diff --git a/.buildkite/pipelines/es_snapshots/build.yml b/.buildkite/pipelines/es_snapshots/build.yml new file mode 100644 index 0000000000000..2bc555de8bf5d --- /dev/null +++ b/.buildkite/pipelines/es_snapshots/build.yml @@ -0,0 +1,5 @@ +steps: + - command: .buildkite/scripts/steps/es_snapshots/build.sh + label: Build ES Snapshot + agents: + queue: c2-8 diff --git a/.buildkite/pipelines/es_snapshots/promote.yml b/.buildkite/pipelines/es_snapshots/promote.yml new file mode 100644 index 0000000000000..5a003321246a1 --- /dev/null +++ b/.buildkite/pipelines/es_snapshots/promote.yml @@ -0,0 +1,12 @@ +steps: + - block: 'Promote' + prompt: "Enter the details for the snapshot you'd like to promote" + if: "build.env('ES_SNAPSHOT_MANIFEST') == null" + # Later, this could be a dropdown dynamically filled with recent builds + fields: + - text: 'ES_SNAPSHOT_MANIFEST' + key: 'ES_SNAPSHOT_MANIFEST' + hint: 'URL pointing to the manifest to promote' + required: true + - label: Promote Snapshot + command: .buildkite/scripts/steps/es_snapshots/promote.sh diff --git a/.buildkite/pipelines/es_snapshots/verify.yml b/.buildkite/pipelines/es_snapshots/verify.yml new file mode 100755 index 0000000000000..f67de4819c23a --- /dev/null +++ b/.buildkite/pipelines/es_snapshots/verify.yml @@ -0,0 +1,102 @@ +env: + IGNORE_SHIP_CI_STATS_ERROR: 'true' +steps: + - block: 'Verify' + prompt: "Enter the details for the snapshot you'd like to verify" + if: "build.env('ES_SNAPSHOT_MANIFEST') == null" + # Later, this could be a dropdown dynamically filled with recent builds + fields: + - text: 'ES_SNAPSHOT_MANIFEST' + key: 'ES_SNAPSHOT_MANIFEST' + hint: 'URL pointing to the manifest to promote' + required: true + + - command: .buildkite/scripts/lifecycle/pre_build.sh + label: Pre-Build + + - wait + + - command: .buildkite/scripts/steps/build_kibana.sh + label: Build Kibana Distribution and Plugins + agents: + queue: c2-8 + key: build + if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''" + + - command: .buildkite/scripts/steps/functional/xpack_cigroup.sh + label: 'Default CI Group' + parallelism: 13 + agents: + queue: ci-group-6 + artifact_paths: target/junit/**/*.xml + depends_on: build + key: default-cigroup + retry: + automatic: + - exit_status: '*' + limit: 1 + + - command: CI_GROUP=Docker .buildkite/scripts/steps/functional/xpack_cigroup.sh + label: 'Docker CI Group' + agents: + queue: ci-group-6 + artifact_paths: target/junit/**/*.xml + depends_on: build + key: default-cigroup-docker + retry: + automatic: + - exit_status: '*' + limit: 1 + + - command: .buildkite/scripts/steps/functional/oss_cigroup.sh + label: 'OSS CI Group' + parallelism: 12 + agents: + queue: ci-group-4d + artifact_paths: target/junit/**/*.xml + depends_on: build + key: oss-cigroup + retry: + automatic: + - exit_status: '*' + limit: 1 + + - command: .buildkite/scripts/steps/test/jest_integration.sh + label: 'Jest Integration Tests' + agents: + queue: jest + artifact_paths: target/junit/**/*.xml + key: jest-integration + retry: + automatic: + - exit_status: '*' + limit: 1 + + - command: .buildkite/scripts/steps/test/api_integration.sh + label: 'API Integration Tests' + agents: + queue: jest + artifact_paths: target/junit/**/*.xml + key: api-integration + + - command: .buildkite/scripts/steps/es_snapshots/trigger_promote.sh + label: Trigger promotion + depends_on: + - default-cigroup + - default-cigroup-docker + - oss-cigroup + - jest-integration + - api-integration + + - wait: ~ + continue_on_failure: true + + - plugins: + - junit-annotate#v1.9.0: + artifacts: target/junit/**/*.xml + + - wait: ~ + continue_on_failure: true + + - command: .buildkite/scripts/lifecycle/post_build.sh + label: Post-Build diff --git a/.buildkite/scripts/build_kibana_plugins.sh b/.buildkite/scripts/build_kibana_plugins.sh old mode 100644 new mode 100755 diff --git a/.buildkite/scripts/download_build_artifacts.sh b/.buildkite/scripts/download_build_artifacts.sh index 6a6b7246753f6..1e7525fff25ea 100755 --- a/.buildkite/scripts/download_build_artifacts.sh +++ b/.buildkite/scripts/download_build_artifacts.sh @@ -7,8 +7,8 @@ if [[ ! -d "$KIBANA_BUILD_LOCATION/bin" ]]; then cd "$WORKSPACE" - buildkite-agent artifact download kibana-default.tar.gz . - buildkite-agent artifact download kibana-default-plugins.tar.gz . + buildkite-agent artifact download kibana-default.tar.gz . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + buildkite-agent artifact download kibana-default-plugins.tar.gz . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" mkdir -p "$KIBANA_BUILD_LOCATION" tar -xzf kibana-default.tar.gz -C "$KIBANA_BUILD_LOCATION" --strip=1 diff --git a/.buildkite/scripts/lifecycle/pre_command.sh b/.buildkite/scripts/lifecycle/pre_command.sh index b0113e6b16964..759f1e7b4ff9e 100755 --- a/.buildkite/scripts/lifecycle/pre_command.sh +++ b/.buildkite/scripts/lifecycle/pre_command.sh @@ -72,3 +72,8 @@ if [[ "${SKIP_CI_SETUP:-}" != "true" ]]; then source .buildkite/scripts/common/setup_bazel.sh fi fi + +PIPELINE_PRE_COMMAND=${PIPELINE_PRE_COMMAND:-".buildkite/scripts/lifecycle/pipelines/$BUILDKITE_PIPELINE_SLUG/pre_command.sh"} +if [[ -f "$PIPELINE_PRE_COMMAND" ]]; then + source "$PIPELINE_PRE_COMMAND" +fi diff --git a/.buildkite/scripts/steps/build_kibana.sh b/.buildkite/scripts/steps/build_kibana.sh new file mode 100755 index 0000000000000..5896dcac5d444 --- /dev/null +++ b/.buildkite/scripts/steps/build_kibana.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -euo pipefail + +.buildkite/scripts/bootstrap.sh +.buildkite/scripts/build_kibana.sh +.buildkite/scripts/build_kibana_plugins.sh +.buildkite/scripts/post_build_kibana.sh diff --git a/.buildkite/scripts/steps/es_snapshots/bucket_config.js b/.buildkite/scripts/steps/es_snapshots/bucket_config.js new file mode 100644 index 0000000000000..a18d1182c4a89 --- /dev/null +++ b/.buildkite/scripts/steps/es_snapshots/bucket_config.js @@ -0,0 +1,4 @@ +module.exports = { + BASE_BUCKET_DAILY: 'kibana-ci-es-snapshots-daily', + BASE_BUCKET_PERMANENT: 'kibana-ci-es-snapshots-permanent', +}; diff --git a/.buildkite/scripts/steps/es_snapshots/build.sh b/.buildkite/scripts/steps/es_snapshots/build.sh new file mode 100755 index 0000000000000..91b5004594a6d --- /dev/null +++ b/.buildkite/scripts/steps/es_snapshots/build.sh @@ -0,0 +1,101 @@ +#!/bin/bash + +set -euo pipefail + +source .buildkite/scripts/common/util.sh + +echo "--- Cloning Elasticsearch and preparing workspace" + +cd .. +destination="$(pwd)/es-build" +rm -rf "$destination" +mkdir -p "$destination" + +mkdir -p elasticsearch && cd elasticsearch + +export ELASTICSEARCH_BRANCH="${ELASTICSEARCH_BRANCH:-$BUILDKITE_BRANCH}" + +if [[ ! -d .git ]]; then + git init + git remote add origin https://github.com/elastic/elasticsearch.git +fi +git fetch origin --depth 1 "$ELASTICSEARCH_BRANCH" +git reset --hard FETCH_HEAD + +ELASTICSEARCH_GIT_COMMIT="$(git rev-parse HEAD)" +export ELASTICSEARCH_GIT_COMMIT + +ELASTICSEARCH_GIT_COMMIT_SHORT="$(git rev-parse --short HEAD)" +export ELASTICSEARCH_GIT_COMMIT_SHORT + +# These turn off automation in the Elasticsearch repo +export BUILD_NUMBER="" +export JENKINS_URL="" +export BUILD_URL="" +export JOB_NAME="" +export NODE_NAME="" +export DOCKER_BUILDKIT="" + +# Reads the ES_BUILD_JAVA env var out of .ci/java-versions.properties and exports it +export "$(grep '^ES_BUILD_JAVA' .ci/java-versions.properties | xargs)" + +export PATH="$HOME/.java/$ES_BUILD_JAVA/bin:$PATH" +export JAVA_HOME="$HOME/.java/$ES_BUILD_JAVA" + +# The Elasticsearch Dockerfile needs to be built with root privileges, but Docker on our servers is running using a non-root user +# So, let's use docker-in-docker to temporarily create a privileged docker daemon to run `docker build` on +# We have to do this, because there's no `docker build --privileged` or similar + +echo "--- Setting up Docker-in-Docker for Elasticsearch" + +docker rm -f dind || true # If there's an old daemon running that somehow didn't get cleaned up, lets remove it first +CERTS_DIR="$HOME/dind-certs" +rm -rf "$CERTS_DIR" +docker run -d --rm --privileged --name dind --userns host -p 2377:2376 -e DOCKER_TLS_CERTDIR=/certs -v "$CERTS_DIR":/certs docker:dind + +trap "docker rm -f dind" EXIT + +export DOCKER_TLS_VERIFY=true +export DOCKER_CERT_PATH="$CERTS_DIR/client" +export DOCKER_TLS_CERTDIR="$CERTS_DIR" +export DOCKER_HOST=localhost:2377 + +echo "--- Build Elasticsearch" +./gradlew -Dbuild.docker=true assemble --parallel + +echo "--- Create distribution archives" +find distribution -type f \( -name 'elasticsearch-*-*-*-*.tar.gz' -o -name 'elasticsearch-*-*-*-*.zip' \) -not -path '*no-jdk*' -not -path '*build-context*' -exec cp {} "$destination" \; + +ls -alh "$destination" + +echo "--- Create docker image archives" +docker images "docker.elastic.co/elasticsearch/elasticsearch" +docker images "docker.elastic.co/elasticsearch/elasticsearch" --format "{{.Tag}}" | xargs -n1 echo 'docker save docker.elastic.co/elasticsearch/elasticsearch:${0} | gzip > ../es-build/elasticsearch-${0}-docker-image.tar.gz' +docker images "docker.elastic.co/elasticsearch/elasticsearch" --format "{{.Tag}}" | xargs -n1 bash -c 'docker save docker.elastic.co/elasticsearch/elasticsearch:${0} | gzip > ../es-build/elasticsearch-${0}-docker-image.tar.gz' + +echo "--- Create checksums for snapshot files" +cd "$destination" +find ./* -exec bash -c "shasum -a 512 {} > {}.sha512" \; + +cd "$BUILDKITE_BUILD_CHECKOUT_PATH" +node "$(dirname "${0}")/create_manifest.js" "$destination" + +ES_SNAPSHOT_MANIFEST="$(buildkite-agent meta-data get ES_SNAPSHOT_MANIFEST)" + +cat << EOF | buildkite-agent annotate --style "info" + - \`ELASTICSEARCH_BRANCH\` - \`$ELASTICSEARCH_BRANCH\` + - \`ELASTICSEARCH_GIT_COMMIT\` - \`$ELASTICSEARCH_GIT_COMMIT\` + - \`ES_SNAPSHOT_MANIFEST\` - \`$ES_SNAPSHOT_MANIFEST\` + - \`ES_SNAPSHOT_VERSION\` - \`$(buildkite-agent meta-data get ES_SNAPSHOT_VERSION)\` + - \`ES_SNAPSHOT_ID\` - \`$(buildkite-agent meta-data get ES_SNAPSHOT_ID)\` +EOF + +cat << EOF | buildkite-agent pipeline upload +steps: + - trigger: 'kibana-elasticsearch-snapshot-verify' + async: true + build: + env: + ES_SNAPSHOT_MANIFEST: '$ES_SNAPSHOT_MANIFEST' + branch: '$BUILDKITE_BRANCH' +EOF diff --git a/.buildkite/scripts/steps/es_snapshots/create_manifest.js b/.buildkite/scripts/steps/es_snapshots/create_manifest.js new file mode 100644 index 0000000000000..3173737e984e8 --- /dev/null +++ b/.buildkite/scripts/steps/es_snapshots/create_manifest.js @@ -0,0 +1,90 @@ +const fs = require('fs'); +const { execSync } = require('child_process'); +const { BASE_BUCKET_DAILY } = require('./bucket_config.js'); + +(async () => { + console.log('--- Create ES Snapshot Manifest'); + + const destination = process.argv[2] || __dirname + '/test'; + + const ES_BRANCH = process.env.ELASTICSEARCH_BRANCH; + const GIT_COMMIT = process.env.ELASTICSEARCH_GIT_COMMIT; + const GIT_COMMIT_SHORT = process.env.ELASTICSEARCH_GIT_COMMIT_SHORT; + + let VERSION = ''; + let SNAPSHOT_ID = ''; + let DESTINATION = ''; + + const now = new Date(); + + // format: yyyyMMdd-HHmmss + const date = [ + now.getFullYear(), + (now.getMonth() + 1).toString().padStart(2, '0'), + now.getDate().toString().padStart(2, '0'), + '-', + now.getHours().toString().padStart(2, '0'), + now.getMinutes().toString().padStart(2, '0'), + now.getSeconds().toString().padStart(2, '0'), + ].join(''); + + try { + const files = fs.readdirSync(destination); + const manifestEntries = files + .filter((filename) => !filename.match(/.sha512$/)) + .filter((filename) => !filename.match(/.json$/)) + .map((filename) => { + const parts = filename.replace('elasticsearch-oss', 'oss').split('-'); + + VERSION = VERSION || parts[1]; + SNAPSHOT_ID = SNAPSHOT_ID || `${date}_${GIT_COMMIT_SHORT}`; + DESTINATION = DESTINATION || `${VERSION}/archives/${SNAPSHOT_ID}`; + + return { + filename: filename, + checksum: filename + '.sha512', + url: `https://storage.googleapis.com/${BASE_BUCKET_DAILY}/${DESTINATION}/${filename}`, + version: parts[1], + platform: parts[3], + architecture: parts[4].split('.')[0], + license: parts[0] == 'oss' ? 'oss' : 'default', + }; + }); + + const manifest = { + id: SNAPSHOT_ID, + bucket: `${BASE_BUCKET_DAILY}/${DESTINATION}`.toString(), + branch: ES_BRANCH, + sha: GIT_COMMIT, + sha_short: GIT_COMMIT_SHORT, + version: VERSION, + generated: now.toISOString(), + archives: manifestEntries, + }; + + const manifestJSON = JSON.stringify(manifest, null, 2); + fs.writeFileSync(`${destination}/manifest.json`, manifestJSON); + + console.log('Manifest:', manifestJSON); + + execSync( + ` + set -euo pipefail + + echo '--- Upload files to GCS' + cd "${destination}" + gsutil -m cp -r *.* gs://${BASE_BUCKET_DAILY}/${DESTINATION} + cp manifest.json manifest-latest.json + gsutil cp manifest-latest.json gs://${BASE_BUCKET_DAILY}/${VERSION} + + buildkite-agent meta-data set ES_SNAPSHOT_MANIFEST 'https://storage.googleapis.com/${BASE_BUCKET_DAILY}/${DESTINATION}/manifest.json' + buildkite-agent meta-data set ES_SNAPSHOT_VERSION '${VERSION}' + buildkite-agent meta-data set ES_SNAPSHOT_ID '${SNAPSHOT_ID}' + `, + { shell: '/bin/bash' } + ); + } catch (ex) { + console.error(ex); + process.exit(1); + } +})(); diff --git a/.buildkite/scripts/steps/es_snapshots/promote.sh b/.buildkite/scripts/steps/es_snapshots/promote.sh new file mode 100755 index 0000000000000..20f79d1a4e2e4 --- /dev/null +++ b/.buildkite/scripts/steps/es_snapshots/promote.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -euo pipefail + +export ES_SNAPSHOT_MANIFEST="${ES_SNAPSHOT_MANIFEST:-"$(buildkite-agent meta-data get ES_SNAPSHOT_MANIFEST)"}" + +cat << EOF | buildkite-agent annotate --style "info" + This promotion is for the following snapshot manifest: + + $ES_SNAPSHOT_MANIFEST +EOF + +node "$(dirname "${0}")/promote_manifest.js" "$ES_SNAPSHOT_MANIFEST" diff --git a/.buildkite/scripts/steps/es_snapshots/promote_manifest.js b/.buildkite/scripts/steps/es_snapshots/promote_manifest.js new file mode 100644 index 0000000000000..ce14935dd1b84 --- /dev/null +++ b/.buildkite/scripts/steps/es_snapshots/promote_manifest.js @@ -0,0 +1,46 @@ +const fs = require('fs'); +const { execSync } = require('child_process'); +const { BASE_BUCKET_DAILY, BASE_BUCKET_PERMANENT } = require('./bucket_config.js'); + +(async () => { + try { + const MANIFEST_URL = process.argv[2]; + + if (!MANIFEST_URL) { + throw Error('Manifest URL missing'); + } + + const tempDir = fs.mkdtempSync('snapshot-promotion'); + process.chdir(tempDir); + + execSync(`curl '${MANIFEST_URL}' > manifest.json`); + + const manifestJson = fs.readFileSync('manifest.json').toString(); + const manifest = JSON.parse(manifestJson); + const { id, bucket, version } = manifest; + + const manifestPermanentJson = manifestJson + .split(BASE_BUCKET_DAILY) + .join(BASE_BUCKET_PERMANENT) + .split(`${version}/archives/${id}`) + .join(version); // e.g. replaceAll + + fs.writeFileSync('manifest-permanent.json', manifestPermanentJson); + + execSync( + ` + set -euo pipefail + cp manifest.json manifest-latest-verified.json + gsutil cp manifest-latest-verified.json gs://${BASE_BUCKET_DAILY}/${version}/ + rm manifest.json + cp manifest-permanent.json manifest.json + gsutil -m cp -r gs://${bucket}/* gs://${BASE_BUCKET_PERMANENT}/${version}/ + gsutil cp manifest.json gs://${BASE_BUCKET_PERMANENT}/${version}/ + `, + { shell: '/bin/bash' } + ); + } catch (ex) { + console.error(ex); + process.exit(1); + } +})(); diff --git a/.buildkite/scripts/steps/es_snapshots/trigger_promote.sh b/.buildkite/scripts/steps/es_snapshots/trigger_promote.sh new file mode 100644 index 0000000000000..1e8256d8c6645 --- /dev/null +++ b/.buildkite/scripts/steps/es_snapshots/trigger_promote.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -euo pipefail + +# If ES_SNAPSHOT_MANIFEST is set dynamically during the verify job, rather than provided during the trigger, +# such as if you provide it as input during a manual build, +# the ES_SNAPSHOT_MANIFEST env var will be empty in the context of the pipeline. +# So, we'll trigger with a script instead, so that we can ensure ES_SNAPSHOT_MANIFEST is populated. + +export ES_SNAPSHOT_MANIFEST="${ES_SNAPSHOT_MANIFEST:-"$(buildkite-agent meta-data get ES_SNAPSHOT_MANIFEST)"}" + +cat << EOF | buildkite-agent pipeline upload +steps: + - trigger: 'kibana-elasticsearch-snapshot-promote' + async: true + build: + env: + ES_SNAPSHOT_MANIFEST: '$ES_SNAPSHOT_MANIFEST' + branch: '$BUILDKITE_BRANCH' +EOF diff --git a/.buildkite/scripts/steps/functional/oss_cigroup.sh b/.buildkite/scripts/steps/functional/oss_cigroup.sh new file mode 100755 index 0000000000000..b4c643868ff7d --- /dev/null +++ b/.buildkite/scripts/steps/functional/oss_cigroup.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -euo pipefail + +.buildkite/scripts/bootstrap.sh +.buildkite/scripts/download_build_artifacts.sh + +export CI_GROUP=${CI_GROUP:-$((BUILDKITE_PARALLEL_JOB+1))} +export JOB=kibana-oss-ciGroup${CI_GROUP} + +echo "--- OSS CI Group $CI_GROUP" + +node scripts/functional_tests \ + --bail \ + --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ + --include-tag "ciGroup$CI_GROUP" diff --git a/.buildkite/scripts/steps/functional/xpack_cigroup.sh b/.buildkite/scripts/steps/functional/xpack_cigroup.sh new file mode 100755 index 0000000000000..e6ef0bba87904 --- /dev/null +++ b/.buildkite/scripts/steps/functional/xpack_cigroup.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -euo pipefail + +.buildkite/scripts/bootstrap.sh +.buildkite/scripts/download_build_artifacts.sh + +export CI_GROUP=${CI_GROUP:-$((BUILDKITE_PARALLEL_JOB+1))} +export JOB=kibana-default-ciGroup${CI_GROUP} + +echo "--- Default CI Group $CI_GROUP" + +cd "$XPACK_DIR" + +node scripts/functional_tests \ + --bail \ + --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ + --include-tag "ciGroup$CI_GROUP" diff --git a/.buildkite/scripts/steps/test/api_integration.sh b/.buildkite/scripts/steps/test/api_integration.sh new file mode 100755 index 0000000000000..4bf1ed1406ac5 --- /dev/null +++ b/.buildkite/scripts/steps/test/api_integration.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -euo pipefail + +.buildkite/scripts/bootstrap.sh + +echo '--- API Integration Tests' +node scripts/functional_tests \ + --config test/api_integration/config.js \ + --bail \ + --debug diff --git a/.buildkite/scripts/steps/test/jest.sh b/.buildkite/scripts/steps/test/jest.sh new file mode 100755 index 0000000000000..ab9be759b43a5 --- /dev/null +++ b/.buildkite/scripts/steps/test/jest.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -euo pipefail + +.buildkite/scripts/bootstrap.sh + +echo '--- Jest' +node scripts/jest --ci --verbose --maxWorkers=13 diff --git a/.buildkite/scripts/steps/test/jest_integration.sh b/.buildkite/scripts/steps/test/jest_integration.sh new file mode 100755 index 0000000000000..eb243e55670e3 --- /dev/null +++ b/.buildkite/scripts/steps/test/jest_integration.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -euo pipefail + +.buildkite/scripts/bootstrap.sh + +echo '--- Jest Integration Tests' +node scripts/jest_integration --ci --verbose diff --git a/.ci/es-snapshots/Jenkinsfile_trigger_build_es b/.ci/es-snapshots/Jenkinsfile_trigger_build_es index 186917e967824..d4e59ca3e411b 100644 --- a/.ci/es-snapshots/Jenkinsfile_trigger_build_es +++ b/.ci/es-snapshots/Jenkinsfile_trigger_build_es @@ -1,10 +1,7 @@ #!/bin/groovy -if (!params.branches_yaml) { - error "'branches_yaml' parameter must be specified" -} - -def branches = readYaml text: params.branches_yaml +// Only run this pipeline for 6.8. Higher branches are now running in Buildkite. +def branches = ['6.8'] branches.each { branch -> build( diff --git a/.eslintignore b/.eslintignore index 66684fbcd52e6..4c6618779bbda 100644 --- a/.eslintignore +++ b/.eslintignore @@ -21,8 +21,6 @@ snapshots.js # plugin overrides /src/core/lib/kbn_internal_native_observable /src/plugins/data/common/es_query/kuery/ast/_generated_/** -/src/plugins/vis_type_timelion/common/_generated_/** -/x-pack/plugins/apm/e2e/tmp/* /x-pack/plugins/canvas/canvas_plugin /x-pack/plugins/canvas/shareable_runtime/build /x-pack/plugins/canvas/storybook/build diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 381fad404ca73..48674bc5444ff 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -16,22 +16,22 @@ /src/plugins/discover/ @elastic/kibana-data-discovery /x-pack/plugins/discover_enhanced/ @elastic/kibana-data-discovery /test/functional/apps/discover/ @elastic/kibana-data-discovery +/x-pack/plugins/graph/ @elastic/kibana-data-discovery +/x-pack/test/functional/apps/graph @elastic/kibana-data-discovery # Vis Editors /x-pack/plugins/lens/ @elastic/kibana-vis-editors -/x-pack/plugins/graph/ @elastic/kibana-vis-editors /src/plugins/advanced_settings/ @elastic/kibana-vis-editors /src/plugins/charts/ @elastic/kibana-vis-editors /src/plugins/management/ @elastic/kibana-vis-editors /src/plugins/kibana_legacy/ @elastic/kibana-vis-editors -/src/plugins/timelion/ @elastic/kibana-vis-editors /src/plugins/vis_default_editor/ @elastic/kibana-vis-editors -/src/plugins/vis_type_metric/ @elastic/kibana-vis-editors -/src/plugins/vis_type_table/ @elastic/kibana-vis-editors -/src/plugins/vis_type_tagcloud/ @elastic/kibana-vis-editors -/src/plugins/vis_type_timelion/ @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_type_timeseries/ @elastic/kibana-vis-editors -/src/plugins/vis_type_vega/ @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 @@ -40,6 +40,8 @@ /src/plugins/chart_expressions/expression_tagcloud/ @elastic/kibana-vis-editors /src/plugins/url_forwarding/ @elastic/kibana-vis-editors /packages/kbn-tinymath/ @elastic/kibana-vis-editors +/x-pack/test/functional/apps/lens @elastic/kibana-vis-editors +/test/functional/apps/visualize/ @elastic/kibana-vis-editors # Application Services /examples/bfetch_explorer/ @elastic/kibana-app-services @@ -123,8 +125,6 @@ /x-pack/test/api_integration/apis/uptime @elastic/uptime # Client Side Monitoring / Uptime (lives in APM directories but owned by Uptime) -/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm @elastic/uptime -/x-pack/plugins/apm/e2e/cypress/integration/csm_dashboard.feature @elastic/uptime /x-pack/plugins/apm/public/application/uxApp.tsx @elastic/uptime /x-pack/plugins/apm/public/components/app/RumDashboard @elastic/uptime /x-pack/plugins/apm/server/lib/rum_client @elastic/uptime @@ -146,6 +146,7 @@ /src/plugins/vis_type_markdown/ @elastic/kibana-presentation /src/plugins/presentation_util/ @elastic/kibana-presentation /test/functional/apps/dashboard/ @elastic/kibana-presentation +/test/functional/apps/dashboard_elements/ @elastic/kibana-presentation /x-pack/plugins/canvas/ @elastic/kibana-presentation /x-pack/plugins/dashboard_enhanced/ @elastic/kibana-presentation /x-pack/test/functional/apps/canvas/ @elastic/kibana-presentation @@ -249,7 +250,6 @@ /src/plugins/kibana_overview/ @elastic/kibana-core /x-pack/plugins/global_search_bar/ @elastic/kibana-core #CC# /src/core/server/csp/ @elastic/kibana-core -#CC# /src/plugins/legacy_export/ @elastic/kibana-core #CC# /src/plugins/xpack_legacy/ @elastic/kibana-core #CC# /src/plugins/saved_objects/ @elastic/kibana-core #CC# /x-pack/plugins/cloud/ @elastic/kibana-core diff --git a/.github/paths-labeller.yml b/.github/paths-labeller.yml index 81d57be9b2d95..37414be6973ad 100644 --- a/.github/paths-labeller.yml +++ b/.github/paths-labeller.yml @@ -15,7 +15,6 @@ - "x-pack/test/fleet_api_integration/**/*.*" - "Team:uptime": - "x-pack/plugins/uptime/**/*.*" - - "x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/*.*" - "x-pack/plugins/apm/public/application/csmApp.tsx" - "x-pack/plugins/apm/public/components/app/RumDashboard/**/*.*" - "x-pack/plugins/apm/public/components/app/RumDashboard/*.*" diff --git a/.github/workflows/sync-main-branch.yml b/.github/workflows/sync-main-branch.yml index 63465602e8436..971ff0b9a6351 100644 --- a/.github/workflows/sync-main-branch.yml +++ b/.github/workflows/sync-main-branch.yml @@ -9,6 +9,7 @@ jobs: sync_latest_from_upstream: runs-on: ubuntu-latest name: Sync latest commits from master branch + if: github.repository == 'elastic/kibana' steps: - name: Checkout target repo diff --git a/.gitignore b/.gitignore index 4f77a6e450c4b..32c77b20ef204 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /.chromium .DS_Store .node_binaries +/.beats .native_modules node_modules !/src/dev/npm/integration_tests/__fixtures__/fixture1/node_modules diff --git a/.i18nrc.json b/.i18nrc.json index f38d6b8faae7e..08783349ec64e 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -56,15 +56,15 @@ "server": "src/legacy/server", "statusPage": "src/legacy/core_plugins/status_page", "telemetry": ["src/plugins/telemetry", "src/plugins/telemetry_management_section"], - "timelion": ["src/plugins/timelion", "src/plugins/vis_type_timelion"], + "timelion": ["src/plugins/vis_types/timelion"], "uiActions": "src/plugins/ui_actions", "visDefaultEditor": "src/plugins/vis_default_editor", "visTypeMarkdown": "src/plugins/vis_type_markdown", - "visTypeMetric": "src/plugins/vis_type_metric", - "visTypeTable": "src/plugins/vis_type_table", - "visTypeTagCloud": "src/plugins/vis_type_tagcloud", + "visTypeMetric": "src/plugins/vis_types/metric", + "visTypeTable": "src/plugins/vis_types/table", + "visTypeTagCloud": "src/plugins/vis_types/tagcloud", "visTypeTimeseries": "src/plugins/vis_type_timeseries", - "visTypeVega": "src/plugins/vis_type_vega", + "visTypeVega": "src/plugins/vis_types/vega", "visTypeVislib": "src/plugins/vis_types/vislib", "visTypeXy": "src/plugins/vis_types/xy", "visTypePie": "src/plugins/vis_types/pie", diff --git a/api_docs/actions.json b/api_docs/actions.json index fcad94e028b1e..6e49272bcb67a 100644 --- a/api_docs/actions.json +++ b/api_docs/actions.json @@ -463,7 +463,7 @@ "children": [ { "parentPluginId": "actions", - "id": "def-server.options", + "id": "def-server.ActionType.executor.$1", "type": "Object", "tags": [], "label": "options", @@ -653,7 +653,7 @@ "label": "ActionParamsType", "description": [], "signature": [ - "{ readonly to: string[]; readonly message: string; readonly cc: string[]; readonly bcc: string[]; readonly subject: string; readonly kibanaFooterLink: Readonly<{} & { path: string; text: string; }>; }" + "{ readonly to: string[]; readonly message: string; readonly subject: string; readonly cc: string[]; readonly bcc: string[]; readonly kibanaFooterLink: Readonly<{} & { path: string; text: string; }>; }" ], "path": "x-pack/plugins/actions/server/builtin_action_types/email.ts", "deprecated": false, @@ -875,7 +875,7 @@ "section": "def-common.ActionType", "text": "ActionType" }, - "[]>; isActionTypeEnabled: (actionTypeId: string, options?: { notifyUsage: boolean; }) => boolean; }" + "[]>; isActionTypeEnabled: (actionTypeId: string, options?: { notifyUsage: boolean; }) => boolean; isPreconfigured: (connectorId: string) => boolean; }" ], "path": "x-pack/plugins/actions/server/index.ts", "deprecated": false, @@ -1091,6 +1091,36 @@ } ], "returnComment": [] + }, + { + "parentPluginId": "actions", + "id": "def-server.PluginSetupContract.isPreconfiguredConnector", + "type": "Function", + "tags": [], + "label": "isPreconfiguredConnector", + "description": [], + "signature": [ + "(connectorId: string) => boolean" + ], + "path": "x-pack/plugins/actions/server/plugin.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "actions", + "id": "def-server.PluginSetupContract.isPreconfiguredConnector.$1", + "type": "string", + "tags": [], + "label": "connectorId", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/actions/server/plugin.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] } ], "lifecycle": "setup", @@ -1135,7 +1165,7 @@ }, { "parentPluginId": "actions", - "id": "def-server.PluginStartContract.isActionTypeEnabled.$2.options", + "id": "def-server.PluginStartContract.isActionTypeEnabled.$2", "type": "Object", "tags": [], "label": "options", @@ -1145,7 +1175,7 @@ "children": [ { "parentPluginId": "actions", - "id": "def-server.PluginStartContract.isActionTypeEnabled.$2.options.notifyUsage", + "id": "def-server.PluginStartContract.isActionTypeEnabled.$2.notifyUsage", "type": "boolean", "tags": [], "label": "notifyUsage", @@ -1201,7 +1231,7 @@ }, { "parentPluginId": "actions", - "id": "def-server.PluginStartContract.isActionExecutable.$3.options", + "id": "def-server.PluginStartContract.isActionExecutable.$3", "type": "Object", "tags": [], "label": "options", @@ -1211,7 +1241,7 @@ "children": [ { "parentPluginId": "actions", - "id": "def-server.PluginStartContract.isActionExecutable.$3.options.notifyUsage", + "id": "def-server.PluginStartContract.isActionExecutable.$3.notifyUsage", "type": "boolean", "tags": [], "label": "notifyUsage", @@ -1248,7 +1278,7 @@ "section": "def-server.ActionsClient", "text": "ActionsClient" }, - ", \"get\" | \"delete\" | \"create\" | \"update\" | \"execute\" | \"getAll\" | \"getBulk\" | \"enqueueExecution\" | \"ephemeralEnqueuedExecution\" | \"listTypes\" | \"isActionTypeEnabled\">>" + ", \"get\" | \"delete\" | \"create\" | \"update\" | \"execute\" | \"getAll\" | \"getBulk\" | \"enqueueExecution\" | \"ephemeralEnqueuedExecution\" | \"listTypes\" | \"isActionTypeEnabled\" | \"isPreconfigured\">>" ], "path": "x-pack/plugins/actions/server/plugin.ts", "deprecated": false, @@ -1818,6 +1848,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "actions", + "id": "def-common.INTERNAL_BASE_ACTION_API_PATH", + "type": "string", + "tags": [], + "label": "INTERNAL_BASE_ACTION_API_PATH", + "description": [], + "signature": [ + "\"/internal/actions\"" + ], + "path": "x-pack/plugins/actions/common/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "actions", "id": "def-common.RewriteRequestCase", @@ -1842,7 +1886,7 @@ "children": [ { "parentPluginId": "actions", - "id": "def-common.requested", + "id": "def-common.RewriteRequestCase.$1", "type": "Object", "tags": [], "label": "requested", @@ -1888,7 +1932,7 @@ "children": [ { "parentPluginId": "actions", - "id": "def-common.responded", + "id": "def-common.RewriteResponseCase.$1", "type": "Uncategorized", "tags": [], "label": "responded", diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index 64b75e17fd865..4a46ce999322e 100644 --- a/api_docs/actions.mdx +++ b/api_docs/actions.mdx @@ -18,7 +18,7 @@ Contact [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting- | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 119 | 0 | 119 | 7 | +| 122 | 0 | 122 | 7 | ## Server diff --git a/api_docs/advanced_settings.json b/api_docs/advanced_settings.json index adc589a5c88d2..ba157c8326940 100644 --- a/api_docs/advanced_settings.json +++ b/api_docs/advanced_settings.json @@ -132,7 +132,7 @@ "children": [ { "parentPluginId": "advancedSettings", - "id": "def-public.id", + "id": "def-public.ComponentRegistry.setup.register.$1", "type": "CompoundType", "tags": [], "label": "id", @@ -145,7 +145,7 @@ }, { "parentPluginId": "advancedSettings", - "id": "def-public.component", + "id": "def-public.ComponentRegistry.setup.register.$2", "type": "CompoundType", "tags": [], "label": "component", @@ -158,7 +158,7 @@ }, { "parentPluginId": "advancedSettings", - "id": "def-public.allowOverride", + "id": "def-public.ComponentRegistry.setup.register.$3", "type": "boolean", "tags": [], "label": "allowOverride", @@ -209,7 +209,7 @@ "children": [ { "parentPluginId": "advancedSettings", - "id": "def-public.id", + "id": "def-public.ComponentRegistry.start.get.$1", "type": "CompoundType", "tags": [], "label": "id", @@ -251,7 +251,7 @@ "children": [ { "parentPluginId": "advancedSettings", - "id": "def-public.props", + "id": "def-public.LazyField.$1", "type": "Uncategorized", "tags": [], "label": "props", diff --git a/api_docs/advanced_settings.mdx b/api_docs/advanced_settings.mdx index ae48f0931f67e..99a905767621a 100644 --- a/api_docs/advanced_settings.mdx +++ b/api_docs/advanced_settings.mdx @@ -12,7 +12,7 @@ import advancedSettingsObj from './advanced_settings.json'; -Contact [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/alerting.json b/api_docs/alerting.json index 3e5ad6e61c2e0..a851387510423 100644 --- a/api_docs/alerting.json +++ b/api_docs/alerting.json @@ -24,7 +24,7 @@ "section": "def-common.Alert", "text": "Alert" }, - ", \"enabled\" | \"id\" | \"name\" | \"params\" | \"actions\" | \"throttle\" | \"tags\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">) => string | ", + ", \"enabled\" | \"id\" | \"name\" | \"tags\" | \"params\" | \"actions\" | \"throttle\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">) => string | ", "JsonObject" ], "path": "x-pack/plugins/alerting/public/alert_navigation_registry/types.ts", @@ -35,13 +35,13 @@ "children": [ { "parentPluginId": "alerting", - "id": "def-public.alert", + "id": "def-public.AlertNavigationHandler.$1", "type": "Object", "tags": [], "label": "alert", "description": [], "signature": [ - "{ enabled: boolean; id: string; name: string; params: never; actions: ", + "{ enabled: boolean; id: string; name: string; tags: string[]; params: never; actions: ", { "pluginId": "alerting", "scope": "common", @@ -49,7 +49,7 @@ "section": "def-common.AlertAction", "text": "AlertAction" }, - "[]; throttle: string | null; tags: string[]; alertTypeId: string; consumer: string; schedule: ", + "[]; throttle: string | null; alertTypeId: string; consumer: string; schedule: ", { "pluginId": "alerting", "scope": "common", @@ -1008,7 +1008,7 @@ "section": "def-common.Alert", "text": "Alert" }, - ", \"enabled\" | \"id\" | \"name\" | \"params\" | \"actions\" | \"throttle\" | \"tags\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">, \"enabled\" | \"name\" | \"actions\" | \"throttle\" | \"tags\" | \"consumer\" | \"schedule\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"notifyWhen\"> & { producer: string; ruleTypeId: string; ruleTypeName: string; }" + ", \"enabled\" | \"id\" | \"name\" | \"tags\" | \"params\" | \"actions\" | \"throttle\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">, \"enabled\" | \"name\" | \"tags\" | \"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 @@ -1425,7 +1425,7 @@ "children": [ { "parentPluginId": "alerting", - "id": "def-server.options", + "id": "def-server.AlertType.executor.$1", "type": "Object", "tags": [], "label": "options", @@ -1607,7 +1607,7 @@ "section": "def-common.Alert", "text": "Alert" }, - ", \"enabled\" | \"id\" | \"name\" | \"params\" | \"actions\" | \"throttle\" | \"tags\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">[]" + ", \"enabled\" | \"id\" | \"name\" | \"tags\" | \"params\" | \"actions\" | \"throttle\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">[]" ], "path": "x-pack/plugins/alerting/server/rules_client/rules_client.ts", "deprecated": false @@ -2068,7 +2068,7 @@ "section": "def-common.Alert", "text": "Alert" }, - ", \"enabled\" | \"name\" | \"params\" | \"actions\" | \"throttle\" | \"tags\" | \"apiKey\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">>" + ", \"enabled\" | \"name\" | \"tags\" | \"params\" | \"actions\" | \"throttle\" | \"apiKey\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">>" ], "path": "x-pack/plugins/alerting/server/types.ts", "deprecated": false, @@ -2102,7 +2102,7 @@ "label": "RulesClient", "description": [], "signature": [ - "{ get: = never>({ id, }: { id: string; }) => Promise = never>({ id, includeLegacyId, }: { id: string; includeLegacyId?: boolean | undefined; }) => Promise, \"enabled\" | \"id\" | \"name\" | \"params\" | \"actions\" | \"throttle\" | \"tags\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">>; delete: ({ id }: { id: string; }) => Promise<{}>; create: = never>({ data, options, }: ", + ", \"enabled\" | \"id\" | \"name\" | \"tags\" | \"params\" | \"actions\" | \"throttle\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\"> | Pick<", + "AlertWithLegacyId", + ", \"enabled\" | \"id\" | \"name\" | \"tags\" | \"params\" | \"actions\" | \"throttle\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\" | \"legacyId\">>; delete: ({ id }: { id: string; }) => Promise<{}>; create: = never>({ data, options, }: ", "CreateOptions", ") => Promise, \"enabled\" | \"id\" | \"name\" | \"params\" | \"actions\" | \"throttle\" | \"tags\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">>; find: = never>({ options: { fields, ...options }, }?: { options?: ", + ", \"enabled\" | \"id\" | \"name\" | \"tags\" | \"params\" | \"actions\" | \"throttle\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">>; find: = never>({ options: { fields, ...options }, }?: { options?: ", "FindOptions", " | undefined; }) => Promise<", { @@ -3993,7 +3995,7 @@ "section": "def-common.Alert", "text": "Alert" }, - ", \"enabled\" | \"id\" | \"name\" | \"params\" | \"actions\" | \"throttle\" | \"tags\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\"> & Pick<", + ", \"enabled\" | \"id\" | \"name\" | \"tags\" | \"params\" | \"actions\" | \"throttle\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\"> & Pick<", { "pluginId": "core", "scope": "server", @@ -4015,7 +4017,7 @@ "label": "SanitizedAlert", "description": [], "signature": [ - "{ enabled: boolean; id: string; name: string; params: Params; actions: ", + "{ enabled: boolean; id: string; name: string; tags: string[]; params: Params; actions: ", { "pluginId": "alerting", "scope": "common", @@ -4023,7 +4025,7 @@ "section": "def-common.AlertAction", "text": "AlertAction" }, - "[]; throttle: string | null; tags: string[]; alertTypeId: string; consumer: string; schedule: ", + "[]; throttle: string | null; alertTypeId: string; consumer: string; schedule: ", { "pluginId": "alerting", "scope": "common", @@ -4061,7 +4063,7 @@ "section": "def-common.Alert", "text": "Alert" }, - ", \"enabled\" | \"id\" | \"name\" | \"params\" | \"actions\" | \"throttle\" | \"tags\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">, \"enabled\" | \"name\" | \"actions\" | \"throttle\" | \"tags\" | \"consumer\" | \"schedule\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"notifyWhen\"> & { producer: string; ruleTypeId: string; ruleTypeName: string; }" + ", \"enabled\" | \"id\" | \"name\" | \"tags\" | \"params\" | \"actions\" | \"throttle\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">, \"enabled\" | \"name\" | \"tags\" | \"actions\" | \"throttle\" | \"consumer\" | \"schedule\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"notifyWhen\"> & { producer: string; ruleTypeId: string; ruleTypeName: string; }" ], "path": "x-pack/plugins/alerting/common/alert.ts", "deprecated": false, diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index 801d8fa58d83a..845c2c53ff7fa 100644 --- a/api_docs/alerting.mdx +++ b/api_docs/alerting.mdx @@ -18,7 +18,7 @@ Contact [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting- | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 248 | 0 | 240 | 16 | +| 248 | 0 | 240 | 17 | ## Client diff --git a/api_docs/apm.json b/api_docs/apm.json index 45b7a2b67d108..4ad469df91383 100644 --- a/api_docs/apm.json +++ b/api_docs/apm.json @@ -186,7 +186,7 @@ "APMPluginSetupDependencies", ", \"data\" | \"security\" | \"home\" | \"features\" | \"fleet\" | \"ml\" | \"actions\" | \"usageCollection\" | \"apmOss\" | \"licensing\" | \"observability\" | \"ruleRegistry\" | \"spaces\" | \"cloud\" | \"taskManager\" | \"alerting\">) => { config$: ", "Observable", - "<{ 'apm_oss.transactionIndices': string; 'apm_oss.spanIndices': string; 'apm_oss.errorIndices': string; 'apm_oss.metricsIndices': string; 'apm_oss.sourcemapIndices': string; 'apm_oss.onboardingIndices': string; 'apm_oss.indexPattern': string; 'xpack.apm.serviceMapEnabled': boolean; 'xpack.apm.serviceMapFingerprintBucketSize': number; 'xpack.apm.serviceMapTraceIdBucketSize': number; 'xpack.apm.serviceMapFingerprintGlobalBucketSize': number; 'xpack.apm.serviceMapTraceIdGlobalBucketSize': number; 'xpack.apm.serviceMapMaxTracesPerRequest': number; 'xpack.apm.ui.enabled': boolean; 'xpack.apm.maxServiceEnvironments': number; 'xpack.apm.maxServiceSelection': number; 'xpack.apm.ui.maxTraceItems': number; 'xpack.apm.ui.transactionGroupBucketSize': number; 'xpack.apm.autocreateApmIndexPattern': boolean; 'xpack.apm.telemetryCollectionEnabled': boolean; 'xpack.apm.searchAggregatedTransactions': ", + "<{ 'apm_oss.transactionIndices': string; 'apm_oss.spanIndices': string; 'apm_oss.errorIndices': string; 'apm_oss.metricsIndices': string; 'apm_oss.sourcemapIndices': string; 'apm_oss.onboardingIndices': string; 'xpack.apm.serviceMapEnabled': boolean; 'xpack.apm.serviceMapFingerprintBucketSize': number; 'xpack.apm.serviceMapTraceIdBucketSize': number; 'xpack.apm.serviceMapFingerprintGlobalBucketSize': number; 'xpack.apm.serviceMapTraceIdGlobalBucketSize': number; 'xpack.apm.serviceMapMaxTracesPerRequest': number; 'xpack.apm.ui.enabled': boolean; 'xpack.apm.maxServiceEnvironments': number; 'xpack.apm.maxServiceSelection': number; 'xpack.apm.ui.maxTraceItems': number; 'xpack.apm.ui.transactionGroupBucketSize': number; 'xpack.apm.autocreateApmIndexPattern': boolean; 'xpack.apm.telemetryCollectionEnabled': boolean; 'xpack.apm.searchAggregatedTransactions': ", "SearchAggregatedTransactionSetting", "; 'xpack.apm.metricsInterval': number; 'xpack.apm.agent.migrations.enabled': boolean; }>; getApmIndices: () => Promise<", "ApmIndicesConfig", @@ -327,7 +327,7 @@ "signature": [ "(apmOssConfig: Readonly<{} & { enabled: boolean; transactionIndices: string; spanIndices: string; errorIndices: string; metricsIndices: string; sourcemapIndices: string; onboardingIndices: string; indexPattern: string; fleetMode: boolean; }>, apmConfig: Readonly<{} & { enabled: boolean; serviceMapEnabled: boolean; serviceMapFingerprintBucketSize: number; serviceMapTraceIdBucketSize: number; serviceMapFingerprintGlobalBucketSize: number; serviceMapTraceIdGlobalBucketSize: number; serviceMapMaxTracesPerRequest: number; autocreateApmIndexPattern: boolean; ui: Readonly<{} & { enabled: boolean; transactionGroupBucketSize: number; maxTraceItems: number; }>; searchAggregatedTransactions: ", "SearchAggregatedTransactionSetting", - "; telemetryCollectionEnabled: boolean; metricsInterval: number; maxServiceEnvironments: number; maxServiceSelection: number; profilingEnabled: boolean; agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; }>) => { 'apm_oss.transactionIndices': string; 'apm_oss.spanIndices': string; 'apm_oss.errorIndices': string; 'apm_oss.metricsIndices': string; 'apm_oss.sourcemapIndices': string; 'apm_oss.onboardingIndices': string; 'apm_oss.indexPattern': string; 'xpack.apm.serviceMapEnabled': boolean; 'xpack.apm.serviceMapFingerprintBucketSize': number; 'xpack.apm.serviceMapTraceIdBucketSize': number; 'xpack.apm.serviceMapFingerprintGlobalBucketSize': number; 'xpack.apm.serviceMapTraceIdGlobalBucketSize': number; 'xpack.apm.serviceMapMaxTracesPerRequest': number; 'xpack.apm.ui.enabled': boolean; 'xpack.apm.maxServiceEnvironments': number; 'xpack.apm.maxServiceSelection': number; 'xpack.apm.ui.maxTraceItems': number; 'xpack.apm.ui.transactionGroupBucketSize': number; 'xpack.apm.autocreateApmIndexPattern': boolean; 'xpack.apm.telemetryCollectionEnabled': boolean; 'xpack.apm.searchAggregatedTransactions': ", + "; telemetryCollectionEnabled: boolean; metricsInterval: number; maxServiceEnvironments: number; maxServiceSelection: number; profilingEnabled: boolean; agent: Readonly<{} & { migrations: Readonly<{} & { enabled: boolean; }>; }>; }>) => { 'apm_oss.transactionIndices': string; 'apm_oss.spanIndices': string; 'apm_oss.errorIndices': string; 'apm_oss.metricsIndices': string; 'apm_oss.sourcemapIndices': string; 'apm_oss.onboardingIndices': string; 'xpack.apm.serviceMapEnabled': boolean; 'xpack.apm.serviceMapFingerprintBucketSize': number; 'xpack.apm.serviceMapTraceIdBucketSize': number; 'xpack.apm.serviceMapFingerprintGlobalBucketSize': number; 'xpack.apm.serviceMapTraceIdGlobalBucketSize': number; 'xpack.apm.serviceMapMaxTracesPerRequest': number; 'xpack.apm.ui.enabled': boolean; 'xpack.apm.maxServiceEnvironments': number; 'xpack.apm.maxServiceSelection': number; 'xpack.apm.ui.maxTraceItems': number; 'xpack.apm.ui.transactionGroupBucketSize': number; 'xpack.apm.autocreateApmIndexPattern': boolean; 'xpack.apm.telemetryCollectionEnabled': boolean; 'xpack.apm.searchAggregatedTransactions': ", "SearchAggregatedTransactionSetting", "; 'xpack.apm.metricsInterval': number; 'xpack.apm.agent.migrations.enabled': boolean; }" ], @@ -434,7 +434,7 @@ "label": "config", "description": [], "signature": [ - "{ 'apm_oss.transactionIndices': string; 'apm_oss.spanIndices': string; 'apm_oss.errorIndices': string; 'apm_oss.metricsIndices': string; 'apm_oss.sourcemapIndices': string; 'apm_oss.onboardingIndices': string; 'apm_oss.indexPattern': string; 'xpack.apm.serviceMapEnabled': boolean; 'xpack.apm.serviceMapFingerprintBucketSize': number; 'xpack.apm.serviceMapTraceIdBucketSize': number; 'xpack.apm.serviceMapFingerprintGlobalBucketSize': number; 'xpack.apm.serviceMapTraceIdGlobalBucketSize': number; 'xpack.apm.serviceMapMaxTracesPerRequest': number; 'xpack.apm.ui.enabled': boolean; 'xpack.apm.maxServiceEnvironments': number; 'xpack.apm.maxServiceSelection': number; 'xpack.apm.ui.maxTraceItems': number; 'xpack.apm.ui.transactionGroupBucketSize': number; 'xpack.apm.autocreateApmIndexPattern': boolean; 'xpack.apm.telemetryCollectionEnabled': boolean; 'xpack.apm.searchAggregatedTransactions': ", + "{ 'apm_oss.transactionIndices': string; 'apm_oss.spanIndices': string; 'apm_oss.errorIndices': string; 'apm_oss.metricsIndices': string; 'apm_oss.sourcemapIndices': string; 'apm_oss.onboardingIndices': string; 'xpack.apm.serviceMapEnabled': boolean; 'xpack.apm.serviceMapFingerprintBucketSize': number; 'xpack.apm.serviceMapTraceIdBucketSize': number; 'xpack.apm.serviceMapFingerprintGlobalBucketSize': number; 'xpack.apm.serviceMapTraceIdGlobalBucketSize': number; 'xpack.apm.serviceMapMaxTracesPerRequest': number; 'xpack.apm.ui.enabled': boolean; 'xpack.apm.maxServiceEnvironments': number; 'xpack.apm.maxServiceSelection': number; 'xpack.apm.ui.maxTraceItems': number; 'xpack.apm.ui.transactionGroupBucketSize': number; 'xpack.apm.autocreateApmIndexPattern': boolean; 'xpack.apm.telemetryCollectionEnabled': boolean; 'xpack.apm.searchAggregatedTransactions': ", "SearchAggregatedTransactionSetting", "; 'xpack.apm.metricsInterval': number; 'xpack.apm.agent.migrations.enabled': boolean; }" ], @@ -799,7 +799,7 @@ "label": "APMConfig", "description": [], "signature": [ - "{ 'apm_oss.transactionIndices': string; 'apm_oss.spanIndices': string; 'apm_oss.errorIndices': string; 'apm_oss.metricsIndices': string; 'apm_oss.sourcemapIndices': string; 'apm_oss.onboardingIndices': string; 'apm_oss.indexPattern': string; 'xpack.apm.serviceMapEnabled': boolean; 'xpack.apm.serviceMapFingerprintBucketSize': number; 'xpack.apm.serviceMapTraceIdBucketSize': number; 'xpack.apm.serviceMapFingerprintGlobalBucketSize': number; 'xpack.apm.serviceMapTraceIdGlobalBucketSize': number; 'xpack.apm.serviceMapMaxTracesPerRequest': number; 'xpack.apm.ui.enabled': boolean; 'xpack.apm.maxServiceEnvironments': number; 'xpack.apm.maxServiceSelection': number; 'xpack.apm.ui.maxTraceItems': number; 'xpack.apm.ui.transactionGroupBucketSize': number; 'xpack.apm.autocreateApmIndexPattern': boolean; 'xpack.apm.telemetryCollectionEnabled': boolean; 'xpack.apm.searchAggregatedTransactions': ", + "{ 'apm_oss.transactionIndices': string; 'apm_oss.spanIndices': string; 'apm_oss.errorIndices': string; 'apm_oss.metricsIndices': string; 'apm_oss.sourcemapIndices': string; 'apm_oss.onboardingIndices': string; 'xpack.apm.serviceMapEnabled': boolean; 'xpack.apm.serviceMapFingerprintBucketSize': number; 'xpack.apm.serviceMapTraceIdBucketSize': number; 'xpack.apm.serviceMapFingerprintGlobalBucketSize': number; 'xpack.apm.serviceMapTraceIdGlobalBucketSize': number; 'xpack.apm.serviceMapMaxTracesPerRequest': number; 'xpack.apm.ui.enabled': boolean; 'xpack.apm.maxServiceEnvironments': number; 'xpack.apm.maxServiceSelection': number; 'xpack.apm.ui.maxTraceItems': number; 'xpack.apm.ui.transactionGroupBucketSize': number; 'xpack.apm.autocreateApmIndexPattern': boolean; 'xpack.apm.telemetryCollectionEnabled': boolean; 'xpack.apm.searchAggregatedTransactions': ", "SearchAggregatedTransactionSetting", "; 'xpack.apm.metricsInterval': number; 'xpack.apm.agent.migrations.enabled': boolean; }" ], @@ -852,18 +852,6 @@ "IndexPatternTitleAndFields", " | undefined; }, ", "APMRouteCreateOptions", - ">; } & { \"GET /api/apm/index_pattern/title\": ", - "ServerRoute", - "<\"GET /api/apm/index_pattern/title\", undefined, ", - { - "pluginId": "apm", - "scope": "server", - "docId": "kibApmPluginApi", - "section": "def-server.APMRouteHandlerResources", - "text": "APMRouteHandlerResources" - }, - ", { indexPatternTitle: string; }, ", - "APMRouteCreateOptions", ">; } & { \"GET /api/apm/environments\": ", "ServerRoute", "<\"GET /api/apm/environments\", ", @@ -1674,7 +1662,7 @@ "section": "def-server.APMRouteHandlerResources", "text": "APMRouteHandlerResources" }, - ", { serviceNodes: { name: string; cpu: number | null; heapMemory: number | null; nonHeapMemory: number | null; threadCount: number | null; }[]; }, ", + ", { serviceNodes: { name: string; cpu: number | null; heapMemory: number | null; hostName: string | null | undefined; nonHeapMemory: number | null; threadCount: number | null; }[]; }, ", "APMRouteCreateOptions", ">; } & { \"GET /api/apm/services\": ", "ServerRoute", @@ -2133,6 +2121,12 @@ "<{ transactionType: ", "StringC", "; }>, ", + "PartialC", + "<{ transactionName: ", + "StringC", + "; }>, ", + "IntersectionC", + "<[", "TypeC", "<{ environment: ", "UnionC", @@ -2162,7 +2156,7 @@ "Type", "; comparisonEnd: ", "Type", - "; }>]>; }>, ", + "; }>]>]>; }>, ", { "pluginId": "apm", "scope": "server", @@ -2642,7 +2636,7 @@ "section": "def-server.APMRouteHandlerResources", "text": "APMRouteHandlerResources" }, - ", { serviceInfrastructure: { containerIds: any; hostNames: any; podNames: any; }; }, ", + ", { serviceInfrastructure: { containerIds: any; hostNames: any; }; }, ", "APMRouteCreateOptions", ">; } & { \"GET /api/apm/traces/{traceId}\": ", "ServerRoute", @@ -4469,20 +4463,6 @@ "path": "x-pack/plugins/apm/server/index.ts", "deprecated": false, "initialIsOpen": false - }, - { - "parentPluginId": "apm", - "id": "def-server.InspectResponse", - "type": "Type", - "tags": [], - "label": "InspectResponse", - "description": [], - "signature": [ - "{ response: any; duration: number; requestType: string; requestParams: Record; esError: Error; operationName: string; }[]" - ], - "path": "x-pack/plugins/apm/server/routes/typings.ts", - "deprecated": false, - "initialIsOpen": false } ], "objects": [], @@ -4505,7 +4485,7 @@ "description": [], "signature": [ "Observable", - "<{ 'apm_oss.transactionIndices': string; 'apm_oss.spanIndices': string; 'apm_oss.errorIndices': string; 'apm_oss.metricsIndices': string; 'apm_oss.sourcemapIndices': string; 'apm_oss.onboardingIndices': string; 'apm_oss.indexPattern': string; 'xpack.apm.serviceMapEnabled': boolean; 'xpack.apm.serviceMapFingerprintBucketSize': number; 'xpack.apm.serviceMapTraceIdBucketSize': number; 'xpack.apm.serviceMapFingerprintGlobalBucketSize': number; 'xpack.apm.serviceMapTraceIdGlobalBucketSize': number; 'xpack.apm.serviceMapMaxTracesPerRequest': number; 'xpack.apm.ui.enabled': boolean; 'xpack.apm.maxServiceEnvironments': number; 'xpack.apm.maxServiceSelection': number; 'xpack.apm.ui.maxTraceItems': number; 'xpack.apm.ui.transactionGroupBucketSize': number; 'xpack.apm.autocreateApmIndexPattern': boolean; 'xpack.apm.telemetryCollectionEnabled': boolean; 'xpack.apm.searchAggregatedTransactions': ", + "<{ 'apm_oss.transactionIndices': string; 'apm_oss.spanIndices': string; 'apm_oss.errorIndices': string; 'apm_oss.metricsIndices': string; 'apm_oss.sourcemapIndices': string; 'apm_oss.onboardingIndices': string; 'xpack.apm.serviceMapEnabled': boolean; 'xpack.apm.serviceMapFingerprintBucketSize': number; 'xpack.apm.serviceMapTraceIdBucketSize': number; 'xpack.apm.serviceMapFingerprintGlobalBucketSize': number; 'xpack.apm.serviceMapTraceIdGlobalBucketSize': number; 'xpack.apm.serviceMapMaxTracesPerRequest': number; 'xpack.apm.ui.enabled': boolean; 'xpack.apm.maxServiceEnvironments': number; 'xpack.apm.maxServiceSelection': number; 'xpack.apm.ui.maxTraceItems': number; 'xpack.apm.ui.transactionGroupBucketSize': number; 'xpack.apm.autocreateApmIndexPattern': boolean; 'xpack.apm.telemetryCollectionEnabled': boolean; 'xpack.apm.searchAggregatedTransactions': ", "SearchAggregatedTransactionSetting", "; 'xpack.apm.metricsInterval': number; 'xpack.apm.agent.migrations.enabled': boolean; }>" ], @@ -4560,7 +4540,7 @@ "children": [ { "parentPluginId": "apm", - "id": "def-server.APMPluginSetup.createApmEventClient.$1.params", + "id": "def-server.APMPluginSetup.createApmEventClient.$1", "type": "Object", "tags": [], "label": "params", @@ -4570,7 +4550,7 @@ "children": [ { "parentPluginId": "apm", - "id": "def-server.APMPluginSetup.createApmEventClient.$1.params.debug", + "id": "def-server.APMPluginSetup.createApmEventClient.$1.debug", "type": "CompoundType", "tags": [], "label": "debug", @@ -4583,7 +4563,7 @@ }, { "parentPluginId": "apm", - "id": "def-server.APMPluginSetup.createApmEventClient.$1.params.request", + "id": "def-server.APMPluginSetup.createApmEventClient.$1.request", "type": "Object", "tags": [], "label": "request", @@ -4603,7 +4583,7 @@ }, { "parentPluginId": "apm", - "id": "def-server.APMPluginSetup.createApmEventClient.$1.params.context", + "id": "def-server.APMPluginSetup.createApmEventClient.$1.context", "type": "Object", "tags": [], "label": "context", diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index c241ea2376f26..ec2b50e738fb9 100644 --- a/api_docs/apm.mdx +++ b/api_docs/apm.mdx @@ -12,13 +12,13 @@ import apmObj from './apm.json'; -Contact APM UI for questions regarding this plugin. +Contact [APM UI](https://github.com/orgs/elastic/teams/apm-ui) for questions regarding this plugin. **Code health stats** | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 42 | 0 | 42 | 30 | +| 41 | 0 | 41 | 30 | ## Client diff --git a/api_docs/apm_oss.mdx b/api_docs/apm_oss.mdx index e9598ba9fd3f0..2189cd5b43edd 100644 --- a/api_docs/apm_oss.mdx +++ b/api_docs/apm_oss.mdx @@ -12,7 +12,7 @@ import apmOssObj from './apm_oss.json'; -Contact APM UI for questions regarding this plugin. +Contact [APM UI](https://github.com/orgs/elastic/teams/apm-ui) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/bfetch.json b/api_docs/bfetch.json index 2e42ea6066eee..c274b6a6d1ced 100644 --- a/api_docs/bfetch.json +++ b/api_docs/bfetch.json @@ -60,7 +60,7 @@ "children": [ { "parentPluginId": "bfetch", - "id": "def-public.payload", + "id": "def-public.BatchedFunc.$1", "type": "Uncategorized", "tags": [], "label": "payload", @@ -73,7 +73,7 @@ }, { "parentPluginId": "bfetch", - "id": "def-public.signal", + "id": "def-public.BatchedFunc.$2", "type": "Object", "tags": [], "label": "signal", @@ -277,7 +277,7 @@ "children": [ { "parentPluginId": "bfetch", - "id": "def-server.context", + "id": "def-server.StreamingRequestHandler.$1", "type": "Object", "tags": [], "label": "context", @@ -296,7 +296,7 @@ }, { "parentPluginId": "bfetch", - "id": "def-server.request", + "id": "def-server.StreamingRequestHandler.$2", "type": "Object", "tags": [], "label": "request", diff --git a/api_docs/canvas.json b/api_docs/canvas.json index ec511b19af93a..5bbd6d01afb20 100644 --- a/api_docs/canvas.json +++ b/api_docs/canvas.json @@ -92,7 +92,65 @@ "functions": [], "interfaces": [], "enums": [], - "misc": [], + "misc": [ + { + "parentPluginId": "canvas", + "id": "def-common.CANVAS_APP_LOCATOR", + "type": "string", + "tags": [], + "label": "CANVAS_APP_LOCATOR", + "description": [], + "signature": [ + "\"CANVAS_APP_LOCATOR\"" + ], + "path": "x-pack/plugins/canvas/common/locator.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "canvas", + "id": "def-common.CanvasAppLocator", + "type": "Type", + "tags": [], + "label": "CanvasAppLocator", + "description": [], + "signature": [ + { + "pluginId": "share", + "scope": "common", + "docId": "kibSharePluginApi", + "section": "def-common.LocatorPublic", + "text": "LocatorPublic" + }, + "<", + { + "pluginId": "canvas", + "scope": "common", + "docId": "kibCanvasPluginApi", + "section": "def-common.CanvasAppLocatorParams", + "text": "CanvasAppLocatorParams" + }, + ">" + ], + "path": "x-pack/plugins/canvas/common/locator.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "canvas", + "id": "def-common.CanvasAppLocatorParams", + "type": "Type", + "tags": [], + "label": "CanvasAppLocatorParams", + "description": [], + "signature": [ + "{ view: \"workpadPDF\"; id: string; page: number; }" + ], + "path": "x-pack/plugins/canvas/common/locator.ts", + "deprecated": false, + "initialIsOpen": false + } + ], "objects": [ { "parentPluginId": "canvas", diff --git a/api_docs/canvas.mdx b/api_docs/canvas.mdx index ad4bc2740342c..3d27f41576824 100644 --- a/api_docs/canvas.mdx +++ b/api_docs/canvas.mdx @@ -18,7 +18,7 @@ Contact [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-prese | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 6 | 0 | 5 | 3 | +| 9 | 0 | 8 | 3 | ## Client @@ -36,3 +36,6 @@ Contact [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-prese ### Objects +### Consts, variables and types + + diff --git a/api_docs/cases.json b/api_docs/cases.json index d635ddce46102..02ea5df201e0d 100644 --- a/api_docs/cases.json +++ b/api_docs/cases.json @@ -2800,7 +2800,7 @@ "label": "actionField", "description": [], "signature": [ - "(\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]" + "(\"status\" | \"description\" | \"title\" | \"tags\" | \"comment\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]" ], "path": "x-pack/plugins/cases/common/ui/types.ts", "deprecated": false @@ -6359,7 +6359,7 @@ "label": "CaseUserActionAttributes", "description": [], "signature": [ - "{ action_field: (\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; owner: string; }" + "{ action_field: (\"status\" | \"description\" | \"title\" | \"tags\" | \"comment\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; owner: string; }" ], "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", "deprecated": false, @@ -6373,7 +6373,7 @@ "label": "CaseUserActionResponse", "description": [], "signature": [ - "{ action_field: (\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; owner: string; } & { action_id: string; case_id: string; comment_id: string | null; } & { sub_case_id?: string | undefined; }" + "{ action_field: (\"status\" | \"description\" | \"title\" | \"tags\" | \"comment\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; owner: string; } & { action_id: string; case_id: string; comment_id: string | null; } & { sub_case_id?: string | undefined; }" ], "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", "deprecated": false, @@ -6387,7 +6387,7 @@ "label": "CaseUserActionsResponse", "description": [], "signature": [ - "({ action_field: (\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; owner: string; } & { action_id: string; case_id: string; comment_id: string | null; } & { sub_case_id?: string | undefined; })[]" + "({ action_field: (\"status\" | \"description\" | \"title\" | \"tags\" | \"comment\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]; action: \"add\" | \"delete\" | \"create\" | \"update\" | \"push-to-service\"; action_at: string; action_by: { email: string | null | undefined; full_name: string | null | undefined; username: string | null | undefined; }; new_value: string | null; old_value: string | null; owner: string; } & { action_id: string; case_id: string; comment_id: string | null; } & { sub_case_id?: string | undefined; })[]" ], "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", "deprecated": false, @@ -8108,7 +8108,7 @@ "label": "UserActionField", "description": [], "signature": [ - "(\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]" + "(\"status\" | \"description\" | \"title\" | \"tags\" | \"comment\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\")[]" ], "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", "deprecated": false, @@ -8122,7 +8122,7 @@ "label": "UserActionFieldType", "description": [], "signature": [ - "\"status\" | \"description\" | \"title\" | \"comment\" | \"tags\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\"" + "\"status\" | \"description\" | \"title\" | \"tags\" | \"comment\" | \"settings\" | \"owner\" | \"connector\" | \"pushed\" | \"sub_case\"" ], "path": "x-pack/plugins/cases/common/api/cases/user_actions.ts", "deprecated": false, diff --git a/api_docs/charts.json b/api_docs/charts.json index eea87223f2e18..ba8751304f710 100644 --- a/api_docs/charts.json +++ b/api_docs/charts.json @@ -529,7 +529,7 @@ "children": [ { "parentPluginId": "charts", - "id": "def-public.props", + "id": "def-public.LegendToggle.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -1641,7 +1641,7 @@ }, { "parentPluginId": "charts", - "id": "def-public.PaletteDefinition.getColorForValue.$3.minmax", + "id": "def-public.PaletteDefinition.getColorForValue.$3", "type": "Object", "tags": [], "label": "{ min, max }", @@ -1651,7 +1651,7 @@ "children": [ { "parentPluginId": "charts", - "id": "def-public.PaletteDefinition.getColorForValue.$3.minmax.min", + "id": "def-public.PaletteDefinition.getColorForValue.$3.min", "type": "number", "tags": [], "label": "min", @@ -1661,7 +1661,7 @@ }, { "parentPluginId": "charts", - "id": "def-public.PaletteDefinition.getColorForValue.$3.minmax.max", + "id": "def-public.PaletteDefinition.getColorForValue.$3.max", "type": "number", "tags": [], "label": "max", diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index 31f7e40b23d0a..38c52bb1e44e2 100644 --- a/api_docs/charts.mdx +++ b/api_docs/charts.mdx @@ -12,7 +12,7 @@ import chartsObj from './charts.json'; -Contact [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/cloud.json b/api_docs/cloud.json index 660c9c1555653..6c6dbf6f48003 100644 --- a/api_docs/cloud.json +++ b/api_docs/cloud.json @@ -200,6 +200,19 @@ "path": "x-pack/plugins/cloud/public/plugin.ts", "deprecated": false }, + { + "parentPluginId": "cloud", + "id": "def-public.CloudSetup.snapshotsUrl", + "type": "string", + "tags": [], + "label": "snapshotsUrl", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/cloud/public/plugin.ts", + "deprecated": false + }, { "parentPluginId": "cloud", "id": "def-public.CloudSetup.isCloudEnabled", diff --git a/api_docs/cloud.mdx b/api_docs/cloud.mdx index 001bcf9d77a82..393e9f27562df 100644 --- a/api_docs/cloud.mdx +++ b/api_docs/cloud.mdx @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 21 | 0 | 21 | 0 | +| 22 | 0 | 22 | 0 | ## Client diff --git a/api_docs/console.json b/api_docs/console.json index 9c40a292c8695..b62897e6194cb 100644 --- a/api_docs/console.json +++ b/api_docs/console.json @@ -48,9 +48,25 @@ "section": "def-public.CoreSetup", "text": "CoreSetup" }, - ", { devTools, home, usageCollection }: ", + ", { devTools, home, share, usageCollection }: ", "AppSetupUIPluginDependencies", - ") => void" + ") => { locator: ", + { + "pluginId": "share", + "scope": "common", + "docId": "kibSharePluginApi", + "section": "def-common.LocatorPublic", + "text": "LocatorPublic" + }, + "<", + { + "pluginId": "console", + "scope": "public", + "docId": "kibConsolePluginApi", + "section": "def-public.ConsoleUILocatorParams", + "text": "ConsoleUILocatorParams" + }, + ">; }" ], "path": "src/plugins/console/public/plugin.ts", "deprecated": false, @@ -81,7 +97,7 @@ "id": "def-public.ConsoleUIPlugin.setup.$2", "type": "Object", "tags": [], - "label": "{ devTools, home, usageCollection }", + "label": "{ devTools, home, share, usageCollection }", "description": [], "signature": [ "AppSetupUIPluginDependencies" @@ -113,7 +129,45 @@ } ], "functions": [], - "interfaces": [], + "interfaces": [ + { + "parentPluginId": "console", + "id": "def-public.ConsoleUILocatorParams", + "type": "Interface", + "tags": [], + "label": "ConsoleUILocatorParams", + "description": [], + "signature": [ + { + "pluginId": "console", + "scope": "public", + "docId": "kibConsolePluginApi", + "section": "def-public.ConsoleUILocatorParams", + "text": "ConsoleUILocatorParams" + }, + " extends ", + "SerializableRecord" + ], + "path": "src/plugins/console/public/plugin.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "console", + "id": "def-public.ConsoleUILocatorParams.loadFrom", + "type": "string", + "tags": [], + "label": "loadFrom", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/console/public/plugin.ts", + "deprecated": false + } + ], + "initialIsOpen": false + } + ], "enums": [], "misc": [], "objects": [] diff --git a/api_docs/console.mdx b/api_docs/console.mdx index 9c91b5fac00de..a29962083727d 100644 --- a/api_docs/console.mdx +++ b/api_docs/console.mdx @@ -18,13 +18,16 @@ Contact [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-ma | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 7 | 0 | 7 | 1 | +| 9 | 0 | 9 | 1 | ## Client ### Classes +### Interfaces + + ## Server ### Setup diff --git a/api_docs/core.json b/api_docs/core.json index 8edb5d3b7ce63..6f429f3ee38e8 100644 --- a/api_docs/core.json +++ b/api_docs/core.json @@ -47,7 +47,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.ToastsApi.Unnamed.$1.deps", + "id": "def-public.ToastsApi.Unnamed.$1", "type": "Object", "tags": [], "label": "deps", @@ -57,7 +57,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.ToastsApi.Unnamed.$1.deps.uiSettings", + "id": "def-public.ToastsApi.Unnamed.$1.uiSettings", "type": "Object", "tags": [], "label": "uiSettings", @@ -753,19 +753,19 @@ "references": [ { "plugin": "visTypeTable", - "path": "src/plugins/vis_type_table/public/plugin.ts" + "path": "src/plugins/vis_types/table/public/plugin.ts" }, { "plugin": "visTypeTable", - "path": "src/plugins/vis_type_table/public/plugin.ts" + "path": "src/plugins/vis_types/table/public/plugin.ts" }, { "plugin": "visTypeTable", - "path": "src/plugins/vis_type_table/target/types/public/plugin.d.ts" + "path": "src/plugins/vis_types/table/target/types/public/plugin.d.ts" }, { "plugin": "visTypeTable", - "path": "src/plugins/vis_type_table/target/types/public/plugin.d.ts" + "path": "src/plugins/vis_types/table/target/types/public/plugin.d.ts" } ], "children": [ @@ -1125,7 +1125,7 @@ "references": [ { "plugin": "visTypeVega", - "path": "src/plugins/vis_type_vega/public/plugin.ts" + "path": "src/plugins/vis_types/vega/public/plugin.ts" } ] }, @@ -1423,15 +1423,15 @@ }, { "plugin": "visTypeVega", - "path": "src/plugins/vis_type_vega/public/data_model/search_api.ts" + "path": "src/plugins/vis_types/vega/public/data_model/search_api.ts" }, { "plugin": "visTypeVega", - "path": "src/plugins/vis_type_vega/public/plugin.ts" + "path": "src/plugins/vis_types/vega/public/plugin.ts" }, { "plugin": "visTypeVega", - "path": "src/plugins/vis_type_vega/target/types/public/data_model/search_api.d.ts" + "path": "src/plugins/vis_types/vega/target/types/public/data_model/search_api.d.ts" } ] } @@ -1620,7 +1620,7 @@ "label": "links", "description": [], "signature": [ - "{ readonly settings: string; readonly canvas: { readonly guide: string; }; readonly dashboard: { readonly guide: string; readonly drilldowns: string; readonly drilldownsTriggerPicker: string; readonly urlDrilldownTemplateSyntax: string; readonly urlDrilldownVariables: string; }; readonly discover: Record; readonly filebeat: { readonly base: string; readonly installation: string; readonly configuration: string; readonly elasticsearchOutput: string; readonly elasticsearchModule: string; readonly startup: string; readonly exportedFields: string; readonly suricataModule: string; readonly zeekModule: string; }; readonly auditbeat: { readonly base: string; readonly auditdModule: string; readonly systemModule: string; }; readonly metricbeat: { readonly base: string; readonly configure: string; readonly httpEndpoint: string; readonly install: string; readonly start: string; }; readonly enterpriseSearch: { readonly base: string; readonly appSearchBase: string; readonly workplaceSearchBase: string; }; readonly heartbeat: { readonly base: string; }; readonly libbeat: { readonly getStarted: string; }; readonly logstash: { readonly base: string; }; readonly functionbeat: { readonly base: string; }; readonly winlogbeat: { readonly base: string; }; readonly aggs: { readonly composite: string; readonly composite_missing_bucket: string; readonly date_histogram: string; readonly date_range: string; readonly date_format_pattern: string; readonly filter: string; readonly filters: string; readonly geohash_grid: string; readonly histogram: string; readonly ip_range: string; readonly range: string; readonly significant_terms: string; readonly terms: string; readonly avg: string; readonly avg_bucket: string; readonly max_bucket: string; readonly min_bucket: string; readonly sum_bucket: string; readonly cardinality: string; readonly count: string; readonly cumulative_sum: string; readonly derivative: string; readonly geo_bounds: string; readonly geo_centroid: string; readonly max: string; readonly median: string; readonly min: string; readonly moving_avg: string; readonly percentile_ranks: string; readonly serial_diff: string; readonly std_dev: string; readonly sum: string; readonly top_hits: string; }; readonly runtimeFields: { readonly overview: string; readonly mapping: string; }; readonly scriptedFields: { readonly scriptFields: string; readonly scriptAggs: string; readonly painless: string; readonly painlessApi: string; readonly painlessLangSpec: string; readonly painlessSyntax: string; readonly painlessWalkthrough: string; readonly luceneExpressions: string; }; readonly search: { readonly sessions: string; readonly sessionLimits: string; }; readonly indexPatterns: { readonly introduction: string; readonly fieldFormattersNumber: string; readonly fieldFormattersString: string; readonly runtimeFields: string; }; readonly addData: string; readonly kibana: string; readonly upgradeAssistant: string; readonly rollupJobs: string; readonly elasticsearch: Record; readonly siem: { readonly guide: string; readonly gettingStarted: string; readonly ml: string; readonly ruleChangeLog: string; readonly detectionsReq: string; readonly networkMap: string; }; readonly query: { readonly eql: string; readonly kueryQuerySyntax: string; readonly luceneQuerySyntax: string; readonly percolate: string; readonly queryDsl: string; readonly autocompleteChanges: string; }; readonly date: { readonly dateMath: string; readonly dateMathIndexNames: string; }; readonly management: Record; readonly ml: Record; readonly transforms: Record; readonly visualize: Record; readonly apis: Readonly<{ bulkIndexAlias: string; byteSizeUnits: string; createAutoFollowPattern: string; createFollower: string; createIndex: string; createSnapshotLifecyclePolicy: string; createRoleMapping: string; createRoleMappingTemplates: string; createRollupJobsRequest: string; createApiKey: string; createPipeline: string; createTransformRequest: string; cronExpressions: string; executeWatchActionModes: string; indexExists: string; openIndex: string; putComponentTemplate: string; painlessExecute: string; painlessExecuteAPIContexts: string; putComponentTemplateMetadata: string; putSnapshotLifecyclePolicy: string; putIndexTemplateV1: string; putWatch: string; simulatePipeline: string; timeUnits: string; updateTransform: string; }>; readonly observability: Record; readonly alerting: Record; readonly maps: Record; readonly monitoring: Record; readonly security: Readonly<{ apiKeyServiceSettings: string; clusterPrivileges: string; elasticsearchSettings: string; elasticsearchEnableSecurity: string; indicesPrivileges: string; kibanaTLS: string; kibanaPrivileges: string; mappingRoles: string; mappingRolesFieldRules: string; runAsPrivilege: string; }>; readonly watcher: Record; readonly ccs: Record; readonly plugins: Record; readonly snapshotRestore: Record; readonly ingest: Record; readonly fleet: Readonly<{ guide: string; fleetServer: string; fleetServerAddFleetServer: string; settings: string; settingsFleetServerHostSettings: string; troubleshooting: string; elasticAgent: string; datastreams: string; datastreamsNamingScheme: string; upgradeElasticAgent: string; upgradeElasticAgent712lower: string; }>; readonly ecs: { readonly guide: string; }; }" + "{ readonly settings: string; readonly apm: { readonly kibanaSettings: string; readonly supportedServiceMaps: string; readonly customLinks: string; readonly droppedTransactionSpans: string; readonly upgrading: string; readonly metaData: string; }; readonly canvas: { readonly guide: string; }; readonly dashboard: { readonly guide: string; readonly drilldowns: string; readonly drilldownsTriggerPicker: string; readonly urlDrilldownTemplateSyntax: string; readonly urlDrilldownVariables: string; }; readonly discover: Record; readonly filebeat: { readonly base: string; readonly installation: string; readonly configuration: string; readonly elasticsearchOutput: string; readonly elasticsearchModule: string; readonly startup: string; readonly exportedFields: string; readonly suricataModule: string; readonly zeekModule: string; }; readonly auditbeat: { readonly base: string; readonly auditdModule: string; readonly systemModule: string; }; readonly metricbeat: { readonly base: string; readonly configure: string; readonly httpEndpoint: string; readonly install: string; readonly start: string; }; readonly enterpriseSearch: { readonly base: string; readonly appSearchBase: string; readonly workplaceSearchBase: string; }; readonly heartbeat: { readonly base: string; }; readonly libbeat: { readonly getStarted: string; }; readonly logstash: { readonly base: string; }; readonly functionbeat: { readonly base: string; }; readonly winlogbeat: { readonly base: string; }; readonly aggs: { readonly composite: string; readonly composite_missing_bucket: string; readonly date_histogram: string; readonly date_range: string; readonly date_format_pattern: string; readonly filter: string; readonly filters: string; readonly geohash_grid: string; readonly histogram: string; readonly ip_range: string; readonly range: string; readonly significant_terms: string; readonly terms: string; readonly avg: string; readonly avg_bucket: string; readonly max_bucket: string; readonly min_bucket: string; readonly sum_bucket: string; readonly cardinality: string; readonly count: string; readonly cumulative_sum: string; readonly derivative: string; readonly geo_bounds: string; readonly geo_centroid: string; readonly max: string; readonly median: string; readonly min: string; readonly moving_avg: string; readonly percentile_ranks: string; readonly serial_diff: string; readonly std_dev: string; readonly sum: string; readonly top_hits: string; }; readonly runtimeFields: { readonly overview: string; readonly mapping: string; }; readonly scriptedFields: { readonly scriptFields: string; readonly scriptAggs: string; readonly painless: string; readonly painlessApi: string; readonly painlessLangSpec: string; readonly painlessSyntax: string; readonly painlessWalkthrough: string; readonly luceneExpressions: string; }; readonly search: { readonly sessions: string; readonly sessionLimits: string; }; readonly indexPatterns: { readonly introduction: string; readonly fieldFormattersNumber: string; readonly fieldFormattersString: string; readonly runtimeFields: string; }; readonly addData: string; readonly kibana: string; readonly upgradeAssistant: string; readonly rollupJobs: string; readonly elasticsearch: Record; readonly siem: { readonly privileges: string; readonly guide: string; readonly gettingStarted: string; readonly ml: string; readonly ruleChangeLog: string; readonly detectionsReq: string; readonly networkMap: string; }; readonly query: { readonly eql: string; readonly kueryQuerySyntax: string; readonly luceneQuerySyntax: string; readonly percolate: string; readonly queryDsl: string; readonly autocompleteChanges: string; }; readonly date: { readonly dateMath: string; readonly dateMathIndexNames: string; }; readonly management: Record; readonly ml: Record; readonly transforms: Record; readonly visualize: Record; readonly apis: Readonly<{ bulkIndexAlias: string; byteSizeUnits: string; createAutoFollowPattern: string; createFollower: string; createIndex: string; createSnapshotLifecyclePolicy: string; createRoleMapping: string; createRoleMappingTemplates: string; createRollupJobsRequest: string; createApiKey: string; createPipeline: string; createTransformRequest: string; cronExpressions: string; executeWatchActionModes: string; indexExists: string; openIndex: string; putComponentTemplate: string; painlessExecute: string; painlessExecuteAPIContexts: string; putComponentTemplateMetadata: string; putSnapshotLifecyclePolicy: string; putIndexTemplateV1: string; putWatch: string; simulatePipeline: string; timeUnits: string; updateTransform: string; }>; readonly observability: Record; readonly alerting: Record; readonly maps: Record; readonly monitoring: Record; readonly security: Readonly<{ apiKeyServiceSettings: string; clusterPrivileges: string; elasticsearchSettings: string; elasticsearchEnableSecurity: string; indicesPrivileges: string; kibanaTLS: string; kibanaPrivileges: string; mappingRoles: string; mappingRolesFieldRules: string; runAsPrivilege: string; }>; readonly watcher: Record; readonly ccs: Record; readonly plugins: Record; readonly snapshotRestore: Record; readonly ingest: Record; readonly fleet: Readonly<{ guide: string; fleetServer: string; fleetServerAddFleetServer: string; settings: string; settingsFleetServerHostSettings: string; troubleshooting: string; elasticAgent: string; datastreams: string; datastreamsNamingScheme: string; upgradeElasticAgent: string; upgradeElasticAgent712lower: string; }>; readonly ecs: { readonly guide: string; }; }" ], "path": "src/core/public/doc_links/doc_links_service.ts", "deprecated": false @@ -1929,7 +1929,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.I18nStart.Context.$1.children", + "id": "def-public.I18nStart.Context.$1", "type": "Object", "tags": [], "label": "{ children }", @@ -1939,7 +1939,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.I18nStart.Context.$1.children.children", + "id": "def-public.I18nStart.Context.$1.children", "type": "CompoundType", "tags": [], "label": "children", @@ -3703,7 +3703,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.mount", + "id": "def-public.OverlayStart.openFlyout.$1", "type": "Function", "tags": [], "label": "mount", @@ -3724,7 +3724,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.element", + "id": "def-public.OverlayStart.openFlyout.$1.$1", "type": "Uncategorized", "tags": [], "label": "element", @@ -3739,7 +3739,7 @@ }, { "parentPluginId": "core", - "id": "def-public.options", + "id": "def-public.OverlayStart.openFlyout.$2", "type": "Object", "tags": [], "label": "options", @@ -3800,7 +3800,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.mount", + "id": "def-public.OverlayStart.openModal.$1", "type": "Function", "tags": [], "label": "mount", @@ -3821,7 +3821,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.element", + "id": "def-public.OverlayStart.openModal.$1.$1", "type": "Uncategorized", "tags": [], "label": "element", @@ -3836,7 +3836,7 @@ }, { "parentPluginId": "core", - "id": "def-public.options", + "id": "def-public.OverlayStart.openModal.$2", "type": "Object", "tags": [], "label": "options", @@ -3890,7 +3890,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.message", + "id": "def-public.OverlayStart.openConfirm.$1", "type": "CompoundType", "tags": [], "label": "message", @@ -3911,7 +3911,7 @@ }, { "parentPluginId": "core", - "id": "def-public.options", + "id": "def-public.OverlayStart.openConfirm.$2", "type": "Object", "tags": [], "label": "options", @@ -6472,7 +6472,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.element", + "id": "def-public.MountPoint.$1", "type": "Uncategorized", "tags": [], "label": "element", @@ -6530,7 +6530,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.core", + "id": "def-public.PluginInitializer.$1", "type": "Object", "tags": [], "label": "core", @@ -7555,7 +7555,7 @@ "label": "rawConfig", "description": [], "signature": [ - "Readonly<{ username?: string | undefined; password?: string | undefined; serviceAccountToken?: string | undefined; } & { ssl: Readonly<{ key?: string | undefined; certificate?: string | undefined; certificateAuthorities?: string | string[] | undefined; keyPassphrase?: string | undefined; } & { verificationMode: \"none\" | \"certificate\" | \"full\"; keystore: Readonly<{ path?: string | undefined; password?: string | undefined; } & {}>; truststore: Readonly<{ path?: string | undefined; password?: string | undefined; } & {}>; alwaysPresentCertificate: boolean; }>; hosts: string | string[]; requestTimeout: moment.Duration; sniffOnStart: boolean; sniffInterval: false | moment.Duration; sniffOnConnectionFault: boolean; requestHeadersWhitelist: string | string[]; customHeaders: Record; shardTimeout: moment.Duration; pingTimeout: moment.Duration; logQueries: boolean; apiVersion: string; healthCheck: Readonly<{} & { delay: moment.Duration; }>; ignoreVersionMismatch: boolean; }>" + "Readonly<{ username?: string | undefined; password?: string | undefined; serviceAccountToken?: string | undefined; } & { ssl: Readonly<{ key?: string | undefined; certificate?: string | undefined; certificateAuthorities?: string | string[] | undefined; keyPassphrase?: string | undefined; } & { verificationMode: \"none\" | \"certificate\" | \"full\"; keystore: Readonly<{ path?: string | undefined; password?: string | undefined; } & {}>; truststore: Readonly<{ path?: string | undefined; password?: string | undefined; } & {}>; alwaysPresentCertificate: boolean; }>; hosts: string | string[]; requestTimeout: moment.Duration; sniffOnStart: boolean; sniffInterval: false | moment.Duration; sniffOnConnectionFault: boolean; requestHeadersWhitelist: string | string[]; customHeaders: Record; shardTimeout: moment.Duration; pingTimeout: moment.Duration; logQueries: boolean; apiVersion: string; healthCheck: Readonly<{} & { delay: moment.Duration; }>; ignoreVersionMismatch: boolean; skipStartupConnectionCheck: boolean; }>" ], "path": "src/core/server/elasticsearch/elasticsearch_config.ts", "deprecated": false, @@ -9190,13 +9190,27 @@ "path": "src/core/server/deprecations/types.ts", "deprecated": false, "children": [ + { + "parentPluginId": "core", + "id": "def-server.DeprecationsDetails.title", + "type": "string", + "tags": [], + "label": "title", + "description": [ + "\nThe title of the deprecation.\nCheck the README for writing deprecations in `src/core/server/deprecations/README.mdx`" + ], + "path": "src/core/server/deprecations/types.ts", + "deprecated": false + }, { "parentPluginId": "core", "id": "def-server.DeprecationsDetails.message", "type": "string", "tags": [], "label": "message", - "description": [], + "description": [ + "\nThe description message to be displayed for the deprecation.\nCheck the README for writing deprecations in `src/core/server/deprecations/README.mdx`" + ], "path": "src/core/server/deprecations/types.ts", "deprecated": false }, @@ -11262,7 +11276,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"count\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"count\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", @@ -12376,7 +12390,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"count\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"count\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", @@ -12401,7 +12415,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"count\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"count\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", @@ -16041,7 +16055,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.details", + "id": "def-server.AddConfigDeprecation.$1", "type": "Object", "tags": [], "label": "details", @@ -16145,7 +16159,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.CapabilitiesSwitcher.$1", "type": "Object", "tags": [], "label": "request", @@ -16165,7 +16179,7 @@ }, { "parentPluginId": "core", - "id": "def-server.uiCapabilities", + "id": "def-server.CapabilitiesSwitcher.$2", "type": "Object", "tags": [], "label": "uiCapabilities", @@ -16178,7 +16192,7 @@ }, { "parentPluginId": "core", - "id": "def-server.useDefaultCapabilities", + "id": "def-server.CapabilitiesSwitcher.$3", "type": "boolean", "tags": [], "label": "useDefaultCapabilities", @@ -16211,7 +16225,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.factory", + "id": "def-server.ConfigDeprecationProvider.$1", "type": "Object", "tags": [], "label": "factory", @@ -16388,7 +16402,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"count\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"count\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", @@ -16488,7 +16502,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.context", + "id": "def-server.HandlerFunction.$1", "type": "Uncategorized", "tags": [], "label": "context", @@ -16501,7 +16515,7 @@ }, { "parentPluginId": "core", - "id": "def-server.args", + "id": "def-server.HandlerFunction.$2", "type": "Array", "tags": [], "label": "args", @@ -16757,7 +16771,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.context", + "id": "def-server.HttpResourcesRequestHandler.$1", "type": "Uncategorized", "tags": [], "label": "context", @@ -16770,7 +16784,7 @@ }, { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.HttpResourcesRequestHandler.$2", "type": "Object", "tags": [], "label": "request", @@ -16790,7 +16804,7 @@ }, { "parentPluginId": "core", - "id": "def-server.response", + "id": "def-server.HttpResourcesRequestHandler.$3", "type": "Uncategorized", "tags": [], "label": "response", @@ -17028,7 +17042,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.context", + "id": "def-server.IContextProvider.$1", "type": "Object", "tags": [], "label": "context", @@ -17043,7 +17057,7 @@ }, { "parentPluginId": "core", - "id": "def-server.rest", + "id": "def-server.IContextProvider.$2", "type": "Object", "tags": [], "label": "rest", @@ -17285,7 +17299,7 @@ "signature": [ "Pick<", "EcsBase", - ", \"labels\" | \"tags\"> & ", + ", \"tags\" | \"labels\"> & ", "EcsTracing", " & { agent?: ", "EcsAgent", @@ -17468,7 +17482,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.core", + "id": "def-server.PluginInitializer.$1", "type": "Object", "tags": [], "label": "core", diff --git a/api_docs/core.mdx b/api_docs/core.mdx index 0f8e650899570..d4c746e9fa575 100644 --- a/api_docs/core.mdx +++ b/api_docs/core.mdx @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2246 | 27 | 998 | 30 | +| 2249 | 27 | 997 | 30 | ## Client diff --git a/api_docs/core_application.json b/api_docs/core_application.json index 66df68f065e2f..35c12330898fb 100644 --- a/api_docs/core_application.json +++ b/api_docs/core_application.json @@ -444,7 +444,7 @@ }, { "parentPluginId": "core", - "id": "def-public.ScopedHistory.createHref.$2.prependBasePathtrue", + "id": "def-public.ScopedHistory.createHref.$2", "type": "Object", "tags": [], "label": "{ prependBasePath = true }", @@ -454,7 +454,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.ScopedHistory.createHref.$2.prependBasePathtrue.prependBasePath", + "id": "def-public.ScopedHistory.createHref.$2.prependBasePath", "type": "CompoundType", "tags": [], "label": "prependBasePath", @@ -715,7 +715,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.params", + "id": "def-public.App.mount.$1", "type": "Object", "tags": [], "label": "params", @@ -1203,7 +1203,7 @@ }, { "parentPluginId": "core", - "id": "def-public.ApplicationStart.getUrlForApp.$2.options", + "id": "def-public.ApplicationStart.getUrlForApp.$2", "type": "Object", "tags": [], "label": "options", @@ -1213,7 +1213,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.ApplicationStart.getUrlForApp.$2.options.path", + "id": "def-public.ApplicationStart.getUrlForApp.$2.path", "type": "string", "tags": [], "label": "path", @@ -1226,7 +1226,7 @@ }, { "parentPluginId": "core", - "id": "def-public.ApplicationStart.getUrlForApp.$2.options.absolute", + "id": "def-public.ApplicationStart.getUrlForApp.$2.absolute", "type": "CompoundType", "tags": [], "label": "absolute", @@ -1239,7 +1239,7 @@ }, { "parentPluginId": "core", - "id": "def-public.ApplicationStart.getUrlForApp.$2.options.deepLinkId", + "id": "def-public.ApplicationStart.getUrlForApp.$2.deepLinkId", "type": "string", "tags": [], "label": "deepLinkId", @@ -1393,10 +1393,6 @@ "plugin": "kibanaOverview", "path": "src/plugins/kibana_overview/public/application.tsx" }, - { - "plugin": "timelion", - "path": "src/plugins/timelion/public/application.ts" - }, { "plugin": "management", "path": "src/plugins/management/target/types/public/application.d.ts" @@ -2004,7 +2000,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.factory", + "id": "def-public.AppLeaveHandler.$1", "type": "Object", "tags": [], "label": "factory", @@ -2017,7 +2013,7 @@ }, { "parentPluginId": "core", - "id": "def-public.nextAppId", + "id": "def-public.AppLeaveHandler.$2", "type": "string", "tags": [], "label": "nextAppId", @@ -2075,7 +2071,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.params", + "id": "def-public.AppMount.$1", "type": "Object", "tags": [], "label": "params", @@ -2188,7 +2184,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.app", + "id": "def-public.AppUpdater.$1", "type": "Object", "tags": [], "label": "app", diff --git a/api_docs/core_application.mdx b/api_docs/core_application.mdx index 61315ac1f840d..86de977df0b35 100644 --- a/api_docs/core_application.mdx +++ b/api_docs/core_application.mdx @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2246 | 27 | 998 | 30 | +| 2249 | 27 | 997 | 30 | ## Client diff --git a/api_docs/core_chrome.json b/api_docs/core_chrome.json index 4706491d6efe2..e2404c6b386fc 100644 --- a/api_docs/core_chrome.json +++ b/api_docs/core_chrome.json @@ -570,7 +570,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.element", + "id": "def-public.ChromeNavControl.mount.$1", "type": "Uncategorized", "tags": [], "label": "element", @@ -1850,6 +1850,25 @@ } ], "returnComment": [] + }, + { + "parentPluginId": "core", + "id": "def-public.ChromeStart.hasHeaderBanner$", + "type": "Function", + "tags": [], + "label": "hasHeaderBanner$", + "description": [ + "\nGet an observable of the current header banner presence state." + ], + "signature": [ + "() => ", + "Observable", + "" + ], + "path": "src/core/public/chrome/types.ts", + "deprecated": false, + "children": [], + "returnComment": [] } ], "initialIsOpen": false @@ -1887,7 +1906,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-public.element", + "id": "def-public.ChromeUserBanner.content.$1", "type": "Uncategorized", "tags": [], "label": "element", diff --git a/api_docs/core_chrome.mdx b/api_docs/core_chrome.mdx index 9f2e1f7984b0c..45a2027591070 100644 --- a/api_docs/core_chrome.mdx +++ b/api_docs/core_chrome.mdx @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2246 | 27 | 998 | 30 | +| 2249 | 27 | 997 | 30 | ## Client diff --git a/api_docs/core_http.json b/api_docs/core_http.json index 154aa16987ca3..5a20607b2ad84 100644 --- a/api_docs/core_http.json +++ b/api_docs/core_http.json @@ -3046,7 +3046,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.HttpAuth.get.$1", "type": "Object", "tags": [], "label": "request", @@ -3092,7 +3092,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.HttpAuth.isAuthenticated.$1", "type": "Object", "tags": [], "label": "request", @@ -4089,9 +4089,9 @@ " | null; (detailed: false): ", "PeerCertificate", " | null; (detailed?: boolean | undefined): ", - "DetailedPeerCertificate", - " | ", "PeerCertificate", + " | ", + "DetailedPeerCertificate", " | null; }" ], "path": "src/core/server/http/router/socket.ts", @@ -4127,9 +4127,9 @@ " | null; (detailed: false): ", "PeerCertificate", " | null; (detailed?: boolean | undefined): ", - "DetailedPeerCertificate", - " | ", "PeerCertificate", + " | ", + "DetailedPeerCertificate", " | null; }" ], "path": "src/core/server/http/router/socket.ts", @@ -4167,9 +4167,9 @@ " | null; (detailed: false): ", "PeerCertificate", " | null; (detailed?: boolean | undefined): ", - "DetailedPeerCertificate", - " | ", "PeerCertificate", + " | ", + "DetailedPeerCertificate", " | null; }" ], "path": "src/core/server/http/router/socket.ts", @@ -4230,7 +4230,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.IKibanaSocket.renegotiate.$1.options", + "id": "def-server.IKibanaSocket.renegotiate.$1", "type": "Object", "tags": [], "label": "options", @@ -4240,7 +4240,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.IKibanaSocket.renegotiate.$1.options.rejectUnauthorized", + "id": "def-server.IKibanaSocket.renegotiate.$1.rejectUnauthorized", "type": "CompoundType", "tags": [], "label": "rejectUnauthorized", @@ -4253,7 +4253,7 @@ }, { "parentPluginId": "core", - "id": "def-server.IKibanaSocket.renegotiate.$1.options.requestCert", + "id": "def-server.IKibanaSocket.renegotiate.$1.requestCert", "type": "CompoundType", "tags": [], "label": "requestCert", @@ -4546,7 +4546,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.route", + "id": "def-server.IRouter.get.$1", "type": "Object", "tags": [], "label": "route", @@ -4566,7 +4566,7 @@ }, { "parentPluginId": "core", - "id": "def-server.handler", + "id": "def-server.IRouter.get.$2", "type": "Function", "tags": [], "label": "handler", @@ -4778,7 +4778,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.context", + "id": "def-server.IRouter.get.$2.$1", "type": "Uncategorized", "tags": [], "label": "context", @@ -4791,7 +4791,7 @@ }, { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.IRouter.get.$2.$2", "type": "Object", "tags": [], "label": "request", @@ -4811,7 +4811,7 @@ }, { "parentPluginId": "core", - "id": "def-server.response", + "id": "def-server.IRouter.get.$2.$3", "type": "Uncategorized", "tags": [], "label": "response", @@ -5034,7 +5034,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.route", + "id": "def-server.IRouter.post.$1", "type": "Object", "tags": [], "label": "route", @@ -5054,7 +5054,7 @@ }, { "parentPluginId": "core", - "id": "def-server.handler", + "id": "def-server.IRouter.post.$2", "type": "Function", "tags": [], "label": "handler", @@ -5266,7 +5266,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.context", + "id": "def-server.IRouter.post.$2.$1", "type": "Uncategorized", "tags": [], "label": "context", @@ -5279,7 +5279,7 @@ }, { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.IRouter.post.$2.$2", "type": "Object", "tags": [], "label": "request", @@ -5299,7 +5299,7 @@ }, { "parentPluginId": "core", - "id": "def-server.response", + "id": "def-server.IRouter.post.$2.$3", "type": "Uncategorized", "tags": [], "label": "response", @@ -5522,7 +5522,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.route", + "id": "def-server.IRouter.put.$1", "type": "Object", "tags": [], "label": "route", @@ -5542,7 +5542,7 @@ }, { "parentPluginId": "core", - "id": "def-server.handler", + "id": "def-server.IRouter.put.$2", "type": "Function", "tags": [], "label": "handler", @@ -5754,7 +5754,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.context", + "id": "def-server.IRouter.put.$2.$1", "type": "Uncategorized", "tags": [], "label": "context", @@ -5767,7 +5767,7 @@ }, { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.IRouter.put.$2.$2", "type": "Object", "tags": [], "label": "request", @@ -5787,7 +5787,7 @@ }, { "parentPluginId": "core", - "id": "def-server.response", + "id": "def-server.IRouter.put.$2.$3", "type": "Uncategorized", "tags": [], "label": "response", @@ -6010,7 +6010,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.route", + "id": "def-server.IRouter.patch.$1", "type": "Object", "tags": [], "label": "route", @@ -6030,7 +6030,7 @@ }, { "parentPluginId": "core", - "id": "def-server.handler", + "id": "def-server.IRouter.patch.$2", "type": "Function", "tags": [], "label": "handler", @@ -6242,7 +6242,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.context", + "id": "def-server.IRouter.patch.$2.$1", "type": "Uncategorized", "tags": [], "label": "context", @@ -6255,7 +6255,7 @@ }, { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.IRouter.patch.$2.$2", "type": "Object", "tags": [], "label": "request", @@ -6275,7 +6275,7 @@ }, { "parentPluginId": "core", - "id": "def-server.response", + "id": "def-server.IRouter.patch.$2.$3", "type": "Uncategorized", "tags": [], "label": "response", @@ -6498,7 +6498,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.route", + "id": "def-server.IRouter.delete.$1", "type": "Object", "tags": [], "label": "route", @@ -6518,7 +6518,7 @@ }, { "parentPluginId": "core", - "id": "def-server.handler", + "id": "def-server.IRouter.delete.$2", "type": "Function", "tags": [], "label": "handler", @@ -6730,7 +6730,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.context", + "id": "def-server.IRouter.delete.$2.$1", "type": "Uncategorized", "tags": [], "label": "context", @@ -6743,7 +6743,7 @@ }, { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.IRouter.delete.$2.$2", "type": "Object", "tags": [], "label": "request", @@ -6763,7 +6763,7 @@ }, { "parentPluginId": "core", - "id": "def-server.response", + "id": "def-server.IRouter.delete.$2.$3", "type": "Uncategorized", "tags": [], "label": "response", @@ -7184,7 +7184,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.handler", + "id": "def-server.IRouter.handleLegacyErrors.$1", "type": "Function", "tags": [], "label": "handler", @@ -7222,7 +7222,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.context", + "id": "def-server.IRouter.handleLegacyErrors.$1.$1", "type": "Uncategorized", "tags": [], "label": "context", @@ -7235,7 +7235,7 @@ }, { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.IRouter.handleLegacyErrors.$1.$2", "type": "Object", "tags": [], "label": "request", @@ -7255,7 +7255,7 @@ }, { "parentPluginId": "core", - "id": "def-server.response", + "id": "def-server.IRouter.handleLegacyErrors.$1.$3", "type": "Uncategorized", "tags": [], "label": "response", @@ -7389,7 +7389,7 @@ "section": "def-server.RouteConfigOptions", "text": "RouteConfigOptions" }, - ", \"timeout\" | \"tags\" | \"authRequired\" | \"xsrfRequired\">> : Required<", + ", \"tags\" | \"timeout\" | \"authRequired\" | \"xsrfRequired\">> : Required<", { "pluginId": "core", "scope": "server", @@ -8833,7 +8833,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.AuthenticationHandler.$1", "type": "Object", "tags": [], "label": "request", @@ -8853,7 +8853,7 @@ }, { "parentPluginId": "core", - "id": "def-server.response", + "id": "def-server.AuthenticationHandler.$2", "type": "Object", "tags": [], "label": "response", @@ -8994,7 +8994,7 @@ }, { "parentPluginId": "core", - "id": "def-server.toolkit", + "id": "def-server.AuthenticationHandler.$3", "type": "Object", "tags": [], "label": "toolkit", @@ -9112,7 +9112,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.GetAuthHeaders.$1", "type": "Object", "tags": [], "label": "request", @@ -9167,7 +9167,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.GetAuthState.$1", "type": "Object", "tags": [], "label": "request", @@ -9280,7 +9280,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.IsAuthenticated.$1", "type": "Object", "tags": [], "label": "request", @@ -9327,7 +9327,7 @@ "section": "def-server.RouteConfigOptions", "text": "RouteConfigOptions" }, - ", \"timeout\" | \"tags\" | \"authRequired\" | \"xsrfRequired\">> : Required<", + ", \"tags\" | \"timeout\" | \"authRequired\" | \"xsrfRequired\">> : Required<", { "pluginId": "core", "scope": "server", @@ -9857,7 +9857,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.OnPostAuthHandler.$1", "type": "Object", "tags": [], "label": "request", @@ -9877,7 +9877,7 @@ }, { "parentPluginId": "core", - "id": "def-server.response", + "id": "def-server.OnPostAuthHandler.$2", "type": "Object", "tags": [], "label": "response", @@ -10018,7 +10018,7 @@ }, { "parentPluginId": "core", - "id": "def-server.toolkit", + "id": "def-server.OnPostAuthHandler.$3", "type": "Object", "tags": [], "label": "toolkit", @@ -10204,7 +10204,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.OnPreAuthHandler.$1", "type": "Object", "tags": [], "label": "request", @@ -10224,7 +10224,7 @@ }, { "parentPluginId": "core", - "id": "def-server.response", + "id": "def-server.OnPreAuthHandler.$2", "type": "Object", "tags": [], "label": "response", @@ -10365,7 +10365,7 @@ }, { "parentPluginId": "core", - "id": "def-server.toolkit", + "id": "def-server.OnPreAuthHandler.$3", "type": "Object", "tags": [], "label": "toolkit", @@ -10427,7 +10427,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.OnPreResponseHandler.$1", "type": "Object", "tags": [], "label": "request", @@ -10447,7 +10447,7 @@ }, { "parentPluginId": "core", - "id": "def-server.preResponse", + "id": "def-server.OnPreResponseHandler.$2", "type": "Object", "tags": [], "label": "preResponse", @@ -10466,7 +10466,7 @@ }, { "parentPluginId": "core", - "id": "def-server.toolkit", + "id": "def-server.OnPreResponseHandler.$3", "type": "Object", "tags": [], "label": "toolkit", @@ -10652,7 +10652,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.OnPreRoutingHandler.$1", "type": "Object", "tags": [], "label": "request", @@ -10672,7 +10672,7 @@ }, { "parentPluginId": "core", - "id": "def-server.response", + "id": "def-server.OnPreRoutingHandler.$2", "type": "Object", "tags": [], "label": "response", @@ -10813,7 +10813,7 @@ }, { "parentPluginId": "core", - "id": "def-server.toolkit", + "id": "def-server.OnPreRoutingHandler.$3", "type": "Object", "tags": [], "label": "toolkit", @@ -10898,7 +10898,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.context", + "id": "def-server.RequestHandler.$1", "type": "Uncategorized", "tags": [], "label": "context", @@ -10911,7 +10911,7 @@ }, { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.RequestHandler.$2", "type": "Object", "tags": [], "label": "request", @@ -10931,7 +10931,7 @@ }, { "parentPluginId": "core", - "id": "def-server.response", + "id": "def-server.RequestHandler.$3", "type": "Uncategorized", "tags": [], "label": "response", @@ -11167,7 +11167,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.context", + "id": "def-server.RequestHandlerContextProvider.$1", "type": "Object", "tags": [], "label": "context", @@ -11180,7 +11180,7 @@ }, { "parentPluginId": "core", - "id": "def-server.rest", + "id": "def-server.RequestHandlerContextProvider.$2", "type": "Object", "tags": [], "label": "rest", @@ -11782,7 +11782,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.handler", + "id": "def-server.RequestHandlerWrapper.$1", "type": "Function", "tags": [], "label": "handler", @@ -11820,7 +11820,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.context", + "id": "def-server.RequestHandlerWrapper.$1.$1", "type": "Uncategorized", "tags": [], "label": "context", @@ -11833,7 +11833,7 @@ }, { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.RequestHandlerWrapper.$1.$2", "type": "Object", "tags": [], "label": "request", @@ -11853,7 +11853,7 @@ }, { "parentPluginId": "core", - "id": "def-server.response", + "id": "def-server.RequestHandlerWrapper.$1.$3", "type": "Uncategorized", "tags": [], "label": "response", @@ -12157,7 +12157,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.route", + "id": "def-server.RouteRegistrar.$1", "type": "Object", "tags": [], "label": "route", @@ -12177,7 +12177,7 @@ }, { "parentPluginId": "core", - "id": "def-server.handler", + "id": "def-server.RouteRegistrar.$2", "type": "Function", "tags": [], "label": "handler", @@ -12389,7 +12389,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.context", + "id": "def-server.RouteRegistrar.$2.$1", "type": "Uncategorized", "tags": [], "label": "context", @@ -12402,7 +12402,7 @@ }, { "parentPluginId": "core", - "id": "def-server.request", + "id": "def-server.RouteRegistrar.$2.$2", "type": "Object", "tags": [], "label": "request", @@ -12422,7 +12422,7 @@ }, { "parentPluginId": "core", - "id": "def-server.response", + "id": "def-server.RouteRegistrar.$2.$3", "type": "Uncategorized", "tags": [], "label": "response", @@ -12472,7 +12472,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.data", + "id": "def-server.RouteValidationFunction.$1", "type": "Any", "tags": [], "label": "data", @@ -12485,7 +12485,7 @@ }, { "parentPluginId": "core", - "id": "def-server.validationResult", + "id": "def-server.RouteValidationFunction.$2", "type": "Object", "tags": [], "label": "validationResult", diff --git a/api_docs/core_http.mdx b/api_docs/core_http.mdx index 0c0912c987b79..fd34cbdc90b4e 100644 --- a/api_docs/core_http.mdx +++ b/api_docs/core_http.mdx @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2246 | 27 | 998 | 30 | +| 2249 | 27 | 997 | 30 | ## Client diff --git a/api_docs/core_saved_objects.json b/api_docs/core_saved_objects.json index 862a2e5f7adc5..6429a2f434132 100644 --- a/api_docs/core_saved_objects.json +++ b/api_docs/core_saved_objects.json @@ -4729,7 +4729,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.SavedObjectsExporter.Unnamed.$1.savedObjectsClienttypeRegistryexportSizeLimitlogger", + "id": "def-server.SavedObjectsExporter.Unnamed.$1", "type": "Object", "tags": [], "label": "{\n savedObjectsClient,\n typeRegistry,\n exportSizeLimit,\n logger,\n }", @@ -4739,7 +4739,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.SavedObjectsExporter.Unnamed.$1.savedObjectsClienttypeRegistryexportSizeLimitlogger.savedObjectsClient", + "id": "def-server.SavedObjectsExporter.Unnamed.$1.savedObjectsClient", "type": "Object", "tags": [], "label": "savedObjectsClient", @@ -5052,7 +5052,7 @@ }, { "parentPluginId": "core", - "id": "def-server.SavedObjectsExporter.Unnamed.$1.savedObjectsClienttypeRegistryexportSizeLimitlogger.typeRegistry", + "id": "def-server.SavedObjectsExporter.Unnamed.$1.typeRegistry", "type": "Object", "tags": [], "label": "typeRegistry", @@ -5097,7 +5097,7 @@ }, { "parentPluginId": "core", - "id": "def-server.SavedObjectsExporter.Unnamed.$1.savedObjectsClienttypeRegistryexportSizeLimitlogger.exportSizeLimit", + "id": "def-server.SavedObjectsExporter.Unnamed.$1.exportSizeLimit", "type": "number", "tags": [], "label": "exportSizeLimit", @@ -5107,7 +5107,7 @@ }, { "parentPluginId": "core", - "id": "def-server.SavedObjectsExporter.Unnamed.$1.savedObjectsClienttypeRegistryexportSizeLimitlogger.logger", + "id": "def-server.SavedObjectsExporter.Unnamed.$1.logger", "type": "Object", "tags": [], "label": "logger", @@ -5893,7 +5893,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.SavedObjectsImporter.Unnamed.$1.savedObjectsClienttypeRegistryimportSizeLimit", + "id": "def-server.SavedObjectsImporter.Unnamed.$1", "type": "Object", "tags": [], "label": "{\n savedObjectsClient,\n typeRegistry,\n importSizeLimit,\n }", @@ -5903,7 +5903,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.SavedObjectsImporter.Unnamed.$1.savedObjectsClienttypeRegistryimportSizeLimit.savedObjectsClient", + "id": "def-server.SavedObjectsImporter.Unnamed.$1.savedObjectsClient", "type": "Object", "tags": [], "label": "savedObjectsClient", @@ -6216,7 +6216,7 @@ }, { "parentPluginId": "core", - "id": "def-server.SavedObjectsImporter.Unnamed.$1.savedObjectsClienttypeRegistryimportSizeLimit.typeRegistry", + "id": "def-server.SavedObjectsImporter.Unnamed.$1.typeRegistry", "type": "Object", "tags": [], "label": "typeRegistry", @@ -6261,7 +6261,7 @@ }, { "parentPluginId": "core", - "id": "def-server.SavedObjectsImporter.Unnamed.$1.savedObjectsClienttypeRegistryimportSizeLimit.importSizeLimit", + "id": "def-server.SavedObjectsImporter.Unnamed.$1.importSizeLimit", "type": "number", "tags": [], "label": "importSizeLimit", @@ -9765,6 +9765,21 @@ ], "path": "src/core/server/saved_objects/service/saved_objects_client.ts", "deprecated": false + }, + { + "parentPluginId": "core", + "id": "def-server.SavedObjectsBulkGetObject.namespaces", + "type": "Array", + "tags": [], + "label": "namespaces", + "description": [ + "\nOptional namespace(s) for the object to be retrieved in. If this is defined, it will supersede the namespace ID that is in the\ntop-level options.\n\n* For shareable object types (registered with `namespaceType: 'multiple'`): this option can be used to specify one or more spaces,\n including the \"All spaces\" identifier (`'*'`).\n* For isolated object types (registered with `namespaceType: 'single'` or `namespaceType: 'multiple-isolated'`): this option can only\n be used to specify a single space, and the \"All spaces\" identifier (`'*'`) is not allowed.\n* For global object types (registered with `namespaceType: 'agnostic'`): this option cannot be used." + ], + "signature": [ + "string[] | undefined" + ], + "path": "src/core/server/saved_objects/service/saved_objects_client.ts", + "deprecated": false } ], "initialIsOpen": false @@ -15558,7 +15573,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.doc", + "id": "def-server.SavedObjectMigrationFn.$1", "type": "CompoundType", "tags": [], "label": "doc", @@ -15571,7 +15586,7 @@ }, { "parentPluginId": "core", - "id": "def-server.context", + "id": "def-server.SavedObjectMigrationFn.$2", "type": "Object", "tags": [], "label": "context", @@ -15957,7 +15972,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.__0", + "id": "def-server.SavedObjectsClientFactory.$1", "type": "Object", "tags": [], "label": "__0", @@ -16012,7 +16027,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.repositoryFactory", + "id": "def-server.SavedObjectsClientFactoryProvider.$1", "type": "Object", "tags": [], "label": "repositoryFactory", @@ -16066,7 +16081,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.options", + "id": "def-server.SavedObjectsClientWrapperFactory.$1", "type": "Object", "tags": [], "label": "options", @@ -16170,7 +16185,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.context", + "id": "def-server.SavedObjectsExportTransform.$1", "type": "Object", "tags": [], "label": "context", @@ -16189,7 +16204,7 @@ }, { "parentPluginId": "core", - "id": "def-server.objects", + "id": "def-server.SavedObjectsExportTransform.$2", "type": "Array", "tags": [], "label": "objects", @@ -16326,7 +16341,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.objects", + "id": "def-server.SavedObjectsImportHook.$1", "type": "Array", "tags": [], "label": "objects", @@ -16419,7 +16434,7 @@ "children": [ { "parentPluginId": "core", - "id": "def-server.toolkit", + "id": "def-server.SavedObjectTypeExcludeFromUpgradeFilterHook.$1", "type": "Object", "tags": [], "label": "toolkit", diff --git a/api_docs/core_saved_objects.mdx b/api_docs/core_saved_objects.mdx index c55776fb3f178..a1a05e9e1b249 100644 --- a/api_docs/core_saved_objects.mdx +++ b/api_docs/core_saved_objects.mdx @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2246 | 27 | 998 | 30 | +| 2249 | 27 | 997 | 30 | ## Client diff --git a/api_docs/dashboard.json b/api_docs/dashboard.json index 52ac3b6ad3b24..d9f9c7d848766 100644 --- a/api_docs/dashboard.json +++ b/api_docs/dashboard.json @@ -933,7 +933,7 @@ "children": [ { "parentPluginId": "dashboard", - "id": "def-public.state", + "id": "def-public.DashboardContainerFactoryDefinition.inject.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -946,7 +946,7 @@ }, { "parentPluginId": "dashboard", - "id": "def-public.references", + "id": "def-public.DashboardContainerFactoryDefinition.inject.$2", "type": "Array", "tags": [], "label": "references", @@ -994,7 +994,7 @@ "children": [ { "parentPluginId": "dashboard", - "id": "def-public.state", + "id": "def-public.DashboardContainerFactoryDefinition.extract.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -1117,231 +1117,6 @@ } ], "interfaces": [ - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardAppLocatorParams", - "type": "Interface", - "tags": [], - "label": "DashboardAppLocatorParams", - "description": [], - "signature": [ - { - "pluginId": "dashboard", - "scope": "public", - "docId": "kibDashboardPluginApi", - "section": "def-public.DashboardAppLocatorParams", - "text": "DashboardAppLocatorParams" - }, - " extends ", - "SerializableRecord" - ], - "path": "src/plugins/dashboard/public/locator.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardAppLocatorParams.dashboardId", - "type": "string", - "tags": [], - "label": "dashboardId", - "description": [ - "\nIf given, the dashboard saved object with this id will be loaded. If not given,\na new, unsaved dashboard will be loaded up." - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/dashboard/public/locator.ts", - "deprecated": false - }, - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardAppLocatorParams.timeRange", - "type": "Object", - "tags": [], - "label": "timeRange", - "description": [ - "\nOptionally set the time range in the time picker." - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" - }, - " | undefined" - ], - "path": "src/plugins/dashboard/public/locator.ts", - "deprecated": false - }, - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardAppLocatorParams.refreshInterval", - "type": "CompoundType", - "tags": [], - "label": "refreshInterval", - "description": [ - "\nOptionally set the refresh interval." - ], - "signature": [ - "(", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.RefreshInterval", - "text": "RefreshInterval" - }, - " & ", - "SerializableRecord", - ") | undefined" - ], - "path": "src/plugins/dashboard/public/locator.ts", - "deprecated": false - }, - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardAppLocatorParams.filters", - "type": "Array", - "tags": [], - "label": "filters", - "description": [ - "\nOptionally apply filers. NOTE: if given and used in conjunction with `dashboardId`, and the\nsaved dashboard has filters saved with it, this will _replace_ those filters." - ], - "signature": [ - "Filter", - "[] | undefined" - ], - "path": "src/plugins/dashboard/public/locator.ts", - "deprecated": false - }, - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardAppLocatorParams.query", - "type": "Object", - "tags": [], - "label": "query", - "description": [ - "\nOptionally set a query. NOTE: if given and used in conjunction with `dashboardId`, and the\nsaved dashboard has a query saved with it, this will _replace_ that query." - ], - "signature": [ - "Query", - " | undefined" - ], - "path": "src/plugins/dashboard/public/locator.ts", - "deprecated": false - }, - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardAppLocatorParams.useHash", - "type": "CompoundType", - "tags": [], - "label": "useHash", - "description": [ - "\nIf not given, will use the uiSettings configuration for `storeInSessionStorage`. useHash determines\nwhether to hash the data in the url to avoid url length issues." - ], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/dashboard/public/locator.ts", - "deprecated": false - }, - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardAppLocatorParams.preserveSavedFilters", - "type": "CompoundType", - "tags": [], - "label": "preserveSavedFilters", - "description": [ - "\nWhen `true` filters from saved filters from destination dashboard as merged with applied filters\nWhen `false` applied filters take precedence and override saved filters\n\ntrue is default" - ], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/dashboard/public/locator.ts", - "deprecated": false - }, - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardAppLocatorParams.viewMode", - "type": "CompoundType", - "tags": [], - "label": "viewMode", - "description": [ - "\nView mode of the dashboard." - ], - "signature": [ - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.ViewMode", - "text": "ViewMode" - }, - " | undefined" - ], - "path": "src/plugins/dashboard/public/locator.ts", - "deprecated": false - }, - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardAppLocatorParams.searchSessionId", - "type": "string", - "tags": [], - "label": "searchSessionId", - "description": [ - "\nSearch search session ID to restore.\n(Background search)" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/dashboard/public/locator.ts", - "deprecated": false - }, - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardAppLocatorParams.panels", - "type": "CompoundType", - "tags": [], - "label": "panels", - "description": [ - "\nList of dashboard panels" - ], - "signature": [ - "(", - { - "pluginId": "dashboard", - "scope": "common", - "docId": "kibDashboardPluginApi", - "section": "def-common.SavedDashboardPanel730ToLatest", - "text": "SavedDashboardPanel730ToLatest" - }, - "[] & ", - "SerializableRecord", - ") | undefined" - ], - "path": "src/plugins/dashboard/public/locator.ts", - "deprecated": false - }, - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardAppLocatorParams.savedQuery", - "type": "string", - "tags": [], - "label": "savedQuery", - "description": [ - "\nSaved query ID" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/dashboard/public/locator.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, { "parentPluginId": "dashboard", "id": "def-public.DashboardContainerInput", @@ -2289,6 +2064,60 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "dashboard", + "id": "def-public.DashboardAppLocatorParams", + "type": "Type", + "tags": [], + "label": "DashboardAppLocatorParams", + "description": [ + "\nWe use `type` instead of `interface` to avoid having to extend this type with\n`SerializableRecord`. See https://github.com/microsoft/TypeScript/issues/15300." + ], + "signature": [ + "{ dashboardId?: string | undefined; timeRange?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, + " | undefined; refreshInterval?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.RefreshInterval", + "text": "RefreshInterval" + }, + " | undefined; filters?: ", + "Filter", + "[] | undefined; query?: ", + "Query", + " | undefined; useHash?: boolean | undefined; preserveSavedFilters?: boolean | undefined; viewMode?: ", + { + "pluginId": "embeddable", + "scope": "common", + "docId": "kibEmbeddablePluginApi", + "section": "def-common.ViewMode", + "text": "ViewMode" + }, + " | undefined; searchSessionId?: string | undefined; panels?: ", + { + "pluginId": "dashboard", + "scope": "common", + "docId": "kibDashboardPluginApi", + "section": "def-common.SavedDashboardPanel730ToLatest", + "text": "SavedDashboardPanel730ToLatest" + }, + "[] | undefined; savedQuery?: string | undefined; options?: ", + "DashboardOptions", + " | undefined; }" + ], + "path": "src/plugins/dashboard/public/locator.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "dashboard", "id": "def-public.DashboardUrlGenerator", @@ -2622,7 +2451,9 @@ "section": "def-server.SavedObjectsRepository", "text": "SavedObjectsRepository" }, - ", \"get\" | \"delete\" | \"create\" | \"bulkCreate\" | \"checkConflicts\" | \"deleteByNamespace\" | \"find\" | \"bulkGet\" | \"resolve\" | \"update\" | \"collectMultiNamespaceReferences\" | \"updateObjectsSpaces\" | \"bulkUpdate\" | \"removeReferencesTo\" | \"incrementCounter\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\">, \"find\">, embeddableType: string) => Promise<{ [key: string]: unknown; }[]>" + ", \"get\" | \"delete\" | \"create\" | \"bulkCreate\" | \"checkConflicts\" | \"deleteByNamespace\" | \"find\" | \"bulkGet\" | \"resolve\" | \"update\" | \"collectMultiNamespaceReferences\" | \"updateObjectsSpaces\" | \"bulkUpdate\" | \"removeReferencesTo\" | \"incrementCounter\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\">, \"find\">, embeddableType: string) => Promise<{ [key: string]: ", + "Serializable", + "; }[]>" ], "path": "src/plugins/dashboard/server/usage/find_by_value_embeddables.ts", "deprecated": false, @@ -2750,7 +2581,9 @@ "section": "def-common.SavedDashboardPanel630", "text": "SavedDashboardPanel630" }, - ")[], version: string, useMargins: boolean, uiState: { [key: string]: { [key: string]: unknown; }; } | undefined) => ", + ")[], version: string, useMargins: boolean, uiState: { [key: string]: ", + "SerializableRecord", + "; } | undefined) => ", { "pluginId": "dashboard", "scope": "common", @@ -2847,7 +2680,7 @@ }, { "parentPluginId": "dashboard", - "id": "def-common.migratePanelsTo730.$4.uiState", + "id": "def-common.migratePanelsTo730.$4", "type": "Object", "tags": [], "label": "uiState", @@ -2857,7 +2690,7 @@ "children": [ { "parentPluginId": "dashboard", - "id": "def-common.migratePanelsTo730.$4.uiState.Unnamed", + "id": "def-common.migratePanelsTo730.$4.Unnamed", "type": "Any", "tags": [], "label": "Unnamed", @@ -2928,69 +2761,6 @@ } ], "initialIsOpen": false - }, - { - "parentPluginId": "dashboard", - "id": "def-common.GridData", - "type": "Interface", - "tags": [], - "label": "GridData", - "description": [], - "path": "src/plugins/dashboard/common/embeddable/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "dashboard", - "id": "def-common.GridData.w", - "type": "number", - "tags": [], - "label": "w", - "description": [], - "path": "src/plugins/dashboard/common/embeddable/types.ts", - "deprecated": false - }, - { - "parentPluginId": "dashboard", - "id": "def-common.GridData.h", - "type": "number", - "tags": [], - "label": "h", - "description": [], - "path": "src/plugins/dashboard/common/embeddable/types.ts", - "deprecated": false - }, - { - "parentPluginId": "dashboard", - "id": "def-common.GridData.x", - "type": "number", - "tags": [], - "label": "x", - "description": [], - "path": "src/plugins/dashboard/common/embeddable/types.ts", - "deprecated": false - }, - { - "parentPluginId": "dashboard", - "id": "def-common.GridData.y", - "type": "number", - "tags": [], - "label": "y", - "description": [], - "path": "src/plugins/dashboard/common/embeddable/types.ts", - "deprecated": false - }, - { - "parentPluginId": "dashboard", - "id": "def-common.GridData.i", - "type": "string", - "tags": [], - "label": "i", - "description": [], - "path": "src/plugins/dashboard/common/embeddable/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false } ], "enums": [], @@ -3037,6 +2807,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "dashboard", + "id": "def-common.GridData", + "type": "Type", + "tags": [], + "label": "GridData", + "description": [], + "signature": [ + "{ w: number; h: number; x: number; y: number; i: string; }" + ], + "path": "src/plugins/dashboard/common/embeddable/types.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "dashboard", "id": "def-common.RawSavedDashboardPanel730ToLatest", diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index 82acfd3cb8cea..eb9ec6e8c1781 100644 --- a/api_docs/dashboard.mdx +++ b/api_docs/dashboard.mdx @@ -18,7 +18,7 @@ Contact [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-prese | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 161 | 1 | 138 | 9 | +| 145 | 1 | 132 | 10 | ## Client diff --git a/api_docs/dashboard_enhanced.json b/api_docs/dashboard_enhanced.json index 00833c9762326..182c66b721972 100644 --- a/api_docs/dashboard_enhanced.json +++ b/api_docs/dashboard_enhanced.json @@ -608,8 +608,16 @@ "; url: ", "UrlService", "; navigate(options: ", - "RedirectOptions", - "): void; }" + { + "pluginId": "share", + "scope": "public", + "docId": "kibSharePluginApi", + "section": "def-public.RedirectOptions", + "text": "RedirectOptions" + }, + "<", + "SerializableRecord", + ">): void; }" ], "path": "x-pack/plugins/dashboard_enhanced/public/plugin.ts", "deprecated": false @@ -705,8 +713,16 @@ "; url: ", "UrlService", "; navigate(options: ", - "RedirectOptions", - "): void; }" + { + "pluginId": "share", + "scope": "public", + "docId": "kibSharePluginApi", + "section": "def-public.RedirectOptions", + "text": "RedirectOptions" + }, + "<", + "SerializableRecord", + ">): void; }" ], "path": "x-pack/plugins/dashboard_enhanced/public/plugin.ts", "deprecated": false @@ -908,7 +924,7 @@ "children": [ { "parentPluginId": "dashboardEnhanced", - "id": "def-common.createExtract.$1.drilldownId", + "id": "def-common.createExtract.$1", "type": "Object", "tags": [], "label": "{\n drilldownId,\n}", @@ -918,7 +934,7 @@ "children": [ { "parentPluginId": "dashboardEnhanced", - "id": "def-common.createExtract.$1.drilldownId.drilldownId", + "id": "def-common.createExtract.$1.drilldownId", "type": "string", "tags": [], "label": "drilldownId", @@ -964,7 +980,7 @@ "children": [ { "parentPluginId": "dashboardEnhanced", - "id": "def-common.createInject.$1.drilldownId", + "id": "def-common.createInject.$1", "type": "Object", "tags": [], "label": "{\n drilldownId,\n}", @@ -974,7 +990,7 @@ "children": [ { "parentPluginId": "dashboardEnhanced", - "id": "def-common.createInject.$1.drilldownId.drilldownId", + "id": "def-common.createInject.$1.drilldownId", "type": "string", "tags": [], "label": "drilldownId", diff --git a/api_docs/data.json b/api_docs/data.json index d0cbb6851a8fe..e62ddb5e30f12 100644 --- a/api_docs/data.json +++ b/api_docs/data.json @@ -2300,7 +2300,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-public.agg", + "id": "def-public.AggParamType.makeAgg.$1", "type": "Uncategorized", "tags": [], "label": "agg", @@ -2313,7 +2313,7 @@ }, { "parentPluginId": "data", - "id": "def-public.state", + "id": "def-public.AggParamType.makeAgg.$2", "type": "Object", "tags": [], "label": "state", @@ -2634,18 +2634,18 @@ }, { "parentPluginId": "data", - "id": "def-public.DuplicateIndexPatternError", + "id": "def-public.DuplicateDataViewError", "type": "Class", "tags": [], - "label": "DuplicateIndexPatternError", + "label": "DuplicateDataViewError", "description": [], "signature": [ { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.DuplicateIndexPatternError", - "text": "DuplicateIndexPatternError" + "section": "def-common.DuplicateDataViewError", + "text": "DuplicateDataViewError" }, " extends Error" ], @@ -2654,7 +2654,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-public.DuplicateIndexPatternError.Unnamed", + "id": "def-public.DuplicateDataViewError.Unnamed", "type": "Function", "tags": [], "label": "Constructor", @@ -2667,7 +2667,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-public.DuplicateIndexPatternError.Unnamed.$1", + "id": "def-public.DuplicateDataViewError.Unnamed.$1", "type": "string", "tags": [], "label": "message", @@ -2689,7 +2689,9 @@ "parentPluginId": "data", "id": "def-public.IndexPattern", "type": "Class", - "tags": [], + "tags": [ + "deprecated" + ], "label": "IndexPattern", "description": [], "signature": [ @@ -2700,7894 +2702,1161 @@ "section": "def-common.IndexPattern", "text": "IndexPattern" }, - " implements ", + " extends ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IIndexPattern", - "text": "IIndexPattern" + "section": "def-common.DataView", + "text": "DataView" } ], "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ + "deprecated": true, + "references": [ { - "parentPluginId": "data", - "id": "def-public.IndexPattern.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.fieldFormatMap", - "type": "Object", - "tags": [], - "label": "fieldFormatMap", - "description": [], - "signature": [ - "{ [x: string]: any; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.typeMeta", - "type": "Object", - "tags": [], - "label": "typeMeta", - "description": [ - "\nOnly used by rollup indices, used by rollup specific endpoint to load field list" - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.TypeMeta", - "text": "TypeMeta" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.fields", - "type": "CompoundType", - "tags": [], - "label": "fields", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IIndexPatternFieldList", - "text": "IIndexPatternFieldList" - }, - " & { toSpec: () => Record; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "reporting", + "path": "x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.timeFieldName", - "type": "string", - "tags": [], - "label": "timeFieldName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "reporting", + "path": "x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.intervalName", - "type": "string", - "tags": [ - "deprecated" - ], - "label": "intervalName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.type", - "type": "string", - "tags": [], - "label": "type", - "description": [ - "\nType is used to identify rollup index patterns" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.formatHit", - "type": "Function", - "tags": [], - "label": "formatHit", - "description": [], - "signature": [ - "{ (hit: Record, type?: string | undefined): any; formatField: FormatFieldFn; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.hit", - "type": "Object", - "tags": [], - "label": "hit", - "description": [], - "signature": [ - "{ [x: string]: any; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false - } - ] + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/columns.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.formatField", - "type": "Function", - "tags": [], - "label": "formatField", - "description": [], - "signature": [ - "(hit: Record, fieldName: string) => any" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.hit", - "type": "Object", - "tags": [], - "label": "hit", - "description": [], - "signature": [ - "{ [x: string]: any; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.fieldName", - "type": "string", - "tags": [], - "label": "fieldName", - "description": [], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false - } - ] + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/columns.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.flattenHit", - "type": "Function", - "tags": [], - "label": "flattenHit", - "description": [], - "signature": [ - "(hit: Record, deep?: boolean | undefined) => Record" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.hit", - "type": "Object", - "tags": [], - "label": "hit", - "description": [], - "signature": [ - "{ [x: string]: any; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.deep", - "type": "CompoundType", - "tags": [], - "label": "deep", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false - } - ] + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/helpers/update_search_source.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.metaFields", - "type": "Array", - "tags": [], - "label": "metaFields", - "description": [], - "signature": [ - "string[]" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/helpers/update_search_source.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.version", - "type": "string", - "tags": [], - "label": "version", - "description": [ - "\nSavedObject version" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.sourceFilters", - "type": "Array", - "tags": [], - "label": "sourceFilters", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.SourceFilter", - "text": "SourceFilter" - }, - "[] | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.allowNoIndex", - "type": "boolean", - "tags": [], - "label": "allowNoIndex", - "description": [ - "\nprevents errors when index pattern exists before indices" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/services/use_es_doc_search.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.Unnamed.$1", - "type": "Object", - "tags": [], - "label": "{\n spec = {},\n fieldFormats,\n shortDotsEnable = false,\n metaFields = [],\n }", - "description": [], - "signature": [ - "IndexPatternDeps" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/services/use_es_doc_search.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.getOriginalSavedObjectBody", - "type": "Function", - "tags": [], - "label": "getOriginalSavedObjectBody", - "description": [ - "\nGet last saved saved object fields" - ], - "signature": [ - "() => { fieldAttrs?: string | undefined; title?: string | undefined; timeFieldName?: string | undefined; intervalName?: string | undefined; fields?: string | undefined; sourceFilters?: string | undefined; fieldFormatMap?: string | undefined; typeMeta?: string | undefined; type?: string | undefined; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/services/use_es_doc_search.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.resetOriginalSavedObjectBody", - "type": "Function", - "tags": [], - "label": "resetOriginalSavedObjectBody", - "description": [ - "\nReset last saved saved object fields. used after saving" - ], - "signature": [ - "() => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/services/use_es_doc_search.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.getFieldAttrs", - "type": "Function", - "tags": [], - "label": "getFieldAttrs", - "description": [], - "signature": [ - "() => { [x: string]: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldAttrSet", - "text": "FieldAttrSet" - }, - "; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app_content.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.getComputedFields", - "type": "Function", - "tags": [], - "label": "getComputedFields", - "description": [], - "signature": [ - "() => { storedFields: string[]; scriptFields: any; docvalueFields: { field: any; format: string; }[]; runtimeFields: Record; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app_content.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.toSpec", - "type": "Function", - "tags": [], - "label": "toSpec", - "description": [ - "\nCreate static representation of index pattern" - ], - "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.getSourceFiltering", - "type": "Function", - "tags": [], - "label": "getSourceFiltering", - "description": [ - "\nGet the source filtering configuration for that index." - ], - "signature": [ - "() => { excludes: any[]; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.addScriptedField", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "addScriptedField", - "description": [ - "\nAdd scripted field to field list\n" - ], - "signature": [ - "(name: string, script: string, fieldType?: string) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.addScriptedField.$1", - "type": "string", - "tags": [], - "label": "name", - "description": [ - "field name" - ], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.addScriptedField.$2", - "type": "string", - "tags": [], - "label": "script", - "description": [ - "script code" - ], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.addScriptedField.$3", - "type": "string", - "tags": [], - "label": "fieldType", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_index_pattern.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.removeScriptedField", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "removeScriptedField", - "description": [ - "\nRemove scripted field from field list" - ], - "signature": [ - "(fieldName: string) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ - { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" - }, - { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" - } - ], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.removeScriptedField.$1", - "type": "string", - "tags": [], - "label": "fieldName", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_index_pattern.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.getNonScriptedFields", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "getNonScriptedFields", - "description": [ - "\n" - ], - "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - "[]" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" - }, - { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" - }, - { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" - }, - { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" - }, - { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_type_timeseries/public/application/lib/fetch_fields.ts" - } - ], - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.getScriptedFields", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "getScriptedFields", - "description": [ - "\n" - ], - "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - "[]" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ - { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" - } - ], - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.isTimeBased", - "type": "Function", - "tags": [], - "label": "isTimeBased", - "description": [], - "signature": [ - "() => boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/update_search_source.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.isTimeNanosBased", - "type": "Function", - "tags": [], - "label": "isTimeNanosBased", - "description": [], - "signature": [ - "() => boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/update_search_source.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.getTimeField", - "type": "Function", - "tags": [], - "label": "getTimeField", - "description": [], - "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/types.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.getFieldByName", - "type": "Function", - "tags": [], - "label": "getFieldByName", - "description": [], - "signature": [ - "(name: string) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.getFieldByName.$1", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/types.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.getAggregationRestrictions", - "type": "Function", - "tags": [], - "label": "getAggregationRestrictions", - "description": [], - "signature": [ - "() => Record> | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/discover_documents.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.getAsSavedObjectBody", - "type": "Function", - "tags": [], - "label": "getAsSavedObjectBody", - "description": [ - "\nReturns index pattern as saved object body for saving" - ], - "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternAttributes", - "text": "IndexPatternAttributes" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/discover_documents.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.getFormatterForField", - "type": "Function", - "tags": [], - "label": "getFormatterForField", - "description": [ - "\nProvide a field, get its formatter" - ], - "signature": [ - "(field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") => ", - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormat", - "text": "FieldFormat" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.getFormatterForField.$1", - "type": "CompoundType", - "tags": [], - "label": "field", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.addRuntimeField", - "type": "Function", - "tags": [], - "label": "addRuntimeField", - "description": [ - "\nAdd a runtime field - Appended to existing mapped field or a new field is\ncreated as appropriate" - ], - "signature": [ - "(name: string, runtimeField: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" - }, - ") => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.addRuntimeField.$1", - "type": "string", - "tags": [], - "label": "name", - "description": [ - "Field name" - ], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.addRuntimeField.$2", - "type": "Object", - "tags": [], - "label": "runtimeField", - "description": [ - "Runtime field definition" - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.hasRuntimeField", - "type": "Function", - "tags": [], - "label": "hasRuntimeField", - "description": [ - "\nChecks if runtime field exists" - ], - "signature": [ - "(name: string) => boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.hasRuntimeField.$1", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.getRuntimeField", - "type": "Function", - "tags": [], - "label": "getRuntimeField", - "description": [ - "\nReturns runtime field if exists" - ], - "signature": [ - "(name: string) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" - }, - " | null" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.getRuntimeField.$1", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.replaceAllRuntimeFields", - "type": "Function", - "tags": [], - "label": "replaceAllRuntimeFields", - "description": [ - "\nReplaces all existing runtime fields with new fields" - ], - "signature": [ - "(newFields: Record) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.replaceAllRuntimeFields.$1", - "type": "Object", - "tags": [], - "label": "newFields", - "description": [], - "signature": [ - "Record" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.removeRuntimeField", - "type": "Function", - "tags": [], - "label": "removeRuntimeField", - "description": [ - "\nRemove a runtime field - removed from mapped field or removed unmapped\nfield as appropriate. Doesn't clear associated field attributes." - ], - "signature": [ - "(name: string) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.removeRuntimeField.$1", - "type": "string", - "tags": [], - "label": "name", - "description": [ - "- Field name to remove" - ], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.getFormatterForFieldNoDefault", - "type": "Function", - "tags": [], - "label": "getFormatterForFieldNoDefault", - "description": [ - "\nGet formatter for a given field name. Return undefined if none exists" - ], - "signature": [ - "(fieldname: string) => ", - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormat", - "text": "FieldFormat" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.getFormatterForFieldNoDefault.$1", - "type": "string", - "tags": [], - "label": "fieldname", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.setFieldAttrs", - "type": "Function", - "tags": [], - "label": "setFieldAttrs", - "description": [], - "signature": [ - "(fieldName: string, attrName: K, value: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldAttrSet", - "text": "FieldAttrSet" - }, - "[K]) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.setFieldAttrs.$1", - "type": "string", - "tags": [], - "label": "fieldName", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.setFieldAttrs.$2", - "type": "Uncategorized", - "tags": [], - "label": "attrName", - "description": [], - "signature": [ - "K" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.setFieldAttrs.$3", - "type": "Uncategorized", - "tags": [], - "label": "value", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldAttrSet", - "text": "FieldAttrSet" - }, - "[K]" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.setFieldCustomLabel", - "type": "Function", - "tags": [], - "label": "setFieldCustomLabel", - "description": [], - "signature": [ - "(fieldName: string, customLabel: string | null | undefined) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.setFieldCustomLabel.$1", - "type": "string", - "tags": [], - "label": "fieldName", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.setFieldCustomLabel.$2", - "type": "CompoundType", - "tags": [], - "label": "customLabel", - "description": [], - "signature": [ - "string | null | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [] + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.setFieldCount", - "type": "Function", - "tags": [], - "label": "setFieldCount", - "description": [], - "signature": [ - "(fieldName: string, count: number | null | undefined) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.setFieldCount.$1", - "type": "string", - "tags": [], - "label": "fieldName", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.setFieldCount.$2", - "type": "CompoundType", - "tags": [], - "label": "count", - "description": [], - "signature": [ - "number | null | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [] + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.setFieldFormat", - "type": "Function", - "tags": [], - "label": "setFieldFormat", - "description": [], - "signature": [ - "(fieldName: string, format: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.SerializedFieldFormat", - "text": "SerializedFieldFormat" - }, - ">) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.setFieldFormat.$1", - "type": "string", - "tags": [], - "label": "fieldName", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.setFieldFormat.$2", - "type": "Object", - "tags": [], - "label": "format", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.SerializedFieldFormat", - "text": "SerializedFieldFormat" - }, - ">" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "maps", + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPattern.deleteFieldFormat", - "type": "Function", - "tags": [], - "label": "deleteFieldFormat", - "description": [], - "signature": [ - "(fieldName: string) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPattern.deleteFieldFormat.$1", - "type": "string", - "tags": [], - "label": "fieldName", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternField", - "type": "Class", - "tags": [], - "label": "IndexPatternField", - "description": [], - "signature": [ + "plugin": "maps", + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts" }, - " implements ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - } - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false, - "children": [ + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts" + }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.spec", - "type": "Object", - "tags": [], - "label": "spec", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.Unnamed.$1", - "type": "Object", - "tags": [], - "label": "spec", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.count", - "type": "number", - "tags": [], - "label": "count", - "description": [ - "\nCount is used for field popularity" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.count", - "type": "number", - "tags": [], - "label": "count", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.runtimeField", - "type": "Object", - "tags": [], - "label": "runtimeField", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.runtimeField", - "type": "Object", - "tags": [], - "label": "runtimeField", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.script", - "type": "string", - "tags": [], - "label": "script", - "description": [ - "\nScript field code" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/types/index.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.script", - "type": "string", - "tags": [], - "label": "script", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/types/index.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.lang", - "type": "CompoundType", - "tags": [], - "label": "lang", - "description": [ - "\nScript field language" - ], - "signature": [ - "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.lang", - "type": "CompoundType", - "tags": [], - "label": "lang", - "description": [], - "signature": [ - "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.customLabel", - "type": "string", - "tags": [], - "label": "customLabel", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.customLabel", - "type": "string", - "tags": [], - "label": "customLabel", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.conflictDescriptions", - "type": "Object", - "tags": [], - "label": "conflictDescriptions", - "description": [ - "\nDescription of field type conflicts across different indices in the same index pattern" - ], - "signature": [ - "Record | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.conflictDescriptions", - "type": "Object", - "tags": [], - "label": "conflictDescriptions", - "description": [], - "signature": [ - "Record | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.name", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.displayName", - "type": "string", - "tags": [], - "label": "displayName", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.esTypes", - "type": "Array", - "tags": [], - "label": "esTypes", - "description": [], - "signature": [ - "string[] | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.scripted", - "type": "boolean", - "tags": [], - "label": "scripted", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.searchable", - "type": "boolean", - "tags": [], - "label": "searchable", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.aggregatable", - "type": "boolean", - "tags": [], - "label": "aggregatable", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.readFromDocValues", - "type": "boolean", - "tags": [], - "label": "readFromDocValues", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.subType", - "type": "Object", - "tags": [], - "label": "subType", - "description": [], - "signature": [ - "IFieldSubType", - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.isMapped", - "type": "CompoundType", - "tags": [], - "label": "isMapped", - "description": [ - "\nIs the field part of the index mapping?" - ], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.sortable", - "type": "boolean", - "tags": [], - "label": "sortable", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.filterable", - "type": "boolean", - "tags": [], - "label": "filterable", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/index.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.visualizable", - "type": "boolean", - "tags": [], - "label": "visualizable", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/index.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.deleteCount", - "type": "Function", - "tags": [], - "label": "deleteCount", - "description": [], - "signature": [ - "() => void" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/index.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.toJSON", - "type": "Function", - "tags": [], - "label": "toJSON", - "description": [], - "signature": [ - "() => { count: number; script: string | undefined; lang: \"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined; conflictDescriptions: Record | undefined; name: string; type: string; esTypes: string[] | undefined; scripted: boolean; searchable: boolean; aggregatable: boolean; readFromDocValues: boolean; subType: ", - "IFieldSubType", - " | undefined; customLabel: string | undefined; }" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "transform", + "path": "x-pack/plugins/transform/common/types/index_pattern.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.toSpec", - "type": "Function", - "tags": [], - "label": "toSpec", - "description": [], - "signature": [ - "({ getFormatterForField, }?: { getFormatterForField?: ((field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") => ", - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormat", - "text": "FieldFormat" - }, - ") | undefined; }) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.toSpec.$1.getFormatterForField", - "type": "Object", - "tags": [], - "label": "{\n getFormatterForField,\n }", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternField.toSpec.$1.getFormatterForField.getFormatterForField", - "type": "Function", - "tags": [], - "label": "getFormatterForField", - "description": [], - "signature": [ - "((field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") => ", - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormat", - "text": "FieldFormat" - }, - ") | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false - } - ] - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService", - "type": "Class", - "tags": [], - "label": "IndexPatternsService", - "description": [], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ + "plugin": "transform", + "path": "x-pack/plugins/transform/common/types/index_pattern.ts" + }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.ensureDefaultIndexPattern", - "type": "Function", - "tags": [], - "label": "ensureDefaultIndexPattern", - "description": [], - "signature": [ - "() => Promise | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "returnComment": [], - "children": [] + "plugin": "transform", + "path": "x-pack/plugins/transform/common/types/index_pattern.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.Unnamed.$1", - "type": "Object", - "tags": [], - "label": "{\n uiSettings,\n savedObjectsClient,\n apiClient,\n fieldFormats,\n onNotification,\n onError,\n onRedirectNoIndexPattern = () => {},\n }", - "description": [], - "signature": [ - "IndexPatternsServiceDeps" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "transform", + "path": "x-pack/plugins/transform/common/types/index_pattern.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.getIds", - "type": "Function", - "tags": [], - "label": "getIds", - "description": [ - "\nGet list of index pattern ids" - ], - "signature": [ - "(refresh?: boolean) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.getIds.$1", - "type": "boolean", - "tags": [], - "label": "refresh", - "description": [ - "Force refresh of index pattern list" - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "infra", + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.getTitles", - "type": "Function", - "tags": [], - "label": "getTitles", - "description": [ - "\nGet list of index pattern titles" - ], - "signature": [ - "(refresh?: boolean) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.getTitles.$1", - "type": "boolean", - "tags": [], - "label": "refresh", - "description": [ - "Force refresh of index pattern list" - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "infra", + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.find", - "type": "Function", - "tags": [], - "label": "find", - "description": [ - "\nFind and load index patterns by title" - ], - "signature": [ - "(search: string, size?: number) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - "[]>" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.find.$1", - "type": "string", - "tags": [], - "label": "search", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.find.$2", - "type": "number", - "tags": [], - "label": "size", - "description": [], - "signature": [ - "number" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "IndexPattern[]" - ] + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.getIdsWithTitle", - "type": "Function", - "tags": [], - "label": "getIdsWithTitle", - "description": [ - "\nGet list of index pattern ids with titles" - ], - "signature": [ - "(refresh?: boolean) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternListItem", - "text": "IndexPatternListItem" - }, - "[]>" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.getIdsWithTitle.$1", - "type": "boolean", - "tags": [], - "label": "refresh", - "description": [ - "Force refresh of index pattern list" - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.clearCache", - "type": "Function", - "tags": [], - "label": "clearCache", - "description": [ - "\nClear index pattern list cache" - ], - "signature": [ - "(id?: string | undefined) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.clearCache.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [ - "optionally clear a single id" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [] + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.getCache", - "type": "Function", - "tags": [], - "label": "getCache", - "description": [], - "signature": [ - "() => Promise<", - "SavedObject", - ">[] | null | undefined>" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.getDefault", - "type": "Function", - "tags": [], - "label": "getDefault", - "description": [ - "\nGet default index pattern" - ], - "signature": [ - "() => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - " | null>" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.getDefaultId", - "type": "Function", - "tags": [], - "label": "getDefaultId", - "description": [ - "\nGet default index pattern id" - ], - "signature": [ - "() => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.setDefault", - "type": "Function", - "tags": [], - "label": "setDefault", - "description": [ - "\nOptionally set default index pattern, unless force = true" - ], - "signature": [ - "(id: string | null, force?: boolean) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.setDefault.$1", - "type": "CompoundType", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string | null" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": false - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.setDefault.$2", - "type": "boolean", - "tags": [], - "label": "force", - "description": [], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.hasUserIndexPattern", - "type": "Function", - "tags": [], - "label": "hasUserIndexPattern", - "description": [ - "\nChecks if current user has a user created index pattern ignoring fleet's server default index patterns" - ], - "signature": [ - "() => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.getFieldsForWildcard", - "type": "Function", - "tags": [], - "label": "getFieldsForWildcard", - "description": [ - "\nGet field list by providing { pattern }" - ], - "signature": [ - "(options: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" - }, - ") => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.getFieldsForWildcard.$1", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "FieldSpec[]" - ] + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/existing_fields.d.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.getFieldsForIndexPattern", - "type": "Function", - "tags": [], - "label": "getFieldsForIndexPattern", - "description": [ - "\nGet field list by providing an index patttern (or spec)" - ], - "signature": [ - "(indexPattern: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - }, - ", options?: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" - }, - " | undefined) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.getFieldsForIndexPattern.$1", - "type": "CompoundType", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.getFieldsForIndexPattern.$2", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [ - "FieldSpec[]" - ] + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/existing_fields.d.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.refreshFields", - "type": "Function", - "tags": [], - "label": "refreshFields", - "description": [ - "\nRefresh field list for a given index pattern" - ], - "signature": [ - "(indexPattern: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ") => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.refreshFields.$1", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.fieldArrayToMap", - "type": "Function", - "tags": [], - "label": "fieldArrayToMap", - "description": [ - "\nConverts field array to map" - ], - "signature": [ - "(fields: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - "[], fieldAttrs?: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldAttrs", - "text": "FieldAttrs" - }, - " | undefined) => Record" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.fieldArrayToMap.$1", - "type": "Array", - "tags": [], - "label": "fields", - "description": [ - ": FieldSpec[]" - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - "[]" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.fieldArrayToMap.$2", - "type": "Object", - "tags": [], - "label": "fieldAttrs", - "description": [ - ": FieldAttrs" - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldAttrs", - "text": "FieldAttrs" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [ - "Record" - ] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.savedObjectToSpec", - "type": "Function", - "tags": [], - "label": "savedObjectToSpec", - "description": [ - "\nConverts index pattern saved object to index pattern spec" - ], - "signature": [ - "(savedObject: ", - "SavedObject", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternAttributes", - "text": "IndexPatternAttributes" - }, - ">) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.savedObjectToSpec.$1", - "type": "Object", - "tags": [], - "label": "savedObject", - "description": [], - "signature": [ - "SavedObject", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternAttributes", - "text": "IndexPatternAttributes" - }, - ">" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "IndexPatternSpec" - ] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.get", - "type": "Function", - "tags": [], - "label": "get", - "description": [ - "\nGet an index pattern by id. Cache optimized" - ], - "signature": [ - "(id: string) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ">" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.get.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.create", - "type": "Function", - "tags": [], - "label": "create", - "description": [ - "\nCreate a new index pattern instance" - ], - "signature": [ - "(spec: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - }, - ", skipFetchFields?: boolean) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ">" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.create.$1", - "type": "Object", - "tags": [], - "label": "spec", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.create.$2", - "type": "boolean", - "tags": [], - "label": "skipFetchFields", - "description": [], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "IndexPattern" - ] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/types.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.createAndSave", - "type": "Function", - "tags": [], - "label": "createAndSave", - "description": [ - "\nCreate a new index pattern and save it right away" - ], - "signature": [ - "(spec: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - }, - ", override?: boolean, skipFetchFields?: boolean) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ">" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.createAndSave.$1", - "type": "Object", - "tags": [], - "label": "spec", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.createAndSave.$2", - "type": "boolean", - "tags": [], - "label": "override", - "description": [ - "Overwrite if existing index pattern exists." - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.createAndSave.$3", - "type": "boolean", - "tags": [], - "label": "skipFetchFields", - "description": [ - "Whether to skip field refresh step." - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/types.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.createSavedObject", - "type": "Function", - "tags": [], - "label": "createSavedObject", - "description": [ - "\nSave a new index pattern" - ], - "signature": [ - "(indexPattern: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ", override?: boolean) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ">" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.createSavedObject.$1", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.createSavedObject.$2", - "type": "boolean", - "tags": [], - "label": "override", - "description": [ - "Overwrite if existing index pattern exists" - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/index_pattern_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.updateSavedObject", - "type": "Function", - "tags": [], - "label": "updateSavedObject", - "description": [ - "\nSave existing index pattern. Will attempt to merge differences if there are conflicts" - ], - "signature": [ - "(indexPattern: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ", saveAttempts?: number, ignoreErrors?: boolean) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.updateSavedObject.$1", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.updateSavedObject.$2", - "type": "number", - "tags": [], - "label": "saveAttempts", - "description": [], - "signature": [ - "number" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.updateSavedObject.$3", - "type": "boolean", - "tags": [], - "label": "ignoreErrors", - "description": [], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/index_pattern_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.delete", - "type": "Function", - "tags": [], - "label": "delete", - "description": [ - "\nDeletes an index pattern from .kibana index" - ], - "signature": [ - "(indexPatternId: string) => Promise<{}>" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsService.delete.$1", - "type": "string", - "tags": [], - "label": "indexPatternId", - "description": [ - ": Id of kibana Index Pattern to delete" - ], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.OptionedParamType", - "type": "Class", - "tags": [], - "label": "OptionedParamType", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.OptionedParamType", - "text": "OptionedParamType" + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_pattern.ts" }, - " extends ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.BaseParamType", - "text": "BaseParamType" + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_pattern.ts" }, - "<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts" }, - ">" - ], - "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", - "deprecated": false, - "children": [ { - "parentPluginId": "data", - "id": "def-public.OptionedParamType.options", - "type": "Array", - "tags": [], - "label": "options", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.OptionedValueProp", - "text": "OptionedValueProp" - }, - "[]" - ], - "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts" }, { - "parentPluginId": "data", - "id": "def-public.OptionedParamType.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.OptionedParamType.Unnamed.$1", - "type": "Object", - "tags": [], - "label": "config", - "description": [], - "signature": [ - "Record" - ], - "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.SearchSource", - "type": "Class", - "tags": [], - "label": "SearchSource", - "description": [], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" + }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.history", - "type": "Array", - "tags": [], - "label": "history", - "description": [], - "signature": [ - "Record[]" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.SearchSource.Unnamed.$1", - "type": "Object", - "tags": [], - "label": "fields", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - } - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.SearchSource.Unnamed.$2", - "type": "Object", - "tags": [], - "label": "dependencies", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceDependencies", - "text": "SearchSourceDependencies" - } - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.setPreferredSearchStrategyId", - "type": "Function", - "tags": [], - "label": "setPreferredSearchStrategyId", - "description": [ - "**\nPUBLIC API\n\ninternal, dont use" - ], - "signature": [ - "(searchStrategyId: string) => void" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.SearchSource.setPreferredSearchStrategyId.$1", - "type": "string", - "tags": [], - "label": "searchStrategyId", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_field_visualize.d.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.setField", - "type": "Function", - "tags": [], - "label": "setField", - "description": [ - "\nsets value to a single search source field" - ], - "signature": [ - "(field: K, value: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - }, - "[K]) => this" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.SearchSource.setField.$1", - "type": "Uncategorized", - "tags": [], - "label": "field", - "description": [ - ": field name" - ], - "signature": [ - "K" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.SearchSource.setField.$2", - "type": "Uncategorized", - "tags": [], - "label": "value", - "description": [ - ": value for the field" - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - }, - "[K]" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_field_visualize.d.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.removeField", - "type": "Function", - "tags": [], - "label": "removeField", - "description": [ - "\nremove field" - ], - "signature": [ - "(field: K) => this" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.SearchSource.removeField.$1", - "type": "Uncategorized", - "tags": [], - "label": "field", - "description": [ - ": field name" - ], - "signature": [ - "K" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.setFields", - "type": "Function", - "tags": [ - "private" - ], - "label": "setFields", - "description": [ - "\nInternal, do not use. Overrides all search source fields with the new field array.\n" - ], - "signature": [ - "(newFields: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - }, - ") => this" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.SearchSource.setFields.$1", - "type": "Object", - "tags": [], - "label": "newFields", - "description": [ - "New field array." - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - } - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.getId", - "type": "Function", - "tags": [], - "label": "getId", - "description": [ - "\nreturns search source id" - ], - "signature": [ - "() => string" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.getFields", - "type": "Function", - "tags": [], - "label": "getFields", - "description": [ - "\nreturns all search source fields" - ], - "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - } - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.getField", - "type": "Function", - "tags": [], - "label": "getField", - "description": [ - "\nGets a single field from the fields" - ], - "signature": [ - "(field: K, recurse?: boolean) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - }, - "[K]" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.SearchSource.getField.$1", - "type": "Uncategorized", - "tags": [], - "label": "field", - "description": [], - "signature": [ - "K" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-public.SearchSource.getField.$2", - "type": "boolean", - "tags": [], - "label": "recurse", - "description": [], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.getOwnField", - "type": "Function", - "tags": [], - "label": "getOwnField", - "description": [ - "\nGet the field from our own fields, don't traverse up the chain" - ], - "signature": [ - "(field: K) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - }, - "[K]" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.SearchSource.getOwnField.$1", - "type": "Uncategorized", - "tags": [], - "label": "field", - "description": [], - "signature": [ - "K" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "maps", + "path": "x-pack/plugins/maps/public/embeddable/types.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.create", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "create", - "description": [], - "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" - } - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": true, - "references": [ - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" - } - ], - "children": [], - "returnComment": [] + "plugin": "maps", + "path": "x-pack/plugins/maps/public/embeddable/types.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.createCopy", - "type": "Function", - "tags": [], - "label": "createCopy", - "description": [ - "\ncreates a copy of this search source (without its children)" - ], - "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" - } - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.createChild", - "type": "Function", - "tags": [], - "label": "createChild", - "description": [ - "\ncreates a new child search source" - ], - "signature": [ - "(options?: {}) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" - } - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.SearchSource.createChild.$1", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - "{}" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.setParent", - "type": "Function", - "tags": [ - "return" - ], - "label": "setParent", - "description": [ - "\nSet a searchSource that this source should inherit from" - ], - "signature": [ - "(parent?: Pick<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" - }, - ", \"create\" | \"history\" | \"setPreferredSearchStrategyId\" | \"setField\" | \"removeField\" | \"setFields\" | \"getId\" | \"getFields\" | \"getField\" | \"getOwnField\" | \"createCopy\" | \"createChild\" | \"setParent\" | \"getParent\" | \"fetch$\" | \"fetch\" | \"onRequestStart\" | \"getSearchRequestBody\" | \"destroy\" | \"getSerializedFields\" | \"serialize\"> | undefined, options?: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceOptions", - "text": "SearchSourceOptions" - }, - ") => this" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.SearchSource.setParent.$1", - "type": "Object", - "tags": [], - "label": "parent", - "description": [ - "- the parent searchSource" - ], - "signature": [ - "Pick<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" - }, - ", \"create\" | \"history\" | \"setPreferredSearchStrategyId\" | \"setField\" | \"removeField\" | \"setFields\" | \"getId\" | \"getFields\" | \"getField\" | \"getOwnField\" | \"createCopy\" | \"createChild\" | \"setParent\" | \"getParent\" | \"fetch$\" | \"fetch\" | \"onRequestStart\" | \"getSearchRequestBody\" | \"destroy\" | \"getSerializedFields\" | \"serialize\"> | undefined" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "isRequired": false - }, - { - "parentPluginId": "data", - "id": "def-public.SearchSource.setParent.$2", - "type": "Object", - "tags": [], - "label": "options", - "description": [ - "- the inherit options" - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceOptions", - "text": "SearchSourceOptions" - } - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "- chainable" - ] + "plugin": "ml", + "path": "x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.getParent", - "type": "Function", - "tags": [ - "return" - ], - "label": "getParent", - "description": [ - "\nGet the parent of this SearchSource" - ], - "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" - }, - " | undefined" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "ml", + "path": "x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.fetch$", - "type": "Function", - "tags": [], - "label": "fetch$", - "description": [ - "\nFetch this source from Elasticsearch, returning an observable over the response(s)" - ], - "signature": [ - "(options?: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchOptions", - "text": "ISearchOptions" - }, - ") => ", - "Observable", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IKibanaSearchResponse", - "text": "IKibanaSearchResponse" - }, - "<", - "SearchResponse", - ">>" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.SearchSource.fetch$.$1", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchOptions", - "text": "ISearchOptions" - } - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "uptime", + "path": "x-pack/plugins/uptime/public/state/reducers/index_pattern.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.fetch", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "fetch", - "description": [ - "\nFetch this source and reject the returned Promise on error" - ], - "signature": [ - "(options?: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchOptions", - "text": "ISearchOptions" - }, - ") => Promise<", - "SearchResponse", - ">" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context/api/utils/fetch_hits_in_interval.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context/api/anchor.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" - }, - { - "plugin": "inputControlVis", - "path": "src/plugins/input_control_vis/public/control/list_control_factory.ts" - }, - { - "plugin": "inputControlVis", - "path": "src/plugins/input_control_vis/public/control/range_control_factory.ts" - } - ], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.SearchSource.fetch.$1", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchOptions", - "text": "ISearchOptions" - } - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "uptime", + "path": "x-pack/plugins/uptime/public/state/reducers/index_pattern.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.onRequestStart", - "type": "Function", - "tags": [ - "return" - ], - "label": "onRequestStart", - "description": [ - "\n Add a handler that will be notified whenever requests start" - ], - "signature": [ - "(handler: (searchSource: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" - }, - ", options?: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchOptions", - "text": "ISearchOptions" - }, - " | undefined) => Promise) => void" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.SearchSource.onRequestStart.$1", - "type": "Function", - "tags": [], - "label": "handler", - "description": [], - "signature": [ - "(searchSource: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" - }, - ", options?: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchOptions", - "text": "ISearchOptions" - }, - " | undefined) => Promise" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.getSearchRequestBody", - "type": "Function", - "tags": [], - "label": "getSearchRequestBody", - "description": [ - "\nReturns body contents of the search request, often referred as query DSL." - ], - "signature": [ - "() => any" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.destroy", - "type": "Function", - "tags": [ - "return" - ], - "label": "destroy", - "description": [ - "\nCompletely destroy the SearchSource." - ], - "signature": [ - "() => void" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.getSerializedFields", - "type": "Function", - "tags": [], - "label": "getSerializedFields", - "description": [ - "\nserializes search source fields (which can later be passed to {@link ISearchStartSearchSource})" - ], - "signature": [ - "(recurse?: boolean) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - } - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.SearchSource.getSerializedFields.$1", - "type": "boolean", - "tags": [], - "label": "recurse", - "description": [], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/types.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSource.serialize", - "type": "Function", - "tags": [], - "label": "serialize", - "description": [ - "\nSerializes the instance to a JSON string and a set of referenced objects.\nUse this method to get a representation of the search source which can be stored in a saved object.\n\nThe references returned by this function can be mixed with other references in the same object,\nhowever make sure there are no name-collisions. The references will be named `kibanaSavedObjectMeta.searchSourceJSON.index`\nand `kibanaSavedObjectMeta.searchSourceJSON.filter[].meta.index`.\n\nUsing `createSearchSource`, the instance can be re-created." - ], - "signature": [ - "() => { searchSourceJSON: string; references: ", - "SavedObjectReference", - "[]; }" - ], - "path": "src/plugins/data/common/search/search_source/search_source.ts", - "deprecated": false, - "children": [], - "returnComment": [] - } - ], - "initialIsOpen": false - } - ], - "functions": [ - { - "parentPluginId": "data", - "id": "def-public.castEsToKbnFieldTypeName", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "castEsToKbnFieldTypeName", - "description": [], - "signature": [ - "(esType: string) => ", - "KBN_FIELD_TYPES" - ], - "path": "src/plugins/data/common/kbn_field_types/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ + "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/apply_es_resp.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/vis.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/vis.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/vis_types/types.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/vis_types/types.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/vis_types/types.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/doc_views/doc_views_types.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/doc_views/doc_views_types.ts" + }, { "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + "path": "src/plugins/index_pattern_field_editor/public/shared_imports.ts" }, { "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" }, { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/create_field_list.ts" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" }, { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/create_field_list.ts" - } - ], - "returnComment": [], - "children": [ + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx" + }, { - "parentPluginId": "data", - "id": "def-public.esType", - "type": "string", - "tags": [], - "label": "esType", - "description": [], - "path": "node_modules/@kbn/field-types/target_types/kbn_field_types.d.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.extractReferences", - "type": "Function", - "tags": [], - "label": "extractReferences", - "description": [], - "signature": [ - "(state: ", + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts" }, - ") => [", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts" }, - " & { indexRefName?: string | undefined; }, ", - "SavedObjectReference", - "[]]" - ], - "path": "src/plugins/data/common/search/search_source/extract_references.ts", - "deprecated": false, - "children": [ { - "parentPluginId": "data", - "id": "def-public.extractReferences.$1", - "type": "Object", - "tags": [], - "label": "state", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - } - ], - "path": "src/plugins/data/common/search/search_source/extract_references.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.fieldList", - "type": "Function", - "tags": [], - "label": "fieldList", - "description": [], - "signature": [ - "(specs?: ", + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx" }, - "[], shortDotsEnable?: boolean) => ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IIndexPatternFieldList", - "text": "IIndexPatternFieldList" - } - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "children": [ + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx" + }, { - "parentPluginId": "data", - "id": "def-public.fieldList.$1", - "type": "Array", - "tags": [], - "label": "specs", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - "[]" - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "isRequired": true + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx" }, { - "parentPluginId": "data", - "id": "def-public.fieldList.$2", - "type": "boolean", - "tags": [], - "label": "shortDotsEnable", - "description": [], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.getEsQueryConfig", - "type": "Function", - "tags": [], - "label": "getEsQueryConfig", - "description": [], - "signature": [ - "(config: KibanaConfig) => ", - "EsQueryConfig" - ], - "path": "src/plugins/data/common/es_query/get_es_query_config.ts", - "deprecated": false, - "children": [ + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" + }, { - "parentPluginId": "data", - "id": "def-public.getEsQueryConfig.$1", - "type": "Object", - "tags": [], - "label": "config", - "description": [], - "signature": [ - "KibanaConfig" - ], - "path": "src/plugins/data/common/es_query/get_es_query_config.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.getKbnTypeNames", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "getKbnTypeNames", - "description": [], - "signature": [ - "() => string[]" - ], - "path": "src/plugins/data/common/kbn_field_types/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" + }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts" - } - ], - "returnComment": [], - "children": [], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.getSearchParamsFromRequest", - "type": "Function", - "tags": [], - "label": "getSearchParamsFromRequest", - "description": [], - "signature": [ - "(searchRequest: Record, dependencies: { getConfig: ", + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataPluginApi", - "section": "def-common.GetConfigFn", - "text": "GetConfigFn" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, - "; }) => ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchRequestParams", - "text": "ISearchRequestParams" - } - ], - "path": "src/plugins/data/common/search/search_source/fetch/get_search_params.ts", - "deprecated": false, - "children": [ + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + }, { - "parentPluginId": "data", - "id": "def-public.getSearchParamsFromRequest.$1", - "type": "Object", - "tags": [], - "label": "searchRequest", - "description": [], - "signature": [ - "Record" - ], - "path": "src/plugins/data/common/search/search_source/fetch/get_search_params.ts", - "deprecated": false, - "isRequired": true + "plugin": "discover", + "path": "src/plugins/discover/public/kibana_services.ts" }, { - "parentPluginId": "data", - "id": "def-public.getSearchParamsFromRequest.$2.dependencies", - "type": "Object", - "tags": [], - "label": "dependencies", - "description": [], - "path": "src/plugins/data/common/search/search_source/fetch/get_search_params.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.getSearchParamsFromRequest.$2.dependencies.getConfig", - "type": "Function", - "tags": [], - "label": "getConfig", - "description": [], - "signature": [ - "(key: string, defaultOverride?: T | undefined) => T" - ], - "path": "src/plugins/data/common/search/search_source/fetch/get_search_params.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.key", - "type": "string", - "tags": [], - "label": "key", - "description": [], - "path": "src/plugins/data/common/types.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.defaultOverride", - "type": "Uncategorized", - "tags": [], - "label": "defaultOverride", - "description": [], - "signature": [ - "T | undefined" - ], - "path": "src/plugins/data/common/types.ts", - "deprecated": false - } - ] - } - ] - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.getTime", - "type": "Function", - "tags": [], - "label": "getTime", - "description": [], - "signature": [ - "(indexPattern: ", + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IIndexPattern", - "text": "IIndexPattern" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx" }, - " | undefined, timeRange: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx" }, - ", options: { forceNow?: Date | undefined; fieldName?: string | undefined; } | undefined) => ", - "RangeFilter", - " | ", - "ScriptedRangeFilter", - " | ", - "MatchAllRangeFilter", - " | undefined" - ], - "path": "src/plugins/data/common/query/timefilter/get_time.ts", - "deprecated": false, - "children": [ { - "parentPluginId": "data", - "id": "def-public.getTime.$1", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IIndexPattern", - "text": "IIndexPattern" - }, - " | undefined" - ], - "path": "src/plugins/data/common/query/timefilter/get_time.ts", - "deprecated": false, - "isRequired": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx" }, { - "parentPluginId": "data", - "id": "def-public.getTime.$2", - "type": "Object", - "tags": [], - "label": "timeRange", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" - } - ], - "path": "src/plugins/data/common/query/timefilter/get_time.ts", - "deprecated": false, - "isRequired": true + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx" }, { - "parentPluginId": "data", - "id": "def-public.getTime.$3.options", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "path": "src/plugins/data/common/query/timefilter/get_time.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.getTime.$3.options.forceNow", - "type": "Object", - "tags": [], - "label": "forceNow", - "description": [], - "signature": [ - "Date | undefined" - ], - "path": "src/plugins/data/common/query/timefilter/get_time.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.getTime.$3.options.fieldName", - "type": "string", - "tags": [], - "label": "fieldName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/query/timefilter/get_time.ts", - "deprecated": false - } - ] - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.injectReferences", - "type": "Function", - "tags": [], - "label": "injectReferences", - "description": [], - "signature": [ - "(searchSourceFields: ", + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx" }, - " & { indexRefName: string; }, references: ", - "SavedObjectReference", - "[]) => ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - } - ], - "path": "src/plugins/data/common/search/search_source/inject_references.ts", - "deprecated": false, - "children": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx" + }, { - "parentPluginId": "data", - "id": "def-public.injectReferences.$1", - "type": "CompoundType", - "tags": [], - "label": "searchSourceFields", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - }, - " & { indexRefName: string; }" - ], - "path": "src/plugins/data/common/search/search_source/inject_references.ts", - "deprecated": false, - "isRequired": true + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid.tsx" }, { - "parentPluginId": "data", - "id": "def-public.injectReferences.$2", - "type": "Array", - "tags": [], - "label": "references", - "description": [], - "signature": [ - "SavedObjectReference", - "[]" - ], - "path": "src/plugins/data/common/search/search_source/inject_references.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.isCompleteResponse", - "type": "Function", - "tags": [], - "label": "isCompleteResponse", - "description": [], - "signature": [ - "(response?: ", + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid.tsx" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IKibanaSearchResponse", - "text": "IKibanaSearchResponse" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_default_sort.ts" }, - " | undefined) => boolean" - ], - "path": "src/plugins/data/common/search/utils.ts", - "deprecated": false, - "children": [ { - "parentPluginId": "data", - "id": "def-public.isCompleteResponse.$1", - "type": "Object", - "tags": [], - "label": "response", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IKibanaSearchResponse", - "text": "IKibanaSearchResponse" - }, - " | undefined" - ], - "path": "src/plugins/data/common/search/utils.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [ - "true if response is completed successfully" - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.isErrorResponse", - "type": "Function", - "tags": [], - "label": "isErrorResponse", - "description": [], - "signature": [ - "(response?: ", + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_default_sort.ts" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IKibanaSearchResponse", - "text": "IKibanaSearchResponse" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/table_header.tsx" }, - " | undefined) => boolean" - ], - "path": "src/plugins/data/common/search/utils.ts", - "deprecated": false, - "children": [ { - "parentPluginId": "data", - "id": "def-public.isErrorResponse.$1", - "type": "Object", - "tags": [], - "label": "response", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IKibanaSearchResponse", - "text": "IKibanaSearchResponse" - }, - " | undefined" - ], - "path": "src/plugins/data/common/search/utils.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [ - "true if response had an error while executing in ES" - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.isFilter", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "isFilter", - "description": [], - "signature": [ - "(x: unknown) => x is ", - "Filter" - ], - "path": "src/plugins/data/common/es_query/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [], - "returnComment": [], - "children": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/table_header.tsx" + }, { - "parentPluginId": "data", - "id": "def-public.x", - "type": "Unknown", - "tags": [], - "label": "x", - "description": [], - "signature": [ - "unknown" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/helpers/meta_filter.d.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.isFilters", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "isFilters", - "description": [], - "signature": [ - "(x: unknown) => x is ", - "Filter", - "[]" - ], - "path": "src/plugins/data/common/es_query/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.tsx" + }, { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.tsx" }, { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" - } - ], - "returnComment": [], - "children": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.tsx" + }, { - "parentPluginId": "data", - "id": "def-public.x", - "type": "Unknown", - "tags": [], - "label": "x", - "description": [], - "signature": [ - "unknown" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/helpers/meta_filter.d.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.isPartialResponse", - "type": "Function", - "tags": [], - "label": "isPartialResponse", - "description": [], - "signature": [ - "(response?: ", + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IKibanaSearchResponse", - "text": "IKibanaSearchResponse" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx" }, - " | undefined) => boolean" - ], - "path": "src/plugins/data/common/search/utils.ts", - "deprecated": false, - "children": [ { - "parentPluginId": "data", - "id": "def-public.isPartialResponse.$1", - "type": "Object", - "tags": [], - "label": "response", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IKibanaSearchResponse", - "text": "IKibanaSearchResponse" - }, - " | undefined" - ], - "path": "src/plugins/data/common/search/utils.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [ - "true if request is still running an/d response contains partial results" - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.isQuery", - "type": "Function", - "tags": [], - "label": "isQuery", - "description": [], - "signature": [ - "(x: unknown) => x is ", - "Query" - ], - "path": "src/plugins/data/common/query/is_query.ts", - "deprecated": false, - "children": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort_for_search_source.ts" + }, { - "parentPluginId": "data", - "id": "def-public.isQuery.$1", - "type": "Unknown", - "tags": [], - "label": "x", - "description": [], - "signature": [ - "unknown" - ], - "path": "src/plugins/data/common/query/is_query.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.isTimeRange", - "type": "Function", - "tags": [], - "label": "isTimeRange", - "description": [], - "signature": [ - "(x: unknown) => x is ", + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort_for_search_source.ts" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" - } - ], - "path": "src/plugins/data/common/query/timefilter/is_time_range.ts", - "deprecated": false, - "children": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_data_grid_columns.ts" + }, { - "parentPluginId": "data", - "id": "def-public.isTimeRange.$1", - "type": "Unknown", - "tags": [], - "label": "x", - "description": [], - "signature": [ - "unknown" - ], - "path": "src/plugins/data/common/query/timefilter/is_time_range.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.parseSearchSourceJSON", - "type": "Function", - "tags": [], - "label": "parseSearchSourceJSON", - "description": [], - "signature": [ - "(searchSourceJSON: string) => ", + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_data_grid_columns.ts" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - } - ], - "path": "src/plugins/data/common/search/search_source/parse_json.ts", - "deprecated": false, - "children": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/utils/sorting.ts" + }, { - "parentPluginId": "data", - "id": "def-public.parseSearchSourceJSON.$1", - "type": "string", - "tags": [], - "label": "searchSourceJSON", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/search/search_source/parse_json.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - } - ], - "interfaces": [ - { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping", - "type": "Interface", - "tags": [], - "label": "AggFunctionsMapping", - "description": [ - "\nA global list of the expression function definitions for each agg type function." - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false, - "children": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/utils/sorting.ts" + }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggFilter", - "type": "Object", - "tags": [], - "label": "aggFilter", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggFilter\", any, Pick, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ geo_bounding_box?: ({ type: \"geo_bounding_box\"; } & GeoBox) | ({ type: \"geo_bounding_box\"; } & { top_left: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.GeoPoint", - "text": "GeoPoint" - }, - "; bottom_right: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.GeoPoint", - "text": "GeoPoint" - }, - "; }) | ({ type: \"geo_bounding_box\"; } & { top_right: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.GeoPoint", - "text": "GeoPoint" - }, - "; bottom_left: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.GeoPoint", - "text": "GeoPoint" - }, - "; }) | ({ type: \"geo_bounding_box\"; } & WellKnownText) | undefined; filter?: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"kibana_query\", ", - "Query", - "> | undefined; }, \"filter\" | \"geo_bounding_box\"> & Pick<{ geo_bounding_box?: ({ type: \"geo_bounding_box\"; } & GeoBox) | ({ type: \"geo_bounding_box\"; } & { top_left: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.GeoPoint", - "text": "GeoPoint" - }, - "; bottom_right: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.GeoPoint", - "text": "GeoPoint" - }, - "; }) | ({ type: \"geo_bounding_box\"; } & { top_right: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.GeoPoint", - "text": "GeoPoint" - }, - "; bottom_left: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.GeoPoint", - "text": "GeoPoint" - }, - "; }) | ({ type: \"geo_bounding_box\"; } & WellKnownText) | undefined; filter?: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"kibana_query\", ", - "Query", - "> | undefined; }, never>, \"enabled\" | \"id\" | \"filter\" | \"customLabel\" | \"schema\" | \"geo_bounding_box\" | \"json\" | \"timeShift\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggFilters", - "type": "Object", - "tags": [], - "label": "aggFilters", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggFilters\", any, Pick, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ filters?: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"kibana_query_filter\", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.QueryFilter", - "text": "QueryFilter" - }, - ">[] | undefined; }, \"filters\"> & Pick<{ filters?: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"kibana_query_filter\", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.QueryFilter", - "text": "QueryFilter" - }, - ">[] | undefined; }, never>, \"enabled\" | \"filters\" | \"id\" | \"schema\" | \"json\" | \"timeShift\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggSignificantTerms", - "type": "Object", - "tags": [], - "label": "aggSignificantTerms", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggSignificantTerms\", any, ", - "AggExpressionFunctionArgs", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.BUCKET_TYPES", - "text": "BUCKET_TYPES" - }, - ".SIGNIFICANT_TERMS>, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/calc_field_counts.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggIpRange", - "type": "Object", - "tags": [], - "label": "aggIpRange", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggIpRange\", any, Pick, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: (", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"cidr\", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.Cidr", - "text": "Cidr" - }, - "> | ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"ip_range\", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IpRange", - "text": "IpRange" - }, - ">)[] | undefined; ipRangeType?: string | undefined; }, \"ipRangeType\" | \"ranges\"> & Pick<{ ranges?: (", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"cidr\", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.Cidr", - "text": "Cidr" - }, - "> | ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"ip_range\", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IpRange", - "text": "IpRange" - }, - ">)[] | undefined; ipRangeType?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ipRangeType\" | \"ranges\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/calc_field_counts.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggDateRange", - "type": "Object", - "tags": [], - "label": "aggDateRange", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggDateRange\", any, Pick, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\"> & Pick<{ ranges?: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"date_range\", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.DateRange", - "text": "DateRange" - }, - ">[] | undefined; }, \"ranges\"> & Pick<{ ranges?: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"date_range\", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.DateRange", - "text": "DateRange" - }, - ">[] | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ranges\" | \"time_zone\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggRange", - "type": "Object", - "tags": [], - "label": "aggRange", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggRange\", any, Pick, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"numerical_range\", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.NumericalRange", - "text": "NumericalRange" - }, - ">[] | undefined; }, \"ranges\"> & Pick<{ ranges?: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"numerical_range\", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.NumericalRange", - "text": "NumericalRange" - }, - ">[] | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ranges\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggGeoTile", - "type": "Object", - "tags": [], - "label": "aggGeoTile", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggGeoTile\", any, ", - "AggExpressionFunctionArgs", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.BUCKET_TYPES", - "text": "BUCKET_TYPES" - }, - ".GEOTILE_GRID>, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggGeoHash", - "type": "Object", - "tags": [], - "label": "aggGeoHash", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggGeoHash\", any, Pick, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\"> & Pick<{ boundingBox?: ({ type: \"geo_bounding_box\"; } & GeoBox) | ({ type: \"geo_bounding_box\"; } & { top_left: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.GeoPoint", - "text": "GeoPoint" - }, - "; bottom_right: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.GeoPoint", - "text": "GeoPoint" - }, - "; }) | ({ type: \"geo_bounding_box\"; } & { top_right: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.GeoPoint", - "text": "GeoPoint" - }, - "; bottom_left: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.GeoPoint", - "text": "GeoPoint" - }, - "; }) | ({ type: \"geo_bounding_box\"; } & WellKnownText) | undefined; }, \"boundingBox\"> & Pick<{ boundingBox?: ({ type: \"geo_bounding_box\"; } & GeoBox) | ({ type: \"geo_bounding_box\"; } & { top_left: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.GeoPoint", - "text": "GeoPoint" - }, - "; bottom_right: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.GeoPoint", - "text": "GeoPoint" - }, - "; }) | ({ type: \"geo_bounding_box\"; } & { top_right: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.GeoPoint", - "text": "GeoPoint" - }, - "; bottom_left: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.GeoPoint", - "text": "GeoPoint" - }, - "; }) | ({ type: \"geo_bounding_box\"; } & WellKnownText) | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\" | \"boundingBox\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggHistogram", - "type": "Object", - "tags": [], - "label": "aggHistogram", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggHistogram\", any, Pick, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\"> & Pick<{ extended_bounds?: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"extended_bounds\", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ExtendedBounds", - "text": "ExtendedBounds" - }, - "> | undefined; }, \"extended_bounds\"> & Pick<{ extended_bounds?: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"extended_bounds\", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ExtendedBounds", - "text": "ExtendedBounds" - }, - "> | undefined; }, never>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\" | \"extended_bounds\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggDateHistogram", - "type": "Object", - "tags": [], - "label": "aggDateHistogram", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggDateHistogram\", any, Pick, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\"> & Pick<{ timeRange?: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"timerange\", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" - }, - "> | undefined; extended_bounds?: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"extended_bounds\", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ExtendedBounds", - "text": "ExtendedBounds" - }, - "> | undefined; }, \"timeRange\" | \"extended_bounds\"> & Pick<{ timeRange?: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"timerange\", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" - }, - "> | undefined; extended_bounds?: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" - }, - "<\"extended_bounds\", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ExtendedBounds", - "text": "ExtendedBounds" - }, - "> | undefined; }, never>, \"enabled\" | \"interval\" | \"timeRange\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"extended_bounds\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/nested_fields.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggTerms", - "type": "Object", - "tags": [], - "label": "aggTerms", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggTerms\", any, Pick, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"orderBy\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\"> & Pick<{ orderAgg?: ", - "AggExpressionType", - " | undefined; }, \"orderAgg\"> & Pick<{ orderAgg?: ", - "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"orderBy\" | \"orderAgg\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/nested_fields.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggAvg", - "type": "Object", - "tags": [], - "label": "aggAvg", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggAvg\", any, ", - "AggExpressionFunctionArgs", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.METRIC_TYPES", - "text": "METRIC_TYPES" - }, - ".AVG>, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table.tsx" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggBucketAvg", - "type": "Object", - "tags": [], - "label": "aggBucketAvg", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggBucketAvg\", any, Pick, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", - "AggExpressionType", - " | undefined; customMetric?: ", - "AggExpressionType", - " | undefined; }, \"customMetric\" | \"customBucket\"> & Pick<{ customBucket?: ", - "AggExpressionType", - " | undefined; customMetric?: ", - "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table.tsx" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggBucketMax", - "type": "Object", - "tags": [], - "label": "aggBucketMax", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggBucketMax\", any, Pick, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", - "AggExpressionType", - " | undefined; customMetric?: ", - "AggExpressionType", - " | undefined; }, \"customMetric\" | \"customBucket\"> & Pick<{ customBucket?: ", - "AggExpressionType", - " | undefined; customMetric?: ", - "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/types.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggBucketMin", - "type": "Object", - "tags": [], - "label": "aggBucketMin", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggBucketMin\", any, Pick, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", - "AggExpressionType", - " | undefined; customMetric?: ", - "AggExpressionType", - " | undefined; }, \"customMetric\" | \"customBucket\"> & Pick<{ customBucket?: ", - "AggExpressionType", - " | undefined; customMetric?: ", - "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/types.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggBucketSum", - "type": "Object", - "tags": [], - "label": "aggBucketSum", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggBucketSum\", any, Pick, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", - "AggExpressionType", - " | undefined; customMetric?: ", - "AggExpressionType", - " | undefined; }, \"customMetric\" | \"customBucket\"> & Pick<{ customBucket?: ", - "AggExpressionType", - " | undefined; customMetric?: ", - "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggFilteredMetric", - "type": "Object", - "tags": [], - "label": "aggFilteredMetric", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggFilteredMetric\", any, Pick, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", - "AggExpressionType", - " | undefined; customMetric?: ", - "AggExpressionType", - " | undefined; }, \"customMetric\" | \"customBucket\"> & Pick<{ customBucket?: ", - "AggExpressionType", - " | undefined; customMetric?: ", - "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggCardinality", - "type": "Object", - "tags": [], - "label": "aggCardinality", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggCardinality\", any, ", - "AggExpressionFunctionArgs", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.METRIC_TYPES", - "text": "METRIC_TYPES" - }, - ".CARDINALITY>, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggCount", - "type": "Object", - "tags": [], - "label": "aggCount", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggCount\", any, ", - "AggExpressionFunctionArgs", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.METRIC_TYPES", - "text": "METRIC_TYPES" - }, - ".COUNT>, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggCumulativeSum", - "type": "Object", - "tags": [], - "label": "aggCumulativeSum", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggCumulativeSum\", any, Pick, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", - "AggExpressionType", - " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", - "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggDerivative", - "type": "Object", - "tags": [], - "label": "aggDerivative", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggDerivative\", any, Pick, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", - "AggExpressionType", - " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", - "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_row.tsx" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggGeoBounds", - "type": "Object", - "tags": [], - "label": "aggGeoBounds", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggGeoBounds\", any, ", - "AggExpressionFunctionArgs", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.METRIC_TYPES", - "text": "METRIC_TYPES" - }, - ".GEO_BOUNDS>, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_row.tsx" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggGeoCentroid", - "type": "Object", - "tags": [], - "label": "aggGeoCentroid", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggGeoCentroid\", any, ", - "AggExpressionFunctionArgs", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.METRIC_TYPES", - "text": "METRIC_TYPES" - }, - ".GEO_CENTROID>, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggMax", - "type": "Object", - "tags": [], - "label": "aggMax", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggMax\", any, ", - "AggExpressionFunctionArgs", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.METRIC_TYPES", - "text": "METRIC_TYPES" - }, - ".MAX>, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggMedian", - "type": "Object", - "tags": [], - "label": "aggMedian", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggMedian\", any, ", - "AggExpressionFunctionArgs", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.METRIC_TYPES", - "text": "METRIC_TYPES" - }, - ".MEDIAN>, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggSinglePercentile", - "type": "Object", - "tags": [], - "label": "aggSinglePercentile", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggSinglePercentile\", any, ", - "AggExpressionFunctionArgs", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.METRIC_TYPES", - "text": "METRIC_TYPES" - }, - ".SINGLE_PERCENTILE>, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggMin", - "type": "Object", - "tags": [], - "label": "aggMin", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggMin\", any, ", - "AggExpressionFunctionArgs", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.METRIC_TYPES", - "text": "METRIC_TYPES" - }, - ".MIN>, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggMovingAvg", - "type": "Object", - "tags": [], - "label": "aggMovingAvg", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggMovingAvg\", any, Pick, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\"> & Pick<{ customMetric?: ", - "AggExpressionType", - " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", - "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/actions/columns.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggPercentileRanks", - "type": "Object", - "tags": [], - "label": "aggPercentileRanks", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggPercentileRanks\", any, ", - "AggExpressionFunctionArgs", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.METRIC_TYPES", - "text": "METRIC_TYPES" - }, - ".PERCENTILE_RANKS>, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/actions/columns.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggPercentiles", - "type": "Object", - "tags": [], - "label": "aggPercentiles", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggPercentiles\", any, ", - "AggExpressionFunctionArgs", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.METRIC_TYPES", - "text": "METRIC_TYPES" - }, - ".PERCENTILES>, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/utils/use_context_app_state.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggSerialDiff", - "type": "Object", - "tags": [], - "label": "aggSerialDiff", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggSerialDiff\", any, Pick, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", - "AggExpressionType", - " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", - "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/utils/use_context_app_state.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggStdDeviation", - "type": "Object", - "tags": [], - "label": "aggStdDeviation", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggStdDeviation\", any, ", - "AggExpressionFunctionArgs", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.METRIC_TYPES", - "text": "METRIC_TYPES" - }, - ".STD_DEV>, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/anchor.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggSum", - "type": "Object", - "tags": [], - "label": "aggSum", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggSum\", any, ", - "AggExpressionFunctionArgs", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.METRIC_TYPES", - "text": "METRIC_TYPES" - }, - ".SUM>, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/anchor.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggFunctionsMapping.aggTopHit", - "type": "Object", - "tags": [], - "label": "aggTopHit", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" - }, - "<\"aggTopHit\", any, ", - "AggExpressionFunctionArgs", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.METRIC_TYPES", - "text": "METRIC_TYPES" - }, - ".TOP_HITS>, ", - "AggExpressionType", - ", ", - { - "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", - ">>" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.AggParamOption", - "type": "Interface", - "tags": [], - "label": "AggParamOption", - "description": [], - "path": "src/plugins/data/common/search/aggs/agg_params.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.AggParamOption.val", - "type": "string", - "tags": [], - "label": "val", - "description": [], - "path": "src/plugins/data/common/search/aggs/agg_params.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggParamOption.display", - "type": "string", - "tags": [], - "label": "display", - "description": [], - "path": "src/plugins/data/common/search/aggs/agg_params.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" }, { - "parentPluginId": "data", - "id": "def-public.AggParamOption.enabled", - "type": "Function", - "tags": [], - "label": "enabled", - "description": [], - "signature": [ - "((agg: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" - }, - ") => boolean) | undefined" - ], - "path": "src/plugins/data/common/search/aggs/agg_params.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.AggParamOption.enabled.$1", - "type": "Object", - "tags": [], - "label": "agg", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" - } - ], - "path": "src/plugins/data/common/search/aggs/agg_params.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.ApplyGlobalFilterActionContext", - "type": "Interface", - "tags": [], - "label": "ApplyGlobalFilterActionContext", - "description": [], - "path": "src/plugins/data/public/actions/apply_filter_action.ts", - "deprecated": false, - "children": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/utils/use_context_app_fetch.tsx" + }, { - "parentPluginId": "data", - "id": "def-public.ApplyGlobalFilterActionContext.filters", - "type": "Array", - "tags": [], - "label": "filters", - "description": [], - "signature": [ - "Filter", - "[]" - ], - "path": "src/plugins/data/public/actions/apply_filter_action.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/utils/use_context_app_fetch.tsx" }, { - "parentPluginId": "data", - "id": "def-public.ApplyGlobalFilterActionContext.timeFieldName", - "type": "string", - "tags": [], - "label": "timeFieldName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/public/actions/apply_filter_action.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx" }, { - "parentPluginId": "data", - "id": "def-public.ApplyGlobalFilterActionContext.embeddable", - "type": "Unknown", - "tags": [], - "label": "embeddable", - "description": [], - "signature": [ - "unknown" - ], - "path": "src/plugins/data/public/actions/apply_filter_action.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx" }, { - "parentPluginId": "data", - "id": "def-public.ApplyGlobalFilterActionContext.controlledBy", - "type": "string", - "tags": [], - "label": "controlledBy", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/public/actions/apply_filter_action.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.DataPublicPluginStartActions", - "type": "Interface", - "tags": [], - "label": "DataPublicPluginStartActions", - "description": [ - "\nutilities to generate filters from action context" - ], - "path": "src/plugins/data/public/types.ts", - "deprecated": false, - "children": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, { - "parentPluginId": "data", - "id": "def-public.DataPublicPluginStartActions.createFiltersFromValueClickAction", - "type": "Function", - "tags": [], - "label": "createFiltersFromValueClickAction", - "description": [], - "signature": [ - "({ data, negate, }: ", - "ValueClickDataContext", - ") => Promise<", - "Filter", - "[]>" - ], - "path": "src/plugins/data/public/types.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.__0", - "type": "Object", - "tags": [], - "label": "__0", - "description": [], - "signature": [ - "ValueClickDataContext" - ], - "path": "src/plugins/data/public/actions/filters/create_filters_from_value_click.ts", - "deprecated": false - } - ] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" }, { - "parentPluginId": "data", - "id": "def-public.DataPublicPluginStartActions.createFiltersFromRangeSelectAction", - "type": "Function", - "tags": [], - "label": "createFiltersFromRangeSelectAction", - "description": [], - "signature": [ - "(event: ", - "RangeSelectDataContext", - ") => Promise<", - "Filter", - "[]>" - ], - "path": "src/plugins/data/public/types.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.event", - "type": "Object", - "tags": [], - "label": "event", - "description": [], - "signature": [ - "RangeSelectDataContext" - ], - "path": "src/plugins/data/public/actions/filters/create_filters_from_range_select.ts", - "deprecated": false - } - ] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.DataPublicPluginStartUi", - "type": "Interface", - "tags": [], - "label": "DataPublicPluginStartUi", - "description": [ - "\nData plugin prewired UI components" - ], - "path": "src/plugins/data/public/types.ts", - "deprecated": false, - "children": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx" + }, { - "parentPluginId": "data", - "id": "def-public.DataPublicPluginStartUi.IndexPatternSelect", - "type": "CompoundType", - "tags": [], - "label": "IndexPatternSelect", - "description": [], - "signature": [ - "React.ComponentClass<", - { - "pluginId": "data", - "scope": "public", - "docId": "kibDataUiPluginApi", - "section": "def-public.IndexPatternSelectProps", - "text": "IndexPatternSelectProps" - }, - ", any> | React.FunctionComponent<", - { - "pluginId": "data", - "scope": "public", - "docId": "kibDataUiPluginApi", - "section": "def-public.IndexPatternSelectProps", - "text": "IndexPatternSelectProps" - }, - ">" - ], - "path": "src/plugins/data/public/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx" }, { - "parentPluginId": "data", - "id": "def-public.DataPublicPluginStartUi.SearchBar", - "type": "CompoundType", - "tags": [], - "label": "SearchBar", - "description": [], - "signature": [ - "React.ComponentClass<", - { - "pluginId": "data", - "scope": "public", - "docId": "kibDataUiPluginApi", - "section": "def-public.StatefulSearchBarProps", - "text": "StatefulSearchBarProps" - }, - ", any> | React.FunctionComponent<", - { - "pluginId": "data", - "scope": "public", - "docId": "kibDataUiPluginApi", - "section": "def-public.StatefulSearchBarProps", - "text": "StatefulSearchBarProps" - }, - ">" - ], - "path": "src/plugins/data/public/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.GetFieldsOptions", - "type": "Interface", - "tags": [], - "label": "GetFieldsOptions", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts" + }, { - "parentPluginId": "data", - "id": "def-public.GetFieldsOptions.pattern", - "type": "string", - "tags": [], - "label": "pattern", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts" }, { - "parentPluginId": "data", - "id": "def-public.GetFieldsOptions.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" }, { - "parentPluginId": "data", - "id": "def-public.GetFieldsOptions.lookBack", - "type": "CompoundType", - "tags": [], - "label": "lookBack", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" }, { - "parentPluginId": "data", - "id": "def-public.GetFieldsOptions.metaFields", - "type": "Array", - "tags": [], - "label": "metaFields", - "description": [], - "signature": [ - "string[] | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" }, { - "parentPluginId": "data", - "id": "def-public.GetFieldsOptions.rollupIndex", - "type": "string", - "tags": [], - "label": "rollupIndex", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" }, { - "parentPluginId": "data", - "id": "def-public.GetFieldsOptions.allowNoIndex", - "type": "CompoundType", - "tags": [], - "label": "allowNoIndex", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IDataPluginServices", - "type": "Interface", - "tags": [], - "label": "IDataPluginServices", - "description": [], - "signature": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/persist_saved_search.ts" + }, { - "pluginId": "data", - "scope": "public", - "docId": "kibDataPluginApi", - "section": "def-public.IDataPluginServices", - "text": "IDataPluginServices" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/persist_saved_search.ts" }, - " extends Partial<", { - "pluginId": "core", - "scope": "public", - "docId": "kibCorePluginApi", - "section": "def-public.CoreStart", - "text": "CoreStart" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts" }, - ">" - ], - "path": "src/plugins/data/public/types.ts", - "deprecated": false, - "children": [ { - "parentPluginId": "data", - "id": "def-public.IDataPluginServices.appName", - "type": "string", - "tags": [], - "label": "appName", - "description": [], - "path": "src/plugins/data/public/types.ts", - "deprecated": false + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts" }, { - "parentPluginId": "data", - "id": "def-public.IDataPluginServices.uiSettings", - "type": "Object", - "tags": [], - "label": "uiSettings", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "public", - "docId": "kibCorePluginApi", - "section": "def-public.IUiSettingsClient", - "text": "IUiSettingsClient" - } - ], - "path": "src/plugins/data/public/types.ts", - "deprecated": false + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" }, { - "parentPluginId": "data", - "id": "def-public.IDataPluginServices.savedObjects", - "type": "Object", - "tags": [], - "label": "savedObjects", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "public", - "docId": "kibCoreSavedObjectsPluginApi", - "section": "def-public.SavedObjectsStart", - "text": "SavedObjectsStart" - } - ], - "path": "src/plugins/data/public/types.ts", - "deprecated": false + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" }, { - "parentPluginId": "data", - "id": "def-public.IDataPluginServices.notifications", - "type": "Object", - "tags": [], - "label": "notifications", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "public", - "docId": "kibCorePluginApi", - "section": "def-public.NotificationsStart", - "text": "NotificationsStart" - } - ], - "path": "src/plugins/data/public/types.ts", - "deprecated": false + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" }, { - "parentPluginId": "data", - "id": "def-public.IDataPluginServices.http", - "type": "Object", - "tags": [], - "label": "http", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "public", - "docId": "kibCoreHttpPluginApi", - "section": "def-public.HttpSetup", - "text": "HttpSetup" - } - ], - "path": "src/plugins/data/public/types.ts", - "deprecated": false + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" }, { - "parentPluginId": "data", - "id": "def-public.IDataPluginServices.storage", - "type": "Object", - "tags": [], - "label": "storage", - "description": [], - "signature": [ - { - "pluginId": "kibanaUtils", - "scope": "public", - "docId": "kibKibanaUtilsPluginApi", - "section": "def-public.IStorageWrapper", - "text": "IStorageWrapper" - }, - "" - ], - "path": "src/plugins/data/public/types.ts", - "deprecated": false + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" }, { - "parentPluginId": "data", - "id": "def-public.IDataPluginServices.data", - "type": "Object", - "tags": [], - "label": "data", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "public", - "docId": "kibDataPluginApi", - "section": "def-public.DataPublicPluginStart", - "text": "DataPublicPluginStart" - } - ], - "path": "src/plugins/data/public/types.ts", - "deprecated": false + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" }, { - "parentPluginId": "data", - "id": "def-public.IDataPluginServices.usageCollection", - "type": "Object", - "tags": [], - "label": "usageCollection", - "description": [], - "signature": [ - { - "pluginId": "usageCollection", - "scope": "public", - "docId": "kibUsageCollectionPluginApi", - "section": "def-public.UsageCollectionStart", - "text": "UsageCollectionStart" - }, - " | undefined" - ], - "path": "src/plugins/data/public/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IEsSearchRequest", - "type": "Interface", - "tags": [], - "label": "IEsSearchRequest", - "description": [], - "signature": [ + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IEsSearchRequest", - "text": "IEsSearchRequest" + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" }, - " extends ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IKibanaSearchRequest", - "text": "IKibanaSearchRequest" + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" }, - "<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchRequestParams", - "text": "ISearchRequestParams" + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/types.ts" }, - ">" - ], - "path": "src/plugins/data/common/search/strategies/es_search/types.ts", - "deprecated": false, - "children": [ { - "parentPluginId": "data", - "id": "def-public.IEsSearchRequest.indexType", - "type": "string", - "tags": [], - "label": "indexType", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/search/strategies/es_search/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IFieldType", - "type": "Interface", - "tags": [ - "deprecated" - ], - "label": "IFieldType", - "description": [], - "signature": [ + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/types.ts" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" }, - " extends ", - "IndexPatternFieldBase" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/utils.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/utils.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/utils.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_agg_tooltip_property.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_agg_tooltip_property.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" + "path": "x-pack/plugins/maps/public/components/geo_index_pattern_select.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" + "path": "x-pack/plugins/maps/public/components/geo_index_pattern_select.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" }, { "plugin": "maps", @@ -10603,47 +3872,51 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.tsx" + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.tsx" + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metrics_editor.tsx" + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metrics_editor.tsx" + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.tsx" + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/geo_line_form.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.tsx" + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/geo_line_form.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/create_source_editor.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/create_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/create_source_editor.tsx" }, { "plugin": "maps", @@ -10667,259 +3940,547 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" + "path": "x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/components/data_grid/common.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" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/field_format_service.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/field_format_service.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/common/group_by_expression/selector.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/common/group_by_expression/selector.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/common/group_by_expression/group_by_expression.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/common/group_by_expression/group_by_expression.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/scatterplot_matrix/use_scatterplot_field_options.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criteria.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/scatterplot_matrix/use_scatterplot_field_options.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criteria.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/group_by.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/group_by.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/metrics.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/single_metric_job_creator.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/metrics.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/single_metric_job_creator.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/multi_metric_job_creator.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/multi_metric_job_creator.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/population_job_creator.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/population_job_creator.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/advanced_job_creator.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/advanced_job_creator.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/categorization_job_creator.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/categorization_job_creator.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/rare_job_creator.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/rare_job_creator.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator_factory.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator_factory.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector_service.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector_service.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/exploration_results_table.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/exploration_results_table.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/ml_context.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/ml_context.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/common/use_results_view_config.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/common/use_results_view_config.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/common/use_results_view_config.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/types/app_state.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/types/app_state.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/datasource.sagas.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/datasource.sagas.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/search_bar.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/search_bar.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/search_bar.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/search_bar.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/inspect_panel.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/inspect_panel.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/workspace_layout/workspace_layout.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/workspace_layout/workspace_layout.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/workspace_layout/workspace_layout.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/index_pattern_cache.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/index_pattern_cache.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/index_pattern_cache.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/threatmatch_input/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/threatmatch_input/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/threatmatch_input/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/get_pivot_dropdown_options.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/get_pivot_dropdown_options.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/common/request.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/common/request.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/common/request.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/common/request.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "uptime", + "path": "x-pack/plugins/uptime/public/hooks/update_kuery_string.ts" + }, + { + "plugin": "uptime", + "path": "x-pack/plugins/uptime/public/hooks/update_kuery_string.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/mocks.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/mocks.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/embeddable/embeddable.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/embeddable/embeddable.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/utils.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/utils.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/es_search_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/es_search_source.d.ts" }, { "plugin": "maps", @@ -10930,204 +4491,204 @@ "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_index_pattern_select.d.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_index_pattern_select.d.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities._service.test.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities._service.test.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/remove_nested_field_children.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/remove_nested_field_children.test.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/__mocks__/index_pattern.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/common/group_by_expression/group_by_expression.d.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/__mocks__/index_pattern.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/common/group_by_expression/group_by_expression.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/count_agg_field.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/common/group_by_expression/selector.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/count_agg_field.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/common/group_by_expression/selector.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/agg_field.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/inventory/components/expression.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/agg_field.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/inventory/components/expression.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/inventory/components/metric.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/inventory/components/metric.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_row.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_row.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/geo_line_form.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/geo_line_form.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/log_threshold/components/expression_editor/criteria.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/log_threshold/components/expression_editor/criteria.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/filter_editor/filter_editor.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/log_threshold/components/expression_editor/criterion.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/filter_editor/filter_editor.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/log_threshold/components/expression_editor/criterion.d.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/components/full_time_range_selector/full_time_range_selector.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/components/group_by.d.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/components/full_time_range_selector/full_time_range_selector.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/components/group_by.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/target/types/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/components/metrics.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/target/types/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/components/metrics.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.d.ts" + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.d.ts" + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.d.ts" + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.d.ts" + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.d.ts" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/single_field_select.d.ts" + "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/single_field_select.d.ts" + "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.d.ts" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/common.test.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.d.ts" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/common.test.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.d.ts" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.d.ts" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/open_editor.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.d.ts" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/open_editor.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.d.ts" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/types.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/types.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" }, { "plugin": "indexPatternManagement", @@ -11139,10761 +4700,18636 @@ }, { "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "path": "src/plugins/index_pattern_management/public/components/utils.ts" }, { "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" - } - ], - "children": [ + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + }, { - "parentPluginId": "data", - "id": "def-public.IFieldType.count", - "type": "number", - "tags": [], - "label": "count", - "description": [], - "signature": [ - "number | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" }, { - "parentPluginId": "data", - "id": "def-public.IFieldType.esTypes", - "type": "Array", - "tags": [], - "label": "esTypes", - "description": [], - "signature": [ - "string[] | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" }, { - "parentPluginId": "data", - "id": "def-public.IFieldType.aggregatable", - "type": "CompoundType", - "tags": [], - "label": "aggregatable", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" }, { - "parentPluginId": "data", - "id": "def-public.IFieldType.filterable", - "type": "CompoundType", - "tags": [], - "label": "filterable", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/create_search_source.ts" }, { - "parentPluginId": "data", - "id": "def-public.IFieldType.searchable", - "type": "CompoundType", - "tags": [], - "label": "searchable", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/create_search_source.ts" }, { - "parentPluginId": "data", - "id": "def-public.IFieldType.sortable", - "type": "CompoundType", - "tags": [], - "label": "sortable", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IFieldType.visualizable", - "type": "CompoundType", - "tags": [], - "label": "visualizable", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IFieldType.readFromDocValues", - "type": "CompoundType", - "tags": [], - "label": "readFromDocValues", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IFieldType.displayName", - "type": "string", - "tags": [], - "label": "displayName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IFieldType.customLabel", - "type": "string", - "tags": [], - "label": "customLabel", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IFieldType.format", - "type": "Any", - "tags": [], - "label": "format", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IFieldType.toSpec", - "type": "Function", - "tags": [], - "label": "toSpec", - "description": [], - "signature": [ - "((options?: { getFormatterForField?: ((field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") => ", - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormat", - "text": "FieldFormat" - }, - ") | undefined; } | undefined) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IFieldType.toSpec.$1.options", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IFieldType.toSpec.$1.options.getFormatterForField", - "type": "Function", - "tags": [], - "label": "getFormatterForField", - "description": [], - "signature": [ - "((field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") => ", - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormat", - "text": "FieldFormat" - }, - ") | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false - } - ] - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IIndexPattern", - "type": "Interface", - "tags": [ - "deprecated" - ], - "label": "IIndexPattern", - "description": [], - "signature": [ + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IIndexPattern", - "text": "IIndexPattern" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" }, - " extends ", - "IndexPatternBase" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": true, - "references": [ { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/helpers.tsx" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/control_editor.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/helpers.tsx" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/control_editor.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/controls_tab.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/controls_tab.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/container/source/index.tsx" + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/container/source/index.tsx" + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/container/source/index.tsx" + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/components/visualize_top_nav.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx" + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/components/visualize_top_nav.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx" + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/components/visualize_top_nav.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/utils/editor_config.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/utils/editor_config.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/components/data_recognizer/data_recognizer.d.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/components/data_recognizer/data_recognizer.d.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_select.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_select.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/utils/kuery.ts" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/test_utils/get_index_pattern_mock.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/utils/kuery.ts" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/test_utils/get_index_pattern_mock.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/test_utils/get_index_pattern_mock.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.test.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.test.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.ts" + "plugin": "visTypeTable", + "path": "src/plugins/vis_types/table/public/legacy/table_vis_controller.test.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.tsx" + "plugin": "visTypeTable", + "path": "src/plugins/vis_types/table/public/legacy/table_vis_controller.test.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.tsx" + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts" + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts" + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/containers/with_source/with_source.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/containers/with_source/with_source.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/toolbar.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/toolbar.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/target/types/public/types.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/target/types/public/types.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/utils/editor_config.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/utils/editor_config.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/url_state/types.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/url_state/types.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/url_state/types.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/query_bar/index.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/query_bar/index.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_bar/index.tsx" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/control/create_search_source.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_bar/index.tsx" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/control/create_search_source.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/columns.tsx" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/test_utils/get_index_pattern_mock.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/columns.tsx" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/test_utils/get_index_pattern_mock.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/columns.tsx" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/agg_select.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/agg_select.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_sharing_data.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_sharing_data.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_sharing_data.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/components/editor/controls_tab.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/components/editor/controls_tab.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_calculator.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_calculator.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/pages/details/types.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/pages/details/types.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/utils/nested_fields.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/utils/nested_fields.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/details/types.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/details/types.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/details/types.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/details/types.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/mock/index_pattern.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/mock/index_pattern.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/common/search_strategy/index_fields/index.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/common/search_strategy/index_fields/index.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/containers/with_kuery_autocompletion.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/containers/with_kuery_autocompletion.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/containers/with_source/with_source.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/containers/with_source/with_source.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/index_pattern_context.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/index_pattern_context.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_chart.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_chart.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/data_loader/data_loader.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/index.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/data_loader/data_loader.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/index.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/data_loader/data_loader.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/index.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/index.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_pattern_management/index_pattern_management.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/network/pages/details/types.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_pattern_management/index_pattern_management.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/network/pages/details/types.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/ueba/pages/details/types.d.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/ueba/pages/details/types.d.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/embeddables/types.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.d.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/embeddables/types.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.d.ts" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.d.ts" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts" + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/saved_object.test.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts" + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/saved_object.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/saved_object.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/saved_object.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.test.ts" + } + ], + "children": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IndexPatternField", + "type": "Class", + "tags": [ + "deprecated" + ], + "label": "IndexPatternField", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPatternField", + "text": "IndexPatternField" }, + " extends ", { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + } + ], + "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", + "deprecated": true, + "references": [ + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/shared_imports.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/kibana_services.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/field_name/field_name.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/field_name/field_name.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table_cell_actions.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table_cell_actions.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/pages/navigation/types.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/pages/navigation/types.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/pages/navigation/types.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/editor.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/editor.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" }, { - "plugin": "transform", - "path": "x-pack/plugins/transform/public/app/services/es_index_service.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" }, { - "plugin": "transform", - "path": "x-pack/plugins/transform/public/app/services/es_index_service.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" }, { - "plugin": "transform", - "path": "x-pack/plugins/transform/server/routes/api/transforms.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" }, { - "plugin": "transform", - "path": "x-pack/plugins/transform/server/routes/api/transforms.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/utils/new_job_utils.test.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/utils/new_job_utils.test.ts" - } - ], - "children": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" + }, { - "parentPluginId": "data", - "id": "def-public.IIndexPattern.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" }, { - "parentPluginId": "data", - "id": "def-public.IIndexPattern.fields", - "type": "Array", - "tags": [], - "label": "fields", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - "[]" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" }, { - "parentPluginId": "data", - "id": "def-public.IIndexPattern.type", - "type": "string", - "tags": [], - "label": "type", - "description": [ - "\nType is used for identifying rollup indices, otherwise left undefined" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IIndexPattern.timeFieldName", - "type": "string", - "tags": [], - "label": "timeFieldName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IIndexPattern.getTimeField", - "type": "Function", - "tags": [], - "label": "getTimeField", - "description": [], - "signature": [ - "(() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | undefined) | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IIndexPattern.fieldFormatMap", - "type": "Object", - "tags": [], - "label": "fieldFormatMap", - "description": [], - "signature": [ - "Record | undefined> | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IIndexPattern.getFormatterForField", - "type": "Function", - "tags": [], - "label": "getFormatterForField", - "description": [ - "\nLook up a formatter for a given field" - ], - "signature": [ - "((field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") => ", - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormat", - "text": "FieldFormat" - }, - ") | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.IIndexPattern.getFormatterForField.$1", - "type": "CompoundType", - "tags": [], - "label": "field", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IKibanaSearchRequest", - "type": "Interface", - "tags": [], - "label": "IKibanaSearchRequest", - "description": [], - "signature": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IKibanaSearchRequest", - "text": "IKibanaSearchRequest" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" }, - "" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false, - "children": [ { - "parentPluginId": "data", - "id": "def-public.IKibanaSearchRequest.id", - "type": "string", - "tags": [], - "label": "id", - "description": [ - "\nAn id can be used to uniquely identify this request." - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IKibanaSearchRequest.params", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Params | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IKibanaSearchResponse", - "type": "Interface", - "tags": [], - "label": "IKibanaSearchResponse", - "description": [], - "signature": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IKibanaSearchResponse", - "text": "IKibanaSearchResponse" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" }, - "" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false, - "children": [ { - "parentPluginId": "data", - "id": "def-public.IKibanaSearchResponse.id", - "type": "string", - "tags": [], - "label": "id", - "description": [ - "\nSome responses may contain a unique id to identify the request this response came from." - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IKibanaSearchResponse.total", - "type": "number", - "tags": [], - "label": "total", - "description": [ - "\nIf relevant to the search strategy, return a total number\nthat represents how progress is indicated." - ], - "signature": [ - "number | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IKibanaSearchResponse.loaded", - "type": "number", - "tags": [], - "label": "loaded", - "description": [ - "\nIf relevant to the search strategy, return a loaded number\nthat represents how progress is indicated." - ], - "signature": [ - "number | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" }, { - "parentPluginId": "data", - "id": "def-public.IKibanaSearchResponse.isRunning", - "type": "CompoundType", - "tags": [], - "label": "isRunning", - "description": [ - "\nIndicates whether search is still in flight" - ], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" }, { - "parentPluginId": "data", - "id": "def-public.IKibanaSearchResponse.isPartial", - "type": "CompoundType", - "tags": [], - "label": "isPartial", - "description": [ - "\nIndicates whether the results returned are complete or partial" - ], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" }, { - "parentPluginId": "data", - "id": "def-public.IKibanaSearchResponse.isRestored", - "type": "CompoundType", - "tags": [], - "label": "isRestored", - "description": [ - "\nIndicates whether the results returned are from the async-search index" - ], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" }, { - "parentPluginId": "data", - "id": "def-public.IKibanaSearchResponse.warning", - "type": "string", - "tags": [], - "label": "warning", - "description": [ - "\nOptional warnings that should be surfaced to the end user" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" }, { - "parentPluginId": "data", - "id": "def-public.IKibanaSearchResponse.rawResponse", - "type": "Uncategorized", - "tags": [], - "label": "rawResponse", - "description": [ - "\nThe raw response returned by the internal search method (usually the raw ES response)" - ], - "signature": [ - "RawResponse" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternAttributes", - "type": "Interface", - "tags": [], - "label": "IndexPatternAttributes", - "description": [ - "\nInterface for an index pattern saved object" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternAttributes.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternAttributes.fields", - "type": "string", - "tags": [], - "label": "fields", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternAttributes.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternAttributes.typeMeta", - "type": "string", - "tags": [], - "label": "typeMeta", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternAttributes.timeFieldName", - "type": "string", - "tags": [], - "label": "timeFieldName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternAttributes.intervalName", - "type": "string", - "tags": [], - "label": "intervalName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternAttributes.sourceFilters", - "type": "string", - "tags": [], - "label": "sourceFilters", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternAttributes.fieldFormatMap", - "type": "string", - "tags": [], - "label": "fieldFormatMap", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternAttributes.fieldAttrs", - "type": "string", - "tags": [], - "label": "fieldAttrs", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternAttributes.runtimeFieldMap", - "type": "string", - "tags": [], - "label": "runtimeFieldMap", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternAttributes.allowNoIndex", - "type": "CompoundType", - "tags": [], - "label": "allowNoIndex", - "description": [ - "\nprevents errors when index pattern exists before indices" - ], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternListItem", - "type": "Interface", - "tags": [], - "label": "IndexPatternListItem", - "description": [], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternListItem.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternListItem.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternListItem.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternListItem.typeMeta", - "type": "Object", - "tags": [], - "label": "typeMeta", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.TypeMeta", - "text": "TypeMeta" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternSpec", - "type": "Interface", - "tags": [], - "label": "IndexPatternSpec", - "description": [ - "\nStatic index pattern format\nSerialized data object, representing index pattern attributes and state" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternSpec.id", - "type": "string", - "tags": [], - "label": "id", - "description": [ - "\nsaved object id" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternSpec.version", - "type": "string", - "tags": [], - "label": "version", - "description": [ - "\nsaved object version string" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternSpec.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternSpec.intervalName", - "type": "string", - "tags": [ - "deprecated" - ], - "label": "intervalName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": true, - "references": [] + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternSpec.timeFieldName", - "type": "string", - "tags": [], - "label": "timeFieldName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternSpec.sourceFilters", - "type": "Array", - "tags": [], - "label": "sourceFilters", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.SourceFilter", - "text": "SourceFilter" - }, - "[] | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternSpec.fields", - "type": "Object", - "tags": [], - "label": "fields", - "description": [], - "signature": [ - "Record | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternSpec.typeMeta", - "type": "Object", - "tags": [], - "label": "typeMeta", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.TypeMeta", - "text": "TypeMeta" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternSpec.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternSpec.fieldFormats", - "type": "Object", - "tags": [], - "label": "fieldFormats", - "description": [], - "signature": [ - "Record>> | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternSpec.runtimeFieldMap", - "type": "Object", - "tags": [], - "label": "runtimeFieldMap", - "description": [], - "signature": [ - "Record | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternSpec.fieldAttrs", - "type": "Object", - "tags": [], - "label": "fieldAttrs", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldAttrs", - "text": "FieldAttrs" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.IndexPatternSpec.allowNoIndex", - "type": "CompoundType", - "tags": [], - "label": "allowNoIndex", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.ISearchOptions", - "type": "Interface", - "tags": [], - "label": "ISearchOptions", - "description": [], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false, - "children": [ + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, { - "parentPluginId": "data", - "id": "def-public.ISearchOptions.abortSignal", - "type": "Object", - "tags": [], - "label": "abortSignal", - "description": [ - "\nAn `AbortSignal` that allows the caller of `search` to abort a search request." - ], - "signature": [ - "AbortSignal | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" }, { - "parentPluginId": "data", - "id": "def-public.ISearchOptions.strategy", - "type": "string", - "tags": [], - "label": "strategy", - "description": [ - "\nUse this option to force using a specific server side search strategy. Leave empty to use the default strategy." - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" }, { - "parentPluginId": "data", - "id": "def-public.ISearchOptions.legacyHitsTotal", - "type": "CompoundType", - "tags": [], - "label": "legacyHitsTotal", - "description": [ - "\nRequest the legacy format for the total number of hits. If sending `rest_total_hits_as_int` to\nsomething other than `true`, this should be set to `false`." - ], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" }, { - "parentPluginId": "data", - "id": "def-public.ISearchOptions.sessionId", - "type": "string", - "tags": [], - "label": "sessionId", - "description": [ - "\nA session ID, grouping multiple search requests into a single session." - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" }, { - "parentPluginId": "data", - "id": "def-public.ISearchOptions.isStored", - "type": "CompoundType", - "tags": [], - "label": "isStored", - "description": [ - "\nWhether the session is already saved (i.e. sent to background)" - ], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" }, { - "parentPluginId": "data", - "id": "def-public.ISearchOptions.isRestore", - "type": "CompoundType", - "tags": [], - "label": "isRestore", - "description": [ - "\nWhether the session is restored (i.e. search requests should re-use the stored search IDs,\nrather than starting from scratch)" - ], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" }, { - "parentPluginId": "data", - "id": "def-public.ISearchOptions.indexPattern", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [ - "\nIndex pattern reference is used for better error messages" - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - " | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.ISearchOptions.inspector", - "type": "Object", - "tags": [], - "label": "inspector", - "description": [ - "\nInspector integration options" - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IInspectorInfo", - "text": "IInspectorInfo" - }, - " | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx" }, { - "parentPluginId": "data", - "id": "def-public.ISearchOptions.executionContext", - "type": "Object", - "tags": [], - "label": "executionContext", - "description": [], - "signature": [ - "KibanaExecutionContext", - " | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.ISearchStartSearchSource", - "type": "Interface", - "tags": [], - "label": "ISearchStartSearchSource", - "description": [ - "\nhigh level search service" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false, - "children": [ + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + }, { - "parentPluginId": "data", - "id": "def-public.ISearchStartSearchSource.create", - "type": "Function", - "tags": [], - "label": "create", - "description": [ - "\ncreates {@link SearchSource} based on provided serialized {@link SearchSourceFields}" - ], - "signature": [ - "(fields?: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - }, - " | undefined) => Promise>" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.ISearchStartSearchSource.create.$1", - "type": "Object", - "tags": [], - "label": "fields", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - }, - " | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [] + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" }, { - "parentPluginId": "data", - "id": "def-public.ISearchStartSearchSource.createEmpty", - "type": "Function", - "tags": [], - "label": "createEmpty", - "description": [ - "\ncreates empty {@link SearchSource}" - ], - "signature": [ - "() => Pick<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" - }, - ", \"create\" | \"history\" | \"setPreferredSearchStrategyId\" | \"setField\" | \"removeField\" | \"setFields\" | \"getId\" | \"getFields\" | \"getField\" | \"getOwnField\" | \"createCopy\" | \"createChild\" | \"setParent\" | \"getParent\" | \"fetch$\" | \"fetch\" | \"onRequestStart\" | \"getSearchRequestBody\" | \"destroy\" | \"getSerializedFields\" | \"serialize\">" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false, - "children": [], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.OptionedValueProp", - "type": "Interface", - "tags": [], - "label": "OptionedValueProp", - "description": [], - "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", - "deprecated": false, - "children": [ + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + }, { - "parentPluginId": "data", - "id": "def-public.OptionedValueProp.value", - "type": "string", - "tags": [], - "label": "value", - "description": [], - "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" }, { - "parentPluginId": "data", - "id": "def-public.OptionedValueProp.text", - "type": "string", - "tags": [], - "label": "text", - "description": [], - "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" }, { - "parentPluginId": "data", - "id": "def-public.OptionedValueProp.disabled", - "type": "CompoundType", - "tags": [], - "label": "disabled", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" }, { - "parentPluginId": "data", - "id": "def-public.OptionedValueProp.isCompatible", - "type": "Function", - "tags": [], - "label": "isCompatible", - "description": [], - "signature": [ - "(agg: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" - }, - ") => boolean" - ], - "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.OptionedValueProp.isCompatible.$1", - "type": "Object", - "tags": [], - "label": "agg", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" - } - ], - "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.RefreshInterval", - "type": "Interface", - "tags": [], - "label": "RefreshInterval", - "description": [], - "path": "src/plugins/data/common/query/timefilter/types.ts", - "deprecated": false, - "children": [ + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + }, { - "parentPluginId": "data", - "id": "def-public.RefreshInterval.pause", - "type": "boolean", - "tags": [], - "label": "pause", - "description": [], - "path": "src/plugins/data/common/query/timefilter/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.tsx" }, { - "parentPluginId": "data", - "id": "def-public.RefreshInterval.value", - "type": "number", - "tags": [], - "label": "value", - "description": [], - "path": "src/plugins/data/common/query/timefilter/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields", - "type": "Interface", - "tags": [], - "label": "SearchSourceFields", - "description": [ - "\nsearch source fields" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false, - "children": [ + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.tsx" + }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.query", - "type": "Object", - "tags": [], - "label": "query", - "description": [ - "\n{@link Query}" - ], - "signature": [ - "Query", - " | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.filter", - "type": "CompoundType", - "tags": [], - "label": "filter", - "description": [ - "\n{@link Filter}" - ], - "signature": [ - "Filter", - " | ", - "Filter", - "[] | (() => ", - "Filter", - " | ", - "Filter", - "[] | undefined) | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.sort", - "type": "CompoundType", - "tags": [], - "label": "sort", - "description": [ - "\n{@link EsQuerySortValue}" - ], - "signature": [ - "Record | Record[] | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/metrics_editor/metrics_editor.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.highlight", - "type": "Any", - "tags": [], - "label": "highlight", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/metrics_editor/metrics_editor.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.highlightAll", - "type": "CompoundType", - "tags": [], - "label": "highlightAll", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.trackTotalHits", - "type": "CompoundType", - "tags": [], - "label": "trackTotalHits", - "description": [], - "signature": [ - "number | boolean | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.aggs", - "type": "CompoundType", - "tags": [], - "label": "aggs", - "description": [ - "\n{@link AggConfigs}" - ], - "signature": [ - "object | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfigs", - "text": "AggConfigs" - }, - " | (() => object) | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.from", - "type": "number", - "tags": [], - "label": "from", - "description": [], - "signature": [ - "number | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.size", - "type": "number", - "tags": [], - "label": "size", - "description": [], - "signature": [ - "number | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/update_source_editor.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.source", - "type": "CompoundType", - "tags": [], - "label": "source", - "description": [], - "signature": [ - "string | boolean | string[] | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/update_source_editor.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.version", - "type": "CompoundType", - "tags": [], - "label": "version", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.fields", - "type": "Array", - "tags": [], - "label": "fields", - "description": [ - "\nRetrieve fields via the search Fields API" - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchFieldValue", - "text": "SearchFieldValue" - }, - "[] | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.fieldsFromSource", - "type": "CompoundType", - "tags": [ - "deprecated" - ], - "label": "fieldsFromSource", - "description": [ - "\nRetreive fields directly from _source (legacy behavior)\n" - ], - "signature": [ - "string | string[] | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": true, - "references": [ - { - "plugin": "reporting", - "path": "x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts" - }, - { - "plugin": "reporting", - "path": "x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts" - } - ] + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.index", - "type": "Object", - "tags": [], - "label": "index", - "description": [ - "\n{@link IndexPatternService}" - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - " | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.searchAfter", - "type": "Object", - "tags": [], - "label": "searchAfter", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.EsQuerySearchAfter", - "text": "EsQuerySearchAfter" - }, - " | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.timeout", - "type": "string", - "tags": [], - "label": "timeout", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.terminate_after", - "type": "number", - "tags": [], - "label": "terminate_after", - "description": [], - "signature": [ - "number | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.SearchSourceFields.parent", - "type": "Object", - "tags": [], - "label": "parent", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - }, - " | undefined" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.TypeMeta", - "type": "Interface", - "tags": [], - "label": "TypeMeta", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" + }, { - "parentPluginId": "data", - "id": "def-public.TypeMeta.aggs", - "type": "Object", - "tags": [], - "label": "aggs", - "description": [], - "signature": [ - "Record> | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" }, { - "parentPluginId": "data", - "id": "def-public.TypeMeta.params", - "type": "Object", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "{ rollup_index: string; } | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - } - ], - "enums": [ - { - "parentPluginId": "data", - "id": "def-public.BUCKET_TYPES", - "type": "Enum", - "tags": [], - "label": "BUCKET_TYPES", - "description": [], - "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_types.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.ES_FIELD_TYPES", - "type": "Enum", - "tags": [], - "label": "ES_FIELD_TYPES", - "description": [], - "signature": [ - "ES_FIELD_TYPES" - ], - "path": "node_modules/@kbn/field-types/target_types/types.d.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternType", - "type": "Enum", - "tags": [], - "label": "IndexPatternType", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.KBN_FIELD_TYPES", - "type": "Enum", - "tags": [], - "label": "KBN_FIELD_TYPES", - "description": [], - "signature": [ - "KBN_FIELD_TYPES" - ], - "path": "node_modules/@kbn/field-types/target_types/types.d.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.METRIC_TYPES", - "type": "Enum", - "tags": [], - "label": "METRIC_TYPES", - "description": [], - "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_types.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.SortDirection", - "type": "Enum", - "tags": [], - "label": "SortDirection", - "description": [], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false, - "initialIsOpen": false - } - ], - "misc": [ - { - "parentPluginId": "data", - "id": "def-public.ACTION_GLOBAL_APPLY_FILTER", - "type": "string", - "tags": [], - "label": "ACTION_GLOBAL_APPLY_FILTER", - "description": [], - "signature": [ - "\"ACTION_GLOBAL_APPLY_FILTER\"" - ], - "path": "src/plugins/data/public/actions/apply_filter_action.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.AggConfigOptions", - "type": "Type", - "tags": [], - "label": "AggConfigOptions", - "description": [], - "signature": [ - "{ type: ", + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IAggType", - "text": "IAggType" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" }, - "; enabled?: boolean | undefined; id?: string | undefined; schema?: string | undefined; params?: {} | ", - "SerializableRecord", - " | undefined; }" - ], - "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.AggConfigSerialized", - "type": "Type", - "tags": [], - "label": "AggConfigSerialized", - "description": [], - "signature": [ - "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", - "SerializableRecord", - " | undefined; schema?: string | undefined; }" - ], - "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.AggGroupName", - "type": "Type", - "tags": [], - "label": "AggGroupName", - "description": [], - "signature": [ - "\"none\" | \"buckets\" | \"metrics\"" - ], - "path": "src/plugins/data/common/search/aggs/agg_groups.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.AggParam", - "type": "Type", - "tags": [], - "label": "AggParam", - "description": [], - "signature": [ { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.BaseParamType", - "text": "BaseParamType" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" }, - "<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" + "plugin": "maps", + "path": "x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts" }, - ">" - ], - "path": "src/plugins/data/common/search/aggs/agg_params.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.AggregationRestrictions", - "type": "Type", - "tags": [], - "label": "AggregationRestrictions", - "description": [], - "signature": [ - "{ [x: string]: { agg?: string | undefined; interval?: number | undefined; fixed_interval?: string | undefined; calendar_interval?: string | undefined; delay?: string | undefined; time_zone?: string | undefined; }; }" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.AggregationRestrictions", - "type": "Type", - "tags": [], - "label": "AggregationRestrictions", - "description": [], - "signature": [ - "{ [x: string]: { agg?: string | undefined; interval?: number | undefined; fixed_interval?: string | undefined; calendar_interval?: string | undefined; delay?: string | undefined; time_zone?: string | undefined; }; }" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.AggsStart", - "type": "Type", - "tags": [], - "label": "AggsStart", - "description": [ - "\nAggsStart represents the actual external contract as AggsCommonStart\nis only used internally. The difference is that AggsStart includes the\ntypings for the registry with initialized agg types.\n" - ], - "signature": [ - "{ calculateAutoTimeExpression: (range: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" + "plugin": "maps", + "path": "x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts" }, - ") => string | undefined; datatableUtilities: { getIndexPattern: (column: ", { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.DatatableColumn", - "text": "DatatableColumn" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx" }, - ") => Promise<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx" }, - " | undefined>; getAggConfig: (column: ", { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.DatatableColumn", - "text": "DatatableColumn" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" }, - ") => Promise<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" }, - " | undefined>; isFilterable: (column: ", { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.DatatableColumn", - "text": "DatatableColumn" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" }, - ") => boolean; }; createAggConfigs: (indexPattern: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" }, - ", configStates?: Pick & Pick<{ type: string | ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IAggType", - "text": "IAggType" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" }, - "; }, \"type\"> & Pick<{ type: string | ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IAggType", - "text": "IAggType" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" }, - "; }, never>, \"type\" | \"enabled\" | \"id\" | \"schema\" | \"params\">[] | undefined) => ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfigs", - "text": "AggConfigs" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/es_doc_field.d.ts" }, - "; types: ", - "AggTypesRegistryStart", - "; }" - ], - "path": "src/plugins/data/common/search/aggs/types.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.APPLY_FILTER_TRIGGER", - "type": "string", - "tags": [], - "label": "APPLY_FILTER_TRIGGER", - "description": [], - "signature": [ - "\"FILTER_TRIGGER\"" - ], - "path": "src/plugins/data/public/triggers/apply_filter_trigger.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.CustomFilter", - "type": "Type", - "tags": [ - "deprecated" - ], - "label": "CustomFilter", - "description": [], - "signature": [ - "{ $state?: { store: ", - "FilterStateStore", - "; } | undefined; meta: ", - "FilterMeta", - "; query?: Record | undefined; }" - ], - "path": "src/plugins/data/common/es_query/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.ES_SEARCH_STRATEGY", - "type": "string", - "tags": [], - "label": "ES_SEARCH_STRATEGY", - "description": [], - "signature": [ - "\"es\"" - ], - "path": "src/plugins/data/common/search/strategies/es_search/types.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.EsaggsExpressionFunctionDefinition", - "type": "Type", - "tags": [], - "label": "EsaggsExpressionFunctionDefinition", - "description": [], - "signature": [ { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/es_doc_field.d.ts" }, - "<\"esaggs\", Input, Arguments, Output, ", { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExecutionContext", - "text": "ExecutionContext" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/update_source_editor.d.ts" }, - "<", { - "pluginId": "inspector", - "scope": "common", - "docId": "kibInspectorPluginApi", - "section": "def-common.Adapters", - "text": "Adapters" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/update_source_editor.d.ts" }, - ", ", - "SerializableRecord", - ">>" - ], - "path": "src/plugins/data/common/search/expressions/esaggs/esaggs_fn.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.EsQueryConfig", - "type": "Type", - "tags": [ - "deprecated" - ], - "label": "EsQueryConfig", - "description": [], - "signature": [ - "KueryQueryOptions", - " & { allowLeadingWildcards: boolean; queryStringOptions: ", - "SerializableRecord", - "; ignoreFilterIfFieldNotInIndex: boolean; }" - ], - "path": "src/plugins/data/common/es_query/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/types.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/update_source_editor.d.ts" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/types.ts" - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.EsQuerySortValue", - "type": "Type", - "tags": [], - "label": "EsQuerySortValue", - "description": [], - "signature": [ - "{ [x: string]: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SortDirection", - "text": "SortDirection" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, - " | ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SortDirectionNumeric", - "text": "SortDirectionNumeric" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, - " | ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SortDirectionFormat", - "text": "SortDirectionFormat" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, - "; }" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.ExecutionContextSearch", - "type": "Type", - "tags": [], - "label": "ExecutionContextSearch", - "description": [], - "signature": [ - "{ filters?: ", - "Filter", - "[] | undefined; query?: ", - "Query", - " | ", - "Query", - "[] | undefined; timeRange?: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, - " | undefined; }" - ], - "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.ExistsFilter", - "type": "Type", - "tags": [ - "deprecated" - ], - "label": "ExistsFilter", - "description": [], - "signature": [ - "Filter", - " & { meta: ", - "FilterMeta", - "; exists?: { field: string; } | undefined; }" - ], - "path": "src/plugins/data/common/es_query/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ { - "plugin": "observability", - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, { - "plugin": "observability", - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.ExpressionFunctionKibana", - "type": "Type", - "tags": [], - "label": "ExpressionFunctionKibana", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, - "<\"kibana\", Input, object, ", { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, - "<\"kibana_context\", ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ExecutionContextSearch", - "text": "ExecutionContextSearch" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, - ">, ", { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExecutionContext", - "text": "ExecutionContext" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, - "<", { - "pluginId": "inspector", - "scope": "common", - "docId": "kibInspectorPluginApi", - "section": "def-common.Adapters", - "text": "Adapters" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, - ", ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ExecutionContextSearch", - "text": "ExecutionContextSearch" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, - ">>" - ], - "path": "src/plugins/data/common/search/expressions/kibana.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.ExpressionFunctionKibanaContext", - "type": "Type", - "tags": [], - "label": "ExpressionFunctionKibanaContext", - "description": [], - "signature": [ { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, - "<\"kibana_context\", Input, Arguments, Promise<", { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionValueBoxed", - "text": "ExpressionValueBoxed" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, - "<\"kibana_context\", ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ExecutionContextSearch", - "text": "ExecutionContextSearch" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, - ">>, ", { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExecutionContext", - "text": "ExecutionContext" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, - "<", { - "pluginId": "inspector", - "scope": "common", - "docId": "kibInspectorPluginApi", - "section": "def-common.Adapters", - "text": "Adapters" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_field_select.d.ts" }, - ", ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ExecutionContextSearch", - "text": "ExecutionContextSearch" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_field_select.d.ts" }, - ">>" - ], - "path": "src/plugins/data/common/search/expressions/kibana_context.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.ExpressionValueSearchContext", - "type": "Type", - "tags": [], - "label": "ExpressionValueSearchContext", - "description": [], - "signature": [ - "{ type: \"kibana_context\"; } & ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ExecutionContextSearch", - "text": "ExecutionContextSearch" - } - ], - "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.Filter", - "type": "Type", - "tags": [ - "deprecated" - ], - "label": "Filter", - "description": [], - "signature": [ - "{ $state?: { store: ", - "FilterStateStore", - "; } | undefined; meta: ", - "FilterMeta", - "; query?: Record | undefined; }" - ], - "path": "src/plugins/data/common/es_query/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/metrics_editor/metrics_editor.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/embeddable/types.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/metrics_editor/metrics_editor.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/embeddable/types.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/metrics_editor/metric_editor.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context/api/context.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/metrics_editor/metric_editor.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context/api/context.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context/api/context.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context/api/context.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.d.ts" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.d.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/filter_utils.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.d.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/filter_utils.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.d.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/filter_utils.ts" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/filter_utils.ts" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/filter_utils.ts" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/state/dashboard_state_slice.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/state/dashboard_state_slice.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/state/dashboard_state_slice.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/types.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/types.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/types.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/types.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/url_generator.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/url_generator.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/url_generator.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/locator.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/locator.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/locator.ts" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/list_control_factory.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/locator.ts" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/list_control_factory.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/types.ts" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/range_control_factory.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/types.ts" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/range_control_factory.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/types.ts" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/state_management/types.ts" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/state_management/types.ts" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.tsx" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.tsx" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts" }, { - "plugin": "observability", - "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts" }, { - "plugin": "observability", - "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_param_props.ts" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/common/types/timeline/store.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_param_props.ts" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/common/types/timeline/store.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/field.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/field.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/field.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/field.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/top_field.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/top_field.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/top_sort_field.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/hover_actions/utils.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/top_sort_field.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/hover_actions/utils.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/hover_actions/utils.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/reducers/map/types.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/reducers/map/types.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/agg_param_props.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/agg_param_props.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/controls/top_field.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/controls/top_field.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/controls/top_sort_field.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/controls/top_sort_field.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/actions/map_actions.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/actions/map_actions.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_filter_control/draw_filter_control.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_filter_control/draw_filter_control.tsx" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/group_fields.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_filter_control/draw_filter_control.tsx" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/group_fields.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_geometry_filter_form.tsx" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/group_fields.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_geometry_filter_form.tsx" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/group_fields.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_properties.tsx" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/group_fields.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_properties.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_properties.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_properties.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/features_tooltip.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/features_tooltip.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_popover.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_popover.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.tsx" + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.tsx" + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx" + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/field_stats.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/toolbar_overlay/toolbar_overlay.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/field_stats.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/toolbar_overlay/toolbar_overlay.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/field_stats.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/field_stats.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/field_stats.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/map_container/map_container.tsx" + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/map_container/map_container.tsx" + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/routes/map_page/url_state/global_sync.ts" + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/routes/map_page/url_state/global_sync.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/routes/map_page/url_state/app_state_manager.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/routes/map_page/url_state/app_state_manager.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/routes/map_page/url_state/app_state_manager.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/routes/map_page/map_app/index.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/routes/map_page/map_app/index.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/locators.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/locators.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/locators.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/locators.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/locators.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_field_visualize.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/components/log_stream/log_stream_embeddable.tsx" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_field_visualize.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/components/log_stream/log_stream_embeddable.tsx" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_field_visualize.d.ts" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx" }, { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/server/migrations/types.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/server/migrations/types.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/server/migrations/types.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/server/migrations/types.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/server/migrations/saved_object_migrations.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/server/migrations/saved_object_migrations.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" }, { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" }, { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" }, { - "plugin": "discoverEnhanced", - "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" }, { - "plugin": "discoverEnhanced", - "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.ts" - }, + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" + } + ], + "children": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IndexPatternsService", + "type": "Class", + "tags": [ + "deprecated" + ], + "label": "IndexPatternsService", + "description": [], + "signature": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/types/timeline/store.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPatternsService", + "text": "IndexPatternsService" }, + " extends ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/types/timeline/store.ts" - }, + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewsService", + "text": "DataViewsService" + } + ], + "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", + "deprecated": true, + "references": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/store/inputs/model.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/store/inputs/model.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/store/inputs/actions.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/store/inputs/actions.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/types.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/types.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/url_state/types.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/url_state/types.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/server/kibana_server_services.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/url_state/helpers.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/server/kibana_server_services.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/url_state/helpers.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/server/data_indexing/create_doc_source.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/url_state/helpers.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/server/data_indexing/create_doc_source.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/navigation/helpers.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/navigation/helpers.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/query_bar/index.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/query_bar/index.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/query_bar/index.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/fields_fetcher.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/fields_fetcher.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/plugin.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/plugin.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_patterns.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_bar/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_patterns.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_bar/index.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/helpers.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/helpers.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/helpers.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/navigation/types.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/navigation/types.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/navigation/types.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/combo_box_select.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/alerts_viewer/types.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/combo_box_select.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/alerts_viewer/types.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/alerts_viewer/types.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/alerts_viewer/alerts_table.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/alerts_viewer/alerts_table.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/alerts_viewer/alerts_table.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/navigation/alerts_query_tab_body.tsx" - }, + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + } + ], + "children": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.OptionedParamType", + "type": "Class", + "tags": [], + "label": "OptionedParamType", + "description": [], + "signature": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/navigation/alerts_query_tab_body.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.OptionedParamType", + "text": "OptionedParamType" }, + " extends ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.BaseParamType", + "text": "BaseParamType" }, + "<", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" }, + ">" + ], + "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", + "deprecated": false, + "children": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx" + "parentPluginId": "data", + "id": "def-public.OptionedParamType.options", + "type": "Array", + "tags": [], + "label": "options", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.OptionedValueProp", + "text": "OptionedValueProp" + }, + "[]" + ], + "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", + "deprecated": false }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx" - }, + "parentPluginId": "data", + "id": "def-public.OptionedParamType.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.OptionedParamType.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "config", + "description": [], + "signature": [ + "Record" + ], + "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.SearchSource", + "type": "Class", + "tags": [], + "label": "SearchSource", + "description": [], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/signals_by_category/index.tsx" + "parentPluginId": "data", + "id": "def-public.SearchSource.history", + "type": "Array", + "tags": [], + "label": "history", + "description": [], + "signature": [ + "Record[]" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/signals_by_category/index.tsx" + "parentPluginId": "data", + "id": "def-public.SearchSource.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.SearchSource.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "fields", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + } + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-public.SearchSource.Unnamed.$2", + "type": "Object", + "tags": [], + "label": "dependencies", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceDependencies", + "text": "SearchSourceDependencies" + } + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx" + "parentPluginId": "data", + "id": "def-public.SearchSource.setPreferredSearchStrategyId", + "type": "Function", + "tags": [], + "label": "setPreferredSearchStrategyId", + "description": [ + "**\nPUBLIC API\n\ninternal, dont use" + ], + "signature": [ + "(searchStrategyId: string) => void" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.SearchSource.setPreferredSearchStrategyId.$1", + "type": "string", + "tags": [], + "label": "searchStrategyId", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx" + "parentPluginId": "data", + "id": "def-public.SearchSource.setField", + "type": "Function", + "tags": [], + "label": "setField", + "description": [ + "\nsets value to a single search source field" + ], + "signature": [ + "(field: K, value: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + }, + "[K]) => this" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.SearchSource.setField.$1", + "type": "Uncategorized", + "tags": [], + "label": "field", + "description": [ + ": field name" + ], + "signature": [ + "K" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-public.SearchSource.setField.$2", + "type": "Uncategorized", + "tags": [], + "label": "value", + "description": [ + ": value for the field" + ], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + }, + "[K]" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + "parentPluginId": "data", + "id": "def-public.SearchSource.removeField", + "type": "Function", + "tags": [], + "label": "removeField", + "description": [ + "\nremove field" + ], + "signature": [ + "(field: K) => this" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.SearchSource.removeField.$1", + "type": "Uncategorized", + "tags": [], + "label": "field", + "description": [ + ": field name" + ], + "signature": [ + "K" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + "parentPluginId": "data", + "id": "def-public.SearchSource.setFields", + "type": "Function", + "tags": [ + "private" + ], + "label": "setFields", + "description": [ + "\nInternal, do not use. Overrides all search source fields with the new field array.\n" + ], + "signature": [ + "(newFields: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + }, + ") => this" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.SearchSource.setFields.$1", + "type": "Object", + "tags": [], + "label": "newFields", + "description": [ + "New field array." + ], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + } + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/helpers.ts" + "parentPluginId": "data", + "id": "def-public.SearchSource.getId", + "type": "Function", + "tags": [], + "label": "getId", + "description": [ + "\nreturns search source id" + ], + "signature": [ + "() => string" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/helpers.ts" + "parentPluginId": "data", + "id": "def-public.SearchSource.getFields", + "type": "Function", + "tags": [], + "label": "getFields", + "description": [ + "\nreturns all search source fields" + ], + "signature": [ + "() => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + } + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx" + "parentPluginId": "data", + "id": "def-public.SearchSource.getField", + "type": "Function", + "tags": [], + "label": "getField", + "description": [ + "\nGets a single field from the fields" + ], + "signature": [ + "(field: K, recurse?: boolean) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + }, + "[K]" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.SearchSource.getField.$1", + "type": "Uncategorized", + "tags": [], + "label": "field", + "description": [], + "signature": [ + "K" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-public.SearchSource.getField.$2", + "type": "boolean", + "tags": [], + "label": "recurse", + "description": [], + "signature": [ + "boolean" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.tsx" + "parentPluginId": "data", + "id": "def-public.SearchSource.getOwnField", + "type": "Function", + "tags": [], + "label": "getOwnField", + "description": [ + "\nGet the field from our own fields, don't traverse up the chain" + ], + "signature": [ + "(field: K) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + }, + "[K]" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.SearchSource.getOwnField.$1", + "type": "Uncategorized", + "tags": [], + "label": "field", + "description": [], + "signature": [ + "K" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.tsx" + "parentPluginId": "data", + "id": "def-public.SearchSource.create", + "type": "Function", + "tags": [ + "deprecated" + ], + "label": "create", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + } + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": true, + "references": [ + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + } + ], + "children": [], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/navigation/tab_navigation/types.ts" + "parentPluginId": "data", + "id": "def-public.SearchSource.createCopy", + "type": "Function", + "tags": [], + "label": "createCopy", + "description": [ + "\ncreates a copy of this search source (without its children)" + ], + "signature": [ + "() => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + } + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/navigation/tab_navigation/types.ts" + "parentPluginId": "data", + "id": "def-public.SearchSource.createChild", + "type": "Function", + "tags": [], + "label": "createChild", + "description": [ + "\ncreates a new child search source" + ], + "signature": [ + "(options?: {}) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + } + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.SearchSource.createChild.$1", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "{}" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/details/types.ts" + "parentPluginId": "data", + "id": "def-public.SearchSource.setParent", + "type": "Function", + "tags": [ + "return" + ], + "label": "setParent", + "description": [ + "\nSet a searchSource that this source should inherit from" + ], + "signature": [ + "(parent?: Pick<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + ", \"create\" | \"history\" | \"setPreferredSearchStrategyId\" | \"setField\" | \"removeField\" | \"setFields\" | \"getId\" | \"getFields\" | \"getField\" | \"getOwnField\" | \"createCopy\" | \"createChild\" | \"setParent\" | \"getParent\" | \"fetch$\" | \"fetch\" | \"onRequestStart\" | \"getSearchRequestBody\" | \"destroy\" | \"getSerializedFields\" | \"serialize\"> | undefined, options?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceOptions", + "text": "SearchSourceOptions" + }, + ") => this" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.SearchSource.setParent.$1", + "type": "Object", + "tags": [], + "label": "parent", + "description": [ + "- the parent searchSource" + ], + "signature": [ + "Pick<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + ", \"create\" | \"history\" | \"setPreferredSearchStrategyId\" | \"setField\" | \"removeField\" | \"setFields\" | \"getId\" | \"getFields\" | \"getField\" | \"getOwnField\" | \"createCopy\" | \"createChild\" | \"setParent\" | \"getParent\" | \"fetch$\" | \"fetch\" | \"onRequestStart\" | \"getSearchRequestBody\" | \"destroy\" | \"getSerializedFields\" | \"serialize\"> | undefined" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "isRequired": false + }, + { + "parentPluginId": "data", + "id": "def-public.SearchSource.setParent.$2", + "type": "Object", + "tags": [], + "label": "options", + "description": [ + "- the inherit options" + ], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceOptions", + "text": "SearchSourceOptions" + } + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [ + "- chainable" + ] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/details/types.ts" + "parentPluginId": "data", + "id": "def-public.SearchSource.getParent", + "type": "Function", + "tags": [ + "return" + ], + "label": "getParent", + "description": [ + "\nGet the parent of this SearchSource" + ], + "signature": [ + "() => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + " | undefined" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/details/types.ts" + "parentPluginId": "data", + "id": "def-public.SearchSource.fetch$", + "type": "Function", + "tags": [], + "label": "fetch$", + "description": [ + "\nFetch this source from Elasticsearch, returning an observable over the response(s)" + ], + "signature": [ + "(options?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ISearchOptions", + "text": "ISearchOptions" + }, + ") => ", + "Observable", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IKibanaSearchResponse", + "text": "IKibanaSearchResponse" + }, + "<", + "SearchResponse", + ">>" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.SearchSource.fetch$.$1", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ISearchOptions", + "text": "ISearchOptions" + } + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/details/helpers.ts" + "parentPluginId": "data", + "id": "def-public.SearchSource.fetch", + "type": "Function", + "tags": [ + "deprecated" + ], + "label": "fetch", + "description": [ + "\nFetch this source and reject the returned Promise on error" + ], + "signature": [ + "(options?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ISearchOptions", + "text": "ISearchOptions" + }, + ") => Promise<", + "SearchResponse", + ">" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [ + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/anchor.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/utils/fetch_hits_in_interval.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/list_control_factory.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/range_control_factory.ts" + } + ], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.SearchSource.fetch.$1", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ISearchOptions", + "text": "ISearchOptions" + } + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/details/helpers.ts" + "parentPluginId": "data", + "id": "def-public.SearchSource.onRequestStart", + "type": "Function", + "tags": [ + "return" + ], + "label": "onRequestStart", + "description": [ + "\n Add a handler that will be notified whenever requests start" + ], + "signature": [ + "(handler: (searchSource: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + ", options?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ISearchOptions", + "text": "ISearchOptions" + }, + " | undefined) => Promise) => void" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.SearchSource.onRequestStart.$1", + "type": "Function", + "tags": [], + "label": "handler", + "description": [], + "signature": [ + "(searchSource: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + ", options?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ISearchOptions", + "text": "ISearchOptions" + }, + " | undefined) => Promise" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx" + "parentPluginId": "data", + "id": "def-public.SearchSource.getSearchRequestBody", + "type": "Function", + "tags": [], + "label": "getSearchRequestBody", + "description": [ + "\nReturns body contents of the search request, often referred as query DSL." + ], + "signature": [ + "() => any" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx" + "parentPluginId": "data", + "id": "def-public.SearchSource.destroy", + "type": "Function", + "tags": [ + "return" + ], + "label": "destroy", + "description": [ + "\nCompletely destroy the SearchSource." + ], + "signature": [ + "() => void" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" + "parentPluginId": "data", + "id": "def-public.SearchSource.getSerializedFields", + "type": "Function", + "tags": [], + "label": "getSerializedFields", + "description": [ + "\nserializes search source fields (which can later be passed to {@link ISearchStartSearchSource})" + ], + "signature": [ + "(recurse?: boolean) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + } + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.SearchSource.getSerializedFields.$1", + "type": "boolean", + "tags": [], + "label": "recurse", + "description": [], + "signature": [ + "boolean" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts" - }, + "parentPluginId": "data", + "id": "def-public.SearchSource.serialize", + "type": "Function", + "tags": [], + "label": "serialize", + "description": [ + "\nSerializes the instance to a JSON string and a set of referenced objects.\nUse this method to get a representation of the search source which can be stored in a saved object.\n\nThe references returned by this function can be mixed with other references in the same object,\nhowever make sure there are no name-collisions. The references will be named `kibanaSavedObjectMeta.searchSourceJSON.index`\nand `kibanaSavedObjectMeta.searchSourceJSON.filter[].meta.index`.\n\nUsing `createSearchSource`, the instance can be re-created." + ], + "signature": [ + "() => { searchSourceJSON: string; references: ", + "SavedObjectReference", + "[]; }" + ], + "path": "src/plugins/data/common/search/search_source/search_source.ts", + "deprecated": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "functions": [ + { + "parentPluginId": "data", + "id": "def-public.castEsToKbnFieldTypeName", + "type": "Function", + "tags": [ + "deprecated" + ], + "label": "castEsToKbnFieldTypeName", + "description": [], + "signature": [ + "(esType: string) => ", + "KBN_FIELD_TYPES" + ], + "path": "src/plugins/data/common/kbn_field_types/index.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/public/lib/create_field_list.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" - }, + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/public/lib/create_field_list.ts" + } + ], + "returnComment": [], + "children": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/details/types.ts" - }, + "parentPluginId": "data", + "id": "def-public.castEsToKbnFieldTypeName.$1", + "type": "string", + "tags": [], + "label": "esType", + "description": [], + "path": "node_modules/@kbn/field-types/target_types/kbn_field_types.d.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.extractReferences", + "type": "Function", + "tags": [], + "label": "extractReferences", + "description": [], + "signature": [ + "(state: ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/details/types.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" }, + ") => [", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/details/types.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" }, + " & { indexRefName?: string | undefined; }, ", + "SavedObjectReference", + "[]]" + ], + "path": "src/plugins/data/common/search/search_source/extract_references.ts", + "deprecated": false, + "children": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/details/helpers.ts" - }, + "parentPluginId": "data", + "id": "def-public.extractReferences.$1", + "type": "Object", + "tags": [], + "label": "state", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + } + ], + "path": "src/plugins/data/common/search/search_source/extract_references.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.fieldList", + "type": "Function", + "tags": [], + "label": "fieldList", + "description": [], + "signature": [ + "(specs?: ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/details/helpers.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" }, + "[], shortDotsEnable?: boolean) => ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/details/index.tsx" - }, + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IIndexPatternFieldList", + "text": "IIndexPatternFieldList" + } + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "children": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/details/index.tsx" + "parentPluginId": "data", + "id": "def-public.fieldList.$1", + "type": "Array", + "tags": [], + "label": "specs", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + "[]" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "isRequired": true }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/url_state/initialize_redux_by_url.tsx" - }, + "parentPluginId": "data", + "id": "def-public.fieldList.$2", + "type": "boolean", + "tags": [], + "label": "shortDotsEnable", + "description": [], + "signature": [ + "boolean" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.getEsQueryConfig", + "type": "Function", + "tags": [], + "label": "getEsQueryConfig", + "description": [], + "signature": [ + "(config: KibanaConfig) => ", + "EsQueryConfig" + ], + "path": "src/plugins/data/common/es_query/get_es_query_config.ts", + "deprecated": false, + "children": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/url_state/initialize_redux_by_url.tsx" - }, + "parentPluginId": "data", + "id": "def-public.getEsQueryConfig.$1", + "type": "Object", + "tags": [], + "label": "config", + "description": [], + "signature": [ + "KibanaConfig" + ], + "path": "src/plugins/data/common/es_query/get_es_query_config.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.getKbnTypeNames", + "type": "Function", + "tags": [ + "deprecated" + ], + "label": "getKbnTypeNames", + "description": [], + "signature": [ + "() => string[]" + ], + "path": "src/plugins/data/common/kbn_field_types/index.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/search_or_filter.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/search_or_filter.tsx" - }, + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts" + } + ], + "returnComment": [], + "children": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.getSearchParamsFromRequest", + "type": "Function", + "tags": [], + "label": "getSearchParamsFromRequest", + "description": [], + "signature": [ + "(searchRequest: Record, dependencies: { getConfig: ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/search_or_filter.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataPluginApi", + "section": "def-common.GetConfigFn", + "text": "GetConfigFn" }, + "; }) => ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/index.tsx" - }, + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ISearchRequestParams", + "text": "ISearchRequestParams" + } + ], + "path": "src/plugins/data/common/search/search_source/fetch/get_search_params.ts", + "deprecated": false, + "children": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/index.tsx" + "parentPluginId": "data", + "id": "def-public.getSearchParamsFromRequest.$1", + "type": "Object", + "tags": [], + "label": "searchRequest", + "description": [], + "signature": [ + "Record" + ], + "path": "src/plugins/data/common/search/search_source/fetch/get_search_params.ts", + "deprecated": false, + "isRequired": true }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/index.tsx" - }, + "parentPluginId": "data", + "id": "def-public.getSearchParamsFromRequest.$2", + "type": "Object", + "tags": [], + "label": "dependencies", + "description": [], + "path": "src/plugins/data/common/search/search_source/fetch/get_search_params.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.getSearchParamsFromRequest.$2.getConfig", + "type": "Function", + "tags": [], + "label": "getConfig", + "description": [], + "signature": [ + "(key: string, defaultOverride?: T | undefined) => T" + ], + "path": "src/plugins/data/common/search/search_source/fetch/get_search_params.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.getSearchParamsFromRequest.$2.getConfig.$1", + "type": "string", + "tags": [], + "label": "key", + "description": [], + "path": "src/plugins/data/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.getSearchParamsFromRequest.$2.getConfig.$2", + "type": "Uncategorized", + "tags": [], + "label": "defaultOverride", + "description": [], + "signature": [ + "T | undefined" + ], + "path": "src/plugins/data/common/types.ts", + "deprecated": false + } + ] + } + ] + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.getTime", + "type": "Function", + "tags": [], + "label": "getTime", + "description": [], + "signature": [ + "(indexPattern: ", { - "plugin": "urlDrilldown", - "path": "x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IIndexPattern", + "text": "IIndexPattern" }, + " | undefined, timeRange: ", { - "plugin": "urlDrilldown", - "path": "x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" }, + ", options: { forceNow?: Date | undefined; fieldName?: string | undefined; } | undefined) => ", + "RangeFilter", + " | ", + "ScriptedRangeFilter", + " | ", + "MatchAllRangeFilter", + " | undefined" + ], + "path": "src/plugins/data/common/query/timefilter/get_time.ts", + "deprecated": false, + "children": [ { - "plugin": "urlDrilldown", - "path": "x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx" + "parentPluginId": "data", + "id": "def-public.getTime.$1", + "type": "Object", + "tags": [], + "label": "indexPattern", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IIndexPattern", + "text": "IIndexPattern" + }, + " | undefined" + ], + "path": "src/plugins/data/common/query/timefilter/get_time.ts", + "deprecated": false, + "isRequired": false }, { - "plugin": "urlDrilldown", - "path": "x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx" + "parentPluginId": "data", + "id": "def-public.getTime.$2", + "type": "Object", + "tags": [], + "label": "timeRange", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } + ], + "path": "src/plugins/data/common/query/timefilter/get_time.ts", + "deprecated": false, + "isRequired": true }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/persistence/filter_references.test.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/persistence/filter_references.test.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/selectors/map_selectors.test.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/selectors/map_selectors.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.test.ts" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts" - }, + "parentPluginId": "data", + "id": "def-public.getTime.$3", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "path": "src/plugins/data/common/query/timefilter/get_time.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.getTime.$3.forceNow", + "type": "Object", + "tags": [], + "label": "forceNow", + "description": [], + "signature": [ + "Date | undefined" + ], + "path": "src/plugins/data/common/query/timefilter/get_time.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.getTime.$3.fieldName", + "type": "string", + "tags": [], + "label": "fieldName", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/query/timefilter/get_time.ts", + "deprecated": false + } + ] + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.injectReferences", + "type": "Function", + "tags": [], + "label": "injectReferences", + "description": [], + "signature": [ + "(searchSourceFields: ", { - "plugin": "discoverEnhanced", - "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" }, + " & { indexRefName: string; }, references: ", + "SavedObjectReference", + "[]) => ", { - "plugin": "discoverEnhanced", - "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts" - }, + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + } + ], + "path": "src/plugins/data/common/search/search_source/inject_references.ts", + "deprecated": false, + "children": [ { - "plugin": "discoverEnhanced", - "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts" + "parentPluginId": "data", + "id": "def-public.injectReferences.$1", + "type": "CompoundType", + "tags": [], + "label": "searchSourceFields", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + }, + " & { indexRefName: string; }" + ], + "path": "src/plugins/data/common/search/search_source/inject_references.ts", + "deprecated": false, + "isRequired": true }, { - "plugin": "urlDrilldown", - "path": "x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts" - }, + "parentPluginId": "data", + "id": "def-public.injectReferences.$2", + "type": "Array", + "tags": [], + "label": "references", + "description": [], + "signature": [ + "SavedObjectReference", + "[]" + ], + "path": "src/plugins/data/common/search/search_source/inject_references.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.isCompleteResponse", + "type": "Function", + "tags": [], + "label": "isCompleteResponse", + "description": [], + "signature": [ + "(response?: ", { - "plugin": "urlDrilldown", - "path": "x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IKibanaSearchResponse", + "text": "IKibanaSearchResponse" }, + " | undefined) => boolean" + ], + "path": "src/plugins/data/common/search/utils.ts", + "deprecated": false, + "children": [ { - "plugin": "lens", - "path": "x-pack/plugins/lens/target/types/public/embeddable/embeddable.d.ts" - }, + "parentPluginId": "data", + "id": "def-public.isCompleteResponse.$1", + "type": "Object", + "tags": [], + "label": "response", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IKibanaSearchResponse", + "text": "IKibanaSearchResponse" + }, + " | undefined" + ], + "path": "src/plugins/data/common/search/utils.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [ + "true if response is completed successfully" + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.isErrorResponse", + "type": "Function", + "tags": [], + "label": "isErrorResponse", + "description": [], + "signature": [ + "(response?: ", { - "plugin": "lens", - "path": "x-pack/plugins/lens/target/types/public/embeddable/embeddable.d.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IKibanaSearchResponse", + "text": "IKibanaSearchResponse" }, + " | undefined) => boolean" + ], + "path": "src/plugins/data/common/search/utils.ts", + "deprecated": false, + "children": [ { - "plugin": "lens", - "path": "x-pack/plugins/lens/target/types/server/migrations/types.d.ts" - }, + "parentPluginId": "data", + "id": "def-public.isErrorResponse.$1", + "type": "Object", + "tags": [], + "label": "response", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IKibanaSearchResponse", + "text": "IKibanaSearchResponse" + }, + " | undefined" + ], + "path": "src/plugins/data/common/search/utils.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [ + "true if response had an error while executing in ES" + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.isFilter", + "type": "Function", + "tags": [ + "deprecated" + ], + "label": "isFilter", + "description": [], + "signature": [ + "(x: unknown) => x is ", + "Filter" + ], + "path": "src/plugins/data/common/es_query/index.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [], + "returnComment": [], + "children": [ { - "plugin": "lens", - "path": "x-pack/plugins/lens/target/types/server/migrations/types.d.ts" - }, + "parentPluginId": "data", + "id": "def-public.isFilter.$1", + "type": "Unknown", + "tags": [], + "label": "x", + "description": [], + "signature": [ + "unknown" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/helpers/meta_filter.d.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.isFilters", + "type": "Function", + "tags": [ + "deprecated" + ], + "label": "isFilters", + "description": [], + "signature": [ + "(x: unknown) => x is ", + "Filter", + "[]" + ], + "path": "src/plugins/data/common/es_query/index.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [ { - "plugin": "lens", - "path": "x-pack/plugins/lens/target/types/server/migrations/types.d.ts" + "plugin": "dashboardEnhanced", + "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/target/types/server/migrations/types.d.ts" - }, + "plugin": "dashboardEnhanced", + "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" + } + ], + "returnComment": [], + "children": [ { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/tooltips/tooltip_property.d.ts" - }, + "parentPluginId": "data", + "id": "def-public.isFilters.$1", + "type": "Unknown", + "tags": [], + "label": "x", + "description": [], + "signature": [ + "unknown" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/helpers/meta_filter.d.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.isPartialResponse", + "type": "Function", + "tags": [], + "label": "isPartialResponse", + "description": [], + "signature": [ + "(response?: ", { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/tooltips/tooltip_property.d.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IKibanaSearchResponse", + "text": "IKibanaSearchResponse" }, + " | undefined) => boolean" + ], + "path": "src/plugins/data/common/search/utils.ts", + "deprecated": false, + "children": [ { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/tooltips/tooltip_property.d.ts" - }, + "parentPluginId": "data", + "id": "def-public.isPartialResponse.$1", + "type": "Object", + "tags": [], + "label": "response", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IKibanaSearchResponse", + "text": "IKibanaSearchResponse" + }, + " | undefined" + ], + "path": "src/plugins/data/common/search/utils.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [ + "true if request is still running an/d response contains partial results" + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.isQuery", + "type": "Function", + "tags": [], + "label": "isQuery", + "description": [], + "signature": [ + "(x: unknown) => x is ", + "Query" + ], + "path": "src/plugins/data/common/query/is_query.ts", + "deprecated": false, + "children": [ { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/tooltips/tooltip_property.d.ts" - }, + "parentPluginId": "data", + "id": "def-public.isQuery.$1", + "type": "Unknown", + "tags": [], + "label": "x", + "description": [], + "signature": [ + "unknown" + ], + "path": "src/plugins/data/common/query/is_query.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.isTimeRange", + "type": "Function", + "tags": [], + "label": "isTimeRange", + "description": [], + "signature": [ + "(x: unknown) => x is ", { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/sources/vector_source/vector_source.d.ts" - }, + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } + ], + "path": "src/plugins/data/common/query/timefilter/is_time_range.ts", + "deprecated": false, + "children": [ { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/sources/vector_source/vector_source.d.ts" - }, + "parentPluginId": "data", + "id": "def-public.isTimeRange.$1", + "type": "Unknown", + "tags": [], + "label": "x", + "description": [], + "signature": [ + "unknown" + ], + "path": "src/plugins/data/common/query/timefilter/is_time_range.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.parseSearchSourceJSON", + "type": "Function", + "tags": [], + "label": "parseSearchSourceJSON", + "description": [], + "signature": [ + "(searchSourceJSON: string) => ", { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/actions/map_actions.d.ts" - }, + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + } + ], + "path": "src/plugins/data/common/search/search_source/parse_json.ts", + "deprecated": false, + "children": [ { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/actions/map_actions.d.ts" - }, + "parentPluginId": "data", + "id": "def-public.parseSearchSourceJSON.$1", + "type": "string", + "tags": [], + "label": "searchSourceJSON", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data/common/search/search_source/parse_json.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping", + "type": "Interface", + "tags": [], + "label": "AggFunctionsMapping", + "description": [ + "\nA global list of the expression function definitions for each agg type function." + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false, + "children": [ { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/routes/map_page/url_state/global_sync.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/routes/map_page/url_state/global_sync.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/routes/map_page/url_state/app_state_manager.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/routes/map_page/url_state/app_state_manager.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/routes/map_page/url_state/app_state_manager.d.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.test.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/map_container/map_container.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/map_container/map_container.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/mb_map.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggFilter", + "type": "Object", + "tags": [], + "label": "aggFilter", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggFilter\", any, Pick, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\"> & Pick<{ geo_bounding_box?: ({ type: \"geo_bounding_box\"; } & GeoBox) | ({ type: \"geo_bounding_box\"; } & { top_left: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GeoPoint", + "text": "GeoPoint" + }, + "; bottom_right: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GeoPoint", + "text": "GeoPoint" + }, + "; }) | ({ type: \"geo_bounding_box\"; } & { top_right: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GeoPoint", + "text": "GeoPoint" + }, + "; bottom_left: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GeoPoint", + "text": "GeoPoint" + }, + "; }) | ({ type: \"geo_bounding_box\"; } & WellKnownText) | undefined; filter?: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"kibana_query\", ", + "Query", + "> | undefined; }, \"filter\" | \"geo_bounding_box\"> & Pick<{ geo_bounding_box?: ({ type: \"geo_bounding_box\"; } & GeoBox) | ({ type: \"geo_bounding_box\"; } & { top_left: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GeoPoint", + "text": "GeoPoint" + }, + "; bottom_right: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GeoPoint", + "text": "GeoPoint" + }, + "; }) | ({ type: \"geo_bounding_box\"; } & { top_right: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GeoPoint", + "text": "GeoPoint" + }, + "; bottom_left: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GeoPoint", + "text": "GeoPoint" + }, + "; }) | ({ type: \"geo_bounding_box\"; } & WellKnownText) | undefined; filter?: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"kibana_query\", ", + "Query", + "> | undefined; }, never>, \"enabled\" | \"id\" | \"filter\" | \"schema\" | \"geo_bounding_box\" | \"json\" | \"customLabel\" | \"timeShift\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/mb_map.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggFilters", + "type": "Object", + "tags": [], + "label": "aggFilters", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggFilters\", any, Pick, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ filters?: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"kibana_query_filter\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.QueryFilter", + "text": "QueryFilter" + }, + ">[] | undefined; }, \"filters\"> & Pick<{ filters?: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"kibana_query_filter\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.QueryFilter", + "text": "QueryFilter" + }, + ">[] | undefined; }, never>, \"enabled\" | \"filters\" | \"id\" | \"schema\" | \"json\" | \"timeShift\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/toolbar_overlay/toolbar_overlay.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggSignificantTerms", + "type": "Object", + "tags": [], + "label": "aggSignificantTerms", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggSignificantTerms\", any, ", + "AggExpressionFunctionArgs", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.BUCKET_TYPES", + "text": "BUCKET_TYPES" + }, + ".SIGNIFICANT_TERMS>, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/toolbar_overlay/toolbar_overlay.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggIpRange", + "type": "Object", + "tags": [], + "label": "aggIpRange", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggIpRange\", any, Pick, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: (", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"cidr\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.Cidr", + "text": "Cidr" + }, + "> | ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"ip_range\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IpRange", + "text": "IpRange" + }, + ">)[] | undefined; ipRangeType?: string | undefined; }, \"ipRangeType\" | \"ranges\"> & Pick<{ ranges?: (", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"cidr\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.Cidr", + "text": "Cidr" + }, + "> | ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"ip_range\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IpRange", + "text": "IpRange" + }, + ">)[] | undefined; ipRangeType?: string | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"ipRangeType\" | \"ranges\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggDateRange", + "type": "Object", + "tags": [], + "label": "aggDateRange", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggDateRange\", any, Pick, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"time_zone\"> & Pick<{ ranges?: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"date_range\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.DateRange", + "text": "DateRange" + }, + ">[] | undefined; }, \"ranges\"> & Pick<{ ranges?: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"date_range\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.DateRange", + "text": "DateRange" + }, + ">[] | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"ranges\" | \"time_zone\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/tooltip_control.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/tooltip_control.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/tooltip_popover.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/tooltip_popover.d.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggRange", + "type": "Object", + "tags": [], + "label": "aggRange", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggRange\", any, Pick, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"numerical_range\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.NumericalRange", + "text": "NumericalRange" + }, + ">[] | undefined; }, \"ranges\"> & Pick<{ ranges?: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"numerical_range\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.NumericalRange", + "text": "NumericalRange" + }, + ">[] | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"ranges\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggGeoTile", + "type": "Object", + "tags": [], + "label": "aggGeoTile", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggGeoTile\", any, ", + "AggExpressionFunctionArgs", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.BUCKET_TYPES", + "text": "BUCKET_TYPES" + }, + ".GEOTILE_GRID>, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggGeoHash", + "type": "Object", + "tags": [], + "label": "aggGeoHash", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggGeoHash\", any, Pick, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\"> & Pick<{ boundingBox?: ({ type: \"geo_bounding_box\"; } & GeoBox) | ({ type: \"geo_bounding_box\"; } & { top_left: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GeoPoint", + "text": "GeoPoint" + }, + "; bottom_right: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GeoPoint", + "text": "GeoPoint" + }, + "; }) | ({ type: \"geo_bounding_box\"; } & { top_right: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GeoPoint", + "text": "GeoPoint" + }, + "; bottom_left: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GeoPoint", + "text": "GeoPoint" + }, + "; }) | ({ type: \"geo_bounding_box\"; } & WellKnownText) | undefined; }, \"boundingBox\"> & Pick<{ boundingBox?: ({ type: \"geo_bounding_box\"; } & GeoBox) | ({ type: \"geo_bounding_box\"; } & { top_left: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GeoPoint", + "text": "GeoPoint" + }, + "; bottom_right: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GeoPoint", + "text": "GeoPoint" + }, + "; }) | ({ type: \"geo_bounding_box\"; } & { top_right: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GeoPoint", + "text": "GeoPoint" + }, + "; bottom_left: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.GeoPoint", + "text": "GeoPoint" + }, + "; }) | ({ type: \"geo_bounding_box\"; } & WellKnownText) | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\" | \"boundingBox\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggHistogram", + "type": "Object", + "tags": [], + "label": "aggHistogram", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggHistogram\", any, Pick, \"enabled\" | \"interval\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\"> & Pick<{ extended_bounds?: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"extended_bounds\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ExtendedBounds", + "text": "ExtendedBounds" + }, + "> | undefined; }, \"extended_bounds\"> & Pick<{ extended_bounds?: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"extended_bounds\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ExtendedBounds", + "text": "ExtendedBounds" + }, + "> | undefined; }, never>, \"enabled\" | \"interval\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\" | \"extended_bounds\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggDateHistogram", + "type": "Object", + "tags": [], + "label": "aggDateHistogram", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggDateHistogram\", any, Pick, \"enabled\" | \"interval\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\"> & Pick<{ timeRange?: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"timerange\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, + "> | undefined; extended_bounds?: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"extended_bounds\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ExtendedBounds", + "text": "ExtendedBounds" + }, + "> | undefined; }, \"timeRange\" | \"extended_bounds\"> & Pick<{ timeRange?: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"timerange\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, + "> | undefined; extended_bounds?: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" + }, + "<\"extended_bounds\", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ExtendedBounds", + "text": "ExtendedBounds" + }, + "> | undefined; }, never>, \"enabled\" | \"interval\" | \"timeRange\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"extended_bounds\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggTerms", + "type": "Object", + "tags": [], + "label": "aggTerms", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggTerms\", any, Pick, \"enabled\" | \"id\" | \"size\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"orderBy\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\"> & Pick<{ orderAgg?: ", + "AggExpressionType", + " | undefined; }, \"orderAgg\"> & Pick<{ orderAgg?: ", + "AggExpressionType", + " | undefined; }, never>, \"enabled\" | \"id\" | \"size\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"orderBy\" | \"orderAgg\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/ueba/pages/details/types.d.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/ueba/pages/details/types.d.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/ueba/pages/details/types.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/draw_control/draw_filter_control/draw_filter_control.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/draw_control/draw_filter_control/draw_filter_control.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_geometry_filter_form.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_geometry_filter_form.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggAvg", + "type": "Object", + "tags": [], + "label": "aggAvg", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggAvg\", any, ", + "AggExpressionFunctionArgs", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.METRIC_TYPES", + "text": "METRIC_TYPES" + }, + ".AVG>, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_properties.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggBucketAvg", + "type": "Object", + "tags": [], + "label": "aggBucketAvg", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggBucketAvg\", any, Pick, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\"> & Pick<{ customBucket?: ", + "AggExpressionType", + " | undefined; customMetric?: ", + "AggExpressionType", + " | undefined; }, \"customMetric\" | \"customBucket\"> & Pick<{ customBucket?: ", + "AggExpressionType", + " | undefined; customMetric?: ", + "AggExpressionType", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_properties.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggBucketMax", + "type": "Object", + "tags": [], + "label": "aggBucketMax", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggBucketMax\", any, Pick, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\"> & Pick<{ customBucket?: ", + "AggExpressionType", + " | undefined; customMetric?: ", + "AggExpressionType", + " | undefined; }, \"customMetric\" | \"customBucket\"> & Pick<{ customBucket?: ", + "AggExpressionType", + " | undefined; customMetric?: ", + "AggExpressionType", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_properties.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggBucketMin", + "type": "Object", + "tags": [], + "label": "aggBucketMin", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggBucketMin\", any, Pick, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\"> & Pick<{ customBucket?: ", + "AggExpressionType", + " | undefined; customMetric?: ", + "AggExpressionType", + " | undefined; }, \"customMetric\" | \"customBucket\"> & Pick<{ customBucket?: ", + "AggExpressionType", + " | undefined; customMetric?: ", + "AggExpressionType", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_properties.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggBucketSum", + "type": "Object", + "tags": [], + "label": "aggBucketSum", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggBucketSum\", any, Pick, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\"> & Pick<{ customBucket?: ", + "AggExpressionType", + " | undefined; customMetric?: ", + "AggExpressionType", + " | undefined; }, \"customMetric\" | \"customBucket\"> & Pick<{ customBucket?: ", + "AggExpressionType", + " | undefined; customMetric?: ", + "AggExpressionType", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/features_tooltip/features_tooltip.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggFilteredMetric", + "type": "Object", + "tags": [], + "label": "aggFilteredMetric", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggFilteredMetric\", any, Pick, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\"> & Pick<{ customBucket?: ", + "AggExpressionType", + " | undefined; customMetric?: ", + "AggExpressionType", + " | undefined; }, \"customMetric\" | \"customBucket\"> & Pick<{ customBucket?: ", + "AggExpressionType", + " | undefined; customMetric?: ", + "AggExpressionType", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/features_tooltip/features_tooltip.d.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggCardinality", + "type": "Object", + "tags": [], + "label": "aggCardinality", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggCardinality\", any, ", + "AggExpressionFunctionArgs", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.METRIC_TYPES", + "text": "METRIC_TYPES" + }, + ".CARDINALITY>, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/url_generator.test.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggCount", + "type": "Object", + "tags": [], + "label": "aggCount", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggCount\", any, ", + "AggExpressionFunctionArgs", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.METRIC_TYPES", + "text": "METRIC_TYPES" + }, + ".COUNT>, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/url_generator.test.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggCumulativeSum", + "type": "Object", + "tags": [], + "label": "aggCumulativeSum", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggCumulativeSum\", any, Pick, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + "AggExpressionType", + " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", + "AggExpressionType", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "inputControlVis", - "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" - }, - { - "plugin": "inputControlVis", - "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" - }, - { - "plugin": "inputControlVis", - "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggDerivative", + "type": "Object", + "tags": [], + "label": "aggDerivative", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggDerivative\", any, Pick, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + "AggExpressionType", + " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", + "AggExpressionType", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "inputControlVis", - "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggGeoBounds", + "type": "Object", + "tags": [], + "label": "aggGeoBounds", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggGeoBounds\", any, ", + "AggExpressionFunctionArgs", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.METRIC_TYPES", + "text": "METRIC_TYPES" + }, + ".GEO_BOUNDS>, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "inputControlVis", - "path": "src/plugins/input_control_vis/public/control/control.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggGeoCentroid", + "type": "Object", + "tags": [], + "label": "aggGeoCentroid", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggGeoCentroid\", any, ", + "AggExpressionFunctionArgs", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.METRIC_TYPES", + "text": "METRIC_TYPES" + }, + ".GEO_CENTROID>, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "inputControlVis", - "path": "src/plugins/input_control_vis/public/control/control.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggMax", + "type": "Object", + "tags": [], + "label": "aggMax", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggMax\", any, ", + "AggExpressionFunctionArgs", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.METRIC_TYPES", + "text": "METRIC_TYPES" + }, + ".MAX>, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "inputControlVis", - "path": "src/plugins/input_control_vis/public/vis_controller.tsx" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggMedian", + "type": "Object", + "tags": [], + "label": "aggMedian", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggMedian\", any, ", + "AggExpressionFunctionArgs", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.METRIC_TYPES", + "text": "METRIC_TYPES" + }, + ".MEDIAN>, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "inputControlVis", - "path": "src/plugins/input_control_vis/public/vis_controller.tsx" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggSinglePercentile", + "type": "Object", + "tags": [], + "label": "aggSinglePercentile", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggSinglePercentile\", any, ", + "AggExpressionFunctionArgs", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.METRIC_TYPES", + "text": "METRIC_TYPES" + }, + ".SINGLE_PERCENTILE>, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggMin", + "type": "Object", + "tags": [], + "label": "aggMin", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggMin\", any, ", + "AggExpressionFunctionArgs", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.METRIC_TYPES", + "text": "METRIC_TYPES" + }, + ".MIN>, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggMovingAvg", + "type": "Object", + "tags": [], + "label": "aggMovingAvg", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggMovingAvg\", any, Pick, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\"> & Pick<{ customMetric?: ", + "AggExpressionType", + " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", + "AggExpressionType", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "visualize", - "path": "src/plugins/visualize/public/application/types.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggPercentileRanks", + "type": "Object", + "tags": [], + "label": "aggPercentileRanks", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggPercentileRanks\", any, ", + "AggExpressionFunctionArgs", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.METRIC_TYPES", + "text": "METRIC_TYPES" + }, + ".PERCENTILE_RANKS>, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "visualize", - "path": "src/plugins/visualize/public/application/types.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggPercentiles", + "type": "Object", + "tags": [], + "label": "aggPercentiles", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggPercentiles\", any, ", + "AggExpressionFunctionArgs", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.METRIC_TYPES", + "text": "METRIC_TYPES" + }, + ".PERCENTILES>, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "visualize", - "path": "src/plugins/visualize/public/application/types.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggSerialDiff", + "type": "Object", + "tags": [], + "label": "aggSerialDiff", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggSerialDiff\", any, Pick, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + "AggExpressionType", + " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", + "AggExpressionType", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "visualize", - "path": "src/plugins/visualize/public/application/types.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggStdDeviation", + "type": "Object", + "tags": [], + "label": "aggStdDeviation", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggStdDeviation\", any, ", + "AggExpressionFunctionArgs", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.METRIC_TYPES", + "text": "METRIC_TYPES" + }, + ".STD_DEV>, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "visualize", - "path": "src/plugins/visualize/public/application/utils/utils.ts" + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggSum", + "type": "Object", + "tags": [], + "label": "aggSum", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggSum\", any, ", + "AggExpressionFunctionArgs", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.METRIC_TYPES", + "text": "METRIC_TYPES" + }, + ".SUM>, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false }, { - "plugin": "visualize", - "path": "src/plugins/visualize/public/application/utils/utils.ts" - }, + "parentPluginId": "data", + "id": "def-public.AggFunctionsMapping.aggTopHit", + "type": "Object", + "tags": [], + "label": "aggTopHit", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"aggTopHit\", any, ", + "AggExpressionFunctionArgs", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.METRIC_TYPES", + "text": "METRIC_TYPES" + }, + ".TOP_HITS>, ", + "AggExpressionType", + ", ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.AggParamOption", + "type": "Interface", + "tags": [], + "label": "AggParamOption", + "description": [], + "path": "src/plugins/data/common/search/aggs/agg_params.ts", + "deprecated": false, + "children": [ { - "plugin": "visualize", - "path": "src/plugins/visualize/public/application/utils/use/use_linked_search_updates.ts" + "parentPluginId": "data", + "id": "def-public.AggParamOption.val", + "type": "string", + "tags": [], + "label": "val", + "description": [], + "path": "src/plugins/data/common/search/aggs/agg_params.ts", + "deprecated": false }, { - "plugin": "visualize", - "path": "src/plugins/visualize/public/application/utils/use/use_linked_search_updates.ts" + "parentPluginId": "data", + "id": "def-public.AggParamOption.display", + "type": "string", + "tags": [], + "label": "display", + "description": [], + "path": "src/plugins/data/common/search/aggs/agg_params.ts", + "deprecated": false }, { - "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/timelion_vis_fn.ts" - }, + "parentPluginId": "data", + "id": "def-public.AggParamOption.enabled", + "type": "Function", + "tags": [], + "label": "enabled", + "description": [], + "signature": [ + "((agg: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" + }, + ") => boolean) | undefined" + ], + "path": "src/plugins/data/common/search/aggs/agg_params.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.AggParamOption.enabled.$1", + "type": "Object", + "tags": [], + "label": "agg", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" + } + ], + "path": "src/plugins/data/common/search/aggs/agg_params.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.ApplyGlobalFilterActionContext", + "type": "Interface", + "tags": [], + "label": "ApplyGlobalFilterActionContext", + "description": [], + "path": "src/plugins/data/public/actions/apply_filter_action.ts", + "deprecated": false, + "children": [ { - "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/timelion_vis_fn.ts" + "parentPluginId": "data", + "id": "def-public.ApplyGlobalFilterActionContext.filters", + "type": "Array", + "tags": [], + "label": "filters", + "description": [], + "signature": [ + "Filter", + "[]" + ], + "path": "src/plugins/data/public/actions/apply_filter_action.ts", + "deprecated": false }, { - "plugin": "visTypeVega", - "path": "src/plugins/vis_type_vega/public/vega_request_handler.ts" + "parentPluginId": "data", + "id": "def-public.ApplyGlobalFilterActionContext.timeFieldName", + "type": "string", + "tags": [], + "label": "timeFieldName", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/public/actions/apply_filter_action.ts", + "deprecated": false }, { - "plugin": "visTypeVega", - "path": "src/plugins/vis_type_vega/public/vega_request_handler.ts" + "parentPluginId": "data", + "id": "def-public.ApplyGlobalFilterActionContext.embeddable", + "type": "Unknown", + "tags": [], + "label": "embeddable", + "description": [], + "signature": [ + "unknown" + ], + "path": "src/plugins/data/public/actions/apply_filter_action.ts", + "deprecated": false }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/server/saved_objects/move_filters_to_query.test.ts" - }, + "parentPluginId": "data", + "id": "def-public.ApplyGlobalFilterActionContext.controlledBy", + "type": "string", + "tags": [], + "label": "controlledBy", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/public/actions/apply_filter_action.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.DataPublicPluginStartActions", + "type": "Interface", + "tags": [], + "label": "DataPublicPluginStartActions", + "description": [ + "\nutilities to generate filters from action context" + ], + "path": "src/plugins/data/public/types.ts", + "deprecated": false, + "children": [ { - "plugin": "dashboard", - "path": "src/plugins/dashboard/server/saved_objects/move_filters_to_query.test.ts" + "parentPluginId": "data", + "id": "def-public.DataPublicPluginStartActions.createFiltersFromValueClickAction", + "type": "Function", + "tags": [], + "label": "createFiltersFromValueClickAction", + "description": [], + "signature": [ + "({ data, negate, }: ", + "ValueClickDataContext", + ") => Promise<", + "Filter", + "[]>" + ], + "path": "src/plugins/data/public/types.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.DataPublicPluginStartActions.createFiltersFromValueClickAction.$1", + "type": "Object", + "tags": [], + "label": "__0", + "description": [], + "signature": [ + "ValueClickDataContext" + ], + "path": "src/plugins/data/public/actions/filters/create_filters_from_value_click.ts", + "deprecated": false + } + ] }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.test.ts" - }, + "parentPluginId": "data", + "id": "def-public.DataPublicPluginStartActions.createFiltersFromRangeSelectAction", + "type": "Function", + "tags": [], + "label": "createFiltersFromRangeSelectAction", + "description": [], + "signature": [ + "(event: ", + "RangeSelectDataContext", + ") => Promise<", + "Filter", + "[]>" + ], + "path": "src/plugins/data/public/types.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.DataPublicPluginStartActions.createFiltersFromRangeSelectAction.$1", + "type": "Object", + "tags": [], + "label": "event", + "description": [], + "signature": [ + "RangeSelectDataContext" + ], + "path": "src/plugins/data/public/actions/filters/create_filters_from_range_select.ts", + "deprecated": false + } + ] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.DataPublicPluginStartUi", + "type": "Interface", + "tags": [], + "label": "DataPublicPluginStartUi", + "description": [ + "\nData plugin prewired UI components" + ], + "path": "src/plugins/data/public/types.ts", + "deprecated": false, + "children": [ { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.test.ts" + "parentPluginId": "data", + "id": "def-public.DataPublicPluginStartUi.IndexPatternSelect", + "type": "CompoundType", + "tags": [], + "label": "IndexPatternSelect", + "description": [], + "signature": [ + "React.ComponentClass<", + { + "pluginId": "data", + "scope": "public", + "docId": "kibDataUiPluginApi", + "section": "def-public.IndexPatternSelectProps", + "text": "IndexPatternSelectProps" + }, + ", any> | React.FunctionComponent<", + { + "pluginId": "data", + "scope": "public", + "docId": "kibDataUiPluginApi", + "section": "def-public.IndexPatternSelectProps", + "text": "IndexPatternSelectProps" + }, + ">" + ], + "path": "src/plugins/data/public/types.ts", + "deprecated": false }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.test.ts" - }, + "parentPluginId": "data", + "id": "def-public.DataPublicPluginStartUi.SearchBar", + "type": "CompoundType", + "tags": [], + "label": "SearchBar", + "description": [], + "signature": [ + "React.ComponentClass<", + { + "pluginId": "data", + "scope": "public", + "docId": "kibDataUiPluginApi", + "section": "def-public.StatefulSearchBarProps", + "text": "StatefulSearchBarProps" + }, + ", any> | React.FunctionComponent<", + { + "pluginId": "data", + "scope": "public", + "docId": "kibDataUiPluginApi", + "section": "def-public.StatefulSearchBarProps", + "text": "StatefulSearchBarProps" + }, + ">" + ], + "path": "src/plugins/data/public/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.GetFieldsOptions", + "type": "Interface", + "tags": [], + "label": "GetFieldsOptions", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ { - "plugin": "inputControlVis", - "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts" + "parentPluginId": "data", + "id": "def-public.GetFieldsOptions.pattern", + "type": "string", + "tags": [], + "label": "pattern", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false }, { - "plugin": "inputControlVis", - "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts" + "parentPluginId": "data", + "id": "def-public.GetFieldsOptions.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false }, { - "plugin": "inputControlVis", - "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts" + "parentPluginId": "data", + "id": "def-public.GetFieldsOptions.lookBack", + "type": "CompoundType", + "tags": [], + "label": "lookBack", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false }, { - "plugin": "inputControlVis", - "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts" + "parentPluginId": "data", + "id": "def-public.GetFieldsOptions.metaFields", + "type": "Array", + "tags": [], + "label": "metaFields", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false }, { - "plugin": "inputControlVis", - "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts" + "parentPluginId": "data", + "id": "def-public.GetFieldsOptions.rollupIndex", + "type": "string", + "tags": [], + "label": "rollupIndex", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false }, { - "plugin": "inputControlVis", - "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts" - }, + "parentPluginId": "data", + "id": "def-public.GetFieldsOptions.allowNoIndex", + "type": "CompoundType", + "tags": [], + "label": "allowNoIndex", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IDataPluginServices", + "type": "Interface", + "tags": [], + "label": "IDataPluginServices", + "description": [], + "signature": [ { - "plugin": "visualize", - "path": "src/plugins/visualize/target/types/public/application/types.d.ts" + "pluginId": "data", + "scope": "public", + "docId": "kibDataPluginApi", + "section": "def-public.IDataPluginServices", + "text": "IDataPluginServices" }, + " extends Partial<", { - "plugin": "visualize", - "path": "src/plugins/visualize/target/types/public/application/types.d.ts" + "pluginId": "core", + "scope": "public", + "docId": "kibCorePluginApi", + "section": "def-public.CoreStart", + "text": "CoreStart" }, + ">" + ], + "path": "src/plugins/data/public/types.ts", + "deprecated": false, + "children": [ { - "plugin": "visualize", - "path": "src/plugins/visualize/target/types/public/application/types.d.ts" + "parentPluginId": "data", + "id": "def-public.IDataPluginServices.appName", + "type": "string", + "tags": [], + "label": "appName", + "description": [], + "path": "src/plugins/data/public/types.ts", + "deprecated": false }, { - "plugin": "visualize", - "path": "src/plugins/visualize/target/types/public/application/types.d.ts" + "parentPluginId": "data", + "id": "def-public.IDataPluginServices.uiSettings", + "type": "Object", + "tags": [], + "label": "uiSettings", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "public", + "docId": "kibCorePluginApi", + "section": "def-public.IUiSettingsClient", + "text": "IUiSettingsClient" + } + ], + "path": "src/plugins/data/public/types.ts", + "deprecated": false }, { - "plugin": "presentationUtil", - "path": "src/plugins/presentation_util/public/components/input_controls/embeddable/types.ts" + "parentPluginId": "data", + "id": "def-public.IDataPluginServices.savedObjects", + "type": "Object", + "tags": [], + "label": "savedObjects", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-public.SavedObjectsStart", + "text": "SavedObjectsStart" + } + ], + "path": "src/plugins/data/public/types.ts", + "deprecated": false }, { - "plugin": "presentationUtil", - "path": "src/plugins/presentation_util/public/components/input_controls/embeddable/types.ts" + "parentPluginId": "data", + "id": "def-public.IDataPluginServices.notifications", + "type": "Object", + "tags": [], + "label": "notifications", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "public", + "docId": "kibCorePluginApi", + "section": "def-public.NotificationsStart", + "text": "NotificationsStart" + } + ], + "path": "src/plugins/data/public/types.ts", + "deprecated": false }, { - "plugin": "presentationUtil", - "path": "src/plugins/presentation_util/public/components/input_controls/embeddable/types.ts" + "parentPluginId": "data", + "id": "def-public.IDataPluginServices.http", + "type": "Object", + "tags": [], + "label": "http", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "public", + "docId": "kibCoreHttpPluginApi", + "section": "def-public.HttpSetup", + "text": "HttpSetup" + } + ], + "path": "src/plugins/data/public/types.ts", + "deprecated": false }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/angular/context/api/context.d.ts" + "parentPluginId": "data", + "id": "def-public.IDataPluginServices.storage", + "type": "Object", + "tags": [], + "label": "storage", + "description": [], + "signature": [ + { + "pluginId": "kibanaUtils", + "scope": "public", + "docId": "kibKibanaUtilsPluginApi", + "section": "def-public.IStorageWrapper", + "text": "IStorageWrapper" + }, + "" + ], + "path": "src/plugins/data/public/types.ts", + "deprecated": false }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/angular/context/api/context.d.ts" + "parentPluginId": "data", + "id": "def-public.IDataPluginServices.data", + "type": "Object", + "tags": [], + "label": "data", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "public", + "docId": "kibDataPluginApi", + "section": "def-public.DataPublicPluginStart", + "text": "DataPublicPluginStart" + } + ], + "path": "src/plugins/data/public/types.ts", + "deprecated": false }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/angular/context/api/context.d.ts" - }, + "parentPluginId": "data", + "id": "def-public.IDataPluginServices.usageCollection", + "type": "Object", + "tags": [], + "label": "usageCollection", + "description": [], + "signature": [ + { + "pluginId": "usageCollection", + "scope": "public", + "docId": "kibUsageCollectionPluginApi", + "section": "def-public.UsageCollectionStart", + "text": "UsageCollectionStart" + }, + " | undefined" + ], + "path": "src/plugins/data/public/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IEsSearchRequest", + "type": "Interface", + "tags": [], + "label": "IEsSearchRequest", + "description": [], + "signature": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/types.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IEsSearchRequest", + "text": "IEsSearchRequest" }, + " extends ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/types.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IKibanaSearchRequest", + "text": "IKibanaSearchRequest" }, + "<", { - "plugin": "discover", - "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ISearchRequestParams", + "text": "ISearchRequestParams" }, + ">" + ], + "path": "src/plugins/data/common/search/strategies/es_search/types.ts", + "deprecated": false, + "children": [ { - "plugin": "discover", - "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + "parentPluginId": "data", + "id": "def-public.IEsSearchRequest.indexType", + "type": "string", + "tags": [], + "label": "indexType", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/search/strategies/es_search/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IFieldType", + "type": "Interface", + "tags": [ + "deprecated" + ], + "label": "IFieldType", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" }, + " extends ", + "DataViewFieldBase" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [ { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/elasticsearch_util/types.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/elasticsearch_util/types.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/embeddable/types.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/embeddable/types.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_fn.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_fn.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/embeddable/map_component.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/embeddable/map_component.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_fn.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_fn.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/ui_actions/apply_influencer_filters_action.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/ui_actions/apply_influencer_filters_action.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/common/group_by_expression/selector.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/ui_actions/apply_entity_filters_action.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/common/group_by_expression/selector.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/ui_actions/apply_entity_filters_action.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/common/group_by_expression/group_by_expression.tsx" }, { "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_dataset_filtering.ts" + "path": "x-pack/plugins/infra/public/alerting/common/group_by_expression/group_by_expression.tsx" }, { "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_dataset_filtering.ts" + "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" }, { "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_dataset_filtering.ts" + "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_type_timeseries/common/types/index.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_type_timeseries/common/types/index.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criteria.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/navigation/types.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criteria.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/navigation/types.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/group_by.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/group_by.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/build_threat_mapping_filter.mock.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/metrics.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/build_threat_mapping_filter.mock.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/metrics.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/server/lib/detection_engine/signals/threat_mapping/build_threat_mapping_filter.mock.d.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/server/lib/detection_engine/signals/threat_mapping/build_threat_mapping_filter.mock.d.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.d.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.d.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_preview/helpers.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_preview/helpers.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_preview/reducer.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_preview/reducer.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/pages/navigation/alerts_query_tab_body.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/pages/navigation/alerts_query_tab_body.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/details/helpers.test.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/details/helpers.test.ts" - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IAggConfig", - "type": "Type", - "tags": [ - "name", - "description" - ], - "label": "IAggConfig", - "description": [], - "signature": [ + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/common/group_by_expression/group_by_expression.d.ts" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" - } - ], - "path": "src/plugins/data/common/search/aggs/agg_config.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IAggType", - "type": "Type", - "tags": [], - "label": "IAggType", - "description": [], - "signature": [ + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/common/group_by_expression/group_by_expression.d.ts" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggType", - "text": "AggType" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/common/group_by_expression/selector.d.ts" }, - "<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/common/group_by_expression/selector.d.ts" }, - ", ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggParamType", - "text": "AggParamType" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/inventory/components/expression.d.ts" }, - "<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/inventory/components/expression.d.ts" }, - ">>" - ], - "path": "src/plugins/data/common/search/aggs/agg_type.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IEsSearchResponse", - "type": "Type", - "tags": [], - "label": "IEsSearchResponse", - "description": [], - "signature": [ { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IKibanaSearchResponse", - "text": "IKibanaSearchResponse" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/inventory/components/metric.d.ts" }, - "<", - "SearchResponse", - ">" - ], - "path": "src/plugins/data/common/search/strategies/es_search/types.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IFieldParamType", - "type": "Type", - "tags": [], - "label": "IFieldParamType", - "description": [], - "signature": [ { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.FieldParamType", - "text": "FieldParamType" - } - ], - "path": "src/plugins/data/common/search/aggs/param_types/field.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IFieldSubType", - "type": "Type", - "tags": [ - "deprecated" - ], - "label": "IFieldSubType", - "description": [], - "signature": [ - "IFieldSubType" - ], - "path": "src/plugins/data/common/es_query/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/inventory/components/metric.d.ts" + }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/common/types/timeline/columns/index.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_row.d.ts" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/common/types/timeline/columns/index.tsx" - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IMetricAggType", - "type": "Type", - "tags": [], - "label": "IMetricAggType", - "description": [], - "signature": [ + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_row.d.ts" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.MetricAggType", - "text": "MetricAggType" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/log_threshold/components/expression_editor/criteria.d.ts" }, - "<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IMetricAggConfig", - "text": "IMetricAggConfig" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/log_threshold/components/expression_editor/criteria.d.ts" }, - ">" - ], - "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.INDEX_PATTERN_SAVED_OBJECT_TYPE", - "type": "string", - "tags": [], - "label": "INDEX_PATTERN_SAVED_OBJECT_TYPE", - "description": [], - "signature": [ - "\"index-pattern\"" - ], - "path": "src/plugins/data/common/constants.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternLoadExpressionFunctionDefinition", - "type": "Type", - "tags": [], - "label": "IndexPatternLoadExpressionFunctionDefinition", - "description": [], - "signature": [ { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/log_threshold/components/expression_editor/criterion.d.ts" }, - "<\"indexPatternLoad\", null, Arguments, Output, ", { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExecutionContext", - "text": "ExecutionContext" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/log_threshold/components/expression_editor/criterion.d.ts" }, - "<", { - "pluginId": "inspector", - "scope": "common", - "docId": "kibInspectorPluginApi", - "section": "def-common.Adapters", - "text": "Adapters" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/components/group_by.d.ts" }, - ", ", - "SerializableRecord", - ">>" - ], - "path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.IndexPatternsContract", - "type": "Type", - "tags": [], - "label": "IndexPatternsContract", - "description": [], - "signature": [ - "{ get: (id: string) => Promise<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/components/group_by.d.ts" }, - ">; delete: (indexPatternId: string) => Promise<{}>; create: (spec: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/components/metrics.d.ts" }, - ", skipFetchFields?: boolean) => Promise<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/components/metrics.d.ts" }, - ">; find: (search: string, size?: number) => Promise<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/single_field_select.d.ts" }, - "[]>; ensureDefaultIndexPattern: ", - "EnsureDefaultIndexPattern", - "; getIds: (refresh?: boolean) => Promise; getTitles: (refresh?: boolean) => Promise; getIdsWithTitle: (refresh?: boolean) => Promise<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternListItem", - "text": "IndexPatternListItem" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/single_field_select.d.ts" }, - "[]>; clearCache: (id?: string | undefined) => void; getCache: () => Promise<", - "SavedObject", - ">[] | null | undefined>; getDefault: () => Promise<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.d.ts" }, - " | null>; getDefaultId: () => Promise; setDefault: (id: string | null, force?: boolean) => Promise; hasUserIndexPattern: () => Promise; getFieldsForWildcard: (options: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.d.ts" }, - ") => Promise; getFieldsForIndexPattern: (indexPattern: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.d.ts" }, - " | ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.d.ts" }, - ", options?: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.d.ts" }, - " | undefined) => Promise; refreshFields: (indexPattern: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts" }, - ") => Promise; fieldArrayToMap: (fields: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts" }, - "[], fieldAttrs?: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldAttrs", - "text": "FieldAttrs" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" }, - " | undefined) => Record; savedObjectToSpec: (savedObject: ", - "SavedObject", - "<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternAttributes", - "text": "IndexPatternAttributes" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" }, - ">) => ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" }, - "; createAndSave: (spec: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" }, - ", override?: boolean, skipFetchFields?: boolean) => Promise<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" }, - ">; createSavedObject: (indexPattern: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" }, - ", override?: boolean) => Promise<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" }, - ">; updateSavedObject: (indexPattern: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" }, - ", saveAttempts?: number, ignoreErrors?: boolean) => Promise; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.ISearchGeneric", - "type": "Type", - "tags": [], - "label": "ISearchGeneric", - "description": [], - "signature": [ - " = ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IEsSearchRequest", - "text": "IEsSearchRequest" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" }, - ", SearchStrategyResponse extends ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IKibanaSearchResponse", - "text": "IKibanaSearchResponse" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" }, - " = ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IEsSearchResponse", - "text": "IEsSearchResponse" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" }, - ">(request: SearchStrategyRequest, options?: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchOptions", - "text": "ISearchOptions" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" }, - " | undefined) => ", - "Observable", - "" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false, - "returnComment": [], - "children": [ { - "parentPluginId": "data", - "id": "def-public.request", - "type": "Uncategorized", - "tags": [], - "label": "request", - "description": [], - "signature": [ - "SearchStrategyRequest" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" }, { - "parentPluginId": "data", - "id": "def-public.options", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchOptions", - "text": "ISearchOptions" - }, - " | undefined" - ], - "path": "src/plugins/data/common/search/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.ISearchSource", - "type": "Type", - "tags": [], - "label": "ISearchSource", - "description": [ - "\nsearch source interface" - ], - "signature": [ - "{ create: () => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" - }, - "; history: Record[]; setPreferredSearchStrategyId: (searchStrategyId: string) => void; setField: (field: K, value: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - }, - "[K]) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" - }, - "; removeField: (field: K) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" - }, - "; setFields: (newFields: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" - }, - ") => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" }, - "; getId: () => string; getFields: () => ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" }, - "; getField: (field: K, recurse?: boolean) => ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" }, - "[K]; getOwnField: (field: K) => ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" }, - "[K]; createCopy: () => ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" - }, - "; createChild: (options?: {}) => ", + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + } + ], + "children": [ { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" + "parentPluginId": "data", + "id": "def-public.IFieldType.count", + "type": "number", + "tags": [], + "label": "count", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false }, - "; setParent: (parent?: Pick<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" + "parentPluginId": "data", + "id": "def-public.IFieldType.esTypes", + "type": "Array", + "tags": [], + "label": "esTypes", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false }, - ", \"create\" | \"history\" | \"setPreferredSearchStrategyId\" | \"setField\" | \"removeField\" | \"setFields\" | \"getId\" | \"getFields\" | \"getField\" | \"getOwnField\" | \"createCopy\" | \"createChild\" | \"setParent\" | \"getParent\" | \"fetch$\" | \"fetch\" | \"onRequestStart\" | \"getSearchRequestBody\" | \"destroy\" | \"getSerializedFields\" | \"serialize\"> | undefined, options?: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceOptions", - "text": "SearchSourceOptions" + "parentPluginId": "data", + "id": "def-public.IFieldType.aggregatable", + "type": "CompoundType", + "tags": [], + "label": "aggregatable", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false }, - ") => ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" + "parentPluginId": "data", + "id": "def-public.IFieldType.filterable", + "type": "CompoundType", + "tags": [], + "label": "filterable", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false }, - "; getParent: () => ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" + "parentPluginId": "data", + "id": "def-public.IFieldType.searchable", + "type": "CompoundType", + "tags": [], + "label": "searchable", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false }, - " | undefined; fetch$: (options?: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchOptions", - "text": "ISearchOptions" + "parentPluginId": "data", + "id": "def-public.IFieldType.sortable", + "type": "CompoundType", + "tags": [], + "label": "sortable", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false }, - ") => ", - "Observable", - "<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IKibanaSearchResponse", - "text": "IKibanaSearchResponse" + "parentPluginId": "data", + "id": "def-public.IFieldType.visualizable", + "type": "CompoundType", + "tags": [], + "label": "visualizable", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false }, - "<", - "SearchResponse", - ">>; fetch: (options?: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchOptions", - "text": "ISearchOptions" + "parentPluginId": "data", + "id": "def-public.IFieldType.readFromDocValues", + "type": "CompoundType", + "tags": [], + "label": "readFromDocValues", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false }, - ") => Promise<", - "SearchResponse", - ">; onRequestStart: (handler: (searchSource: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" + "parentPluginId": "data", + "id": "def-public.IFieldType.displayName", + "type": "string", + "tags": [], + "label": "displayName", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false }, - ", options?: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ISearchOptions", - "text": "ISearchOptions" + "parentPluginId": "data", + "id": "def-public.IFieldType.customLabel", + "type": "string", + "tags": [], + "label": "customLabel", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false }, - " | undefined) => Promise) => void; getSearchRequestBody: () => any; destroy: () => void; getSerializedFields: (recurse?: boolean) => ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSourceFields", - "text": "SearchSourceFields" + "parentPluginId": "data", + "id": "def-public.IFieldType.format", + "type": "Any", + "tags": [], + "label": "format", + "description": [], + "signature": [ + "any" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false }, - "; serialize: () => { searchSourceJSON: string; references: ", - "SavedObjectReference", - "[]; }; }" - ], - "path": "src/plugins/data/common/search/search_source/types.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.KibanaContext", - "type": "Type", - "tags": [], - "label": "KibanaContext", - "description": [], - "signature": [ - "{ type: \"kibana_context\"; } & ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.ExecutionContextSearch", - "text": "ExecutionContextSearch" + "parentPluginId": "data", + "id": "def-public.IFieldType.toSpec", + "type": "Function", + "tags": [], + "label": "toSpec", + "description": [], + "signature": [ + "((options?: { getFormatterForField?: ((field: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + }, + ") => ", + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.FieldFormat", + "text": "FieldFormat" + }, + ") | undefined; } | undefined) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + ") | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.IFieldType.toSpec.$1", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.IFieldType.toSpec.$1.getFormatterForField", + "type": "Function", + "tags": [], + "label": "getFormatterForField", + "description": [], + "signature": [ + "((field: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + }, + ") => ", + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.FieldFormat", + "text": "FieldFormat" + }, + ") | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false + } + ] + } + ], + "returnComment": [] } ], - "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", - "deprecated": false, "initialIsOpen": false }, { "parentPluginId": "data", - "id": "def-public.KueryNode", - "type": "Type", + "id": "def-public.IIndexPattern", + "type": "Interface", "tags": [ "deprecated" ], - "label": "KueryNode", + "label": "IIndexPattern", "description": [], "signature": [ - "KueryNode" + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IIndexPattern", + "text": "IIndexPattern" + }, + " extends ", + "DataViewBase" ], - "path": "src/plugins/data/common/es_query/index.ts", + "path": "src/plugins/data/common/index_patterns/types.ts", "deprecated": true, - "removeBy": "8.1", "references": [ { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/common/types.ts" + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/helpers.tsx" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/common/types.ts" + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/helpers.tsx" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/rules_client.ts" + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/rules_client.ts" + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/rules_client.ts" + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/container/source/index.tsx" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/authorization/types.ts" + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/container/source/index.tsx" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/authorization/types.ts" + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/container/source/index.tsx" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/authorization/utils.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/authorization/utils.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/authorization/utils.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/authorization/utils.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/authorization/utils.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/client/utils.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/client/utils.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/client/utils.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/client/utils.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_recognizer/data_recognizer.d.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/client/utils.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_recognizer/data_recognizer.d.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/client/utils.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/client/utils.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/client/utils.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/client/utils.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/client/utils.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/client/utils.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/client/utils.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/utils/kuery.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/client/utils.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/utils/kuery.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/client/utils.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/client/utils.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/client/utils.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/client/utils.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/services/cases/index.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.tsx" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/services/cases/index.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.tsx" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/services/cases/index.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/services/cases/index.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/services/cases/index.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/with_source/with_source.tsx" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/services/attachments/index.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/with_source/with_source.tsx" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/server/services/attachments/index.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/toolbar.tsx" }, { - "plugin": "dataEnhanced", - "path": "x-pack/plugins/data_enhanced/server/search/session/types.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/toolbar.tsx" }, { - "plugin": "dataEnhanced", - "path": "x-pack/plugins/data_enhanced/server/search/session/types.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts" }, { - "plugin": "dataEnhanced", - "path": "x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts" }, { - "plugin": "dataEnhanced", - "path": "x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx" }, { - "plugin": "dataEnhanced", - "path": "x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx" }, { - "plugin": "dataEnhanced", - "path": "x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts" }, { - "plugin": "dataEnhanced", - "path": "x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts" }, { - "plugin": "dataEnhanced", - "path": "x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts" }, { - "plugin": "dataEnhanced", - "path": "x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts" }, { - "plugin": "dataEnhanced", - "path": "x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/target/types/server/authorization/types.d.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts" }, { - "plugin": "cases", - "path": "x-pack/plugins/cases/target/types/server/authorization/types.d.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" }, { - "plugin": "dataEnhanced", - "path": "x-pack/plugins/data_enhanced/target/types/server/search/session/types.d.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" }, { - "plugin": "dataEnhanced", - "path": "x-pack/plugins/data_enhanced/target/types/server/search/session/types.d.ts" - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.MatchAllFilter", - "type": "Type", - "tags": [ - "deprecated" - ], - "label": "MatchAllFilter", - "description": [], - "signature": [ - "Filter", - " & { meta: ", - "MatchAllFilterMeta", - "; match_all: ", - "QueryDslMatchAllQuery", - "; }" - ], - "path": "src/plugins/data/common/es_query/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.ParsedInterval", - "type": "Type", - "tags": [], - "label": "ParsedInterval", - "description": [], - "signature": [ - "{ value: number; unit: ", - "Unit", - "; type: \"calendar\" | \"fixed\"; }" - ], - "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.PhraseFilter", - "type": "Type", - "tags": [ - "deprecated" - ], - "label": "PhraseFilter", - "description": [], - "signature": [ - "Filter", - " & { meta: ", - "PhraseFilterMeta", - "; query: { match_phrase?: Record | undefined; match?: Record | undefined; }; }" - ], - "path": "src/plugins/data/common/es_query/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.PhrasesFilter", - "type": "Type", - "tags": [ - "deprecated" - ], - "label": "PhrasesFilter", - "description": [], - "signature": [ - "Filter", - " & { meta: ", - "PhrasesFilterMeta", - "; query: ", - "QueryDslQueryContainer", - "; }" - ], - "path": "src/plugins/data/common/es_query/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.Query", - "type": "Type", - "tags": [], - "label": "Query", - "description": [], - "signature": [ - "{ query: string | { [key: string]: any; }; language: string; }" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/types.d.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.RangeFilter", - "type": "Type", - "tags": [ - "deprecated" - ], - "label": "RangeFilter", - "description": [], - "signature": [ - "Filter", - " & { meta: ", - "RangeFilterMeta", - "; range: { [key: string]: ", - "RangeFilterParams", - "; }; }" - ], - "path": "src/plugins/data/common/es_query/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ - { - "plugin": "discoverEnhanced", - "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" }, { - "plugin": "discoverEnhanced", - "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts" - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.RangeFilterMeta", - "type": "Type", - "tags": [ - "deprecated" - ], - "label": "RangeFilterMeta", - "description": [], - "signature": [ - "FilterMeta", - " & { params: ", - "RangeFilterParams", - "; field?: string | undefined; formattedValue?: string | undefined; }" - ], - "path": "src/plugins/data/common/es_query/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.RangeFilterParams", - "type": "Type", - "tags": [ - "deprecated" - ], - "label": "RangeFilterParams", - "description": [], - "signature": [ - "RangeFilterParams" - ], - "path": "src/plugins/data/common/es_query/index.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ - { - "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/components/timelion_vis_component.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" }, { - "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/components/timelion_vis_component.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" }, { - "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/timelion_vis_renderer.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/url_state/types.ts" }, { - "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/timelion_vis_renderer.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/url_state/types.ts" }, { - "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/legacy/timelion_vis_component.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/url_state/types.ts" }, { - "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/legacy/timelion_vis_component.tsx" - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.TimeRange", - "type": "Type", - "tags": [], - "label": "TimeRange", - "description": [], - "signature": [ - "{ from: string; to: string; mode?: \"absolute\" | \"relative\" | undefined; }" - ], - "path": "src/plugins/data/common/query/timefilter/types.ts", - "deprecated": false, - "initialIsOpen": false - } - ], - "objects": [ - { - "parentPluginId": "data", - "id": "def-public.AggGroupLabels", - "type": "Object", - "tags": [], - "label": "AggGroupLabels", - "description": [], - "path": "src/plugins/data/common/search/aggs/agg_groups.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.AggGroupLabels.AggGroupNames.Buckets", - "type": "string", - "tags": [], - "label": "[AggGroupNames.Buckets]", - "description": [], - "path": "src/plugins/data/common/search/aggs/agg_groups.ts", - "deprecated": false + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/query_bar/index.tsx" }, { - "parentPluginId": "data", - "id": "def-public.AggGroupLabels.AggGroupNames.Metrics", - "type": "string", - "tags": [], - "label": "[AggGroupNames.Metrics]", - "description": [], - "path": "src/plugins/data/common/search/aggs/agg_groups.ts", - "deprecated": false + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/query_bar/index.tsx" }, { - "parentPluginId": "data", - "id": "def-public.AggGroupLabels.AggGroupNames.None", - "type": "string", - "tags": [], - "label": "[AggGroupNames.None]", - "description": [], - "path": "src/plugins/data/common/search/aggs/agg_groups.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.AggGroupNames", - "type": "Object", - "tags": [], - "label": "AggGroupNames", - "description": [], - "signature": [ - "{ readonly Buckets: \"buckets\"; readonly Metrics: \"metrics\"; readonly None: \"none\"; }" - ], - "path": "src/plugins/data/common/search/aggs/agg_groups.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.esFilters", - "type": "Object", - "tags": [ - "deprecated" - ], - "label": "esFilters", - "description": [ - "\nFilter helpers namespace:" - ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_bar/index.tsx" + }, { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_bar/index.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/columns.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/url_generator.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/columns.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/columns.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/locator.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/helpers/get_context_url.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/helpers/get_context_url.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/pages/details/types.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/pages/details/types.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/components/context_app/context_app.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/components/context_app/context_app.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/details/types.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/details/types.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/plugin.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/plugin.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/save_dashboard.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/save_dashboard.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/details/types.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/details/types.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts" + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/mock/index_pattern.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts" + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/mock/index_pattern.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/plugin.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/common/search_strategy/index_fields/index.d.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/plugin.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/common/search_strategy/index_fields/index.d.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/url_generator.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/containers/with_kuery_autocompletion.d.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/url_generator.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/containers/with_kuery_autocompletion.d.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/url_generator.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/containers/with_source/with_source.d.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/locator.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/containers/with_source/with_source.d.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/locator.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/index_pattern_context.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/locator.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/index_pattern_context.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts" }, { - "plugin": "observability", - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts" }, { - "plugin": "observability", - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts" }, { - "plugin": "observability", - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts" }, { - "plugin": "observability", - "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts" }, { - "plugin": "observability", - "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts" }, { - "plugin": "observability", - "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts" }, { - "plugin": "observability", - "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_chart.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_chart.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/index.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/index.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/routes/map_page/url_state/app_sync.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/routes/map_page/url_state/app_sync.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/index.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/index.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/network/pages/details/types.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/network/pages/details/types.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/locators.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/ueba/pages/details/types.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/locators.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/ueba/pages/details/types.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/locators.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.d.ts" }, { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.d.ts" }, { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.d.ts" }, { - "plugin": "dashboardEnhanced", - "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.d.ts" }, { - "plugin": "discoverEnhanced", - "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts" }, { - "plugin": "discoverEnhanced", - "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/locators.test.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/locators.test.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/index.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + "path": "x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + "path": "x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + "path": "x-pack/plugins/security_solution/public/network/pages/navigation/types.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/helpers.tsx" + "path": "x-pack/plugins/security_solution/public/network/pages/navigation/types.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/helpers.tsx" + "path": "x-pack/plugins/security_solution/public/network/pages/navigation/types.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/helpers.tsx" + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/mocks.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/mocks.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/state_management/time_range_middleware.test.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/state_management/time_range_middleware.test.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts" + "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts" + "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.test.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.test.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.test.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/__mocks__/mock.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/__mocks__/mock.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/editor.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/__mocks__/mock.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/editor.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/locator.test.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/locator.test.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/url_generator.test.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/url_generator.test.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" }, { - "plugin": "visualize", - "path": "src/plugins/visualize/public/application/utils/use/use_visualize_app_state.tsx" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" }, { - "plugin": "visualize", - "path": "src/plugins/visualize/public/application/utils/use/use_visualize_app_state.tsx" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" }, { - "plugin": "visualize", - "path": "src/plugins/visualize/public/plugin.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" }, { - "plugin": "visualize", - "path": "src/plugins/visualize/public/plugin.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" }, { - "plugin": "timelion", - "path": "src/plugins/timelion/public/plugin.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" }, { - "plugin": "timelion", - "path": "src/plugins/timelion/public/plugin.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/server/saved_objects/move_filters_to_query.test.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/server/saved_objects/move_filters_to_query.test.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/server/saved_objects/move_filters_to_query.test.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/listing/get_dashboard_list_item_link.test.ts" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/services/es_index_service.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/application/listing/get_dashboard_list_item_link.test.ts" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/services/es_index_service.ts" }, { - "plugin": "visualize", - "path": "src/plugins/visualize/public/application/utils/get_visualize_list_item_link.test.ts" + "plugin": "transform", + "path": "x-pack/plugins/transform/server/routes/api/transforms.ts" }, { - "plugin": "visualize", - "path": "src/plugins/visualize/public/application/utils/get_visualize_list_item_link.test.ts" + "plugin": "transform", + "path": "x-pack/plugins/transform/server/routes/api/transforms.ts" }, { - "plugin": "presentationUtil", - "path": "src/plugins/presentation_util/public/components/input_controls/control_types/options_list/options_list_embeddable.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx" }, { - "plugin": "presentationUtil", - "path": "src/plugins/presentation_util/public/components/input_controls/control_types/options_list/options_list_embeddable.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/utils/new_job_utils.test.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/utils/new_job_utils.test.ts" } ], "children": [ { "parentPluginId": "data", - "id": "def-public.esFilters.FilterLabel", - "type": "Function", + "id": "def-public.IIndexPattern.title", + "type": "string", "tags": [], - "label": "FilterLabel", + "label": "title", "description": [], - "signature": [ - "(props: ", - "FilterLabelProps", - ") => JSX.Element" - ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.props", - "type": "Object", - "tags": [], - "label": "props", - "description": [], - "signature": [ - "FilterLabelProps" - ], - "path": "src/plugins/data/public/ui/filter_bar/index.tsx", - "deprecated": false - } - ] + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.FilterItem", - "type": "Function", + "id": "def-public.IIndexPattern.fields", + "type": "Array", "tags": [], - "label": "FilterItem", + "label": "fields", "description": [], "signature": [ - "(props: ", - "FilterItemProps", - ") => JSX.Element" - ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ { - "parentPluginId": "data", - "id": "def-public.props", - "type": "Object", - "tags": [], - "label": "props", - "description": [], - "signature": [ - "FilterItemProps" - ], - "path": "src/plugins/data/public/ui/filter_bar/index.tsx", - "deprecated": false - } - ] - }, - { - "parentPluginId": "data", - "id": "def-public.esFilters.FILTERS", - "type": "Object", - "tags": [], - "label": "FILTERS", - "description": [], - "signature": [ - "typeof ", - "FILTERS" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + "[]" ], - "path": "src/plugins/data/public/deprecated.ts", + "path": "src/plugins/data/common/index_patterns/types.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.FilterStateStore", - "type": "Object", + "id": "def-public.IIndexPattern.type", + "type": "string", "tags": [], - "label": "FilterStateStore", - "description": [], + "label": "type", + "description": [ + "\nType is used for identifying rollup indices, otherwise left undefined" + ], "signature": [ - "typeof ", - "FilterStateStore" + "string | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", + "path": "src/plugins/data/common/index_patterns/types.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.buildEmptyFilter", - "type": "Function", + "id": "def-public.IIndexPattern.timeFieldName", + "type": "string", "tags": [], - "label": "buildEmptyFilter", + "label": "timeFieldName", "description": [], "signature": [ - "(isPinned: boolean, index?: string | undefined) => ", - "Filter" + "string | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.isPinned", - "type": "boolean", - "tags": [], - "label": "isPinned", - "description": [], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/build_empty_filter.d.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.index", - "type": "string", - "tags": [], - "label": "index", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/build_empty_filter.d.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.buildPhrasesFilter", + "id": "def-public.IIndexPattern.getTimeField", "type": "Function", "tags": [], - "label": "buildPhrasesFilter", + "label": "getTimeField", "description": [], "signature": [ - "(field: ", - "IndexPatternFieldBase", - ", params: ", - "PhraseFilterValue", - "[], indexPattern: ", - "IndexPatternBase", - ") => ", - "PhrasesFilter" - ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.field", - "type": "Object", - "tags": [], - "label": "field", - "description": [], - "signature": [ - "IndexPatternFieldBase" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrases_filter.d.ts", - "deprecated": false - }, + "(() => ", { - "parentPluginId": "data", - "id": "def-public.params", - "type": "Array", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "PhraseFilterValue", - "[]" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrases_filter.d.ts", - "deprecated": false + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" }, - { - "parentPluginId": "data", - "id": "def-public.indexPattern", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - "IndexPatternBase" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrases_filter.d.ts", - "deprecated": false - } - ] + " | undefined) | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [], + "returnComment": [] }, { "parentPluginId": "data", - "id": "def-public.esFilters.buildExistsFilter", - "type": "Function", + "id": "def-public.IIndexPattern.fieldFormatMap", + "type": "Object", "tags": [], - "label": "buildExistsFilter", + "label": "fieldFormatMap", "description": [], "signature": [ - "(field: ", - "IndexPatternFieldBase", - ", indexPattern: ", - "IndexPatternBase", - ") => ", - "ExistsFilter" - ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ + "Record | undefined> | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.buildPhraseFilter", + "id": "def-public.IIndexPattern.getFormatterForField", "type": "Function", "tags": [], - "label": "buildPhraseFilter", - "description": [], + "label": "getFormatterForField", + "description": [ + "\nLook up a formatter for a given field" + ], "signature": [ - "(field: ", - "IndexPatternFieldBase", - ", value: ", - "PhraseFilterValue", - ", indexPattern: ", - "IndexPatternBase", - ") => ", - "PhraseFilter", + "((field: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, " | ", - "ScriptedPhraseFilter" - ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ { - "parentPluginId": "data", - "id": "def-public.field", - "type": "Object", - "tags": [], - "label": "field", - "description": [], - "signature": [ - "IndexPatternFieldBase" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrase_filter.d.ts", - "deprecated": false + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" }, + " | ", { - "parentPluginId": "data", - "id": "def-public.value", - "type": "CompoundType", - "tags": [], - "label": "value", - "description": [], - "signature": [ - "string | number | boolean" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrase_filter.d.ts", - "deprecated": false + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" }, + ") => ", { - "parentPluginId": "data", - "id": "def-public.indexPattern", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - "IndexPatternBase" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrase_filter.d.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "data", - "id": "def-public.esFilters.buildQueryFilter", - "type": "Function", - "tags": [], - "label": "buildQueryFilter", - "description": [], - "signature": [ - "(query: (Record & { query_string?: { query: string; } | undefined; }) | undefined, index: string, alias: string) => ", - "QueryStringFilter" + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.FieldFormat", + "text": "FieldFormat" + }, + ") | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", + "path": "src/plugins/data/common/index_patterns/types.ts", "deprecated": false, - "returnComment": [], "children": [ { "parentPluginId": "data", - "id": "def-public.query", + "id": "def-public.IIndexPattern.getFormatterForField.$1", "type": "CompoundType", "tags": [], - "label": "query", + "label": "field", "description": [], "signature": [ - "(Record & { query_string?: { query: string; } | undefined; }) | undefined" + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + } ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/query_string_filter.d.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.index", - "type": "string", - "tags": [], - "label": "index", - "description": [], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/query_string_filter.d.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.alias", - "type": "string", - "tags": [], - "label": "alias", - "description": [], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/query_string_filter.d.ts", - "deprecated": false + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true } - ] + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IKibanaSearchRequest", + "type": "Interface", + "tags": [], + "label": "IKibanaSearchRequest", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IKibanaSearchRequest", + "text": "IKibanaSearchRequest" }, + "" + ], + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false, + "children": [ { "parentPluginId": "data", - "id": "def-public.esFilters.buildRangeFilter", - "type": "Function", + "id": "def-public.IKibanaSearchRequest.id", + "type": "string", "tags": [], - "label": "buildRangeFilter", - "description": [], + "label": "id", + "description": [ + "\nAn id can be used to uniquely identify this request." + ], "signature": [ - "(field: ", - "IndexPatternFieldBase", - ", params: ", - "RangeFilterParams", - ", indexPattern: ", - "IndexPatternBase", - ", formattedValue?: string | undefined) => ", - "RangeFilter", - " | ", - "ScriptedRangeFilter", - " | ", - "MatchAllRangeFilter" + "string | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.field", - "type": "Object", - "tags": [], - "label": "field", - "description": [], - "signature": [ - "IndexPatternFieldBase" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/range_filter.d.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.params", - "type": "Object", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "RangeFilterParams" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/range_filter.d.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.indexPattern", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - "IndexPatternBase" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/range_filter.d.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.formattedValue", - "type": "string", - "tags": [], - "label": "formattedValue", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/range_filter.d.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.isPhraseFilter", - "type": "Function", + "id": "def-public.IKibanaSearchRequest.params", + "type": "Uncategorized", "tags": [], - "label": "isPhraseFilter", + "label": "params", "description": [], "signature": [ - "(filter: ", - "Filter", - ") => filter is ", - "PhraseFilter" + "Params | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.filter", - "type": "Object", - "tags": [], - "label": "filter", - "description": [], - "signature": [ - "{ $state?: { store: ", - "FilterStateStore", - "; } | undefined; meta: ", - "FilterMeta", - "; query?: Record | undefined; }" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrase_filter.d.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IKibanaSearchResponse", + "type": "Interface", + "tags": [], + "label": "IKibanaSearchResponse", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IKibanaSearchResponse", + "text": "IKibanaSearchResponse" }, + "" + ], + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false, + "children": [ { "parentPluginId": "data", - "id": "def-public.esFilters.isExistsFilter", - "type": "Function", + "id": "def-public.IKibanaSearchResponse.id", + "type": "string", "tags": [], - "label": "isExistsFilter", - "description": [], + "label": "id", + "description": [ + "\nSome responses may contain a unique id to identify the request this response came from." + ], "signature": [ - "(filter: ", - "Filter", - ") => filter is ", - "ExistsFilter" + "string | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.filter", - "type": "Object", - "tags": [], - "label": "filter", - "description": [], - "signature": [ - "{ $state?: { store: ", - "FilterStateStore", - "; } | undefined; meta: ", - "FilterMeta", - "; query?: Record | undefined; }" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/exists_filter.d.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.isPhrasesFilter", - "type": "Function", + "id": "def-public.IKibanaSearchResponse.total", + "type": "number", "tags": [], - "label": "isPhrasesFilter", - "description": [], + "label": "total", + "description": [ + "\nIf relevant to the search strategy, return a total number\nthat represents how progress is indicated." + ], "signature": [ - "(filter: ", - "Filter", - ") => filter is ", - "PhrasesFilter" + "number | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.filter", - "type": "Object", - "tags": [], - "label": "filter", - "description": [], - "signature": [ - "{ $state?: { store: ", - "FilterStateStore", - "; } | undefined; meta: ", - "FilterMeta", - "; query?: Record | undefined; }" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrases_filter.d.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.isRangeFilter", - "type": "Function", + "id": "def-public.IKibanaSearchResponse.loaded", + "type": "number", "tags": [], - "label": "isRangeFilter", - "description": [], + "label": "loaded", + "description": [ + "\nIf relevant to the search strategy, return a loaded number\nthat represents how progress is indicated." + ], "signature": [ - "(filter?: ", - "Filter", - " | undefined) => filter is ", - "RangeFilter" + "number | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.filter", - "type": "Object", - "tags": [], - "label": "filter", - "description": [], - "signature": [ - "Filter", - " | undefined" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/range_filter.d.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.isMatchAllFilter", - "type": "Function", + "id": "def-public.IKibanaSearchResponse.isRunning", + "type": "CompoundType", "tags": [], - "label": "isMatchAllFilter", - "description": [], + "label": "isRunning", + "description": [ + "\nIndicates whether search is still in flight" + ], "signature": [ - "(filter: ", - "Filter", - ") => filter is ", - "MatchAllFilter" + "boolean | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.filter", - "type": "Object", - "tags": [], - "label": "filter", - "description": [], - "signature": [ - "{ $state?: { store: ", - "FilterStateStore", - "; } | undefined; meta: ", - "FilterMeta", - "; query?: Record | undefined; }" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/match_all_filter.d.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.isMissingFilter", - "type": "Function", + "id": "def-public.IKibanaSearchResponse.isPartial", + "type": "CompoundType", "tags": [], - "label": "isMissingFilter", - "description": [], + "label": "isPartial", + "description": [ + "\nIndicates whether the results returned are complete or partial" + ], "signature": [ - "(filter: ", - "Filter", - ") => filter is ", - "MissingFilter" + "boolean | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.filter", - "type": "Object", - "tags": [], - "label": "filter", - "description": [], - "signature": [ - "{ $state?: { store: ", - "FilterStateStore", - "; } | undefined; meta: ", - "FilterMeta", - "; query?: Record | undefined; }" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/missing_filter.d.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.isQueryStringFilter", - "type": "Function", + "id": "def-public.IKibanaSearchResponse.isRestored", + "type": "CompoundType", "tags": [], - "label": "isQueryStringFilter", - "description": [], + "label": "isRestored", + "description": [ + "\nIndicates whether the results returned are from the async-search index" + ], "signature": [ - "(filter: ", - "Filter", - ") => filter is ", - "QueryStringFilter" + "boolean | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.filter", - "type": "Object", - "tags": [], - "label": "filter", - "description": [], - "signature": [ - "{ $state?: { store: ", - "FilterStateStore", - "; } | undefined; meta: ", - "FilterMeta", - "; query?: Record | undefined; }" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/query_string_filter.d.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.isFilterPinned", - "type": "Function", + "id": "def-public.IKibanaSearchResponse.warning", + "type": "string", "tags": [], - "label": "isFilterPinned", - "description": [], + "label": "warning", + "description": [ + "\nOptional warnings that should be surfaced to the end user" + ], "signature": [ - "(filter: ", - "Filter", - ") => boolean | undefined" + "string | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.filter", - "type": "Object", - "tags": [], - "label": "filter", - "description": [], - "signature": [ - "{ $state?: { store: ", - "FilterStateStore", - "; } | undefined; meta: ", - "FilterMeta", - "; query?: Record | undefined; }" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/helpers/meta_filter.d.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.toggleFilterNegated", - "type": "Function", + "id": "def-public.IKibanaSearchResponse.rawResponse", + "type": "Uncategorized", "tags": [], - "label": "toggleFilterNegated", - "description": [], + "label": "rawResponse", + "description": [ + "\nThe raw response returned by the internal search method (usually the raw ES response)" + ], "signature": [ - "(filter: ", - "Filter", - ") => { meta: { negate: boolean; alias?: string | null | undefined; disabled?: boolean | undefined; controlledBy?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; params?: any; value?: string | undefined; }; $state?: { store: ", - "FilterStateStore", - "; } | undefined; query?: Record | undefined; }" + "RawResponse" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.filter", - "type": "Object", - "tags": [], - "label": "filter", - "description": [], - "signature": [ - "{ $state?: { store: ", - "FilterStateStore", - "; } | undefined; meta: ", - "FilterMeta", - "; query?: Record | undefined; }" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/helpers/meta_filter.d.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.ISearchOptions", + "type": "Interface", + "tags": [], + "label": "ISearchOptions", + "description": [], + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.ISearchOptions.abortSignal", + "type": "Object", + "tags": [], + "label": "abortSignal", + "description": [ + "\nAn `AbortSignal` that allows the caller of `search` to abort a search request." + ], + "signature": [ + "AbortSignal | undefined" + ], + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.disableFilter", - "type": "Function", + "id": "def-public.ISearchOptions.strategy", + "type": "string", "tags": [], - "label": "disableFilter", - "description": [], + "label": "strategy", + "description": [ + "\nUse this option to force using a specific server side search strategy. Leave empty to use the default strategy." + ], "signature": [ - "(filter: ", - "Filter", - ") => ", - "Filter" + "string | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.filter", - "type": "Object", - "tags": [], - "label": "filter", - "description": [], - "signature": [ - "{ $state?: { store: ", - "FilterStateStore", - "; } | undefined; meta: ", - "FilterMeta", - "; query?: Record | undefined; }" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/helpers/meta_filter.d.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.getPhraseFilterField", - "type": "Function", + "id": "def-public.ISearchOptions.legacyHitsTotal", + "type": "CompoundType", "tags": [], - "label": "getPhraseFilterField", - "description": [], + "label": "legacyHitsTotal", + "description": [ + "\nRequest the legacy format for the total number of hits. If sending `rest_total_hits_as_int` to\nsomething other than `true`, this should be set to `false`." + ], "signature": [ - "(filter: ", - "PhraseFilter", - ") => string" + "boolean | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.filter", - "type": "CompoundType", - "tags": [], - "label": "filter", - "description": [], - "signature": [ - "Filter", - " & { meta: ", - "PhraseFilterMeta", - "; query: { match_phrase?: Record | undefined; match?: Record | undefined; }; }" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrase_filter.d.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.getPhraseFilterValue", - "type": "Function", + "id": "def-public.ISearchOptions.sessionId", + "type": "string", "tags": [], - "label": "getPhraseFilterValue", - "description": [], + "label": "sessionId", + "description": [ + "\nA session ID, grouping multiple search requests into a single session." + ], "signature": [ - "(filter: ", - "PhraseFilter", - " | ", - "ScriptedPhraseFilter", - ") => ", - "PhraseFilterValue" + "string | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.filter", - "type": "CompoundType", - "tags": [], - "label": "filter", - "description": [], - "signature": [ - "PhraseFilter", - " | ", - "ScriptedPhraseFilter" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrase_filter.d.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.getDisplayValueFromFilter", - "type": "Function", + "id": "def-public.ISearchOptions.isStored", + "type": "CompoundType", "tags": [], - "label": "getDisplayValueFromFilter", - "description": [], + "label": "isStored", + "description": [ + "\nWhether the session is already saved (i.e. sent to background)" + ], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.ISearchOptions.isRestore", + "type": "CompoundType", + "tags": [], + "label": "isRestore", + "description": [ + "\nWhether the session is restored (i.e. search requests should re-use the stored search IDs,\nrather than starting from scratch)" + ], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.ISearchOptions.indexPattern", + "type": "Object", + "tags": [], + "label": "indexPattern", + "description": [ + "\nIndex pattern reference is used for better error messages" + ], "signature": [ - "(filter: ", - "Filter", - ", indexPatterns: ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IIndexPattern", - "text": "IIndexPattern" + "section": "def-common.IndexPattern", + "text": "IndexPattern" }, - "[]) => string" + " | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.ISearchOptions.inspector", + "type": "Object", + "tags": [], + "label": "inspector", + "description": [ + "\nInspector integration options" + ], + "signature": [ { - "parentPluginId": "data", - "id": "def-public.filter", - "type": "Object", - "tags": [], - "label": "filter", - "description": [], - "signature": [ - "{ $state?: { store: ", - "FilterStateStore", - "; } | undefined; meta: ", - "FilterMeta", - "; query?: Record | undefined; }" - ], - "path": "src/plugins/data/public/query/filter_manager/lib/get_display_value.ts", - "deprecated": false + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IInspectorInfo", + "text": "IInspectorInfo" }, - { - "parentPluginId": "data", - "id": "def-public.indexPatterns", - "type": "Array", - "tags": [], - "label": "indexPatterns", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IIndexPattern", - "text": "IIndexPattern" - }, - "[]" - ], - "path": "src/plugins/data/public/query/filter_manager/lib/get_display_value.ts", - "deprecated": false - } - ] + " | undefined" + ], + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.compareFilters", - "type": "Function", + "id": "def-public.ISearchOptions.executionContext", + "type": "Object", "tags": [], - "label": "compareFilters", + "label": "executionContext", "description": [], "signature": [ - "(first: ", - "Filter", - " | ", - "Filter", - "[], second: ", - "Filter", - " | ", - "Filter", - "[], comparatorOptions?: ", - "FilterCompareOptions", - " | undefined) => boolean" + "KibanaExecutionContext", + " | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.ISearchStartSearchSource", + "type": "Interface", + "tags": [], + "label": "ISearchStartSearchSource", + "description": [ + "\nhigh level search service" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.ISearchStartSearchSource.create", + "type": "Function", + "tags": [], + "label": "create", + "description": [ + "\ncreates {@link SearchSource} based on provided serialized {@link SearchSourceFields}" + ], + "signature": [ + "(fields?: ", { - "parentPluginId": "data", - "id": "def-public.first", - "type": "CompoundType", - "tags": [], - "label": "first", - "description": [], - "signature": [ - "Filter", - " | ", - "Filter", - "[]" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/helpers/compare_filters.d.ts", - "deprecated": false + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" }, + " | undefined) => Promise>" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false, + "children": [ { "parentPluginId": "data", - "id": "def-public.comparatorOptions", + "id": "def-public.ISearchStartSearchSource.create.$1", "type": "Object", "tags": [], - "label": "comparatorOptions", + "label": "fields", "description": [], "signature": [ - "FilterCompareOptions", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + }, " | undefined" ], - "path": "node_modules/@kbn/es-query/target_types/filters/helpers/compare_filters.d.ts", - "deprecated": false + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false, + "isRequired": false } - ] + ], + "returnComment": [] }, { "parentPluginId": "data", - "id": "def-public.esFilters.COMPARE_ALL_OPTIONS", - "type": "Object", + "id": "def-public.ISearchStartSearchSource.createEmpty", + "type": "Function", "tags": [], - "label": "COMPARE_ALL_OPTIONS", + "label": "createEmpty", + "description": [ + "\ncreates empty {@link SearchSource}" + ], + "signature": [ + "() => Pick<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + ", \"create\" | \"history\" | \"setPreferredSearchStrategyId\" | \"setField\" | \"removeField\" | \"setFields\" | \"getId\" | \"getFields\" | \"getField\" | \"getOwnField\" | \"createCopy\" | \"createChild\" | \"setParent\" | \"getParent\" | \"fetch$\" | \"fetch\" | \"onRequestStart\" | \"getSearchRequestBody\" | \"destroy\" | \"getSerializedFields\" | \"serialize\">" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.OptionedValueProp", + "type": "Interface", + "tags": [], + "label": "OptionedValueProp", + "description": [], + "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.OptionedValueProp.value", + "type": "string", + "tags": [], + "label": "value", + "description": [], + "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.OptionedValueProp.text", + "type": "string", + "tags": [], + "label": "text", + "description": [], + "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.OptionedValueProp.disabled", + "type": "CompoundType", + "tags": [], + "label": "disabled", "description": [], "signature": [ - "FilterCompareOptions" + "boolean | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", + "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.generateFilters", + "id": "def-public.OptionedValueProp.isCompatible", "type": "Function", "tags": [], - "label": "generateFilters", + "label": "isCompatible", "description": [], "signature": [ - "(filterManager: ", - { - "pluginId": "data", - "scope": "public", - "docId": "kibDataQueryPluginApi", - "section": "def-public.FilterManager", - "text": "FilterManager" - }, - ", field: string | ", + "(agg: ", { "pluginId": "data", "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" }, - ", values: any, operation: string, index: string) => ", - "Filter", - "[]" + ") => boolean" ], - "path": "src/plugins/data/public/deprecated.ts", + "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", "deprecated": false, - "returnComment": [], "children": [ { "parentPluginId": "data", - "id": "def-public.filterManager", + "id": "def-public.OptionedValueProp.isCompatible.$1", "type": "Object", "tags": [], - "label": "filterManager", + "label": "agg", "description": [], "signature": [ { "pluginId": "data", - "scope": "public", - "docId": "kibDataQueryPluginApi", - "section": "def-public.FilterManager", - "text": "FilterManager" + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" } ], - "path": "src/plugins/data/public/query/filter_manager/lib/generate_filters.ts", - "deprecated": false + "path": "src/plugins/data/common/search/aggs/param_types/optioned.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.SearchSourceFields", + "type": "Interface", + "tags": [], + "label": "SearchSourceFields", + "description": [ + "\nsearch source fields" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.SearchSourceFields.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.SearchSourceFields.query", + "type": "Object", + "tags": [], + "label": "query", + "description": [ + "\n{@link Query}" + ], + "signature": [ + "Query", + " | undefined" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.SearchSourceFields.filter", + "type": "CompoundType", + "tags": [], + "label": "filter", + "description": [ + "\n{@link Filter}" + ], + "signature": [ + "Filter", + " | ", + "Filter", + "[] | (() => ", + "Filter", + " | ", + "Filter", + "[] | undefined) | undefined" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.SearchSourceFields.sort", + "type": "CompoundType", + "tags": [], + "label": "sort", + "description": [ + "\n{@link EsQuerySortValue}" + ], + "signature": [ + "Record | Record[] | undefined" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.onlyDisabledFiltersChanged", - "type": "Function", + "id": "def-public.SearchSourceFields.highlight", + "type": "Any", "tags": [], - "label": "onlyDisabledFiltersChanged", + "label": "highlight", "description": [], "signature": [ - "(newFilters?: ", - "Filter", - "[] | undefined, oldFilters?: ", - "Filter", - "[] | undefined) => boolean" + "any" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.SearchSourceFields.highlightAll", + "type": "CompoundType", + "tags": [], + "label": "highlightAll", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.SearchSourceFields.trackTotalHits", + "type": "CompoundType", + "tags": [], + "label": "trackTotalHits", + "description": [], + "signature": [ + "number | boolean | undefined" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.SearchSourceFields.aggs", + "type": "CompoundType", + "tags": [], + "label": "aggs", + "description": [ + "\n{@link AggConfigs}" + ], + "signature": [ + "object | ", { - "parentPluginId": "data", - "id": "def-public.newFilters", - "type": "Array", - "tags": [], - "label": "newFilters", - "description": [], - "signature": [ - "Filter", - "[] | undefined" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/helpers/only_disabled.d.ts", - "deprecated": false + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfigs", + "text": "AggConfigs" }, - { - "parentPluginId": "data", - "id": "def-public.oldFilters", - "type": "Array", - "tags": [], - "label": "oldFilters", - "description": [], - "signature": [ - "Filter", - "[] | undefined" - ], - "path": "node_modules/@kbn/es-query/target_types/filters/helpers/only_disabled.d.ts", - "deprecated": false - } - ] + " | (() => object) | undefined" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.changeTimeFilter", - "type": "Function", + "id": "def-public.SearchSourceFields.from", + "type": "number", "tags": [], - "label": "changeTimeFilter", + "label": "from", "description": [], "signature": [ - "(timeFilter: Pick<", - "Timefilter", - ", \"isTimeRangeSelectorEnabled\" | \"isAutoRefreshSelectorEnabled\" | \"isTimeTouched\" | \"getEnabledUpdated$\" | \"getTimeUpdate$\" | \"getRefreshIntervalUpdate$\" | \"getAutoRefreshFetch$\" | \"getFetch$\" | \"getTime\" | \"getAbsoluteTime\" | \"setTime\" | \"getRefreshInterval\" | \"setRefreshInterval\" | \"createFilter\" | \"getBounds\" | \"calculateBounds\" | \"getActiveBounds\" | \"enableTimeRangeSelector\" | \"disableTimeRangeSelector\" | \"enableAutoRefreshSelector\" | \"disableAutoRefreshSelector\" | \"getTimeDefaults\" | \"getRefreshIntervalDefaults\">, filter: ", - "RangeFilter", - ") => void" + "number | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.timeFilter", - "type": "Object", - "tags": [], - "label": "timeFilter", - "description": [], - "signature": [ - "{ isTimeRangeSelectorEnabled: () => boolean; isAutoRefreshSelectorEnabled: () => boolean; isTimeTouched: () => boolean; getEnabledUpdated$: () => ", - "Observable", - "; getTimeUpdate$: () => ", - "Observable", - "; getRefreshIntervalUpdate$: () => ", - "Observable", - "; getAutoRefreshFetch$: () => ", - "Observable", - "<", - { - "pluginId": "data", - "scope": "public", - "docId": "kibDataQueryPluginApi", - "section": "def-public.AutoRefreshDoneFn", - "text": "AutoRefreshDoneFn" - }, - ">; getFetch$: () => ", - "Observable", - "; getTime: () => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" - }, - "; getAbsoluteTime: () => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" - }, - "; setTime: (time: ", - "InputTimeRange", - ") => void; getRefreshInterval: () => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.RefreshInterval", - "text": "RefreshInterval" - }, - "; setRefreshInterval: (refreshInterval: Partial<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.RefreshInterval", - "text": "RefreshInterval" - }, - ">) => void; createFilter: (indexPattern: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IIndexPattern", - "text": "IIndexPattern" - }, - ", timeRange?: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" - }, - " | undefined) => ", - "RangeFilter", - " | ", - "ScriptedRangeFilter", - " | ", - "MatchAllRangeFilter", - " | undefined; getBounds: () => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRangeBounds", - "text": "TimeRangeBounds" - }, - "; calculateBounds: (timeRange: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" - }, - ") => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRangeBounds", - "text": "TimeRangeBounds" - }, - "; getActiveBounds: () => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRangeBounds", - "text": "TimeRangeBounds" - }, - " | undefined; enableTimeRangeSelector: () => void; disableTimeRangeSelector: () => void; enableAutoRefreshSelector: () => void; disableAutoRefreshSelector: () => void; getTimeDefaults: () => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" - }, - "; getRefreshIntervalDefaults: () => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.RefreshInterval", - "text": "RefreshInterval" - }, - "; }" - ], - "path": "src/plugins/data/public/query/timefilter/lib/change_time_filter.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.filter", - "type": "CompoundType", - "tags": [], - "label": "filter", - "description": [], - "signature": [ - "Filter", - " & { meta: ", - "RangeFilterMeta", - "; range: { [key: string]: ", - "RangeFilterParams", - "; }; }" - ], - "path": "src/plugins/data/public/query/timefilter/lib/change_time_filter.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.convertRangeFilterToTimeRangeString", - "type": "Function", + "id": "def-public.SearchSourceFields.size", + "type": "number", "tags": [], - "label": "convertRangeFilterToTimeRangeString", + "label": "size", "description": [], "signature": [ - "(filter: ", - "RangeFilter", - ") => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" - } + "number | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.filter", - "type": "CompoundType", - "tags": [], - "label": "filter", - "description": [], - "signature": [ - "Filter", - " & { meta: ", - "RangeFilterMeta", - "; range: { [key: string]: ", - "RangeFilterParams", - "; }; }" - ], - "path": "src/plugins/data/public/query/timefilter/lib/change_time_filter.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.mapAndFlattenFilters", - "type": "Function", + "id": "def-public.SearchSourceFields.source", + "type": "CompoundType", "tags": [], - "label": "mapAndFlattenFilters", + "label": "source", "description": [], "signature": [ - "(filters: ", - "Filter", - "[]) => ", - "Filter", - "[]" + "string | boolean | string[] | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.filters", - "type": "Array", - "tags": [], - "label": "filters", - "description": [], - "signature": [ - "Filter", - "[]" - ], - "path": "src/plugins/data/public/query/filter_manager/lib/map_and_flatten_filters.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.extractTimeFilter", - "type": "Function", + "id": "def-public.SearchSourceFields.version", + "type": "CompoundType", "tags": [], - "label": "extractTimeFilter", + "label": "version", "description": [], "signature": [ - "(timeFieldName: string, filters: ", - "Filter", - "[]) => { restOfFilters: ", - "Filter", - "[]; timeRangeFilter: ", - "RangeFilter", - " | undefined; }" + "boolean | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.timeFieldName", - "type": "string", - "tags": [], - "label": "timeFieldName", - "description": [], - "path": "src/plugins/data/public/query/timefilter/lib/extract_time_filter.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.filters", - "type": "Array", - "tags": [], - "label": "filters", - "description": [], - "signature": [ - "Filter", - "[]" - ], - "path": "src/plugins/data/public/query/timefilter/lib/extract_time_filter.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esFilters.extractTimeRange", - "type": "Function", + "id": "def-public.SearchSourceFields.fields", + "type": "Array", "tags": [], - "label": "extractTimeRange", - "description": [], + "label": "fields", + "description": [ + "\nRetrieve fields via the search Fields API" + ], "signature": [ - "(filters: ", - "Filter", - "[], timeFieldName?: string | undefined) => { restOfFilters: ", - "Filter", - "[]; timeRange?: ", { "pluginId": "data", "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchFieldValue", + "text": "SearchFieldValue" }, - " | undefined; }" + "[] | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.SearchSourceFields.fieldsFromSource", + "type": "CompoundType", + "tags": [ + "deprecated" + ], + "label": "fieldsFromSource", + "description": [ + "\nRetreive fields directly from _source (legacy behavior)\n" + ], + "signature": [ + "string | string[] | undefined" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": true, + "references": [ { - "parentPluginId": "data", - "id": "def-public.filters", - "type": "Array", - "tags": [], - "label": "filters", - "description": [], - "signature": [ - "Filter", - "[]" - ], - "path": "src/plugins/data/public/query/timefilter/lib/extract_time_filter.ts", - "deprecated": false + "plugin": "reporting", + "path": "x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts" }, { - "parentPluginId": "data", - "id": "def-public.timeFieldName", - "type": "string", - "tags": [], - "label": "timeFieldName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/public/query/timefilter/lib/extract_time_filter.ts", - "deprecated": false + "plugin": "reporting", + "path": "x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts" } ] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.esKuery", - "type": "Object", - "tags": [ - "deprecated" - ], - "label": "esKuery", - "description": [], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/utils/kuery.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/utils/kuery.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/utils/kuery.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_filters.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_filters.ts" - }, - { - "plugin": "apm", - "path": "x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx" - }, - { - "plugin": "apm", - "path": "x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx" - }, - { - "plugin": "apm", - "path": "x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "parentPluginId": "data", + "id": "def-public.SearchSourceFields.index", + "type": "Object", + "tags": [], + "label": "index", + "description": [ + "\n{@link IndexPatternService}" + ], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPattern", + "text": "IndexPattern" + }, + " | undefined" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "parentPluginId": "data", + "id": "def-public.SearchSourceFields.searchAfter", + "type": "Object", + "tags": [], + "label": "searchAfter", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.EsQuerySearchAfter", + "text": "EsQuerySearchAfter" + }, + " | undefined" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false }, { - "plugin": "transform", - "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_search_bar.ts" + "parentPluginId": "data", + "id": "def-public.SearchSourceFields.timeout", + "type": "string", + "tags": [], + "label": "timeout", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false }, { - "plugin": "transform", - "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_search_bar.ts" + "parentPluginId": "data", + "id": "def-public.SearchSourceFields.terminate_after", + "type": "number", + "tags": [], + "label": "terminate_after", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false }, { - "plugin": "transform", - "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_search_bar.ts" + "parentPluginId": "data", + "id": "def-public.SearchSourceFields.parent", + "type": "Object", + "tags": [], + "label": "parent", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + }, + " | undefined" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false } ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.TypeMeta", + "type": "Interface", + "tags": [], + "label": "TypeMeta", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, "children": [ { "parentPluginId": "data", - "id": "def-public.esKuery.nodeTypes", + "id": "def-public.TypeMeta.aggs", "type": "Object", "tags": [], - "label": "nodeTypes", + "label": "aggs", "description": [], "signature": [ - "NodeTypes" + "Record> | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", + "path": "src/plugins/data/common/index_patterns/types.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-public.esKuery.fromKueryExpression", - "type": "Function", + "id": "def-public.TypeMeta.params", + "type": "Object", "tags": [], - "label": "fromKueryExpression", + "label": "params", "description": [], "signature": [ - "(expression: string | ", - "QueryDslQueryContainer", - ", parseOptions?: Partial<", - "KueryParseOptions", - "> | undefined) => ", - "KueryNode" + "{ rollup_index: string; } | undefined" ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.expression", - "type": "CompoundType", - "tags": [], - "label": "expression", - "description": [], - "signature": [ - "string | ", - "QueryDslQueryContainer" - ], - "path": "node_modules/@kbn/es-query/target_types/kuery/ast/ast.d.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.parseOptions", - "type": "Object", - "tags": [], - "label": "parseOptions", - "description": [], - "signature": [ - "Partial<", - "KueryParseOptions", - "> | undefined" - ], - "path": "node_modules/@kbn/es-query/target_types/kuery/ast/ast.d.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "data", - "id": "def-public.esKuery.toElasticsearchQuery", - "type": "Function", - "tags": [], - "label": "toElasticsearchQuery", - "description": [], - "signature": [ - "(node: ", - "KueryNode", - ", indexPattern?: ", - "IndexPatternBase", - " | undefined, config?: ", - "KueryQueryOptions", - " | undefined, context?: Record | undefined) => ", - "QueryDslQueryContainer" - ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.node", - "type": "Object", - "tags": [], - "label": "node", - "description": [], - "signature": [ - "KueryNode" - ], - "path": "node_modules/@kbn/es-query/target_types/kuery/index.d.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.indexPattern", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - "IndexPatternBase", - " | undefined" - ], - "path": "node_modules/@kbn/es-query/target_types/kuery/index.d.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.config", - "type": "Object", - "tags": [], - "label": "config", - "description": [], - "signature": [ - "KueryQueryOptions", - " | undefined" - ], - "path": "node_modules/@kbn/es-query/target_types/kuery/index.d.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.context", - "type": "Object", - "tags": [], - "label": "context", - "description": [], - "signature": [ - "Record | undefined" - ], - "path": "node_modules/@kbn/es-query/target_types/kuery/index.d.ts", - "deprecated": false - } - ] + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false } ], "initialIsOpen": false + } + ], + "enums": [ + { + "parentPluginId": "data", + "id": "def-public.BUCKET_TYPES", + "type": "Enum", + "tags": [], + "label": "BUCKET_TYPES", + "description": [], + "path": "src/plugins/data/common/search/aggs/buckets/bucket_agg_types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.ES_FIELD_TYPES", + "type": "Enum", + "tags": [], + "label": "ES_FIELD_TYPES", + "description": [], + "signature": [ + "ES_FIELD_TYPES" + ], + "path": "node_modules/@kbn/field-types/target_types/types.d.ts", + "deprecated": false, + "initialIsOpen": false }, { "parentPluginId": "data", - "id": "def-public.esQuery", - "type": "Object", + "id": "def-public.IndexPatternType", + "type": "Enum", "tags": [ "deprecated" ], - "label": "esQuery", + "label": "IndexPatternType", "description": [], - "path": "src/plugins/data/public/deprecated.ts", + "path": "src/plugins/data/common/index_patterns/types.ts", "deprecated": true, - "removeBy": "8.1", - "references": [ + "references": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.KBN_FIELD_TYPES", + "type": "Enum", + "tags": [], + "label": "KBN_FIELD_TYPES", + "description": [], + "signature": [ + "KBN_FIELD_TYPES" + ], + "path": "node_modules/@kbn/field-types/target_types/types.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.METRIC_TYPES", + "type": "Enum", + "tags": [], + "label": "METRIC_TYPES", + "description": [], + "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.SortDirection", + "type": "Enum", + "tags": [], + "label": "SortDirection", + "description": [], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false, + "initialIsOpen": false + } + ], + "misc": [ + { + "parentPluginId": "data", + "id": "def-public.ACTION_GLOBAL_APPLY_FILTER", + "type": "string", + "tags": [], + "label": "ACTION_GLOBAL_APPLY_FILTER", + "description": [], + "signature": [ + "\"ACTION_GLOBAL_APPLY_FILTER\"" + ], + "path": "src/plugins/data/public/actions/apply_filter_action.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.AggConfigOptions", + "type": "Type", + "tags": [], + "label": "AggConfigOptions", + "description": [], + "signature": [ + "{ type: ", { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IAggType", + "text": "IAggType" }, + "; enabled?: boolean | undefined; id?: string | undefined; schema?: string | undefined; params?: {} | ", + "SerializableRecord", + " | undefined; }" + ], + "path": "src/plugins/data/common/search/aggs/agg_config.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.AggConfigSerialized", + "type": "Type", + "tags": [], + "label": "AggConfigSerialized", + "description": [], + "signature": [ + "{ type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", + "SerializableRecord", + " | undefined; schema?: string | undefined; }" + ], + "path": "src/plugins/data/common/search/aggs/agg_config.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.AggGroupName", + "type": "Type", + "tags": [], + "label": "AggGroupName", + "description": [], + "signature": [ + "\"none\" | \"buckets\" | \"metrics\"" + ], + "path": "src/plugins/data/common/search/aggs/agg_groups.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.AggParam", + "type": "Type", + "tags": [], + "label": "AggParam", + "description": [], + "signature": [ { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.BaseParamType", + "text": "BaseParamType" }, + "<", { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" }, + ">" + ], + "path": "src/plugins/data/common/search/aggs/agg_params.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.AggregationRestrictions", + "type": "Type", + "tags": [], + "label": "AggregationRestrictions", + "description": [], + "signature": [ + "{ [x: string]: { agg?: string | undefined; interval?: number | undefined; fixed_interval?: string | undefined; calendar_interval?: string | undefined; delay?: string | undefined; time_zone?: string | undefined; }; }" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.AggregationRestrictions", + "type": "Type", + "tags": [], + "label": "AggregationRestrictions", + "description": [], + "signature": [ + "{ [x: string]: { agg?: string | undefined; interval?: number | undefined; fixed_interval?: string | undefined; calendar_interval?: string | undefined; delay?: string | undefined; time_zone?: string | undefined; }; }" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.AggsStart", + "type": "Type", + "tags": [], + "label": "AggsStart", + "description": [ + "\nAggsStart represents the actual external contract as AggsCommonStart\nis only used internally. The difference is that AggsStart includes the\ntypings for the registry with initialized agg types.\n" + ], + "signature": [ + "{ calculateAutoTimeExpression: (range: ", { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" }, + ") => string | undefined; datatableUtilities: { getIndexPattern: (column: ", { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx" + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableColumn", + "text": "DatatableColumn" }, + ") => Promise<", { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPattern", + "text": "IndexPattern" }, + " | undefined>; getAggConfig: (column: ", { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx" + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableColumn", + "text": "DatatableColumn" }, + ") => Promise<", { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" }, + " | undefined>; isFilterable: (column: ", { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx" + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableColumn", + "text": "DatatableColumn" }, + ") => boolean; }; createAggConfigs: (indexPattern: ", { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPattern", + "text": "IndexPattern" }, + ", configStates?: Pick & Pick<{ type: string | ", { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IAggType", + "text": "IAggType" }, + "; }, \"type\"> & Pick<{ type: string | ", { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IAggType", + "text": "IAggType" }, + "; }, never>, \"type\" | \"enabled\" | \"id\" | \"schema\" | \"params\">[] | undefined) => ", { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfigs", + "text": "AggConfigs" }, + "; types: ", + "AggTypesRegistryStart", + "; }" + ], + "path": "src/plugins/data/common/search/aggs/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.APPLY_FILTER_TRIGGER", + "type": "string", + "tags": [], + "label": "APPLY_FILTER_TRIGGER", + "description": [], + "signature": [ + "\"FILTER_TRIGGER\"" + ], + "path": "src/plugins/data/public/triggers/apply_filter_trigger.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.CustomFilter", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "CustomFilter", + "description": [], + "signature": [ + "{ $state?: { store: ", + "FilterStateStore", + "; } | undefined; meta: ", + "FilterMeta", + "; query?: Record | undefined; }" + ], + "path": "src/plugins/data/common/es_query/index.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.DataViewsContract", + "type": "Type", + "tags": [], + "label": "DataViewsContract", + "description": [], + "signature": [ + "{ get: (id: string) => Promise<", { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" }, + ">; delete: (indexPatternId: string) => Promise<{}>; create: (spec: ", { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" }, + ", skipFetchFields?: boolean) => Promise<", { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" }, + ">; find: (search: string, size?: number) => Promise<", { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" }, + "[]>; ensureDefaultIndexPattern: ", + "EnsureDefaultDataView", + "; getIds: (refresh?: boolean) => Promise; getTitles: (refresh?: boolean) => Promise; getIdsWithTitle: (refresh?: boolean) => Promise<", { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/containers/logs/log_stream/index.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewListItem", + "text": "DataViewListItem" }, + "[]>; clearCache: (id?: string | undefined) => void; getCache: () => Promise<", + "SavedObject", + ">[] | null | undefined>; getDefault: () => Promise<", { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" }, + " | null>; getDefaultId: () => Promise; setDefault: (id: string | null, force?: boolean) => Promise; hasUserIndexPattern: () => Promise; getFieldsForWildcard: (options: ", { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.GetFieldsOptions", + "text": "GetFieldsOptions" }, + ") => Promise; getFieldsForIndexPattern: (indexPattern: ", { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" }, + " | ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/side_panel/network_details/expandable_network.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" }, + ", options?: ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/side_panel/network_details/expandable_network.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.GetFieldsOptions", + "text": "GetFieldsOptions" }, + " | undefined) => Promise; refreshFields: (indexPattern: ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" }, + ") => Promise; fieldArrayToMap: (fields: ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" }, + "[], fieldAttrs?: ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldAttrs", + "text": "FieldAttrs" }, + " | undefined) => Record; savedObjectToSpec: (savedObject: ", + "SavedObject", + "<", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" }, + ">) => ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" }, + "; createAndSave: (spec: ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" }, + ", override?: boolean, skipFetchFields?: boolean) => Promise<", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" }, + ">; createSavedObject: (indexPattern: ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" }, + ", override?: boolean) => Promise<", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" }, + ">; updateSavedObject: (indexPattern: ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" }, + ", saveAttempts?: number, ignoreErrors?: boolean) => Promise; }" + ], + "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.ES_SEARCH_STRATEGY", + "type": "string", + "tags": [], + "label": "ES_SEARCH_STRATEGY", + "description": [], + "signature": [ + "\"es\"" + ], + "path": "src/plugins/data/common/search/strategies/es_search/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.EsaggsExpressionFunctionDefinition", + "type": "Type", + "tags": [], + "label": "EsaggsExpressionFunctionDefinition", + "description": [], + "signature": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.tsx" + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" }, + "<\"esaggs\", Input, Arguments, Output, ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.tsx" + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" }, + "<", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/pages/details/index.tsx" + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" }, + ", ", + "SerializableRecord", + ">>" + ], + "path": "src/plugins/data/common/search/expressions/esaggs/esaggs_fn.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.EsQueryConfig", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "EsQueryConfig", + "description": [], + "signature": [ + "KueryQueryOptions", + " & { allowLeadingWildcards: boolean; queryStringOptions: ", + "SerializableRecord", + "; ignoreFilterIfFieldNotInIndex: boolean; }" + ], + "path": "src/plugins/data/common/es_query/index.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/pages/details/index.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/types.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/types.ts" + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.EsQuerySortValue", + "type": "Type", + "tags": [], + "label": "EsQuerySortValue", + "description": [], + "signature": [ + "{ [x: string]: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SortDirection", + "text": "SortDirection" }, + " | ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SortDirectionNumeric", + "text": "SortDirectionNumeric" }, + " | ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/hosts.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SortDirectionFormat", + "text": "SortDirectionFormat" }, + "; }" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.ExecutionContextSearch", + "type": "Type", + "tags": [], + "label": "ExecutionContextSearch", + "description": [], + "signature": [ + "{ filters?: ", + "Filter", + "[] | undefined; query?: ", + "Query", + " | ", + "Query", + "[] | undefined; timeRange?: ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/hosts.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" }, + " | undefined; }" + ], + "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.ExistsFilter", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "ExistsFilter", + "description": [], + "signature": [ + "Filter", + " & { meta: ", + "FilterMeta", + "; exists?: { field: string; } | undefined; }" + ], + "path": "src/plugins/data/common/es_query/index.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/hosts.tsx" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/pages/network.tsx" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.ExpressionFunctionKibana", + "type": "Type", + "tags": [], + "label": "ExpressionFunctionKibana", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" }, + "<\"kibana\", Input, object, ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/pages/network.tsx" + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" }, + "<\"kibana_context\", ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/pages/network.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ExecutionContextSearch", + "text": "ExecutionContextSearch" }, + ">, ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx" + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" }, + "<", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx" + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" }, + ", ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ExecutionContextSearch", + "text": "ExecutionContextSearch" }, + ">>" + ], + "path": "src/plugins/data/common/search/expressions/kibana.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.ExpressionFunctionKibanaContext", + "type": "Type", + "tags": [], + "label": "ExpressionFunctionKibanaContext", + "description": [], + "signature": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" }, + "<\"kibana_context\", Input, Arguments, Promise<", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionValueBoxed", + "text": "ExpressionValueBoxed" }, + "<\"kibana_context\", ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/ueba.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ExecutionContextSearch", + "text": "ExecutionContextSearch" }, + ">>, ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/ueba.tsx" + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExecutionContext", + "text": "ExecutionContext" }, + "<", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/ueba.tsx" + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" }, + ", ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/details/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ExecutionContextSearch", + "text": "ExecutionContextSearch" }, + ">>" + ], + "path": "src/plugins/data/common/search/expressions/kibana_context.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.ExpressionValueSearchContext", + "type": "Type", + "tags": [], + "label": "ExpressionValueSearchContext", + "description": [], + "signature": [ + "{ type: \"kibana_context\"; } & ", { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/details/index.tsx" + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ExecutionContextSearch", + "text": "ExecutionContextSearch" + } + ], + "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.Filter", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "Filter", + "description": [], + "signature": [ + "{ $state?: { store: ", + "FilterStateStore", + "; } | undefined; meta: ", + "FilterMeta", + "; query?: Record | undefined; }" + ], + "path": "src/plugins/data/common/es_query/index.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [ + { + "plugin": "discover", + "path": "src/plugins/discover/public/url_generator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/flyout/header/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/url_generator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/flyout/header/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/url_generator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/flyout/header/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/locator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_tab_content/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/locator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_tab_content/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/locator.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/types.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/types.ts" }, { - "plugin": "transform", - "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_search_bar.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { - "plugin": "transform", - "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_search_bar.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { - "plugin": "transform", - "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { - "plugin": "transform", - "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { - "plugin": "transform", - "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { - "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { - "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { - "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { - "plugin": "visTypeVega", - "path": "src/plugins/vis_type_vega/public/vega_request_handler.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" }, { - "plugin": "visTypeVega", - "path": "src/plugins/vis_type_vega/public/vega_request_handler.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" }, { - "plugin": "visTypeVega", - "path": "src/plugins/vis_type_vega/public/vega_request_handler.ts" - } - ], - "children": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" + }, { - "parentPluginId": "data", - "id": "def-public.esQuery.buildEsQuery", - "type": "Function", - "tags": [], - "label": "buildEsQuery", - "description": [], - "signature": [ - "(indexPattern: ", - "IndexPatternBase", - " | undefined, queries: ", - "Query", - " | ", - "Query", - "[], filters: ", - "Filter", - " | ", - "Filter", - "[], config?: ", - "EsQueryConfig", - " | undefined) => { bool: ", - "BoolQuery", - "; }" - ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.indexPattern", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - "IndexPatternBase", - " | undefined" - ], - "path": "node_modules/@kbn/es-query/target_types/es_query/build_es_query.d.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.queries", - "type": "CompoundType", - "tags": [], - "label": "queries", - "description": [], - "signature": [ - "Query", - " | ", - "Query", - "[]" - ], - "path": "node_modules/@kbn/es-query/target_types/es_query/build_es_query.d.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.filters", - "type": "CompoundType", - "tags": [], - "label": "filters", - "description": [], - "signature": [ - "Filter", - " | ", - "Filter", - "[]" - ], - "path": "node_modules/@kbn/es-query/target_types/es_query/build_es_query.d.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.config", - "type": "CompoundType", - "tags": [], - "label": "config", - "description": [], - "signature": [ - "EsQueryConfig", - " | undefined" - ], - "path": "node_modules/@kbn/es-query/target_types/es_query/build_es_query.d.ts", - "deprecated": false - } - ] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" }, { - "parentPluginId": "data", - "id": "def-public.esQuery.getEsQueryConfig", - "type": "Function", - "tags": [], - "label": "getEsQueryConfig", - "description": [], - "signature": [ - "(config: KibanaConfig) => ", - "EsQueryConfig" - ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.config", - "type": "Object", - "tags": [], - "label": "config", - "description": [], - "signature": [ - "KibanaConfig" - ], - "path": "src/plugins/data/common/es_query/get_es_query_config.ts", - "deprecated": false - } - ] + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" }, { - "parentPluginId": "data", - "id": "def-public.esQuery.buildQueryFromFilters", - "type": "Function", - "tags": [], - "label": "buildQueryFromFilters", - "description": [], - "signature": [ - "(filters: ", - "Filter", - "[] | undefined, indexPattern: ", - "IndexPatternBase", - " | undefined, ignoreFilterIfFieldNotInIndex?: boolean | undefined) => ", - "BoolQuery" - ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.filters", - "type": "Array", - "tags": [], - "label": "filters", - "description": [], - "signature": [ - "Filter", - "[] | undefined" - ], - "path": "node_modules/@kbn/es-query/target_types/es_query/from_filters.d.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.indexPattern", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - "IndexPatternBase", - " | undefined" - ], - "path": "node_modules/@kbn/es-query/target_types/es_query/from_filters.d.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.ignoreFilterIfFieldNotInIndex", - "type": "CompoundType", - "tags": [], - "label": "ignoreFilterIfFieldNotInIndex", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "node_modules/@kbn/es-query/target_types/es_query/from_filters.d.ts", - "deprecated": false - } - ] + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" }, { - "parentPluginId": "data", - "id": "def-public.esQuery.luceneStringToDsl", - "type": "Function", - "tags": [], - "label": "luceneStringToDsl", - "description": [], - "signature": [ - "(query: string | ", - "QueryDslQueryContainer", - ") => ", - "QueryDslQueryContainer" - ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.query", - "type": "CompoundType", - "tags": [], - "label": "query", - "description": [], - "signature": [ - "string | ", - "QueryDslQueryContainer" - ], - "path": "node_modules/@kbn/es-query/target_types/es_query/lucene_string_to_dsl.d.ts", - "deprecated": false - } - ] + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" }, { - "parentPluginId": "data", - "id": "def-public.esQuery.decorateQuery", - "type": "Function", - "tags": [], - "label": "decorateQuery", - "description": [], - "signature": [ - "(query: ", - "QueryDslQueryContainer", - ", queryStringOptions: string | ", - "SerializableRecord", - ", dateFormatTZ?: string | undefined) => ", - "QueryDslQueryContainer" - ], - "path": "src/plugins/data/public/deprecated.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.query", - "type": "Object", - "tags": [], - "label": "query", - "description": [], - "signature": [ - "QueryDslQueryContainer" - ], - "path": "node_modules/@kbn/es-query/target_types/es_query/decorate_query.d.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.queryStringOptions", - "type": "CompoundType", - "tags": [], - "label": "queryStringOptions", - "description": [], - "signature": [ - "string | ", - "SerializableRecord" - ], - "path": "node_modules/@kbn/es-query/target_types/es_query/decorate_query.d.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.dateFormatTZ", - "type": "string", - "tags": [], - "label": "dateFormatTZ", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "node_modules/@kbn/es-query/target_types/es_query/decorate_query.d.ts", - "deprecated": false - } - ] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.exporters", - "type": "Object", - "tags": [], - "label": "exporters", - "description": [], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "children": [ + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/filter_utils.ts" + }, { - "parentPluginId": "data", - "id": "def-public.exporters.datatableToCSV", - "type": "Function", - "tags": [], - "label": "datatableToCSV", - "description": [], - "signature": [ - "({ columns, rows }: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.Datatable", - "text": "Datatable" - }, - ", { csvSeparator, quoteValues, formatFactory, raw, escapeFormulaValues }: CSVOptions) => string" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.__0", - "type": "Object", - "tags": [], - "label": "__0", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.Datatable", - "text": "Datatable" - } - ], - "path": "src/plugins/data/common/exports/export_csv.tsx", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.__1", - "type": "Object", - "tags": [], - "label": "__1", - "description": [], - "signature": [ - "CSVOptions" - ], - "path": "src/plugins/data/common/exports/export_csv.tsx", - "deprecated": false - } - ] + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/filter_utils.ts" }, { - "parentPluginId": "data", - "id": "def-public.exporters.CSV_MIME_TYPE", - "type": "string", - "tags": [], - "label": "CSV_MIME_TYPE", - "description": [], - "path": "src/plugins/data/public/index.ts", - "deprecated": false + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/filter_utils.ts" }, { - "parentPluginId": "data", - "id": "def-public.exporters.cellHasFormulas", - "type": "Function", - "tags": [], - "label": "cellHasFormulas", - "description": [], - "signature": [ - "(val: string) => boolean" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.val", - "type": "string", - "tags": [], - "label": "val", - "description": [], - "path": "src/plugins/data/common/exports/formula_checks.ts", - "deprecated": false - } - ] + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/filter_utils.ts" }, { - "parentPluginId": "data", - "id": "def-public.exporters.tableHasFormulas", - "type": "Function", - "tags": [], - "label": "tableHasFormulas", - "description": [], - "signature": [ - "(columns: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.DatatableColumn", - "text": "DatatableColumn" - }, - "[], rows: Record[]) => boolean" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.columns", - "type": "Array", - "tags": [], - "label": "columns", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.DatatableColumn", - "text": "DatatableColumn" - }, - "[]" - ], - "path": "src/plugins/data/common/exports/formula_checks.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.rows", - "type": "Array", - "tags": [], - "label": "rows", - "description": [], - "signature": [ - "Record[]" - ], - "path": "src/plugins/data/common/exports/formula_checks.ts", - "deprecated": false - } - ] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.indexPatterns", - "type": "Object", - "tags": [], - "label": "indexPatterns", - "description": [], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "children": [ + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/filter_utils.ts" + }, { - "parentPluginId": "data", - "id": "def-public.indexPatterns.ILLEGAL_CHARACTERS_KEY", - "type": "string", - "tags": [], - "label": "ILLEGAL_CHARACTERS_KEY", - "description": [], - "path": "src/plugins/data/public/index.ts", - "deprecated": false + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts" }, { - "parentPluginId": "data", - "id": "def-public.indexPatterns.CONTAINS_SPACES_KEY", - "type": "string", - "tags": [], - "label": "CONTAINS_SPACES_KEY", - "description": [], - "path": "src/plugins/data/public/index.ts", - "deprecated": false + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts" }, { - "parentPluginId": "data", - "id": "def-public.indexPatterns.ILLEGAL_CHARACTERS_VISIBLE", - "type": "Array", - "tags": [], - "label": "ILLEGAL_CHARACTERS_VISIBLE", - "description": [], - "signature": [ - "string[]" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/state/dashboard_state_slice.ts" }, { - "parentPluginId": "data", - "id": "def-public.indexPatterns.ILLEGAL_CHARACTERS", - "type": "Array", - "tags": [], - "label": "ILLEGAL_CHARACTERS", - "description": [], - "signature": [ - "string[]" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/state/dashboard_state_slice.ts" }, { - "parentPluginId": "data", - "id": "def-public.indexPatterns.isDefault", - "type": "Function", - "tags": [], - "label": "isDefault", - "description": [], - "signature": [ - "(indexPattern: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IIndexPattern", - "text": "IIndexPattern" - }, - ") => boolean" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.indexPattern", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IIndexPattern", - "text": "IIndexPattern" - } - ], - "path": "src/plugins/data/common/index_patterns/lib/is_default.ts", - "deprecated": false - } - ] + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/state/dashboard_state_slice.ts" }, { - "parentPluginId": "data", - "id": "def-public.indexPatterns.isFilterable", - "type": "Function", - "tags": [], - "label": "isFilterable", - "description": [], - "signature": [ - "(field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - ") => boolean" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.field", - "type": "Object", - "tags": [], - "label": "field", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - } - ], - "path": "src/plugins/data/common/index_patterns/fields/utils.ts", - "deprecated": false - } - ] + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts" }, { - "parentPluginId": "data", - "id": "def-public.indexPatterns.isNestedField", - "type": "Function", - "tags": [], - "label": "isNestedField", - "description": [], - "signature": [ - "(field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - ") => boolean" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.field", - "type": "Object", - "tags": [], - "label": "field", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - } - ], - "path": "src/plugins/data/common/index_patterns/fields/utils.ts", - "deprecated": false - } - ] + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts" }, { - "parentPluginId": "data", - "id": "def-public.indexPatterns.validate", - "type": "Function", - "tags": [], - "label": "validate", - "description": [], - "signature": [ - "(indexPattern: string) => Record" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.indexPattern", - "type": "string", - "tags": [], - "label": "indexPattern", - "description": [], - "path": "src/plugins/data/common/index_patterns/lib/validate_index_pattern.ts", - "deprecated": false - } - ] + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts" }, { - "parentPluginId": "data", - "id": "def-public.indexPatterns.flattenHitWrapper", - "type": "Function", - "tags": [], - "label": "flattenHitWrapper", - "description": [], - "signature": [ - "(indexPattern: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ", metaFields?: {}, cache?: WeakMap) => (hit: Record, deep?: boolean) => Record" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.indexPattern", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/flatten_hit.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.metaFields", - "type": "Object", - "tags": [], - "label": "metaFields", - "description": [], - "signature": [ - "{}" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/flatten_hit.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.cache", - "type": "Object", - "tags": [], - "label": "cache", - "description": [], - "signature": [ - "WeakMap" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/flatten_hit.ts", - "deprecated": false - } - ] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.search", - "type": "Object", - "tags": [], - "label": "search", - "description": [], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "children": [ + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts" + }, { - "parentPluginId": "data", - "id": "def-public.search.aggs", - "type": "Object", - "tags": [], - "label": "aggs", - "description": [], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-public.search.aggs.CidrMask", - "type": "Object", - "tags": [], - "label": "CidrMask", - "description": [], - "signature": [ - "typeof ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.CidrMask", - "text": "CidrMask" - } - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.dateHistogramInterval", - "type": "Function", - "tags": [], - "label": "dateHistogramInterval", - "description": [], - "signature": [ - "(interval: string) => Interval" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.interval", - "type": "string", - "tags": [], - "label": "interval", - "description": [], - "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/date_histogram_interval.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.intervalOptions", - "type": "Array", - "tags": [], - "label": "intervalOptions", - "description": [], - "signature": [ - "({ display: string; val: string; enabled(agg: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IBucketAggConfig", - "text": "IBucketAggConfig" - }, - "): boolean; } | { display: string; val: string; })[]" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.InvalidEsCalendarIntervalError", - "type": "Object", - "tags": [], - "label": "InvalidEsCalendarIntervalError", - "description": [], - "signature": [ - "typeof ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.InvalidEsCalendarIntervalError", - "text": "InvalidEsCalendarIntervalError" - } - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.InvalidEsIntervalFormatError", - "type": "Object", - "tags": [], - "label": "InvalidEsIntervalFormatError", - "description": [], - "signature": [ - "typeof ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.InvalidEsIntervalFormatError", - "text": "InvalidEsIntervalFormatError" - } - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.IpAddress", - "type": "Object", - "tags": [], - "label": "IpAddress", - "description": [], - "signature": [ - "typeof ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IpAddress", - "text": "IpAddress" - } - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.isDateHistogramBucketAggConfig", - "type": "Function", - "tags": [], - "label": "isDateHistogramBucketAggConfig", - "description": [], - "signature": [ - "(agg: any) => agg is ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IBucketDateHistogramAggConfig", - "text": "IBucketDateHistogramAggConfig" - } - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.agg", - "type": "Any", - "tags": [], - "label": "agg", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/data/common/search/aggs/buckets/date_histogram.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.isNumberType", - "type": "Function", - "tags": [], - "label": "isNumberType", - "description": [], - "signature": [ - "(agg: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" - }, - ") => boolean" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.agg", - "type": "Object", - "tags": [], - "label": "agg", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" - } - ], - "path": "src/plugins/data/common/search/aggs/buckets/migrate_include_exclude_format.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.isStringType", - "type": "Function", - "tags": [], - "label": "isStringType", - "description": [], - "signature": [ - "(agg: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" - }, - ") => boolean" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.agg", - "type": "Object", - "tags": [], - "label": "agg", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" - } - ], - "path": "src/plugins/data/common/search/aggs/buckets/migrate_include_exclude_format.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.isType", - "type": "Function", - "tags": [], - "label": "isType", - "description": [], - "signature": [ - "(...types: string[]) => (agg: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" - }, - ") => boolean" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.types", - "type": "Array", - "tags": [], - "label": "types", - "description": [], - "signature": [ - "string[]" - ], - "path": "src/plugins/data/common/search/aggs/buckets/migrate_include_exclude_format.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.isValidEsInterval", - "type": "Function", - "tags": [], - "label": "isValidEsInterval", - "description": [], - "signature": [ - "(interval: string) => boolean" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.interval", - "type": "string", - "tags": [], - "label": "interval", - "description": [], - "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/is_valid_es_interval.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.isValidInterval", - "type": "Function", - "tags": [], - "label": "isValidInterval", - "description": [], - "signature": [ - "(value: string, baseInterval?: string | undefined) => boolean" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.value", - "type": "string", - "tags": [], - "label": "value", - "description": [], - "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/is_valid_interval.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.baseInterval", - "type": "string", - "tags": [], - "label": "baseInterval", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/is_valid_interval.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.parentPipelineType", - "type": "string", - "tags": [], - "label": "parentPipelineType", - "description": [], - "path": "src/plugins/data/public/index.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.parseEsInterval", - "type": "Function", - "tags": [], - "label": "parseEsInterval", - "description": [], - "signature": [ - "(interval: string) => { value: number; unit: ", - "Unit", - "; type: \"calendar\" | \"fixed\"; }" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.interval", - "type": "string", - "tags": [], - "label": "interval", - "description": [], - "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.parseInterval", - "type": "Function", - "tags": [], - "label": "parseInterval", - "description": [], - "signature": [ - "(interval: string) => moment.Duration | null" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.interval", - "type": "string", - "tags": [], - "label": "interval", - "description": [], - "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_interval.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.propFilter", - "type": "Function", - "tags": [], - "label": "propFilter", - "description": [], - "signature": [ - "

(prop: P) => (list: T[], filters?: string | string[] | FilterFunc) => T[]" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.prop", - "type": "Uncategorized", - "tags": [], - "label": "prop", - "description": [], - "signature": [ - "P" - ], - "path": "src/plugins/data/common/search/aggs/utils/prop_filter.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.siblingPipelineType", - "type": "string", - "tags": [], - "label": "siblingPipelineType", - "description": [], - "path": "src/plugins/data/public/index.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.termsAggFilter", - "type": "Array", - "tags": [], - "label": "termsAggFilter", - "description": [], - "signature": [ - "string[]" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.toAbsoluteDates", - "type": "Function", - "tags": [], - "label": "toAbsoluteDates", - "description": [], - "signature": [ - "(range: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" - }, - ") => { from: Date; to: Date; } | undefined" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.range", - "type": "Object", - "tags": [], - "label": "range", - "description": [], - "signature": [ - "{ from: string; to: string; mode?: \"absolute\" | \"relative\" | undefined; }" - ], - "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/to_absolute_dates.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.boundsDescendingRaw", - "type": "Array", - "tags": [], - "label": "boundsDescendingRaw", - "description": [], - "signature": [ - "({ bound: number; interval: moment.Duration; boundLabel: string; intervalLabel: string; } | { bound: moment.Duration; interval: moment.Duration; boundLabel: string; intervalLabel: string; })[]" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.getNumberHistogramIntervalByDatatableColumn", - "type": "Function", - "tags": [], - "label": "getNumberHistogramIntervalByDatatableColumn", - "description": [], - "signature": [ - "(column: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.DatatableColumn", - "text": "DatatableColumn" - }, - ") => number | undefined" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.column", - "type": "Object", - "tags": [], - "label": "column", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.DatatableColumn", - "text": "DatatableColumn" - } - ], - "path": "src/plugins/data/common/search/aggs/utils/get_number_histogram_interval.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "data", - "id": "def-public.search.aggs.getDateHistogramMetaDataByDatatableColumn", - "type": "Function", - "tags": [], - "label": "getDateHistogramMetaDataByDatatableColumn", - "description": [], - "signature": [ - "(column: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.DatatableColumn", - "text": "DatatableColumn" - }, - ", defaults?: Partial<{ timeZone: string; }>) => { interval: string | undefined; timeZone: string | undefined; timeRange: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" - }, - " | undefined; } | undefined" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.column", - "type": "Object", - "tags": [], - "label": "column", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.DatatableColumn", - "text": "DatatableColumn" - } - ], - "path": "src/plugins/data/common/search/aggs/utils/get_date_histogram_meta.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.defaults", - "type": "Object", - "tags": [], - "label": "defaults", - "description": [], - "signature": [ - "{ timeZone?: string | undefined; }" - ], - "path": "src/plugins/data/common/search/aggs/utils/get_date_histogram_meta.ts", - "deprecated": false - } - ] - } - ] + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts" }, { - "parentPluginId": "data", - "id": "def-public.search.getResponseInspectorStats", - "type": "Function", - "tags": [], - "label": "getResponseInspectorStats", - "description": [], - "signature": [ - "(resp?: ", - "SearchResponse", - " | undefined, searchSource?: Pick<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" - }, - ", \"create\" | \"history\" | \"setPreferredSearchStrategyId\" | \"setField\" | \"removeField\" | \"setFields\" | \"getId\" | \"getFields\" | \"getField\" | \"getOwnField\" | \"createCopy\" | \"createChild\" | \"setParent\" | \"getParent\" | \"fetch$\" | \"fetch\" | \"onRequestStart\" | \"getSearchRequestBody\" | \"destroy\" | \"getSerializedFields\" | \"serialize\"> | undefined) => ", - { - "pluginId": "inspector", - "scope": "common", - "docId": "kibInspectorPluginApi", - "section": "def-common.RequestStatistics", - "text": "RequestStatistics" - } - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.resp", - "type": "Object", - "tags": [], - "label": "resp", - "description": [], - "signature": [ - "SearchResponse", - " | undefined" - ], - "path": "src/plugins/data/common/search/search_source/inspect/inspector_stats.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.searchSource", - "type": "Object", - "tags": [], - "label": "searchSource", - "description": [], - "signature": [ - "Pick<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.SearchSource", - "text": "SearchSource" - }, - ", \"create\" | \"history\" | \"setPreferredSearchStrategyId\" | \"setField\" | \"removeField\" | \"setFields\" | \"getId\" | \"getFields\" | \"getField\" | \"getOwnField\" | \"createCopy\" | \"createChild\" | \"setParent\" | \"getParent\" | \"fetch$\" | \"fetch\" | \"onRequestStart\" | \"getSearchRequestBody\" | \"destroy\" | \"getSerializedFields\" | \"serialize\"> | undefined" - ], - "path": "src/plugins/data/common/search/search_source/inspect/inspector_stats.ts", - "deprecated": false - } - ] + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts" }, { - "parentPluginId": "data", - "id": "def-public.search.tabifyAggResponse", - "type": "Function", - "tags": [], - "label": "tabifyAggResponse", - "description": [], - "signature": [ - "(aggConfigs: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfigs", - "text": "AggConfigs" - }, - ", esResponse: Record, respOpts?: Partial<", - "TabbedResponseWriterOptions", - "> | undefined) => ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.Datatable", - "text": "Datatable" - } - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.aggConfigs", - "type": "Object", - "tags": [], - "label": "aggConfigs", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfigs", - "text": "AggConfigs" - } - ], - "path": "src/plugins/data/common/search/tabify/tabify.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.esResponse", - "type": "Object", - "tags": [], - "label": "esResponse", - "description": [], - "signature": [ - "{ [x: string]: any; }" - ], - "path": "src/plugins/data/common/search/tabify/tabify.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.respOpts", - "type": "Object", - "tags": [], - "label": "respOpts", - "description": [], - "signature": [ - "Partial<", - "TabbedResponseWriterOptions", - "> | undefined" - ], - "path": "src/plugins/data/common/search/tabify/tabify.ts", - "deprecated": false - } - ] + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts" }, { - "parentPluginId": "data", - "id": "def-public.search.tabifyGetColumns", - "type": "Function", - "tags": [], - "label": "tabifyGetColumns", - "description": [], - "signature": [ - "(aggs: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" - }, - "[], minimalColumns: boolean) => ", - "TabbedAggColumn", - "[]" - ], - "path": "src/plugins/data/public/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-public.aggs", - "type": "Array", - "tags": [], - "label": "aggs", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.AggConfig", - "text": "AggConfig" - }, - "[]" - ], - "path": "src/plugins/data/common/search/tabify/get_columns.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.minimalColumns", - "type": "boolean", - "tags": [], - "label": "minimalColumns", - "description": [], - "path": "src/plugins/data/common/search/tabify/get_columns.ts", - "deprecated": false - } - ] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-public.UI_SETTINGS", - "type": "Object", - "tags": [], - "label": "UI_SETTINGS", - "description": [], - "signature": [ - "{ readonly META_FIELDS: \"metaFields\"; readonly DOC_HIGHLIGHT: \"doc_table:highlight\"; readonly QUERY_STRING_OPTIONS: \"query:queryString:options\"; readonly QUERY_ALLOW_LEADING_WILDCARDS: \"query:allowLeadingWildcards\"; readonly SEARCH_QUERY_LANGUAGE: \"search:queryLanguage\"; readonly SORT_OPTIONS: \"sort:options\"; readonly COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX: \"courier:ignoreFilterIfFieldNotInIndex\"; readonly COURIER_SET_REQUEST_PREFERENCE: \"courier:setRequestPreference\"; readonly COURIER_CUSTOM_REQUEST_PREFERENCE: \"courier:customRequestPreference\"; readonly COURIER_MAX_CONCURRENT_SHARD_REQUESTS: \"courier:maxConcurrentShardRequests\"; readonly SEARCH_INCLUDE_FROZEN: \"search:includeFrozen\"; readonly SEARCH_TIMEOUT: \"search:timeout\"; readonly HISTOGRAM_BAR_TARGET: \"histogram:barTarget\"; readonly HISTOGRAM_MAX_BARS: \"histogram:maxBars\"; readonly HISTORY_LIMIT: \"history:limit\"; readonly TIMEPICKER_REFRESH_INTERVAL_DEFAULTS: \"timepicker:refreshIntervalDefaults\"; readonly TIMEPICKER_QUICK_RANGES: \"timepicker:quickRanges\"; readonly TIMEPICKER_TIME_DEFAULTS: \"timepicker:timeDefaults\"; readonly INDEXPATTERN_PLACEHOLDER: \"indexPattern:placeholder\"; readonly FILTERS_PINNED_BY_DEFAULT: \"filters:pinnedByDefault\"; readonly FILTERS_EDITOR_SUGGEST_VALUES: \"filterEditor:suggestValues\"; readonly AUTOCOMPLETE_USE_TIMERANGE: \"autocomplete:useTimeRange\"; readonly AUTOCOMPLETE_VALUE_SUGGESTION_METHOD: \"autocomplete:valueSuggestionMethod\"; }" - ], - "path": "src/plugins/data/common/constants.ts", - "deprecated": false, - "initialIsOpen": false - } - ], - "setup": { - "parentPluginId": "data", - "id": "def-public.DataPublicPluginSetup", - "type": "Interface", - "tags": [], - "label": "DataPublicPluginSetup", - "description": [ - "\nData plugin public Setup contract" + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/types.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/types.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/types.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/types.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/locator.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/locator.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/locator.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/locator.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/url_generator.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/url_generator.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/url_generator.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/types.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/types.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/types.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/state_management/types.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/state_management/types.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/fields_accordion.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/common/types/timeline/store.ts" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/common/types/timeline/store.ts" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/hover_actions/utils.ts" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/hover_actions/utils.ts" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/hover_actions/utils.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/reducers/map/types.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/reducers/map/types.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/actions/map_actions.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/actions/map_actions.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_filter_control/draw_filter_control.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_filter_control/draw_filter_control.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_filter_control/draw_filter_control.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_geometry_filter_form.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_geometry_filter_form.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_properties.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_properties.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_properties.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_properties.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/features_tooltip.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/features_tooltip.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_popover.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_popover.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/tooltip_control.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/toolbar_overlay/toolbar_overlay.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/toolbar_overlay/toolbar_overlay.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/map_container/map_container.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/map_container/map_container.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/routes/map_page/url_state/global_sync.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/routes/map_page/url_state/global_sync.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/routes/map_page/url_state/app_state_manager.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/routes/map_page/url_state/app_state_manager.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/routes/map_page/url_state/app_state_manager.ts" + }, + { + "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_app/map_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_app/map_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_app/map_app.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/routes/map_page/map_app/index.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/routes/map_page/map_app/index.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/locators.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/locators.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/locators.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/locators.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/locators.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/components/log_stream/log_stream_embeddable.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/components/log_stream/log_stream_embeddable.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/migrations/types.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/migrations/types.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/migrations/types.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/migrations/types.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/migrations/saved_object_migrations.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/migrations/saved_object_migrations.ts" + }, + { + "plugin": "dashboardEnhanced", + "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" + }, + { + "plugin": "dashboardEnhanced", + "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" + }, + { + "plugin": "discoverEnhanced", + "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.ts" + }, + { + "plugin": "discoverEnhanced", + "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/common/types/timeline/store.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/common/types/timeline/store.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/store/inputs/model.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/store/inputs/model.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/store/inputs/actions.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/store/inputs/actions.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/url_state/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/url_state/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/url_state/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/url_state/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/url_state/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/navigation/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/navigation/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/add_filter_to_global_search_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/navigation/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/navigation/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/navigation/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/alerts_viewer/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/alerts_viewer/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/alerts_viewer/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/alerts_viewer/alerts_table.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/alerts_viewer/alerts_table.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/alerts_viewer/alerts_table.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/navigation/alerts_query_tab_body.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/navigation/alerts_query_tab_body.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/signals_by_category/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/signals_by_category/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/navigation/tab_navigation/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/navigation/tab_navigation/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/details/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/details/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/details/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/details/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/details/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/details/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/details/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/details/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/details/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/details/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/details/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/details/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/url_state/initialize_redux_by_url.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/url_state/initialize_redux_by_url.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/search_or_filter.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/search_or_filter.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/search_or_filter.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/index.tsx" + }, + { + "plugin": "urlDrilldown", + "path": "x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts" + }, + { + "plugin": "urlDrilldown", + "path": "x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts" + }, + { + "plugin": "urlDrilldown", + "path": "x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx" + }, + { + "plugin": "urlDrilldown", + "path": "x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/persistence/filter_references.test.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/persistence/filter_references.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/selectors/map_selectors.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/selectors/map_selectors.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.test.ts" + }, + { + "plugin": "discoverEnhanced", + "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts" + }, + { + "plugin": "discoverEnhanced", + "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts" + }, + { + "plugin": "discoverEnhanced", + "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts" + }, + { + "plugin": "urlDrilldown", + "path": "x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts" + }, + { + "plugin": "urlDrilldown", + "path": "x-pack/plugins/drilldowns/url_drilldown/public/lib/test/data.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/embeddable/embeddable.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/embeddable/embeddable.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/migrations/types.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/migrations/types.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/migrations/types.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/migrations/types.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/tooltips/tooltip_property.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/tooltips/tooltip_property.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/tooltips/tooltip_property.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/tooltips/tooltip_property.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/vector_source/vector_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/vector_source/vector_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/actions/map_actions.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/actions/map_actions.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/url_state/global_sync.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/url_state/global_sync.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/url_state/app_state_manager.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/url_state/app_state_manager.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/routes/map_page/url_state/app_state_manager.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/map_container/map_container.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/map_container/map_container.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/mb_map.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/mb_map.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/toolbar_overlay/toolbar_overlay.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/toolbar_overlay/toolbar_overlay.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/tooltip_control.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/tooltip_control.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/tooltip_popover.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/tooltip_popover.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/ueba/pages/details/types.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/ueba/pages/details/types.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/ueba/pages/details/types.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/draw_control/draw_filter_control/draw_filter_control.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/draw_control/draw_filter_control/draw_filter_control.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_geometry_filter_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_geometry_filter_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_properties.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_properties.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_properties.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/features_tooltip/feature_properties.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/features_tooltip/features_tooltip.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/mb_map/tooltip_control/features_tooltip/features_tooltip.d.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/url_generator.test.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/url_generator.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/control.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/control.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/vis_controller.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/vis_controller.tsx" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/types.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/types.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/types.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/types.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/utils/utils.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/utils/utils.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/utils/use/use_linked_search_updates.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/utils/use/use_linked_search_updates.ts" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/timelion_vis_fn.ts" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/timelion_vis_fn.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/move_filters_to_query.test.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/move_filters_to_query.test.ts" + }, + { + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/vega_request_handler.ts" + }, + { + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/vega_request_handler.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/target/types/public/application/types.d.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/target/types/public/application/types.d.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/target/types/public/application/types.d.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/target/types/public/application/types.d.ts" + }, + { + "plugin": "presentationUtil", + "path": "src/plugins/presentation_util/public/components/input_controls/embeddable/types.ts" + }, + { + "plugin": "presentationUtil", + "path": "src/plugins/presentation_util/public/components/input_controls/embeddable/types.ts" + }, + { + "plugin": "presentationUtil", + "path": "src/plugins/presentation_util/public/components/input_controls/embeddable/types.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context_state.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context_state.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context_state.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/types.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/embeddable/types.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/embeddable/types.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/common/elasticsearch_util/types.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/common/elasticsearch_util/types.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_fn.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_fn.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/embeddable/map_component.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/embeddable/map_component.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_fn.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_fn.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/ui_actions/apply_influencer_filters_action.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/ui_actions/apply_influencer_filters_action.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/ui_actions/apply_entity_filters_action.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/ui_actions/apply_entity_filters_action.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_dataset_filtering.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_dataset_filtering.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_dataset_filtering.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/types/index.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/types/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/navigation/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/navigation/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/build_threat_mapping_filter.mock.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/build_threat_mapping_filter.mock.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/server/lib/detection_engine/signals/threat_mapping/build_threat_mapping_filter.mock.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/server/lib/detection_engine/signals/threat_mapping/build_threat_mapping_filter.mock.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.d.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/common/locator.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/common/locator.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/target/types/common/locator.d.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/target/types/common/locator.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_preview/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_preview/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_preview/reducer.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_preview/reducer.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/pages/navigation/alerts_query_tab_body.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/pages/navigation/alerts_query_tab_body.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/details/helpers.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/details/helpers.test.ts" + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IAggConfig", + "type": "Type", + "tags": [ + "name", + "description" + ], + "label": "IAggConfig", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" + } + ], + "path": "src/plugins/data/common/search/aggs/agg_config.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IAggType", + "type": "Type", + "tags": [], + "label": "IAggType", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggType", + "text": "AggType" + }, + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" + }, + ", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggParamType", + "text": "AggParamType" + }, + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" + }, + ">>" + ], + "path": "src/plugins/data/common/search/aggs/agg_type.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IEsSearchResponse", + "type": "Type", + "tags": [], + "label": "IEsSearchResponse", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IKibanaSearchResponse", + "text": "IKibanaSearchResponse" + }, + "<", + "SearchResponse", + ">" + ], + "path": "src/plugins/data/common/search/strategies/es_search/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IFieldParamType", + "type": "Type", + "tags": [], + "label": "IFieldParamType", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.FieldParamType", + "text": "FieldParamType" + } + ], + "path": "src/plugins/data/common/search/aggs/param_types/field.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IFieldSubType", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "IFieldSubType", + "description": [], + "signature": [ + "IFieldSubType" + ], + "path": "src/plugins/data/common/es_query/index.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [ + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/common/types/timeline/columns/index.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/common/types/timeline/columns/index.tsx" + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IMetricAggType", + "type": "Type", + "tags": [], + "label": "IMetricAggType", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.MetricAggType", + "text": "MetricAggType" + }, + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IMetricAggConfig", + "text": "IMetricAggConfig" + }, + ">" + ], + "path": "src/plugins/data/common/search/aggs/metrics/metric_agg_type.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.INDEX_PATTERN_SAVED_OBJECT_TYPE", + "type": "string", + "tags": [ + "deprecated" + ], + "label": "INDEX_PATTERN_SAVED_OBJECT_TYPE", + "description": [], + "signature": [ + "\"index-pattern\"" + ], + "path": "src/plugins/data/common/constants.ts", + "deprecated": true, + "references": [ + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/controls_references.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/controls_references.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/timeseries_references.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/timeseries_references.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/replace_index_pattern_reference.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/replace_index_pattern_reference.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts" + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IndexPatternAttributes", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "IndexPatternAttributes", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + } + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": true, + "references": [ + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/lib/es_service.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/lib/es_service.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/lib/es_service.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" + }, + { + "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/models/job_service/new_job_caps/rollup.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/models/data_recognizer/data_recognizer.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/types.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/types.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_app.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_app.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_route.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_route.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_route.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/common/types/kibana.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/common/types/kibana.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/common/types/kibana.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/common/types/kibana.d.ts" + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IndexPatternListItem", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "IndexPatternListItem", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewListItem", + "text": "DataViewListItem" + } + ], + "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IndexPatternLoadExpressionFunctionDefinition", + "type": "Type", + "tags": [], + "label": "IndexPatternLoadExpressionFunctionDefinition", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"indexPatternLoad\", null, Arguments, Output, ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IndexPatternsContract", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "IndexPatternsContract", + "description": [], + "signature": [ + "{ get: (id: string) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ">; delete: (indexPatternId: string) => Promise<{}>; create: (spec: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + }, + ", skipFetchFields?: boolean) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ">; find: (search: string, size?: number) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + "[]>; ensureDefaultIndexPattern: ", + "EnsureDefaultDataView", + "; getIds: (refresh?: boolean) => Promise; getTitles: (refresh?: boolean) => Promise; getIdsWithTitle: (refresh?: boolean) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewListItem", + "text": "DataViewListItem" + }, + "[]>; clearCache: (id?: string | undefined) => void; getCache: () => Promise<", + "SavedObject", + ">[] | null | undefined>; getDefault: () => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + " | null>; getDefaultId: () => Promise; setDefault: (id: string | null, force?: boolean) => Promise; hasUserIndexPattern: () => Promise; getFieldsForWildcard: (options: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.GetFieldsOptions", + "text": "GetFieldsOptions" + }, + ") => Promise; getFieldsForIndexPattern: (indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + }, + ", options?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.GetFieldsOptions", + "text": "GetFieldsOptions" + }, + " | undefined) => Promise; refreshFields: (indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ") => Promise; fieldArrayToMap: (fields: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + "[], fieldAttrs?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldAttrs", + "text": "FieldAttrs" + }, + " | undefined) => Record; savedObjectToSpec: (savedObject: ", + "SavedObject", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + }, + ">) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + }, + "; createAndSave: (spec: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + }, + ", override?: boolean, skipFetchFields?: boolean) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ">; createSavedObject: (indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ", override?: boolean) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ">; updateSavedObject: (indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ", saveAttempts?: number, ignoreErrors?: boolean) => Promise; }" + ], + "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", + "deprecated": true, + "references": [ + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_index_pattern.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_index_pattern.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/logs/log_source/log_source.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/logs/log_source/log_source.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.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/hydrate_index_pattern.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/helpers/hydrate_index_pattern.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/build_services.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/build_services.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/kibana_services.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_data_grid_columns.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_data_grid_columns.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/actions/columns.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/actions/columns.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/doc/components/doc.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/doc/components/doc.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/anchor.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/anchor.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/types.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/types.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/test_helpers/make_default_services.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/test_helpers/make_default_services.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/utils.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/utils.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable_factory.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable_factory.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/dependency_cache.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/dependency_cache.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/routing/resolvers.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/routing/resolvers.ts" + }, + { + "plugin": "ml", + "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/pages/index_or_search/preconfigured_job_redirect.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/routing/router.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/routing/router.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/ml_context.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/ml_context.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/application.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/application.ts" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/utils.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/utils.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/__mocks__/index_patterns.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/__mocks__/index_patterns.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/routing/router.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/routing/router.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/util/dependency_cache.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/util/dependency_cache.d.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/target/types/public/management/roles/edit_role/edit_role_page.d.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/target/types/public/management/roles/edit_role/edit_role_page.d.ts" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.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": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx" + }, + { + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/helpers/plugin_services.ts" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/helpers/plugin_services.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.test.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.test.ts" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/components/timelion_expression_input_helpers.test.ts" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/components/timelion_expression_input_helpers.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/build_services.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/build_services.d.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/_stubs.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/_stubs.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/doc/components/doc.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/doc/components/doc.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/lazy_load_bundle/index.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/lazy_load_bundle/index.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx" + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.IndexPatternSpec", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "IndexPatternSpec", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + } + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": true, + "references": [ + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts" + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.ISearchGeneric", + "type": "Type", + "tags": [], + "label": "ISearchGeneric", + "description": [], + "signature": [ + " = ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IEsSearchRequest", + "text": "IEsSearchRequest" + }, + ", SearchStrategyResponse extends ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IKibanaSearchResponse", + "text": "IKibanaSearchResponse" + }, + " = ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IEsSearchResponse", + "text": "IEsSearchResponse" + }, + ">(request: SearchStrategyRequest, options?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ISearchOptions", + "text": "ISearchOptions" + }, + " | undefined) => ", + "Observable", + "" + ], + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.ISearchGeneric.$1", + "type": "Uncategorized", + "tags": [], + "label": "request", + "description": [], + "signature": [ + "SearchStrategyRequest" + ], + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.ISearchGeneric.$2", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ISearchOptions", + "text": "ISearchOptions" + }, + " | undefined" + ], + "path": "src/plugins/data/common/search/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.ISearchSource", + "type": "Type", + "tags": [], + "label": "ISearchSource", + "description": [ + "\nsearch source interface" + ], + "signature": [ + "{ create: () => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + "; history: Record[]; setPreferredSearchStrategyId: (searchStrategyId: string) => void; setField: (field: K, value: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + }, + "[K]) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + "; removeField: (field: K) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + "; setFields: (newFields: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + }, + ") => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + "; getId: () => string; getFields: () => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + }, + "; getField: (field: K, recurse?: boolean) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + }, + "[K]; getOwnField: (field: K) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + }, + "[K]; createCopy: () => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + "; createChild: (options?: {}) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + "; setParent: (parent?: Pick<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + ", \"create\" | \"history\" | \"setPreferredSearchStrategyId\" | \"setField\" | \"removeField\" | \"setFields\" | \"getId\" | \"getFields\" | \"getField\" | \"getOwnField\" | \"createCopy\" | \"createChild\" | \"setParent\" | \"getParent\" | \"fetch$\" | \"fetch\" | \"onRequestStart\" | \"getSearchRequestBody\" | \"destroy\" | \"getSerializedFields\" | \"serialize\"> | undefined, options?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceOptions", + "text": "SearchSourceOptions" + }, + ") => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + "; getParent: () => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + " | undefined; fetch$: (options?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ISearchOptions", + "text": "ISearchOptions" + }, + ") => ", + "Observable", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IKibanaSearchResponse", + "text": "IKibanaSearchResponse" + }, + "<", + "SearchResponse", + ">>; fetch: (options?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ISearchOptions", + "text": "ISearchOptions" + }, + ") => Promise<", + "SearchResponse", + ">; onRequestStart: (handler: (searchSource: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + ", options?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ISearchOptions", + "text": "ISearchOptions" + }, + " | undefined) => Promise) => void; getSearchRequestBody: () => any; destroy: () => void; getSerializedFields: (recurse?: boolean) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSourceFields", + "text": "SearchSourceFields" + }, + "; serialize: () => { searchSourceJSON: string; references: ", + "SavedObjectReference", + "[]; }; }" + ], + "path": "src/plugins/data/common/search/search_source/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.KibanaContext", + "type": "Type", + "tags": [], + "label": "KibanaContext", + "description": [], + "signature": [ + "{ type: \"kibana_context\"; } & ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.ExecutionContextSearch", + "text": "ExecutionContextSearch" + } + ], + "path": "src/plugins/data/common/search/expressions/kibana_context_type.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.KueryNode", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "KueryNode", + "description": [], + "signature": [ + "KueryNode" + ], + "path": "src/plugins/data/common/es_query/index.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [ + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/common/types.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/common/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": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/rules_client.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/authorization/types.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/authorization/types.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/authorization/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/authorization/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/authorization/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/authorization/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/authorization/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/client/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/client/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/client/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/client/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/client/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/client/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/client/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/client/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/client/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/client/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/client/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/client/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/client/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/client/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/client/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/client/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/client/utils.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/services/cases/index.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/services/cases/index.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/services/cases/index.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/services/cases/index.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/services/cases/index.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/services/attachments/index.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/server/services/attachments/index.ts" + }, + { + "plugin": "dataEnhanced", + "path": "x-pack/plugins/data_enhanced/server/search/session/types.ts" + }, + { + "plugin": "dataEnhanced", + "path": "x-pack/plugins/data_enhanced/server/search/session/types.ts" + }, + { + "plugin": "dataEnhanced", + "path": "x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts" + }, + { + "plugin": "dataEnhanced", + "path": "x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts" + }, + { + "plugin": "dataEnhanced", + "path": "x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts" + }, + { + "plugin": "dataEnhanced", + "path": "x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts" + }, + { + "plugin": "dataEnhanced", + "path": "x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts" + }, + { + "plugin": "dataEnhanced", + "path": "x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts" + }, + { + "plugin": "dataEnhanced", + "path": "x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts" + }, + { + "plugin": "dataEnhanced", + "path": "x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/target/types/server/authorization/types.d.ts" + }, + { + "plugin": "cases", + "path": "x-pack/plugins/cases/target/types/server/authorization/types.d.ts" + }, + { + "plugin": "dataEnhanced", + "path": "x-pack/plugins/data_enhanced/target/types/server/search/session/types.d.ts" + }, + { + "plugin": "dataEnhanced", + "path": "x-pack/plugins/data_enhanced/target/types/server/search/session/types.d.ts" + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.MatchAllFilter", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "MatchAllFilter", + "description": [], + "signature": [ + "Filter", + " & { meta: ", + "MatchAllFilterMeta", + "; match_all: ", + "QueryDslMatchAllQuery", + "; }" + ], + "path": "src/plugins/data/common/es_query/index.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.ParsedInterval", + "type": "Type", + "tags": [], + "label": "ParsedInterval", + "description": [], + "signature": [ + "{ value: number; unit: ", + "Unit", + "; type: \"calendar\" | \"fixed\"; }" + ], + "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.PhraseFilter", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "PhraseFilter", + "description": [], + "signature": [ + "Filter", + " & { meta: ", + "PhraseFilterMeta", + "; query: { match_phrase?: Record | undefined; match?: Record | undefined; }; }" + ], + "path": "src/plugins/data/common/es_query/index.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.PhrasesFilter", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "PhrasesFilter", + "description": [], + "signature": [ + "Filter", + " & { meta: ", + "PhrasesFilterMeta", + "; query: ", + "QueryDslQueryContainer", + "; }" + ], + "path": "src/plugins/data/common/es_query/index.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.Query", + "type": "Type", + "tags": [], + "label": "Query", + "description": [], + "signature": [ + "{ query: string | { [key: string]: any; }; language: string; }" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/types.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.RangeFilter", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "RangeFilter", + "description": [], + "signature": [ + "Filter", + " & { meta: ", + "RangeFilterMeta", + "; range: { [key: string]: ", + "RangeFilterParams", + "; }; }" + ], + "path": "src/plugins/data/common/es_query/index.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [ + { + "plugin": "discoverEnhanced", + "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts" + }, + { + "plugin": "discoverEnhanced", + "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts" + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.RangeFilterMeta", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "RangeFilterMeta", + "description": [], + "signature": [ + "FilterMeta", + " & { params: ", + "RangeFilterParams", + "; field?: string | undefined; formattedValue?: string | undefined; }" + ], + "path": "src/plugins/data/common/es_query/index.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.RangeFilterParams", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "RangeFilterParams", + "description": [], + "signature": [ + "RangeFilterParams" + ], + "path": "src/plugins/data/common/es_query/index.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [ + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/components/timelion_vis_component.tsx" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/components/timelion_vis_component.tsx" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/legacy/timelion_vis_component.tsx" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/legacy/timelion_vis_component.tsx" + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.RefreshInterval", + "type": "Type", + "tags": [], + "label": "RefreshInterval", + "description": [], + "signature": [ + "{ pause: boolean; value: number; }" + ], + "path": "src/plugins/data/common/query/timefilter/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.TimeRange", + "type": "Type", + "tags": [], + "label": "TimeRange", + "description": [], + "signature": [ + "{ from: string; to: string; mode?: \"absolute\" | \"relative\" | undefined; }" + ], + "path": "src/plugins/data/common/query/timefilter/types.ts", + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [ + { + "parentPluginId": "data", + "id": "def-public.AggGroupLabels", + "type": "Object", + "tags": [], + "label": "AggGroupLabels", + "description": [], + "path": "src/plugins/data/common/search/aggs/agg_groups.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.AggGroupLabels.AggGroupNames.Buckets", + "type": "string", + "tags": [], + "label": "[AggGroupNames.Buckets]", + "description": [], + "path": "src/plugins/data/common/search/aggs/agg_groups.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.AggGroupLabels.AggGroupNames.Metrics", + "type": "string", + "tags": [], + "label": "[AggGroupNames.Metrics]", + "description": [], + "path": "src/plugins/data/common/search/aggs/agg_groups.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.AggGroupLabels.AggGroupNames.None", + "type": "string", + "tags": [], + "label": "[AggGroupNames.None]", + "description": [], + "path": "src/plugins/data/common/search/aggs/agg_groups.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.AggGroupNames", + "type": "Object", + "tags": [], + "label": "AggGroupNames", + "description": [], + "signature": [ + "{ readonly Buckets: \"buckets\"; readonly Metrics: \"metrics\"; readonly None: \"none\"; }" + ], + "path": "src/plugins/data/common/search/aggs/agg_groups.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters", + "type": "Object", + "tags": [ + "deprecated" + ], + "label": "esFilters", + "description": [ + "\nFilter helpers namespace:" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [ + { + "plugin": "discover", + "path": "src/plugins/discover/public/url_generator.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/url_generator.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/url_generator.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/locator.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/locator.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/locator.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_context_url.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_context_url.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/plugin.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/plugin.tsx" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/save_dashboard.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/save_dashboard.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/plugin.tsx" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/plugin.tsx" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/locator.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/locator.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/url_generator.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/url_generator.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/url_generator.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/routes/map_page/url_state/app_sync.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/routes/map_page/url_state/app_sync.ts" + }, + { + "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_app/map_app.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/embeddable/map_embeddable.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/locators.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/locators.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/locators.ts" + }, + { + "plugin": "dashboardEnhanced", + "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" + }, + { + "plugin": "dashboardEnhanced", + "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" + }, + { + "plugin": "dashboardEnhanced", + "path": "x-pack/plugins/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/embeddable_to_dashboard_drilldown.tsx" + }, + { + "plugin": "discoverEnhanced", + "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.ts" + }, + { + "plugin": "discoverEnhanced", + "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/locators.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/locators.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/helpers.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/helpers.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/helpers.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/mocks.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/mocks.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/state_management/time_range_middleware.test.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/state_management/time_range_middleware.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/store/timeline/epic.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/__mocks__/mock.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/__mocks__/mock.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/__mocks__/mock.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/locator.test.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/locator.test.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/url_generator.test.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/url_generator.test.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/utils/use/use_visualize_app_state.tsx" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/utils/use/use_visualize_app_state.tsx" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/plugin.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/plugin.ts" + }, + { + "plugin": "timelion", + "path": "src/plugins/timelion/public/plugin.ts" + }, + { + "plugin": "timelion", + "path": "src/plugins/timelion/public/plugin.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/move_filters_to_query.test.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/move_filters_to_query.test.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/move_filters_to_query.test.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/listing/get_dashboard_list_item_link.test.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/listing/get_dashboard_list_item_link.test.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/utils/get_visualize_list_item_link.test.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/utils/get_visualize_list_item_link.test.ts" + }, + { + "plugin": "presentationUtil", + "path": "src/plugins/presentation_util/public/components/input_controls/control_types/options_list/options_list_embeddable.tsx" + }, + { + "plugin": "presentationUtil", + "path": "src/plugins/presentation_util/public/components/input_controls/control_types/options_list/options_list_embeddable.tsx" + } + ], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.FilterLabel", + "type": "Function", + "tags": [], + "label": "FilterLabel", + "description": [], + "signature": [ + "(props: ", + "FilterLabelProps", + ") => JSX.Element" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.FilterLabel.$1", + "type": "Object", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "FilterLabelProps" + ], + "path": "src/plugins/data/public/ui/filter_bar/index.tsx", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.FilterItem", + "type": "Function", + "tags": [], + "label": "FilterItem", + "description": [], + "signature": [ + "(props: ", + "FilterItemProps", + ") => JSX.Element" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.FilterItem.$1", + "type": "Object", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "FilterItemProps" + ], + "path": "src/plugins/data/public/ui/filter_bar/index.tsx", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.FILTERS", + "type": "Object", + "tags": [], + "label": "FILTERS", + "description": [], + "signature": [ + "typeof ", + "FILTERS" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.FilterStateStore", + "type": "Object", + "tags": [], + "label": "FilterStateStore", + "description": [], + "signature": [ + "typeof ", + "FilterStateStore" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildEmptyFilter", + "type": "Function", + "tags": [], + "label": "buildEmptyFilter", + "description": [], + "signature": [ + "(isPinned: boolean, index?: string | undefined) => ", + "Filter" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildEmptyFilter.$1", + "type": "boolean", + "tags": [], + "label": "isPinned", + "description": [], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/build_empty_filter.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildEmptyFilter.$2", + "type": "string", + "tags": [], + "label": "index", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/build_empty_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildPhrasesFilter", + "type": "Function", + "tags": [], + "label": "buildPhrasesFilter", + "description": [], + "signature": [ + "(field: ", + "DataViewFieldBase", + ", params: ", + "PhraseFilterValue", + "[], indexPattern: ", + "DataViewBase", + ") => ", + "PhrasesFilter" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildPhrasesFilter.$1", + "type": "Object", + "tags": [], + "label": "field", + "description": [], + "signature": [ + "DataViewFieldBase" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrases_filter.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildPhrasesFilter.$2", + "type": "Array", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "PhraseFilterValue", + "[]" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrases_filter.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildPhrasesFilter.$3", + "type": "Object", + "tags": [], + "label": "indexPattern", + "description": [], + "signature": [ + "DataViewBase" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrases_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildExistsFilter", + "type": "Function", + "tags": [], + "label": "buildExistsFilter", + "description": [], + "signature": [ + "(field: ", + "DataViewFieldBase", + ", indexPattern: ", + "DataViewBase", + ") => ", + "ExistsFilter" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildExistsFilter.$1", + "type": "Object", + "tags": [], + "label": "field", + "description": [], + "signature": [ + "DataViewFieldBase" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/exists_filter.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildExistsFilter.$2", + "type": "Object", + "tags": [], + "label": "indexPattern", + "description": [], + "signature": [ + "DataViewBase" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/exists_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildPhraseFilter", + "type": "Function", + "tags": [], + "label": "buildPhraseFilter", + "description": [], + "signature": [ + "(field: ", + "DataViewFieldBase", + ", value: ", + "PhraseFilterValue", + ", indexPattern: ", + "DataViewBase", + ") => ", + "PhraseFilter", + " | ", + "ScriptedPhraseFilter" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildPhraseFilter.$1", + "type": "Object", + "tags": [], + "label": "field", + "description": [], + "signature": [ + "DataViewFieldBase" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrase_filter.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildPhraseFilter.$2", + "type": "CompoundType", + "tags": [], + "label": "value", + "description": [], + "signature": [ + "string | number | boolean" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrase_filter.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildPhraseFilter.$3", + "type": "Object", + "tags": [], + "label": "indexPattern", + "description": [], + "signature": [ + "DataViewBase" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrase_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildQueryFilter", + "type": "Function", + "tags": [], + "label": "buildQueryFilter", + "description": [], + "signature": [ + "(query: (Record & { query_string?: { query: string; } | undefined; }) | undefined, index: string, alias: string) => ", + "QueryStringFilter" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildQueryFilter.$1", + "type": "CompoundType", + "tags": [], + "label": "query", + "description": [], + "signature": [ + "(Record & { query_string?: { query: string; } | undefined; }) | undefined" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/query_string_filter.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildQueryFilter.$2", + "type": "string", + "tags": [], + "label": "index", + "description": [], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/query_string_filter.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildQueryFilter.$3", + "type": "string", + "tags": [], + "label": "alias", + "description": [], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/query_string_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildRangeFilter", + "type": "Function", + "tags": [], + "label": "buildRangeFilter", + "description": [], + "signature": [ + "(field: ", + "DataViewFieldBase", + ", params: ", + "RangeFilterParams", + ", indexPattern: ", + "DataViewBase", + ", formattedValue?: string | undefined) => ", + "RangeFilter", + " | ", + "ScriptedRangeFilter", + " | ", + "MatchAllRangeFilter" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildRangeFilter.$1", + "type": "Object", + "tags": [], + "label": "field", + "description": [], + "signature": [ + "DataViewFieldBase" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/range_filter.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildRangeFilter.$2", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "RangeFilterParams" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/range_filter.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildRangeFilter.$3", + "type": "Object", + "tags": [], + "label": "indexPattern", + "description": [], + "signature": [ + "DataViewBase" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/range_filter.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.buildRangeFilter.$4", + "type": "string", + "tags": [], + "label": "formattedValue", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/range_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.isPhraseFilter", + "type": "Function", + "tags": [], + "label": "isPhraseFilter", + "description": [], + "signature": [ + "(filter: ", + "Filter", + ") => filter is ", + "PhraseFilter" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.isPhraseFilter.$1", + "type": "Object", + "tags": [], + "label": "filter", + "description": [], + "signature": [ + "{ $state?: { store: ", + "FilterStateStore", + "; } | undefined; meta: ", + "FilterMeta", + "; query?: Record | undefined; }" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrase_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.isExistsFilter", + "type": "Function", + "tags": [], + "label": "isExistsFilter", + "description": [], + "signature": [ + "(filter: ", + "Filter", + ") => filter is ", + "ExistsFilter" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.isExistsFilter.$1", + "type": "Object", + "tags": [], + "label": "filter", + "description": [], + "signature": [ + "{ $state?: { store: ", + "FilterStateStore", + "; } | undefined; meta: ", + "FilterMeta", + "; query?: Record | undefined; }" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/exists_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.isPhrasesFilter", + "type": "Function", + "tags": [], + "label": "isPhrasesFilter", + "description": [], + "signature": [ + "(filter: ", + "Filter", + ") => filter is ", + "PhrasesFilter" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.isPhrasesFilter.$1", + "type": "Object", + "tags": [], + "label": "filter", + "description": [], + "signature": [ + "{ $state?: { store: ", + "FilterStateStore", + "; } | undefined; meta: ", + "FilterMeta", + "; query?: Record | undefined; }" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrases_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.isRangeFilter", + "type": "Function", + "tags": [], + "label": "isRangeFilter", + "description": [], + "signature": [ + "(filter?: ", + "Filter", + " | undefined) => filter is ", + "RangeFilter" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.isRangeFilter.$1", + "type": "Object", + "tags": [], + "label": "filter", + "description": [], + "signature": [ + "Filter", + " | undefined" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/range_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.isMatchAllFilter", + "type": "Function", + "tags": [], + "label": "isMatchAllFilter", + "description": [], + "signature": [ + "(filter: ", + "Filter", + ") => filter is ", + "MatchAllFilter" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.isMatchAllFilter.$1", + "type": "Object", + "tags": [], + "label": "filter", + "description": [], + "signature": [ + "{ $state?: { store: ", + "FilterStateStore", + "; } | undefined; meta: ", + "FilterMeta", + "; query?: Record | undefined; }" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/match_all_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.isMissingFilter", + "type": "Function", + "tags": [], + "label": "isMissingFilter", + "description": [], + "signature": [ + "(filter: ", + "Filter", + ") => filter is ", + "MissingFilter" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.isMissingFilter.$1", + "type": "Object", + "tags": [], + "label": "filter", + "description": [], + "signature": [ + "{ $state?: { store: ", + "FilterStateStore", + "; } | undefined; meta: ", + "FilterMeta", + "; query?: Record | undefined; }" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/missing_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.isQueryStringFilter", + "type": "Function", + "tags": [], + "label": "isQueryStringFilter", + "description": [], + "signature": [ + "(filter: ", + "Filter", + ") => filter is ", + "QueryStringFilter" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.isQueryStringFilter.$1", + "type": "Object", + "tags": [], + "label": "filter", + "description": [], + "signature": [ + "{ $state?: { store: ", + "FilterStateStore", + "; } | undefined; meta: ", + "FilterMeta", + "; query?: Record | undefined; }" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/query_string_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.isFilterPinned", + "type": "Function", + "tags": [], + "label": "isFilterPinned", + "description": [], + "signature": [ + "(filter: ", + "Filter", + ") => boolean | undefined" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.isFilterPinned.$1", + "type": "Object", + "tags": [], + "label": "filter", + "description": [], + "signature": [ + "{ $state?: { store: ", + "FilterStateStore", + "; } | undefined; meta: ", + "FilterMeta", + "; query?: Record | undefined; }" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/helpers/meta_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.toggleFilterNegated", + "type": "Function", + "tags": [], + "label": "toggleFilterNegated", + "description": [], + "signature": [ + "(filter: ", + "Filter", + ") => { meta: { negate: boolean; alias?: string | null | undefined; disabled?: boolean | undefined; controlledBy?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; params?: any; value?: string | undefined; }; $state?: { store: ", + "FilterStateStore", + "; } | undefined; query?: Record | undefined; }" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.toggleFilterNegated.$1", + "type": "Object", + "tags": [], + "label": "filter", + "description": [], + "signature": [ + "{ $state?: { store: ", + "FilterStateStore", + "; } | undefined; meta: ", + "FilterMeta", + "; query?: Record | undefined; }" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/helpers/meta_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.disableFilter", + "type": "Function", + "tags": [], + "label": "disableFilter", + "description": [], + "signature": [ + "(filter: ", + "Filter", + ") => ", + "Filter" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.disableFilter.$1", + "type": "Object", + "tags": [], + "label": "filter", + "description": [], + "signature": [ + "{ $state?: { store: ", + "FilterStateStore", + "; } | undefined; meta: ", + "FilterMeta", + "; query?: Record | undefined; }" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/helpers/meta_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.getPhraseFilterField", + "type": "Function", + "tags": [], + "label": "getPhraseFilterField", + "description": [], + "signature": [ + "(filter: ", + "PhraseFilter", + ") => string" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.getPhraseFilterField.$1", + "type": "CompoundType", + "tags": [], + "label": "filter", + "description": [], + "signature": [ + "Filter", + " & { meta: ", + "PhraseFilterMeta", + "; query: { match_phrase?: Record | undefined; match?: Record | undefined; }; }" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrase_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.getPhraseFilterValue", + "type": "Function", + "tags": [], + "label": "getPhraseFilterValue", + "description": [], + "signature": [ + "(filter: ", + "PhraseFilter", + " | ", + "ScriptedPhraseFilter", + ") => ", + "PhraseFilterValue" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.getPhraseFilterValue.$1", + "type": "CompoundType", + "tags": [], + "label": "filter", + "description": [], + "signature": [ + "PhraseFilter", + " | ", + "ScriptedPhraseFilter" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrase_filter.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.getDisplayValueFromFilter", + "type": "Function", + "tags": [], + "label": "getDisplayValueFromFilter", + "description": [], + "signature": [ + "(filter: ", + "Filter", + ", indexPatterns: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IIndexPattern", + "text": "IIndexPattern" + }, + "[]) => string" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.getDisplayValueFromFilter.$1", + "type": "Object", + "tags": [], + "label": "filter", + "description": [], + "signature": [ + "{ $state?: { store: ", + "FilterStateStore", + "; } | undefined; meta: ", + "FilterMeta", + "; query?: Record | undefined; }" + ], + "path": "src/plugins/data/public/query/filter_manager/lib/get_display_value.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.getDisplayValueFromFilter.$2", + "type": "Array", + "tags": [], + "label": "indexPatterns", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IIndexPattern", + "text": "IIndexPattern" + }, + "[]" + ], + "path": "src/plugins/data/public/query/filter_manager/lib/get_display_value.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.compareFilters", + "type": "Function", + "tags": [], + "label": "compareFilters", + "description": [], + "signature": [ + "(first: ", + "Filter", + " | ", + "Filter", + "[], second: ", + "Filter", + " | ", + "Filter", + "[], comparatorOptions?: ", + "FilterCompareOptions", + " | undefined) => boolean" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.compareFilters.$1", + "type": "CompoundType", + "tags": [], + "label": "first", + "description": [], + "signature": [ + "Filter", + " | ", + "Filter", + "[]" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/helpers/compare_filters.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.compareFilters.$2", + "type": "CompoundType", + "tags": [], + "label": "second", + "description": [], + "signature": [ + "Filter", + " | ", + "Filter", + "[]" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/helpers/compare_filters.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.compareFilters.$3", + "type": "Object", + "tags": [], + "label": "comparatorOptions", + "description": [], + "signature": [ + "FilterCompareOptions", + " | undefined" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/helpers/compare_filters.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.COMPARE_ALL_OPTIONS", + "type": "Object", + "tags": [], + "label": "COMPARE_ALL_OPTIONS", + "description": [], + "signature": [ + "FilterCompareOptions" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.generateFilters", + "type": "Function", + "tags": [], + "label": "generateFilters", + "description": [], + "signature": [ + "(filterManager: ", + { + "pluginId": "data", + "scope": "public", + "docId": "kibDataQueryPluginApi", + "section": "def-public.FilterManager", + "text": "FilterManager" + }, + ", field: string | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + ", values: any, operation: string, index: string) => ", + "Filter", + "[]" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.generateFilters.$1", + "type": "Object", + "tags": [], + "label": "filterManager", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "public", + "docId": "kibDataQueryPluginApi", + "section": "def-public.FilterManager", + "text": "FilterManager" + } + ], + "path": "src/plugins/data/public/query/filter_manager/lib/generate_filters.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.generateFilters.$2", + "type": "CompoundType", + "tags": [], + "label": "field", + "description": [], + "signature": [ + "string | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + } + ], + "path": "src/plugins/data/public/query/filter_manager/lib/generate_filters.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.generateFilters.$3", + "type": "Any", + "tags": [], + "label": "values", + "description": [], + "signature": [ + "any" + ], + "path": "src/plugins/data/public/query/filter_manager/lib/generate_filters.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.generateFilters.$4", + "type": "string", + "tags": [], + "label": "operation", + "description": [], + "path": "src/plugins/data/public/query/filter_manager/lib/generate_filters.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.generateFilters.$5", + "type": "string", + "tags": [], + "label": "index", + "description": [], + "path": "src/plugins/data/public/query/filter_manager/lib/generate_filters.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.onlyDisabledFiltersChanged", + "type": "Function", + "tags": [], + "label": "onlyDisabledFiltersChanged", + "description": [], + "signature": [ + "(newFilters?: ", + "Filter", + "[] | undefined, oldFilters?: ", + "Filter", + "[] | undefined) => boolean" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.onlyDisabledFiltersChanged.$1", + "type": "Array", + "tags": [], + "label": "newFilters", + "description": [], + "signature": [ + "Filter", + "[] | undefined" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/helpers/only_disabled.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.onlyDisabledFiltersChanged.$2", + "type": "Array", + "tags": [], + "label": "oldFilters", + "description": [], + "signature": [ + "Filter", + "[] | undefined" + ], + "path": "node_modules/@kbn/es-query/target_types/filters/helpers/only_disabled.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.changeTimeFilter", + "type": "Function", + "tags": [], + "label": "changeTimeFilter", + "description": [], + "signature": [ + "(timeFilter: Pick<", + "Timefilter", + ", \"isTimeRangeSelectorEnabled\" | \"isAutoRefreshSelectorEnabled\" | \"isTimeTouched\" | \"getEnabledUpdated$\" | \"getTimeUpdate$\" | \"getRefreshIntervalUpdate$\" | \"getAutoRefreshFetch$\" | \"getFetch$\" | \"getTime\" | \"getAbsoluteTime\" | \"setTime\" | \"getRefreshInterval\" | \"setRefreshInterval\" | \"createFilter\" | \"getBounds\" | \"calculateBounds\" | \"getActiveBounds\" | \"enableTimeRangeSelector\" | \"disableTimeRangeSelector\" | \"enableAutoRefreshSelector\" | \"disableAutoRefreshSelector\" | \"getTimeDefaults\" | \"getRefreshIntervalDefaults\">, filter: ", + "RangeFilter", + ") => void" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.changeTimeFilter.$1", + "type": "Object", + "tags": [], + "label": "timeFilter", + "description": [], + "signature": [ + "{ isTimeRangeSelectorEnabled: () => boolean; isAutoRefreshSelectorEnabled: () => boolean; isTimeTouched: () => boolean; getEnabledUpdated$: () => ", + "Observable", + "; getTimeUpdate$: () => ", + "Observable", + "; getRefreshIntervalUpdate$: () => ", + "Observable", + "; getAutoRefreshFetch$: () => ", + "Observable", + "<", + { + "pluginId": "data", + "scope": "public", + "docId": "kibDataQueryPluginApi", + "section": "def-public.AutoRefreshDoneFn", + "text": "AutoRefreshDoneFn" + }, + ">; getFetch$: () => ", + "Observable", + "; getTime: () => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, + "; getAbsoluteTime: () => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, + "; setTime: (time: ", + "InputTimeRange", + ") => void; getRefreshInterval: () => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.RefreshInterval", + "text": "RefreshInterval" + }, + "; setRefreshInterval: (refreshInterval: Partial<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.RefreshInterval", + "text": "RefreshInterval" + }, + ">) => void; createFilter: (indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IIndexPattern", + "text": "IIndexPattern" + }, + ", timeRange?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, + " | undefined) => ", + "RangeFilter", + " | ", + "ScriptedRangeFilter", + " | ", + "MatchAllRangeFilter", + " | undefined; getBounds: () => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRangeBounds", + "text": "TimeRangeBounds" + }, + "; calculateBounds: (timeRange: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, + ") => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRangeBounds", + "text": "TimeRangeBounds" + }, + "; getActiveBounds: () => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRangeBounds", + "text": "TimeRangeBounds" + }, + " | undefined; enableTimeRangeSelector: () => void; disableTimeRangeSelector: () => void; enableAutoRefreshSelector: () => void; disableAutoRefreshSelector: () => void; getTimeDefaults: () => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, + "; getRefreshIntervalDefaults: () => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.RefreshInterval", + "text": "RefreshInterval" + }, + "; }" + ], + "path": "src/plugins/data/public/query/timefilter/lib/change_time_filter.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.changeTimeFilter.$2", + "type": "CompoundType", + "tags": [], + "label": "filter", + "description": [], + "signature": [ + "Filter", + " & { meta: ", + "RangeFilterMeta", + "; range: { [key: string]: ", + "RangeFilterParams", + "; }; }" + ], + "path": "src/plugins/data/public/query/timefilter/lib/change_time_filter.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.convertRangeFilterToTimeRangeString", + "type": "Function", + "tags": [], + "label": "convertRangeFilterToTimeRangeString", + "description": [], + "signature": [ + "(filter: ", + "RangeFilter", + ") => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + } + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.convertRangeFilterToTimeRangeString.$1", + "type": "CompoundType", + "tags": [], + "label": "filter", + "description": [], + "signature": [ + "Filter", + " & { meta: ", + "RangeFilterMeta", + "; range: { [key: string]: ", + "RangeFilterParams", + "; }; }" + ], + "path": "src/plugins/data/public/query/timefilter/lib/change_time_filter.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.mapAndFlattenFilters", + "type": "Function", + "tags": [], + "label": "mapAndFlattenFilters", + "description": [], + "signature": [ + "(filters: ", + "Filter", + "[]) => ", + "Filter", + "[]" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.mapAndFlattenFilters.$1", + "type": "Array", + "tags": [], + "label": "filters", + "description": [], + "signature": [ + "Filter", + "[]" + ], + "path": "src/plugins/data/public/query/filter_manager/lib/map_and_flatten_filters.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.extractTimeFilter", + "type": "Function", + "tags": [], + "label": "extractTimeFilter", + "description": [], + "signature": [ + "(timeFieldName: string, filters: ", + "Filter", + "[]) => { restOfFilters: ", + "Filter", + "[]; timeRangeFilter: ", + "RangeFilter", + " | undefined; }" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.extractTimeFilter.$1", + "type": "string", + "tags": [], + "label": "timeFieldName", + "description": [], + "path": "src/plugins/data/public/query/timefilter/lib/extract_time_filter.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.extractTimeFilter.$2", + "type": "Array", + "tags": [], + "label": "filters", + "description": [], + "signature": [ + "Filter", + "[]" + ], + "path": "src/plugins/data/public/query/timefilter/lib/extract_time_filter.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.extractTimeRange", + "type": "Function", + "tags": [], + "label": "extractTimeRange", + "description": [], + "signature": [ + "(filters: ", + "Filter", + "[], timeFieldName?: string | undefined) => { restOfFilters: ", + "Filter", + "[]; timeRange?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, + " | undefined; }" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esFilters.extractTimeRange.$1", + "type": "Array", + "tags": [], + "label": "filters", + "description": [], + "signature": [ + "Filter", + "[]" + ], + "path": "src/plugins/data/public/query/timefilter/lib/extract_time_filter.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esFilters.extractTimeRange.$2", + "type": "string", + "tags": [], + "label": "timeFieldName", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/public/query/timefilter/lib/extract_time_filter.ts", + "deprecated": false + } + ] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.esKuery", + "type": "Object", + "tags": [ + "deprecated" + ], + "label": "esKuery", + "description": [], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [ + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/utils/kuery.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/utils/kuery.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/utils/kuery.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_filters.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_filters.ts" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/search_bar.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/search_bar.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/search_bar.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_search_bar.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_search_bar.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_search_bar.ts" + } + ], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esKuery.nodeTypes", + "type": "Object", + "tags": [], + "label": "nodeTypes", + "description": [], + "signature": [ + "NodeTypes" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esKuery.fromKueryExpression", + "type": "Function", + "tags": [], + "label": "fromKueryExpression", + "description": [], + "signature": [ + "(expression: string | ", + "QueryDslQueryContainer", + ", parseOptions?: Partial<", + "KueryParseOptions", + "> | undefined) => ", + "KueryNode" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esKuery.fromKueryExpression.$1", + "type": "CompoundType", + "tags": [], + "label": "expression", + "description": [], + "signature": [ + "string | ", + "QueryDslQueryContainer" + ], + "path": "node_modules/@kbn/es-query/target_types/kuery/ast/ast.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esKuery.fromKueryExpression.$2", + "type": "Object", + "tags": [], + "label": "parseOptions", + "description": [], + "signature": [ + "Partial<", + "KueryParseOptions", + "> | undefined" + ], + "path": "node_modules/@kbn/es-query/target_types/kuery/ast/ast.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esKuery.toElasticsearchQuery", + "type": "Function", + "tags": [], + "label": "toElasticsearchQuery", + "description": [], + "signature": [ + "(node: ", + "KueryNode", + ", indexPattern?: ", + "DataViewBase", + " | undefined, config?: ", + "KueryQueryOptions", + " | undefined, context?: Record | undefined) => ", + "QueryDslQueryContainer" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esKuery.toElasticsearchQuery.$1", + "type": "Object", + "tags": [], + "label": "node", + "description": [], + "signature": [ + "KueryNode" + ], + "path": "node_modules/@kbn/es-query/target_types/kuery/index.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esKuery.toElasticsearchQuery.$2", + "type": "Object", + "tags": [], + "label": "indexPattern", + "description": [], + "signature": [ + "DataViewBase", + " | undefined" + ], + "path": "node_modules/@kbn/es-query/target_types/kuery/index.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esKuery.toElasticsearchQuery.$3", + "type": "Object", + "tags": [], + "label": "config", + "description": [], + "signature": [ + "KueryQueryOptions", + " | undefined" + ], + "path": "node_modules/@kbn/es-query/target_types/kuery/index.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esKuery.toElasticsearchQuery.$4", + "type": "Object", + "tags": [], + "label": "context", + "description": [], + "signature": [ + "Record | undefined" + ], + "path": "node_modules/@kbn/es-query/target_types/kuery/index.d.ts", + "deprecated": false + } + ] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.esQuery", + "type": "Object", + "tags": [ + "deprecated" + ], + "label": "esQuery", + "description": [], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [ + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/logs/log_stream/index.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/logs/log_stream/index.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/side_panel/network_details/expandable_network.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/side_panel/network_details/expandable_network.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/pages/details/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/pages/details/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/hosts.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/hosts.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/hosts.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/pages/network.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/pages/network.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/pages/network.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/ueba.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/ueba.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/ueba.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/details/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/details/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/flyout/header/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/flyout/header/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/flyout/header/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_tab_content/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/query_tab_content/index.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_search_bar.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_search_bar.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts" + }, + { + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/vega_request_handler.ts" + }, + { + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/vega_request_handler.ts" + }, + { + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/vega_request_handler.ts" + } + ], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esQuery.buildEsQuery", + "type": "Function", + "tags": [], + "label": "buildEsQuery", + "description": [], + "signature": [ + "(indexPattern: ", + "DataViewBase", + " | undefined, queries: ", + "Query", + " | ", + "Query", + "[], filters: ", + "Filter", + " | ", + "Filter", + "[], config?: ", + "EsQueryConfig", + " | undefined) => { bool: ", + "BoolQuery", + "; }" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esQuery.buildEsQuery.$1", + "type": "Object", + "tags": [], + "label": "indexPattern", + "description": [], + "signature": [ + "DataViewBase", + " | undefined" + ], + "path": "node_modules/@kbn/es-query/target_types/es_query/build_es_query.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esQuery.buildEsQuery.$2", + "type": "CompoundType", + "tags": [], + "label": "queries", + "description": [], + "signature": [ + "Query", + " | ", + "Query", + "[]" + ], + "path": "node_modules/@kbn/es-query/target_types/es_query/build_es_query.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esQuery.buildEsQuery.$3", + "type": "CompoundType", + "tags": [], + "label": "filters", + "description": [], + "signature": [ + "Filter", + " | ", + "Filter", + "[]" + ], + "path": "node_modules/@kbn/es-query/target_types/es_query/build_es_query.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esQuery.buildEsQuery.$4", + "type": "CompoundType", + "tags": [], + "label": "config", + "description": [], + "signature": [ + "EsQueryConfig", + " | undefined" + ], + "path": "node_modules/@kbn/es-query/target_types/es_query/build_es_query.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esQuery.getEsQueryConfig", + "type": "Function", + "tags": [], + "label": "getEsQueryConfig", + "description": [], + "signature": [ + "(config: KibanaConfig) => ", + "EsQueryConfig" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esQuery.getEsQueryConfig.$1", + "type": "Object", + "tags": [], + "label": "config", + "description": [], + "signature": [ + "KibanaConfig" + ], + "path": "src/plugins/data/common/es_query/get_es_query_config.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esQuery.buildQueryFromFilters", + "type": "Function", + "tags": [], + "label": "buildQueryFromFilters", + "description": [], + "signature": [ + "(filters: ", + "Filter", + "[] | undefined, indexPattern: ", + "DataViewBase", + " | undefined, ignoreFilterIfFieldNotInIndex?: boolean | undefined) => ", + "BoolQuery" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esQuery.buildQueryFromFilters.$1", + "type": "Array", + "tags": [], + "label": "filters", + "description": [], + "signature": [ + "Filter", + "[] | undefined" + ], + "path": "node_modules/@kbn/es-query/target_types/es_query/from_filters.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esQuery.buildQueryFromFilters.$2", + "type": "Object", + "tags": [], + "label": "indexPattern", + "description": [], + "signature": [ + "DataViewBase", + " | undefined" + ], + "path": "node_modules/@kbn/es-query/target_types/es_query/from_filters.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esQuery.buildQueryFromFilters.$3", + "type": "CompoundType", + "tags": [], + "label": "ignoreFilterIfFieldNotInIndex", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "node_modules/@kbn/es-query/target_types/es_query/from_filters.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esQuery.luceneStringToDsl", + "type": "Function", + "tags": [], + "label": "luceneStringToDsl", + "description": [], + "signature": [ + "(query: string | ", + "QueryDslQueryContainer", + ") => ", + "QueryDslQueryContainer" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esQuery.luceneStringToDsl.$1", + "type": "CompoundType", + "tags": [], + "label": "query", + "description": [], + "signature": [ + "string | ", + "QueryDslQueryContainer" + ], + "path": "node_modules/@kbn/es-query/target_types/es_query/lucene_string_to_dsl.d.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.esQuery.decorateQuery", + "type": "Function", + "tags": [], + "label": "decorateQuery", + "description": [], + "signature": [ + "(query: ", + "QueryDslQueryContainer", + ", queryStringOptions: string | ", + "SerializableRecord", + ", dateFormatTZ?: string | undefined) => ", + "QueryDslQueryContainer" + ], + "path": "src/plugins/data/public/deprecated.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.esQuery.decorateQuery.$1", + "type": "Object", + "tags": [], + "label": "query", + "description": [], + "signature": [ + "QueryDslQueryContainer" + ], + "path": "node_modules/@kbn/es-query/target_types/es_query/decorate_query.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esQuery.decorateQuery.$2", + "type": "CompoundType", + "tags": [], + "label": "queryStringOptions", + "description": [], + "signature": [ + "string | ", + "SerializableRecord" + ], + "path": "node_modules/@kbn/es-query/target_types/es_query/decorate_query.d.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.esQuery.decorateQuery.$3", + "type": "string", + "tags": [], + "label": "dateFormatTZ", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "node_modules/@kbn/es-query/target_types/es_query/decorate_query.d.ts", + "deprecated": false + } + ] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.exporters", + "type": "Object", + "tags": [], + "label": "exporters", + "description": [], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.exporters.datatableToCSV", + "type": "Function", + "tags": [], + "label": "datatableToCSV", + "description": [], + "signature": [ + "({ columns, rows }: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.Datatable", + "text": "Datatable" + }, + ", { csvSeparator, quoteValues, formatFactory, raw, escapeFormulaValues }: CSVOptions) => string" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.exporters.datatableToCSV.$1", + "type": "Object", + "tags": [], + "label": "__0", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.Datatable", + "text": "Datatable" + } + ], + "path": "src/plugins/data/common/exports/export_csv.tsx", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.exporters.datatableToCSV.$2", + "type": "Object", + "tags": [], + "label": "__1", + "description": [], + "signature": [ + "CSVOptions" + ], + "path": "src/plugins/data/common/exports/export_csv.tsx", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.exporters.CSV_MIME_TYPE", + "type": "string", + "tags": [], + "label": "CSV_MIME_TYPE", + "description": [], + "path": "src/plugins/data/public/index.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.exporters.cellHasFormulas", + "type": "Function", + "tags": [], + "label": "cellHasFormulas", + "description": [], + "signature": [ + "(val: string) => boolean" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.exporters.cellHasFormulas.$1", + "type": "string", + "tags": [], + "label": "val", + "description": [], + "path": "src/plugins/data/common/exports/formula_checks.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.exporters.tableHasFormulas", + "type": "Function", + "tags": [], + "label": "tableHasFormulas", + "description": [], + "signature": [ + "(columns: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableColumn", + "text": "DatatableColumn" + }, + "[], rows: Record[]) => boolean" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.exporters.tableHasFormulas.$1", + "type": "Array", + "tags": [], + "label": "columns", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableColumn", + "text": "DatatableColumn" + }, + "[]" + ], + "path": "src/plugins/data/common/exports/formula_checks.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.exporters.tableHasFormulas.$2", + "type": "Array", + "tags": [], + "label": "rows", + "description": [], + "signature": [ + "Record[]" + ], + "path": "src/plugins/data/common/exports/formula_checks.ts", + "deprecated": false + } + ] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.indexPatterns", + "type": "Object", + "tags": [], + "label": "indexPatterns", + "description": [], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.indexPatterns.ILLEGAL_CHARACTERS_KEY", + "type": "string", + "tags": [], + "label": "ILLEGAL_CHARACTERS_KEY", + "description": [], + "path": "src/plugins/data/public/index.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.indexPatterns.CONTAINS_SPACES_KEY", + "type": "string", + "tags": [], + "label": "CONTAINS_SPACES_KEY", + "description": [], + "path": "src/plugins/data/public/index.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.indexPatterns.ILLEGAL_CHARACTERS_VISIBLE", + "type": "Array", + "tags": [], + "label": "ILLEGAL_CHARACTERS_VISIBLE", + "description": [], + "signature": [ + "string[]" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.indexPatterns.ILLEGAL_CHARACTERS", + "type": "Array", + "tags": [], + "label": "ILLEGAL_CHARACTERS", + "description": [], + "signature": [ + "string[]" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.indexPatterns.isDefault", + "type": "Function", + "tags": [], + "label": "isDefault", + "description": [], + "signature": [ + "(indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IIndexPattern", + "text": "IIndexPattern" + }, + ") => boolean" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.indexPatterns.isDefault.$1", + "type": "Object", + "tags": [], + "label": "indexPattern", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IIndexPattern", + "text": "IIndexPattern" + } + ], + "path": "src/plugins/data/common/index_patterns/lib/is_default.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.indexPatterns.isFilterable", + "type": "Function", + "tags": [], + "label": "isFilterable", + "description": [], + "signature": [ + "(field: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + ") => boolean" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.indexPatterns.isFilterable.$1", + "type": "Object", + "tags": [], + "label": "field", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + } + ], + "path": "src/plugins/data/common/index_patterns/fields/utils.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.indexPatterns.isNestedField", + "type": "Function", + "tags": [], + "label": "isNestedField", + "description": [], + "signature": [ + "(field: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + ") => boolean" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.indexPatterns.isNestedField.$1", + "type": "Object", + "tags": [], + "label": "field", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + } + ], + "path": "src/plugins/data/common/index_patterns/fields/utils.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.indexPatterns.validate", + "type": "Function", + "tags": [], + "label": "validate", + "description": [], + "signature": [ + "(indexPattern: string) => Record" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.indexPatterns.validate.$1", + "type": "string", + "tags": [], + "label": "indexPattern", + "description": [], + "path": "src/plugins/data/common/index_patterns/lib/validate_index_pattern.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.indexPatterns.flattenHitWrapper", + "type": "Function", + "tags": [], + "label": "flattenHitWrapper", + "description": [], + "signature": [ + "(indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ", metaFields?: {}, cache?: WeakMap) => (hit: Record, deep?: boolean) => Record" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.indexPatterns.flattenHitWrapper.$1", + "type": "Object", + "tags": [], + "label": "indexPattern", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + } + ], + "path": "src/plugins/data/common/index_patterns/index_patterns/flatten_hit.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.indexPatterns.flattenHitWrapper.$2", + "type": "Object", + "tags": [], + "label": "metaFields", + "description": [], + "signature": [ + "{}" + ], + "path": "src/plugins/data/common/index_patterns/index_patterns/flatten_hit.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.indexPatterns.flattenHitWrapper.$3", + "type": "Object", + "tags": [], + "label": "cache", + "description": [], + "signature": [ + "WeakMap" + ], + "path": "src/plugins/data/common/index_patterns/index_patterns/flatten_hit.ts", + "deprecated": false + } + ] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.search", + "type": "Object", + "tags": [], + "label": "search", + "description": [], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.aggs", + "type": "Object", + "tags": [], + "label": "aggs", + "description": [], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.aggs.CidrMask", + "type": "Object", + "tags": [], + "label": "CidrMask", + "description": [], + "signature": [ + "typeof ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.CidrMask", + "text": "CidrMask" + } + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.dateHistogramInterval", + "type": "Function", + "tags": [], + "label": "dateHistogramInterval", + "description": [], + "signature": [ + "(interval: string) => Interval" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.aggs.dateHistogramInterval.$1", + "type": "string", + "tags": [], + "label": "interval", + "description": [], + "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/date_histogram_interval.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.intervalOptions", + "type": "Array", + "tags": [], + "label": "intervalOptions", + "description": [], + "signature": [ + "({ display: string; val: string; enabled(agg: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IBucketAggConfig", + "text": "IBucketAggConfig" + }, + "): boolean; } | { display: string; val: string; })[]" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.InvalidEsCalendarIntervalError", + "type": "Object", + "tags": [], + "label": "InvalidEsCalendarIntervalError", + "description": [], + "signature": [ + "typeof ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.InvalidEsCalendarIntervalError", + "text": "InvalidEsCalendarIntervalError" + } + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.InvalidEsIntervalFormatError", + "type": "Object", + "tags": [], + "label": "InvalidEsIntervalFormatError", + "description": [], + "signature": [ + "typeof ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.InvalidEsIntervalFormatError", + "text": "InvalidEsIntervalFormatError" + } + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.IpAddress", + "type": "Object", + "tags": [], + "label": "IpAddress", + "description": [], + "signature": [ + "typeof ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IpAddress", + "text": "IpAddress" + } + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.isDateHistogramBucketAggConfig", + "type": "Function", + "tags": [], + "label": "isDateHistogramBucketAggConfig", + "description": [], + "signature": [ + "(agg: any) => agg is ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IBucketDateHistogramAggConfig", + "text": "IBucketDateHistogramAggConfig" + } + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.aggs.isDateHistogramBucketAggConfig.$1", + "type": "Any", + "tags": [], + "label": "agg", + "description": [], + "signature": [ + "any" + ], + "path": "src/plugins/data/common/search/aggs/buckets/date_histogram.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.isNumberType", + "type": "Function", + "tags": [], + "label": "isNumberType", + "description": [], + "signature": [ + "(agg: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" + }, + ") => boolean" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.aggs.isNumberType.$1", + "type": "Object", + "tags": [], + "label": "agg", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" + } + ], + "path": "src/plugins/data/common/search/aggs/buckets/migrate_include_exclude_format.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.isStringType", + "type": "Function", + "tags": [], + "label": "isStringType", + "description": [], + "signature": [ + "(agg: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" + }, + ") => boolean" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.aggs.isStringType.$1", + "type": "Object", + "tags": [], + "label": "agg", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" + } + ], + "path": "src/plugins/data/common/search/aggs/buckets/migrate_include_exclude_format.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.isType", + "type": "Function", + "tags": [], + "label": "isType", + "description": [], + "signature": [ + "(...types: string[]) => (agg: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" + }, + ") => boolean" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.aggs.isType.$1", + "type": "Array", + "tags": [], + "label": "types", + "description": [], + "signature": [ + "string[]" + ], + "path": "src/plugins/data/common/search/aggs/buckets/migrate_include_exclude_format.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.isValidEsInterval", + "type": "Function", + "tags": [], + "label": "isValidEsInterval", + "description": [], + "signature": [ + "(interval: string) => boolean" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.aggs.isValidEsInterval.$1", + "type": "string", + "tags": [], + "label": "interval", + "description": [], + "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/is_valid_es_interval.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.isValidInterval", + "type": "Function", + "tags": [], + "label": "isValidInterval", + "description": [], + "signature": [ + "(value: string, baseInterval?: string | undefined) => boolean" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.aggs.isValidInterval.$1", + "type": "string", + "tags": [], + "label": "value", + "description": [], + "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/is_valid_interval.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.isValidInterval.$2", + "type": "string", + "tags": [], + "label": "baseInterval", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/is_valid_interval.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.parentPipelineType", + "type": "string", + "tags": [], + "label": "parentPipelineType", + "description": [], + "path": "src/plugins/data/public/index.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.parseEsInterval", + "type": "Function", + "tags": [], + "label": "parseEsInterval", + "description": [], + "signature": [ + "(interval: string) => { value: number; unit: ", + "Unit", + "; type: \"calendar\" | \"fixed\"; }" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.aggs.parseEsInterval.$1", + "type": "string", + "tags": [], + "label": "interval", + "description": [], + "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_es_interval.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.parseInterval", + "type": "Function", + "tags": [], + "label": "parseInterval", + "description": [], + "signature": [ + "(interval: string) => moment.Duration | null" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.aggs.parseInterval.$1", + "type": "string", + "tags": [], + "label": "interval", + "description": [], + "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/parse_interval.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.propFilter", + "type": "Function", + "tags": [], + "label": "propFilter", + "description": [], + "signature": [ + "

(prop: P) => (list: T[], filters?: string | string[] | FilterFunc) => T[]" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.aggs.propFilter.$1", + "type": "Uncategorized", + "tags": [], + "label": "prop", + "description": [], + "signature": [ + "P" + ], + "path": "src/plugins/data/common/search/aggs/utils/prop_filter.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.siblingPipelineType", + "type": "string", + "tags": [], + "label": "siblingPipelineType", + "description": [], + "path": "src/plugins/data/public/index.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.termsAggFilter", + "type": "Array", + "tags": [], + "label": "termsAggFilter", + "description": [], + "signature": [ + "string[]" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.toAbsoluteDates", + "type": "Function", + "tags": [], + "label": "toAbsoluteDates", + "description": [], + "signature": [ + "(range: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, + ") => { from: Date; to: Date; } | undefined" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.aggs.toAbsoluteDates.$1", + "type": "Object", + "tags": [], + "label": "range", + "description": [], + "signature": [ + "{ from: string; to: string; mode?: \"absolute\" | \"relative\" | undefined; }" + ], + "path": "src/plugins/data/common/search/aggs/utils/date_interval_utils/to_absolute_dates.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.boundsDescendingRaw", + "type": "Array", + "tags": [], + "label": "boundsDescendingRaw", + "description": [], + "signature": [ + "({ bound: number; interval: moment.Duration; boundLabel: string; intervalLabel: string; } | { bound: moment.Duration; interval: moment.Duration; boundLabel: string; intervalLabel: string; })[]" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.getNumberHistogramIntervalByDatatableColumn", + "type": "Function", + "tags": [], + "label": "getNumberHistogramIntervalByDatatableColumn", + "description": [], + "signature": [ + "(column: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableColumn", + "text": "DatatableColumn" + }, + ") => number | undefined" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.aggs.getNumberHistogramIntervalByDatatableColumn.$1", + "type": "Object", + "tags": [], + "label": "column", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableColumn", + "text": "DatatableColumn" + } + ], + "path": "src/plugins/data/common/search/aggs/utils/get_number_histogram_interval.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.getDateHistogramMetaDataByDatatableColumn", + "type": "Function", + "tags": [], + "label": "getDateHistogramMetaDataByDatatableColumn", + "description": [], + "signature": [ + "(column: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableColumn", + "text": "DatatableColumn" + }, + ", defaults?: Partial<{ timeZone: string; }>) => { interval: string | undefined; timeZone: string | undefined; timeRange: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataQueryPluginApi", + "section": "def-common.TimeRange", + "text": "TimeRange" + }, + " | undefined; } | undefined" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.aggs.getDateHistogramMetaDataByDatatableColumn.$1", + "type": "Object", + "tags": [], + "label": "column", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DatatableColumn", + "text": "DatatableColumn" + } + ], + "path": "src/plugins/data/common/search/aggs/utils/get_date_histogram_meta.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.search.aggs.getDateHistogramMetaDataByDatatableColumn.$2", + "type": "Object", + "tags": [], + "label": "defaults", + "description": [], + "signature": [ + "{ timeZone?: string | undefined; }" + ], + "path": "src/plugins/data/common/search/aggs/utils/get_date_histogram_meta.ts", + "deprecated": false + } + ] + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.search.getResponseInspectorStats", + "type": "Function", + "tags": [], + "label": "getResponseInspectorStats", + "description": [], + "signature": [ + "(resp?: ", + "SearchResponse", + " | undefined, searchSource?: Pick<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + ", \"create\" | \"history\" | \"setPreferredSearchStrategyId\" | \"setField\" | \"removeField\" | \"setFields\" | \"getId\" | \"getFields\" | \"getField\" | \"getOwnField\" | \"createCopy\" | \"createChild\" | \"setParent\" | \"getParent\" | \"fetch$\" | \"fetch\" | \"onRequestStart\" | \"getSearchRequestBody\" | \"destroy\" | \"getSerializedFields\" | \"serialize\"> | undefined) => ", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.RequestStatistics", + "text": "RequestStatistics" + } + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.getResponseInspectorStats.$1", + "type": "Object", + "tags": [], + "label": "resp", + "description": [], + "signature": [ + "SearchResponse", + " | undefined" + ], + "path": "src/plugins/data/common/search/search_source/inspect/inspector_stats.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.search.getResponseInspectorStats.$2", + "type": "Object", + "tags": [], + "label": "searchSource", + "description": [], + "signature": [ + "Pick<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.SearchSource", + "text": "SearchSource" + }, + ", \"create\" | \"history\" | \"setPreferredSearchStrategyId\" | \"setField\" | \"removeField\" | \"setFields\" | \"getId\" | \"getFields\" | \"getField\" | \"getOwnField\" | \"createCopy\" | \"createChild\" | \"setParent\" | \"getParent\" | \"fetch$\" | \"fetch\" | \"onRequestStart\" | \"getSearchRequestBody\" | \"destroy\" | \"getSerializedFields\" | \"serialize\"> | undefined" + ], + "path": "src/plugins/data/common/search/search_source/inspect/inspector_stats.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.search.tabifyAggResponse", + "type": "Function", + "tags": [], + "label": "tabifyAggResponse", + "description": [], + "signature": [ + "(aggConfigs: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfigs", + "text": "AggConfigs" + }, + ", esResponse: Record, respOpts?: Partial<", + "TabbedResponseWriterOptions", + "> | undefined) => ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.Datatable", + "text": "Datatable" + } + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.tabifyAggResponse.$1", + "type": "Object", + "tags": [], + "label": "aggConfigs", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfigs", + "text": "AggConfigs" + } + ], + "path": "src/plugins/data/common/search/tabify/tabify.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.search.tabifyAggResponse.$2", + "type": "Object", + "tags": [], + "label": "esResponse", + "description": [], + "signature": [ + "{ [x: string]: any; }" + ], + "path": "src/plugins/data/common/search/tabify/tabify.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.search.tabifyAggResponse.$3", + "type": "Object", + "tags": [], + "label": "respOpts", + "description": [], + "signature": [ + "Partial<", + "TabbedResponseWriterOptions", + "> | undefined" + ], + "path": "src/plugins/data/common/search/tabify/tabify.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "data", + "id": "def-public.search.tabifyGetColumns", + "type": "Function", + "tags": [], + "label": "tabifyGetColumns", + "description": [], + "signature": [ + "(aggs: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" + }, + "[], minimalColumns: boolean) => ", + "TabbedAggColumn", + "[]" + ], + "path": "src/plugins/data/public/index.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "data", + "id": "def-public.search.tabifyGetColumns.$1", + "type": "Array", + "tags": [], + "label": "aggs", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.AggConfig", + "text": "AggConfig" + }, + "[]" + ], + "path": "src/plugins/data/common/search/tabify/get_columns.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-public.search.tabifyGetColumns.$2", + "type": "boolean", + "tags": [], + "label": "minimalColumns", + "description": [], + "path": "src/plugins/data/common/search/tabify/get_columns.ts", + "deprecated": false + } + ] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-public.UI_SETTINGS", + "type": "Object", + "tags": [], + "label": "UI_SETTINGS", + "description": [], + "signature": [ + "{ readonly META_FIELDS: \"metaFields\"; readonly DOC_HIGHLIGHT: \"doc_table:highlight\"; readonly QUERY_STRING_OPTIONS: \"query:queryString:options\"; readonly QUERY_ALLOW_LEADING_WILDCARDS: \"query:allowLeadingWildcards\"; readonly SEARCH_QUERY_LANGUAGE: \"search:queryLanguage\"; readonly SORT_OPTIONS: \"sort:options\"; readonly COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX: \"courier:ignoreFilterIfFieldNotInIndex\"; readonly COURIER_SET_REQUEST_PREFERENCE: \"courier:setRequestPreference\"; readonly COURIER_CUSTOM_REQUEST_PREFERENCE: \"courier:customRequestPreference\"; readonly COURIER_MAX_CONCURRENT_SHARD_REQUESTS: \"courier:maxConcurrentShardRequests\"; readonly SEARCH_INCLUDE_FROZEN: \"search:includeFrozen\"; readonly SEARCH_TIMEOUT: \"search:timeout\"; readonly HISTOGRAM_BAR_TARGET: \"histogram:barTarget\"; readonly HISTOGRAM_MAX_BARS: \"histogram:maxBars\"; readonly HISTORY_LIMIT: \"history:limit\"; readonly TIMEPICKER_REFRESH_INTERVAL_DEFAULTS: \"timepicker:refreshIntervalDefaults\"; readonly TIMEPICKER_QUICK_RANGES: \"timepicker:quickRanges\"; readonly TIMEPICKER_TIME_DEFAULTS: \"timepicker:timeDefaults\"; readonly FILTERS_PINNED_BY_DEFAULT: \"filters:pinnedByDefault\"; readonly FILTERS_EDITOR_SUGGEST_VALUES: \"filterEditor:suggestValues\"; readonly AUTOCOMPLETE_USE_TIMERANGE: \"autocomplete:useTimeRange\"; readonly AUTOCOMPLETE_VALUE_SUGGESTION_METHOD: \"autocomplete:valueSuggestionMethod\"; }" + ], + "path": "src/plugins/data/common/constants.ts", + "deprecated": false, + "initialIsOpen": false + } + ], + "setup": { + "parentPluginId": "data", + "id": "def-public.DataPublicPluginSetup", + "type": "Interface", + "tags": [], + "label": "DataPublicPluginSetup", + "description": [ + "\nData plugin public Setup contract" ], "path": "src/plugins/data/public/types.ts", "deprecated": false, @@ -21924,37 +23360,19 @@ "id": "def-public.DataPublicPluginSetup.search", "type": "Object", "tags": [], - "label": "search", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "public", - "docId": "kibDataSearchPluginApi", - "section": "def-public.ISearchSetup", - "text": "ISearchSetup" - } - ], - "path": "src/plugins/data/public/types.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-public.DataPublicPluginSetup.fieldFormats", - "type": "Object", - "tags": [ - "deprecated" - ], - "label": "fieldFormats", + "label": "search", "description": [], "signature": [ - "{ register: (fieldFormats: ", - "FieldFormatInstanceType", - "[]) => void; has: (id: string) => boolean; }" + { + "pluginId": "data", + "scope": "public", + "docId": "kibDataSearchPluginApi", + "section": "def-public.ISearchSetup", + "text": "ISearchSetup" + } ], "path": "src/plugins/data/public/types.ts", - "deprecated": true, - "references": [] + "deprecated": false }, { "parentPluginId": "data", @@ -22063,12 +23481,12 @@ }, { "parentPluginId": "data", - "id": "def-public.DataPublicPluginStart.indexPatterns", + "id": "def-public.DataPublicPluginStart.dataViews", "type": "Object", "tags": [], - "label": "indexPatterns", + "label": "dataViews", "description": [ - "\nindex patterns service\n{@link IndexPatternsContract}" + "\ndata views service\n{@link DataViewsContract}" ], "signature": [ "{ get: (id: string) => Promise<", @@ -22076,42 +23494,42 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, ">; delete: (indexPatternId: string) => Promise<{}>; create: (spec: ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" }, ", skipFetchFields?: boolean) => Promise<", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, ">; find: (search: string, size?: number) => Promise<", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, "[]>; ensureDefaultIndexPattern: ", - "EnsureDefaultIndexPattern", + "EnsureDefaultDataView", "; getIds: (refresh?: boolean) => Promise; getTitles: (refresh?: boolean) => Promise; getIdsWithTitle: (refresh?: boolean) => Promise<", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternListItem", - "text": "IndexPatternListItem" + "section": "def-common.DataViewListItem", + "text": "DataViewListItem" }, "[]>; clearCache: (id?: string | undefined) => void; getCache: () => Promise<", "SavedObject", @@ -22120,16 +23538,16 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternAttributes", - "text": "IndexPatternAttributes" + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" }, ", \"type\" | \"title\" | \"typeMeta\">>[] | null | undefined>; getDefault: () => Promise<", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, " | null>; getDefaultId: () => Promise; setDefault: (id: string | null, force?: boolean) => Promise; hasUserIndexPattern: () => Promise; getFieldsForWildcard: (options: ", { @@ -22144,16 +23562,16 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, " | ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" }, ", options?: ", { @@ -22168,8 +23586,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, ") => Promise; fieldArrayToMap: (fields: ", { @@ -22202,62 +23620,727 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternAttributes", - "text": "IndexPatternAttributes" + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" }, ">) => ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" }, "; createAndSave: (spec: ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" }, ", override?: boolean, skipFetchFields?: boolean) => Promise<", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, ">; createSavedObject: (indexPattern: ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, ", override?: boolean) => Promise<", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, ">; updateSavedObject: (indexPattern: ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, ", saveAttempts?: number, ignoreErrors?: boolean) => Promise; }" ], "path": "src/plugins/data/public/types.ts", "deprecated": false }, + { + "parentPluginId": "data", + "id": "def-public.DataPublicPluginStart.indexPatterns", + "type": "Object", + "tags": [ + "deprecated" + ], + "label": "indexPatterns", + "description": [ + "\nindex patterns service\n{@link DataViewsContract}" + ], + "signature": [ + "{ get: (id: string) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ">; delete: (indexPatternId: string) => Promise<{}>; create: (spec: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + }, + ", skipFetchFields?: boolean) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ">; find: (search: string, size?: number) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + "[]>; ensureDefaultIndexPattern: ", + "EnsureDefaultDataView", + "; getIds: (refresh?: boolean) => Promise; getTitles: (refresh?: boolean) => Promise; getIdsWithTitle: (refresh?: boolean) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewListItem", + "text": "DataViewListItem" + }, + "[]>; clearCache: (id?: string | undefined) => void; getCache: () => Promise<", + "SavedObject", + ">[] | null | undefined>; getDefault: () => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + " | null>; getDefaultId: () => Promise; setDefault: (id: string | null, force?: boolean) => Promise; hasUserIndexPattern: () => Promise; getFieldsForWildcard: (options: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.GetFieldsOptions", + "text": "GetFieldsOptions" + }, + ") => Promise; getFieldsForIndexPattern: (indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + }, + ", options?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.GetFieldsOptions", + "text": "GetFieldsOptions" + }, + " | undefined) => Promise; refreshFields: (indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ") => Promise; fieldArrayToMap: (fields: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + "[], fieldAttrs?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldAttrs", + "text": "FieldAttrs" + }, + " | undefined) => Record; savedObjectToSpec: (savedObject: ", + "SavedObject", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + }, + ">) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + }, + "; createAndSave: (spec: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + }, + ", override?: boolean, skipFetchFields?: boolean) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ">; createSavedObject: (indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ", override?: boolean) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ">; updateSavedObject: (indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ", saveAttempts?: number, ignoreErrors?: boolean) => Promise; }" + ], + "path": "src/plugins/data/public/types.ts", + "deprecated": true, + "references": [ + { + "plugin": "home", + "path": "src/plugins/home/public/plugin.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/plugin.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/roles/roles_management_app.tsx" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/plugin.ts" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/plugin.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/build_services.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/source_viewer/source_viewer.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_route.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_route.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_route.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/plugin.tsx" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/plugin.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/dashboard_router.tsx" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/dashboard_router.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/plugin.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/plugin.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/pages/alerts/index.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/kibana_services.ts" + }, + { + "plugin": "fileUpload", + "path": "x-pack/plugins/file_upload/public/kibana_services.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/file_data_visualizer/file_data_visualizer.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/index_data_visualizer.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/datavisualizer/file_based/file_datavisualizer.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/app.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/app.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/import_export_jobs/import_jobs_flyout/import_jobs_flyout.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/editor.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/components/log_stream/log_stream.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/components/log_stream/log_stream.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/utils/logs_overview_fetchers.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/hooks/use_kibana_index_patterns.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/logs/page_providers.tsx" + }, + { + "plugin": "fleet", + "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/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/plugin.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/plugin.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_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/expressions/boundary_index_expression.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/use_search_items.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/transform_management/components/action_clone/use_clone_action.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/transform_management/components/action_discover/use_action_discover.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/edit_transform_flyout_form.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/transform_management/components/action_edit/use_edit_action.tsx" + }, + { + "plugin": "upgradeAssistant", + "path": "x-pack/plugins/upgrade_assistant/public/application/components/overview/fix_deprecation_logs_step/external_links.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/plugin.tsx" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/plugin.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/list_control_factory.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/range_control_factory.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/controls_tab.tsx" + }, + { + "plugin": "kibanaOverview", + "path": "src/plugins/kibana_overview/public/components/overview/overview.tsx" + }, + { + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/public/management_section/saved_objects_table_page.tsx" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/components/visualize_top_nav.tsx" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/components/visualize_top_nav.tsx" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/plugin.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/plugin.ts" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/plugin.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/lib/fetch_fields.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/combo_box_select.tsx" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/query_bar_wrapper.tsx" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/annotation_row.tsx" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/metrics_type.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/timeseries_visualization.tsx" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/timeseries_visualization.tsx" + }, + { + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/data_model/search_api.ts" + }, + { + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/vega_request_handler.ts" + }, + { + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts" + }, + { + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/data_model/search_api.test.ts" + }, + { + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/data_model/search_api.test.ts" + }, + { + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/data_model/search_api.test.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/utils/logs_overview_fetches.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/mock/endpoint/dependencies_start_mock.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": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/vega_view/vega_map_view/view.test.ts" + } + ] + }, { "parentPluginId": "data", "id": "def-public.DataPublicPluginStart.search", @@ -22394,18 +24477,18 @@ "plugin": "indexPatternManagement", "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" }, - { - "plugin": "visTypeMetric", - "path": "src/plugins/vis_type_metric/public/plugin.ts" - }, { "plugin": "visTypeTable", - "path": "src/plugins/vis_type_table/public/plugin.ts" + "path": "src/plugins/vis_types/table/public/plugin.ts" }, { "plugin": "visTypeTimeseries", "path": "src/plugins/vis_type_timeseries/public/plugin.ts" }, + { + "plugin": "visTypeMetric", + "path": "src/plugins/vis_types/metric/public/plugin.ts" + }, { "plugin": "visTypePie", "path": "src/plugins/vis_types/pie/public/pie_component.tsx" @@ -22600,4484 +24683,4860 @@ "classes": [ { "parentPluginId": "data", - "id": "def-server.DataServerPlugin", + "id": "def-server.DataServerPlugin", + "type": "Class", + "tags": [], + "label": "DataServerPlugin", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "server", + "docId": "kibDataPluginApi", + "section": "def-server.DataServerPlugin", + "text": "DataServerPlugin" + }, + " implements ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.Plugin", + "text": "Plugin" + }, + "<", + { + "pluginId": "data", + "scope": "server", + "docId": "kibDataPluginApi", + "section": "def-server.DataPluginSetup", + "text": "DataPluginSetup" + }, + ", ", + { + "pluginId": "data", + "scope": "server", + "docId": "kibDataPluginApi", + "section": "def-server.DataPluginStart", + "text": "DataPluginStart" + }, + ", ", + "DataPluginSetupDependencies", + ", ", + "DataPluginStartDependencies", + ">" + ], + "path": "src/plugins/data/server/plugin.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-server.DataServerPlugin.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "src/plugins/data/server/plugin.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-server.DataServerPlugin.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "initializerContext", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.PluginInitializerContext", + "text": "PluginInitializerContext" + }, + "; }>; }>; autocomplete: Readonly<{} & { querySuggestions: Readonly<{} & { enabled: boolean; }>; valueSuggestions: Readonly<{} & { enabled: boolean; timeout: moment.Duration; tiers: string[]; terminateAfter: moment.Duration; }>; }>; }>>" + ], + "path": "src/plugins/data/server/plugin.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-server.DataServerPlugin.setup", + "type": "Function", + "tags": [], + "label": "setup", + "description": [], + "signature": [ + "(core: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.CoreSetup", + "text": "CoreSetup" + }, + "<", + "DataPluginStartDependencies", + ", ", + { + "pluginId": "data", + "scope": "server", + "docId": "kibDataPluginApi", + "section": "def-server.DataPluginStart", + "text": "DataPluginStart" + }, + ">, { bfetch, expressions, usageCollection, fieldFormats }: ", + "DataPluginSetupDependencies", + ") => { __enhance: (enhancements: ", + "DataEnhancements", + ") => void; search: ", + "ISearchSetup", + "; fieldFormats: ", + { + "pluginId": "fieldFormats", + "scope": "server", + "docId": "kibFieldFormatsPluginApi", + "section": "def-server.FieldFormatsSetup", + "text": "FieldFormatsSetup" + }, + "; }" + ], + "path": "src/plugins/data/server/plugin.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-server.DataServerPlugin.setup.$1", + "type": "Object", + "tags": [], + "label": "core", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.CoreSetup", + "text": "CoreSetup" + }, + "<", + "DataPluginStartDependencies", + ", ", + { + "pluginId": "data", + "scope": "server", + "docId": "kibDataPluginApi", + "section": "def-server.DataPluginStart", + "text": "DataPluginStart" + }, + ">" + ], + "path": "src/plugins/data/server/plugin.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-server.DataServerPlugin.setup.$2", + "type": "Object", + "tags": [], + "label": "{ bfetch, expressions, usageCollection, fieldFormats }", + "description": [], + "signature": [ + "DataPluginSetupDependencies" + ], + "path": "src/plugins/data/server/plugin.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-server.DataServerPlugin.start", + "type": "Function", + "tags": [], + "label": "start", + "description": [], + "signature": [ + "(core: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.CoreStart", + "text": "CoreStart" + }, + ", { fieldFormats }: ", + "DataPluginStartDependencies", + ") => { fieldFormats: ", + { + "pluginId": "fieldFormats", + "scope": "server", + "docId": "kibFieldFormatsPluginApi", + "section": "def-server.FieldFormatsStart", + "text": "FieldFormatsStart" + }, + "; indexPatterns: { indexPatternsServiceFactory: (savedObjectsClient: Pick<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsClient", + "text": "SavedObjectsClient" + }, + ", \"get\" | \"delete\" | \"create\" | \"bulkCreate\" | \"checkConflicts\" | \"find\" | \"bulkGet\" | \"resolve\" | \"update\" | \"collectMultiNamespaceReferences\" | \"updateObjectsSpaces\" | \"bulkUpdate\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\" | \"errors\">, elasticsearchClient: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + ") => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPatternsService", + "text": "IndexPatternsService" + }, + ">; }; search: ", + "ISearchStart", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IEsSearchRequest", + "text": "IEsSearchRequest" + }, + ", ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataSearchPluginApi", + "section": "def-common.IEsSearchResponse", + "text": "IEsSearchResponse" + }, + ">; }" + ], + "path": "src/plugins/data/server/plugin.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-server.DataServerPlugin.start.$1", + "type": "Object", + "tags": [], + "label": "core", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.CoreStart", + "text": "CoreStart" + } + ], + "path": "src/plugins/data/server/plugin.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-server.DataServerPlugin.start.$2", + "type": "Object", + "tags": [], + "label": "{ fieldFormats }", + "description": [], + "signature": [ + "DataPluginStartDependencies" + ], + "path": "src/plugins/data/server/plugin.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-server.DataServerPlugin.stop", + "type": "Function", + "tags": [], + "label": "stop", + "description": [], + "signature": [ + "() => void" + ], + "path": "src/plugins/data/server/plugin.ts", + "deprecated": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-server.IndexPattern", + "type": "Class", + "tags": [ + "deprecated" + ], + "label": "IndexPattern", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPattern", + "text": "IndexPattern" + }, + " extends ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + } + ], + "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", + "deprecated": true, + "references": [ + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" + }, + { + "plugin": "reporting", + "path": "x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts" + }, + { + "plugin": "reporting", + "path": "x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/columns.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/columns.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/helpers/update_search_source.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/helpers/update_search_source.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/services/use_es_doc_search.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/services/use_es_doc_search.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/services/use_es_doc_search.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/services/use_es_doc_search.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app_content.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app_content.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_index_pattern.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_index_pattern.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/update_search_source.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/update_search_source.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/types.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/types.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/discover_documents.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/discover_documents.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" + }, + { + "plugin": "ml", + "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/jobs/new_job/common/chart_loader/chart_loader.ts" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/types/index.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/types/index.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx" + }, + { + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/index.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/common/types/index_pattern.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/common/types/index_pattern.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/common/types/index_pattern.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/common/types/index_pattern.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.test.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.test.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.test.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/existing_fields.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/existing_fields.d.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/types.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/types.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/index_pattern_select.tsx" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/index_pattern_select.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_pattern.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_pattern.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_field_visualize.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_field_visualize.d.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/embeddable/types.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/embeddable/types.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx" + }, + { + "plugin": "uptime", + "path": "x-pack/plugins/uptime/public/state/reducers/index_pattern.ts" + }, + { + "plugin": "uptime", + "path": "x-pack/plugins/uptime/public/state/reducers/index_pattern.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.test.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.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/apply_es_resp.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/vis.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/vis.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/vis_types/types.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/vis_types/types.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/vis_types/types.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/doc_views/doc_views_types.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/doc_views/doc_views_types.ts" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/shared_imports.ts" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/kibana_services.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_default_sort.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_default_sort.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/table_header.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/table_header.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort_for_search_source.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort_for_search_source.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_data_grid_columns.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_data_grid_columns.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/utils/sorting.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/utils/sorting.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/calc_field_counts.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/calc_field_counts.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/nested_fields.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/nested_fields.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/types.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/types.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_row.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_row.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/actions/columns.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/actions/columns.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/utils/use_context_app_state.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/utils/use_context_app_state.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/anchor.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/anchor.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/utils/use_context_app_fetch.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/utils/use_context_app_fetch.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/persist_saved_search.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/persist_saved_search.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/types.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/types.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/utils.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/utils.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/utils.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_agg_tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_agg_tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/geo_index_pattern_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/geo_index_pattern_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/geo_line_form.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/geo_line_form.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/create_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/create_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/create_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/update_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/update_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.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_app/map_app.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.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" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/field_format_service.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/field_format_service.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/scatterplot_matrix/use_scatterplot_field_options.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/scatterplot_matrix/use_scatterplot_field_options.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.tsx" + }, + { + "plugin": "ml", + "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/common/job_creator/job_creator.ts" + }, + { + "plugin": "ml", + "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/common/job_creator/single_metric_job_creator.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/single_metric_job_creator.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/multi_metric_job_creator.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/multi_metric_job_creator.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/population_job_creator.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/population_job_creator.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/advanced_job_creator.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/advanced_job_creator.ts" + }, + { + "plugin": "ml", + "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/jobs/new_job/common/results_loader/categorization_examples_loader.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/categorization_job_creator.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/categorization_job_creator.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/rare_job_creator.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/rare_job_creator.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator_factory.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator_factory.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector_service.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector_service.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/exploration_results_table.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/exploration_results_table.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/ml_context.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/ml_context.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/common/use_results_view_config.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/common/use_results_view_config.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/common/use_results_view_config.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/types/app_state.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/types/app_state.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/datasource.sagas.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/datasource.sagas.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/search_bar.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/search_bar.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/search_bar.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/search_bar.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/inspect_panel.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/inspect_panel.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/workspace_layout/workspace_layout.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/workspace_layout/workspace_layout.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/workspace_layout/workspace_layout.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/index_pattern_cache.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/index_pattern_cache.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/index_pattern_cache.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/threatmatch_input/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/threatmatch_input/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/threatmatch_input/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/get_pivot_dropdown_options.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/get_pivot_dropdown_options.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/common/request.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/common/request.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/common/request.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/common/request.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "uptime", + "path": "x-pack/plugins/uptime/public/hooks/update_kuery_string.ts" + }, + { + "plugin": "uptime", + "path": "x-pack/plugins/uptime/public/hooks/update_kuery_string.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/mocks.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/mocks.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/embeddable/embeddable.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/embeddable/embeddable.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/utils.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/es_search_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/es_search_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_index_pattern_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_index_pattern_select.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities._service.test.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities._service.test.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/remove_nested_field_children.test.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/remove_nested_field_children.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/__mocks__/index_pattern.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/__mocks__/index_pattern.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/count_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/count_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/geo_line_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/geo_line_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/filter_editor/filter_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/filter_editor/filter_editor.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/components/full_time_range_selector/full_time_range_selector.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/components/full_time_range_selector/full_time_range_selector.d.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/target/types/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.d.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/target/types/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.d.ts" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/common.test.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/common.test.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/open_editor.tsx" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/open_editor.tsx" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/types.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/types.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/create_search_source.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/create_search_source.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/controls_tab.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/controls_tab.tsx" + }, + { + "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": "visualize", + "path": "src/plugins/visualize/public/application/components/visualize_top_nav.tsx" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/components/visualize_top_nav.tsx" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/components/visualize_top_nav.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/utils/editor_config.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/utils/editor_config.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_select.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_select.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params.tsx" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/test_utils/get_index_pattern_mock.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/test_utils/get_index_pattern_mock.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/test_utils/get_index_pattern_mock.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.test.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.test.ts" + }, + { + "plugin": "visTypeTable", + "path": "src/plugins/vis_types/table/public/legacy/table_vis_controller.test.ts" + }, + { + "plugin": "visTypeTable", + "path": "src/plugins/vis_types/table/public/legacy/table_vis_controller.test.ts" + }, + { + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts" + }, + { + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts" + }, + { + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/target/types/public/types.d.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/target/types/public/types.d.ts" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/utils/editor_config.d.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/utils/editor_config.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/control/create_search_source.d.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/control/create_search_source.d.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/test_utils/get_index_pattern_mock.d.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/test_utils/get_index_pattern_mock.d.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/agg_select.d.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/agg_select.d.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_sharing_data.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_sharing_data.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_sharing_data.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/components/editor/controls_tab.d.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/components/editor/controls_tab.d.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_calculator.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_calculator.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/utils/nested_fields.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/utils/nested_fields.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/data_loader/data_loader.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/data_loader/data_loader.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/data_loader/data_loader.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_pattern_management/index_pattern_management.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_pattern_management/index_pattern_management.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/embeddables/types.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/embeddables/types.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.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": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.test.ts" + } + ], + "children": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-server.IndexPatternField", "type": "Class", - "tags": [], - "label": "DataServerPlugin", + "tags": [ + "deprecated" + ], + "label": "IndexPatternField", "description": [], "signature": [ { - "pluginId": "data", - "scope": "server", - "docId": "kibDataPluginApi", - "section": "def-server.DataServerPlugin", - "text": "DataServerPlugin" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPatternField", + "text": "IndexPatternField" + }, + " extends ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + } + ], + "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", + "deprecated": true, + "references": [ + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/shared_imports.ts" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/kibana_services.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/field_name/field_name.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/field_name/field_name.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table_cell_actions.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table_cell_actions.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/metrics_editor/metrics_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/metrics_editor/metrics_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/update_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/update_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/es_doc_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/es_doc_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_field_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_field_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/metrics_editor/metrics_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/metrics_editor/metrics_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/metrics_editor/metric_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/metrics_editor/metric_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" }, - " implements ", { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.Plugin", - "text": "Plugin" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" }, - "<", { - "pluginId": "data", - "scope": "server", - "docId": "kibDataPluginApi", - "section": "def-server.DataPluginSetup", - "text": "DataPluginSetup" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" }, - ", ", { - "pluginId": "data", - "scope": "server", - "docId": "kibDataPluginApi", - "section": "def-server.DataPluginStart", - "text": "DataPluginStart" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" }, - ", ", - "DataPluginSetupDependencies", - ", ", - "DataPluginStartDependencies", - ">" - ], - "path": "src/plugins/data/server/plugin.ts", - "deprecated": false, - "children": [ { - "parentPluginId": "data", - "id": "def-server.DataServerPlugin.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/data/server/plugin.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.DataServerPlugin.Unnamed.$1", - "type": "Object", - "tags": [], - "label": "initializerContext", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.PluginInitializerContext", - "text": "PluginInitializerContext" - }, - "; }>; }>; autocomplete: Readonly<{} & { querySuggestions: Readonly<{} & { enabled: boolean; }>; valueSuggestions: Readonly<{} & { enabled: boolean; timeout: moment.Duration; tiers: string[]; terminateAfter: moment.Duration; }>; }>; }>>" - ], - "path": "src/plugins/data/server/plugin.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.DataServerPlugin.setup", - "type": "Function", - "tags": [], - "label": "setup", - "description": [], - "signature": [ - "(core: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreSetup", - "text": "CoreSetup" - }, - "<", - "DataPluginStartDependencies", - ", ", - { - "pluginId": "data", - "scope": "server", - "docId": "kibDataPluginApi", - "section": "def-server.DataPluginStart", - "text": "DataPluginStart" - }, - ">, { bfetch, expressions, usageCollection, fieldFormats }: ", - "DataPluginSetupDependencies", - ") => { __enhance: (enhancements: ", - "DataEnhancements", - ") => void; search: ", - "ISearchSetup", - "; fieldFormats: ", - { - "pluginId": "fieldFormats", - "scope": "server", - "docId": "kibFieldFormatsPluginApi", - "section": "def-server.FieldFormatsSetup", - "text": "FieldFormatsSetup" - }, - "; }" - ], - "path": "src/plugins/data/server/plugin.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.DataServerPlugin.setup.$1", - "type": "Object", - "tags": [], - "label": "core", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreSetup", - "text": "CoreSetup" - }, - "<", - "DataPluginStartDependencies", - ", ", - { - "pluginId": "data", - "scope": "server", - "docId": "kibDataPluginApi", - "section": "def-server.DataPluginStart", - "text": "DataPluginStart" - }, - ">" - ], - "path": "src/plugins/data/server/plugin.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.DataServerPlugin.setup.$2", - "type": "Object", - "tags": [], - "label": "{ bfetch, expressions, usageCollection, fieldFormats }", - "description": [], - "signature": [ - "DataPluginSetupDependencies" - ], - "path": "src/plugins/data/server/plugin.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.DataServerPlugin.start", - "type": "Function", - "tags": [], - "label": "start", - "description": [], - "signature": [ - "(core: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreStart", - "text": "CoreStart" - }, - ", { fieldFormats }: ", - "DataPluginStartDependencies", - ") => { fieldFormats: ", - { - "pluginId": "fieldFormats", - "scope": "server", - "docId": "kibFieldFormatsPluginApi", - "section": "def-server.FieldFormatsStart", - "text": "FieldFormatsStart" - }, - "; indexPatterns: { indexPatternsServiceFactory: (savedObjectsClient: Pick<", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCoreSavedObjectsPluginApi", - "section": "def-server.SavedObjectsClient", - "text": "SavedObjectsClient" - }, - ", \"get\" | \"delete\" | \"create\" | \"bulkCreate\" | \"checkConflicts\" | \"find\" | \"bulkGet\" | \"resolve\" | \"update\" | \"collectMultiNamespaceReferences\" | \"updateObjectsSpaces\" | \"bulkUpdate\" | \"removeReferencesTo\" | \"openPointInTimeForType\" | \"closePointInTime\" | \"createPointInTimeFinder\" | \"errors\">, elasticsearchClient: ", - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.ElasticsearchClient", - "text": "ElasticsearchClient" - }, - ") => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternsService", - "text": "IndexPatternsService" - }, - ">; }; search: ", - "ISearchStart", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IEsSearchRequest", - "text": "IEsSearchRequest" - }, - ", ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IEsSearchResponse", - "text": "IEsSearchResponse" - }, - ">; }" - ], - "path": "src/plugins/data/server/plugin.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.DataServerPlugin.start.$1", - "type": "Object", - "tags": [], - "label": "core", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "server", - "docId": "kibCorePluginApi", - "section": "def-server.CoreStart", - "text": "CoreStart" - } - ], - "path": "src/plugins/data/server/plugin.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.DataServerPlugin.start.$2", - "type": "Object", - "tags": [], - "label": "{ fieldFormats }", - "description": [], - "signature": [ - "DataPluginStartDependencies" - ], - "path": "src/plugins/data/server/plugin.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.DataServerPlugin.stop", - "type": "Function", - "tags": [], - "label": "stop", - "description": [], - "signature": [ - "() => void" - ], - "path": "src/plugins/data/server/plugin.ts", - "deprecated": false, - "children": [], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPattern", - "type": "Class", - "tags": [], - "label": "IndexPattern", - "description": [], - "signature": [ + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.d.ts" }, - " implements ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IIndexPattern", - "text": "IIndexPattern" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.d.ts" + }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.fieldFormatMap", - "type": "Object", - "tags": [], - "label": "fieldFormatMap", - "description": [], - "signature": [ - "{ [x: string]: any; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.typeMeta", - "type": "Object", - "tags": [], - "label": "typeMeta", - "description": [ - "\nOnly used by rollup indices, used by rollup specific endpoint to load field list" - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.TypeMeta", - "text": "TypeMeta" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/list_control_factory.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/list_control_factory.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/range_control_factory.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/range_control_factory.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_param_props.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_param_props.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/field.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/field.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/field.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/field.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/top_field.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/top_field.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/top_sort_field.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/top_sort_field.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.fields", - "type": "CompoundType", - "tags": [], - "label": "fields", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IIndexPatternFieldList", - "text": "IIndexPatternFieldList" - }, - " & { toSpec: () => Record; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.timeFieldName", - "type": "string", - "tags": [], - "label": "timeFieldName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.intervalName", - "type": "string", - "tags": [ - "deprecated" - ], - "label": "intervalName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [] + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/agg_param_props.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.type", - "type": "string", - "tags": [], - "label": "type", - "description": [ - "\nType is used to identify rollup index patterns" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/agg_param_props.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.formatHit", - "type": "Function", - "tags": [], - "label": "formatHit", - "description": [], - "signature": [ - "{ (hit: Record, type?: string | undefined): any; formatField: FormatFieldFn; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-server.hit", - "type": "Object", - "tags": [], - "label": "hit", - "description": [], - "signature": [ - "{ [x: string]: any; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-server.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false - } - ] + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.formatField", - "type": "Function", - "tags": [], - "label": "formatField", - "description": [], - "signature": [ - "(hit: Record, fieldName: string) => any" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-server.hit", - "type": "Object", - "tags": [], - "label": "hit", - "description": [], - "signature": [ - "{ [x: string]: any; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-server.fieldName", - "type": "string", - "tags": [], - "label": "fieldName", - "description": [], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false - } - ] + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.flattenHit", - "type": "Function", - "tags": [], - "label": "flattenHit", - "description": [], - "signature": [ - "(hit: Record, deep?: boolean | undefined) => Record" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-server.hit", - "type": "Object", - "tags": [], - "label": "hit", - "description": [], - "signature": [ - "{ [x: string]: any; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-server.deep", - "type": "CompoundType", - "tags": [], - "label": "deep", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false - } - ] + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/controls/top_field.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.metaFields", - "type": "Array", - "tags": [], - "label": "metaFields", - "description": [], - "signature": [ - "string[]" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/controls/top_field.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.version", - "type": "string", - "tags": [], - "label": "version", - "description": [ - "\nSavedObject version" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/controls/top_sort_field.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.sourceFilters", - "type": "Array", - "tags": [], - "label": "sourceFilters", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.SourceFilter", - "text": "SourceFilter" - }, - "[] | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/controls/top_sort_field.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.allowNoIndex", - "type": "boolean", - "tags": [], - "label": "allowNoIndex", - "description": [ - "\nprevents errors when index pattern exists before indices" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.Unnamed.$1", - "type": "Object", - "tags": [], - "label": "{\n spec = {},\n fieldFormats,\n shortDotsEnable = false,\n metaFields = [],\n }", - "description": [], - "signature": [ - "IndexPatternDeps" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.getOriginalSavedObjectBody", - "type": "Function", - "tags": [], - "label": "getOriginalSavedObjectBody", - "description": [ - "\nGet last saved saved object fields" - ], - "signature": [ - "() => { fieldAttrs?: string | undefined; title?: string | undefined; timeFieldName?: string | undefined; intervalName?: string | undefined; fields?: string | undefined; sourceFilters?: string | undefined; fieldFormatMap?: string | undefined; typeMeta?: string | undefined; type?: string | undefined; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.resetOriginalSavedObjectBody", - "type": "Function", - "tags": [], - "label": "resetOriginalSavedObjectBody", - "description": [ - "\nReset last saved saved object fields. used after saving" - ], - "signature": [ - "() => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.getFieldAttrs", - "type": "Function", - "tags": [], - "label": "getFieldAttrs", - "description": [], - "signature": [ - "() => { [x: string]: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldAttrSet", - "text": "FieldAttrSet" - }, - "; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.getComputedFields", - "type": "Function", - "tags": [], - "label": "getComputedFields", - "description": [], - "signature": [ - "() => { storedFields: string[]; scriptFields: any; docvalueFields: { field: any; format: string; }[]; runtimeFields: Record; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.toSpec", - "type": "Function", - "tags": [], - "label": "toSpec", - "description": [ - "\nCreate static representation of index pattern" - ], - "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.getSourceFiltering", - "type": "Function", - "tags": [], - "label": "getSourceFiltering", - "description": [ - "\nGet the source filtering configuration for that index." - ], - "signature": [ - "() => { excludes: any[]; }" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.addScriptedField", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "addScriptedField", - "description": [ - "\nAdd scripted field to field list\n" - ], - "signature": [ - "(name: string, script: string, fieldType?: string) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [], - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.addScriptedField.$1", - "type": "string", - "tags": [], - "label": "name", - "description": [ - "field name" - ], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.addScriptedField.$2", - "type": "string", - "tags": [], - "label": "script", - "description": [ - "script code" - ], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.addScriptedField.$3", - "type": "string", - "tags": [], - "label": "fieldType", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/group_fields.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.removeScriptedField", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "removeScriptedField", - "description": [ - "\nRemove scripted field from field list" - ], - "signature": [ - "(fieldName: string) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ - { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" - }, - { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" - } - ], - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.removeScriptedField.$1", - "type": "string", - "tags": [], - "label": "fieldName", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/group_fields.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.getNonScriptedFields", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "getNonScriptedFields", - "description": [ - "\n" - ], - "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - "[]" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" - }, - { - "plugin": "graph", - "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" - }, - { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" - }, - { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" - }, - { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" - }, - { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_type_timeseries/public/application/lib/fetch_fields.ts" - } - ], - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/group_fields.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.getScriptedFields", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "getScriptedFields", - "description": [ - "\n" - ], - "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - "[]" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ - { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" - } - ], - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/group_fields.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.isTimeBased", - "type": "Function", - "tags": [], - "label": "isTimeBased", - "description": [], - "signature": [ - "() => boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/group_fields.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.isTimeNanosBased", - "type": "Function", - "tags": [], - "label": "isTimeNanosBased", - "description": [], - "signature": [ - "() => boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.getTimeField", - "type": "Function", - "tags": [], - "label": "getTimeField", - "description": [], - "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.getFieldByName", - "type": "Function", - "tags": [], - "label": "getFieldByName", - "description": [], - "signature": [ - "(name: string) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.getFieldByName.$1", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app.tsx" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.getAggregationRestrictions", - "type": "Function", - "tags": [], - "label": "getAggregationRestrictions", - "description": [], - "signature": [ - "() => Record> | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.getAsSavedObjectBody", - "type": "Function", - "tags": [], - "label": "getAsSavedObjectBody", - "description": [ - "\nReturns index pattern as saved object body for saving" - ], - "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternAttributes", - "text": "IndexPatternAttributes" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.getFormatterForField", - "type": "Function", - "tags": [], - "label": "getFormatterForField", - "description": [ - "\nProvide a field, get its formatter" - ], - "signature": [ - "(field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") => ", - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormat", - "text": "FieldFormat" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.getFormatterForField.$1", - "type": "CompoundType", - "tags": [], - "label": "field", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.addRuntimeField", - "type": "Function", - "tags": [], - "label": "addRuntimeField", - "description": [ - "\nAdd a runtime field - Appended to existing mapped field or a new field is\ncreated as appropriate" - ], - "signature": [ - "(name: string, runtimeField: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" - }, - ") => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.addRuntimeField.$1", - "type": "string", - "tags": [], - "label": "name", - "description": [ - "Field name" - ], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.addRuntimeField.$2", - "type": "Object", - "tags": [], - "label": "runtimeField", - "description": [ - "Runtime field definition" - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "maps", + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.hasRuntimeField", - "type": "Function", - "tags": [], - "label": "hasRuntimeField", - "description": [ - "\nChecks if runtime field exists" - ], - "signature": [ - "(name: string) => boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.hasRuntimeField.$1", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "maps", + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.getRuntimeField", - "type": "Function", - "tags": [], - "label": "getRuntimeField", - "description": [ - "\nReturns runtime field if exists" - ], - "signature": [ - "(name: string) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" - }, - " | null" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.getRuntimeField.$1", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "maps", + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.replaceAllRuntimeFields", - "type": "Function", - "tags": [], - "label": "replaceAllRuntimeFields", - "description": [ - "\nReplaces all existing runtime fields with new fields" - ], - "signature": [ - "(newFields: Record) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.replaceAllRuntimeFields.$1", - "type": "Object", - "tags": [], - "label": "newFields", - "description": [], - "signature": [ - "Record" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/field_stats.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.removeRuntimeField", - "type": "Function", - "tags": [], - "label": "removeRuntimeField", - "description": [ - "\nRemove a runtime field - removed from mapped field or removed unmapped\nfield as appropriate. Doesn't clear associated field attributes." - ], - "signature": [ - "(name: string) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.removeRuntimeField.$1", - "type": "string", - "tags": [], - "label": "name", - "description": [ - "- Field name to remove" - ], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/field_stats.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.getFormatterForFieldNoDefault", - "type": "Function", - "tags": [], - "label": "getFormatterForFieldNoDefault", - "description": [ - "\nGet formatter for a given field name. Return undefined if none exists" - ], - "signature": [ - "(fieldname: string) => ", - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormat", - "text": "FieldFormat" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.getFormatterForFieldNoDefault.$1", - "type": "string", - "tags": [], - "label": "fieldname", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/field_stats.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.setFieldAttrs", - "type": "Function", - "tags": [], - "label": "setFieldAttrs", - "description": [], - "signature": [ - "(fieldName: string, attrName: K, value: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldAttrSet", - "text": "FieldAttrSet" - }, - "[K]) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.setFieldAttrs.$1", - "type": "string", - "tags": [], - "label": "fieldName", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.setFieldAttrs.$2", - "type": "Uncategorized", - "tags": [], - "label": "attrName", - "description": [], - "signature": [ - "K" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.setFieldAttrs.$3", - "type": "Uncategorized", - "tags": [], - "label": "value", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldAttrSet", - "text": "FieldAttrSet" - }, - "[K]" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/field_stats.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.setFieldCustomLabel", - "type": "Function", - "tags": [], - "label": "setFieldCustomLabel", - "description": [], - "signature": [ - "(fieldName: string, customLabel: string | null | undefined) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.setFieldCustomLabel.$1", - "type": "string", - "tags": [], - "label": "fieldName", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.setFieldCustomLabel.$2", - "type": "CompoundType", - "tags": [], - "label": "customLabel", - "description": [], - "signature": [ - "string | null | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [] + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/field_stats.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.setFieldCount", - "type": "Function", - "tags": [], - "label": "setFieldCount", - "description": [], - "signature": [ - "(fieldName: string, count: number | null | undefined) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.setFieldCount.$1", - "type": "string", - "tags": [], - "label": "fieldName", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.setFieldCount.$2", - "type": "CompoundType", - "tags": [], - "label": "count", - "description": [], - "signature": [ - "number | null | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [] + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.setFieldFormat", - "type": "Function", - "tags": [], - "label": "setFieldFormat", - "description": [], - "signature": [ - "(fieldName: string, format: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.SerializedFieldFormat", - "text": "SerializedFieldFormat" - }, - ">) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.setFieldFormat.$1", - "type": "string", - "tags": [], - "label": "fieldName", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.setFieldFormat.$2", - "type": "Object", - "tags": [], - "label": "format", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.SerializedFieldFormat", - "text": "SerializedFieldFormat" - }, - ">" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPattern.deleteFieldFormat", - "type": "Function", - "tags": [], - "label": "deleteFieldFormat", - "description": [], - "signature": [ - "(fieldName: string) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPattern.deleteFieldFormat.$1", - "type": "string", - "tags": [], - "label": "fieldName", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternField", - "type": "Class", - "tags": [], - "label": "IndexPatternField", - "description": [], - "signature": [ + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts" }, - " implements ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - } - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false, - "children": [ + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts" + }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.spec", - "type": "Object", - "tags": [], - "label": "spec", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.Unnamed.$1", - "type": "Object", - "tags": [], - "label": "spec", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.count", - "type": "number", - "tags": [], - "label": "count", - "description": [ - "\nCount is used for field popularity" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.count", - "type": "number", - "tags": [], - "label": "count", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.runtimeField", - "type": "Object", - "tags": [], - "label": "runtimeField", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.runtimeField", - "type": "Object", - "tags": [], - "label": "runtimeField", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.script", - "type": "string", - "tags": [], - "label": "script", - "description": [ - "\nScript field code" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.script", - "type": "string", - "tags": [], - "label": "script", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.lang", - "type": "CompoundType", - "tags": [], - "label": "lang", - "description": [ - "\nScript field language" - ], - "signature": [ - "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.lang", - "type": "CompoundType", - "tags": [], - "label": "lang", - "description": [], - "signature": [ - "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.customLabel", - "type": "string", - "tags": [], - "label": "customLabel", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.customLabel", - "type": "string", - "tags": [], - "label": "customLabel", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.conflictDescriptions", - "type": "Object", - "tags": [], - "label": "conflictDescriptions", - "description": [ - "\nDescription of field type conflicts across different indices in the same index pattern" - ], - "signature": [ - "Record | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.conflictDescriptions", - "type": "Object", - "tags": [], - "label": "conflictDescriptions", - "description": [], - "signature": [ - "Record | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.name", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.displayName", - "type": "string", - "tags": [], - "label": "displayName", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_field_visualize.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_field_visualize.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.esTypes", - "type": "Array", - "tags": [], - "label": "esTypes", - "description": [], - "signature": [ - "string[] | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_field_visualize.d.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.scripted", - "type": "boolean", - "tags": [], - "label": "scripted", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.searchable", - "type": "boolean", - "tags": [], - "label": "searchable", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.aggregatable", - "type": "boolean", - "tags": [], - "label": "aggregatable", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.readFromDocValues", - "type": "boolean", - "tags": [], - "label": "readFromDocValues", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.subType", - "type": "Object", - "tags": [], - "label": "subType", - "description": [], - "signature": [ - "IFieldSubType", - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.isMapped", - "type": "CompoundType", - "tags": [], - "label": "isMapped", - "description": [ - "\nIs the field part of the index mapping?" - ], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.sortable", - "type": "boolean", - "tags": [], - "label": "sortable", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.filterable", - "type": "boolean", - "tags": [], - "label": "filterable", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.visualizable", - "type": "boolean", - "tags": [], - "label": "visualizable", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.deleteCount", - "type": "Function", - "tags": [], - "label": "deleteCount", - "description": [], - "signature": [ - "() => void" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.toJSON", - "type": "Function", - "tags": [], - "label": "toJSON", - "description": [], - "signature": [ - "() => { count: number; script: string | undefined; lang: \"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined; conflictDescriptions: Record | undefined; name: string; type: string; esTypes: string[] | undefined; scripted: boolean; searchable: boolean; aggregatable: boolean; readFromDocValues: boolean; subType: ", - "IFieldSubType", - " | undefined; customLabel: string | undefined; }" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.toSpec", - "type": "Function", - "tags": [], - "label": "toSpec", - "description": [], - "signature": [ - "({ getFormatterForField, }?: { getFormatterForField?: ((field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") => ", - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormat", - "text": "FieldFormat" - }, - ") | undefined; }) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.toSpec.$1.getFormatterForField", - "type": "Object", - "tags": [], - "label": "{\n getFormatterForField,\n }", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternField.toSpec.$1.getFormatterForField.getFormatterForField", - "type": "Function", - "tags": [], - "label": "getFormatterForField", - "description": [], - "signature": [ - "((field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") => ", - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormat", - "text": "FieldFormat" - }, - ") | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", - "deprecated": false - } - ] - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" } ], + "children": [], "initialIsOpen": false }, { "parentPluginId": "data", "id": "def-server.IndexPatternsService", "type": "Class", - "tags": [], + "tags": [ + "deprecated" + ], "label": "IndexPatternsService", "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPatternsService", + "text": "IndexPatternsService" + }, + " extends ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewsService", + "text": "DataViewsService" + } + ], "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ + "deprecated": true, + "references": [ { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.ensureDefaultIndexPattern", - "type": "Function", - "tags": [], - "label": "ensureDefaultIndexPattern", - "description": [], - "signature": [ - "() => Promise | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "returnComment": [], - "children": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.Unnamed.$1", - "type": "Object", - "tags": [], - "label": "{\n uiSettings,\n savedObjectsClient,\n apiClient,\n fieldFormats,\n onNotification,\n onError,\n onRedirectNoIndexPattern = () => {},\n }", - "description": [], - "signature": [ - "IndexPatternsServiceDeps" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getIds", - "type": "Function", - "tags": [], - "label": "getIds", - "description": [ - "\nGet list of index pattern ids" - ], - "signature": [ - "(refresh?: boolean) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getIds.$1", - "type": "boolean", - "tags": [], - "label": "refresh", - "description": [ - "Force refresh of index pattern list" - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/types.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/types.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/server/kibana_server_services.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/server/kibana_server_services.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/server/data_indexing/create_doc_source.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/server/data_indexing/create_doc_source.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getTitles", - "type": "Function", - "tags": [], - "label": "getTitles", - "description": [ - "\nGet list of index pattern titles" - ], - "signature": [ - "(refresh?: boolean) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getTitles.$1", - "type": "boolean", - "tags": [], - "label": "refresh", - "description": [ - "Force refresh of index pattern list" - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.find", - "type": "Function", - "tags": [], - "label": "find", - "description": [ - "\nFind and load index patterns by title" - ], - "signature": [ - "(search: string, size?: number) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - "[]>" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.find.$1", - "type": "string", - "tags": [], - "label": "search", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.find.$2", - "type": "number", - "tags": [], - "label": "size", - "description": [], - "signature": [ - "number" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "IndexPattern[]" - ] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getIdsWithTitle", - "type": "Function", - "tags": [], - "label": "getIdsWithTitle", - "description": [ - "\nGet list of index pattern ids with titles" - ], - "signature": [ - "(refresh?: boolean) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternListItem", - "text": "IndexPatternListItem" - }, - "[]>" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getIdsWithTitle.$1", - "type": "boolean", - "tags": [], - "label": "refresh", - "description": [ - "Force refresh of index pattern list" - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/fields_fetcher.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.clearCache", - "type": "Function", - "tags": [], - "label": "clearCache", - "description": [ - "\nClear index pattern list cache" - ], - "signature": [ - "(id?: string | undefined) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.clearCache.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [ - "optionally clear a single id" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/fields_fetcher.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getCache", - "type": "Function", - "tags": [], - "label": "getCache", - "description": [], - "signature": [ - "() => Promise<", - "SavedObject", - ">[] | null | undefined>" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/plugin.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getDefault", - "type": "Function", - "tags": [], - "label": "getDefault", - "description": [ - "\nGet default index pattern" - ], - "signature": [ - "() => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - " | null>" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/plugin.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getDefaultId", - "type": "Function", - "tags": [], - "label": "getDefaultId", - "description": [ - "\nGet default index pattern id" - ], - "signature": [ - "() => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.setDefault", - "type": "Function", - "tags": [], - "label": "setDefault", - "description": [ - "\nOptionally set default index pattern, unless force = true" - ], - "signature": [ - "(id: string | null, force?: boolean) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.setDefault.$1", - "type": "CompoundType", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string | null" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": false - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.setDefault.$2", - "type": "boolean", - "tags": [], - "label": "force", - "description": [], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.hasUserIndexPattern", - "type": "Function", - "tags": [], - "label": "hasUserIndexPattern", - "description": [ - "\nChecks if current user has a user created index pattern ignoring fleet's server default index patterns" - ], - "signature": [ - "() => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getFieldsForWildcard", - "type": "Function", - "tags": [], - "label": "getFieldsForWildcard", - "description": [ - "\nGet field list by providing { pattern }" - ], - "signature": [ - "(options: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" - }, - ") => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getFieldsForWildcard.$1", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "FieldSpec[]" - ] + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_patterns.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getFieldsForIndexPattern", - "type": "Function", - "tags": [], - "label": "getFieldsForIndexPattern", - "description": [ - "\nGet field list by providing an index patttern (or spec)" - ], - "signature": [ - "(indexPattern: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - }, - ", options?: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" - }, - " | undefined) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getFieldsForIndexPattern.$1", - "type": "CompoundType", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getFieldsForIndexPattern.$2", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [ - "FieldSpec[]" - ] + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_patterns.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.refreshFields", - "type": "Function", - "tags": [], - "label": "refreshFields", - "description": [ - "\nRefresh field list for a given index pattern" - ], - "signature": [ - "(indexPattern: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ") => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.refreshFields.$1", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.fieldArrayToMap", - "type": "Function", - "tags": [], - "label": "fieldArrayToMap", - "description": [ - "\nConverts field array to map" - ], - "signature": [ - "(fields: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - "[], fieldAttrs?: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldAttrs", - "text": "FieldAttrs" - }, - " | undefined) => Record" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.fieldArrayToMap.$1", - "type": "Array", - "tags": [], - "label": "fields", - "description": [ - ": FieldSpec[]" - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - "[]" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.fieldArrayToMap.$2", - "type": "Object", - "tags": [], - "label": "fieldAttrs", - "description": [ - ": FieldAttrs" - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldAttrs", - "text": "FieldAttrs" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [ - "Record" - ] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.savedObjectToSpec", - "type": "Function", - "tags": [], - "label": "savedObjectToSpec", - "description": [ - "\nConverts index pattern saved object to index pattern spec" - ], - "signature": [ - "(savedObject: ", - "SavedObject", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternAttributes", - "text": "IndexPatternAttributes" - }, - ">) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.savedObjectToSpec.$1", - "type": "Object", - "tags": [], - "label": "savedObject", - "description": [], - "signature": [ - "SavedObject", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternAttributes", - "text": "IndexPatternAttributes" - }, - ">" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "IndexPatternSpec" - ] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.get", - "type": "Function", - "tags": [], - "label": "get", - "description": [ - "\nGet an index pattern by id. Cache optimized" - ], - "signature": [ - "(id: string) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ">" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.get.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/combo_box_select.tsx" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/combo_box_select.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.create", - "type": "Function", - "tags": [], - "label": "create", - "description": [ - "\nCreate a new index pattern instance" - ], - "signature": [ - "(spec: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - }, - ", skipFetchFields?: boolean) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ">" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.create.$1", - "type": "Object", - "tags": [], - "label": "spec", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.create.$2", - "type": "boolean", - "tags": [], - "label": "skipFetchFields", - "description": [], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "IndexPattern" - ] + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.createAndSave", - "type": "Function", - "tags": [], - "label": "createAndSave", - "description": [ - "\nCreate a new index pattern and save it right away" - ], - "signature": [ - "(spec: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - }, - ", override?: boolean, skipFetchFields?: boolean) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ">" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.createAndSave.$1", - "type": "Object", - "tags": [], - "label": "spec", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.createAndSave.$2", - "type": "boolean", - "tags": [], - "label": "override", - "description": [ - "Overwrite if existing index pattern exists." - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.createAndSave.$3", - "type": "boolean", - "tags": [], - "label": "skipFetchFields", - "description": [ - "Whether to skip field refresh step." - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.createSavedObject", - "type": "Function", - "tags": [], - "label": "createSavedObject", - "description": [ - "\nSave a new index pattern" - ], - "signature": [ - "(indexPattern: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ", override?: boolean) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ">" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.createSavedObject.$1", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.createSavedObject.$2", - "type": "boolean", - "tags": [], - "label": "override", - "description": [ - "Overwrite if existing index pattern exists" - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.updateSavedObject", - "type": "Function", - "tags": [], - "label": "updateSavedObject", - "description": [ - "\nSave existing index pattern. Will attempt to merge differences if there are conflicts" - ], - "signature": [ - "(indexPattern: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ", saveAttempts?: number, ignoreErrors?: boolean) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.updateSavedObject.$1", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.updateSavedObject.$2", - "type": "number", - "tags": [], - "label": "saveAttempts", - "description": [], - "signature": [ - "number" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.updateSavedObject.$3", - "type": "boolean", - "tags": [], - "label": "ignoreErrors", - "description": [], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.delete", - "type": "Function", - "tags": [], - "label": "delete", - "description": [ - "\nDeletes an index pattern from .kibana index" - ], - "signature": [ - "(indexPatternId: string) => Promise<{}>" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.delete.$1", - "type": "string", - "tags": [], - "label": "indexPatternId", - "description": [ - ": Id of kibana Index Pattern to delete" - ], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" } ], + "children": [], "initialIsOpen": false }, { "parentPluginId": "data", "id": "def-server.IndexPatternsService", "type": "Class", - "tags": [], + "tags": [ + "deprecated" + ], "label": "IndexPatternsService", "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPatternsService", + "text": "IndexPatternsService" + }, + " extends ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewsService", + "text": "DataViewsService" + } + ], "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ + "deprecated": true, + "references": [ { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.ensureDefaultIndexPattern", - "type": "Function", - "tags": [], - "label": "ensureDefaultIndexPattern", - "description": [], - "signature": [ - "() => Promise | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "returnComment": [], - "children": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.Unnamed.$1", - "type": "Object", - "tags": [], - "label": "{\n uiSettings,\n savedObjectsClient,\n apiClient,\n fieldFormats,\n onNotification,\n onError,\n onRedirectNoIndexPattern = () => {},\n }", - "description": [], - "signature": [ - "IndexPatternsServiceDeps" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getIds", - "type": "Function", - "tags": [], - "label": "getIds", - "description": [ - "\nGet list of index pattern ids" - ], - "signature": [ - "(refresh?: boolean) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getIds.$1", - "type": "boolean", - "tags": [], - "label": "refresh", - "description": [ - "Force refresh of index pattern list" - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getTitles", - "type": "Function", - "tags": [], - "label": "getTitles", - "description": [ - "\nGet list of index pattern titles" - ], - "signature": [ - "(refresh?: boolean) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getTitles.$1", - "type": "boolean", - "tags": [], - "label": "refresh", - "description": [ - "Force refresh of index pattern list" - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.find", - "type": "Function", - "tags": [], - "label": "find", - "description": [ - "\nFind and load index patterns by title" - ], - "signature": [ - "(search: string, size?: number) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - "[]>" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.find.$1", - "type": "string", - "tags": [], - "label": "search", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.find.$2", - "type": "number", - "tags": [], - "label": "size", - "description": [], - "signature": [ - "number" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "IndexPattern[]" - ] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getIdsWithTitle", - "type": "Function", - "tags": [], - "label": "getIdsWithTitle", - "description": [ - "\nGet list of index pattern ids with titles" - ], - "signature": [ - "(refresh?: boolean) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternListItem", - "text": "IndexPatternListItem" - }, - "[]>" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getIdsWithTitle.$1", - "type": "boolean", - "tags": [], - "label": "refresh", - "description": [ - "Force refresh of index pattern list" - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.clearCache", - "type": "Function", - "tags": [], - "label": "clearCache", - "description": [ - "\nClear index pattern list cache" - ], - "signature": [ - "(id?: string | undefined) => void" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.clearCache.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [ - "optionally clear a single id" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getCache", - "type": "Function", - "tags": [], - "label": "getCache", - "description": [], - "signature": [ - "() => Promise<", - "SavedObject", - ">[] | null | undefined>" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getDefault", - "type": "Function", - "tags": [], - "label": "getDefault", - "description": [ - "\nGet default index pattern" - ], - "signature": [ - "() => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - " | null>" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/types.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getDefaultId", - "type": "Function", - "tags": [], - "label": "getDefaultId", - "description": [ - "\nGet default index pattern id" - ], - "signature": [ - "() => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/types.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/server/kibana_server_services.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.setDefault", - "type": "Function", - "tags": [], - "label": "setDefault", - "description": [ - "\nOptionally set default index pattern, unless force = true" - ], - "signature": [ - "(id: string | null, force?: boolean) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.setDefault.$1", - "type": "CompoundType", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string | null" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": false - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.setDefault.$2", - "type": "boolean", - "tags": [], - "label": "force", - "description": [], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "maps", + "path": "x-pack/plugins/maps/server/kibana_server_services.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.hasUserIndexPattern", - "type": "Function", - "tags": [], - "label": "hasUserIndexPattern", - "description": [ - "\nChecks if current user has a user created index pattern ignoring fleet's server default index patterns" - ], - "signature": [ - "() => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "maps", + "path": "x-pack/plugins/maps/server/data_indexing/create_doc_source.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getFieldsForWildcard", - "type": "Function", - "tags": [], - "label": "getFieldsForWildcard", - "description": [ - "\nGet field list by providing { pattern }" - ], - "signature": [ - "(options: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" - }, - ") => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getFieldsForWildcard.$1", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "FieldSpec[]" - ] + "plugin": "maps", + "path": "x-pack/plugins/maps/server/data_indexing/create_doc_source.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getFieldsForIndexPattern", - "type": "Function", - "tags": [], - "label": "getFieldsForIndexPattern", - "description": [ - "\nGet field list by providing an index patttern (or spec)" - ], - "signature": [ - "(indexPattern: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - }, - ", options?: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" - }, - " | undefined) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getFieldsForIndexPattern.$1", - "type": "CompoundType", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.getFieldsForIndexPattern.$2", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [ - "FieldSpec[]" - ] + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.refreshFields", - "type": "Function", - "tags": [], - "label": "refreshFields", - "description": [ - "\nRefresh field list for a given index pattern" - ], - "signature": [ - "(indexPattern: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ") => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.refreshFields.$1", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.fieldArrayToMap", - "type": "Function", - "tags": [], - "label": "fieldArrayToMap", - "description": [ - "\nConverts field array to map" - ], - "signature": [ - "(fields: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - "[], fieldAttrs?: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldAttrs", - "text": "FieldAttrs" - }, - " | undefined) => Record" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.fieldArrayToMap.$1", - "type": "Array", - "tags": [], - "label": "fields", - "description": [ - ": FieldSpec[]" - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - "[]" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.fieldArrayToMap.$2", - "type": "Object", - "tags": [], - "label": "fieldAttrs", - "description": [ - ": FieldAttrs" - ], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldAttrs", - "text": "FieldAttrs" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [ - "Record" - ] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.savedObjectToSpec", - "type": "Function", - "tags": [], - "label": "savedObjectToSpec", - "description": [ - "\nConverts index pattern saved object to index pattern spec" - ], - "signature": [ - "(savedObject: ", - "SavedObject", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternAttributes", - "text": "IndexPatternAttributes" - }, - ">) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.savedObjectToSpec.$1", - "type": "Object", - "tags": [], - "label": "savedObject", - "description": [], - "signature": [ - "SavedObject", - "<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternAttributes", - "text": "IndexPatternAttributes" - }, - ">" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "IndexPatternSpec" - ] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.get", - "type": "Function", - "tags": [], - "label": "get", - "description": [ - "\nGet an index pattern by id. Cache optimized" - ], - "signature": [ - "(id: string) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ">" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.get.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/fields_fetcher.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.create", - "type": "Function", - "tags": [], - "label": "create", - "description": [ - "\nCreate a new index pattern instance" - ], - "signature": [ - "(spec: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - }, - ", skipFetchFields?: boolean) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ">" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.create.$1", - "type": "Object", - "tags": [], - "label": "spec", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.create.$2", - "type": "boolean", - "tags": [], - "label": "skipFetchFields", - "description": [], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "IndexPattern" - ] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/fields_fetcher.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.createAndSave", - "type": "Function", - "tags": [], - "label": "createAndSave", - "description": [ - "\nCreate a new index pattern and save it right away" - ], - "signature": [ - "(spec: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - }, - ", override?: boolean, skipFetchFields?: boolean) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ">" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.createAndSave.$1", - "type": "Object", - "tags": [], - "label": "spec", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.createAndSave.$2", - "type": "boolean", - "tags": [], - "label": "override", - "description": [ - "Overwrite if existing index pattern exists." - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.createAndSave.$3", - "type": "boolean", - "tags": [], - "label": "skipFetchFields", - "description": [ - "Whether to skip field refresh step." - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/plugin.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.createSavedObject", - "type": "Function", - "tags": [], - "label": "createSavedObject", - "description": [ - "\nSave a new index pattern" - ], - "signature": [ - "(indexPattern: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ", override?: boolean) => Promise<", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ">" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.createSavedObject.$1", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.createSavedObject.$2", - "type": "boolean", - "tags": [], - "label": "override", - "description": [ - "Overwrite if existing index pattern exists" - ], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/plugin.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.updateSavedObject", - "type": "Function", - "tags": [], - "label": "updateSavedObject", - "description": [ - "\nSave existing index pattern. Will attempt to merge differences if there are conflicts" - ], - "signature": [ - "(indexPattern: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - }, - ", saveAttempts?: number, ignoreErrors?: boolean) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.updateSavedObject.$1", - "type": "Object", - "tags": [], - "label": "indexPattern", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" - } - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.updateSavedObject.$2", - "type": "number", - "tags": [], - "label": "saveAttempts", - "description": [], - "signature": [ - "number" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.updateSavedObject.$3", - "type": "boolean", - "tags": [], - "label": "ignoreErrors", - "description": [], - "signature": [ - "boolean" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.delete", - "type": "Function", - "tags": [], - "label": "delete", - "description": [ - "\nDeletes an index pattern from .kibana index" - ], - "signature": [ - "(indexPatternId: string) => Promise<{}>" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternsService.delete.$1", - "type": "string", - "tags": [], - "label": "indexPatternId", - "description": [ - ": Id of kibana Index Pattern to delete" - ], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_patterns.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_patterns.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/combo_box_select.tsx" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/combo_box_select.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" } ], + "children": [], "initialIsOpen": false } ], @@ -27120,7 +29579,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.esType", + "id": "def-server.castEsToKbnFieldTypeName.$1", "type": "string", "tags": [], "label": "esType", @@ -27241,7 +29700,7 @@ }, { "parentPluginId": "data", - "id": "def-server.getTime.$3.options", + "id": "def-server.getTime.$3", "type": "Object", "tags": [], "label": "options", @@ -27251,7 +29710,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.getTime.$3.options.forceNow", + "id": "def-server.getTime.$3.forceNow", "type": "Object", "tags": [], "label": "forceNow", @@ -27264,7 +29723,7 @@ }, { "parentPluginId": "data", - "id": "def-server.getTime.$3.options.fieldName", + "id": "def-server.getTime.$3.fieldName", "type": "string", "tags": [], "label": "fieldName", @@ -27384,7 +29843,7 @@ "text": "IFieldType" }, " extends ", - "IndexPatternFieldBase" + "DataViewFieldBase" ], "path": "src/plugins/data/common/index_patterns/fields/types.ts", "deprecated": true, @@ -27402,238 +29861,6 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metrics_editor.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metrics_editor.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/update_source_editor.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/update_source_editor.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" - }, { "plugin": "ml", "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" @@ -27774,14 +30001,6 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts" - }, { "plugin": "stackAlerts", "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" @@ -27814,86 +30033,6 @@ "plugin": "stackAlerts", "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" - }, { "plugin": "ml", "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts" @@ -27922,26 +30061,6 @@ "plugin": "ml", "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" - }, { "plugin": "infra", "path": "x-pack/plugins/infra/target/types/public/alerting/common/group_by_expression/group_by_expression.d.ts" @@ -27982,22 +30101,6 @@ "plugin": "infra", "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_row.d.ts" }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" - }, { "plugin": "infra", "path": "x-pack/plugins/infra/target/types/public/alerting/log_threshold/components/expression_editor/criteria.d.ts" @@ -28030,30 +30133,6 @@ "plugin": "infra", "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/components/metrics.d.ts" }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.d.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.d.ts" - }, { "plugin": "stackAlerts", "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/single_field_select.d.ts" @@ -28110,66 +30189,6 @@ "plugin": "indexPatternManagement", "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts" - }, - { - "plugin": "lens", - "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts" - }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts" - }, { "plugin": "stackAlerts", "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" @@ -28233,14 +30252,6 @@ { "plugin": "stackAlerts", "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" } ], "children": [ @@ -28408,16 +30419,16 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" + "section": "def-common.FieldSpec", + "text": "FieldSpec" }, " | ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" + "section": "def-common.DataViewField", + "text": "DataViewField" }, ") => ", { @@ -28442,7 +30453,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.IFieldType.toSpec.$1.options", + "id": "def-server.IFieldType.toSpec.$1", "type": "Object", "tags": [], "label": "options", @@ -28452,7 +30463,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.IFieldType.toSpec.$1.options.getFormatterForField", + "id": "def-server.IFieldType.toSpec.$1.getFormatterForField", "type": "Function", "tags": [], "label": "getFormatterForField", @@ -28471,16 +30482,16 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" + "section": "def-common.FieldSpec", + "text": "FieldSpec" }, " | ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" + "section": "def-common.DataViewField", + "text": "DataViewField" }, ") => ", { @@ -28503,154 +30514,6 @@ ], "initialIsOpen": false }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternAttributes", - "type": "Interface", - "tags": [], - "label": "IndexPatternAttributes", - "description": [ - "\nInterface for an index pattern saved object" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-server.IndexPatternAttributes.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternAttributes.fields", - "type": "string", - "tags": [], - "label": "fields", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternAttributes.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternAttributes.typeMeta", - "type": "string", - "tags": [], - "label": "typeMeta", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternAttributes.timeFieldName", - "type": "string", - "tags": [], - "label": "timeFieldName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternAttributes.intervalName", - "type": "string", - "tags": [], - "label": "intervalName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternAttributes.sourceFilters", - "type": "string", - "tags": [], - "label": "sourceFilters", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternAttributes.fieldFormatMap", - "type": "string", - "tags": [], - "label": "fieldFormatMap", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternAttributes.fieldAttrs", - "type": "string", - "tags": [], - "label": "fieldAttrs", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternAttributes.runtimeFieldMap", - "type": "string", - "tags": [], - "label": "runtimeFieldMap", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-server.IndexPatternAttributes.allowNoIndex", - "type": "CompoundType", - "tags": [], - "label": "allowNoIndex", - "description": [ - "\nprevents errors when index pattern exists before indices" - ], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, { "parentPluginId": "data", "id": "def-server.ISearchOptions", @@ -28919,14 +30782,6 @@ "deprecated": true, "removeBy": "8.1", "references": [ - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts" - }, { "plugin": "discover", "path": "src/plugins/discover/public/url_generator.ts" @@ -28961,63 +30816,63 @@ }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context/api/context.ts" + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context/api/context.ts" + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context/api/context.ts" + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context/api/context.ts" + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" }, { "plugin": "visualizations", @@ -29129,15 +30984,15 @@ }, { "plugin": "dashboard", - "path": "src/plugins/dashboard/public/url_generator.ts" + "path": "src/plugins/dashboard/public/locator.ts" }, { "plugin": "dashboard", - "path": "src/plugins/dashboard/public/url_generator.ts" + "path": "src/plugins/dashboard/public/locator.ts" }, { "plugin": "dashboard", - "path": "src/plugins/dashboard/public/url_generator.ts" + "path": "src/plugins/dashboard/public/locator.ts" }, { "plugin": "dashboard", @@ -29145,15 +31000,15 @@ }, { "plugin": "dashboard", - "path": "src/plugins/dashboard/public/locator.ts" + "path": "src/plugins/dashboard/public/url_generator.ts" }, { "plugin": "dashboard", - "path": "src/plugins/dashboard/public/locator.ts" + "path": "src/plugins/dashboard/public/url_generator.ts" }, { "plugin": "dashboard", - "path": "src/plugins/dashboard/public/locator.ts" + "path": "src/plugins/dashboard/public/url_generator.ts" }, { "plugin": "lens", @@ -29297,47 +31152,47 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.ts" + "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.ts" + "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + "path": "x-pack/plugins/maps/public/actions/map_actions.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + "path": "x-pack/plugins/maps/public/actions/map_actions.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/actions/map_actions.ts" + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/actions/map_actions.ts" + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" }, { "plugin": "maps", @@ -29523,14 +31378,6 @@ "plugin": "infra", "path": "x-pack/plugins/infra/public/components/log_stream/log_stream_embeddable.tsx" }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts" - }, { "plugin": "lens", "path": "x-pack/plugins/lens/server/migrations/types.ts" @@ -30059,14 +31906,6 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.test.ts" }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts" - }, { "plugin": "discoverEnhanced", "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts" @@ -30369,11 +32208,11 @@ }, { "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts" + "path": "src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts" }, { "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts" + "path": "src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts" }, { "plugin": "visualize", @@ -30409,19 +32248,11 @@ }, { "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/timelion_vis_fn.ts" + "path": "src/plugins/vis_types/timelion/public/timelion_vis_fn.ts" }, { "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/timelion_vis_fn.ts" - }, - { - "plugin": "visTypeVega", - "path": "src/plugins/vis_type_vega/public/vega_request_handler.ts" - }, - { - "plugin": "visTypeVega", - "path": "src/plugins/vis_type_vega/public/vega_request_handler.ts" + "path": "src/plugins/vis_types/timelion/public/timelion_vis_fn.ts" }, { "plugin": "dashboard", @@ -30432,16 +32263,12 @@ "path": "src/plugins/dashboard/server/saved_objects/move_filters_to_query.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.test.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.test.ts" + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/vega_request_handler.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.test.ts" + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/vega_request_handler.ts" }, { "plugin": "inputControlVis", @@ -30497,15 +32324,27 @@ }, { "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/angular/context/api/context.d.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context_state.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context_state.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/angular/context/api/context.d.ts" + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/angular/context/api/context.d.ts" + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" }, { "plugin": "securitySolution", @@ -30533,19 +32372,19 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/common/elasticsearch_util/types.ts" + "path": "x-pack/plugins/maps/public/embeddable/types.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/common/elasticsearch_util/types.ts" + "path": "x-pack/plugins/maps/public/embeddable/types.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/embeddable/types.ts" + "path": "x-pack/plugins/maps/common/elasticsearch_util/types.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/embeddable/types.ts" + "path": "x-pack/plugins/maps/common/elasticsearch_util/types.ts" }, { "plugin": "maps", @@ -30679,6 +32518,22 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/target/types/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.d.ts" }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/common/locator.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/common/locator.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/target/types/common/locator.d.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/target/types/common/locator.d.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_preview/helpers.ts" @@ -30723,6 +32578,14 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/network/pages/navigation/alerts_query_tab_body.tsx" @@ -30796,14 +32659,222 @@ "parentPluginId": "data", "id": "def-server.INDEX_PATTERN_SAVED_OBJECT_TYPE", "type": "string", - "tags": [], + "tags": [ + "deprecated" + ], "label": "INDEX_PATTERN_SAVED_OBJECT_TYPE", "description": [], "signature": [ "\"index-pattern\"" ], "path": "src/plugins/data/common/constants.ts", - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/controls_references.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/controls_references.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/timeseries_references.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/timeseries_references.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/replace_index_pattern_reference.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/replace_index_pattern_reference.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts" + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-server.IndexPatternAttributes", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "IndexPatternAttributes", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + } + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": true, + "references": [ + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/lib/es_service.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/lib/es_service.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/lib/es_service.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" + }, + { + "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/models/job_service/new_job_caps/rollup.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/models/data_recognizer/data_recognizer.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/types.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/types.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_app.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_app.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_route.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_route.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_route.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/common/types/kibana.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/common/types/kibana.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/common/types/kibana.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/common/types/kibana.d.ts" + } + ], "initialIsOpen": false }, { @@ -31098,7 +33169,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.query", + "id": "def-server.esFilters.buildQueryFilter.$1", "type": "CompoundType", "tags": [], "label": "query", @@ -31111,7 +33182,7 @@ }, { "parentPluginId": "data", - "id": "def-server.index", + "id": "def-server.esFilters.buildQueryFilter.$2", "type": "string", "tags": [], "label": "index", @@ -31121,7 +33192,7 @@ }, { "parentPluginId": "data", - "id": "def-server.alias", + "id": "def-server.esFilters.buildQueryFilter.$3", "type": "string", "tags": [], "label": "alias", @@ -31152,7 +33223,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.indexPatternString", + "id": "def-server.esFilters.buildCustomFilter.$1", "type": "string", "tags": [], "label": "indexPatternString", @@ -31162,7 +33233,7 @@ }, { "parentPluginId": "data", - "id": "def-server.queryDsl", + "id": "def-server.esFilters.buildCustomFilter.$2", "type": "Object", "tags": [], "label": "queryDsl", @@ -31175,7 +33246,7 @@ }, { "parentPluginId": "data", - "id": "def-server.disabled", + "id": "def-server.esFilters.buildCustomFilter.$3", "type": "boolean", "tags": [], "label": "disabled", @@ -31185,7 +33256,7 @@ }, { "parentPluginId": "data", - "id": "def-server.negate", + "id": "def-server.esFilters.buildCustomFilter.$4", "type": "boolean", "tags": [], "label": "negate", @@ -31195,7 +33266,7 @@ }, { "parentPluginId": "data", - "id": "def-server.alias", + "id": "def-server.esFilters.buildCustomFilter.$5", "type": "CompoundType", "tags": [], "label": "alias", @@ -31208,7 +33279,7 @@ }, { "parentPluginId": "data", - "id": "def-server.store", + "id": "def-server.esFilters.buildCustomFilter.$6", "type": "Enum", "tags": [], "label": "store", @@ -31238,7 +33309,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.isPinned", + "id": "def-server.esFilters.buildEmptyFilter.$1", "type": "boolean", "tags": [], "label": "isPinned", @@ -31248,7 +33319,7 @@ }, { "parentPluginId": "data", - "id": "def-server.index", + "id": "def-server.esFilters.buildEmptyFilter.$2", "type": "string", "tags": [], "label": "index", @@ -31270,9 +33341,9 @@ "description": [], "signature": [ "(field: ", - "IndexPatternFieldBase", + "DataViewFieldBase", ", indexPattern: ", - "IndexPatternBase", + "DataViewBase", ") => ", "ExistsFilter" ], @@ -31282,26 +33353,26 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.field", + "id": "def-server.esFilters.buildExistsFilter.$1", "type": "Object", "tags": [], "label": "field", "description": [], "signature": [ - "IndexPatternFieldBase" + "DataViewFieldBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/exists_filter.d.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-server.indexPattern", + "id": "def-server.esFilters.buildExistsFilter.$2", "type": "Object", "tags": [], "label": "indexPattern", "description": [], "signature": [ - "IndexPatternBase" + "DataViewBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/exists_filter.d.ts", "deprecated": false @@ -31317,9 +33388,9 @@ "description": [], "signature": [ "(indexPattern: ", - "IndexPatternBase", + "DataViewBase", ", field: ", - "IndexPatternFieldBase", + "DataViewFieldBase", ", type: ", "FILTERS", ", negate: boolean, disabled: boolean, params: ", @@ -31335,33 +33406,33 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.indexPattern", + "id": "def-server.esFilters.buildFilter.$1", "type": "Object", "tags": [], "label": "indexPattern", "description": [], "signature": [ - "IndexPatternBase" + "DataViewBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/build_filters.d.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-server.field", + "id": "def-server.esFilters.buildFilter.$2", "type": "Object", "tags": [], "label": "field", "description": [], "signature": [ - "IndexPatternFieldBase" + "DataViewFieldBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/build_filters.d.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-server.type", + "id": "def-server.esFilters.buildFilter.$3", "type": "Enum", "tags": [], "label": "type", @@ -31374,7 +33445,7 @@ }, { "parentPluginId": "data", - "id": "def-server.negate", + "id": "def-server.esFilters.buildFilter.$4", "type": "boolean", "tags": [], "label": "negate", @@ -31384,7 +33455,7 @@ }, { "parentPluginId": "data", - "id": "def-server.disabled", + "id": "def-server.esFilters.buildFilter.$5", "type": "boolean", "tags": [], "label": "disabled", @@ -31394,7 +33465,7 @@ }, { "parentPluginId": "data", - "id": "def-server.params", + "id": "def-server.esFilters.buildFilter.$6", "type": "CompoundType", "tags": [], "label": "params", @@ -31411,7 +33482,7 @@ }, { "parentPluginId": "data", - "id": "def-server.alias", + "id": "def-server.esFilters.buildFilter.$7", "type": "CompoundType", "tags": [], "label": "alias", @@ -31424,7 +33495,7 @@ }, { "parentPluginId": "data", - "id": "def-server.store", + "id": "def-server.esFilters.buildFilter.$8", "type": "CompoundType", "tags": [], "label": "store", @@ -31447,11 +33518,11 @@ "description": [], "signature": [ "(field: ", - "IndexPatternFieldBase", + "DataViewFieldBase", ", value: ", "PhraseFilterValue", ", indexPattern: ", - "IndexPatternBase", + "DataViewBase", ") => ", "PhraseFilter", " | ", @@ -31463,20 +33534,20 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.field", + "id": "def-server.esFilters.buildPhraseFilter.$1", "type": "Object", "tags": [], "label": "field", "description": [], "signature": [ - "IndexPatternFieldBase" + "DataViewFieldBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrase_filter.d.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-server.value", + "id": "def-server.esFilters.buildPhraseFilter.$2", "type": "CompoundType", "tags": [], "label": "value", @@ -31489,13 +33560,13 @@ }, { "parentPluginId": "data", - "id": "def-server.indexPattern", + "id": "def-server.esFilters.buildPhraseFilter.$3", "type": "Object", "tags": [], "label": "indexPattern", "description": [], "signature": [ - "IndexPatternBase" + "DataViewBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrase_filter.d.ts", "deprecated": false @@ -31511,11 +33582,11 @@ "description": [], "signature": [ "(field: ", - "IndexPatternFieldBase", + "DataViewFieldBase", ", params: ", "PhraseFilterValue", "[], indexPattern: ", - "IndexPatternBase", + "DataViewBase", ") => ", "PhrasesFilter" ], @@ -31525,20 +33596,20 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.field", + "id": "def-server.esFilters.buildPhrasesFilter.$1", "type": "Object", "tags": [], "label": "field", "description": [], "signature": [ - "IndexPatternFieldBase" + "DataViewFieldBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrases_filter.d.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-server.params", + "id": "def-server.esFilters.buildPhrasesFilter.$2", "type": "Array", "tags": [], "label": "params", @@ -31552,13 +33623,13 @@ }, { "parentPluginId": "data", - "id": "def-server.indexPattern", + "id": "def-server.esFilters.buildPhrasesFilter.$3", "type": "Object", "tags": [], "label": "indexPattern", "description": [], "signature": [ - "IndexPatternBase" + "DataViewBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrases_filter.d.ts", "deprecated": false @@ -31574,11 +33645,11 @@ "description": [], "signature": [ "(field: ", - "IndexPatternFieldBase", + "DataViewFieldBase", ", params: ", "RangeFilterParams", ", indexPattern: ", - "IndexPatternBase", + "DataViewBase", ", formattedValue?: string | undefined) => ", "RangeFilter", " | ", @@ -31592,20 +33663,20 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.field", + "id": "def-server.esFilters.buildRangeFilter.$1", "type": "Object", "tags": [], "label": "field", "description": [], "signature": [ - "IndexPatternFieldBase" + "DataViewFieldBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/range_filter.d.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-server.params", + "id": "def-server.esFilters.buildRangeFilter.$2", "type": "Object", "tags": [], "label": "params", @@ -31618,20 +33689,20 @@ }, { "parentPluginId": "data", - "id": "def-server.indexPattern", + "id": "def-server.esFilters.buildRangeFilter.$3", "type": "Object", "tags": [], "label": "indexPattern", "description": [], "signature": [ - "IndexPatternBase" + "DataViewBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/range_filter.d.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-server.formattedValue", + "id": "def-server.esFilters.buildRangeFilter.$4", "type": "string", "tags": [], "label": "formattedValue", @@ -31662,7 +33733,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.filter", + "id": "def-server.esFilters.isFilterDisabled.$1", "type": "Object", "tags": [], "label": "filter", @@ -31726,7 +33797,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.expression", + "id": "def-server.esKuery.fromKueryExpression.$1", "type": "CompoundType", "tags": [], "label": "expression", @@ -31740,7 +33811,7 @@ }, { "parentPluginId": "data", - "id": "def-server.parseOptions", + "id": "def-server.esKuery.fromKueryExpression.$2", "type": "Object", "tags": [], "label": "parseOptions", @@ -31766,7 +33837,7 @@ "(node: ", "KueryNode", ", indexPattern?: ", - "IndexPatternBase", + "DataViewBase", " | undefined, config?: ", "KueryQueryOptions", " | undefined, context?: Record | undefined) => ", @@ -31778,7 +33849,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.node", + "id": "def-server.esKuery.toElasticsearchQuery.$1", "type": "Object", "tags": [], "label": "node", @@ -31791,13 +33862,13 @@ }, { "parentPluginId": "data", - "id": "def-server.indexPattern", + "id": "def-server.esKuery.toElasticsearchQuery.$2", "type": "Object", "tags": [], "label": "indexPattern", "description": [], "signature": [ - "IndexPatternBase", + "DataViewBase", " | undefined" ], "path": "node_modules/@kbn/es-query/target_types/kuery/index.d.ts", @@ -31805,7 +33876,7 @@ }, { "parentPluginId": "data", - "id": "def-server.config", + "id": "def-server.esKuery.toElasticsearchQuery.$3", "type": "Object", "tags": [], "label": "config", @@ -31819,7 +33890,7 @@ }, { "parentPluginId": "data", - "id": "def-server.context", + "id": "def-server.esKuery.toElasticsearchQuery.$4", "type": "Object", "tags": [], "label": "context", @@ -31856,7 +33927,7 @@ "(filters: ", "Filter", "[] | undefined, indexPattern: ", - "IndexPatternBase", + "DataViewBase", " | undefined, ignoreFilterIfFieldNotInIndex?: boolean | undefined) => ", "BoolQuery" ], @@ -31866,7 +33937,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.filters", + "id": "def-server.esQuery.buildQueryFromFilters.$1", "type": "Array", "tags": [], "label": "filters", @@ -31880,13 +33951,13 @@ }, { "parentPluginId": "data", - "id": "def-server.indexPattern", + "id": "def-server.esQuery.buildQueryFromFilters.$2", "type": "Object", "tags": [], "label": "indexPattern", "description": [], "signature": [ - "IndexPatternBase", + "DataViewBase", " | undefined" ], "path": "node_modules/@kbn/es-query/target_types/es_query/from_filters.d.ts", @@ -31894,7 +33965,7 @@ }, { "parentPluginId": "data", - "id": "def-server.ignoreFilterIfFieldNotInIndex", + "id": "def-server.esQuery.buildQueryFromFilters.$3", "type": "CompoundType", "tags": [], "label": "ignoreFilterIfFieldNotInIndex", @@ -31924,7 +33995,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.config", + "id": "def-server.esQuery.getEsQueryConfig.$1", "type": "Object", "tags": [], "label": "config", @@ -31946,7 +34017,7 @@ "description": [], "signature": [ "(indexPattern: ", - "IndexPatternBase", + "DataViewBase", " | undefined, queries: ", "Query", " | ", @@ -31967,13 +34038,13 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.indexPattern", + "id": "def-server.esQuery.buildEsQuery.$1", "type": "Object", "tags": [], "label": "indexPattern", "description": [], "signature": [ - "IndexPatternBase", + "DataViewBase", " | undefined" ], "path": "node_modules/@kbn/es-query/target_types/es_query/build_es_query.d.ts", @@ -31981,7 +34052,7 @@ }, { "parentPluginId": "data", - "id": "def-server.queries", + "id": "def-server.esQuery.buildEsQuery.$2", "type": "CompoundType", "tags": [], "label": "queries", @@ -31997,7 +34068,7 @@ }, { "parentPluginId": "data", - "id": "def-server.filters", + "id": "def-server.esQuery.buildEsQuery.$3", "type": "CompoundType", "tags": [], "label": "filters", @@ -32013,7 +34084,7 @@ }, { "parentPluginId": "data", - "id": "def-server.config", + "id": "def-server.esQuery.buildEsQuery.$4", "type": "CompoundType", "tags": [], "label": "config", @@ -32064,7 +34135,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.__0", + "id": "def-server.exporters.datatableToCSV.$1", "type": "Object", "tags": [], "label": "__0", @@ -32083,7 +34154,7 @@ }, { "parentPluginId": "data", - "id": "def-server.__1", + "id": "def-server.exporters.datatableToCSV.$2", "type": "Object", "tags": [], "label": "__1", @@ -32165,7 +34236,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.interval", + "id": "def-server.search.aggs.dateHistogramInterval.$1", "type": "string", "tags": [], "label": "interval", @@ -32211,7 +34282,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.interval", + "id": "def-server.search.aggs.parseInterval.$1", "type": "string", "tags": [], "label": "interval", @@ -32237,7 +34308,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.maxBucketCount", + "id": "def-server.search.aggs.calcAutoIntervalLessThan.$1", "type": "number", "tags": [], "label": "maxBucketCount", @@ -32247,7 +34318,7 @@ }, { "parentPluginId": "data", - "id": "def-server.duration", + "id": "def-server.search.aggs.calcAutoIntervalLessThan.$2", "type": "number", "tags": [], "label": "duration", @@ -32270,7 +34341,7 @@ "label": "UI_SETTINGS", "description": [], "signature": [ - "{ readonly META_FIELDS: \"metaFields\"; readonly DOC_HIGHLIGHT: \"doc_table:highlight\"; readonly QUERY_STRING_OPTIONS: \"query:queryString:options\"; readonly QUERY_ALLOW_LEADING_WILDCARDS: \"query:allowLeadingWildcards\"; readonly SEARCH_QUERY_LANGUAGE: \"search:queryLanguage\"; readonly SORT_OPTIONS: \"sort:options\"; readonly COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX: \"courier:ignoreFilterIfFieldNotInIndex\"; readonly COURIER_SET_REQUEST_PREFERENCE: \"courier:setRequestPreference\"; readonly COURIER_CUSTOM_REQUEST_PREFERENCE: \"courier:customRequestPreference\"; readonly COURIER_MAX_CONCURRENT_SHARD_REQUESTS: \"courier:maxConcurrentShardRequests\"; readonly SEARCH_INCLUDE_FROZEN: \"search:includeFrozen\"; readonly SEARCH_TIMEOUT: \"search:timeout\"; readonly HISTOGRAM_BAR_TARGET: \"histogram:barTarget\"; readonly HISTOGRAM_MAX_BARS: \"histogram:maxBars\"; readonly HISTORY_LIMIT: \"history:limit\"; readonly TIMEPICKER_REFRESH_INTERVAL_DEFAULTS: \"timepicker:refreshIntervalDefaults\"; readonly TIMEPICKER_QUICK_RANGES: \"timepicker:quickRanges\"; readonly TIMEPICKER_TIME_DEFAULTS: \"timepicker:timeDefaults\"; readonly INDEXPATTERN_PLACEHOLDER: \"indexPattern:placeholder\"; readonly FILTERS_PINNED_BY_DEFAULT: \"filters:pinnedByDefault\"; readonly FILTERS_EDITOR_SUGGEST_VALUES: \"filterEditor:suggestValues\"; readonly AUTOCOMPLETE_USE_TIMERANGE: \"autocomplete:useTimeRange\"; readonly AUTOCOMPLETE_VALUE_SUGGESTION_METHOD: \"autocomplete:valueSuggestionMethod\"; }" + "{ readonly META_FIELDS: \"metaFields\"; readonly DOC_HIGHLIGHT: \"doc_table:highlight\"; readonly QUERY_STRING_OPTIONS: \"query:queryString:options\"; readonly QUERY_ALLOW_LEADING_WILDCARDS: \"query:allowLeadingWildcards\"; readonly SEARCH_QUERY_LANGUAGE: \"search:queryLanguage\"; readonly SORT_OPTIONS: \"sort:options\"; readonly COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX: \"courier:ignoreFilterIfFieldNotInIndex\"; readonly COURIER_SET_REQUEST_PREFERENCE: \"courier:setRequestPreference\"; readonly COURIER_CUSTOM_REQUEST_PREFERENCE: \"courier:customRequestPreference\"; readonly COURIER_MAX_CONCURRENT_SHARD_REQUESTS: \"courier:maxConcurrentShardRequests\"; readonly SEARCH_INCLUDE_FROZEN: \"search:includeFrozen\"; readonly SEARCH_TIMEOUT: \"search:timeout\"; readonly HISTOGRAM_BAR_TARGET: \"histogram:barTarget\"; readonly HISTOGRAM_MAX_BARS: \"histogram:maxBars\"; readonly HISTORY_LIMIT: \"history:limit\"; readonly TIMEPICKER_REFRESH_INTERVAL_DEFAULTS: \"timepicker:refreshIntervalDefaults\"; readonly TIMEPICKER_QUICK_RANGES: \"timepicker:quickRanges\"; readonly TIMEPICKER_TIME_DEFAULTS: \"timepicker:timeDefaults\"; readonly FILTERS_PINNED_BY_DEFAULT: \"filters:pinnedByDefault\"; readonly FILTERS_EDITOR_SUGGEST_VALUES: \"filterEditor:suggestValues\"; readonly AUTOCOMPLETE_USE_TIMERANGE: \"autocomplete:useTimeRange\"; readonly AUTOCOMPLETE_VALUE_SUGGESTION_METHOD: \"autocomplete:valueSuggestionMethod\"; }" ], "path": "src/plugins/data/common/constants.ts", "deprecated": false, @@ -32533,7 +34604,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.indexPatternString", + "id": "def-common.buildCustomFilter.$1", "type": "string", "tags": [], "label": "indexPatternString", @@ -32543,7 +34614,7 @@ }, { "parentPluginId": "data", - "id": "def-common.queryDsl", + "id": "def-common.buildCustomFilter.$2", "type": "Object", "tags": [], "label": "queryDsl", @@ -32556,7 +34627,7 @@ }, { "parentPluginId": "data", - "id": "def-common.disabled", + "id": "def-common.buildCustomFilter.$3", "type": "boolean", "tags": [], "label": "disabled", @@ -32566,7 +34637,7 @@ }, { "parentPluginId": "data", - "id": "def-common.negate", + "id": "def-common.buildCustomFilter.$4", "type": "boolean", "tags": [], "label": "negate", @@ -32576,7 +34647,7 @@ }, { "parentPluginId": "data", - "id": "def-common.alias", + "id": "def-common.buildCustomFilter.$5", "type": "CompoundType", "tags": [], "label": "alias", @@ -32589,7 +34660,7 @@ }, { "parentPluginId": "data", - "id": "def-common.store", + "id": "def-common.buildCustomFilter.$6", "type": "Enum", "tags": [], "label": "store", @@ -32624,7 +34695,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.isPinned", + "id": "def-common.buildEmptyFilter.$1", "type": "boolean", "tags": [], "label": "isPinned", @@ -32634,7 +34705,7 @@ }, { "parentPluginId": "data", - "id": "def-common.index", + "id": "def-common.buildEmptyFilter.$2", "type": "string", "tags": [], "label": "index", @@ -32659,7 +34730,7 @@ "description": [], "signature": [ "(indexPattern: ", - "IndexPatternBase", + "DataViewBase", " | undefined, queries: ", "Query", " | ", @@ -32682,13 +34753,13 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.indexPattern", + "id": "def-common.buildEsQuery.$1", "type": "Object", "tags": [], "label": "indexPattern", "description": [], "signature": [ - "IndexPatternBase", + "DataViewBase", " | undefined" ], "path": "node_modules/@kbn/es-query/target_types/es_query/build_es_query.d.ts", @@ -32696,7 +34767,7 @@ }, { "parentPluginId": "data", - "id": "def-common.queries", + "id": "def-common.buildEsQuery.$2", "type": "CompoundType", "tags": [], "label": "queries", @@ -32712,7 +34783,7 @@ }, { "parentPluginId": "data", - "id": "def-common.filters", + "id": "def-common.buildEsQuery.$3", "type": "CompoundType", "tags": [], "label": "filters", @@ -32728,7 +34799,7 @@ }, { "parentPluginId": "data", - "id": "def-common.config", + "id": "def-common.buildEsQuery.$4", "type": "CompoundType", "tags": [], "label": "config", @@ -32754,9 +34825,9 @@ "description": [], "signature": [ "(field: ", - "IndexPatternFieldBase", + "DataViewFieldBase", ", indexPattern: ", - "IndexPatternBase", + "DataViewBase", ") => ", "ExistsFilter" ], @@ -32768,26 +34839,26 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.field", + "id": "def-common.buildExistsFilter.$1", "type": "Object", "tags": [], "label": "field", "description": [], "signature": [ - "IndexPatternFieldBase" + "DataViewFieldBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/exists_filter.d.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-common.indexPattern", + "id": "def-common.buildExistsFilter.$2", "type": "Object", "tags": [], "label": "indexPattern", "description": [], "signature": [ - "IndexPatternBase" + "DataViewBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/exists_filter.d.ts", "deprecated": false @@ -32806,9 +34877,9 @@ "description": [], "signature": [ "(indexPattern: ", - "IndexPatternBase", + "DataViewBase", ", field: ", - "IndexPatternFieldBase", + "DataViewFieldBase", ", type: ", "FILTERS", ", negate: boolean, disabled: boolean, params: ", @@ -32826,33 +34897,33 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.indexPattern", + "id": "def-common.buildFilter.$1", "type": "Object", "tags": [], "label": "indexPattern", "description": [], "signature": [ - "IndexPatternBase" + "DataViewBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/build_filters.d.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-common.field", + "id": "def-common.buildFilter.$2", "type": "Object", "tags": [], "label": "field", "description": [], "signature": [ - "IndexPatternFieldBase" + "DataViewFieldBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/build_filters.d.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-common.type", + "id": "def-common.buildFilter.$3", "type": "Enum", "tags": [], "label": "type", @@ -32865,7 +34936,7 @@ }, { "parentPluginId": "data", - "id": "def-common.negate", + "id": "def-common.buildFilter.$4", "type": "boolean", "tags": [], "label": "negate", @@ -32875,7 +34946,7 @@ }, { "parentPluginId": "data", - "id": "def-common.disabled", + "id": "def-common.buildFilter.$5", "type": "boolean", "tags": [], "label": "disabled", @@ -32885,7 +34956,7 @@ }, { "parentPluginId": "data", - "id": "def-common.params", + "id": "def-common.buildFilter.$6", "type": "CompoundType", "tags": [], "label": "params", @@ -32902,7 +34973,7 @@ }, { "parentPluginId": "data", - "id": "def-common.alias", + "id": "def-common.buildFilter.$7", "type": "CompoundType", "tags": [], "label": "alias", @@ -32915,7 +34986,7 @@ }, { "parentPluginId": "data", - "id": "def-common.store", + "id": "def-common.buildFilter.$8", "type": "CompoundType", "tags": [], "label": "store", @@ -32941,11 +35012,11 @@ "description": [], "signature": [ "(field: ", - "IndexPatternFieldBase", + "DataViewFieldBase", ", value: ", "PhraseFilterValue", ", indexPattern: ", - "IndexPatternBase", + "DataViewBase", ") => ", "PhraseFilter", " | ", @@ -32959,20 +35030,20 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.field", + "id": "def-common.buildPhraseFilter.$1", "type": "Object", "tags": [], "label": "field", "description": [], "signature": [ - "IndexPatternFieldBase" + "DataViewFieldBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrase_filter.d.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-common.value", + "id": "def-common.buildPhraseFilter.$2", "type": "CompoundType", "tags": [], "label": "value", @@ -32985,13 +35056,13 @@ }, { "parentPluginId": "data", - "id": "def-common.indexPattern", + "id": "def-common.buildPhraseFilter.$3", "type": "Object", "tags": [], "label": "indexPattern", "description": [], "signature": [ - "IndexPatternBase" + "DataViewBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrase_filter.d.ts", "deprecated": false @@ -33010,11 +35081,11 @@ "description": [], "signature": [ "(field: ", - "IndexPatternFieldBase", + "DataViewFieldBase", ", params: ", "PhraseFilterValue", "[], indexPattern: ", - "IndexPatternBase", + "DataViewBase", ") => ", "PhrasesFilter" ], @@ -33026,20 +35097,20 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.field", + "id": "def-common.buildPhrasesFilter.$1", "type": "Object", "tags": [], "label": "field", "description": [], "signature": [ - "IndexPatternFieldBase" + "DataViewFieldBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrases_filter.d.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-common.params", + "id": "def-common.buildPhrasesFilter.$2", "type": "Array", "tags": [], "label": "params", @@ -33053,13 +35124,13 @@ }, { "parentPluginId": "data", - "id": "def-common.indexPattern", + "id": "def-common.buildPhrasesFilter.$3", "type": "Object", "tags": [], "label": "indexPattern", "description": [], "signature": [ - "IndexPatternBase" + "DataViewBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/phrases_filter.d.ts", "deprecated": false @@ -33088,7 +35159,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.query", + "id": "def-common.buildQueryFilter.$1", "type": "CompoundType", "tags": [], "label": "query", @@ -33101,7 +35172,7 @@ }, { "parentPluginId": "data", - "id": "def-common.index", + "id": "def-common.buildQueryFilter.$2", "type": "string", "tags": [], "label": "index", @@ -33111,7 +35182,7 @@ }, { "parentPluginId": "data", - "id": "def-common.alias", + "id": "def-common.buildQueryFilter.$3", "type": "string", "tags": [], "label": "alias", @@ -33135,7 +35206,7 @@ "(filters: ", "Filter", "[] | undefined, indexPattern: ", - "IndexPatternBase", + "DataViewBase", " | undefined, ignoreFilterIfFieldNotInIndex?: boolean | undefined) => ", "BoolQuery" ], @@ -33147,7 +35218,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.filters", + "id": "def-common.buildQueryFromFilters.$1", "type": "Array", "tags": [], "label": "filters", @@ -33161,13 +35232,13 @@ }, { "parentPluginId": "data", - "id": "def-common.indexPattern", + "id": "def-common.buildQueryFromFilters.$2", "type": "Object", "tags": [], "label": "indexPattern", "description": [], "signature": [ - "IndexPatternBase", + "DataViewBase", " | undefined" ], "path": "node_modules/@kbn/es-query/target_types/es_query/from_filters.d.ts", @@ -33175,7 +35246,7 @@ }, { "parentPluginId": "data", - "id": "def-common.ignoreFilterIfFieldNotInIndex", + "id": "def-common.buildQueryFromFilters.$3", "type": "CompoundType", "tags": [], "label": "ignoreFilterIfFieldNotInIndex", @@ -33200,11 +35271,11 @@ "description": [], "signature": [ "(field: ", - "IndexPatternFieldBase", + "DataViewFieldBase", ", params: ", "RangeFilterParams", ", indexPattern: ", - "IndexPatternBase", + "DataViewBase", ", formattedValue?: string | undefined) => ", "RangeFilter", " | ", @@ -33220,20 +35291,20 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.field", + "id": "def-common.buildRangeFilter.$1", "type": "Object", "tags": [], "label": "field", "description": [], "signature": [ - "IndexPatternFieldBase" + "DataViewFieldBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/range_filter.d.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-common.params", + "id": "def-common.buildRangeFilter.$2", "type": "Object", "tags": [], "label": "params", @@ -33246,20 +35317,20 @@ }, { "parentPluginId": "data", - "id": "def-common.indexPattern", + "id": "def-common.buildRangeFilter.$3", "type": "Object", "tags": [], "label": "indexPattern", "description": [], "signature": [ - "IndexPatternBase" + "DataViewBase" ], "path": "node_modules/@kbn/es-query/target_types/filters/build_filters/range_filter.d.ts", "deprecated": false }, { "parentPluginId": "data", - "id": "def-common.formattedValue", + "id": "def-common.buildRangeFilter.$4", "type": "string", "tags": [], "label": "formattedValue", @@ -33311,7 +35382,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.esType", + "id": "def-common.castEsToKbnFieldTypeName.$1", "type": "string", "tags": [], "label": "esType", @@ -33383,7 +35454,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.first", + "id": "def-common.compareFilters.$1", "type": "CompoundType", "tags": [], "label": "first", @@ -33399,7 +35470,7 @@ }, { "parentPluginId": "data", - "id": "def-common.second", + "id": "def-common.compareFilters.$2", "type": "CompoundType", "tags": [], "label": "second", @@ -33415,7 +35486,7 @@ }, { "parentPluginId": "data", - "id": "def-common.comparatorOptions", + "id": "def-common.compareFilters.$3", "type": "Object", "tags": [], "label": "comparatorOptions", @@ -33559,7 +35630,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.query", + "id": "def-common.decorateQuery.$1", "type": "Object", "tags": [], "label": "query", @@ -33572,7 +35643,7 @@ }, { "parentPluginId": "data", - "id": "def-common.queryStringOptions", + "id": "def-common.decorateQuery.$2", "type": "CompoundType", "tags": [], "label": "queryStringOptions", @@ -33586,7 +35657,7 @@ }, { "parentPluginId": "data", - "id": "def-common.dateFormatTZ", + "id": "def-common.decorateQuery.$3", "type": "string", "tags": [], "label": "dateFormatTZ", @@ -33628,7 +35699,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.existingFilters", + "id": "def-common.dedupFilters.$1", "type": "Array", "tags": [], "label": "existingFilters", @@ -33642,7 +35713,7 @@ }, { "parentPluginId": "data", - "id": "def-common.filters", + "id": "def-common.dedupFilters.$2", "type": "Array", "tags": [], "label": "filters", @@ -33656,7 +35727,7 @@ }, { "parentPluginId": "data", - "id": "def-common.comparatorOptions", + "id": "def-common.dedupFilters.$3", "type": "Object", "tags": [], "label": "comparatorOptions", @@ -33694,7 +35765,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.filter", + "id": "def-common.disableFilter.$1", "type": "Object", "tags": [], "label": "filter", @@ -33735,7 +35806,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.filter", + "id": "def-common.enableFilter.$1", "type": "Object", "tags": [], "label": "filter", @@ -33778,7 +35849,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.expression", + "id": "def-common.fromKueryExpression.$1", "type": "CompoundType", "tags": [], "label": "expression", @@ -33792,7 +35863,7 @@ }, { "parentPluginId": "data", - "id": "def-common.parseOptions", + "id": "def-common.fromKueryExpression.$2", "type": "Object", "tags": [], "label": "parseOptions", @@ -33881,7 +35952,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.typeName", + "id": "def-common.getKbnFieldType.$1", "type": "string", "tags": [], "label": "typeName", @@ -33943,7 +36014,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.filter", + "id": "def-common.getPhraseFilterField.$1", "type": "CompoundType", "tags": [], "label": "filter", @@ -33989,7 +36060,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.filter", + "id": "def-common.getPhraseFilterValue.$1", "type": "CompoundType", "tags": [], "label": "filter", @@ -34028,7 +36099,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.filter", + "id": "def-common.isExistsFilter.$1", "type": "Object", "tags": [], "label": "filter", @@ -34067,7 +36138,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.x", + "id": "def-common.isFilter.$1", "type": "Unknown", "tags": [], "label": "x", @@ -34103,7 +36174,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.filter", + "id": "def-common.isFilterDisabled.$1", "type": "Object", "tags": [], "label": "filter", @@ -34138,12 +36209,25 @@ "path": "src/plugins/data/common/es_query/index.ts", "deprecated": true, "removeBy": "8.1", - "references": [], + "references": [ + { + "plugin": "visualize", + "path": "src/plugins/visualize/common/locator.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/common/locator.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/common/locator.ts" + } + ], "returnComment": [], "children": [ { "parentPluginId": "data", - "id": "def-common.filter", + "id": "def-common.isFilterPinned.$1", "type": "Object", "tags": [], "label": "filter", @@ -34192,7 +36276,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.x", + "id": "def-common.isFilters.$1", "type": "Unknown", "tags": [], "label": "x", @@ -34229,7 +36313,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.filter", + "id": "def-common.isMatchAllFilter.$1", "type": "Object", "tags": [], "label": "filter", @@ -34270,7 +36354,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.filter", + "id": "def-common.isMissingFilter.$1", "type": "Object", "tags": [], "label": "filter", @@ -34311,7 +36395,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.filter", + "id": "def-common.isPhraseFilter.$1", "type": "Object", "tags": [], "label": "filter", @@ -34352,7 +36436,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.filter", + "id": "def-common.isPhrasesFilter.$1", "type": "Object", "tags": [], "label": "filter", @@ -34393,7 +36477,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.filter", + "id": "def-common.isQueryStringFilter.$1", "type": "Object", "tags": [], "label": "filter", @@ -34434,7 +36518,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.filter", + "id": "def-common.isRangeFilter.$1", "type": "Object", "tags": [], "label": "filter", @@ -34472,7 +36556,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.query", + "id": "def-common.luceneStringToDsl.$1", "type": "CompoundType", "tags": [], "label": "query", @@ -34511,7 +36595,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.newFilters", + "id": "def-common.onlyDisabledFiltersChanged.$1", "type": "Array", "tags": [], "label": "newFilters", @@ -34525,7 +36609,7 @@ }, { "parentPluginId": "data", - "id": "def-common.oldFilters", + "id": "def-common.onlyDisabledFiltersChanged.$2", "type": "Array", "tags": [], "label": "oldFilters", @@ -34563,7 +36647,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.filter", + "id": "def-common.pinFilter.$1", "type": "Object", "tags": [], "label": "filter", @@ -34689,7 +36773,7 @@ "(node: ", "KueryNode", ", indexPattern?: ", - "IndexPatternBase", + "DataViewBase", " | undefined, config?: ", "KueryQueryOptions", " | undefined, context?: Record | undefined) => ", @@ -34703,7 +36787,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.node", + "id": "def-common.toElasticsearchQuery.$1", "type": "Object", "tags": [], "label": "node", @@ -34716,13 +36800,13 @@ }, { "parentPluginId": "data", - "id": "def-common.indexPattern", + "id": "def-common.toElasticsearchQuery.$2", "type": "Object", "tags": [], "label": "indexPattern", "description": [], "signature": [ - "IndexPatternBase", + "DataViewBase", " | undefined" ], "path": "node_modules/@kbn/es-query/target_types/kuery/index.d.ts", @@ -34730,7 +36814,7 @@ }, { "parentPluginId": "data", - "id": "def-common.config", + "id": "def-common.toElasticsearchQuery.$3", "type": "Object", "tags": [], "label": "config", @@ -34744,7 +36828,7 @@ }, { "parentPluginId": "data", - "id": "def-common.context", + "id": "def-common.toElasticsearchQuery.$4", "type": "Object", "tags": [], "label": "context", @@ -34782,7 +36866,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.filter", + "id": "def-common.toggleFilterDisabled.$1", "type": "Object", "tags": [], "label": "filter", @@ -34824,7 +36908,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.filter", + "id": "def-common.toggleFilterNegated.$1", "type": "Object", "tags": [], "label": "filter", @@ -34868,7 +36952,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.filters", + "id": "def-common.uniqFilters.$1", "type": "Array", "tags": [], "label": "filters", @@ -34882,7 +36966,7 @@ }, { "parentPluginId": "data", - "id": "def-common.comparatorOptions", + "id": "def-common.uniqFilters.$2", "type": "Object", "tags": [], "label": "comparatorOptions", @@ -34925,7 +37009,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.value", + "id": "def-common.FilterValueFormatter.convert.$1", "type": "Any", "tags": [], "label": "value", @@ -35306,6 +37390,20 @@ "references": [], "initialIsOpen": false }, + { + "parentPluginId": "data", + "id": "def-common.DATA_VIEW_SAVED_OBJECT_TYPE", + "type": "string", + "tags": [], + "label": "DATA_VIEW_SAVED_OBJECT_TYPE", + "description": [], + "signature": [ + "\"index-pattern\"" + ], + "path": "src/plugins/data/common/constants.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "data", "id": "def-common.DEFAULT_QUERY_LANGUAGE", @@ -35400,14 +37498,6 @@ "deprecated": true, "removeBy": "8.1", "references": [ - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts" - }, { "plugin": "discover", "path": "src/plugins/discover/public/url_generator.ts" @@ -35442,63 +37532,63 @@ }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context/api/context.ts" + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context/api/context.ts" + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context/api/context.ts" + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context/api/context.ts" + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" }, { "plugin": "visualizations", @@ -35610,15 +37700,15 @@ }, { "plugin": "dashboard", - "path": "src/plugins/dashboard/public/url_generator.ts" + "path": "src/plugins/dashboard/public/locator.ts" }, { "plugin": "dashboard", - "path": "src/plugins/dashboard/public/url_generator.ts" + "path": "src/plugins/dashboard/public/locator.ts" }, { "plugin": "dashboard", - "path": "src/plugins/dashboard/public/url_generator.ts" + "path": "src/plugins/dashboard/public/locator.ts" }, { "plugin": "dashboard", @@ -35626,15 +37716,15 @@ }, { "plugin": "dashboard", - "path": "src/plugins/dashboard/public/locator.ts" + "path": "src/plugins/dashboard/public/url_generator.ts" }, { "plugin": "dashboard", - "path": "src/plugins/dashboard/public/locator.ts" + "path": "src/plugins/dashboard/public/url_generator.ts" }, { "plugin": "dashboard", - "path": "src/plugins/dashboard/public/locator.ts" + "path": "src/plugins/dashboard/public/url_generator.ts" }, { "plugin": "lens", @@ -35778,47 +37868,47 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.ts" + "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.ts" + "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + "path": "x-pack/plugins/maps/public/actions/map_actions.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + "path": "x-pack/plugins/maps/public/actions/map_actions.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/actions/map_actions.ts" + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/actions/map_actions.ts" + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" }, { "plugin": "maps", @@ -36004,14 +38094,6 @@ "plugin": "infra", "path": "x-pack/plugins/infra/public/components/log_stream/log_stream_embeddable.tsx" }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts" - }, { "plugin": "lens", "path": "x-pack/plugins/lens/server/migrations/types.ts" @@ -36540,14 +38622,6 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/common/detection_engine/get_query_filter.test.ts" }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts" - }, { "plugin": "discoverEnhanced", "path": "x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts" @@ -36850,11 +38924,11 @@ }, { "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts" + "path": "src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts" }, { "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts" + "path": "src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts" }, { "plugin": "visualize", @@ -36890,19 +38964,11 @@ }, { "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/timelion_vis_fn.ts" + "path": "src/plugins/vis_types/timelion/public/timelion_vis_fn.ts" }, { "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/timelion_vis_fn.ts" - }, - { - "plugin": "visTypeVega", - "path": "src/plugins/vis_type_vega/public/vega_request_handler.ts" - }, - { - "plugin": "visTypeVega", - "path": "src/plugins/vis_type_vega/public/vega_request_handler.ts" + "path": "src/plugins/vis_types/timelion/public/timelion_vis_fn.ts" }, { "plugin": "dashboard", @@ -36913,16 +38979,12 @@ "path": "src/plugins/dashboard/server/saved_objects/move_filters_to_query.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.test.ts" - }, - { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.test.ts" + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/vega_request_handler.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context_state.test.ts" + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/vega_request_handler.ts" }, { "plugin": "inputControlVis", @@ -36978,15 +39040,27 @@ }, { "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/angular/context/api/context.d.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.test.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/angular/context/api/context.d.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.test.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/angular/context/api/context.d.ts" + "path": "src/plugins/discover/public/application/apps/context/services/context_state.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" }, { "plugin": "securitySolution", @@ -37014,19 +39088,19 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/common/elasticsearch_util/types.ts" + "path": "x-pack/plugins/maps/public/embeddable/types.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/common/elasticsearch_util/types.ts" + "path": "x-pack/plugins/maps/public/embeddable/types.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/embeddable/types.ts" + "path": "x-pack/plugins/maps/common/elasticsearch_util/types.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/embeddable/types.ts" + "path": "x-pack/plugins/maps/common/elasticsearch_util/types.ts" }, { "plugin": "maps", @@ -37160,6 +39234,22 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/target/types/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.d.ts" }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/common/locator.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/common/locator.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/target/types/common/locator.d.ts" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/target/types/common/locator.d.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_preview/helpers.ts" @@ -37204,6 +39294,14 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/network/pages/navigation/alerts_query_tab_body.tsx" @@ -37259,7 +39357,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.key", + "id": "def-common.GetConfigFn.$1", "type": "string", "tags": [], "label": "key", @@ -37269,7 +39367,7 @@ }, { "parentPluginId": "data", - "id": "def-common.defaultOverride", + "id": "def-common.GetConfigFn.$2", "type": "Uncategorized", "tags": [], "label": "defaultOverride", @@ -37314,14 +39412,74 @@ "parentPluginId": "data", "id": "def-common.INDEX_PATTERN_SAVED_OBJECT_TYPE", "type": "string", - "tags": [], + "tags": [ + "deprecated" + ], "label": "INDEX_PATTERN_SAVED_OBJECT_TYPE", "description": [], "signature": [ "\"index-pattern\"" ], "path": "src/plugins/data/common/constants.ts", - "deprecated": false, + "deprecated": true, + "references": [ + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/controls_references.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/controls_references.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/timeseries_references.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/timeseries_references.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/replace_index_pattern_reference.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/replace_index_pattern_reference.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts" + } + ], "initialIsOpen": false }, { @@ -37734,27 +39892,27 @@ "references": [ { "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/components/timelion_vis_component.tsx" + "path": "src/plugins/vis_types/timelion/public/components/timelion_vis_component.tsx" }, { "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/components/timelion_vis_component.tsx" + "path": "src/plugins/vis_types/timelion/public/components/timelion_vis_component.tsx" }, { "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/timelion_vis_renderer.tsx" + "path": "src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx" }, { "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/timelion_vis_renderer.tsx" + "path": "src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx" }, { "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/legacy/timelion_vis_component.tsx" + "path": "src/plugins/vis_types/timelion/public/legacy/timelion_vis_component.tsx" }, { "plugin": "visTypeTimelion", - "path": "src/plugins/vis_type_timelion/public/legacy/timelion_vis_component.tsx" + "path": "src/plugins/vis_types/timelion/public/legacy/timelion_vis_component.tsx" } ], "initialIsOpen": false @@ -38133,7 +40291,7 @@ "label": "UI_SETTINGS", "description": [], "signature": [ - "{ readonly META_FIELDS: \"metaFields\"; readonly DOC_HIGHLIGHT: \"doc_table:highlight\"; readonly QUERY_STRING_OPTIONS: \"query:queryString:options\"; readonly QUERY_ALLOW_LEADING_WILDCARDS: \"query:allowLeadingWildcards\"; readonly SEARCH_QUERY_LANGUAGE: \"search:queryLanguage\"; readonly SORT_OPTIONS: \"sort:options\"; readonly COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX: \"courier:ignoreFilterIfFieldNotInIndex\"; readonly COURIER_SET_REQUEST_PREFERENCE: \"courier:setRequestPreference\"; readonly COURIER_CUSTOM_REQUEST_PREFERENCE: \"courier:customRequestPreference\"; readonly COURIER_MAX_CONCURRENT_SHARD_REQUESTS: \"courier:maxConcurrentShardRequests\"; readonly SEARCH_INCLUDE_FROZEN: \"search:includeFrozen\"; readonly SEARCH_TIMEOUT: \"search:timeout\"; readonly HISTOGRAM_BAR_TARGET: \"histogram:barTarget\"; readonly HISTOGRAM_MAX_BARS: \"histogram:maxBars\"; readonly HISTORY_LIMIT: \"history:limit\"; readonly TIMEPICKER_REFRESH_INTERVAL_DEFAULTS: \"timepicker:refreshIntervalDefaults\"; readonly TIMEPICKER_QUICK_RANGES: \"timepicker:quickRanges\"; readonly TIMEPICKER_TIME_DEFAULTS: \"timepicker:timeDefaults\"; readonly INDEXPATTERN_PLACEHOLDER: \"indexPattern:placeholder\"; readonly FILTERS_PINNED_BY_DEFAULT: \"filters:pinnedByDefault\"; readonly FILTERS_EDITOR_SUGGEST_VALUES: \"filterEditor:suggestValues\"; readonly AUTOCOMPLETE_USE_TIMERANGE: \"autocomplete:useTimeRange\"; readonly AUTOCOMPLETE_VALUE_SUGGESTION_METHOD: \"autocomplete:valueSuggestionMethod\"; }" + "{ readonly META_FIELDS: \"metaFields\"; readonly DOC_HIGHLIGHT: \"doc_table:highlight\"; readonly QUERY_STRING_OPTIONS: \"query:queryString:options\"; readonly QUERY_ALLOW_LEADING_WILDCARDS: \"query:allowLeadingWildcards\"; readonly SEARCH_QUERY_LANGUAGE: \"search:queryLanguage\"; readonly SORT_OPTIONS: \"sort:options\"; readonly COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX: \"courier:ignoreFilterIfFieldNotInIndex\"; readonly COURIER_SET_REQUEST_PREFERENCE: \"courier:setRequestPreference\"; readonly COURIER_CUSTOM_REQUEST_PREFERENCE: \"courier:customRequestPreference\"; readonly COURIER_MAX_CONCURRENT_SHARD_REQUESTS: \"courier:maxConcurrentShardRequests\"; readonly SEARCH_INCLUDE_FROZEN: \"search:includeFrozen\"; readonly SEARCH_TIMEOUT: \"search:timeout\"; readonly HISTOGRAM_BAR_TARGET: \"histogram:barTarget\"; readonly HISTOGRAM_MAX_BARS: \"histogram:maxBars\"; readonly HISTORY_LIMIT: \"history:limit\"; readonly TIMEPICKER_REFRESH_INTERVAL_DEFAULTS: \"timepicker:refreshIntervalDefaults\"; readonly TIMEPICKER_QUICK_RANGES: \"timepicker:quickRanges\"; readonly TIMEPICKER_TIME_DEFAULTS: \"timepicker:timeDefaults\"; readonly FILTERS_PINNED_BY_DEFAULT: \"filters:pinnedByDefault\"; readonly FILTERS_EDITOR_SUGGEST_VALUES: \"filterEditor:suggestValues\"; readonly AUTOCOMPLETE_USE_TIMERANGE: \"autocomplete:useTimeRange\"; readonly AUTOCOMPLETE_VALUE_SUGGESTION_METHOD: \"autocomplete:valueSuggestionMethod\"; }" ], "path": "src/plugins/data/common/constants.ts", "deprecated": false, diff --git a/api_docs/data.mdx b/api_docs/data.mdx index 7af9d8cdbce17..35884a885946e 100644 --- a/api_docs/data.mdx +++ b/api_docs/data.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3498 | 44 | 2981 | 50 | +| 3099 | 44 | 2738 | 50 | ## Client diff --git a/api_docs/data_autocomplete.json b/api_docs/data_autocomplete.json index 57fe5efbde55a..aae6f7d861cf2 100644 --- a/api_docs/data_autocomplete.json +++ b/api_docs/data_autocomplete.json @@ -385,7 +385,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-public.args", + "id": "def-public.QuerySuggestionGetFn.$1", "type": "Object", "tags": [], "label": "args", diff --git a/api_docs/data_autocomplete.mdx b/api_docs/data_autocomplete.mdx index 5618db8f44f6b..ef44e5fe3e887 100644 --- a/api_docs/data_autocomplete.mdx +++ b/api_docs/data_autocomplete.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3498 | 44 | 2981 | 50 | +| 3099 | 44 | 2738 | 50 | ## Client diff --git a/api_docs/data_index_patterns.json b/api_docs/data_index_patterns.json index 0ea451c7bc6e2..cf621b2413975 100644 --- a/api_docs/data_index_patterns.json +++ b/api_docs/data_index_patterns.json @@ -99,7 +99,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.IndexPatternsFetcher.getFieldsForWildcard.$1.options", + "id": "def-server.IndexPatternsFetcher.getFieldsForWildcard.$1", "type": "Object", "tags": [], "label": "options", @@ -109,7 +109,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.IndexPatternsFetcher.getFieldsForWildcard.$1.options.pattern", + "id": "def-server.IndexPatternsFetcher.getFieldsForWildcard.$1.pattern", "type": "CompoundType", "tags": [], "label": "pattern", @@ -122,7 +122,7 @@ }, { "parentPluginId": "data", - "id": "def-server.IndexPatternsFetcher.getFieldsForWildcard.$1.options.metaFields", + "id": "def-server.IndexPatternsFetcher.getFieldsForWildcard.$1.metaFields", "type": "Array", "tags": [], "label": "metaFields", @@ -135,7 +135,7 @@ }, { "parentPluginId": "data", - "id": "def-server.IndexPatternsFetcher.getFieldsForWildcard.$1.options.fieldCapsOptions", + "id": "def-server.IndexPatternsFetcher.getFieldsForWildcard.$1.fieldCapsOptions", "type": "Object", "tags": [], "label": "fieldCapsOptions", @@ -148,7 +148,7 @@ }, { "parentPluginId": "data", - "id": "def-server.IndexPatternsFetcher.getFieldsForWildcard.$1.options.type", + "id": "def-server.IndexPatternsFetcher.getFieldsForWildcard.$1.type", "type": "string", "tags": [], "label": "type", @@ -161,7 +161,7 @@ }, { "parentPluginId": "data", - "id": "def-server.IndexPatternsFetcher.getFieldsForWildcard.$1.options.rollupIndex", + "id": "def-server.IndexPatternsFetcher.getFieldsForWildcard.$1.rollupIndex", "type": "string", "tags": [], "label": "rollupIndex", @@ -207,7 +207,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.IndexPatternsFetcher.getFieldsForTimePattern.$1.options", + "id": "def-server.IndexPatternsFetcher.getFieldsForTimePattern.$1", "type": "Object", "tags": [], "label": "options", @@ -217,7 +217,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.IndexPatternsFetcher.getFieldsForTimePattern.$1.options.pattern", + "id": "def-server.IndexPatternsFetcher.getFieldsForTimePattern.$1.pattern", "type": "string", "tags": [], "label": "pattern", @@ -227,7 +227,7 @@ }, { "parentPluginId": "data", - "id": "def-server.IndexPatternsFetcher.getFieldsForTimePattern.$1.options.metaFields", + "id": "def-server.IndexPatternsFetcher.getFieldsForTimePattern.$1.metaFields", "type": "Array", "tags": [], "label": "metaFields", @@ -240,7 +240,7 @@ }, { "parentPluginId": "data", - "id": "def-server.IndexPatternsFetcher.getFieldsForTimePattern.$1.options.lookBack", + "id": "def-server.IndexPatternsFetcher.getFieldsForTimePattern.$1.lookBack", "type": "number", "tags": [], "label": "lookBack", @@ -250,7 +250,7 @@ }, { "parentPluginId": "data", - "id": "def-server.IndexPatternsFetcher.getFieldsForTimePattern.$1.options.interval", + "id": "def-server.IndexPatternsFetcher.getFieldsForTimePattern.$1.interval", "type": "string", "tags": [], "label": "interval", @@ -480,71 +480,18 @@ "classes": [ { "parentPluginId": "data", - "id": "def-common.DuplicateIndexPatternError", + "id": "def-common.DataView", "type": "Class", "tags": [], - "label": "DuplicateIndexPatternError", + "label": "DataView", "description": [], "signature": [ { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.DuplicateIndexPatternError", - "text": "DuplicateIndexPatternError" - }, - " extends Error" - ], - "path": "src/plugins/data/common/index_patterns/errors/duplicate_index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.DuplicateIndexPatternError.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/data/common/index_patterns/errors/duplicate_index_pattern.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.DuplicateIndexPatternError.Unnamed.$1", - "type": "string", - "tags": [], - "label": "message", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/errors/duplicate_index_pattern.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.IndexPattern", - "type": "Class", - "tags": [], - "label": "IndexPattern", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, " implements ", { @@ -560,7 +507,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPattern.id", + "id": "def-common.DataView.id", "type": "string", "tags": [], "label": "id", @@ -573,7 +520,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.title", + "id": "def-common.DataView.title", "type": "string", "tags": [], "label": "title", @@ -583,7 +530,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.fieldFormatMap", + "id": "def-common.DataView.fieldFormatMap", "type": "Object", "tags": [], "label": "fieldFormatMap", @@ -596,7 +543,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.typeMeta", + "id": "def-common.DataView.typeMeta", "type": "Object", "tags": [], "label": "typeMeta", @@ -618,7 +565,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.fields", + "id": "def-common.DataView.fields", "type": "CompoundType", "tags": [], "label": "fields", @@ -646,7 +593,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.timeFieldName", + "id": "def-common.DataView.timeFieldName", "type": "string", "tags": [], "label": "timeFieldName", @@ -659,7 +606,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.intervalName", + "id": "def-common.DataView.intervalName", "type": "string", "tags": [ "deprecated" @@ -676,7 +623,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.type", + "id": "def-common.DataView.type", "type": "string", "tags": [], "label": "type", @@ -691,7 +638,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.formatHit", + "id": "def-common.DataView.formatHit", "type": "Function", "tags": [], "label": "formatHit", @@ -705,7 +652,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.hit", + "id": "def-common.DataView.formatHit.$1", "type": "Object", "tags": [], "label": "hit", @@ -718,7 +665,7 @@ }, { "parentPluginId": "data", - "id": "def-common.type", + "id": "def-common.DataView.formatHit.$2", "type": "string", "tags": [], "label": "type", @@ -733,7 +680,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.formatField", + "id": "def-common.DataView.formatField", "type": "Function", "tags": [], "label": "formatField", @@ -747,7 +694,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.hit", + "id": "def-common.DataView.formatField.$1", "type": "Object", "tags": [], "label": "hit", @@ -760,7 +707,7 @@ }, { "parentPluginId": "data", - "id": "def-common.fieldName", + "id": "def-common.DataView.formatField.$2", "type": "string", "tags": [], "label": "fieldName", @@ -772,7 +719,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.flattenHit", + "id": "def-common.DataView.flattenHit", "type": "Function", "tags": [], "label": "flattenHit", @@ -786,7 +733,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.hit", + "id": "def-common.DataView.flattenHit.$1", "type": "Object", "tags": [], "label": "hit", @@ -799,7 +746,7 @@ }, { "parentPluginId": "data", - "id": "def-common.deep", + "id": "def-common.DataView.flattenHit.$2", "type": "CompoundType", "tags": [], "label": "deep", @@ -814,7 +761,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.metaFields", + "id": "def-common.DataView.metaFields", "type": "Array", "tags": [], "label": "metaFields", @@ -827,7 +774,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.version", + "id": "def-common.DataView.version", "type": "string", "tags": [], "label": "version", @@ -842,7 +789,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.sourceFilters", + "id": "def-common.DataView.sourceFilters", "type": "Array", "tags": [], "label": "sourceFilters", @@ -862,7 +809,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.allowNoIndex", + "id": "def-common.DataView.allowNoIndex", "type": "boolean", "tags": [], "label": "allowNoIndex", @@ -874,7 +821,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.Unnamed", + "id": "def-common.DataView.Unnamed", "type": "Function", "tags": [], "label": "Constructor", @@ -887,13 +834,13 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPattern.Unnamed.$1", + "id": "def-common.DataView.Unnamed.$1", "type": "Object", "tags": [], - "label": "{\n spec = {},\n fieldFormats,\n shortDotsEnable = false,\n metaFields = [],\n }", + "label": "{ spec = {}, fieldFormats, shortDotsEnable = false, metaFields = [] }", "description": [], "signature": [ - "IndexPatternDeps" + "DataViewDeps" ], "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", "deprecated": false, @@ -904,7 +851,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.getOriginalSavedObjectBody", + "id": "def-common.DataView.getOriginalSavedObjectBody", "type": "Function", "tags": [], "label": "getOriginalSavedObjectBody", @@ -921,7 +868,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.resetOriginalSavedObjectBody", + "id": "def-common.DataView.resetOriginalSavedObjectBody", "type": "Function", "tags": [], "label": "resetOriginalSavedObjectBody", @@ -938,7 +885,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.getFieldAttrs", + "id": "def-common.DataView.getFieldAttrs", "type": "Function", "tags": [], "label": "getFieldAttrs", @@ -961,7 +908,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.getComputedFields", + "id": "def-common.DataView.getComputedFields", "type": "Function", "tags": [], "label": "getComputedFields", @@ -984,7 +931,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.toSpec", + "id": "def-common.DataView.toSpec", "type": "Function", "tags": [], "label": "toSpec", @@ -997,8 +944,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" } ], "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", @@ -1008,7 +955,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.getSourceFiltering", + "id": "def-common.DataView.getSourceFiltering", "type": "Function", "tags": [], "label": "getSourceFiltering", @@ -1025,7 +972,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.addScriptedField", + "id": "def-common.DataView.addScriptedField", "type": "Function", "tags": [ "deprecated" @@ -1044,7 +991,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPattern.addScriptedField.$1", + "id": "def-common.DataView.addScriptedField.$1", "type": "string", "tags": [], "label": "name", @@ -1060,7 +1007,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.addScriptedField.$2", + "id": "def-common.DataView.addScriptedField.$2", "type": "string", "tags": [], "label": "script", @@ -1076,7 +1023,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.addScriptedField.$3", + "id": "def-common.DataView.addScriptedField.$3", "type": "string", "tags": [], "label": "fieldType", @@ -1093,7 +1040,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.removeScriptedField", + "id": "def-common.DataView.removeScriptedField", "type": "Function", "tags": [ "deprecated" @@ -1121,7 +1068,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPattern.removeScriptedField.$1", + "id": "def-common.DataView.removeScriptedField.$1", "type": "string", "tags": [], "label": "fieldName", @@ -1138,7 +1085,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.getNonScriptedFields", + "id": "def-common.DataView.getNonScriptedFields", "type": "Function", "tags": [ "deprecated" @@ -1153,8 +1100,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" + "section": "def-common.DataViewField", + "text": "DataViewField" }, "[]" ], @@ -1208,7 +1155,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.getScriptedFields", + "id": "def-common.DataView.getScriptedFields", "type": "Function", "tags": [ "deprecated" @@ -1223,8 +1170,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" + "section": "def-common.DataViewField", + "text": "DataViewField" }, "[]" ], @@ -1242,7 +1189,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.isTimeBased", + "id": "def-common.DataView.isTimeBased", "type": "Function", "tags": [], "label": "isTimeBased", @@ -1257,7 +1204,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.isTimeNanosBased", + "id": "def-common.DataView.isTimeNanosBased", "type": "Function", "tags": [], "label": "isTimeNanosBased", @@ -1272,7 +1219,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.getTimeField", + "id": "def-common.DataView.getTimeField", "type": "Function", "tags": [], "label": "getTimeField", @@ -1283,8 +1230,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" + "section": "def-common.DataViewField", + "text": "DataViewField" }, " | undefined" ], @@ -1295,7 +1242,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.getFieldByName", + "id": "def-common.DataView.getFieldByName", "type": "Function", "tags": [], "label": "getFieldByName", @@ -1306,8 +1253,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" + "section": "def-common.DataViewField", + "text": "DataViewField" }, " | undefined" ], @@ -1316,7 +1263,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPattern.getFieldByName.$1", + "id": "def-common.DataView.getFieldByName.$1", "type": "string", "tags": [], "label": "name", @@ -1333,7 +1280,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.getAggregationRestrictions", + "id": "def-common.DataView.getAggregationRestrictions", "type": "Function", "tags": [], "label": "getAggregationRestrictions", @@ -1348,7 +1295,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.getAsSavedObjectBody", + "id": "def-common.DataView.getAsSavedObjectBody", "type": "Function", "tags": [], "label": "getAsSavedObjectBody", @@ -1361,8 +1308,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternAttributes", - "text": "IndexPatternAttributes" + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" } ], "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", @@ -1372,7 +1319,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.getFormatterForField", + "id": "def-common.DataView.getFormatterForField", "type": "Function", "tags": [], "label": "getFormatterForField", @@ -1393,16 +1340,16 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" + "section": "def-common.FieldSpec", + "text": "FieldSpec" }, " | ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" + "section": "def-common.DataViewField", + "text": "DataViewField" }, ") => ", { @@ -1418,7 +1365,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPattern.getFormatterForField.$1", + "id": "def-common.DataView.getFormatterForField.$1", "type": "CompoundType", "tags": [], "label": "field", @@ -1436,16 +1383,16 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" + "section": "def-common.FieldSpec", + "text": "FieldSpec" }, " | ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" + "section": "def-common.DataViewField", + "text": "DataViewField" } ], "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", @@ -1457,7 +1404,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.addRuntimeField", + "id": "def-common.DataView.addRuntimeField", "type": "Function", "tags": [], "label": "addRuntimeField", @@ -1480,7 +1427,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPattern.addRuntimeField.$1", + "id": "def-common.DataView.addRuntimeField.$1", "type": "string", "tags": [], "label": "name", @@ -1496,7 +1443,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.addRuntimeField.$2", + "id": "def-common.DataView.addRuntimeField.$2", "type": "Object", "tags": [], "label": "runtimeField", @@ -1521,7 +1468,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.hasRuntimeField", + "id": "def-common.DataView.hasRuntimeField", "type": "Function", "tags": [], "label": "hasRuntimeField", @@ -1536,7 +1483,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPattern.hasRuntimeField.$1", + "id": "def-common.DataView.hasRuntimeField.$1", "type": "string", "tags": [], "label": "name", @@ -1553,7 +1500,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.getRuntimeField", + "id": "def-common.DataView.getRuntimeField", "type": "Function", "tags": [], "label": "getRuntimeField", @@ -1576,7 +1523,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPattern.getRuntimeField.$1", + "id": "def-common.DataView.getRuntimeField.$1", "type": "string", "tags": [], "label": "name", @@ -1593,7 +1540,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.replaceAllRuntimeFields", + "id": "def-common.DataView.replaceAllRuntimeFields", "type": "Function", "tags": [], "label": "replaceAllRuntimeFields", @@ -1616,7 +1563,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPattern.replaceAllRuntimeFields.$1", + "id": "def-common.DataView.replaceAllRuntimeFields.$1", "type": "Object", "tags": [], "label": "newFields", @@ -1641,7 +1588,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.removeRuntimeField", + "id": "def-common.DataView.removeRuntimeField", "type": "Function", "tags": [], "label": "removeRuntimeField", @@ -1656,7 +1603,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPattern.removeRuntimeField.$1", + "id": "def-common.DataView.removeRuntimeField.$1", "type": "string", "tags": [], "label": "name", @@ -1675,7 +1622,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.getFormatterForFieldNoDefault", + "id": "def-common.DataView.getFormatterForFieldNoDefault", "type": "Function", "tags": [], "label": "getFormatterForFieldNoDefault", @@ -1698,7 +1645,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPattern.getFormatterForFieldNoDefault.$1", + "id": "def-common.DataView.getFormatterForFieldNoDefault.$1", "type": "string", "tags": [], "label": "fieldname", @@ -1715,7 +1662,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.setFieldAttrs", + "id": "def-common.DataView.setFieldAttrs", "type": "Function", "tags": [], "label": "setFieldAttrs", @@ -1736,7 +1683,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPattern.setFieldAttrs.$1", + "id": "def-common.DataView.setFieldAttrs.$1", "type": "string", "tags": [], "label": "fieldName", @@ -1750,7 +1697,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.setFieldAttrs.$2", + "id": "def-common.DataView.setFieldAttrs.$2", "type": "Uncategorized", "tags": [], "label": "attrName", @@ -1764,7 +1711,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.setFieldAttrs.$3", + "id": "def-common.DataView.setFieldAttrs.$3", "type": "Uncategorized", "tags": [], "label": "value", @@ -1788,7 +1735,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.setFieldCustomLabel", + "id": "def-common.DataView.setFieldCustomLabel", "type": "Function", "tags": [], "label": "setFieldCustomLabel", @@ -1801,7 +1748,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPattern.setFieldCustomLabel.$1", + "id": "def-common.DataView.setFieldCustomLabel.$1", "type": "string", "tags": [], "label": "fieldName", @@ -1815,7 +1762,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.setFieldCustomLabel.$2", + "id": "def-common.DataView.setFieldCustomLabel.$2", "type": "CompoundType", "tags": [], "label": "customLabel", @@ -1832,7 +1779,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.setFieldCount", + "id": "def-common.DataView.setFieldCount", "type": "Function", "tags": [], "label": "setFieldCount", @@ -1845,7 +1792,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPattern.setFieldCount.$1", + "id": "def-common.DataView.setFieldCount.$1", "type": "string", "tags": [], "label": "fieldName", @@ -1859,7 +1806,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.setFieldCount.$2", + "id": "def-common.DataView.setFieldCount.$2", "type": "CompoundType", "tags": [], "label": "count", @@ -1876,7 +1823,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.setFieldFormat", + "id": "def-common.DataView.setFieldFormat", "type": "Function", "tags": [], "label": "setFieldFormat", @@ -1897,7 +1844,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPattern.setFieldFormat.$1", + "id": "def-common.DataView.setFieldFormat.$1", "type": "string", "tags": [], "label": "fieldName", @@ -1911,7 +1858,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.setFieldFormat.$2", + "id": "def-common.DataView.setFieldFormat.$2", "type": "Object", "tags": [], "label": "format", @@ -1935,7 +1882,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPattern.deleteFieldFormat", + "id": "def-common.DataView.deleteFieldFormat", "type": "Function", "tags": [], "label": "deleteFieldFormat", @@ -1948,7 +1895,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPattern.deleteFieldFormat.$1", + "id": "def-common.DataView.deleteFieldFormat.$1", "type": "string", "tags": [], "label": "fieldName", @@ -1968,18 +1915,18 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField", + "id": "def-common.DataViewField", "type": "Class", "tags": [], - "label": "IndexPatternField", + "label": "DataViewField", "description": [], "signature": [ { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" + "section": "def-common.DataViewField", + "text": "DataViewField" }, " implements ", { @@ -1995,7 +1942,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternField.spec", + "id": "def-common.DataViewField.spec", "type": "Object", "tags": [], "label": "spec", @@ -2014,7 +1961,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.Unnamed", + "id": "def-common.DataViewField.Unnamed", "type": "Function", "tags": [], "label": "Constructor", @@ -2027,7 +1974,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternField.Unnamed.$1", + "id": "def-common.DataViewField.Unnamed.$1", "type": "Object", "tags": [], "label": "spec", @@ -2050,7 +1997,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.count", + "id": "def-common.DataViewField.count", "type": "number", "tags": [], "label": "count", @@ -2062,7 +2009,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.count", + "id": "def-common.DataViewField.count", "type": "number", "tags": [], "label": "count", @@ -2072,7 +2019,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.runtimeField", + "id": "def-common.DataViewField.runtimeField", "type": "Object", "tags": [], "label": "runtimeField", @@ -2092,7 +2039,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.runtimeField", + "id": "def-common.DataViewField.runtimeField", "type": "Object", "tags": [], "label": "runtimeField", @@ -2112,7 +2059,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.script", + "id": "def-common.DataViewField.script", "type": "string", "tags": [], "label": "script", @@ -2127,7 +2074,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.script", + "id": "def-common.DataViewField.script", "type": "string", "tags": [], "label": "script", @@ -2140,7 +2087,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.lang", + "id": "def-common.DataViewField.lang", "type": "CompoundType", "tags": [], "label": "lang", @@ -2155,7 +2102,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.lang", + "id": "def-common.DataViewField.lang", "type": "CompoundType", "tags": [], "label": "lang", @@ -2168,7 +2115,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.customLabel", + "id": "def-common.DataViewField.customLabel", "type": "string", "tags": [], "label": "customLabel", @@ -2181,7 +2128,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.customLabel", + "id": "def-common.DataViewField.customLabel", "type": "string", "tags": [], "label": "customLabel", @@ -2194,7 +2141,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.conflictDescriptions", + "id": "def-common.DataViewField.conflictDescriptions", "type": "Object", "tags": [], "label": "conflictDescriptions", @@ -2209,7 +2156,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.conflictDescriptions", + "id": "def-common.DataViewField.conflictDescriptions", "type": "Object", "tags": [], "label": "conflictDescriptions", @@ -2222,7 +2169,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.name", + "id": "def-common.DataViewField.name", "type": "string", "tags": [], "label": "name", @@ -2232,7 +2179,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.displayName", + "id": "def-common.DataViewField.displayName", "type": "string", "tags": [], "label": "displayName", @@ -2242,7 +2189,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.type", + "id": "def-common.DataViewField.type", "type": "string", "tags": [], "label": "type", @@ -2252,7 +2199,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.esTypes", + "id": "def-common.DataViewField.esTypes", "type": "Array", "tags": [], "label": "esTypes", @@ -2265,7 +2212,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.scripted", + "id": "def-common.DataViewField.scripted", "type": "boolean", "tags": [], "label": "scripted", @@ -2275,7 +2222,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.searchable", + "id": "def-common.DataViewField.searchable", "type": "boolean", "tags": [], "label": "searchable", @@ -2285,7 +2232,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.aggregatable", + "id": "def-common.DataViewField.aggregatable", "type": "boolean", "tags": [], "label": "aggregatable", @@ -2295,7 +2242,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.readFromDocValues", + "id": "def-common.DataViewField.readFromDocValues", "type": "boolean", "tags": [], "label": "readFromDocValues", @@ -2305,7 +2252,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.subType", + "id": "def-common.DataViewField.subType", "type": "Object", "tags": [], "label": "subType", @@ -2319,7 +2266,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.isMapped", + "id": "def-common.DataViewField.isMapped", "type": "CompoundType", "tags": [], "label": "isMapped", @@ -2334,7 +2281,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.sortable", + "id": "def-common.DataViewField.sortable", "type": "boolean", "tags": [], "label": "sortable", @@ -2344,7 +2291,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.filterable", + "id": "def-common.DataViewField.filterable", "type": "boolean", "tags": [], "label": "filterable", @@ -2354,7 +2301,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.visualizable", + "id": "def-common.DataViewField.visualizable", "type": "boolean", "tags": [], "label": "visualizable", @@ -2364,7 +2311,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.deleteCount", + "id": "def-common.DataViewField.deleteCount", "type": "Function", "tags": [], "label": "deleteCount", @@ -2379,7 +2326,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.toJSON", + "id": "def-common.DataViewField.toJSON", "type": "Function", "tags": [], "label": "toJSON", @@ -2396,7 +2343,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternField.toSpec", + "id": "def-common.DataViewField.toSpec", "type": "Function", "tags": [], "label": "toSpec", @@ -2415,16 +2362,16 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" + "section": "def-common.FieldSpec", + "text": "FieldSpec" }, " | ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" + "section": "def-common.DataViewField", + "text": "DataViewField" }, ") => ", { @@ -2448,7 +2395,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternField.toSpec.$1.getFormatterForField", + "id": "def-common.DataViewField.toSpec.$1", "type": "Object", "tags": [], "label": "{\n getFormatterForField,\n }", @@ -2458,7 +2405,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternField.toSpec.$1.getFormatterForField.getFormatterForField", + "id": "def-common.DataViewField.toSpec.$1.getFormatterForField", "type": "Function", "tags": [], "label": "getFormatterForField", @@ -2477,16 +2424,16 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" + "section": "def-common.FieldSpec", + "text": "FieldSpec" }, " | ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" + "section": "def-common.DataViewField", + "text": "DataViewField" }, ") => ", { @@ -2511,17 +2458,17 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService", + "id": "def-common.DataViewsService", "type": "Class", "tags": [], - "label": "IndexPatternsService", + "label": "DataViewsService", "description": [], "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", "deprecated": false, "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.ensureDefaultIndexPattern", + "id": "def-common.DataViewsService.ensureDefaultIndexPattern", "type": "Function", "tags": [], "label": "ensureDefaultIndexPattern", @@ -2536,7 +2483,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.Unnamed", + "id": "def-common.DataViewsService.Unnamed", "type": "Function", "tags": [], "label": "Constructor", @@ -2549,7 +2496,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.Unnamed.$1", + "id": "def-common.DataViewsService.Unnamed.$1", "type": "Object", "tags": [], "label": "{\n uiSettings,\n savedObjectsClient,\n apiClient,\n fieldFormats,\n onNotification,\n onError,\n onRedirectNoIndexPattern = () => {},\n }", @@ -2566,7 +2513,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.getIds", + "id": "def-common.DataViewsService.getIds", "type": "Function", "tags": [], "label": "getIds", @@ -2581,7 +2528,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.getIds.$1", + "id": "def-common.DataViewsService.getIds.$1", "type": "boolean", "tags": [], "label": "refresh", @@ -2600,7 +2547,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.getTitles", + "id": "def-common.DataViewsService.getTitles", "type": "Function", "tags": [], "label": "getTitles", @@ -2615,7 +2562,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.getTitles.$1", + "id": "def-common.DataViewsService.getTitles.$1", "type": "boolean", "tags": [], "label": "refresh", @@ -2634,7 +2581,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.find", + "id": "def-common.DataViewsService.find", "type": "Function", "tags": [], "label": "find", @@ -2647,8 +2594,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, "[]>" ], @@ -2657,7 +2604,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.find.$1", + "id": "def-common.DataViewsService.find.$1", "type": "string", "tags": [], "label": "search", @@ -2671,7 +2618,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.find.$2", + "id": "def-common.DataViewsService.find.$2", "type": "number", "tags": [], "label": "size", @@ -2690,7 +2637,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.getIdsWithTitle", + "id": "def-common.DataViewsService.getIdsWithTitle", "type": "Function", "tags": [], "label": "getIdsWithTitle", @@ -2703,8 +2650,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternListItem", - "text": "IndexPatternListItem" + "section": "def-common.DataViewListItem", + "text": "DataViewListItem" }, "[]>" ], @@ -2713,7 +2660,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.getIdsWithTitle.$1", + "id": "def-common.DataViewsService.getIdsWithTitle.$1", "type": "boolean", "tags": [], "label": "refresh", @@ -2732,7 +2679,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.clearCache", + "id": "def-common.DataViewsService.clearCache", "type": "Function", "tags": [], "label": "clearCache", @@ -2747,7 +2694,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.clearCache.$1", + "id": "def-common.DataViewsService.clearCache.$1", "type": "string", "tags": [], "label": "id", @@ -2766,7 +2713,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.getCache", + "id": "def-common.DataViewsService.getCache", "type": "Function", "tags": [], "label": "getCache", @@ -2779,8 +2726,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternAttributes", - "text": "IndexPatternAttributes" + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" }, ", \"type\" | \"title\" | \"typeMeta\">>[] | null | undefined>" ], @@ -2791,7 +2738,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.getDefault", + "id": "def-common.DataViewsService.getDefault", "type": "Function", "tags": [], "label": "getDefault", @@ -2804,8 +2751,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, " | null>" ], @@ -2816,7 +2763,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.getDefaultId", + "id": "def-common.DataViewsService.getDefaultId", "type": "Function", "tags": [], "label": "getDefaultId", @@ -2833,7 +2780,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.setDefault", + "id": "def-common.DataViewsService.setDefault", "type": "Function", "tags": [], "label": "setDefault", @@ -2848,7 +2795,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.setDefault.$1", + "id": "def-common.DataViewsService.setDefault.$1", "type": "CompoundType", "tags": [], "label": "id", @@ -2862,7 +2809,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.setDefault.$2", + "id": "def-common.DataViewsService.setDefault.$2", "type": "boolean", "tags": [], "label": "force", @@ -2879,7 +2826,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.hasUserIndexPattern", + "id": "def-common.DataViewsService.hasUserIndexPattern", "type": "Function", "tags": [], "label": "hasUserIndexPattern", @@ -2896,7 +2843,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.getFieldsForWildcard", + "id": "def-common.DataViewsService.getFieldsForWildcard", "type": "Function", "tags": [], "label": "getFieldsForWildcard", @@ -2919,7 +2866,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.getFieldsForWildcard.$1", + "id": "def-common.DataViewsService.getFieldsForWildcard.$1", "type": "Object", "tags": [], "label": "options", @@ -2944,7 +2891,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.getFieldsForIndexPattern", + "id": "def-common.DataViewsService.getFieldsForIndexPattern", "type": "Function", "tags": [], "label": "getFieldsForIndexPattern", @@ -2957,16 +2904,16 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, " | ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" }, ", options?: ", { @@ -2983,7 +2930,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.getFieldsForIndexPattern.$1", + "id": "def-common.DataViewsService.getFieldsForIndexPattern.$1", "type": "CompoundType", "tags": [], "label": "indexPattern", @@ -2993,16 +2940,16 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, " | ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" } ], "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", @@ -3011,7 +2958,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.getFieldsForIndexPattern.$2", + "id": "def-common.DataViewsService.getFieldsForIndexPattern.$2", "type": "Object", "tags": [], "label": "options", @@ -3037,7 +2984,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.refreshFields", + "id": "def-common.DataViewsService.refreshFields", "type": "Function", "tags": [], "label": "refreshFields", @@ -3050,8 +2997,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, ") => Promise" ], @@ -3060,7 +3007,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.refreshFields.$1", + "id": "def-common.DataViewsService.refreshFields.$1", "type": "Object", "tags": [], "label": "indexPattern", @@ -3070,8 +3017,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" } ], "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", @@ -3083,7 +3030,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.fieldArrayToMap", + "id": "def-common.DataViewsService.fieldArrayToMap", "type": "Function", "tags": [], "label": "fieldArrayToMap", @@ -3122,7 +3069,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.fieldArrayToMap.$1", + "id": "def-common.DataViewsService.fieldArrayToMap.$1", "type": "Array", "tags": [], "label": "fields", @@ -3145,7 +3092,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.fieldArrayToMap.$2", + "id": "def-common.DataViewsService.fieldArrayToMap.$2", "type": "Object", "tags": [], "label": "fieldAttrs", @@ -3173,7 +3120,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.savedObjectToSpec", + "id": "def-common.DataViewsService.savedObjectToSpec", "type": "Function", "tags": [], "label": "savedObjectToSpec", @@ -3188,16 +3135,16 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternAttributes", - "text": "IndexPatternAttributes" + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" }, ">) => ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" } ], "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", @@ -3205,7 +3152,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.savedObjectToSpec.$1", + "id": "def-common.DataViewsService.savedObjectToSpec.$1", "type": "Object", "tags": [], "label": "savedObject", @@ -3217,8 +3164,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternAttributes", - "text": "IndexPatternAttributes" + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" }, ">" ], @@ -3233,7 +3180,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.get", + "id": "def-common.DataViewsService.get", "type": "Function", "tags": [], "label": "get", @@ -3246,8 +3193,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, ">" ], @@ -3256,7 +3203,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.get.$1", + "id": "def-common.DataViewsService.get.$1", "type": "string", "tags": [], "label": "id", @@ -3273,7 +3220,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.create", + "id": "def-common.DataViewsService.create", "type": "Function", "tags": [], "label": "create", @@ -3286,16 +3233,16 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" }, ", skipFetchFields?: boolean) => Promise<", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, ">" ], @@ -3304,7 +3251,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.create.$1", + "id": "def-common.DataViewsService.create.$1", "type": "Object", "tags": [], "label": "spec", @@ -3314,8 +3261,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" } ], "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", @@ -3324,7 +3271,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.create.$2", + "id": "def-common.DataViewsService.create.$2", "type": "boolean", "tags": [], "label": "skipFetchFields", @@ -3343,7 +3290,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.createAndSave", + "id": "def-common.DataViewsService.createAndSave", "type": "Function", "tags": [], "label": "createAndSave", @@ -3356,16 +3303,16 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" }, ", override?: boolean, skipFetchFields?: boolean) => Promise<", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, ">" ], @@ -3374,7 +3321,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.createAndSave.$1", + "id": "def-common.DataViewsService.createAndSave.$1", "type": "Object", "tags": [], "label": "spec", @@ -3384,8 +3331,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" } ], "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", @@ -3394,7 +3341,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.createAndSave.$2", + "id": "def-common.DataViewsService.createAndSave.$2", "type": "boolean", "tags": [], "label": "override", @@ -3410,7 +3357,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.createAndSave.$3", + "id": "def-common.DataViewsService.createAndSave.$3", "type": "boolean", "tags": [], "label": "skipFetchFields", @@ -3429,7 +3376,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.createSavedObject", + "id": "def-common.DataViewsService.createSavedObject", "type": "Function", "tags": [], "label": "createSavedObject", @@ -3442,16 +3389,16 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, ", override?: boolean) => Promise<", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, ">" ], @@ -3460,7 +3407,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.createSavedObject.$1", + "id": "def-common.DataViewsService.createSavedObject.$1", "type": "Object", "tags": [], "label": "indexPattern", @@ -3470,8 +3417,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" } ], "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", @@ -3480,7 +3427,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.createSavedObject.$2", + "id": "def-common.DataViewsService.createSavedObject.$2", "type": "boolean", "tags": [], "label": "override", @@ -3499,7 +3446,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.updateSavedObject", + "id": "def-common.DataViewsService.updateSavedObject", "type": "Function", "tags": [], "label": "updateSavedObject", @@ -3512,8 +3459,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, ", saveAttempts?: number, ignoreErrors?: boolean) => Promise" ], @@ -3522,7 +3469,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.updateSavedObject.$1", + "id": "def-common.DataViewsService.updateSavedObject.$1", "type": "Object", "tags": [], "label": "indexPattern", @@ -3532,8 +3479,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" } ], "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", @@ -3542,7 +3489,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.updateSavedObject.$2", + "id": "def-common.DataViewsService.updateSavedObject.$2", "type": "number", "tags": [], "label": "saveAttempts", @@ -3556,7 +3503,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.updateSavedObject.$3", + "id": "def-common.DataViewsService.updateSavedObject.$3", "type": "boolean", "tags": [], "label": "ignoreErrors", @@ -3573,7 +3520,7 @@ }, { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.delete", + "id": "def-common.DataViewsService.delete", "type": "Function", "tags": [], "label": "delete", @@ -3588,7 +3535,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.IndexPatternsService.delete.$1", + "id": "def-common.DataViewsService.delete.$1", "type": "string", "tags": [], "label": "indexPatternId", @@ -3607,4881 +3554,9913 @@ } ], "initialIsOpen": false - } - ], - "functions": [ + }, { "parentPluginId": "data", - "id": "def-common.fieldList", - "type": "Function", + "id": "def-common.DuplicateDataViewError", + "type": "Class", "tags": [], - "label": "fieldList", + "label": "DuplicateDataViewError", "description": [], "signature": [ - "(specs?: ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" + "section": "def-common.DuplicateDataViewError", + "text": "DuplicateDataViewError" }, - "[], shortDotsEnable?: boolean) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IIndexPatternFieldList", - "text": "IIndexPatternFieldList" - } + " extends Error" ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "path": "src/plugins/data/common/index_patterns/errors/duplicate_index_pattern.ts", "deprecated": false, "children": [ { "parentPluginId": "data", - "id": "def-common.fieldList.$1", - "type": "Array", + "id": "def-common.DuplicateDataViewError.Unnamed", + "type": "Function", "tags": [], - "label": "specs", + "label": "Constructor", "description": [], "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - "[]" + "any" ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "path": "src/plugins/data/common/index_patterns/errors/duplicate_index_pattern.ts", "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-common.fieldList.$2", - "type": "boolean", - "tags": [], - "label": "shortDotsEnable", - "description": [], - "signature": [ - "boolean" + "children": [ + { + "parentPluginId": "data", + "id": "def-common.DuplicateDataViewError.Unnamed.$1", + "type": "string", + "tags": [], + "label": "message", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data/common/index_patterns/errors/duplicate_index_pattern.ts", + "deprecated": false, + "isRequired": true + } ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "isRequired": true + "returnComment": [] } ], - "returnComment": [], "initialIsOpen": false }, { "parentPluginId": "data", - "id": "def-common.getIndexPatternLoadMeta", - "type": "Function", - "tags": [], - "label": "getIndexPatternLoadMeta", + "id": "def-common.IndexPattern", + "type": "Class", + "tags": [ + "deprecated" + ], + "label": "IndexPattern", "description": [], "signature": [ - "() => Pick<", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternLoadExpressionFunctionDefinition", - "text": "IndexPatternLoadExpressionFunctionDefinition" + "section": "def-common.IndexPattern", + "text": "IndexPattern" }, - ", \"type\" | \"telemetry\" | \"extract\" | \"inject\" | \"migrations\" | \"name\" | \"disabled\" | \"help\" | \"inputTypes\" | \"args\" | \"aliases\" | \"context\">" - ], - "path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.isFilterable", - "type": "Function", - "tags": [], - "label": "isFilterable", - "description": [], - "signature": [ - "(field: ", + " extends ", { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - ") => boolean" - ], - "path": "src/plugins/data/common/index_patterns/fields/utils.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.isFilterable.$1", - "type": "Object", - "tags": [], - "label": "field", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - } - ], - "path": "src/plugins/data/common/index_patterns/fields/utils.ts", - "deprecated": false, - "isRequired": true + "section": "def-common.DataView", + "text": "DataView" } ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.isNestedField", - "type": "Function", - "tags": [], - "label": "isNestedField", - "description": [], - "signature": [ - "(field: ", + "path": "src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts", + "deprecated": true, + "references": [ { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" }, - ") => boolean" - ], - "path": "src/plugins/data/common/index_patterns/fields/utils.ts", - "deprecated": false, - "children": [ { - "parentPluginId": "data", - "id": "def-common.isNestedField.$1", - "type": "Object", - "tags": [], - "label": "field", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - } - ], - "path": "src/plugins/data/common/index_patterns/fields/utils.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - } - ], - "interfaces": [ - { - "parentPluginId": "data", - "id": "def-common.FieldAttrs", - "type": "Interface", - "tags": [ - "intenal" - ], - "label": "FieldAttrs", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" + }, { - "parentPluginId": "data", - "id": "def-common.FieldAttrs.Unnamed", - "type": "Any", - "tags": [], - "label": "Unnamed", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.FieldAttrSet", - "type": "Interface", - "tags": [], - "label": "FieldAttrSet", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" + }, { - "parentPluginId": "data", - "id": "def-common.FieldAttrSet.customLabel", - "type": "string", - "tags": [], - "label": "customLabel", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" }, { - "parentPluginId": "data", - "id": "def-common.FieldAttrSet.count", - "type": "number", - "tags": [], - "label": "count", - "description": [], - "signature": [ - "number | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.FieldSpec", - "type": "Interface", - "tags": [], - "label": "FieldSpec", - "description": [], - "signature": [ + "plugin": "reporting", + "path": "x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" + "plugin": "reporting", + "path": "x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts" }, - " extends ", - "IndexPatternFieldBase" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ { - "parentPluginId": "data", - "id": "def-common.FieldSpec.count", - "type": "number", - "tags": [], - "label": "count", - "description": [ - "\nPopularity count is used by discover" - ], - "signature": [ - "number | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.ts" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpec.conflictDescriptions", - "type": "Object", - "tags": [], - "label": "conflictDescriptions", - "description": [], - "signature": [ - "Record | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.ts" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpec.format", - "type": "Object", - "tags": [], - "label": "format", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.SerializedFieldFormat", - "text": "SerializedFieldFormat" - }, - "> | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/columns.ts" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpec.esTypes", - "type": "Array", - "tags": [], - "label": "esTypes", - "description": [], - "signature": [ - "string[] | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/columns.ts" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpec.searchable", - "type": "boolean", - "tags": [], - "label": "searchable", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/helpers/update_search_source.ts" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpec.aggregatable", - "type": "boolean", - "tags": [], - "label": "aggregatable", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/helpers/update_search_source.ts" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpec.readFromDocValues", - "type": "CompoundType", - "tags": [], - "label": "readFromDocValues", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpec.indexed", - "type": "CompoundType", - "tags": [], - "label": "indexed", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpec.customLabel", - "type": "string", - "tags": [], - "label": "customLabel", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/services/use_es_doc_search.ts" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpec.runtimeField", - "type": "Object", - "tags": [], - "label": "runtimeField", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.RuntimeField", - "text": "RuntimeField" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/services/use_es_doc_search.ts" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpec.shortDotsEnable", - "type": "CompoundType", - "tags": [], - "label": "shortDotsEnable", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/services/use_es_doc_search.ts" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpec.isMapped", - "type": "CompoundType", - "tags": [], - "label": "isMapped", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.FieldSpecExportFmt", - "type": "Interface", - "tags": [], - "label": "FieldSpecExportFmt", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/services/use_es_doc_search.ts" + }, { - "parentPluginId": "data", - "id": "def-common.FieldSpecExportFmt.count", - "type": "number", - "tags": [], - "label": "count", - "description": [], - "signature": [ - "number | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app_content.tsx" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpecExportFmt.script", - "type": "string", - "tags": [], - "label": "script", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app_content.tsx" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpecExportFmt.lang", - "type": "CompoundType", - "tags": [], - "label": "lang", - "description": [], - "signature": [ - "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app.tsx" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpecExportFmt.conflictDescriptions", - "type": "Object", - "tags": [], - "label": "conflictDescriptions", - "description": [], - "signature": [ - "Record | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app.tsx" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpecExportFmt.name", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_index_pattern.tsx" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpecExportFmt.type", - "type": "Enum", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "KBN_FIELD_TYPES" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_index_pattern.tsx" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpecExportFmt.esTypes", - "type": "Array", - "tags": [], - "label": "esTypes", - "description": [], - "signature": [ - "string[] | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpecExportFmt.scripted", - "type": "boolean", - "tags": [], - "label": "scripted", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpecExportFmt.searchable", - "type": "boolean", - "tags": [], - "label": "searchable", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/update_search_source.ts" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpecExportFmt.aggregatable", - "type": "boolean", - "tags": [], - "label": "aggregatable", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/update_search_source.ts" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpecExportFmt.readFromDocValues", - "type": "CompoundType", - "tags": [], - "label": "readFromDocValues", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/types.ts" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpecExportFmt.subType", - "type": "Object", - "tags": [], - "label": "subType", - "description": [], - "signature": [ - "IFieldSubType", - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/types.ts" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpecExportFmt.format", - "type": "Object", - "tags": [], - "label": "format", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.SerializedFieldFormat", - "text": "SerializedFieldFormat" - }, - "> | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/discover_documents.tsx" }, { - "parentPluginId": "data", - "id": "def-common.FieldSpecExportFmt.indexed", - "type": "CompoundType", - "tags": [], - "label": "indexed", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.GetFieldsOptions", - "type": "Interface", - "tags": [], - "label": "GetFieldsOptions", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/discover_documents.tsx" + }, { - "parentPluginId": "data", - "id": "def-common.GetFieldsOptions.pattern", - "type": "string", - "tags": [], - "label": "pattern", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts" }, { - "parentPluginId": "data", - "id": "def-common.GetFieldsOptions.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts" }, { - "parentPluginId": "data", - "id": "def-common.GetFieldsOptions.lookBack", - "type": "CompoundType", - "tags": [], - "label": "lookBack", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts" }, { - "parentPluginId": "data", - "id": "def-common.GetFieldsOptions.metaFields", - "type": "Array", - "tags": [], - "label": "metaFields", - "description": [], - "signature": [ - "string[] | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts" }, { - "parentPluginId": "data", - "id": "def-common.GetFieldsOptions.rollupIndex", - "type": "string", - "tags": [], - "label": "rollupIndex", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts" }, { - "parentPluginId": "data", - "id": "def-common.GetFieldsOptions.allowNoIndex", - "type": "CompoundType", - "tags": [], - "label": "allowNoIndex", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.GetFieldsOptionsTimePattern", - "type": "Interface", - "tags": [], - "label": "GetFieldsOptionsTimePattern", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx" + }, { - "parentPluginId": "data", - "id": "def-common.GetFieldsOptionsTimePattern.pattern", - "type": "string", - "tags": [], - "label": "pattern", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx" }, { - "parentPluginId": "data", - "id": "def-common.GetFieldsOptionsTimePattern.metaFields", - "type": "Array", - "tags": [], - "label": "metaFields", - "description": [], - "signature": [ - "string[]" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts" }, { - "parentPluginId": "data", - "id": "def-common.GetFieldsOptionsTimePattern.lookBack", - "type": "number", - "tags": [], - "label": "lookBack", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts" }, { - "parentPluginId": "data", - "id": "def-common.GetFieldsOptionsTimePattern.interval", - "type": "string", - "tags": [], - "label": "interval", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.IFieldType", - "type": "Interface", - "tags": [ - "deprecated" - ], - "label": "IFieldType", - "description": [], - "signature": [ + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" + "plugin": "maps", + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" }, - " extends ", - "IndexPatternFieldBase" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": true, - "removeBy": "8.1", - "references": [ { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/types/index.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/types/index.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "osquery", + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/index.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/index.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/threat_match/index.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "plugin": "transform", + "path": "x-pack/plugins/transform/common/types/index_pattern.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "plugin": "transform", + "path": "x-pack/plugins/transform/common/types/index_pattern.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "plugin": "transform", + "path": "x-pack/plugins/transform/common/types/index_pattern.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "plugin": "transform", + "path": "x-pack/plugins/transform/common/types/index_pattern.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.test.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.tsx" + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/existing_fields.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/existing_fields.d.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metrics_editor.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metrics_editor.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/types.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/types.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/index_pattern_select.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/index_pattern_select.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/update_source_editor.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_pattern.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/update_source_editor.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_pattern.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_field_visualize.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_field_visualize.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/embeddable/types.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/embeddable/types.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/common/group_by_expression/selector.tsx" + "plugin": "uptime", + "path": "x-pack/plugins/uptime/public/state/reducers/index_pattern.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/common/group_by_expression/selector.tsx" + "plugin": "uptime", + "path": "x-pack/plugins/uptime/public/state/reducers/index_pattern.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/common/group_by_expression/group_by_expression.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.test.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/common/group_by_expression/group_by_expression.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.test.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/types.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/types.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/types.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criteria.tsx" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/vis.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criteria.tsx" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/vis.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/group_by.tsx" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/vis_types/types.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/group_by.tsx" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/vis_types/types.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/vis_types/types.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/doc_views/doc_views_types.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/metrics.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/doc_views/doc_views_types.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/metrics.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/shared_imports.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/kibana_services.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/helpers.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/get_render_cell_value.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_default_sort.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_default_sort.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/table_header.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_header/table_header.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort_for_search_source.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort_for_search_source.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_data_grid_columns.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_data_grid_columns.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/utils/sorting.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/utils/sorting.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/calc_field_counts.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/common/group_by_expression/group_by_expression.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/calc_field_counts.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/common/group_by_expression/group_by_expression.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/common/group_by_expression/selector.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/common/group_by_expression/selector.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/inventory/components/expression.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/inventory/components/expression.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/inventory/components/metric.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/nested_fields.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/inventory/components/metric.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/nested_fields.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_row.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_row.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/types.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/types.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/log_threshold/components/expression_editor/criteria.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/log_threshold/components/expression_editor/criteria.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/log_threshold/components/expression_editor/criterion.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/log_threshold/components/expression_editor/criterion.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_row.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/components/group_by.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/components/table_row.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/components/group_by.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/components/metrics.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/components/metrics.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/services/discover_state.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/actions/columns.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/actions/columns.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/utils/use_context_app_state.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/utils/use_context_app_state.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/single_field_select.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/anchor.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/single_field_select.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/anchor.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/utils/use_context_app_fetch.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/utils/use_context_app_fetch.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/public/indexpattern_datasource/types.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/persist_saved_search.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/persist_saved_search.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" }, { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts" + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" }, { - "plugin": "lens", - "path": "x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts" + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts" + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts" + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/types.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/types.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/utils.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/utils.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/utils.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "lens", + "path": "x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" - } - ], - "children": [ + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + }, { - "parentPluginId": "data", - "id": "def-common.IFieldType.count", - "type": "number", - "tags": [], - "label": "count", - "description": [], - "signature": [ - "number | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" }, { - "parentPluginId": "data", - "id": "def-common.IFieldType.esTypes", - "type": "Array", - "tags": [], - "label": "esTypes", - "description": [], - "signature": [ - "string[] | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_agg_tooltip_property.ts" }, { - "parentPluginId": "data", - "id": "def-common.IFieldType.aggregatable", - "type": "CompoundType", - "tags": [], - "label": "aggregatable", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_agg_tooltip_property.ts" }, { - "parentPluginId": "data", - "id": "def-common.IFieldType.filterable", - "type": "CompoundType", - "tags": [], - "label": "filterable", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts" }, { - "parentPluginId": "data", - "id": "def-common.IFieldType.searchable", - "type": "CompoundType", - "tags": [], - "label": "searchable", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts" }, { - "parentPluginId": "data", - "id": "def-common.IFieldType.sortable", - "type": "CompoundType", - "tags": [], - "label": "sortable", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts" }, { - "parentPluginId": "data", - "id": "def-common.IFieldType.visualizable", - "type": "CompoundType", - "tags": [], - "label": "visualizable", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts" }, { - "parentPluginId": "data", - "id": "def-common.IFieldType.readFromDocValues", - "type": "CompoundType", - "tags": [], - "label": "readFromDocValues", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts" }, { - "parentPluginId": "data", - "id": "def-common.IFieldType.displayName", - "type": "string", - "tags": [], - "label": "displayName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts" }, { - "parentPluginId": "data", - "id": "def-common.IFieldType.customLabel", - "type": "string", - "tags": [], - "label": "customLabel", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts" }, { - "parentPluginId": "data", - "id": "def-common.IFieldType.format", - "type": "Any", - "tags": [], - "label": "format", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" }, { - "parentPluginId": "data", - "id": "def-common.IFieldType.toSpec", - "type": "Function", - "tags": [], - "label": "toSpec", - "description": [], - "signature": [ - "((options?: { getFormatterForField?: ((field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") => ", - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormat", - "text": "FieldFormat" - }, - ") | undefined; } | undefined) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.IFieldType.toSpec.$1.options", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.IFieldType.toSpec.$1.options.getFormatterForField", - "type": "Function", - "tags": [], - "label": "getFormatterForField", - "description": [], - "signature": [ - "((field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") => ", - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormat", - "text": "FieldFormat" - }, - ") | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/types.ts", - "deprecated": false - } - ] - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.IIndexPattern", - "type": "Interface", - "tags": [ - "deprecated" - ], - "label": "IIndexPattern", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IIndexPattern", - "text": "IIndexPattern" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" }, - " extends ", - "IndexPatternBase" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": true, - "references": [ { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/helpers.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/helpers.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/container/source/index.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/container/source/index.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/geo_index_pattern_select.tsx" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/container/source/index.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/geo_index_pattern_select.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/components/data_recognizer/data_recognizer.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/components/data_recognizer/data_recognizer.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/geo_line_form.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/geo_line_form.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/create_source_editor.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/utils/kuery.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/create_source_editor.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/utils/kuery.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/create_source_editor.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/update_source_editor.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/update_source_editor.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/routes/map_page/map_app/map_app.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.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" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/containers/with_source/with_source.tsx" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/containers/with_source/with_source.tsx" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/toolbar.tsx" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/toolbar.tsx" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts" + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/field_format_service.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/field_format_service.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/datavisualizer/index_based/data_loader/data_loader.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/url_state/types.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/url_state/types.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/hooks/use_index_data.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/url_state/types.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/scatterplot_matrix/use_scatterplot_field_options.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/query_bar/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/scatterplot_matrix/use_scatterplot_field_options.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/query_bar/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_bar/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_bar/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/columns.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/columns.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/columns.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/single_metric_job_creator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/single_metric_job_creator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/multi_metric_job_creator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/multi_metric_job_creator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/population_job_creator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/population_job_creator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/advanced_job_creator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/advanced_job_creator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/results_loader/categorization_examples_loader.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/categorization_job_creator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/categorization_job_creator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/rare_job_creator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/rare_job_creator.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator_factory.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/pages/details/types.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/job_creator/job_creator_factory.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/pages/details/types.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector_service.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector_service.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/details/types.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/hosts/pages/details/types.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/outlier_exploration/use_outlier_data.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/use_exploration_results.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/exploration_results_table.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_results_table/exploration_results_table.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/ml_context.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/ml_context.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/details/types.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/common/use_results_view_config.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/ueba/pages/details/types.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/common/use_results_view_config.ts" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/mock/index_pattern.ts" + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/common/use_results_view_config.ts" }, { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/public/mock/index_pattern.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/common/search_strategy/index_fields/index.d.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/common/search_strategy/index_fields/index.d.ts" + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts" }, { "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/containers/with_kuery_autocompletion.d.ts" + "path": "x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts" }, { "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/containers/with_kuery_autocompletion.d.ts" + "path": "x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/containers/with_source/with_source.d.ts" + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/containers/with_source/with_source.d.ts" + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/index_pattern_context.ts" + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/index_pattern_context.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/types/app_state.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/types/app_state.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/datasource.sagas.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/datasource.sagas.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/search_bar.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/search_bar.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_chart.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/search_bar.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_chart.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/search_bar.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/inspect_panel.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/inspect_panel.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/index.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/workspace_layout/workspace_layout.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/index.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/workspace_layout/workspace_layout.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/components/workspace_layout/workspace_layout.tsx" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/index_pattern_cache.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/index_pattern_cache.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/index_pattern_cache.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/index.d.ts" + "path": "x-pack/plugins/security_solution/public/detections/components/rules/threatmatch_input/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/index.d.ts" + "path": "x-pack/plugins/security_solution/public/detections/components/rules/threatmatch_input/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/network/pages/details/types.d.ts" + "path": "x-pack/plugins/security_solution/public/detections/components/rules/threatmatch_input/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/network/pages/details/types.d.ts" + "path": "x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/ueba/pages/details/types.d.ts" + "path": "x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/target/types/public/ueba/pages/details/types.d.ts" + "path": "x-pack/plugins/security_solution/public/detections/components/rules/step_define_rule/index.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.d.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.d.ts" + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.d.ts" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.d.ts" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/get_pivot_dropdown_options.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/get_pivot_dropdown_options.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/common/request.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/common/request.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/common/request.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/common/request.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" + "plugin": "uptime", + "path": "x-pack/plugins/uptime/public/hooks/update_kuery_string.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx" + "plugin": "uptime", + "path": "x-pack/plugins/uptime/public/hooks/update_kuery_string.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/mocks.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/mocks.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/index.tsx" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/public/pages/metrics/index.tsx" + "plugin": "graph", + "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/embeddable/embeddable.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/embeddable/embeddable.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/pages/navigation/types.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/utils.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/pages/navigation/types.ts" + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/utils.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/network/pages/navigation/types.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/es_search_source.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/es_search_source.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_index_pattern_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_index_pattern_select.d.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx" + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities._service.test.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx" + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities._service.test.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/editor.tsx" + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/remove_nested_field_children.test.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/editor.tsx" + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/remove_nested_field_children.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx" + "path": "x-pack/plugins/ml/public/application/contexts/ml/__mocks__/index_pattern.ts" }, { "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx" + "path": "x-pack/plugins/ml/public/application/contexts/ml/__mocks__/index_pattern.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/count_agg_field.d.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/count_agg_field.d.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/agg_field.d.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/agg_field.d.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" }, { - "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/geo_line_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/geo_line_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/filter_editor/filter_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/filter_editor/filter_editor.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/components/full_time_range_selector/full_time_range_selector.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/components/full_time_range_selector/full_time_range_selector.d.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/target/types/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.d.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/target/types/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.d.ts" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts" }, { "plugin": "stackAlerts", - "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts" }, { "plugin": "transform", - "path": "x-pack/plugins/transform/public/app/services/es_index_service.ts" + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/common.test.ts" }, { "plugin": "transform", - "path": "x-pack/plugins/transform/public/app/services/es_index_service.ts" + "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/common.test.ts" }, { - "plugin": "transform", - "path": "x-pack/plugins/transform/server/routes/api/transforms.ts" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" }, { - "plugin": "transform", - "path": "x-pack/plugins/transform/server/routes/api/transforms.ts" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/open_editor.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/open_editor.tsx" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/types.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx" + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/types.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/utils/new_job_utils.test.ts" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" }, { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/jobs/new_job/utils/new_job_utils.test.ts" - } - ], - "children": [ + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, { - "parentPluginId": "data", - "id": "def-common.IIndexPattern.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" }, { - "parentPluginId": "data", - "id": "def-common.IIndexPattern.fields", - "type": "Array", - "tags": [], - "label": "fields", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - "[]" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" }, { - "parentPluginId": "data", - "id": "def-common.IIndexPattern.type", - "type": "string", - "tags": [], - "label": "type", - "description": [ - "\nType is used for identifying rollup indices, otherwise left undefined" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" }, { - "parentPluginId": "data", - "id": "def-common.IIndexPattern.timeFieldName", - "type": "string", - "tags": [], - "label": "timeFieldName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" }, { - "parentPluginId": "data", - "id": "def-common.IIndexPattern.getTimeField", - "type": "Function", - "tags": [], - "label": "getTimeField", - "description": [], - "signature": [ - "(() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | undefined) | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" }, { - "parentPluginId": "data", - "id": "def-common.IIndexPattern.fieldFormatMap", - "type": "Object", - "tags": [], - "label": "fieldFormatMap", - "description": [], - "signature": [ - "Record | undefined> | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" }, { - "parentPluginId": "data", - "id": "def-common.IIndexPattern.getFormatterForField", - "type": "Function", - "tags": [], - "label": "getFormatterForField", - "description": [ - "\nLook up a formatter for a given field" - ], - "signature": [ - "((field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") => ", - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormat", - "text": "FieldFormat" - }, - ") | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.IIndexPattern.getFormatterForField.$1", - "type": "CompoundType", - "tags": [], - "label": "field", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList", - "type": "Interface", - "tags": [], - "label": "IIndexPatternFieldList", - "description": [], - "signature": [ + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" + }, { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IIndexPatternFieldList", - "text": "IIndexPatternFieldList" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" }, - " extends ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" }, - "[]" - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "children": [ { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList.add", - "type": "Function", - "tags": [], - "label": "add", - "description": [], - "signature": [ - "(field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") => void" - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList.add.$1", - "type": "Object", - "tags": [], - "label": "field", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" }, { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList.getAll", - "type": "Function", - "tags": [], - "label": "getAll", - "description": [], - "signature": [ - "() => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - "[]" - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList.getByName", - "type": "Function", - "tags": [], - "label": "getByName", - "description": [], - "signature": [ - "(name: string) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList.getByName.$1", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList.getByType", - "type": "Function", - "tags": [], - "label": "getByType", - "description": [], - "signature": [ - "(type: string) => ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - "[]" - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList.getByType.$1", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList.remove", - "type": "Function", - "tags": [], - "label": "remove", - "description": [], - "signature": [ - "(field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - ") => void" - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList.remove.$1", - "type": "Object", - "tags": [], + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/create_search_source.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/create_search_source.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/controls_tab.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/controls_tab.tsx" + }, + { + "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": "visualize", + "path": "src/plugins/visualize/public/application/components/visualize_top_nav.tsx" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/components/visualize_top_nav.tsx" + }, + { + "plugin": "visualize", + "path": "src/plugins/visualize/public/application/components/visualize_top_nav.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/utils/editor_config.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/utils/editor_config.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_select.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_select.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params.tsx" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/test_utils/get_index_pattern_mock.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/test_utils/get_index_pattern_mock.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/test_utils/get_index_pattern_mock.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.test.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.test.ts" + }, + { + "plugin": "visTypeTable", + "path": "src/plugins/vis_types/table/public/legacy/table_vis_controller.test.ts" + }, + { + "plugin": "visTypeTable", + "path": "src/plugins/vis_types/table/public/legacy/table_vis_controller.test.ts" + }, + { + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts" + }, + { + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts" + }, + { + "plugin": "visTypeVega", + "path": "src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/target/types/public/types.d.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/target/types/public/types.d.ts" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/utils/editor_config.d.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/utils/editor_config.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/control/create_search_source.d.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/control/create_search_source.d.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/test_utils/get_index_pattern_mock.d.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/test_utils/get_index_pattern_mock.d.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/agg_select.d.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/agg_select.d.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_sharing_data.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_sharing_data.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/get_sharing_data.test.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/components/editor/controls_tab.d.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/target/types/public/components/editor/controls_tab.d.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/target/types/public/application/components/lib/convert_series_to_datatable.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_calculator.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_calculator.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/utils/nested_fields.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/utils/nested_fields.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/data_loader/data_loader.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/data_loader/data_loader.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/data_loader/data_loader.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/search_panel.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_pattern_management/index_pattern_management.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_pattern_management/index_pattern_management.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/embeddables/types.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/embeddables/types.ts" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx" + }, + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/agg/percentile_agg_field.d.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": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.test.ts" + } + ], + "children": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.IndexPatternField", + "type": "Class", + "tags": [ + "deprecated" + ], + "label": "IndexPatternField", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPatternField", + "text": "IndexPatternField" + }, + " extends ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + } + ], + "path": "src/plugins/data/common/index_patterns/fields/index_pattern_field.ts", + "deprecated": true, + "references": [ + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/shared_imports.ts" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" + }, + { + "plugin": "indexPatternFieldEditor", + "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/kibana_services.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/field_name/field_name.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/field_name/field_name.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table_cell_actions.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table_cell_actions.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/table/table.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_details.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_index_pattern_field_list.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/top_hits_form.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/update_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/geo_field_select.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/top_hits/create_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/metrics_editor/metrics_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/components/metrics_editor/metrics_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/update_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_geo_line_source/update_source_editor.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/layer_template.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/server/maps_telemetry/maps_telemetry.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_source/es_source.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/es_doc_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/fields/es_doc_field.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/index_pattern_util.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_field_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/geo_field_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/single_field_select.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/classes/sources/es_search_source/util/get_docvalue_source_fields.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/metrics_editor/metrics_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/metrics_editor/metrics_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/metrics_editor/metric_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/components/metrics_editor/metric_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/layers/choropleth_layer_wizard/layer_template.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_geo_line_source/update_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/create_source_editor.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/classes/sources/es_search_source/top_hits/top_hits_form.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.d.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/list_control_factory.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/list_control_factory.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/range_control_factory.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/range_control_factory.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/field_select.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_param_props.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_param_props.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/field.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/field.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/field.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/field.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/top_field.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/top_field.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/top_sort_field.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/controls/top_sort_field.tsx" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/agg_param_props.d.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/agg_param_props.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/controls/top_field.d.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/controls/top_field.d.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/controls/top_sort_field.d.ts" + }, + { + "plugin": "visDefaultEditor", + "path": "src/plugins/vis_default_editor/target/types/public/components/controls/top_sort_field.d.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/field_filter.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/group_fields.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/group_fields.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/group_fields.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/group_fields.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/lib/group_fields.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/context_app.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_visualize.tsx" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/field_stats.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/field_stats.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/field_stats.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/field_stats.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/field_stats.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/get_fields_to_show.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/visualize_trigger_utils.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_field_visualize.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_field_visualize.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_field_visualize.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts" + } + ], + "children": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.IndexPatternsService", + "type": "Class", + "tags": [ + "deprecated" + ], + "label": "IndexPatternsService", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPatternsService", + "text": "IndexPatternsService" + }, + " extends ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewsService", + "text": "DataViewsService" + } + ], + "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", + "deprecated": true, + "references": [ + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/types.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/types.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/server/kibana_server_services.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/server/kibana_server_services.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/server/data_indexing/create_doc_source.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/server/data_indexing/create_doc_source.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/server/routes/existing_fields.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/fields_fetcher.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/fields_fetcher.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/plugin.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/plugin.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_patterns.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/__mocks__/index_patterns.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.test.ts" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/combo_box_select.tsx" + }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/combo_box_select.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.test.ts" + } + ], + "children": [], + "initialIsOpen": false + } + ], + "functions": [ + { + "parentPluginId": "data", + "id": "def-common.fieldList", + "type": "Function", + "tags": [], + "label": "fieldList", + "description": [], + "signature": [ + "(specs?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + "[], shortDotsEnable?: boolean) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IIndexPatternFieldList", + "text": "IIndexPatternFieldList" + } + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.fieldList.$1", + "type": "Array", + "tags": [], + "label": "specs", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + "[]" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-common.fieldList.$2", + "type": "boolean", + "tags": [], + "label": "shortDotsEnable", + "description": [], + "signature": [ + "boolean" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.getIndexPatternLoadMeta", + "type": "Function", + "tags": [], + "label": "getIndexPatternLoadMeta", + "description": [], + "signature": [ + "() => Pick<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IndexPatternLoadExpressionFunctionDefinition", + "text": "IndexPatternLoadExpressionFunctionDefinition" + }, + ", \"type\" | \"telemetry\" | \"inject\" | \"extract\" | \"migrations\" | \"name\" | \"disabled\" | \"help\" | \"inputTypes\" | \"args\" | \"aliases\" | \"context\">" + ], + "path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts", + "deprecated": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.isFilterable", + "type": "Function", + "tags": [], + "label": "isFilterable", + "description": [], + "signature": [ + "(field: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + ") => boolean" + ], + "path": "src/plugins/data/common/index_patterns/fields/utils.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.isFilterable.$1", + "type": "Object", + "tags": [], + "label": "field", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + } + ], + "path": "src/plugins/data/common/index_patterns/fields/utils.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.isNestedField", + "type": "Function", + "tags": [], + "label": "isNestedField", + "description": [], + "signature": [ + "(field: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + ") => boolean" + ], + "path": "src/plugins/data/common/index_patterns/fields/utils.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.isNestedField.$1", + "type": "Object", + "tags": [], + "label": "field", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + } + ], + "path": "src/plugins/data/common/index_patterns/fields/utils.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "data", + "id": "def-common.DataViewAttributes", + "type": "Interface", + "tags": [], + "label": "DataViewAttributes", + "description": [ + "\nInterface for an index pattern saved object" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.DataViewAttributes.fields", + "type": "string", + "tags": [], + "label": "fields", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewAttributes.title", + "type": "string", + "tags": [], + "label": "title", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewAttributes.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewAttributes.typeMeta", + "type": "string", + "tags": [], + "label": "typeMeta", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewAttributes.timeFieldName", + "type": "string", + "tags": [], + "label": "timeFieldName", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewAttributes.intervalName", + "type": "string", + "tags": [], + "label": "intervalName", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewAttributes.sourceFilters", + "type": "string", + "tags": [], + "label": "sourceFilters", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewAttributes.fieldFormatMap", + "type": "string", + "tags": [], + "label": "fieldFormatMap", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewAttributes.fieldAttrs", + "type": "string", + "tags": [], + "label": "fieldAttrs", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewAttributes.runtimeFieldMap", + "type": "string", + "tags": [], + "label": "runtimeFieldMap", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewAttributes.allowNoIndex", + "type": "CompoundType", + "tags": [], + "label": "allowNoIndex", + "description": [ + "\nprevents errors when index pattern exists before indices" + ], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewListItem", + "type": "Interface", + "tags": [], + "label": "DataViewListItem", + "description": [], + "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.DataViewListItem.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewListItem.title", + "type": "string", + "tags": [], + "label": "title", + "description": [], + "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewListItem.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewListItem.typeMeta", + "type": "Object", + "tags": [], + "label": "typeMeta", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.TypeMeta", + "text": "TypeMeta" + }, + " | undefined" + ], + "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewSpec", + "type": "Interface", + "tags": [], + "label": "DataViewSpec", + "description": [ + "\nStatic index pattern format\nSerialized data object, representing index pattern attributes and state" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.DataViewSpec.id", + "type": "string", + "tags": [], + "label": "id", + "description": [ + "\nsaved object id" + ], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewSpec.version", + "type": "string", + "tags": [], + "label": "version", + "description": [ + "\nsaved object version string" + ], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewSpec.title", + "type": "string", + "tags": [], + "label": "title", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewSpec.intervalName", + "type": "string", + "tags": [ + "deprecated" + ], + "label": "intervalName", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": true, + "references": [] + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewSpec.timeFieldName", + "type": "string", + "tags": [], + "label": "timeFieldName", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewSpec.sourceFilters", + "type": "Array", + "tags": [], + "label": "sourceFilters", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.SourceFilter", + "text": "SourceFilter" + }, + "[] | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewSpec.fields", + "type": "Object", + "tags": [], + "label": "fields", + "description": [], + "signature": [ + "Record | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewSpec.typeMeta", + "type": "Object", + "tags": [], + "label": "typeMeta", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.TypeMeta", + "text": "TypeMeta" + }, + " | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewSpec.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewSpec.fieldFormats", + "type": "Object", + "tags": [], + "label": "fieldFormats", + "description": [], + "signature": [ + "Record>> | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewSpec.runtimeFieldMap", + "type": "Object", + "tags": [], + "label": "runtimeFieldMap", + "description": [], + "signature": [ + "Record | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewSpec.fieldAttrs", + "type": "Object", + "tags": [], + "label": "fieldAttrs", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldAttrs", + "text": "FieldAttrs" + }, + " | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewSpec.allowNoIndex", + "type": "CompoundType", + "tags": [], + "label": "allowNoIndex", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldAttrs", + "type": "Interface", + "tags": [ + "intenal" + ], + "label": "FieldAttrs", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.FieldAttrs.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [], + "signature": [ + "any" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldAttrSet", + "type": "Interface", + "tags": [], + "label": "FieldAttrSet", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.FieldAttrSet.customLabel", + "type": "string", + "tags": [], + "label": "customLabel", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldAttrSet.count", + "type": "number", + "tags": [], + "label": "count", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpec", + "type": "Interface", + "tags": [], + "label": "FieldSpec", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + " extends ", + "DataViewFieldBase" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.FieldSpec.count", + "type": "number", + "tags": [], + "label": "count", + "description": [ + "\nPopularity count is used by discover" + ], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpec.conflictDescriptions", + "type": "Object", + "tags": [], + "label": "conflictDescriptions", + "description": [], + "signature": [ + "Record | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpec.format", + "type": "Object", + "tags": [], + "label": "format", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.SerializedFieldFormat", + "text": "SerializedFieldFormat" + }, + "> | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpec.esTypes", + "type": "Array", + "tags": [], + "label": "esTypes", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpec.searchable", + "type": "boolean", + "tags": [], + "label": "searchable", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpec.aggregatable", + "type": "boolean", + "tags": [], + "label": "aggregatable", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpec.readFromDocValues", + "type": "CompoundType", + "tags": [], + "label": "readFromDocValues", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpec.indexed", + "type": "CompoundType", + "tags": [], + "label": "indexed", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpec.customLabel", + "type": "string", + "tags": [], + "label": "customLabel", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpec.runtimeField", + "type": "Object", + "tags": [], + "label": "runtimeField", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.RuntimeField", + "text": "RuntimeField" + }, + " | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpec.shortDotsEnable", + "type": "CompoundType", + "tags": [], + "label": "shortDotsEnable", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpec.isMapped", + "type": "CompoundType", + "tags": [], + "label": "isMapped", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpecExportFmt", + "type": "Interface", + "tags": [], + "label": "FieldSpecExportFmt", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.FieldSpecExportFmt.count", + "type": "number", + "tags": [], + "label": "count", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpecExportFmt.script", + "type": "string", + "tags": [], + "label": "script", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpecExportFmt.lang", + "type": "CompoundType", + "tags": [], + "label": "lang", + "description": [], + "signature": [ + "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpecExportFmt.conflictDescriptions", + "type": "Object", + "tags": [], + "label": "conflictDescriptions", + "description": [], + "signature": [ + "Record | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpecExportFmt.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpecExportFmt.type", + "type": "Enum", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "KBN_FIELD_TYPES" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpecExportFmt.esTypes", + "type": "Array", + "tags": [], + "label": "esTypes", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpecExportFmt.scripted", + "type": "boolean", + "tags": [], + "label": "scripted", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpecExportFmt.searchable", + "type": "boolean", + "tags": [], + "label": "searchable", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpecExportFmt.aggregatable", + "type": "boolean", + "tags": [], + "label": "aggregatable", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpecExportFmt.readFromDocValues", + "type": "CompoundType", + "tags": [], + "label": "readFromDocValues", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpecExportFmt.subType", + "type": "Object", + "tags": [], + "label": "subType", + "description": [], + "signature": [ + "IFieldSubType", + " | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpecExportFmt.format", + "type": "Object", + "tags": [], + "label": "format", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.SerializedFieldFormat", + "text": "SerializedFieldFormat" + }, + "> | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpecExportFmt.indexed", + "type": "CompoundType", + "tags": [], + "label": "indexed", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.GetFieldsOptions", + "type": "Interface", + "tags": [], + "label": "GetFieldsOptions", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.GetFieldsOptions.pattern", + "type": "string", + "tags": [], + "label": "pattern", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.GetFieldsOptions.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.GetFieldsOptions.lookBack", + "type": "CompoundType", + "tags": [], + "label": "lookBack", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.GetFieldsOptions.metaFields", + "type": "Array", + "tags": [], + "label": "metaFields", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.GetFieldsOptions.rollupIndex", + "type": "string", + "tags": [], + "label": "rollupIndex", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.GetFieldsOptions.allowNoIndex", + "type": "CompoundType", + "tags": [], + "label": "allowNoIndex", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.GetFieldsOptionsTimePattern", + "type": "Interface", + "tags": [], + "label": "GetFieldsOptionsTimePattern", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.GetFieldsOptionsTimePattern.pattern", + "type": "string", + "tags": [], + "label": "pattern", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.GetFieldsOptionsTimePattern.metaFields", + "type": "Array", + "tags": [], + "label": "metaFields", + "description": [], + "signature": [ + "string[]" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.GetFieldsOptionsTimePattern.lookBack", + "type": "number", + "tags": [], + "label": "lookBack", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.GetFieldsOptionsTimePattern.interval", + "type": "string", + "tags": [], + "label": "interval", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.IDataViewsApiClient", + "type": "Interface", + "tags": [], + "label": "IDataViewsApiClient", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IDataViewsApiClient.getFieldsForTimePattern", + "type": "Function", + "tags": [], + "label": "getFieldsForTimePattern", + "description": [], + "signature": [ + "(options: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.GetFieldsOptionsTimePattern", + "text": "GetFieldsOptionsTimePattern" + }, + ") => Promise" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IDataViewsApiClient.getFieldsForTimePattern.$1", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.GetFieldsOptionsTimePattern", + "text": "GetFieldsOptionsTimePattern" + } + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.IDataViewsApiClient.getFieldsForWildcard", + "type": "Function", + "tags": [], + "label": "getFieldsForWildcard", + "description": [], + "signature": [ + "(options: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.GetFieldsOptions", + "text": "GetFieldsOptions" + }, + ") => Promise" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IDataViewsApiClient.getFieldsForWildcard.$1", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.GetFieldsOptions", + "text": "GetFieldsOptions" + } + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.IDataViewsApiClient.hasUserIndexPattern", + "type": "Function", + "tags": [], + "label": "hasUserIndexPattern", + "description": [], + "signature": [ + "() => Promise" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.IFieldType", + "type": "Interface", + "tags": [ + "deprecated" + ], + "label": "IFieldType", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + " extends ", + "DataViewFieldBase" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": true, + "removeBy": "8.1", + "references": [ + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_grid/common.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/common/group_by_expression/selector.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/common/group_by_expression/selector.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/common/group_by_expression/group_by_expression.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/common/group_by_expression/group_by_expression.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criteria.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criteria.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/group_by.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/group_by.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/metrics.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/metrics.tsx" + }, + { + "plugin": "fleet", + "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/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/field_types_utils.test.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/common/group_by_expression/group_by_expression.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/common/group_by_expression/group_by_expression.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/common/group_by_expression/selector.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/common/group_by_expression/selector.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/inventory/components/expression.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/inventory/components/expression.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/inventory/components/metric.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/inventory/components/metric.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_row.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_row.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/log_threshold/components/expression_editor/criteria.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/log_threshold/components/expression_editor/criteria.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/log_threshold/components/expression_editor/criterion.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/log_threshold/components/expression_editor/criterion.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/components/group_by.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/components/group_by.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/components/metrics.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/components/metrics.d.ts" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/single_field_select.d.ts" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/single_field_select.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_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/expressions/entity_index_expression.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_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/expressions/entity_index_expression.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_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/expressions/entity_by_expression.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_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/boundary_index_expression.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_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/boundary_index_expression.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_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/boundary_index_expression.tsx" + } + ], + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IFieldType.count", + "type": "number", + "tags": [], + "label": "count", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.IFieldType.esTypes", + "type": "Array", + "tags": [], + "label": "esTypes", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.IFieldType.aggregatable", + "type": "CompoundType", + "tags": [], + "label": "aggregatable", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.IFieldType.filterable", + "type": "CompoundType", + "tags": [], + "label": "filterable", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.IFieldType.searchable", + "type": "CompoundType", + "tags": [], + "label": "searchable", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.IFieldType.sortable", + "type": "CompoundType", + "tags": [], + "label": "sortable", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.IFieldType.visualizable", + "type": "CompoundType", + "tags": [], + "label": "visualizable", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.IFieldType.readFromDocValues", + "type": "CompoundType", + "tags": [], + "label": "readFromDocValues", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.IFieldType.displayName", + "type": "string", + "tags": [], + "label": "displayName", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.IFieldType.customLabel", + "type": "string", + "tags": [], + "label": "customLabel", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.IFieldType.format", + "type": "Any", + "tags": [], + "label": "format", + "description": [], + "signature": [ + "any" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.IFieldType.toSpec", + "type": "Function", + "tags": [], + "label": "toSpec", + "description": [], + "signature": [ + "((options?: { getFormatterForField?: ((field: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + }, + ") => ", + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.FieldFormat", + "text": "FieldFormat" + }, + ") | undefined; } | undefined) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + ") | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IFieldType.toSpec.$1", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IFieldType.toSpec.$1.getFormatterForField", + "type": "Function", + "tags": [], + "label": "getFormatterForField", + "description": [], + "signature": [ + "((field: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + }, + ") => ", + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.FieldFormat", + "text": "FieldFormat" + }, + ") | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/types.ts", + "deprecated": false + } + ] + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.IIndexPattern", + "type": "Interface", + "tags": [ + "deprecated" + ], + "label": "IIndexPattern", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IIndexPattern", + "text": "IIndexPattern" + }, + " extends ", + "DataViewBase" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": true, + "references": [ + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/helpers.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/helpers.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/container/source/index.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/container/source/index.tsx" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/container/source/index.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_recognizer/data_recognizer.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/components/data_recognizer/data_recognizer.d.ts" + }, + { + "plugin": "ml", + "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/services/new_job_capabilities/new_job_capabilities_service.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/utils/kuery.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/utils/kuery.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/with_source/with_source.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/with_source/with_source.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/toolbar.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/toolbar.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/url_state/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/url_state/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/url_state/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/query_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/columns.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/columns.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/columns.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/pages/details/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/pages/details/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/components/network_top_countries_table/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/details/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/hosts/pages/details/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/alerts_by_category/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/detections/components/rules/description_step/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/details/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/ueba/pages/details/types.ts" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/mock/index_pattern.ts" + }, + { + "plugin": "timelines", + "path": "x-pack/plugins/timelines/public/mock/index_pattern.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/common/search_strategy/index_fields/index.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/common/search_strategy/index_fields/index.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/containers/with_kuery_autocompletion.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/containers/with_kuery_autocompletion.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/containers/with_source/with_source.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/containers/with_source/with_source.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/index_pattern_context.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/common/index_pattern_context.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/containers/source/index.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/url_state/types.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/columns.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_chart.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/components/expression_chart.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/alerting/metric_threshold/hooks/use_metrics_explorer_chart_data.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/index.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/index.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/common/components/search_bar/index.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/hosts/pages/details/types.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/index.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/network/components/network_top_countries_table/index.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/network/pages/details/types.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/network/pages/details/types.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/ueba/pages/details/types.d.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/target/types/public/ueba/pages/details/types.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/jobs/new_job/common/index_pattern_context.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_clone/clone_action_name.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/use_delete_action.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_utils.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/index.tsx" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/pages/metrics/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/store/sourcerer/model.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/pages/navigation/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/pages/navigation/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/network/pages/navigation/types.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/common/mock/index_pattern.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/editor.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/editor.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_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/expressions/entity_index_expression.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_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/expressions/boundary_index_expression.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_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/boundary_index_expression.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/services/es_index_service.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/services/es_index_service.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/server/routes/api/transforms.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/server/routes/api/transforms.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/explorer/components/explorer_query_bar/explorer_query_bar.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/utils/new_job_utils.test.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/utils/new_job_utils.test.ts" + } + ], + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IIndexPattern.title", + "type": "string", + "tags": [], + "label": "title", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.IIndexPattern.fields", + "type": "Array", + "tags": [], + "label": "fields", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + "[]" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.IIndexPattern.type", + "type": "string", + "tags": [], + "label": "type", + "description": [ + "\nType is used for identifying rollup indices, otherwise left undefined" + ], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.IIndexPattern.timeFieldName", + "type": "string", + "tags": [], + "label": "timeFieldName", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.IIndexPattern.getTimeField", + "type": "Function", + "tags": [], + "label": "getTimeField", + "description": [], + "signature": [ + "(() => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + " | undefined) | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.IIndexPattern.fieldFormatMap", + "type": "Object", + "tags": [], + "label": "fieldFormatMap", + "description": [], + "signature": [ + "Record | undefined> | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.IIndexPattern.getFormatterForField", + "type": "Function", + "tags": [], + "label": "getFormatterForField", + "description": [ + "\nLook up a formatter for a given field" + ], + "signature": [ + "((field: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + }, + ") => ", + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.FieldFormat", + "text": "FieldFormat" + }, + ") | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IIndexPattern.getFormatterForField.$1", + "type": "CompoundType", + "tags": [], + "label": "field", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + } + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList", + "type": "Interface", + "tags": [], + "label": "IIndexPatternFieldList", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IIndexPatternFieldList", + "text": "IIndexPatternFieldList" + }, + " extends ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + }, + "[]" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList.add", + "type": "Function", + "tags": [], + "label": "add", + "description": [], + "signature": [ + "(field: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + ") => void" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList.add.$1", + "type": "Object", + "tags": [], + "label": "field", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + } + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList.getAll", + "type": "Function", + "tags": [], + "label": "getAll", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + }, + "[]" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList.getByName", + "type": "Function", + "tags": [], + "label": "getByName", + "description": [], + "signature": [ + "(name: string) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + }, + " | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList.getByName.$1", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList.getByType", + "type": "Function", + "tags": [], + "label": "getByType", + "description": [], + "signature": [ + "(type: string) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + }, + "[]" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList.getByType.$1", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList.remove", + "type": "Function", + "tags": [], + "label": "remove", + "description": [], + "signature": [ + "(field: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + ") => void" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList.remove.$1", + "type": "Object", + "tags": [], + "label": "field", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + } + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList.removeAll", + "type": "Function", + "tags": [], + "label": "removeAll", + "description": [], + "signature": [ + "() => void" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList.replaceAll", + "type": "Function", + "tags": [], + "label": "replaceAll", + "description": [], + "signature": [ + "(specs: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + "[]) => void" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList.replaceAll.$1", + "type": "Array", + "tags": [], + "label": "specs", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + "[]" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList.update", + "type": "Function", + "tags": [], + "label": "update", + "description": [], + "signature": [ + "(field: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + ") => void" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList.update.$1", + "type": "Object", + "tags": [], "label": "field", "description": [], "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - } + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + } + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList.toSpec", + "type": "Function", + "tags": [], + "label": "toSpec", + "description": [], + "signature": [ + "(options?: { getFormatterForField?: ((field: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + }, + ") => ", + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.FieldFormat", + "text": "FieldFormat" + }, + ") | undefined; } | undefined) => Record" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList.toSpec.$1", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternFieldList.toSpec.$1.getFormatterForField", + "type": "Function", + "tags": [], + "label": "getFormatterForField", + "description": [], + "signature": [ + "((field: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + }, + ") => ", + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.FieldFormat", + "text": "FieldFormat" + }, + ") | undefined" + ], + "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "deprecated": false + } + ] + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.IndexPatternExpressionType", + "type": "Interface", + "tags": [], + "label": "IndexPatternExpressionType", + "description": [], + "path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.IndexPatternExpressionType.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"index_pattern\"" + ], + "path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.IndexPatternExpressionType.value", + "type": "Object", + "tags": [], + "label": "value", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + } + ], + "path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.RuntimeField", + "type": "Interface", + "tags": [], + "label": "RuntimeField", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.RuntimeField.type", + "type": "CompoundType", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"boolean\" | \"date\" | \"keyword\" | \"geo_point\" | \"ip\" | \"long\" | \"double\"" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.RuntimeField.script", + "type": "Object", + "tags": [], + "label": "script", + "description": [], + "signature": [ + "{ source: string; } | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon", + "type": "Interface", + "tags": [], + "label": "SavedObjectsClientCommon", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon.find", + "type": "Function", + "tags": [], + "label": "find", + "description": [], + "signature": [ + "(options: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.SavedObjectsClientCommonFindArgs", + "text": "SavedObjectsClientCommonFindArgs" + }, + ") => Promise<", + "SavedObject", + "[]>" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon.find.$1", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.SavedObjectsClientCommonFindArgs", + "text": "SavedObjectsClientCommonFindArgs" + } + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon.get", + "type": "Function", + "tags": [], + "label": "get", + "description": [], + "signature": [ + "(type: string, id: string) => Promise<", + "SavedObject", + ">" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon.get.$1", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon.get.$2", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon.update", + "type": "Function", + "tags": [], + "label": "update", + "description": [], + "signature": [ + "(type: string, id: string, attributes: Record, options: Record) => Promise<", + "SavedObject", + ">" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon.update.$1", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon.update.$2", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon.update.$3", + "type": "Object", + "tags": [], + "label": "attributes", + "description": [], + "signature": [ + "Record" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon.update.$4", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "Record" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon.create", + "type": "Function", + "tags": [], + "label": "create", + "description": [], + "signature": [ + "(type: string, attributes: Record, options: Record) => Promise<", + "SavedObject", + ">" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon.create.$1", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon.create.$2", + "type": "Object", + "tags": [], + "label": "attributes", + "description": [], + "signature": [ + "Record" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon.create.$3", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "Record" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon.delete", + "type": "Function", + "tags": [], + "label": "delete", + "description": [], + "signature": [ + "(type: string, id: string) => Promise<{}>" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon.delete.$1", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommon.delete.$2", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommonFindArgs", + "type": "Interface", + "tags": [], + "label": "SavedObjectsClientCommonFindArgs", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommonFindArgs.type", + "type": "CompoundType", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "string | string[]" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommonFindArgs.fields", + "type": "Array", + "tags": [], + "label": "fields", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommonFindArgs.perPage", + "type": "number", + "tags": [], + "label": "perPage", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommonFindArgs.search", + "type": "string", + "tags": [], + "label": "search", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.SavedObjectsClientCommonFindArgs.searchFields", + "type": "Array", + "tags": [], + "label": "searchFields", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.SourceFilter", + "type": "Interface", + "tags": [], + "label": "SourceFilter", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.SourceFilter.value", + "type": "string", + "tags": [], + "label": "value", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.TypeMeta", + "type": "Interface", + "tags": [], + "label": "TypeMeta", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.TypeMeta.aggs", + "type": "Object", + "tags": [], + "label": "aggs", + "description": [], + "signature": [ + "Record> | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + }, + { + "parentPluginId": "data", + "id": "def-common.TypeMeta.params", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "{ rollup_index: string; } | undefined" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.UiSettingsCommon", + "type": "Interface", + "tags": [], + "label": "UiSettingsCommon", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.UiSettingsCommon.get", + "type": "Function", + "tags": [], + "label": "get", + "description": [], + "signature": [ + "(key: string) => Promise" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.UiSettingsCommon.get.$1", + "type": "string", + "tags": [], + "label": "key", + "description": [], + "signature": [ + "string" ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.UiSettingsCommon.getAll", + "type": "Function", + "tags": [], + "label": "getAll", + "description": [], + "signature": [ + "() => Promise>" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.UiSettingsCommon.set", + "type": "Function", + "tags": [], + "label": "set", + "description": [], + "signature": [ + "(key: string, value: any) => Promise" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.UiSettingsCommon.set.$1", + "type": "string", + "tags": [], + "label": "key", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "data", + "id": "def-common.UiSettingsCommon.set.$2", + "type": "Any", + "tags": [], + "label": "value", + "description": [], + "signature": [ + "any" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "data", + "id": "def-common.UiSettingsCommon.remove", + "type": "Function", + "tags": [], + "label": "remove", + "description": [], + "signature": [ + "(key: string) => Promise" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "data", + "id": "def-common.UiSettingsCommon.remove.$1", + "type": "string", + "tags": [], + "label": "key", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", "deprecated": false, "isRequired": true } ], "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "enums": [ + { + "parentPluginId": "data", + "id": "def-common.DataViewType", + "type": "Enum", + "tags": [], + "label": "DataViewType", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.IndexPatternType", + "type": "Enum", + "tags": [ + "deprecated" + ], + "label": "IndexPatternType", + "description": [], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": true, + "references": [], + "initialIsOpen": false + } + ], + "misc": [ + { + "parentPluginId": "data", + "id": "def-common.AggregationRestrictions", + "type": "Type", + "tags": [], + "label": "AggregationRestrictions", + "description": [], + "signature": [ + "{ [x: string]: { agg?: string | undefined; interval?: number | undefined; fixed_interval?: string | undefined; calendar_interval?: string | undefined; delay?: string | undefined; time_zone?: string | undefined; }; }" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewFieldMap", + "type": "Type", + "tags": [], + "label": "DataViewFieldMap", + "description": [], + "signature": [ + "{ [x: string]: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + "; }" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.DataViewsContract", + "type": "Type", + "tags": [], + "label": "DataViewsContract", + "description": [], + "signature": [ + "{ get: (id: string) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ">; delete: (indexPatternId: string) => Promise<{}>; create: (spec: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + }, + ", skipFetchFields?: boolean) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ">; find: (search: string, size?: number) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + "[]>; ensureDefaultIndexPattern: ", + "EnsureDefaultDataView", + "; getIds: (refresh?: boolean) => Promise; getTitles: (refresh?: boolean) => Promise; getIdsWithTitle: (refresh?: boolean) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewListItem", + "text": "DataViewListItem" + }, + "[]>; clearCache: (id?: string | undefined) => void; getCache: () => Promise<", + "SavedObject", + ">[] | null | undefined>; getDefault: () => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + " | null>; getDefaultId: () => Promise; setDefault: (id: string | null, force?: boolean) => Promise; hasUserIndexPattern: () => Promise; getFieldsForWildcard: (options: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.GetFieldsOptions", + "text": "GetFieldsOptions" + }, + ") => Promise; getFieldsForIndexPattern: (indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + }, + ", options?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.GetFieldsOptions", + "text": "GetFieldsOptions" + }, + " | undefined) => Promise; refreshFields: (indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ") => Promise; fieldArrayToMap: (fields: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + "[], fieldAttrs?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldAttrs", + "text": "FieldAttrs" + }, + " | undefined) => Record; savedObjectToSpec: (savedObject: ", + "SavedObject", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + }, + ">) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + }, + "; createAndSave: (spec: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + }, + ", override?: boolean, skipFetchFields?: boolean) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ">; createSavedObject: (indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ", override?: boolean) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ">; updateSavedObject: (indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ", saveAttempts?: number, ignoreErrors?: boolean) => Promise; }" + ], + "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldFormatMap", + "type": "Type", + "tags": [], + "label": "FieldFormatMap", + "description": [], + "signature": [ + "{ [x: string]: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.SerializedFieldFormat", + "text": "SerializedFieldFormat" + }, + ">; }" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.FieldSpecConflictDescriptions", + "type": "Type", + "tags": [], + "label": "FieldSpecConflictDescriptions", + "description": [], + "signature": [ + "{ [x: string]: string[]; }" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.IIndexPatternsApiClient", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "IIndexPatternsApiClient", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.IDataViewsApiClient", + "text": "IDataViewsApiClient" + } + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": true, + "references": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.IndexPatternAttributes", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "IndexPatternAttributes", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + } + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": true, + "references": [ + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/lib/es_service.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/lib/es_service.ts" + }, + { + "plugin": "canvas", + "path": "x-pack/plugins/canvas/public/lib/es_service.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts" + }, + { + "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/models/job_service/new_job_caps/rollup.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/models/data_recognizer/data_recognizer.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/types.ts" }, { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList.removeAll", - "type": "Function", - "tags": [], - "label": "removeAll", - "description": [], - "signature": [ - "() => void" - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/layout/types.ts" }, { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList.replaceAll", - "type": "Function", - "tags": [], - "label": "replaceAll", - "description": [], - "signature": [ - "(specs: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - "[]) => void" - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList.replaceAll.$1", - "type": "Array", - "tags": [], - "label": "specs", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - "[]" - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_app.tsx" }, { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList.update", - "type": "Function", - "tags": [], - "label": "update", - "description": [], - "signature": [ - "(field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") => void" - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList.update.$1", - "type": "Object", - "tags": [], - "label": "field", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_app.tsx" }, { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList.toSpec", - "type": "Function", - "tags": [], - "label": "toSpec", - "description": [], - "signature": [ - "(options?: { getFormatterForField?: ((field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") => ", - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormat", - "text": "FieldFormat" - }, - ") | undefined; } | undefined) => Record" - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList.toSpec.$1.options", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.IIndexPatternFieldList.toSpec.$1.options.getFormatterForField", - "type": "Function", - "tags": [], - "label": "getFormatterForField", - "description": [], - "signature": [ - "((field: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IFieldType", - "text": "IFieldType" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" - }, - " | ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" - }, - ") => ", - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormat", - "text": "FieldFormat" - }, - ") | undefined" - ], - "path": "src/plugins/data/common/index_patterns/fields/field_list.ts", - "deprecated": false - } - ] - } - ], - "returnComment": [] + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_route.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_route.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_route.tsx" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/common/types/kibana.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/common/types/kibana.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/common/types/kibana.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/common/types/kibana.d.ts" + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.IndexPatternFieldMap", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "IndexPatternFieldMap", + "description": [], + "signature": [ + "{ [x: string]: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + "; }" + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": true, + "references": [], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.IndexPatternListItem", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "IndexPatternListItem", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewListItem", + "text": "DataViewListItem" + } + ], + "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", + "deprecated": true, + "references": [ + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" } ], "initialIsOpen": false }, { "parentPluginId": "data", - "id": "def-common.IIndexPatternsApiClient", - "type": "Interface", + "id": "def-common.IndexPatternLoadExpressionFunctionDefinition", + "type": "Type", "tags": [], - "label": "IIndexPatternsApiClient", + "label": "IndexPatternLoadExpressionFunctionDefinition", "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", + "signature": [ + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionFunctionDefinition", + "text": "ExpressionFunctionDefinition" + }, + "<\"indexPatternLoad\", null, Arguments, Output, ", + { + "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", + ">>" + ], + "path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts", "deprecated": false, - "children": [ + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.IndexPatternsContract", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "IndexPatternsContract", + "description": [], + "signature": [ + "{ get: (id: string) => Promise<", { - "parentPluginId": "data", - "id": "def-common.IIndexPatternsApiClient.getFieldsForTimePattern", - "type": "Function", - "tags": [], - "label": "getFieldsForTimePattern", - "description": [], - "signature": [ - "(options: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptionsTimePattern", - "text": "GetFieldsOptionsTimePattern" - }, - ") => Promise" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.IIndexPatternsApiClient.getFieldsForTimePattern.$1", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptionsTimePattern", - "text": "GetFieldsOptionsTimePattern" - } - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ">; delete: (indexPatternId: string) => Promise<{}>; create: (spec: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + }, + ", skipFetchFields?: boolean) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ">; find: (search: string, size?: number) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + "[]>; ensureDefaultIndexPattern: ", + "EnsureDefaultDataView", + "; getIds: (refresh?: boolean) => Promise; getTitles: (refresh?: boolean) => Promise; getIdsWithTitle: (refresh?: boolean) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewListItem", + "text": "DataViewListItem" + }, + "[]>; clearCache: (id?: string | undefined) => void; getCache: () => Promise<", + "SavedObject", + ">[] | null | undefined>; getDefault: () => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + " | null>; getDefaultId: () => Promise; setDefault: (id: string | null, force?: boolean) => Promise; hasUserIndexPattern: () => Promise; getFieldsForWildcard: (options: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.GetFieldsOptions", + "text": "GetFieldsOptions" + }, + ") => Promise; getFieldsForIndexPattern: (indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + " | ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + }, + ", options?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.GetFieldsOptions", + "text": "GetFieldsOptions" + }, + " | undefined) => Promise; refreshFields: (indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ") => Promise; fieldArrayToMap: (fields: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + "[], fieldAttrs?: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.FieldAttrs", + "text": "FieldAttrs" + }, + " | undefined) => Record; savedObjectToSpec: (savedObject: ", + "SavedObject", + "<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewAttributes", + "text": "DataViewAttributes" + }, + ">) => ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + }, + "; createAndSave: (spec: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + }, + ", override?: boolean, skipFetchFields?: boolean) => Promise<", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" }, + ">; createSavedObject: (indexPattern: ", { - "parentPluginId": "data", - "id": "def-common.IIndexPatternsApiClient.getFieldsForWildcard", - "type": "Function", - "tags": [], - "label": "getFieldsForWildcard", - "description": [], - "signature": [ - "(options: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" - }, - ") => Promise" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.IIndexPatternsApiClient.getFieldsForWildcard.$1", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" - } - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" }, + ", override?: boolean) => Promise<", { - "parentPluginId": "data", - "id": "def-common.IIndexPatternsApiClient.hasUserIndexPattern", - "type": "Function", - "tags": [], - "label": "hasUserIndexPattern", - "description": [], - "signature": [ - "() => Promise" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.IndexPatternAttributes", - "type": "Interface", - "tags": [], - "label": "IndexPatternAttributes", - "description": [ - "\nInterface for an index pattern saved object" + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ">; updateSavedObject: (indexPattern: ", + { + "pluginId": "data", + "scope": "common", + "docId": "kibDataIndexPatternsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + }, + ", saveAttempts?: number, ignoreErrors?: boolean) => Promise; }" ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ + "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", + "deprecated": true, + "references": [ { - "parentPluginId": "data", - "id": "def-common.IndexPatternAttributes.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_index_pattern.tsx" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternAttributes.fields", - "type": "string", - "tags": [], - "label": "fields", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_index_pattern.tsx" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternAttributes.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternAttributes.typeMeta", - "type": "string", - "tags": [], - "label": "typeMeta", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternAttributes.timeFieldName", - "type": "string", - "tags": [], - "label": "timeFieldName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternAttributes.intervalName", - "type": "string", - "tags": [], - "label": "intervalName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternAttributes.sourceFilters", - "type": "string", - "tags": [], - "label": "sourceFilters", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/logs/log_source/log_source.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/public/containers/logs/log_source/log_source.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.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/hydrate_index_pattern.ts" + }, + { + "plugin": "savedObjects", + "path": "src/plugins/saved_objects/public/saved_object/helpers/hydrate_index_pattern.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/build_services.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/build_services.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/kibana_services.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_data_grid_columns.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/use_data_grid_columns.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/helpers/popularize_field.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/actions/columns.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/components/doc_table/actions/columns.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/doc/components/doc.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/doc/components/doc.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/anchor.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/anchor.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/context.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/types.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/types.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/test_helpers/make_default_services.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/public/application/test_helpers/make_default_services.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable.tsx" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/utils.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/utils.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.ts" + }, + { + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternAttributes.fieldFormatMap", - "type": "string", - "tags": [], - "label": "fieldFormatMap", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable_factory.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternAttributes.fieldAttrs", - "type": "string", - "tags": [], - "label": "fieldAttrs", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "lens", + "path": "x-pack/plugins/lens/public/embeddable/embeddable_factory.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternAttributes.runtimeFieldMap", - "type": "string", - "tags": [], - "label": "runtimeFieldMap", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/dependency_cache.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternAttributes.allowNoIndex", - "type": "CompoundType", - "tags": [], - "label": "allowNoIndex", - "description": [ - "\nprevents errors when index pattern exists before indices" - ], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.IndexPatternExpressionType", - "type": "Interface", - "tags": [], - "label": "IndexPatternExpressionType", - "description": [], - "path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts", - "deprecated": false, - "children": [ + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/dependency_cache.ts" + }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternExpressionType.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "\"index_pattern\"" - ], - "path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts", - "deprecated": false + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternExpressionType.value", - "type": "Object", - "tags": [], - "label": "value", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" - } - ], - "path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.IndexPatternListItem", - "type": "Interface", - "tags": [], - "label": "IndexPatternListItem", - "description": [], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, - "children": [ + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" + }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternListItem.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/util/index_utils.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternListItem.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/routing/resolvers.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternListItem.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/routing/resolvers.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternListItem.typeMeta", - "type": "Object", - "tags": [], - "label": "typeMeta", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.TypeMeta", - "text": "TypeMeta" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.IndexPatternSpec", - "type": "Interface", - "tags": [], - "label": "IndexPatternSpec", - "description": [ - "\nStatic index pattern format\nSerialized data object, representing index pattern attributes and state" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" + }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternSpec.id", - "type": "string", - "tags": [], - "label": "id", - "description": [ - "\nsaved object id" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternSpec.version", - "type": "string", - "tags": [], - "label": "version", - "description": [ - "\nsaved object version string" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternSpec.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternSpec.intervalName", - "type": "string", - "tags": [ - "deprecated" - ], - "label": "intervalName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": true, - "references": [] + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/routing/router.tsx" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternSpec.timeFieldName", - "type": "string", - "tags": [], - "label": "timeFieldName", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/routing/router.tsx" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternSpec.sourceFilters", - "type": "Array", - "tags": [], - "label": "sourceFilters", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.SourceFilter", - "text": "SourceFilter" - }, - "[] | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/ml_context.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/ml_context.ts" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/application.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternSpec.fields", - "type": "Object", - "tags": [], - "label": "fields", - "description": [], - "signature": [ - "Record | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "graph", + "path": "x-pack/plugins/graph/public/application.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternSpec.typeMeta", - "type": "Object", - "tags": [], - "label": "typeMeta", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.TypeMeta", - "text": "TypeMeta" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternSpec.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternSpec.fieldFormats", - "type": "Object", - "tags": [], - "label": "fieldFormats", - "description": [], - "signature": [ - "Record>> | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternSpec.runtimeFieldMap", - "type": "Object", - "tags": [], - "label": "runtimeFieldMap", - "description": [], - "signature": [ - "Record | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternSpec.fieldAttrs", - "type": "Object", - "tags": [], - "label": "fieldAttrs", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldAttrs", - "text": "FieldAttrs" - }, - " | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "transform", + "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" }, { - "parentPluginId": "data", - "id": "def-common.IndexPatternSpec.allowNoIndex", - "type": "CompoundType", - "tags": [], - "label": "allowNoIndex", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.RuntimeField", - "type": "Interface", - "tags": [], - "label": "RuntimeField", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts" + }, { - "parentPluginId": "data", - "id": "def-common.RuntimeField.type", - "type": "CompoundType", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "\"boolean\" | \"date\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"geo_point\"" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts" }, { - "parentPluginId": "data", - "id": "def-common.RuntimeField.script", - "type": "Object", - "tags": [], - "label": "script", - "description": [], - "signature": [ - "{ source: string; } | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon", - "type": "Interface", - "tags": [], - "label": "SavedObjectsClientCommon", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts" + }, { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon.find", - "type": "Function", - "tags": [], - "label": "find", - "description": [], - "signature": [ - "(options: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.SavedObjectsClientCommonFindArgs", - "text": "SavedObjectsClientCommonFindArgs" - }, - ") => Promise<", - "SavedObject", - "[]>" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon.find.$1", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.SavedObjectsClientCommonFindArgs", - "text": "SavedObjectsClientCommonFindArgs" - } - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts" }, { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon.get", - "type": "Function", - "tags": [], - "label": "get", - "description": [], - "signature": [ - "(type: string, id: string) => Promise<", - "SavedObject", - ">" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon.get.$1", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon.get.$2", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "lens", + "path": "x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts" }, { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon.update", - "type": "Function", - "tags": [], - "label": "update", - "description": [], - "signature": [ - "(type: string, id: string, attributes: Record, options: Record) => Promise<", - "SavedObject", - ">" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon.update.$1", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon.update.$2", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon.update.$3", - "type": "Object", - "tags": [], - "label": "attributes", - "description": [], - "signature": [ - "Record" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon.update.$4", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - "Record" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/utils.d.ts" }, { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon.create", - "type": "Function", - "tags": [], - "label": "create", - "description": [], - "signature": [ - "(type: string, attributes: Record, options: Record) => Promise<", - "SavedObject", - ">" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon.create.$1", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon.create.$2", - "type": "Object", - "tags": [], - "label": "attributes", - "description": [], - "signature": [ - "Record" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon.create.$3", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - "Record" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "lens", + "path": "x-pack/plugins/lens/target/types/public/utils.d.ts" }, { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon.delete", - "type": "Function", - "tags": [], - "label": "delete", - "description": [], - "signature": [ - "(type: string, id: string) => Promise<{}>" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon.delete.$1", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommon.delete.$2", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommonFindArgs", - "type": "Interface", - "tags": [], - "label": "SavedObjectsClientCommonFindArgs", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/__mocks__/index_patterns.ts" + }, { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommonFindArgs.type", - "type": "CompoundType", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string | string[]" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "ml", + "path": "x-pack/plugins/ml/public/application/contexts/ml/__mocks__/index_patterns.ts" }, { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommonFindArgs.fields", - "type": "Array", - "tags": [], - "label": "fields", - "description": [], - "signature": [ - "string[] | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/routing/router.d.ts" }, { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommonFindArgs.perPage", - "type": "number", - "tags": [], - "label": "perPage", - "description": [], - "signature": [ - "number | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/routing/router.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/util/dependency_cache.d.ts" + }, + { + "plugin": "ml", + "path": "x-pack/plugins/ml/target/types/public/application/util/dependency_cache.d.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/target/types/public/management/roles/edit_role/edit_role_page.d.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/target/types/public/management/roles/edit_role/edit_role_page.d.ts" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts" + }, + { + "plugin": "stackAlerts", + "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts" + }, + { + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.ts" }, { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommonFindArgs.search", - "type": "string", - "tags": [], - "label": "search", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.ts" }, { - "parentPluginId": "data", - "id": "def-common.SavedObjectsClientCommonFindArgs.searchFields", - "type": "Array", - "tags": [], - "label": "searchFields", - "description": [], - "signature": [ - "string[] | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.SourceFilter", - "type": "Interface", - "tags": [], - "label": "SourceFilter", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx" + }, { - "parentPluginId": "data", - "id": "def-common.SourceFilter.value", - "type": "string", - "tags": [], - "label": "value", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.TypeMeta", - "type": "Interface", - "tags": [], - "label": "TypeMeta", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx" + }, { - "parentPluginId": "data", - "id": "def-common.TypeMeta.aggs", - "type": "Object", - "tags": [], - "label": "aggs", - "description": [], - "signature": [ - "Record> | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx" }, { - "parentPluginId": "data", - "id": "def-common.TypeMeta.params", - "type": "Object", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "{ rollup_index: string; } | undefined" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.UiSettingsCommon", - "type": "Interface", - "tags": [], - "label": "UiSettingsCommon", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ + "plugin": "savedObjectsManagement", + "path": "src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx" + }, { - "parentPluginId": "data", - "id": "def-common.UiSettingsCommon.get", - "type": "Function", - "tags": [], - "label": "get", - "description": [], - "signature": [ - "(key: string) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.UiSettingsCommon.get.$1", - "type": "string", - "tags": [], - "label": "key", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/helpers/plugin_services.ts" }, { - "parentPluginId": "data", - "id": "def-common.UiSettingsCommon.getAll", - "type": "Function", - "tags": [], - "label": "getAll", - "description": [], - "signature": [ - "() => Promise>" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/helpers/plugin_services.ts" }, { - "parentPluginId": "data", - "id": "def-common.UiSettingsCommon.set", - "type": "Function", - "tags": [], - "label": "set", - "description": [], - "signature": [ - "(key: string, value: any) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.UiSettingsCommon.set.$1", - "type": "string", - "tags": [], - "label": "key", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "data", - "id": "def-common.UiSettingsCommon.set.$2", - "type": "Any", - "tags": [], - "label": "value", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.test.ts" }, { - "parentPluginId": "data", - "id": "def-common.UiSettingsCommon.remove", - "type": "Function", - "tags": [], - "label": "remove", - "description": [], - "signature": [ - "(key: string) => Promise" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.UiSettingsCommon.remove.$1", - "type": "string", - "tags": [], - "label": "key", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - } - ], - "enums": [ - { - "parentPluginId": "data", - "id": "def-common.IndexPatternType", - "type": "Enum", - "tags": [], - "label": "IndexPatternType", - "description": [], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "initialIsOpen": false - } - ], - "misc": [ - { - "parentPluginId": "data", - "id": "def-common.AggregationRestrictions", - "type": "Type", - "tags": [], - "label": "AggregationRestrictions", - "description": [], - "signature": [ - "{ [x: string]: { agg?: string | undefined; interval?: number | undefined; fixed_interval?: string | undefined; calendar_interval?: string | undefined; delay?: string | undefined; time_zone?: string | undefined; }; }" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.FieldFormatMap", - "type": "Type", - "tags": [], - "label": "FieldFormatMap", - "description": [], - "signature": [ - "{ [x: string]: ", + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/public/components/utils.test.ts" + }, + { + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/components/timelion_expression_input_helpers.test.ts" + }, { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.SerializedFieldFormat", - "text": "SerializedFieldFormat" + "plugin": "visTypeTimelion", + "path": "src/plugins/vis_types/timelion/public/components/timelion_expression_input_helpers.test.ts" }, - ">; }" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.FieldSpecConflictDescriptions", - "type": "Type", - "tags": [], - "label": "FieldSpecConflictDescriptions", - "description": [], - "signature": [ - "{ [x: string]: string[]; }" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.IndexPatternFieldMap", - "type": "Type", - "tags": [], - "label": "IndexPatternFieldMap", - "description": [], - "signature": [ - "{ [x: string]: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/build_services.d.ts" }, - "; }" - ], - "path": "src/plugins/data/common/index_patterns/types.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.IndexPatternLoadExpressionFunctionDefinition", - "type": "Type", - "tags": [], - "label": "IndexPatternLoadExpressionFunctionDefinition", - "description": [], - "signature": [ { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExpressionFunctionDefinition", - "text": "ExpressionFunctionDefinition" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/build_services.d.ts" }, - "<\"indexPatternLoad\", null, Arguments, Output, ", { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.ExecutionContext", - "text": "ExecutionContext" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts" }, - "<", { - "pluginId": "inspector", - "scope": "common", - "docId": "kibInspectorPluginApi", - "section": "def-common.Adapters", - "text": "Adapters" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts" }, - ", ", - "SerializableRecord", - ">>" - ], - "path": "src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "data", - "id": "def-common.IndexPatternsContract", - "type": "Type", - "tags": [], - "label": "IndexPatternsContract", - "description": [], - "signature": [ - "{ get: (id: string) => Promise<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts" }, - ">; delete: (indexPatternId: string) => Promise<{}>; create: (spec: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts" }, - ", skipFetchFields?: boolean) => Promise<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts" }, - ">; find: (search: string, size?: number) => Promise<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts" }, - "[]>; ensureDefaultIndexPattern: ", - "EnsureDefaultIndexPattern", - "; getIds: (refresh?: boolean) => Promise; getTitles: (refresh?: boolean) => Promise; getIdsWithTitle: (refresh?: boolean) => Promise<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternListItem", - "text": "IndexPatternListItem" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.ts" }, - "[]>; clearCache: (id?: string | undefined) => void; getCache: () => Promise<", - "SavedObject", - ">[] | null | undefined>; getDefault: () => Promise<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.ts" }, - " | null>; getDefaultId: () => Promise; setDefault: (id: string | null, force?: boolean) => Promise; hasUserIndexPattern: () => Promise; getFieldsForWildcard: (options: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" + "plugin": "inputControlVis", + "path": "src/plugins/input_control_vis/public/control/filter_manager/range_filter_manager.test.ts" }, - ") => Promise; getFieldsForIndexPattern: (indexPattern: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" }, - " | ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "plugin": "indexPatternManagement", + "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" }, - ", options?: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.GetFieldsOptions", - "text": "GetFieldsOptions" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/_stubs.ts" }, - " | undefined) => Promise; refreshFields: (indexPattern: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/context/services/_stubs.ts" }, - ") => Promise; fieldArrayToMap: (fields: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldSpec", - "text": "FieldSpec" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/doc/components/doc.d.ts" }, - "[], fieldAttrs?: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.FieldAttrs", - "text": "FieldAttrs" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/doc/components/doc.d.ts" }, - " | undefined) => Record; savedObjectToSpec: (savedObject: ", - "SavedObject", - "<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternAttributes", - "text": "IndexPatternAttributes" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/apps/context/services/context.d.ts" }, - ">) => ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/lazy_load_bundle/index.ts" }, - "; createAndSave: (spec: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternSpec", - "text": "IndexPatternSpec" + "plugin": "maps", + "path": "x-pack/plugins/maps/public/lazy_load_bundle/index.ts" }, - ", override?: boolean, skipFetchFields?: boolean) => Promise<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts" }, - ">; createSavedObject: (indexPattern: ", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "maps", + "path": "x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts" }, - ", override?: boolean) => Promise<", { - "pluginId": "data", - "scope": "common", - "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx" }, - ">; updateSavedObject: (indexPattern: ", + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx" + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "data", + "id": "def-common.IndexPatternSpec", + "type": "Type", + "tags": [ + "deprecated" + ], + "label": "IndexPatternSpec", + "description": [], + "signature": [ { "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataViewSpec", + "text": "DataViewSpec" + } + ], + "path": "src/plugins/data/common/index_patterns/types.ts", + "deprecated": true, + "references": [ + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" }, - ", saveAttempts?: number, ignoreErrors?: boolean) => Promise; }" + { + "plugin": "observability", + "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx" + }, + { + "plugin": "indexPatternEditor", + "path": "src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts" + }, + { + "plugin": "apm", + "path": "x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts" + } ], - "path": "src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts", - "deprecated": false, "initialIsOpen": false }, { @@ -8508,7 +13487,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.error", + "id": "def-common.OnError.$1", "type": "Object", "tags": [], "label": "error", @@ -8521,7 +13500,7 @@ }, { "parentPluginId": "data", - "id": "def-common.toastInputFields", + "id": "def-common.OnError.$2", "type": "Object", "tags": [], "label": "toastInputFields", @@ -8565,7 +13544,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.toastInputFields", + "id": "def-common.OnNotification.$1", "type": "CompoundType", "tags": [], "label": "toastInputFields", @@ -8605,7 +13584,7 @@ "label": "RuntimeType", "description": [], "signature": [ - "\"boolean\" | \"date\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"geo_point\"" + "\"boolean\" | \"date\" | \"keyword\" | \"geo_point\" | \"ip\" | \"long\" | \"double\"" ], "path": "src/plugins/data/common/index_patterns/types.ts", "deprecated": false, diff --git a/api_docs/data_index_patterns.mdx b/api_docs/data_index_patterns.mdx index 4c7a9976fa0f0..d678cf0ae99ce 100644 --- a/api_docs/data_index_patterns.mdx +++ b/api_docs/data_index_patterns.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3498 | 44 | 2981 | 50 | +| 3099 | 44 | 2738 | 50 | ## Server diff --git a/api_docs/data_query.json b/api_docs/data_query.json index 4c7f2d3be9d82..8bd12377c8947 100644 --- a/api_docs/data_query.json +++ b/api_docs/data_query.json @@ -491,7 +491,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-public.filters", + "id": "def-public.FilterManager.telemetry.$1", "type": "Object", "tags": [], "label": "filters", @@ -504,7 +504,7 @@ }, { "parentPluginId": "data", - "id": "def-public.collector", + "id": "def-public.FilterManager.telemetry.$2", "type": "Unknown", "tags": [], "label": "collector", @@ -915,7 +915,7 @@ }, { "parentPluginId": "data", - "id": "def-public.connectToQueryState.$3.syncConfig", + "id": "def-public.connectToQueryState.$3", "type": "Object", "tags": [], "label": "syncConfig", @@ -925,7 +925,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-public.connectToQueryState.$3.syncConfig.time", + "id": "def-public.connectToQueryState.$3.time", "type": "CompoundType", "tags": [], "label": "time", @@ -938,7 +938,7 @@ }, { "parentPluginId": "data", - "id": "def-public.connectToQueryState.$3.syncConfig.refreshInterval", + "id": "def-public.connectToQueryState.$3.refreshInterval", "type": "CompoundType", "tags": [], "label": "refreshInterval", @@ -951,7 +951,7 @@ }, { "parentPluginId": "data", - "id": "def-public.connectToQueryState.$3.syncConfig.filters", + "id": "def-public.connectToQueryState.$3.filters", "type": "CompoundType", "tags": [], "label": "filters", @@ -966,7 +966,7 @@ }, { "parentPluginId": "data", - "id": "def-public.connectToQueryState.$3.syncConfig.query", + "id": "def-public.connectToQueryState.$3.query", "type": "CompoundType", "tags": [], "label": "query", @@ -1782,7 +1782,7 @@ }, { "parentPluginId": "data", - "id": "def-public.SavedQueryService.saveQuery.$2.config", + "id": "def-public.SavedQueryService.saveQuery.$2", "type": "Object", "tags": [], "label": "config", @@ -1792,7 +1792,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-public.SavedQueryService.saveQuery.$2.config.overwrite", + "id": "def-public.SavedQueryService.saveQuery.$2.overwrite", "type": "boolean", "tags": [], "label": "overwrite", @@ -2396,7 +2396,7 @@ }, { "parentPluginId": "data", - "id": "def-common.getAbsoluteTimeRange.$2.forceNow", + "id": "def-common.getAbsoluteTimeRange.$2", "type": "Object", "tags": [], "label": "{ forceNow }", @@ -2406,7 +2406,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.getAbsoluteTimeRange.$2.forceNow.forceNow", + "id": "def-common.getAbsoluteTimeRange.$2.forceNow", "type": "Object", "tags": [], "label": "forceNow", @@ -2501,7 +2501,7 @@ }, { "parentPluginId": "data", - "id": "def-common.getTime.$3.options", + "id": "def-common.getTime.$3", "type": "Object", "tags": [], "label": "options", @@ -2511,7 +2511,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.getTime.$3.options.forceNow", + "id": "def-common.getTime.$3.forceNow", "type": "Object", "tags": [], "label": "forceNow", @@ -2524,7 +2524,7 @@ }, { "parentPluginId": "data", - "id": "def-common.getTime.$3.options.fieldName", + "id": "def-common.getTime.$3.fieldName", "type": "string", "tags": [], "label": "fieldName", @@ -2613,39 +2613,6 @@ } ], "interfaces": [ - { - "parentPluginId": "data", - "id": "def-common.RefreshInterval", - "type": "Interface", - "tags": [], - "label": "RefreshInterval", - "description": [], - "path": "src/plugins/data/common/query/timefilter/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "data", - "id": "def-common.RefreshInterval.pause", - "type": "boolean", - "tags": [], - "label": "pause", - "description": [], - "path": "src/plugins/data/common/query/timefilter/types.ts", - "deprecated": false - }, - { - "parentPluginId": "data", - "id": "def-common.RefreshInterval.value", - "type": "number", - "tags": [], - "label": "value", - "description": [], - "path": "src/plugins/data/common/query/timefilter/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, { "parentPluginId": "data", "id": "def-common.TimeRangeBounds", @@ -2688,6 +2655,20 @@ ], "enums": [], "misc": [ + { + "parentPluginId": "data", + "id": "def-common.RefreshInterval", + "type": "Type", + "tags": [], + "label": "RefreshInterval", + "description": [], + "signature": [ + "{ pause: boolean; value: number; }" + ], + "path": "src/plugins/data/common/query/timefilter/types.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "data", "id": "def-common.TimeRange", diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index 088de0ad9120c..8a3119feac0e2 100644 --- a/api_docs/data_query.mdx +++ b/api_docs/data_query.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3498 | 44 | 2981 | 50 | +| 3099 | 44 | 2738 | 50 | ## Client diff --git a/api_docs/data_search.json b/api_docs/data_search.json index 654649f105d92..a16dd60a6da7f 100644 --- a/api_docs/data_search.json +++ b/api_docs/data_search.json @@ -464,7 +464,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-public.request", + "id": "def-public.ISearchStart.search.$1", "type": "Uncategorized", "tags": [], "label": "request", @@ -477,7 +477,7 @@ }, { "parentPluginId": "data", - "id": "def-public.options", + "id": "def-public.ISearchStart.search.$2", "type": "Object", "tags": [], "label": "options", @@ -1250,7 +1250,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.sessionId", + "id": "def-server.IScopedSearchClient.saveSession.$1", "type": "string", "tags": [], "label": "sessionId", @@ -1260,7 +1260,7 @@ }, { "parentPluginId": "data", - "id": "def-server.attributes", + "id": "def-server.IScopedSearchClient.saveSession.$2", "type": "Object", "tags": [], "label": "attributes", @@ -1291,7 +1291,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.sessionId", + "id": "def-server.IScopedSearchClient.getSession.$1", "type": "string", "tags": [], "label": "sessionId", @@ -1333,7 +1333,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.options", + "id": "def-server.IScopedSearchClient.findSessions.$1", "type": "Object", "tags": [], "label": "options", @@ -1396,7 +1396,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.sessionId", + "id": "def-server.IScopedSearchClient.updateSession.$1", "type": "string", "tags": [], "label": "sessionId", @@ -1406,7 +1406,7 @@ }, { "parentPluginId": "data", - "id": "def-server.attributes", + "id": "def-server.IScopedSearchClient.updateSession.$2", "type": "Object", "tags": [], "label": "attributes", @@ -1435,7 +1435,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.sessionId", + "id": "def-server.IScopedSearchClient.cancelSession.$1", "type": "string", "tags": [], "label": "sessionId", @@ -1461,7 +1461,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.sessionId", + "id": "def-server.IScopedSearchClient.deleteSession.$1", "type": "string", "tags": [], "label": "sessionId", @@ -1495,7 +1495,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-server.sessionId", + "id": "def-server.IScopedSearchClient.extendSession.$1", "type": "string", "tags": [], "label": "sessionId", @@ -1505,7 +1505,7 @@ }, { "parentPluginId": "data", - "id": "def-server.expires", + "id": "def-server.IScopedSearchClient.extendSession.$2", "type": "Object", "tags": [], "label": "expires", @@ -4621,7 +4621,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.agg", + "id": "def-common.AggParamType.makeAgg.$1", "type": "Uncategorized", "tags": [], "label": "agg", @@ -4634,7 +4634,7 @@ }, { "parentPluginId": "data", - "id": "def-common.state", + "id": "def-common.AggParamType.makeAgg.$2", "type": "Object", "tags": [], "label": "state", @@ -4889,7 +4889,7 @@ "\nThe type the values produced by this agg will have in the final data table.\nIf not specified, the type of the field is used." ], "signature": [ - "\"string\" | \"number\" | \"boolean\" | \"object\" | \"date\" | \"ip\" | \"geo_point\" | \"_source\" | \"attachment\" | \"geo_shape\" | \"murmur3\" | \"unknown\" | \"conflict\" | \"nested\" | \"histogram\" | \"null\" | undefined" + "\"string\" | \"number\" | \"boolean\" | \"object\" | \"date\" | \"_source\" | \"attachment\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"murmur3\" | \"unknown\" | \"conflict\" | \"nested\" | \"histogram\" | \"null\" | undefined" ], "path": "src/plugins/data/common/search/aggs/agg_type.ts", "deprecated": false @@ -4916,7 +4916,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.aggConfig", + "id": "def-common.AggType.makeLabel.$1", "type": "Uncategorized", "tags": [], "label": "aggConfig", @@ -5032,7 +5032,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.aggConfig", + "id": "def-common.AggType.getRequestAggs.$1", "type": "Uncategorized", "tags": [], "label": "aggConfig", @@ -5067,7 +5067,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.aggConfig", + "id": "def-common.AggType.getResponseAggs.$1", "type": "Uncategorized", "tags": [], "label": "aggConfig", @@ -5145,7 +5145,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.resp", + "id": "def-common.AggType.postFlightRequest.$1", "type": "Object", "tags": [], "label": "resp", @@ -5161,7 +5161,7 @@ }, { "parentPluginId": "data", - "id": "def-common.aggConfigs", + "id": "def-common.AggType.postFlightRequest.$2", "type": "Object", "tags": [], "label": "aggConfigs", @@ -5182,7 +5182,7 @@ }, { "parentPluginId": "data", - "id": "def-common.aggConfig", + "id": "def-common.AggType.postFlightRequest.$3", "type": "Uncategorized", "tags": [], "label": "aggConfig", @@ -5197,7 +5197,7 @@ }, { "parentPluginId": "data", - "id": "def-common.searchSource", + "id": "def-common.AggType.postFlightRequest.$4", "type": "Object", "tags": [], "label": "searchSource", @@ -5386,7 +5386,7 @@ }, { "parentPluginId": "data", - "id": "def-common.inspectorRequestAdapter", + "id": "def-common.AggType.postFlightRequest.$5", "type": "Object", "tags": [], "label": "inspectorRequestAdapter", @@ -5406,7 +5406,7 @@ }, { "parentPluginId": "data", - "id": "def-common.abortSignal", + "id": "def-common.AggType.postFlightRequest.$6", "type": "Object", "tags": [], "label": "abortSignal", @@ -5421,7 +5421,7 @@ }, { "parentPluginId": "data", - "id": "def-common.searchSessionId", + "id": "def-common.AggType.postFlightRequest.$7", "type": "string", "tags": [], "label": "searchSessionId", @@ -5464,7 +5464,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.agg", + "id": "def-common.AggType.getSerializedFormat.$1", "type": "Uncategorized", "tags": [], "label": "agg", @@ -5495,7 +5495,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.agg", + "id": "def-common.AggType.getValue.$1", "type": "Uncategorized", "tags": [], "label": "agg", @@ -5508,7 +5508,7 @@ }, { "parentPluginId": "data", - "id": "def-common.bucket", + "id": "def-common.AggType.getValue.$2", "type": "Any", "tags": [], "label": "bucket", @@ -5877,7 +5877,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.aggConfig", + "id": "def-common.BaseParamType.write.$1", "type": "Uncategorized", "tags": [], "label": "aggConfig", @@ -5890,7 +5890,7 @@ }, { "parentPluginId": "data", - "id": "def-common.output", + "id": "def-common.BaseParamType.write.$2", "type": "Object", "tags": [], "label": "output", @@ -5903,7 +5903,7 @@ }, { "parentPluginId": "data", - "id": "def-common.aggConfigs", + "id": "def-common.BaseParamType.write.$3", "type": "Object", "tags": [], "label": "aggConfigs", @@ -5923,7 +5923,7 @@ }, { "parentPluginId": "data", - "id": "def-common.locals", + "id": "def-common.BaseParamType.write.$4", "type": "Object", "tags": [], "label": "locals", @@ -5952,7 +5952,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.value", + "id": "def-common.BaseParamType.serialize.$1", "type": "Any", "tags": [], "label": "value", @@ -5965,7 +5965,7 @@ }, { "parentPluginId": "data", - "id": "def-common.aggConfig", + "id": "def-common.BaseParamType.serialize.$2", "type": "Uncategorized", "tags": [], "label": "aggConfig", @@ -5994,7 +5994,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.value", + "id": "def-common.BaseParamType.deserialize.$1", "type": "Any", "tags": [], "label": "value", @@ -6007,7 +6007,7 @@ }, { "parentPluginId": "data", - "id": "def-common.aggConfig", + "id": "def-common.BaseParamType.deserialize.$2", "type": "Uncategorized", "tags": [], "label": "aggConfig", @@ -6109,7 +6109,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.aggConfig", + "id": "def-common.BaseParamType.modifyAggConfigOnSearchRequestStart.$1", "type": "Uncategorized", "tags": [], "label": "aggConfig", @@ -6122,7 +6122,7 @@ }, { "parentPluginId": "data", - "id": "def-common.searchSource", + "id": "def-common.BaseParamType.modifyAggConfigOnSearchRequestStart.$2", "type": "Object", "tags": [], "label": "searchSource", @@ -6143,7 +6143,7 @@ }, { "parentPluginId": "data", - "id": "def-common.options", + "id": "def-common.BaseParamType.modifyAggConfigOnSearchRequestStart.$3", "type": "Object", "tags": [], "label": "options", @@ -6248,7 +6248,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.bucket", + "id": "def-common.BucketAggType.getKey.$1", "type": "Any", "tags": [], "label": "bucket", @@ -6261,7 +6261,7 @@ }, { "parentPluginId": "data", - "id": "def-common.key", + "id": "def-common.BucketAggType.getKey.$2", "type": "Any", "tags": [], "label": "key", @@ -6274,7 +6274,7 @@ }, { "parentPluginId": "data", - "id": "def-common.agg", + "id": "def-common.BucketAggType.getKey.$3", "type": "Uncategorized", "tags": [], "label": "agg", @@ -6641,9 +6641,8 @@ "label": "filterFieldTypes", "description": [], "signature": [ - "\"*\" | ", "KBN_FIELD_TYPES", - " | ", + " | \"*\" | ", "KBN_FIELD_TYPES", "[]" ], @@ -6713,8 +6712,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" + "section": "def-common.DataViewField", + "text": "DataViewField" }, "[]" ], @@ -6949,21 +6948,6 @@ "deprecated": false, "children": [], "returnComment": [] - }, - { - "parentPluginId": "data", - "id": "def-common.IpAddress.valueOf", - "type": "Function", - "tags": [], - "label": "valueOf", - "description": [], - "signature": [ - "() => number | bigint" - ], - "path": "src/plugins/data/common/search/aggs/utils/ip_address.ts", - "deprecated": false, - "children": [], - "returnComment": [] } ], "initialIsOpen": false @@ -8046,11 +8030,11 @@ "references": [ { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context/api/utils/fetch_hits_in_interval.ts" + "path": "src/plugins/discover/public/application/apps/context/services/anchor.ts" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/angular/context/api/anchor.ts" + "path": "src/plugins/discover/public/application/apps/context/services/utils/fetch_hits_in_interval.ts" }, { "plugin": "maps", @@ -8298,8 +8282,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternsService", - "text": "IndexPatternsService" + "section": "def-common.DataViewsService", + "text": "DataViewsService" }, ", \"get\" | \"delete\" | \"create\" | \"find\" | \"ensureDefaultIndexPattern\" | \"getIds\" | \"getTitles\" | \"getIdsWithTitle\" | \"clearCache\" | \"getCache\" | \"getDefault\" | \"getDefaultId\" | \"setDefault\" | \"hasUserIndexPattern\" | \"getFieldsForWildcard\" | \"getFieldsForIndexPattern\" | \"refreshFields\" | \"fieldArrayToMap\" | \"savedObjectToSpec\" | \"createAndSave\" | \"createSavedObject\" | \"updateSavedObject\">, dependencies: ", { @@ -8351,8 +8335,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternsService", - "text": "IndexPatternsService" + "section": "def-common.DataViewsService", + "text": "DataViewsService" }, ", \"get\" | \"delete\" | \"create\" | \"find\" | \"ensureDefaultIndexPattern\" | \"getIds\" | \"getTitles\" | \"getIdsWithTitle\" | \"clearCache\" | \"getCache\" | \"getDefault\" | \"getDefaultId\" | \"setDefault\" | \"hasUserIndexPattern\" | \"getFieldsForWildcard\" | \"getFieldsForIndexPattern\" | \"refreshFields\" | \"fieldArrayToMap\" | \"savedObjectToSpec\" | \"createAndSave\" | \"createSavedObject\" | \"updateSavedObject\">" ], @@ -9305,8 +9289,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternsService", - "text": "IndexPatternsService" + "section": "def-common.DataViewsService", + "text": "DataViewsService" }, ", \"get\" | \"delete\" | \"create\" | \"find\" | \"ensureDefaultIndexPattern\" | \"getIds\" | \"getTitles\" | \"getIdsWithTitle\" | \"clearCache\" | \"getCache\" | \"getDefault\" | \"getDefaultId\" | \"setDefault\" | \"hasUserIndexPattern\" | \"getFieldsForWildcard\" | \"getFieldsForIndexPattern\" | \"refreshFields\" | \"fieldArrayToMap\" | \"savedObjectToSpec\" | \"createAndSave\" | \"createSavedObject\" | \"updateSavedObject\">, searchSourceDependencies: ", { @@ -9352,8 +9336,8 @@ "pluginId": "data", "scope": "common", "docId": "kibDataIndexPatternsPluginApi", - "section": "def-common.IndexPatternsService", - "text": "IndexPatternsService" + "section": "def-common.DataViewsService", + "text": "DataViewsService" }, ", \"get\" | \"delete\" | \"create\" | \"find\" | \"ensureDefaultIndexPattern\" | \"getIds\" | \"getTitles\" | \"getIdsWithTitle\" | \"clearCache\" | \"getCache\" | \"getDefault\" | \"getDefaultId\" | \"setDefault\" | \"hasUserIndexPattern\" | \"getFieldsForWildcard\" | \"getFieldsForIndexPattern\" | \"refreshFields\" | \"fieldArrayToMap\" | \"savedObjectToSpec\" | \"createAndSave\" | \"createSavedObject\" | \"updateSavedObject\">" ], @@ -10338,7 +10322,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.getEsdslFn.$1.getStartDependencies", + "id": "def-common.getEsdslFn.$1", "type": "Object", "tags": [], "label": "{\n getStartDependencies,\n}", @@ -10348,7 +10332,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.getEsdslFn.$1.getStartDependencies.getStartDependencies", + "id": "def-common.getEsdslFn.$1.getStartDependencies", "type": "Function", "tags": [], "label": "getStartDependencies", @@ -10363,7 +10347,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.getEsdslFn.$1.getStartDependencies.getStartDependencies.$1", + "id": "def-common.getEsdslFn.$1.getStartDependencies.$1", "type": "Any", "tags": [], "label": "getKibanaRequest", @@ -10415,7 +10399,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.getFilterBucketAgg.$1.getConfig", + "id": "def-common.getFilterBucketAgg.$1", "type": "Object", "tags": [], "label": "{ getConfig }", @@ -10425,7 +10409,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.getFilterBucketAgg.$1.getConfig.getConfig", + "id": "def-common.getFilterBucketAgg.$1.getConfig", "type": "Function", "tags": [], "label": "getConfig", @@ -10438,7 +10422,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.getFilterBucketAgg.$1.getConfig.getConfig.$1", + "id": "def-common.getFilterBucketAgg.$1.getConfig.$1", "type": "string", "tags": [], "label": "key", @@ -11345,7 +11329,7 @@ }, { "parentPluginId": "data", - "id": "def-common.getSearchParamsFromRequest.$2.dependencies", + "id": "def-common.getSearchParamsFromRequest.$2", "type": "Object", "tags": [], "label": "dependencies", @@ -11355,7 +11339,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.getSearchParamsFromRequest.$2.dependencies.getConfig", + "id": "def-common.getSearchParamsFromRequest.$2.getConfig", "type": "Function", "tags": [], "label": "getConfig", @@ -11369,7 +11353,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.key", + "id": "def-common.getSearchParamsFromRequest.$2.getConfig.$1", "type": "string", "tags": [], "label": "key", @@ -11379,7 +11363,7 @@ }, { "parentPluginId": "data", - "id": "def-common.defaultOverride", + "id": "def-common.getSearchParamsFromRequest.$2.getConfig.$2", "type": "Uncategorized", "tags": [], "label": "defaultOverride", @@ -12124,7 +12108,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.agg", + "id": "def-common.isNumberType.$1", "type": "Object", "tags": [], "label": "agg", @@ -12216,7 +12200,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.agg", + "id": "def-common.isStringOrNumberType.$1", "type": "Object", "tags": [], "label": "agg", @@ -12260,7 +12244,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.agg", + "id": "def-common.isStringType.$1", "type": "Object", "tags": [], "label": "agg", @@ -13248,7 +13232,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".FILTER>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ geo_bounding_box?: ({ type: \"geo_bounding_box\"; } & GeoBox) | ({ type: \"geo_bounding_box\"; } & { top_left: ", + ".FILTER>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\"> & Pick<{ geo_bounding_box?: ({ type: \"geo_bounding_box\"; } & GeoBox) | ({ type: \"geo_bounding_box\"; } & { top_left: ", { "pluginId": "data", "scope": "common", @@ -13332,7 +13316,7 @@ }, "<\"kibana_query\", ", "Query", - "> | undefined; }, never>, \"enabled\" | \"id\" | \"filter\" | \"customLabel\" | \"schema\" | \"geo_bounding_box\" | \"json\" | \"timeShift\">, ", + "> | undefined; }, never>, \"enabled\" | \"id\" | \"filter\" | \"schema\" | \"geo_bounding_box\" | \"json\" | \"customLabel\" | \"timeShift\">, ", "AggExpressionType", ", ", { @@ -13514,7 +13498,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".IP_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: (", + ".IP_RANGE>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: (", { "pluginId": "expressions", "scope": "common", @@ -13578,7 +13562,7 @@ "section": "def-common.IpRange", "text": "IpRange" }, - ">)[] | undefined; ipRangeType?: string | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ipRangeType\" | \"ranges\">, ", + ">)[] | undefined; ipRangeType?: string | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"ipRangeType\" | \"ranges\">, ", "AggExpressionType", ", ", { @@ -13628,7 +13612,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".DATE_RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\"> & Pick<{ ranges?: ", + ".DATE_RANGE>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"time_zone\"> & Pick<{ ranges?: ", { "pluginId": "expressions", "scope": "common", @@ -13660,7 +13644,7 @@ "section": "def-common.DateRange", "text": "DateRange" }, - ">[] | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ranges\" | \"time_zone\">, ", + ">[] | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"ranges\" | \"time_zone\">, ", "AggExpressionType", ", ", { @@ -13710,7 +13694,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".RANGE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: ", + ".RANGE>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\"> & Pick<{ ranges?: ", { "pluginId": "expressions", "scope": "common", @@ -13742,7 +13726,7 @@ "section": "def-common.NumericalRange", "text": "NumericalRange" }, - ">[] | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"ranges\">, ", + ">[] | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"ranges\">, ", "AggExpressionType", ", ", { @@ -13842,7 +13826,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".GEOHASH_GRID>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\"> & Pick<{ boundingBox?: ({ type: \"geo_bounding_box\"; } & GeoBox) | ({ type: \"geo_bounding_box\"; } & { top_left: ", + ".GEOHASH_GRID>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\"> & Pick<{ boundingBox?: ({ type: \"geo_bounding_box\"; } & GeoBox) | ({ type: \"geo_bounding_box\"; } & { top_left: ", { "pluginId": "data", "scope": "common", @@ -13906,7 +13890,7 @@ "section": "def-common.GeoPoint", "text": "GeoPoint" }, - "; }) | ({ type: \"geo_bounding_box\"; } & WellKnownText) | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\" | \"boundingBox\">, ", + "; }) | ({ type: \"geo_bounding_box\"; } & WellKnownText) | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"autoPrecision\" | \"precision\" | \"useGeocentroid\" | \"isFilteredByCollar\" | \"boundingBox\">, ", "AggExpressionType", ", ", { @@ -13956,7 +13940,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\"> & Pick<{ extended_bounds?: ", + ".HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\"> & Pick<{ extended_bounds?: ", { "pluginId": "expressions", "scope": "common", @@ -13988,7 +13972,7 @@ "section": "def-common.ExtendedBounds", "text": "ExtendedBounds" }, - "> | undefined; }, never>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\" | \"extended_bounds\">, ", + "> | undefined; }, never>, \"enabled\" | \"interval\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"used_interval\" | \"maxBars\" | \"intervalBase\" | \"min_doc_count\" | \"has_extended_bounds\" | \"extended_bounds\">, ", "AggExpressionType", ", ", { @@ -14038,7 +14022,7 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".DATE_HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\"> & Pick<{ timeRange?: ", + ".DATE_HISTOGRAM>, \"enabled\" | \"interval\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\"> & Pick<{ timeRange?: ", { "pluginId": "expressions", "scope": "common", @@ -14102,7 +14086,7 @@ "section": "def-common.ExtendedBounds", "text": "ExtendedBounds" }, - "> | undefined; }, never>, \"enabled\" | \"interval\" | \"timeRange\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"extended_bounds\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\">, ", + "> | undefined; }, never>, \"enabled\" | \"interval\" | \"timeRange\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"time_zone\" | \"used_interval\" | \"min_doc_count\" | \"extended_bounds\" | \"useNormalizedEsInterval\" | \"scaleMetricValues\" | \"used_time_zone\" | \"drop_partials\" | \"format\">, ", "AggExpressionType", ", ", { @@ -14152,11 +14136,11 @@ "section": "def-common.BUCKET_TYPES", "text": "BUCKET_TYPES" }, - ".TERMS>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"orderBy\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\"> & Pick<{ orderAgg?: ", + ".TERMS>, \"enabled\" | \"id\" | \"size\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"orderBy\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\"> & Pick<{ orderAgg?: ", "AggExpressionType", " | undefined; }, \"orderAgg\"> & Pick<{ orderAgg?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"size\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"field\" | \"orderBy\" | \"orderAgg\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"size\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"field\" | \"orderBy\" | \"orderAgg\" | \"order\" | \"missingBucket\" | \"missingBucketLabel\" | \"otherBucket\" | \"otherBucketLabel\" | \"exclude\" | \"include\">, ", "AggExpressionType", ", ", { @@ -14256,7 +14240,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".AVG_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", + ".AVG_BUCKET>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -14264,7 +14248,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -14314,7 +14298,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MAX_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", + ".MAX_BUCKET>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -14322,7 +14306,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -14372,7 +14356,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MIN_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", + ".MIN_BUCKET>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -14380,7 +14364,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -14430,7 +14414,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".SUM_BUCKET>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", + ".SUM_BUCKET>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -14438,7 +14422,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -14488,7 +14472,7 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".FILTERED_METRIC>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\"> & Pick<{ customBucket?: ", + ".FILTERED_METRIC>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\"> & Pick<{ customBucket?: ", "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", @@ -14496,7 +14480,7 @@ "AggExpressionType", " | undefined; customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"customBucket\">, ", "AggExpressionType", ", ", { @@ -14646,11 +14630,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".CUMULATIVE_SUM>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".CUMULATIVE_SUM>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -14700,11 +14684,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".DERIVATIVE>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".DERIVATIVE>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -15054,11 +15038,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".MOVING_FN>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\"> & Pick<{ customMetric?: ", + ".MOVING_FN>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\" | \"window\" | \"script\">, ", "AggExpressionType", ", ", { @@ -15208,11 +15192,11 @@ "section": "def-common.METRIC_TYPES", "text": "METRIC_TYPES" }, - ".SERIAL_DIFF>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", + ".SERIAL_DIFF>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"buckets_path\" | \"metricAgg\"> & Pick<{ customMetric?: ", "AggExpressionType", " | undefined; }, \"customMetric\"> & Pick<{ customMetric?: ", "AggExpressionType", - " | undefined; }, never>, \"enabled\" | \"id\" | \"customLabel\" | \"schema\" | \"json\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", + " | undefined; }, never>, \"enabled\" | \"id\" | \"schema\" | \"json\" | \"customLabel\" | \"timeShift\" | \"customMetric\" | \"buckets_path\" | \"metricAgg\">, ", "AggExpressionType", ", ", { @@ -17862,7 +17846,7 @@ "label": "valueType", "description": [], "signature": [ - "\"string\" | \"number\" | \"boolean\" | \"object\" | \"date\" | \"ip\" | \"geo_point\" | \"_source\" | \"attachment\" | \"geo_shape\" | \"murmur3\" | \"unknown\" | \"conflict\" | \"nested\" | \"histogram\" | \"null\" | undefined" + "\"string\" | \"number\" | \"boolean\" | \"object\" | \"date\" | \"_source\" | \"attachment\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"murmur3\" | \"unknown\" | \"conflict\" | \"nested\" | \"histogram\" | \"null\" | undefined" ], "path": "src/plugins/data/common/search/aggs/agg_type.ts", "deprecated": false @@ -18202,9 +18186,8 @@ "label": "filterFieldTypes", "description": [], "signature": [ - "\"*\" | ", "KBN_FIELD_TYPES", - " | ", + " | \"*\" | ", "KBN_FIELD_TYPES", "[] | undefined" ], @@ -18314,7 +18297,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.timeRange", + "id": "def-common.DateHistogramBucketAggDependencies.calculateBounds.$1", "type": "Object", "tags": [], "label": "timeRange", @@ -18640,7 +18623,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.key", + "id": "def-common.FetchHandlers.getConfig.$1", "type": "string", "tags": [], "label": "key", @@ -18650,7 +18633,7 @@ }, { "parentPluginId": "data", - "id": "def-common.defaultOverride", + "id": "def-common.FetchHandlers.getConfig.$2", "type": "Uncategorized", "tags": [], "label": "defaultOverride", @@ -19560,7 +19543,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.request", + "id": "def-common.ISearchClient.search.$1", "type": "Uncategorized", "tags": [], "label": "request", @@ -19573,7 +19556,7 @@ }, { "parentPluginId": "data", - "id": "def-common.options", + "id": "def-common.ISearchClient.search.$2", "type": "Object", "tags": [], "label": "options", @@ -19619,7 +19602,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.id", + "id": "def-common.ISearchClient.cancel.$1", "type": "string", "tags": [], "label": "id", @@ -19629,7 +19612,7 @@ }, { "parentPluginId": "data", - "id": "def-common.options", + "id": "def-common.ISearchClient.cancel.$2", "type": "Object", "tags": [], "label": "options", @@ -19675,7 +19658,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.id", + "id": "def-common.ISearchClient.extend.$1", "type": "string", "tags": [], "label": "id", @@ -19685,7 +19668,7 @@ }, { "parentPluginId": "data", - "id": "def-common.keepAlive", + "id": "def-common.ISearchClient.extend.$2", "type": "string", "tags": [], "label": "keepAlive", @@ -19695,7 +19678,7 @@ }, { "parentPluginId": "data", - "id": "def-common.options", + "id": "def-common.ISearchClient.extend.$3", "type": "Object", "tags": [], "label": "options", @@ -20093,9 +20076,8 @@ "label": "filterFieldTypes", "description": [], "signature": [ - "\"*\" | ", "KBN_FIELD_TYPES", - " | ", + " | \"*\" | ", "KBN_FIELD_TYPES", "[] | undefined" ], @@ -21100,7 +21082,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.request", + "id": "def-common.SearchSourceDependencies.search.$1", "type": "Uncategorized", "tags": [], "label": "request", @@ -21113,7 +21095,7 @@ }, { "parentPluginId": "data", - "id": "def-common.options", + "id": "def-common.SearchSourceDependencies.search.$2", "type": "Object", "tags": [], "label": "options", @@ -24037,9 +24019,8 @@ "label": "FieldTypes", "description": [], "signature": [ - "\"*\" | ", "KBN_FIELD_TYPES", - " | ", + " | \"*\" | ", "KBN_FIELD_TYPES", "[]" ], @@ -24518,7 +24499,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.id", + "id": "def-common.ISearchCancelGeneric.$1", "type": "string", "tags": [], "label": "id", @@ -24528,7 +24509,7 @@ }, { "parentPluginId": "data", - "id": "def-common.options", + "id": "def-common.ISearchCancelGeneric.$2", "type": "Object", "tags": [], "label": "options", @@ -24573,7 +24554,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.id", + "id": "def-common.ISearchExtendGeneric.$1", "type": "string", "tags": [], "label": "id", @@ -24583,7 +24564,7 @@ }, { "parentPluginId": "data", - "id": "def-common.keepAlive", + "id": "def-common.ISearchExtendGeneric.$2", "type": "string", "tags": [], "label": "keepAlive", @@ -24593,7 +24574,7 @@ }, { "parentPluginId": "data", - "id": "def-common.options", + "id": "def-common.ISearchExtendGeneric.$3", "type": "Object", "tags": [], "label": "options", @@ -24672,7 +24653,7 @@ "children": [ { "parentPluginId": "data", - "id": "def-common.request", + "id": "def-common.ISearchGeneric.$1", "type": "Uncategorized", "tags": [], "label": "request", @@ -24685,7 +24666,7 @@ }, { "parentPluginId": "data", - "id": "def-common.options", + "id": "def-common.ISearchGeneric.$2", "type": "Object", "tags": [], "label": "options", @@ -28527,9 +28508,9 @@ "label": "migrateIncludeExcludeFormat", "description": [], "signature": [ - "{ scriptable?: boolean | undefined; filterFieldTypes?: \"*\" | ", + "{ scriptable?: boolean | undefined; filterFieldTypes?: ", "KBN_FIELD_TYPES", - " | ", + " | \"*\" | ", "KBN_FIELD_TYPES", "[] | undefined; makeAgg?: ((agg: ", { diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index 8780d2eb0c22e..4ec672049a391 100644 --- a/api_docs/data_search.mdx +++ b/api_docs/data_search.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3498 | 44 | 2981 | 50 | +| 3099 | 44 | 2738 | 50 | ## Client diff --git a/api_docs/data_ui.json b/api_docs/data_ui.json index e818c846fa1ba..d7c80d5124f5e 100644 --- a/api_docs/data_ui.json +++ b/api_docs/data_ui.json @@ -572,7 +572,7 @@ "section": "def-public.SearchBarProps", "text": "SearchBarProps" }, - ", \"filters\" | \"query\" | \"isClearable\" | \"placeholder\" | \"isLoading\" | \"intl\" | \"indexPatterns\" | \"customSubmitButton\" | \"screenTitle\" | \"dataTestSubj\" | \"showQueryBar\" | \"showQueryInput\" | \"showFilterBar\" | \"showDatePicker\" | \"showAutoRefreshOnly\" | \"isRefreshPaused\" | \"refreshInterval\" | \"dateRangeFrom\" | \"dateRangeTo\" | \"showSaveQuery\" | \"savedQuery\" | \"onQueryChange\" | \"onQuerySubmit\" | \"onSaved\" | \"onSavedQueryUpdated\" | \"onClearSavedQuery\" | \"onRefresh\" | \"indicateNoData\" | \"iconType\" | \"nonKqlMode\" | \"nonKqlModeHelpText\" | \"displayStyle\" | \"timeHistory\" | \"onFiltersUpdated\" | \"onRefreshChange\">, \"filters\" | \"query\" | \"isClearable\" | \"placeholder\" | \"isLoading\" | \"indexPatterns\" | \"customSubmitButton\" | \"screenTitle\" | \"dataTestSubj\" | \"showQueryBar\" | \"showQueryInput\" | \"showFilterBar\" | \"showDatePicker\" | \"showAutoRefreshOnly\" | \"isRefreshPaused\" | \"refreshInterval\" | \"dateRangeFrom\" | \"dateRangeTo\" | \"showSaveQuery\" | \"savedQuery\" | \"onQueryChange\" | \"onQuerySubmit\" | \"onSaved\" | \"onSavedQueryUpdated\" | \"onClearSavedQuery\" | \"onRefresh\" | \"indicateNoData\" | \"iconType\" | \"nonKqlMode\" | \"nonKqlModeHelpText\" | \"displayStyle\" | \"timeHistory\" | \"onFiltersUpdated\" | \"onRefreshChange\">, any> & { WrappedComponent: React.ComponentType, \"filters\" | \"query\" | \"savedQuery\" | \"isClearable\" | \"placeholder\" | \"isLoading\" | \"indexPatterns\" | \"customSubmitButton\" | \"screenTitle\" | \"dataTestSubj\" | \"showQueryBar\" | \"showQueryInput\" | \"showFilterBar\" | \"showDatePicker\" | \"showAutoRefreshOnly\" | \"isRefreshPaused\" | \"refreshInterval\" | \"dateRangeFrom\" | \"dateRangeTo\" | \"showSaveQuery\" | \"onQueryChange\" | \"onQuerySubmit\" | \"onSaved\" | \"onSavedQueryUpdated\" | \"onClearSavedQuery\" | \"onRefresh\" | \"indicateNoData\" | \"iconType\" | \"nonKqlMode\" | \"nonKqlModeHelpText\" | \"displayStyle\" | \"timeHistory\" | \"onFiltersUpdated\" | \"onRefreshChange\">, any> & { WrappedComponent: React.ComponentType & ReactIntl.InjectedIntlProps>; }" + ", \"filters\" | \"query\" | \"savedQuery\" | \"isClearable\" | \"placeholder\" | \"isLoading\" | \"intl\" | \"indexPatterns\" | \"customSubmitButton\" | \"screenTitle\" | \"dataTestSubj\" | \"showQueryBar\" | \"showQueryInput\" | \"showFilterBar\" | \"showDatePicker\" | \"showAutoRefreshOnly\" | \"isRefreshPaused\" | \"refreshInterval\" | \"dateRangeFrom\" | \"dateRangeTo\" | \"showSaveQuery\" | \"onQueryChange\" | \"onQuerySubmit\" | \"onSaved\" | \"onSavedQueryUpdated\" | \"onClearSavedQuery\" | \"onRefresh\" | \"indicateNoData\" | \"iconType\" | \"nonKqlMode\" | \"nonKqlModeHelpText\" | \"displayStyle\" | \"timeHistory\" | \"onFiltersUpdated\" | \"onRefreshChange\"> & ReactIntl.InjectedIntlProps>; }" ], "path": "src/plugins/data/public/ui/search_bar/index.tsx", "deprecated": false, diff --git a/api_docs/data_ui.mdx b/api_docs/data_ui.mdx index 5816012657bb6..35c4a476e66d1 100644 --- a/api_docs/data_ui.mdx +++ b/api_docs/data_ui.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3498 | 44 | 2981 | 50 | +| 3099 | 44 | 2738 | 50 | ## Client diff --git a/api_docs/data_visualizer.json b/api_docs/data_visualizer.json index f646924e9cee0..8537b55996046 100644 --- a/api_docs/data_visualizer.json +++ b/api_docs/data_visualizer.json @@ -234,7 +234,7 @@ "children": [ { "parentPluginId": "dataVisualizer", - "id": "def-public.props", + "id": "def-public.FileDataVisualizerSpec.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -247,7 +247,7 @@ }, { "parentPluginId": "dataVisualizer", - "id": "def-public.context", + "id": "def-public.FileDataVisualizerSpec.$2", "type": "Any", "tags": [], "label": "context", @@ -285,7 +285,7 @@ "children": [ { "parentPluginId": "dataVisualizer", - "id": "def-public.props", + "id": "def-public.IndexDataVisualizerSpec.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -298,7 +298,7 @@ }, { "parentPluginId": "dataVisualizer", - "id": "def-public.context", + "id": "def-public.IndexDataVisualizerSpec.$2", "type": "Any", "tags": [], "label": "context", @@ -542,7 +542,7 @@ "label": "type", "description": [], "signature": [ - "\"number\" | \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"unknown\" | \"histogram\" | \"text\"" + "\"number\" | \"boolean\" | \"date\" | \"keyword\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"unknown\" | \"histogram\" | \"text\"" ], "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", "deprecated": false @@ -972,7 +972,7 @@ "label": "JobFieldType", "description": [], "signature": [ - "\"number\" | \"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"unknown\" | \"histogram\" | \"text\"" + "\"number\" | \"boolean\" | \"date\" | \"keyword\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"unknown\" | \"histogram\" | \"text\"" ], "path": "x-pack/plugins/data_visualizer/common/types/job_field_type.ts", "deprecated": false, diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index 5d2a815cfd84c..82caea2104067 100644 --- a/api_docs/deprecations_by_api.mdx +++ b/api_docs/deprecations_by_api.mdx @@ -13,41 +13,38 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Referencing plugin(s) | Remove By | | ---------------|-----------|-----------| -| | discover, visualizations, dashboard, lens, observability, maps, dashboardEnhanced, discoverEnhanced, securitySolution, visualize, timelion, presentationUtil | 8.1 | +| | discover, visualizations, dashboard, lens, observability, maps, dashboardEnhanced, discoverEnhanced, securitySolution, visualize, presentationUtil | 8.1 | | | lens, timelines, infra, securitySolution, stackAlerts, transform, indexPatternManagement, visTypeTimelion, visTypeVega | 8.1 | -| | canvas, discover, visualizations, dashboard, lens, observability, timelines, maps, infra, dashboardEnhanced, discoverEnhanced, securitySolution, urlDrilldown, inputControlVis, visTypeTimelion, visualize, visTypeVega, presentationUtil, ml, visTypeTimeseries | 8.1 | -| | canvas, discover, visualizations, dashboard, lens, observability, timelines, maps, infra, dashboardEnhanced, discoverEnhanced, securitySolution, urlDrilldown, inputControlVis, visTypeTimelion, visualize, visTypeVega, presentationUtil, ml, visTypeTimeseries | 8.1 | -| | canvas, discover, visualizations, dashboard, lens, observability, timelines, maps, infra, dashboardEnhanced, discoverEnhanced, securitySolution, urlDrilldown, inputControlVis, visTypeTimelion, visualize, visTypeVega, presentationUtil, ml, visTypeTimeseries | 8.1 | -| | indexPatternManagement | 8.1 | -| | visTypeTimeseries, graph, indexPatternManagement | 8.1 | -| | indexPatternManagement | 8.1 | -| | fleet, maps, ml, infra, stackAlerts, indexPatternManagement, lens, visTypeTimeseries | 8.1 | -| | indexPatternManagement | 8.1 | -| | indexPatternManagement | 8.1 | -| | visTypeTimeseries, graph, indexPatternManagement | 8.1 | -| | indexPatternManagement | 8.1 | -| | fleet, maps, ml, infra, stackAlerts, indexPatternManagement, lens, visTypeTimeseries | 8.1 | -| | indexPatternManagement | 8.1 | -| | fleet, maps, ml, infra, stackAlerts, indexPatternManagement, lens, visTypeTimeseries | 8.1 | -| | indexPatternManagement | 8.1 | -| | visTypeTimeseries, graph, indexPatternManagement | 8.1 | -| | indexPatternManagement | 8.1 | +| | discover, visualizations, dashboard, lens, observability, timelines, maps, infra, dashboardEnhanced, discoverEnhanced, securitySolution, urlDrilldown, inputControlVis, visTypeTimelion, visualize, visTypeVega, presentationUtil, ml, visTypeTimeseries | 8.1 | +| | discover, visualizations, dashboard, lens, observability, timelines, maps, infra, dashboardEnhanced, discoverEnhanced, securitySolution, urlDrilldown, inputControlVis, visTypeTimelion, visualize, visTypeVega, presentationUtil, ml, visTypeTimeseries | 8.1 | +| | discover, visualizations, dashboard, lens, observability, timelines, maps, infra, dashboardEnhanced, discoverEnhanced, securitySolution, urlDrilldown, inputControlVis, visTypeTimelion, visualize, visTypeVega, presentationUtil, ml, visTypeTimeseries | 8.1 | | | visTypeTimeseries | 8.1 | | | visTypeTimeseries | 8.1 | +| | visTypeTimeseries, graph, indexPatternManagement | 8.1 | | | visTypeTimeseries | 8.1 | -| | timelines | 8.1 | -| | timelines | 8.1 | -| | timelines | 8.1 | -| | lens, infra, apm, stackAlerts, transform | 8.1 | | | discover, maps, inputControlVis | 8.1 | | | discover, maps, inputControlVis | 8.1 | +| | lens, infra, apm, graph, stackAlerts, transform | 8.1 | +| | fleet, ml, infra, stackAlerts, indexPatternManagement | 8.1 | +| | fleet, ml, infra, stackAlerts, indexPatternManagement | 8.1 | +| | fleet, ml, infra, stackAlerts, indexPatternManagement | 8.1 | | | visualizations, visDefaultEditor | 8.1 | | | visualizations, visDefaultEditor | 8.1 | +| | indexPatternManagement | 8.1 | +| | indexPatternManagement | 8.1 | +| | indexPatternManagement | 8.1 | +| | indexPatternManagement | 8.1 | | | indexPatternFieldEditor, savedObjectsManagement | 8.1 | | | indexPatternFieldEditor, savedObjectsManagement | 8.1 | | | indexPatternFieldEditor, savedObjectsManagement | 8.1 | +| | visTypeTimelion | 8.1 | +| | visTypeTimelion | 8.1 | | | observability | 8.1 | | | observability | 8.1 | +| | visualize | 8.1 | +| | timelines | 8.1 | +| | timelines | 8.1 | +| | timelines | 8.1 | | | dashboardEnhanced | 8.1 | | | dashboardEnhanced | 8.1 | | | discoverEnhanced | 8.1 | @@ -56,54 +53,74 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | actions, alerting, cases, dataEnhanced | 8.1 | | | cases, alerting, dataEnhanced | 8.1 | | | cases, alerting, dataEnhanced | 8.1 | -| | visTypeTimelion | 8.1 | -| | visTypeTimelion | 8.1 | | | security, reporting, apm, infra, securitySolution | 7.16 | | | security, reporting, apm, infra, securitySolution | 7.16 | | | security | 7.16 | | | securitySolution | - | +| | visTypeTimeseries, reporting, discover, observability, infra, maps, ml, apm, lens, osquery, securitySolution, transform, dataVisualizer, uptime, savedObjects, visualizations, indexPatternFieldEditor, dashboard, graph, stackAlerts, indexPatternEditor, indexPatternManagement, inputControlVis, savedObjectsManagement, visualize, visDefaultEditor, visTypeTable, visTypeVega | - | +| | indexPatternFieldEditor, discover, maps, dataVisualizer, securitySolution, indexPatternEditor, indexPatternManagement, inputControlVis, visDefaultEditor, visTypeTimeseries, lens | - | | | timelines, infra, ml, securitySolution, indexPatternManagement, stackAlerts, transform | - | +| | home, savedObjects, security, fleet, indexPatternFieldEditor, discover, visualizations, dashboard, lens, observability, maps, fileUpload, dataVisualizer, ml, infra, apm, graph, osquery, securitySolution, stackAlerts, transform, upgradeAssistant, indexPatternEditor, indexPatternManagement, inputControlVis, kibanaOverview, savedObjectsManagement, visualize, visTypeTimelion, visTypeTimeseries, visTypeVega | - | +| | visTypeTimeseries, reporting, discover, observability, infra, maps, ml, apm, lens, osquery, securitySolution, transform, dataVisualizer, uptime, savedObjects, visualizations, indexPatternFieldEditor, dashboard, graph, stackAlerts, indexPatternEditor, indexPatternManagement, inputControlVis, savedObjectsManagement, visualize, visDefaultEditor, visTypeTable, visTypeVega | - | +| | indexPatternFieldEditor, discover, maps, dataVisualizer, securitySolution, indexPatternEditor, indexPatternManagement, inputControlVis, visDefaultEditor, visTypeTimeseries, lens | - | | | timelines, infra, ml, securitySolution, indexPatternManagement, stackAlerts, transform | - | +| | indexPatternFieldEditor, discover, maps, dataVisualizer, securitySolution, indexPatternEditor, indexPatternManagement, inputControlVis, visDefaultEditor, visTypeTimeseries, lens | - | +| | visTypeTimeseries, reporting, discover, observability, infra, maps, ml, apm, lens, osquery, securitySolution, transform, dataVisualizer, uptime, savedObjects, visualizations, indexPatternFieldEditor, dashboard, graph, stackAlerts, indexPatternEditor, indexPatternManagement, inputControlVis, savedObjectsManagement, visualize, visDefaultEditor, visTypeTable, visTypeVega | - | | | apm, security, securitySolution | - | | | apm, security, securitySolution | - | | | reporting, encryptedSavedObjects, actions, ml, dataEnhanced, logstash, securitySolution | - | | | dashboard, lens, maps, ml, securitySolution, security, visualize | - | | | securitySolution | - | -| | fleet, indexPatternFieldEditor, discover, dashboard, lens, ml, stackAlerts, indexPatternManagement, visTypeMetric, visTypeTable, visTypeTimeseries, visTypePie, visTypeXy, visTypeVislib | - | -| | embeddable, discover, presentationUtil, dashboard, graph | - | +| | visTypeTimeseries, maps, lens, discover | - | +| | fleet, indexPatternFieldEditor, discover, dashboard, lens, ml, stackAlerts, indexPatternManagement, visTypeTable, visTypeTimeseries, visTypeMetric, visTypePie, visTypeXy, visTypeVislib | - | +| | visTypeTimeseries, maps, lens, discover | - | +| | visTypeTimeseries, maps, lens, discover | - | +| | discover, infra, savedObjects, security, visualizations, dashboard, lens, ml, graph, stackAlerts, transform, indexPatternManagement, inputControlVis, savedObjectsManagement, visTypeTimelion, maps, observability | - | +| | discover, infra, savedObjects, security, visualizations, dashboard, lens, ml, graph, stackAlerts, transform, indexPatternManagement, inputControlVis, savedObjectsManagement, visTypeTimelion, maps, observability | - | +| | dashboard, maps, graph, visualize | - | | | spaces, security, reporting, actions, alerting, ml, fleet, remoteClusters, graph, indexLifecycleManagement, maps, painlessLab, rollup, searchprofiler, snapshotRestore, transform, upgradeAssistant | - | -| | security, licenseManagement, ml, fleet, apm, reporting, crossClusterReplication, logstash, painlessLab, searchprofiler, watcher | - | -| | actions, ml, enterpriseSearch, savedObjectsTagging | - | -| | ml | - | -| | management, fleet, security, kibanaOverview, timelion | - | -| | fleet | - | -| | dashboard, maps, visualize | - | | | lens, dashboard | - | -| | visualizations, discover, dashboard, savedObjectsManagement, timelion | - | -| | savedObjectsTaggingOss, visualizations, discover, dashboard, savedObjectsManagement, visualize, visDefaultEditor | - | -| | discover, visualizations, dashboard, timelion | - | -| | reporting | - | -| | reporting | - | -| | reporting | - | +| | discover, ml, transform, canvas | - | | | discover | - | +| | discover, ml, transform, canvas | - | | | discover | - | +| | discover, ml, transform, canvas | - | +| | embeddable, discover, presentationUtil, dashboard, graph | - | +| | visualizations, discover, dashboard, savedObjectsManagement | - | +| | discover, savedObjectsTaggingOss, visualizations, dashboard, visualize, visDefaultEditor | - | +| | discover, visualizations, dashboard | - | | | data, discover, embeddable | - | | | advancedSettings, discover | - | | | advancedSettings, discover | - | +| | security | - | +| | security | - | +| | security, licenseManagement, ml, fleet, apm, reporting, crossClusterReplication, logstash, painlessLab, searchprofiler, watcher | - | +| | management, fleet, security, kibanaOverview | - | +| | visualizations, dashboard | - | +| | visualizations, dashboard | - | +| | visualizations, dashboard | - | +| | actions, ml, enterpriseSearch, savedObjectsTagging | - | +| | ml | - | +| | indexPatternManagement | - | +| | indexPatternManagement | - | | | spaces, savedObjectsManagement | - | | | spaces, savedObjectsManagement | - | +| | observability, indexPatternEditor, apm | - | +| | observability, indexPatternEditor, apm | - | +| | reporting | - | +| | reporting | - | +| | reporting | - | +| | cloud, apm | - | +| | osquery | - | | | visTypeTable | - | -| | canvas, visTypePie, visTypeXy | - | +| | visTypeVega | - | +| | monitoring, visTypeVega | - | +| | fleet | - | | | canvas, visTypeXy | - | +| | canvas, visTypePie, visTypeXy | - | | | canvas, visTypeXy | - | | | canvas, visTypeXy | - | | | encryptedSavedObjects, actions, alerting | - | -| | cloud, apm | - | -| | visTypeVega | - | -| | monitoring, visTypeVega | - | -| | osquery | - | -| | security | - | -| | security | - | | | console | - | @@ -115,10 +132,7 @@ Safe to remove. | ---------------| | | | | -| | -| | -| | -| | +| | | | | | | | @@ -140,7 +154,6 @@ Safe to remove. | | | | | | -| | | | | | | | @@ -170,13 +183,14 @@ Safe to remove. | | | | | | -| | -| | -| | +| | +| | +| | +| | +| | +| | | | | | -| | -| | | | | | | | @@ -189,8 +203,8 @@ Safe to remove. | | | | | | -| | | | +| | | | | | | | diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index 24cfe1e5342a7..99f241e81384d 100644 --- a/api_docs/deprecations_by_plugin.mdx +++ b/api_docs/deprecations_by_plugin.mdx @@ -47,10 +47,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPattern), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern) | - | +| | [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPatternSpec), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPatternSpec) | - | +| | [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=indexPatterns) | - | | | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=esKuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=esKuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=esKuery) | 8.1 | +| | [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPattern), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern) | - | +| | [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPatternSpec), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPatternSpec) | - | +| | [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [SelectedFilters.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/SelectedFilters.tsx#:~:text=IndexPattern), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPattern), [use_index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/app/RumDashboard/LocalUIFilters/use_index_pattern.ts#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/components/shared/kuery_bar/index.tsx#:~:text=IndexPattern) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/plugin.ts#:~:text=environment) | - | -| | [license_context.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/context/license/license_context.tsx#:~:text=license%24) | - | | | [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode)+ 2 more | - | +| | [license_context.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/context/license/license_context.tsx#:~:text=license%24) | - | | | [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode)+ 2 more | - | | | [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/server/routes/index_pattern.ts#:~:text=spacesService) | 7.16 | | | [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/server/routes/index_pattern.ts#:~:text=getSpaceId) | 7.16 | @@ -61,9 +67,9 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [saved_lens.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts#:~:text=Filter), [saved_lens.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts#:~:text=Filter), [saved_lens.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts#:~:text=Filter), [saved_lens.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts#:~:text=Filter), [saved_lens.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts#:~:text=Filter), [saved_lens.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts#:~:text=Filter) | 8.1 | -| | [saved_lens.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts#:~:text=Filter), [saved_lens.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts#:~:text=Filter), [saved_lens.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts#:~:text=Filter), [saved_lens.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts#:~:text=Filter), [saved_lens.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts#:~:text=Filter), [saved_lens.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts#:~:text=Filter) | 8.1 | -| | [saved_lens.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts#:~:text=Filter), [saved_lens.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts#:~:text=Filter), [saved_lens.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts#:~:text=Filter), [saved_lens.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts#:~:text=Filter), [saved_lens.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts#:~:text=Filter), [saved_lens.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/target/types/canvas_plugin_src/functions/external/saved_lens.d.ts#:~:text=Filter) | 8.1 | +| | [es_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/public/lib/es_service.ts#:~:text=IndexPatternAttributes), [es_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/public/lib/es_service.ts#:~:text=IndexPatternAttributes), [es_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/public/lib/es_service.ts#:~:text=IndexPatternAttributes) | - | +| | [es_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/public/lib/es_service.ts#:~:text=IndexPatternAttributes), [es_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/public/lib/es_service.ts#:~:text=IndexPatternAttributes), [es_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/public/lib/es_service.ts#:~:text=IndexPatternAttributes) | - | +| | [es_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/public/lib/es_service.ts#:~:text=IndexPatternAttributes), [es_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/public/lib/es_service.ts#:~:text=IndexPatternAttributes), [es_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/public/lib/es_service.ts#:~:text=IndexPatternAttributes) | - | | | [filters.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/public/functions/filters.ts#:~:text=context), [escount.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/escount.ts#:~:text=context), [esdocs.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/esdocs.ts#:~:text=context), [essql.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/essql.ts#:~:text=context), [neq.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/common/neq.ts#:~:text=context), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts#:~:text=context), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/server/demodata/index.ts#:~:text=context) | - | | | [state.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/types/state.ts#:~:text=Render), [state.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/types/state.ts#:~:text=Render), [state.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/target/types/types/state.d.ts#:~:text=Render), [state.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/target/types/types/state.d.ts#:~:text=Render), [markdown.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/markdown.ts#:~:text=Render), [markdown.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/markdown.ts#:~:text=Render), [timefilterControl.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/common/timefilterControl.ts#:~:text=Render), [timefilterControl.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/common/timefilterControl.ts#:~:text=Render), [pie.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/public/functions/pie.ts#:~:text=Render), [pie.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/public/functions/pie.ts#:~:text=Render)+ 6 more | - | | | [filters.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/public/functions/filters.ts#:~:text=context), [escount.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/escount.ts#:~:text=context), [esdocs.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/esdocs.ts#:~:text=context), [essql.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/essql.ts#:~:text=context), [neq.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/common/neq.ts#:~:text=context), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts#:~:text=context), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas/canvas_plugin_src/functions/server/demodata/index.ts#:~:text=context) | - | @@ -110,10 +116,19 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPatternsContract), [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPatternsContract), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/types.ts#:~:text=IndexPatternsContract), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/types.ts#:~:text=IndexPatternsContract), [make_default_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/test_helpers/make_default_services.ts#:~:text=IndexPatternsContract), [make_default_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/test_helpers/make_default_services.ts#:~:text=IndexPatternsContract) | - | +| | [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/types.ts#:~:text=IndexPattern) | - | +| | [replace_index_pattern_reference.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/server/saved_objects/replace_index_pattern_reference.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [replace_index_pattern_reference.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/server/saved_objects/replace_index_pattern_reference.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [dashboard_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [dashboard_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [dashboard_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE) | - | +| | [dashboard_router.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/dashboard_router.tsx#:~:text=indexPatterns), [dashboard_router.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/dashboard_router.tsx#:~:text=indexPatterns) | - | | | [export_csv_action.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/actions/export_csv_action.tsx#:~:text=fieldFormats) | - | -| | [save_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/save_dashboard.ts#:~:text=esFilters), [save_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/save_dashboard.ts#:~:text=esFilters), [diff_dashboard_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts#:~:text=esFilters), [diff_dashboard_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts#:~:text=esFilters), [diff_dashboard_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts#:~:text=esFilters), [diff_dashboard_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts#:~:text=esFilters), [sync_dashboard_container_input.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts#:~:text=esFilters), [sync_dashboard_container_input.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts#:~:text=esFilters), [sync_dashboard_container_input.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts#:~:text=esFilters), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/plugin.tsx#:~:text=esFilters)+ 16 more | 8.1 | +| | [save_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/save_dashboard.ts#:~:text=esFilters), [save_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/save_dashboard.ts#:~:text=esFilters), [diff_dashboard_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts#:~:text=esFilters), [diff_dashboard_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts#:~:text=esFilters), [diff_dashboard_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts#:~:text=esFilters), [diff_dashboard_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/diff_dashboard_state.ts#:~:text=esFilters), [sync_dashboard_container_input.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts#:~:text=esFilters), [sync_dashboard_container_input.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts#:~:text=esFilters), [sync_dashboard_container_input.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_container_input.ts#:~:text=esFilters), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/plugin.tsx#:~:text=esFilters)+ 15 more | 8.1 | | | [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=Filter), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter)+ 25 more | 8.1 | +| | [replace_index_pattern_reference.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/server/saved_objects/replace_index_pattern_reference.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [replace_index_pattern_reference.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/server/saved_objects/replace_index_pattern_reference.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [dashboard_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [dashboard_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [dashboard_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE) | - | | | [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=Filter), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter)+ 25 more | 8.1 | +| | [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPatternsContract), [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPatternsContract), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/types.ts#:~:text=IndexPatternsContract), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/types.ts#:~:text=IndexPatternsContract), [make_default_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/test_helpers/make_default_services.ts#:~:text=IndexPatternsContract), [make_default_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/test_helpers/make_default_services.ts#:~:text=IndexPatternsContract) | - | +| | [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/types.ts#:~:text=IndexPattern) | - | +| | [replace_index_pattern_reference.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/server/saved_objects/replace_index_pattern_reference.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [replace_index_pattern_reference.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/server/saved_objects/replace_index_pattern_reference.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [dashboard_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [dashboard_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [dashboard_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/server/saved_objects/dashboard_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE) | - | +| | [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [sync_dashboard_index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/types.ts#:~:text=IndexPattern) | - | | | [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [filter_utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/lib/filter_utils.ts#:~:text=Filter), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=Filter), [saved_dashboard.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter), [dashboard_state_slice.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts#:~:text=Filter)+ 25 more | 8.1 | | | [saved_objects.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/services/saved_objects.ts#:~:text=SavedObjectSaveModal), [save_modal.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/top_nav/save_modal.tsx#:~:text=SavedObjectSaveModal), [save_modal.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/top_nav/save_modal.tsx#:~:text=SavedObjectSaveModal) | - | | | [saved_objects.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/services/saved_objects.ts#:~:text=SavedObjectLoader), [saved_dashboards.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboards.ts#:~:text=SavedObjectLoader), [saved_dashboards.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/saved_dashboards/saved_dashboards.ts#:~:text=SavedObjectLoader), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/types.ts#:~:text=SavedObjectLoader), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/types.ts#:~:text=SavedObjectLoader), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/plugin.tsx#:~:text=SavedObjectLoader), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/plugin.tsx#:~:text=SavedObjectLoader), [make_default_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/test_helpers/make_default_services.ts#:~:text=SavedObjectLoader), [make_default_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/application/test_helpers/make_default_services.ts#:~:text=SavedObjectLoader), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/dashboard/public/url_generator.ts#:~:text=SavedObjectLoader)+ 3 more | - | @@ -158,22 +173,51 @@ warning: This document is auto-generated and is meant to be viewed inside our ex +## dataVisualizer + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [actions_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx#:~:text=IndexPattern), [actions_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx#:~:text=IndexPattern), [full_time_range_selector_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts#:~:text=IndexPattern), [full_time_range_selector_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts#:~:text=IndexPattern), [full_time_range_selector.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx#:~:text=IndexPattern), [full_time_range_selector.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx#:~:text=IndexPattern), [full_time_range_selector.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx#:~:text=IndexPattern), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPattern), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPattern), [full_time_range_selector.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/target/types/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.d.ts#:~:text=IndexPattern)+ 23 more | - | +| | [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField) | - | +| | [file_data_visualizer.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/file_data_visualizer.tsx#:~:text=indexPatterns), [index_data_visualizer.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx#:~:text=indexPatterns) | - | +| | [actions_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx#:~:text=IndexPattern), [actions_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx#:~:text=IndexPattern), [full_time_range_selector_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts#:~:text=IndexPattern), [full_time_range_selector_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts#:~:text=IndexPattern), [full_time_range_selector.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx#:~:text=IndexPattern), [full_time_range_selector.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx#:~:text=IndexPattern), [full_time_range_selector.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx#:~:text=IndexPattern), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPattern), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPattern), [full_time_range_selector.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/target/types/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.d.ts#:~:text=IndexPattern)+ 23 more | - | +| | [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField) | - | +| | [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/common/util/field_types_utils.ts#:~:text=IndexPatternField) | - | +| | [actions_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx#:~:text=IndexPattern), [actions_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx#:~:text=IndexPattern), [full_time_range_selector_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts#:~:text=IndexPattern), [full_time_range_selector_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector_service.ts#:~:text=IndexPattern), [full_time_range_selector.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx#:~:text=IndexPattern), [full_time_range_selector.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx#:~:text=IndexPattern), [full_time_range_selector.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx#:~:text=IndexPattern), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPattern), [index_data_visualizer_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx#:~:text=IndexPattern), [full_time_range_selector.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/data_visualizer/target/types/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.d.ts#:~:text=IndexPattern)+ 23 more | - | + + + ## discover | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService) | - | +| | [use_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_index_pattern.tsx#:~:text=IndexPatternsContract), [use_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_index_pattern.tsx#:~:text=IndexPatternsContract), [resolve_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts#:~:text=IndexPatternsContract), [build_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/build_services.ts#:~:text=IndexPatternsContract), [build_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/build_services.ts#:~:text=IndexPatternsContract), [kibana_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/kibana_services.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts#:~:text=IndexPatternsContract), [popularize_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.ts#:~:text=IndexPatternsContract)+ 17 more | - | +| | [get_fields_to_show.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/get_fields_to_show.ts#:~:text=IndexPattern), [get_fields_to_show.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/get_fields_to_show.ts#:~:text=IndexPattern), [columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/columns.ts#:~:text=IndexPattern), [columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/columns.ts#:~:text=IndexPattern), [update_search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/helpers/update_search_source.ts#:~:text=IndexPattern), [update_search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/helpers/update_search_source.ts#:~:text=IndexPattern), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPattern), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPattern), [use_es_doc_search.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/services/use_es_doc_search.ts#:~:text=IndexPattern), [use_es_doc_search.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/services/use_es_doc_search.ts#:~:text=IndexPattern)+ 136 more | - | +| | [kibana_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/kibana_services.ts#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [field_name.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/field_name/field_name.tsx#:~:text=IndexPatternField), [field_name.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/field_name/field_name.tsx#:~:text=IndexPatternField), [table_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/table/table_cell_actions.tsx#:~:text=IndexPatternField), [table_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/table/table_cell_actions.tsx#:~:text=IndexPatternField), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/table/table.tsx#:~:text=IndexPatternField), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/table/table.tsx#:~:text=IndexPatternField), [discover_field_bucket.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx#:~:text=IndexPatternField)+ 92 more | - | +| | [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_app.tsx#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_app.tsx#:~:text=IndexPatternAttributes)+ 3 more | - | | | [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=create), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=create) | - | -| | [fetch_hits_in_interval.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/context/api/utils/fetch_hits_in_interval.ts#:~:text=fetch), [anchor.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/context/api/anchor.ts#:~:text=fetch) | 8.1 | +| | [anchor.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/context/services/anchor.ts#:~:text=fetch), [fetch_hits_in_interval.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/context/services/utils/fetch_hits_in_interval.ts#:~:text=fetch) | 8.1 | +| | [build_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/build_services.ts#:~:text=indexPatterns), [source_viewer.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/source_viewer/source_viewer.tsx#:~:text=indexPatterns), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_route.tsx#:~:text=indexPatterns), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_route.tsx#:~:text=indexPatterns), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_route.tsx#:~:text=indexPatterns), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/plugin.tsx#:~:text=indexPatterns) | - | | | [histogram.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/chart/histogram.tsx#:~:text=fieldFormats) | - | | | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=esFilters), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=esFilters), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=esFilters), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=esFilters), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=esFilters), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=esFilters), [get_context_url.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/get_context_url.tsx#:~:text=esFilters), [get_context_url.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/get_context_url.tsx#:~:text=esFilters), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/services/discover_state.ts#:~:text=esFilters), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/services/discover_state.ts#:~:text=esFilters)+ 17 more | 8.1 | -| | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [context.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/context/api/context.ts#:~:text=Filter), [context.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/context/api/context.ts#:~:text=Filter)+ 21 more | 8.1 | -| | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [context.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/context/api/context.ts#:~:text=Filter), [context.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/context/api/context.ts#:~:text=Filter)+ 21 more | 8.1 | +| | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/services/discover_state.ts#:~:text=Filter)+ 21 more | 8.1 | +| | [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_app.tsx#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_app.tsx#:~:text=IndexPatternAttributes)+ 3 more | - | +| | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/services/discover_state.ts#:~:text=Filter)+ 21 more | 8.1 | +| | [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService) | - | +| | [use_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_index_pattern.tsx#:~:text=IndexPatternsContract), [use_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_index_pattern.tsx#:~:text=IndexPatternsContract), [resolve_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts#:~:text=IndexPatternsContract), [build_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/build_services.ts#:~:text=IndexPatternsContract), [build_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/build_services.ts#:~:text=IndexPatternsContract), [kibana_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/kibana_services.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts#:~:text=IndexPatternsContract), [popularize_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.ts#:~:text=IndexPatternsContract)+ 17 more | - | +| | [get_fields_to_show.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/get_fields_to_show.ts#:~:text=IndexPattern), [get_fields_to_show.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/get_fields_to_show.ts#:~:text=IndexPattern), [columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/columns.ts#:~:text=IndexPattern), [columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/columns.ts#:~:text=IndexPattern), [update_search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/helpers/update_search_source.ts#:~:text=IndexPattern), [update_search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/helpers/update_search_source.ts#:~:text=IndexPattern), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPattern), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPattern), [use_es_doc_search.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/services/use_es_doc_search.ts#:~:text=IndexPattern), [use_es_doc_search.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/services/use_es_doc_search.ts#:~:text=IndexPattern)+ 136 more | - | +| | [kibana_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/kibana_services.ts#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [field_name.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/field_name/field_name.tsx#:~:text=IndexPatternField), [field_name.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/field_name/field_name.tsx#:~:text=IndexPatternField), [table_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/table/table_cell_actions.tsx#:~:text=IndexPatternField), [table_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/table/table_cell_actions.tsx#:~:text=IndexPatternField), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/table/table.tsx#:~:text=IndexPatternField), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/table/table.tsx#:~:text=IndexPatternField), [discover_field_bucket.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx#:~:text=IndexPatternField)+ 92 more | - | | | [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=create), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=create) | - | -| | [fetch_hits_in_interval.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/context/api/utils/fetch_hits_in_interval.ts#:~:text=fetch), [anchor.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/context/api/anchor.ts#:~:text=fetch) | 8.1 | -| | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [context.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/context/api/context.ts#:~:text=Filter), [context.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/angular/context/api/context.ts#:~:text=Filter)+ 21 more | 8.1 | +| | [anchor.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/context/services/anchor.ts#:~:text=fetch), [fetch_hits_in_interval.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/context/services/utils/fetch_hits_in_interval.ts#:~:text=fetch) | 8.1 | +| | [kibana_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/kibana_services.ts#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [field_name.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/field_name/field_name.tsx#:~:text=IndexPatternField), [field_name.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/field_name/field_name.tsx#:~:text=IndexPatternField), [table_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/table/table_cell_actions.tsx#:~:text=IndexPatternField), [table_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/table/table_cell_actions.tsx#:~:text=IndexPatternField), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/table/table.tsx#:~:text=IndexPatternField), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/table/table.tsx#:~:text=IndexPatternField), [discover_field_bucket.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_bucket.tsx#:~:text=IndexPatternField)+ 92 more | - | +| | [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/apps/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_app.tsx#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_app.tsx#:~:text=IndexPatternAttributes)+ 3 more | - | +| | [get_fields_to_show.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/get_fields_to_show.ts#:~:text=IndexPattern), [get_fields_to_show.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/get_fields_to_show.ts#:~:text=IndexPattern), [columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/columns.ts#:~:text=IndexPattern), [columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/columns.ts#:~:text=IndexPattern), [update_search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/helpers/update_search_source.ts#:~:text=IndexPattern), [update_search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/helpers/update_search_source.ts#:~:text=IndexPattern), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPattern), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=IndexPattern), [use_es_doc_search.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/services/use_es_doc_search.ts#:~:text=IndexPattern), [use_es_doc_search.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/services/use_es_doc_search.ts#:~:text=IndexPattern)+ 136 more | - | +| | [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/helpers/popularize_field.test.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService)+ 6 more | - | +| | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/types.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/services/discover_state.ts#:~:text=Filter)+ 21 more | 8.1 | | | [on_save_search.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx#:~:text=SavedObjectSaveModal), [on_save_search.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx#:~:text=SavedObjectSaveModal) | - | | | [saved_searches.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/saved_searches/saved_searches.ts#:~:text=SavedObjectLoader), [saved_searches.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/saved_searches/saved_searches.ts#:~:text=SavedObjectLoader), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/plugin.tsx#:~:text=SavedObjectLoader), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/plugin.tsx#:~:text=SavedObjectLoader) | - | -| | [_saved_search.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/saved_searches/_saved_search.ts#:~:text=SavedObject), [_saved_search.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/saved_searches/_saved_search.ts#:~:text=SavedObject) | - | +| | [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_route.tsx#:~:text=SavedObject), [_saved_search.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/saved_searches/_saved_search.ts#:~:text=SavedObject), [_saved_search.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/saved_searches/_saved_search.ts#:~:text=SavedObject), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_route.tsx#:~:text=SavedObject), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/apps/main/discover_main_route.tsx#:~:text=SavedObject) | - | | | [_saved_search.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/saved_searches/_saved_search.ts#:~:text=SavedObjectClass) | - | | | [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/saved_search_embeddable.tsx#:~:text=executeTriggerActions), [search_embeddable_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/embeddable/search_embeddable_factory.ts#:~:text=executeTriggerActions), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/plugin.tsx#:~:text=executeTriggerActions), [search_embeddable_factory.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/embeddable/search_embeddable_factory.d.ts#:~:text=executeTriggerActions) | - | | | [ui_settings.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/server/ui_settings.ts#:~:text=metric), [ui_settings.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/server/ui_settings.ts#:~:text=metric) | - | @@ -220,11 +264,20 @@ warning: This document is auto-generated and is meant to be viewed inside our ex +## fileUpload + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [kibana_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/file_upload/public/kibana_services.ts#:~:text=indexPatterns) | - | + + + ## fleet | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| | | [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx#:~:text=IFieldType), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx#:~:text=IFieldType), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx#:~:text=IFieldType), [query_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=IFieldType), [query_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=IFieldType), [query_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=IFieldType) | 8.1 | +| | [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx#:~:text=indexPatterns), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx#:~:text=indexPatterns), [query_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=indexPatterns), [query_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=indexPatterns) | - | | | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/list_page/index.tsx#:~:text=fieldFormats) | - | | | [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx#:~:text=IFieldType), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx#:~:text=IFieldType), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx#:~:text=IFieldType), [query_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=IFieldType), [query_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=IFieldType), [query_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=IFieldType) | 8.1 | | | [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx#:~:text=IFieldType), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx#:~:text=IFieldType), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx#:~:text=IFieldType), [query_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=IFieldType), [query_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=IFieldType), [query_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/query_bar.tsx#:~:text=IFieldType) | 8.1 | @@ -239,14 +292,28 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=getNonScriptedFields), [datasource.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields) | 8.1 | -| | [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=getNonScriptedFields), [datasource.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields) | 8.1 | -| | [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=getNonScriptedFields), [datasource.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields) | 8.1 | +| | [application.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/application.ts#:~:text=IndexPatternsContract), [application.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/application.ts#:~:text=IndexPatternsContract) | - | +| | [app_state.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/types/app_state.ts#:~:text=IndexPattern), [app_state.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/types/app_state.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [datasource.sagas.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.sagas.ts#:~:text=IndexPattern), [datasource.sagas.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.sagas.ts#:~:text=IndexPattern), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=IndexPattern), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=IndexPattern)+ 17 more | - | +| | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/plugin.ts#:~:text=indexPatterns) | - | +| | [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=esKuery), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=esKuery), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=esKuery) | 8.1 | +| | [application.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/application.ts#:~:text=IndexPatternsContract), [application.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/application.ts#:~:text=IndexPatternsContract) | - | +| | [app_state.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/types/app_state.ts#:~:text=IndexPattern), [app_state.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/types/app_state.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [datasource.sagas.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.sagas.ts#:~:text=IndexPattern), [datasource.sagas.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.sagas.ts#:~:text=IndexPattern), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=IndexPattern), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=IndexPattern)+ 17 more | - | +| | [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=getNonScriptedFields), [datasource.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields) | 8.1 | +| | [app_state.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/types/app_state.ts#:~:text=IndexPattern), [app_state.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/types/app_state.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [datasource.sagas.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.sagas.ts#:~:text=IndexPattern), [datasource.sagas.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.sagas.ts#:~:text=IndexPattern), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=IndexPattern), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=IndexPattern)+ 17 more | - | | | [save_modal.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/save_modal.tsx#:~:text=SavedObjectSaveModal), [save_modal.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/save_modal.tsx#:~:text=SavedObjectSaveModal) | - | +| | [listing_route.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/apps/listing_route.tsx#:~:text=settings), [listing_route.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/apps/listing_route.tsx#:~:text=settings) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/server/plugin.ts#:~:text=license%24) | - | +## home + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/home/public/plugin.ts#:~:text=indexPatterns) | - | + + + ## indexLifecycleManagement | Deprecated API | Reference location(s) | Remove By | @@ -255,13 +322,36 @@ warning: This document is auto-generated and is meant to be viewed inside our ex +## indexPatternEditor + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/open_editor.tsx#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/open_editor.tsx#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/types.ts#:~:text=IndexPattern), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/target/types/public/types.d.ts#:~:text=IndexPattern), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/target/types/public/types.d.ts#:~:text=IndexPattern) | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField) | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPatternSpec), [index_pattern_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [index_pattern_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [index_pattern_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [index_pattern_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx#:~:text=IndexPatternSpec), [index_pattern_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx#:~:text=IndexPatternSpec) | - | +| | [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/plugin.tsx#:~:text=indexPatterns), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/plugin.tsx#:~:text=indexPatterns) | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/open_editor.tsx#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/open_editor.tsx#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/types.ts#:~:text=IndexPattern), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/target/types/public/types.d.ts#:~:text=IndexPattern), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/target/types/public/types.d.ts#:~:text=IndexPattern) | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField) | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPatternSpec), [index_pattern_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [index_pattern_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [index_pattern_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [index_pattern_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx#:~:text=IndexPatternSpec), [index_pattern_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx#:~:text=IndexPatternSpec) | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField) | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/open_editor.tsx#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/open_editor.tsx#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/types.ts#:~:text=IndexPattern), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/target/types/public/types.d.ts#:~:text=IndexPattern), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/target/types/public/types.d.ts#:~:text=IndexPattern) | - | + + + ## indexPatternFieldEditor | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/shared_imports.ts#:~:text=IndexPattern), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPattern), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPattern), [field_editor_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx#:~:text=IndexPattern), [field_editor_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx#:~:text=IndexPattern), [remove_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts#:~:text=IndexPattern), [remove_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts#:~:text=IndexPattern), [open_delete_modal.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx#:~:text=IndexPattern), [open_delete_modal.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx#:~:text=IndexPattern), [delete_field_provider.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx#:~:text=IndexPattern)+ 9 more | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/shared_imports.ts#:~:text=IndexPatternField), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPatternField), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField) | - | | | [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName) | 8.1 | +| | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/plugin.ts#:~:text=indexPatterns), [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/plugin.ts#:~:text=indexPatterns) | - | | | [field_editor_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx#:~:text=fieldFormats), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=fieldFormats), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=fieldFormats), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=fieldFormats), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=fieldFormats), [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/plugin.ts#:~:text=fieldFormats), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=fieldFormats), [setup_environment.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/setup_environment.tsx#:~:text=fieldFormats) | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/shared_imports.ts#:~:text=IndexPattern), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPattern), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPattern), [field_editor_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx#:~:text=IndexPattern), [field_editor_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx#:~:text=IndexPattern), [remove_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts#:~:text=IndexPattern), [remove_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts#:~:text=IndexPattern), [open_delete_modal.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx#:~:text=IndexPattern), [open_delete_modal.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx#:~:text=IndexPattern), [delete_field_provider.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx#:~:text=IndexPattern)+ 9 more | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/shared_imports.ts#:~:text=IndexPatternField), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPatternField), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField) | - | | | [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName) | 8.1 | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/shared_imports.ts#:~:text=IndexPatternField), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPatternField), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField) | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/shared_imports.ts#:~:text=IndexPattern), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPattern), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPattern), [field_editor_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx#:~:text=IndexPattern), [field_editor_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx#:~:text=IndexPattern), [remove_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts#:~:text=IndexPattern), [remove_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts#:~:text=IndexPattern), [open_delete_modal.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx#:~:text=IndexPattern), [open_delete_modal.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx#:~:text=IndexPattern), [delete_field_provider.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx#:~:text=IndexPattern)+ 9 more | - | | | [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName) | 8.1 | @@ -270,24 +360,29 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=removeScriptedField), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=removeScriptedField) | 8.1 | -| | [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields) | 8.1 | -| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=getScriptedFields) | 8.1 | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.test.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.test.ts#:~:text=IndexPatternsContract), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternsContract), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternsContract) | - | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern)+ 36 more | - | +| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField)+ 16 more | - | | | [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [index_header.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx#:~:text=IIndexPattern), [index_header.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx#:~:text=IIndexPattern), [index_header.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts#:~:text=IIndexPattern), [index_header.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts#:~:text=IIndexPattern) | - | | | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType) | 8.1 | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts#:~:text=getKbnTypeNames), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts#:~:text=getKbnTypeNames) | 8.1 | +| | [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=indexPatterns), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=indexPatterns), [edit_index_pattern_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx#:~:text=indexPatterns), [edit_index_pattern_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx#:~:text=indexPatterns), [create_edit_field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx#:~:text=indexPatterns), [create_edit_field_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx#:~:text=indexPatterns), [create_edit_field_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx#:~:text=indexPatterns) | - | | | [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats) | - | | | [test_script.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx#:~:text=esQuery), [test_script.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx#:~:text=esQuery), [test_script.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx#:~:text=esQuery) | 8.1 | -| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=removeScriptedField), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=removeScriptedField) | 8.1 | -| | [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields) | 8.1 | -| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=getScriptedFields) | 8.1 | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.test.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.test.ts#:~:text=IndexPatternsContract), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternsContract), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternsContract) | - | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern)+ 36 more | - | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem) | - | +| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=removeScriptedField), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=removeScriptedField) | 8.1 | +| | [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields) | 8.1 | +| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=getScriptedFields) | 8.1 | | | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType) | 8.1 | +| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField)+ 16 more | - | | | [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [index_header.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx#:~:text=IIndexPattern), [index_header.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx#:~:text=IIndexPattern), [index_header.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts#:~:text=IIndexPattern), [index_header.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts#:~:text=IIndexPattern) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts#:~:text=getKbnTypeNames), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts#:~:text=getKbnTypeNames) | 8.1 | +| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField)+ 16 more | - | | | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType) | 8.1 | -| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=removeScriptedField), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=removeScriptedField) | 8.1 | -| | [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields) | 8.1 | -| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=getScriptedFields) | 8.1 | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern)+ 36 more | - | @@ -295,15 +390,21 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [resolved_log_source_configuration.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts#:~:text=IndexPatternsContract), [resolved_log_source_configuration.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts#:~:text=IndexPatternsContract), [resolved_log_source_configuration.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts#:~:text=IndexPatternsContract), [resolved_log_source_configuration.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts#:~:text=IndexPatternsContract), [log_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/containers/logs/log_source/log_source.ts#:~:text=IndexPatternsContract), [log_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/containers/logs/log_source/log_source.ts#:~:text=IndexPatternsContract), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=IndexPatternsContract), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=IndexPatternsContract), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=IndexPatternsContract), [index_patterns.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts#:~:text=IndexPatternsContract)+ 1 more | - | +| | [resolved_log_source_configuration.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts#:~:text=IndexPattern), [resolved_log_source_configuration.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts#:~:text=IndexPattern), [resolved_log_source_configuration.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts#:~:text=IndexPattern), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=IndexPattern), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=IndexPattern), [index_patterns.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts#:~:text=IndexPattern), [index_patterns.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts#:~:text=IndexPattern), [validation_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=IndexPattern), [validation_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=IndexPattern), [validation_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=IndexPattern)+ 2 more | - | | | [with_kuery_autocompletion.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx#:~:text=IIndexPattern), [with_kuery_autocompletion.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx#:~:text=IIndexPattern), [kuery_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx#:~:text=IIndexPattern), [kuery_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx#:~:text=IIndexPattern), [toolbar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx#:~:text=IIndexPattern), [toolbar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx#:~:text=IIndexPattern), [kuery.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/utils/kuery.ts#:~:text=IIndexPattern), [kuery.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/utils/kuery.ts#:~:text=IIndexPattern), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts#:~:text=IIndexPattern), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts#:~:text=IIndexPattern)+ 34 more | - | | | [custom_metric_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx#:~:text=IFieldType), [custom_metric_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx#:~:text=IFieldType), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx#:~:text=IFieldType), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx#:~:text=IFieldType), [custom_field_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx#:~:text=IFieldType), [custom_field_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx#:~:text=IFieldType), [waffle_group_by_controls.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx#:~:text=IFieldType), [waffle_group_by_controls.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx#:~:text=IFieldType), [metric.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx#:~:text=IFieldType), [metric.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx#:~:text=IFieldType)+ 46 more | 8.1 | +| | [editor.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/editor.tsx#:~:text=indexPatterns), [log_stream.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/components/log_stream/log_stream.tsx#:~:text=indexPatterns), [log_stream.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/components/log_stream/log_stream.tsx#:~:text=indexPatterns), [logs_overview_fetchers.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/utils/logs_overview_fetchers.ts#:~:text=indexPatterns), [redirect_to_node_logs.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx#:~:text=indexPatterns), [use_kibana_index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/hooks/use_kibana_index_patterns.ts#:~:text=indexPatterns), [page_providers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/page_providers.tsx#:~:text=indexPatterns), [logs_overview_fetches.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/utils/logs_overview_fetches.test.ts#:~:text=indexPatterns) | - | | | [kuery_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx#:~:text=esKuery), [kuery_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx#:~:text=esKuery), [kuery.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/utils/kuery.ts#:~:text=esKuery), [kuery.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/utils/kuery.ts#:~:text=esKuery), [kuery.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/utils/kuery.ts#:~:text=esKuery), [use_waffle_filters.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_filters.ts#:~:text=esKuery), [use_waffle_filters.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_filters.ts#:~:text=esKuery) | 8.1 | | | [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/containers/logs/log_stream/index.ts#:~:text=esQuery), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/containers/logs/log_stream/index.ts#:~:text=esQuery), [log_filter_state.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts#:~:text=esQuery), [log_filter_state.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts#:~:text=esQuery), [log_filter_state.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts#:~:text=esQuery) | 8.1 | | | [log_stream_embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/components/log_stream/log_stream_embeddable.tsx#:~:text=Filter), [log_stream_embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/components/log_stream/log_stream_embeddable.tsx#:~:text=Filter), [use_dataset_filtering.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_dataset_filtering.ts#:~:text=Filter), [use_dataset_filtering.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_dataset_filtering.ts#:~:text=Filter), [use_dataset_filtering.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_dataset_filtering.ts#:~:text=Filter) | 8.1 | | | [log_stream_embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/components/log_stream/log_stream_embeddable.tsx#:~:text=Filter), [log_stream_embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/components/log_stream/log_stream_embeddable.tsx#:~:text=Filter), [use_dataset_filtering.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_dataset_filtering.ts#:~:text=Filter), [use_dataset_filtering.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_dataset_filtering.ts#:~:text=Filter), [use_dataset_filtering.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_dataset_filtering.ts#:~:text=Filter) | 8.1 | +| | [resolved_log_source_configuration.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts#:~:text=IndexPatternsContract), [resolved_log_source_configuration.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts#:~:text=IndexPatternsContract), [resolved_log_source_configuration.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts#:~:text=IndexPatternsContract), [resolved_log_source_configuration.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts#:~:text=IndexPatternsContract), [log_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/containers/logs/log_source/log_source.ts#:~:text=IndexPatternsContract), [log_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/containers/logs/log_source/log_source.ts#:~:text=IndexPatternsContract), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=IndexPatternsContract), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=IndexPatternsContract), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=IndexPatternsContract), [index_patterns.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts#:~:text=IndexPatternsContract)+ 1 more | - | +| | [resolved_log_source_configuration.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts#:~:text=IndexPattern), [resolved_log_source_configuration.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts#:~:text=IndexPattern), [resolved_log_source_configuration.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts#:~:text=IndexPattern), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=IndexPattern), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=IndexPattern), [index_patterns.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts#:~:text=IndexPattern), [index_patterns.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts#:~:text=IndexPattern), [validation_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=IndexPattern), [validation_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=IndexPattern), [validation_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=IndexPattern)+ 2 more | - | | | [custom_metric_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx#:~:text=IFieldType), [custom_metric_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx#:~:text=IFieldType), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx#:~:text=IFieldType), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx#:~:text=IFieldType), [custom_field_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx#:~:text=IFieldType), [custom_field_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx#:~:text=IFieldType), [waffle_group_by_controls.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx#:~:text=IFieldType), [waffle_group_by_controls.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx#:~:text=IFieldType), [metric.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx#:~:text=IFieldType), [metric.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx#:~:text=IFieldType)+ 46 more | 8.1 | | | [with_kuery_autocompletion.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx#:~:text=IIndexPattern), [with_kuery_autocompletion.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/containers/with_kuery_autocompletion.tsx#:~:text=IIndexPattern), [kuery_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx#:~:text=IIndexPattern), [kuery_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/kuery_bar.tsx#:~:text=IIndexPattern), [toolbar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx#:~:text=IIndexPattern), [toolbar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx#:~:text=IIndexPattern), [kuery.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/utils/kuery.ts#:~:text=IIndexPattern), [kuery.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/utils/kuery.ts#:~:text=IIndexPattern), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts#:~:text=IIndexPattern), [use_metrics_explorer_data.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts#:~:text=IIndexPattern)+ 34 more | - | | | [custom_metric_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx#:~:text=IFieldType), [custom_metric_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx#:~:text=IFieldType), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx#:~:text=IFieldType), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx#:~:text=IFieldType), [custom_field_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx#:~:text=IFieldType), [custom_field_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/custom_field_panel.tsx#:~:text=IFieldType), [waffle_group_by_controls.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx#:~:text=IFieldType), [waffle_group_by_controls.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx#:~:text=IFieldType), [metric.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx#:~:text=IFieldType), [metric.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx#:~:text=IFieldType)+ 46 more | 8.1 | +| | [resolved_log_source_configuration.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts#:~:text=IndexPattern), [resolved_log_source_configuration.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts#:~:text=IndexPattern), [resolved_log_source_configuration.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/log_sources/resolved_log_source_configuration.ts#:~:text=IndexPattern), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=IndexPattern), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/common/dependency_mocks/index_patterns.ts#:~:text=IndexPattern), [index_patterns.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts#:~:text=IndexPattern), [index_patterns.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/target/types/common/dependency_mocks/index_patterns.d.ts#:~:text=IndexPattern), [validation_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=IndexPattern), [validation_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=IndexPattern), [validation_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/settings/validation_errors.ts#:~:text=IndexPattern)+ 2 more | - | | | [log_stream_embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/components/log_stream/log_stream_embeddable.tsx#:~:text=Filter), [log_stream_embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/components/log_stream/log_stream_embeddable.tsx#:~:text=Filter), [use_dataset_filtering.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_dataset_filtering.ts#:~:text=Filter), [use_dataset_filtering.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_dataset_filtering.ts#:~:text=Filter), [use_dataset_filtering.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/pages/logs/log_entry_rate/use_dataset_filtering.ts#:~:text=Filter) | 8.1 | | | [kibana_framework_adapter.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts#:~:text=spacesService), [kibana_framework_adapter.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts#:~:text=spacesService), [kibana_framework_adapter.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts#:~:text=spacesService), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/plugin.ts#:~:text=spacesService) | 7.16 | | | [kibana_framework_adapter.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts#:~:text=getSpaceId), [kibana_framework_adapter.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts#:~:text=getSpaceId), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/plugin.ts#:~:text=getSpaceId) | 7.16 | @@ -314,10 +415,19 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=IndexPatternsContract), [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=IndexPatternsContract), [phrase_filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.ts#:~:text=IndexPatternsContract), [phrase_filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.ts#:~:text=IndexPatternsContract), [filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts#:~:text=IndexPatternsContract), [filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts#:~:text=IndexPatternsContract), [phrase_filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts#:~:text=IndexPatternsContract), [phrase_filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts#:~:text=IndexPatternsContract), [phrase_filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts#:~:text=IndexPatternsContract), [phrase_filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts#:~:text=IndexPatternsContract)+ 4 more | - | +| | [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=IndexPattern), [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=IndexPattern), [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=IndexPattern), [create_search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/create_search_source.ts#:~:text=IndexPattern), [create_search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/create_search_source.ts#:~:text=IndexPattern), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPattern), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPattern), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPattern), [range_control_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx#:~:text=IndexPattern), [range_control_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx#:~:text=IndexPattern)+ 22 more | - | +| | [list_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/list_control_factory.ts#:~:text=IndexPatternField), [list_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/list_control_factory.ts#:~:text=IndexPatternField), [range_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/range_control_factory.ts#:~:text=IndexPatternField), [range_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/range_control_factory.ts#:~:text=IndexPatternField), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPatternField), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPatternField), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPatternField), [range_control_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx#:~:text=IndexPatternField), [range_control_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx#:~:text=IndexPatternField), [list_control_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx#:~:text=IndexPatternField)+ 2 more | - | | | [list_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/list_control_factory.ts#:~:text=fetch), [range_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/range_control_factory.ts#:~:text=fetch) | 8.1 | +| | [list_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/list_control_factory.ts#:~:text=indexPatterns), [range_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/range_control_factory.ts#:~:text=indexPatterns), [controls_tab.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/controls_tab.tsx#:~:text=indexPatterns) | - | | | [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=Filter), [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=Filter), [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=Filter), [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=Filter), [control.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/control.ts#:~:text=Filter), [control.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/control.ts#:~:text=Filter), [vis_controller.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/vis_controller.tsx#:~:text=Filter), [vis_controller.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/vis_controller.tsx#:~:text=Filter), [filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts#:~:text=Filter), [filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts#:~:text=Filter)+ 4 more | 8.1 | | | [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=Filter), [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=Filter), [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=Filter), [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=Filter), [control.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/control.ts#:~:text=Filter), [control.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/control.ts#:~:text=Filter), [vis_controller.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/vis_controller.tsx#:~:text=Filter), [vis_controller.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/vis_controller.tsx#:~:text=Filter), [filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts#:~:text=Filter), [filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts#:~:text=Filter)+ 4 more | 8.1 | +| | [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=IndexPatternsContract), [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=IndexPatternsContract), [phrase_filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.ts#:~:text=IndexPatternsContract), [phrase_filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.ts#:~:text=IndexPatternsContract), [filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts#:~:text=IndexPatternsContract), [filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts#:~:text=IndexPatternsContract), [phrase_filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts#:~:text=IndexPatternsContract), [phrase_filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts#:~:text=IndexPatternsContract), [phrase_filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts#:~:text=IndexPatternsContract), [phrase_filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.test.ts#:~:text=IndexPatternsContract)+ 4 more | - | +| | [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=IndexPattern), [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=IndexPattern), [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=IndexPattern), [create_search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/create_search_source.ts#:~:text=IndexPattern), [create_search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/create_search_source.ts#:~:text=IndexPattern), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPattern), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPattern), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPattern), [range_control_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx#:~:text=IndexPattern), [range_control_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx#:~:text=IndexPattern)+ 22 more | - | +| | [list_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/list_control_factory.ts#:~:text=IndexPatternField), [list_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/list_control_factory.ts#:~:text=IndexPatternField), [range_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/range_control_factory.ts#:~:text=IndexPatternField), [range_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/range_control_factory.ts#:~:text=IndexPatternField), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPatternField), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPatternField), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPatternField), [range_control_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx#:~:text=IndexPatternField), [range_control_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx#:~:text=IndexPatternField), [list_control_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx#:~:text=IndexPatternField)+ 2 more | - | | | [list_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/list_control_factory.ts#:~:text=fetch), [range_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/range_control_factory.ts#:~:text=fetch) | 8.1 | +| | [list_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/list_control_factory.ts#:~:text=IndexPatternField), [list_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/list_control_factory.ts#:~:text=IndexPatternField), [range_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/range_control_factory.ts#:~:text=IndexPatternField), [range_control_factory.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/range_control_factory.ts#:~:text=IndexPatternField), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPatternField), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPatternField), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPatternField), [range_control_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx#:~:text=IndexPatternField), [range_control_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx#:~:text=IndexPatternField), [list_control_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx#:~:text=IndexPatternField)+ 2 more | - | +| | [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=IndexPattern), [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=IndexPattern), [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=IndexPattern), [create_search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/create_search_source.ts#:~:text=IndexPattern), [create_search_source.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/create_search_source.ts#:~:text=IndexPattern), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPattern), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPattern), [field_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/field_select.tsx#:~:text=IndexPattern), [range_control_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx#:~:text=IndexPattern), [range_control_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx#:~:text=IndexPattern)+ 22 more | - | | | [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=Filter), [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=Filter), [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=Filter), [filter_manager.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.ts#:~:text=Filter), [control.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/control.ts#:~:text=Filter), [control.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/control.ts#:~:text=Filter), [vis_controller.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/vis_controller.tsx#:~:text=Filter), [vis_controller.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/vis_controller.tsx#:~:text=Filter), [filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts#:~:text=Filter), [filter_manager.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/input_control_vis/public/control/filter_manager/filter_manager.test.ts#:~:text=Filter)+ 4 more | 8.1 | @@ -326,6 +436,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [overview.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/kibana_overview/public/components/overview/overview.tsx#:~:text=indexPatterns) | - | | | [application.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/kibana_overview/public/application.tsx#:~:text=appBasePath) | - | @@ -334,15 +445,24 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#:~:text=IFieldType), [types.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#:~:text=IFieldType), [types.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#:~:text=IFieldType) | 8.1 | +| | [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPatternsService), [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPatternsService) | - | +| | [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=IndexPatternsContract), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/utils.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/utils.ts#:~:text=IndexPatternsContract), [loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts#:~:text=IndexPatternsContract), [loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts#:~:text=IndexPatternsContract), [embeddable_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts#:~:text=IndexPatternsContract), [embeddable_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts#:~:text=IndexPatternsContract), [loader.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts#:~:text=IndexPatternsContract), [loader.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts#:~:text=IndexPatternsContract)+ 5 more | - | +| | [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPattern), [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/existing_fields.d.ts#:~:text=IndexPattern), [existing_fields.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/existing_fields.d.ts#:~:text=IndexPattern), [loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts#:~:text=IndexPattern), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=IndexPattern)+ 13 more | - | +| | [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField) | - | +| | [datapanel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#:~:text=indexPatterns), [datapanel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#:~:text=indexPatterns), [datapanel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#:~:text=indexPatterns), [datapanel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#:~:text=indexPatterns), [indexpattern.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx#:~:text=indexPatterns), [lens_top_nav.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx#:~:text=indexPatterns), [lens_top_nav.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx#:~:text=indexPatterns), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/plugin.ts#:~:text=indexPatterns), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/plugin.ts#:~:text=indexPatterns) | - | | | [ranges.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.tsx#:~:text=fieldFormats), [droppable.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/droppable/droppable.test.ts#:~:text=fieldFormats) | - | | | [save_modal_container.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx#:~:text=esFilters), [save_modal_container.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx#:~:text=esFilters), [mocks.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/mocks.tsx#:~:text=esFilters), [mocks.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/mocks.tsx#:~:text=esFilters), [time_range_middleware.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/state_management/time_range_middleware.test.ts#:~:text=esFilters), [time_range_middleware.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/state_management/time_range_middleware.test.ts#:~:text=esFilters) | 8.1 | | | [validation.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts#:~:text=esKuery), [validation.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts#:~:text=esKuery), [validation.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts#:~:text=esKuery) | 8.1 | | | [validation.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts#:~:text=esQuery), [validation.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/validation.ts#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/index.tsx#:~:text=esQuery), [field_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#:~:text=esQuery), [field_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#:~:text=esQuery), [field_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#:~:text=esQuery), [datapanel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#:~:text=esQuery), [datapanel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx#:~:text=esQuery)+ 1 more | 8.1 | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/types.ts#:~:text=Filter), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=Filter), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=Filter), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/state_management/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/state_management/types.ts#:~:text=Filter), [field_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#:~:text=Filter), [field_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#:~:text=Filter)+ 16 more | 8.1 | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/types.ts#:~:text=Filter), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=Filter), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=Filter), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/state_management/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/state_management/types.ts#:~:text=Filter), [field_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#:~:text=Filter), [field_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#:~:text=Filter)+ 16 more | 8.1 | -| | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#:~:text=IFieldType), [types.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#:~:text=IFieldType), [types.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#:~:text=IFieldType) | 8.1 | -| | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/types.ts#:~:text=IFieldType), [types.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#:~:text=IFieldType), [types.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/public/indexpattern_datasource/types.d.ts#:~:text=IFieldType) | 8.1 | +| | [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPatternsService), [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPatternsService) | - | +| | [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=IndexPatternsContract), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/utils.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/utils.ts#:~:text=IndexPatternsContract), [loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts#:~:text=IndexPatternsContract), [loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts#:~:text=IndexPatternsContract), [embeddable_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts#:~:text=IndexPatternsContract), [embeddable_factory.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts#:~:text=IndexPatternsContract), [loader.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts#:~:text=IndexPatternsContract), [loader.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.test.ts#:~:text=IndexPatternsContract)+ 5 more | - | +| | [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPattern), [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/existing_fields.d.ts#:~:text=IndexPattern), [existing_fields.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/existing_fields.d.ts#:~:text=IndexPattern), [loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts#:~:text=IndexPattern), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=IndexPattern)+ 13 more | - | +| | [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField) | - | +| | [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/field_stats.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField), [field_stats.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/field_stats.d.ts#:~:text=IndexPatternField) | - | +| | [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPattern), [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.test.ts#:~:text=IndexPattern), [existing_fields.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/existing_fields.d.ts#:~:text=IndexPattern), [existing_fields.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/target/types/server/routes/existing_fields.d.ts#:~:text=IndexPattern), [loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/loader.ts#:~:text=IndexPattern), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=IndexPattern)+ 13 more | - | +| | [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPatternsService), [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPatternsService), [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPatternsService), [existing_fields.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/routes/existing_fields.ts#:~:text=IndexPatternsService) | - | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/types.ts#:~:text=Filter), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=Filter), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=Filter), [embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/embeddable/embeddable.tsx#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/state_management/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/state_management/types.ts#:~:text=Filter), [field_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#:~:text=Filter), [field_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/indexpattern_datasource/field_item.tsx#:~:text=Filter)+ 16 more | 8.1 | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/types.ts#:~:text=onAppLeave), [mounter.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/public/app_plugin/mounter.tsx#:~:text=onAppLeave) | - | | | [saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/migrations/saved_object_migrations.ts#:~:text=warning), [saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/lens/server/migrations/saved_object_migrations.ts#:~:text=warning) | - | @@ -378,14 +498,23 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IFieldType), [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IFieldType), [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=IFieldType), [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType)+ 96 more | 8.1 | +| | [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService) | - | +| | [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract) | - | +| | [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPattern), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPattern), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPattern), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#:~:text=IndexPattern), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPattern), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPattern), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPattern), [es_agg_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_agg_tooltip_property.ts#:~:text=IndexPattern)+ 95 more | - | +| | [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPatternField), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPatternField), [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IndexPatternField), [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IndexPatternField), [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=IndexPatternField), [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=IndexPatternField), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IndexPatternField), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IndexPatternField), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IndexPatternField), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IndexPatternField)+ 129 more | - | | | [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch) | 8.1 | +| | [kibana_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/kibana_services.ts#:~:text=indexPatterns) | - | | | [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=esFilters), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=esFilters), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=esFilters), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=esFilters), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=esFilters), [es_geo_line_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx#:~:text=esFilters), [es_geo_line_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx#:~:text=esFilters), [es_geo_line_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx#:~:text=esFilters), [app_sync.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/routes/map_page/url_state/app_sync.ts#:~:text=esFilters), [app_sync.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/routes/map_page/url_state/app_sync.ts#:~:text=esFilters)+ 9 more | 8.1 | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/reducers/map/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/reducers/map/types.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [vector_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx#:~:text=Filter), [vector_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx#:~:text=Filter), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=Filter), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=Filter)+ 106 more | 8.1 | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/reducers/map/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/reducers/map/types.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [vector_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx#:~:text=Filter), [vector_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx#:~:text=Filter), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=Filter), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=Filter)+ 106 more | 8.1 | -| | [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IFieldType), [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IFieldType), [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=IFieldType), [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType)+ 96 more | 8.1 | +| | [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService) | - | +| | [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract) | - | +| | [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPattern), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPattern), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPattern), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#:~:text=IndexPattern), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPattern), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPattern), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPattern), [es_agg_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_agg_tooltip_property.ts#:~:text=IndexPattern)+ 95 more | - | +| | [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPatternField), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPatternField), [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IndexPatternField), [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IndexPatternField), [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=IndexPatternField), [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=IndexPatternField), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IndexPatternField), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IndexPatternField), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IndexPatternField), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IndexPatternField)+ 129 more | - | | | [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch) | 8.1 | -| | [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IFieldType), [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IFieldType), [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=IFieldType), [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IFieldType)+ 96 more | 8.1 | +| | [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPatternField), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPatternField), [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IndexPatternField), [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IndexPatternField), [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=IndexPatternField), [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=IndexPatternField), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IndexPatternField), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IndexPatternField), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IndexPatternField), [index_pattern_util.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/index_pattern_util.ts#:~:text=IndexPatternField)+ 129 more | - | +| | [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPattern), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPattern), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPattern), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#:~:text=IndexPattern), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPattern), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPattern), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPattern), [es_agg_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_agg_tooltip_property.ts#:~:text=IndexPattern)+ 95 more | - | +| | [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService) | - | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/reducers/map/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/reducers/map/types.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [vector_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx#:~:text=Filter), [vector_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx#:~:text=Filter), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=Filter), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=Filter)+ 106 more | 8.1 | | | [maps_list_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/routes/list_page/maps_list_view.tsx#:~:text=settings), [maps_list_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/routes/list_page/maps_list_view.tsx#:~:text=settings), [maps_list_view.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/routes/list_page/maps_list_view.tsx#:~:text=settings) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/plugin.ts#:~:text=license%24) | - | @@ -397,14 +526,23 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [dependency_cache.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/dependency_cache.ts#:~:text=IndexPatternsContract), [dependency_cache.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/dependency_cache.ts#:~:text=IndexPatternsContract), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPatternsContract), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPatternsContract), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPatternsContract), [resolvers.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/routing/resolvers.ts#:~:text=IndexPatternsContract), [resolvers.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/routing/resolvers.ts#:~:text=IndexPatternsContract), [preconfigured_job_redirect.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts#:~:text=IndexPatternsContract), [preconfigured_job_redirect.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts#:~:text=IndexPatternsContract), [load_new_job_capabilities.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts#:~:text=IndexPatternsContract)+ 11 more | - | +| | [chart_loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts#:~:text=IndexPattern), [chart_loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts#:~:text=IndexPattern), [anomaly_charts_embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx#:~:text=IndexPattern), [anomaly_charts_embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx#:~:text=IndexPattern), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPattern), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPattern), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPattern), [field_format_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/field_format_service.ts#:~:text=IndexPattern), [field_format_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/field_format_service.ts#:~:text=IndexPattern), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/data_grid/common.ts#:~:text=IndexPattern)+ 60 more | - | | | [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IIndexPattern), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IIndexPattern), [new_job_capabilities_service_analytics.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts#:~:text=IIndexPattern), [new_job_capabilities_service_analytics.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts#:~:text=IIndexPattern), [data_recognizer.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/data_recognizer/data_recognizer.d.ts#:~:text=IIndexPattern), [data_recognizer.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/data_recognizer/data_recognizer.d.ts#:~:text=IIndexPattern), [new_job_capabilities_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts#:~:text=IIndexPattern), [new_job_capabilities_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts#:~:text=IIndexPattern), [load_new_job_capabilities.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts#:~:text=IIndexPattern), [load_new_job_capabilities.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts#:~:text=IIndexPattern)+ 24 more | - | | | [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/data_grid/common.ts#:~:text=IFieldType), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/data_grid/common.ts#:~:text=IFieldType), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.ts#:~:text=IFieldType), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.ts#:~:text=IFieldType), [field_types_utils.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#:~:text=IFieldType), [field_types_utils.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#:~:text=IFieldType), [field_types_utils.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#:~:text=IFieldType), [field_types_utils.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#:~:text=IFieldType), [field_types_utils.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#:~:text=IFieldType) | 8.1 | +| | [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPatternAttributes), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPatternAttributes), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts#:~:text=IndexPatternAttributes), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts#:~:text=IndexPatternAttributes), [rollup.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts#:~:text=IndexPatternAttributes), [rollup.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts#:~:text=IndexPatternAttributes), [rollup.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts#:~:text=IndexPatternAttributes), [data_recognizer.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts#:~:text=IndexPatternAttributes), [data_recognizer.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts#:~:text=IndexPatternAttributes), [kibana.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/common/types/kibana.ts#:~:text=IndexPatternAttributes)+ 3 more | - | +| | [index_data_visualizer.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/index_based/index_data_visualizer.tsx#:~:text=indexPatterns), [file_datavisualizer.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/datavisualizer/file_based/file_datavisualizer.tsx#:~:text=indexPatterns), [app.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/app.tsx#:~:text=indexPatterns), [app.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/app.tsx#:~:text=indexPatterns), [import_jobs_flyout.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/import_export_jobs/import_jobs_flyout/import_jobs_flyout.tsx#:~:text=indexPatterns), [anomaly_charts_embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx#:~:text=indexPatterns) | - | | | [dependency_cache.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/dependency_cache.ts#:~:text=fieldFormats), [app.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/app.tsx#:~:text=fieldFormats), [dependency_cache.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/target/types/public/application/util/dependency_cache.d.ts#:~:text=fieldFormats) | - | | | [apply_influencer_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_influencer_filters_action.tsx#:~:text=Filter), [apply_influencer_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_influencer_filters_action.tsx#:~:text=Filter), [apply_entity_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_entity_filters_action.tsx#:~:text=Filter), [apply_entity_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_entity_filters_action.tsx#:~:text=Filter) | 8.1 | +| | [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPatternAttributes), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPatternAttributes), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts#:~:text=IndexPatternAttributes), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts#:~:text=IndexPatternAttributes), [rollup.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts#:~:text=IndexPatternAttributes), [rollup.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts#:~:text=IndexPatternAttributes), [rollup.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts#:~:text=IndexPatternAttributes), [data_recognizer.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts#:~:text=IndexPatternAttributes), [data_recognizer.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts#:~:text=IndexPatternAttributes), [kibana.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/common/types/kibana.ts#:~:text=IndexPatternAttributes)+ 3 more | - | | | [apply_influencer_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_influencer_filters_action.tsx#:~:text=Filter), [apply_influencer_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_influencer_filters_action.tsx#:~:text=Filter), [apply_entity_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_entity_filters_action.tsx#:~:text=Filter), [apply_entity_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_entity_filters_action.tsx#:~:text=Filter) | 8.1 | +| | [dependency_cache.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/dependency_cache.ts#:~:text=IndexPatternsContract), [dependency_cache.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/dependency_cache.ts#:~:text=IndexPatternsContract), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPatternsContract), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPatternsContract), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPatternsContract), [resolvers.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/routing/resolvers.ts#:~:text=IndexPatternsContract), [resolvers.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/routing/resolvers.ts#:~:text=IndexPatternsContract), [preconfigured_job_redirect.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts#:~:text=IndexPatternsContract), [preconfigured_job_redirect.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/preconfigured_job_redirect.ts#:~:text=IndexPatternsContract), [load_new_job_capabilities.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts#:~:text=IndexPatternsContract)+ 11 more | - | +| | [chart_loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts#:~:text=IndexPattern), [chart_loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts#:~:text=IndexPattern), [anomaly_charts_embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx#:~:text=IndexPattern), [anomaly_charts_embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx#:~:text=IndexPattern), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPattern), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPattern), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPattern), [field_format_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/field_format_service.ts#:~:text=IndexPattern), [field_format_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/field_format_service.ts#:~:text=IndexPattern), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/data_grid/common.ts#:~:text=IndexPattern)+ 60 more | - | | | [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/data_grid/common.ts#:~:text=IFieldType), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/data_grid/common.ts#:~:text=IFieldType), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.ts#:~:text=IFieldType), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.ts#:~:text=IFieldType), [field_types_utils.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#:~:text=IFieldType), [field_types_utils.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#:~:text=IFieldType), [field_types_utils.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#:~:text=IFieldType), [field_types_utils.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#:~:text=IFieldType), [field_types_utils.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#:~:text=IFieldType) | 8.1 | | | [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IIndexPattern), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IIndexPattern), [new_job_capabilities_service_analytics.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts#:~:text=IIndexPattern), [new_job_capabilities_service_analytics.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service_analytics.ts#:~:text=IIndexPattern), [data_recognizer.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/data_recognizer/data_recognizer.d.ts#:~:text=IIndexPattern), [data_recognizer.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/data_recognizer/data_recognizer.d.ts#:~:text=IIndexPattern), [new_job_capabilities_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts#:~:text=IIndexPattern), [new_job_capabilities_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/new_job_capabilities/new_job_capabilities_service.ts#:~:text=IIndexPattern), [load_new_job_capabilities.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts#:~:text=IIndexPattern), [load_new_job_capabilities.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/new_job_capabilities/load_new_job_capabilities.ts#:~:text=IIndexPattern)+ 24 more | - | | | [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/data_grid/common.ts#:~:text=IFieldType), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/data_grid/common.ts#:~:text=IFieldType), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.ts#:~:text=IFieldType), [field_types_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.ts#:~:text=IFieldType), [field_types_utils.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#:~:text=IFieldType), [field_types_utils.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#:~:text=IFieldType), [field_types_utils.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#:~:text=IFieldType), [field_types_utils.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#:~:text=IFieldType), [field_types_utils.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/field_types_utils.test.ts#:~:text=IFieldType) | 8.1 | +| | [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPatternAttributes), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPatternAttributes), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts#:~:text=IndexPatternAttributes), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/data_frame_analytics/index_patterns.ts#:~:text=IndexPatternAttributes), [rollup.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts#:~:text=IndexPatternAttributes), [rollup.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts#:~:text=IndexPatternAttributes), [rollup.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/job_service/new_job_caps/rollup.ts#:~:text=IndexPatternAttributes), [data_recognizer.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts#:~:text=IndexPatternAttributes), [data_recognizer.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts#:~:text=IndexPatternAttributes), [kibana.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/common/types/kibana.ts#:~:text=IndexPatternAttributes)+ 3 more | - | +| | [chart_loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts#:~:text=IndexPattern), [chart_loader.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/common/chart_loader/chart_loader.ts#:~:text=IndexPattern), [anomaly_charts_embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx#:~:text=IndexPattern), [anomaly_charts_embeddable.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable.tsx#:~:text=IndexPattern), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPattern), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPattern), [index_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/util/index_utils.ts#:~:text=IndexPattern), [field_format_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/field_format_service.ts#:~:text=IndexPattern), [field_format_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/services/field_format_service.ts#:~:text=IndexPattern), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/data_grid/common.ts#:~:text=IndexPattern)+ 60 more | - | | | [apply_influencer_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_influencer_filters_action.tsx#:~:text=Filter), [apply_influencer_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_influencer_filters_action.tsx#:~:text=Filter), [apply_entity_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_entity_filters_action.tsx#:~:text=Filter), [apply_entity_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_entity_filters_action.tsx#:~:text=Filter) | 8.1 | | | [check_license.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/license/check_license.tsx#:~:text=license%24), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/plugin.ts#:~:text=license%24) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/plugin.ts#:~:text=license%24), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/plugin.ts#:~:text=license%24) | - | @@ -427,11 +565,19 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [rtl_helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx#:~:text=IndexPatternsContract), [rtl_helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx#:~:text=IndexPatternsContract) | - | +| | [lens_attributes.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts#:~:text=IndexPattern), [lens_attributes.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts#:~:text=IndexPattern), [lens_attributes.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts#:~:text=IndexPattern), [default_configs.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#:~:text=IndexPattern), [default_configs.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#:~:text=IndexPattern), [use_app_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx#:~:text=IndexPattern), [use_app_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern)+ 14 more | - | +| | [observability_index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts#:~:text=IndexPatternSpec), [observability_index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts#:~:text=IndexPatternSpec) | - | +| | [observability_index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts#:~:text=indexPatterns), [observability_index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts#:~:text=indexPatterns), [observability_index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts#:~:text=indexPatterns), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/pages/alerts/index.tsx#:~:text=indexPatterns), [observability_index_patterns.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts#:~:text=indexPatterns), [observability_index_patterns.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts#:~:text=indexPatterns), [observability_index_patterns.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts#:~:text=indexPatterns), [observability_index_patterns.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts#:~:text=indexPatterns), [observability_index_patterns.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts#:~:text=indexPatterns), [observability_index_patterns.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts#:~:text=indexPatterns)+ 5 more | - | | | [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=esFilters), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=esFilters), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=esFilters), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=esFilters), [filter_value_label.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx#:~:text=esFilters), [filter_value_label.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx#:~:text=esFilters), [filter_value_label.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx#:~:text=esFilters) | 8.1 | | | [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=ExistsFilter), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=ExistsFilter) | 8.1 | | | [filter_value_label.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx#:~:text=Filter), [filter_value_label.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx#:~:text=Filter) | 8.1 | | | [filter_value_label.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx#:~:text=Filter), [filter_value_label.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx#:~:text=Filter) | 8.1 | | | [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=ExistsFilter), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=ExistsFilter) | 8.1 | +| | [rtl_helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx#:~:text=IndexPatternsContract), [rtl_helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx#:~:text=IndexPatternsContract) | - | +| | [lens_attributes.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts#:~:text=IndexPattern), [lens_attributes.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts#:~:text=IndexPattern), [lens_attributes.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts#:~:text=IndexPattern), [default_configs.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#:~:text=IndexPattern), [default_configs.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#:~:text=IndexPattern), [use_app_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx#:~:text=IndexPattern), [use_app_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern)+ 14 more | - | +| | [observability_index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts#:~:text=IndexPatternSpec), [observability_index_patterns.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts#:~:text=IndexPatternSpec) | - | +| | [lens_attributes.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts#:~:text=IndexPattern), [lens_attributes.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts#:~:text=IndexPattern), [lens_attributes.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts#:~:text=IndexPattern), [default_configs.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#:~:text=IndexPattern), [default_configs.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts#:~:text=IndexPattern), [use_app_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx#:~:text=IndexPattern), [use_app_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/utils.ts#:~:text=IndexPattern)+ 14 more | - | | | [filter_value_label.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx#:~:text=Filter), [filter_value_label.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx#:~:text=Filter) | 8.1 | @@ -440,7 +586,11 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [scheduled_query_group_queries_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_table.tsx#:~:text=urlGenerator), [use_discover_link.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/common/hooks/use_discover_link.tsx#:~:text=urlGenerator) | - | +| | [use_scheduled_query_group_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts#:~:text=IndexPattern), [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=IndexPattern), [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=IndexPattern) | - | +| | [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=indexPatterns), [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=indexPatterns) | - | +| | [use_scheduled_query_group_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts#:~:text=IndexPattern), [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=IndexPattern), [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=IndexPattern) | - | +| | [use_scheduled_query_group_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_errors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_errors.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts#:~:text=IndexPattern), [use_scheduled_query_group_query_last_results.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/use_scheduled_query_group_query_last_results.ts#:~:text=IndexPattern), [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=IndexPattern), [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=IndexPattern) | - | +| | [scheduled_query_group_queries_status_table.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx#:~:text=urlGenerator), [use_discover_link.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/osquery/public/common/hooks/use_discover_link.tsx#:~:text=urlGenerator) | - | @@ -477,8 +627,11 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [generate_csv.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts#:~:text=IndexPattern), [generate_csv.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts#:~:text=IndexPattern) | - | | | [generate_csv.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts#:~:text=fieldsFromSource), [generate_csv.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts#:~:text=fieldsFromSource) | - | +| | [generate_csv.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts#:~:text=IndexPattern), [generate_csv.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts#:~:text=IndexPattern) | - | | | [generate_csv.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts#:~:text=fieldsFromSource), [generate_csv.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts#:~:text=fieldsFromSource) | - | +| | [generate_csv.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts#:~:text=IndexPattern), [generate_csv.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/generate_csv.ts#:~:text=IndexPattern) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/plugin.ts#:~:text=fieldFormats) | - | | | [get_csv_panel_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx#:~:text=license%24), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/public/share_context_menu/index.ts#:~:text=license%24), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/public/management/index.ts#:~:text=license%24), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/public/plugin.ts#:~:text=license%24), [get_csv_panel_action.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/public/panel_actions/get_csv_panel_action.test.ts#:~:text=license%24) | - | | | [reporting_usage_collector.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/usage/reporting_usage_collector.ts#:~:text=license%24), [core.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/core.ts#:~:text=license%24) | - | @@ -496,15 +649,33 @@ warning: This document is auto-generated and is meant to be viewed inside our ex +## savedObjects + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/types.ts#:~:text=IndexPatternsContract), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/types.ts#:~:text=IndexPatternsContract), [hydrate_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/helpers/hydrate_index_pattern.ts#:~:text=IndexPatternsContract), [hydrate_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/helpers/hydrate_index_pattern.ts#:~:text=IndexPatternsContract) | - | +| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/types.ts#:~:text=IndexPattern), [apply_es_resp.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts#:~:text=IndexPattern), [apply_es_resp.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts#:~:text=IndexPattern), [saved_object.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/saved_object.test.ts#:~:text=IndexPattern), [saved_object.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/saved_object.test.ts#:~:text=IndexPattern), [saved_object.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/saved_object.test.ts#:~:text=IndexPattern), [saved_object.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/saved_object.test.ts#:~:text=IndexPattern) | - | +| | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/plugin.ts#:~:text=indexPatterns), [saved_object.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/saved_object.test.ts#:~:text=indexPatterns), [saved_object.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/saved_object.test.ts#:~:text=indexPatterns) | - | +| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/types.ts#:~:text=IndexPatternsContract), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/types.ts#:~:text=IndexPatternsContract), [hydrate_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/helpers/hydrate_index_pattern.ts#:~:text=IndexPatternsContract), [hydrate_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/helpers/hydrate_index_pattern.ts#:~:text=IndexPatternsContract) | - | +| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/types.ts#:~:text=IndexPattern), [apply_es_resp.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts#:~:text=IndexPattern), [apply_es_resp.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts#:~:text=IndexPattern), [saved_object.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/saved_object.test.ts#:~:text=IndexPattern), [saved_object.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/saved_object.test.ts#:~:text=IndexPattern), [saved_object.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/saved_object.test.ts#:~:text=IndexPattern), [saved_object.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/saved_object.test.ts#:~:text=IndexPattern) | - | +| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/types.ts#:~:text=IndexPattern), [apply_es_resp.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts#:~:text=IndexPattern), [apply_es_resp.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/helpers/apply_es_resp.ts#:~:text=IndexPattern), [saved_object.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/saved_object.test.ts#:~:text=IndexPattern), [saved_object.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/saved_object.test.ts#:~:text=IndexPattern), [saved_object.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/saved_object.test.ts#:~:text=IndexPattern), [saved_object.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects/public/saved_object/saved_object.test.ts#:~:text=IndexPattern) | - | + + + ## savedObjectsManagement | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx#:~:text=IndexPatternsContract), [flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx#:~:text=IndexPatternsContract), [saved_objects_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx#:~:text=IndexPatternsContract), [saved_objects_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx#:~:text=IndexPatternsContract) | - | +| | [flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx#:~:text=IndexPattern), [flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx#:~:text=IndexPattern) | - | | | [create_field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/create_field_list.ts#:~:text=castEsToKbnFieldTypeName), [create_field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/create_field_list.ts#:~:text=castEsToKbnFieldTypeName) | 8.1 | +| | [saved_objects_table_page.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/saved_objects_table_page.tsx#:~:text=indexPatterns) | - | +| | [flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx#:~:text=IndexPatternsContract), [flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx#:~:text=IndexPatternsContract), [saved_objects_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx#:~:text=IndexPatternsContract), [saved_objects_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx#:~:text=IndexPatternsContract) | - | +| | [flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx#:~:text=IndexPattern), [flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx#:~:text=IndexPattern) | - | | | [create_field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/create_field_list.ts#:~:text=castEsToKbnFieldTypeName), [create_field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/create_field_list.ts#:~:text=castEsToKbnFieldTypeName) | 8.1 | +| | [flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx#:~:text=IndexPattern), [flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx#:~:text=IndexPattern) | - | | | [create_field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/create_field_list.ts#:~:text=castEsToKbnFieldTypeName), [create_field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/create_field_list.ts#:~:text=castEsToKbnFieldTypeName) | 8.1 | -| | [service_registry.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/services/service_registry.ts#:~:text=SavedObjectLoader), [service_registry.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/services/service_registry.ts#:~:text=SavedObjectLoader), [resolve_saved_objects.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts#:~:text=SavedObjectLoader), [resolve_saved_objects.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts#:~:text=SavedObjectLoader), [resolve_saved_objects.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts#:~:text=SavedObjectLoader), [resolve_saved_objects.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts#:~:text=SavedObjectLoader), [create_field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/create_field_list.ts#:~:text=SavedObjectLoader), [create_field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/create_field_list.ts#:~:text=SavedObjectLoader), [form.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/object_view/components/form.tsx#:~:text=SavedObjectLoader), [form.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/object_view/components/form.tsx#:~:text=SavedObjectLoader)+ 3 more | - | -| | [resolve_saved_objects.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts#:~:text=SavedObject), [resolve_saved_objects.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts#:~:text=SavedObject), [resolve_saved_objects.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts#:~:text=SavedObject), [resolve_saved_objects.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts#:~:text=SavedObject), [resolve_saved_objects.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts#:~:text=SavedObject), [resolve_saved_objects.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts#:~:text=SavedObject), [resolve_saved_objects.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts#:~:text=SavedObject), [resolve_saved_objects.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts#:~:text=SavedObject), [resolve_saved_objects.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts#:~:text=SavedObject), [resolve_saved_objects.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts#:~:text=SavedObject) | - | +| | [service_registry.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/services/service_registry.ts#:~:text=SavedObjectLoader), [service_registry.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/services/service_registry.ts#:~:text=SavedObjectLoader), [create_field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/create_field_list.ts#:~:text=SavedObjectLoader), [create_field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/create_field_list.ts#:~:text=SavedObjectLoader), [form.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/object_view/components/form.tsx#:~:text=SavedObjectLoader), [form.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/management_section/object_view/components/form.tsx#:~:text=SavedObjectLoader) | - | | | [resolve_import_errors.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/resolve_import_errors.ts#:~:text=createNewCopy) | - | | | [resolve_import_errors.ts](https://github.com/elastic/kibana/tree/master/src/plugins/saved_objects_management/public/lib/resolve_import_errors.ts#:~:text=createNewCopy) | - | @@ -539,10 +710,13 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [edit_role_page.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx#:~:text=IndexPatternsContract), [edit_role_page.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx#:~:text=IndexPatternsContract), [edit_role_page.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx#:~:text=IndexPatternsContract), [edit_role_page.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/target/types/public/management/roles/edit_role/edit_role_page.d.ts#:~:text=IndexPatternsContract), [edit_role_page.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/target/types/public/management/roles/edit_role/edit_role_page.d.ts#:~:text=IndexPatternsContract) | - | +| | [roles_management_app.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/management/roles/roles_management_app.tsx#:~:text=indexPatterns) | - | +| | [edit_role_page.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx#:~:text=IndexPatternsContract), [edit_role_page.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx#:~:text=IndexPatternsContract), [edit_role_page.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx#:~:text=IndexPatternsContract), [edit_role_page.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/target/types/public/management/roles/edit_role/edit_role_page.d.ts#:~:text=IndexPatternsContract), [edit_role_page.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/target/types/public/management/roles/edit_role/edit_role_page.d.ts#:~:text=IndexPatternsContract) | - | | | [disable_ui_capabilities.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/authorization/disable_ui_capabilities.ts#:~:text=requiredRoles) | - | | | [disable_ui_capabilities.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/authorization/disable_ui_capabilities.ts#:~:text=requiredRoles) | - | -| | [plugin.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/plugin.tsx#:~:text=license%24) | - | | | [license_service.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode), [license_service.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode), [license_service.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode) | - | +| | [plugin.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/plugin.tsx#:~:text=license%24) | - | | | [license_service.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode), [license_service.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode), [license_service.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/plugin.ts#:~:text=license%24) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/plugin.ts#:~:text=spacesService), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/plugin.ts#:~:text=spacesService), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/plugin.ts#:~:text=spacesService), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/plugin.ts#:~:text=spacesService) | 7.16 | @@ -558,13 +732,20 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| | | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/overview/containers/overview_cti_links/index.tsx#:~:text=dashboardUrlGenerator) | - | +| | [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [list_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx#:~:text=IndexPattern), [list_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx#:~:text=IndexPattern)+ 10 more | - | +| | [field_name_cell.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx#:~:text=IndexPatternField), [field_name_cell.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx#:~:text=IndexPatternField) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=IIndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=IIndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#:~:text=IIndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#:~:text=IIndexPattern), [action.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#:~:text=IIndexPattern), [action.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx#:~:text=IIndexPattern)+ 76 more | - | +| | [middleware.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=indexPatterns), [plugin.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/plugin.tsx#:~:text=indexPatterns), [dependencies_start_mock.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/mock/endpoint/dependencies_start_mock.ts#:~:text=indexPatterns) | - | | | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx#:~:text=esFilters), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx#:~:text=esFilters), [epic.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts#:~:text=esFilters), [epic.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts#:~:text=esFilters), [epic.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts#:~:text=esFilters), [epic.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts#:~:text=esFilters), [epic.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts#:~:text=esFilters), [epic.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts#:~:text=esFilters), [epic.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts#:~:text=esFilters), [epic.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/epic.ts#:~:text=esFilters)+ 15 more | 8.1 | | | [expandable_network.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/side_panel/network_details/expandable_network.tsx#:~:text=esQuery), [expandable_network.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/side_panel/network_details/expandable_network.tsx#:~:text=esQuery), [events_viewer.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx#:~:text=esQuery), [events_viewer.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/events_viewer/events_viewer.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/top_n/index.tsx#:~:text=esQuery)+ 30 more | 8.1 | -| | [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter)+ 156 more | 8.1 | -| | [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter)+ 156 more | 8.1 | +| | [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter)+ 158 more | 8.1 | +| | [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter)+ 158 more | 8.1 | +| | [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [list_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx#:~:text=IndexPattern), [list_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx#:~:text=IndexPattern)+ 10 more | - | +| | [field_name_cell.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx#:~:text=IndexPatternField), [field_name_cell.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx#:~:text=IndexPatternField) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=IIndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=IIndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#:~:text=IIndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts#:~:text=IIndexPattern), [action.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#:~:text=IIndexPattern), [action.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/containers/source/index.tsx#:~:text=IIndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx#:~:text=IIndexPattern)+ 76 more | - | -| | [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter)+ 156 more | 8.1 | +| | [field_name_cell.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx#:~:text=IndexPatternField), [field_name_cell.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/event_details/table/field_name_cell.tsx#:~:text=IndexPatternField) | - | +| | [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [entry_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx#:~:text=IndexPattern), [list_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx#:~:text=IndexPattern), [list_item.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx#:~:text=IndexPattern)+ 10 more | - | +| | [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [store.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/types/timeline/store.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [model.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/model.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [selectors.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter), [actions.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/public/timelines/store/timeline/actions.ts#:~:text=Filter)+ 158 more | 8.1 | | | [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [isolation.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts#:~:text=mode), [isolation.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts#:~:text=mode)+ 2 more | - | | | [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [isolation.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts#:~:text=mode), [isolation.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/endpoint/routes/actions/isolation.test.ts#:~:text=mode)+ 2 more | - | | | [create_signals_migration_route.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.ts#:~:text=authc), [delete_signals_migration_route.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts#:~:text=authc), [finalize_signals_migration_route.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts#:~:text=authc), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts#:~:text=authc) | - | @@ -597,14 +778,20 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [geo_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx#:~:text=IndexPatternsContract), [geo_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx#:~:text=IndexPatternsContract), [geo_index_pattern_select.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts#:~:text=IndexPatternsContract), [geo_index_pattern_select.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts#:~:text=IndexPatternsContract) | - | +| | [geo_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx#:~:text=IndexPattern), [geo_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx#:~:text=IndexPattern), [geo_index_pattern_select.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts#:~:text=IndexPattern), [geo_index_pattern_select.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts#:~:text=IndexPattern) | - | | | [entity_index_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx#:~:text=IIndexPattern), [entity_index_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx#:~:text=IIndexPattern), [entity_index_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx#:~:text=IIndexPattern), [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=IIndexPattern), [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=IIndexPattern), [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=IIndexPattern)+ 1 more | - | | | [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/single_field_select.d.ts#:~:text=IFieldType), [single_field_select.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/single_field_select.d.ts#:~:text=IFieldType)+ 16 more | 8.1 | +| | [entity_index_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx#:~:text=indexPatterns), [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=indexPatterns), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=indexPatterns), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=indexPatterns), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=indexPatterns) | - | | | [expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.tsx#:~:text=fieldFormats) | - | | | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=esKuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=esKuery) | 8.1 | | | [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=esQuery), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=esQuery) | 8.1 | +| | [geo_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx#:~:text=IndexPatternsContract), [geo_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx#:~:text=IndexPatternsContract), [geo_index_pattern_select.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts#:~:text=IndexPatternsContract), [geo_index_pattern_select.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts#:~:text=IndexPatternsContract) | - | +| | [geo_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx#:~:text=IndexPattern), [geo_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx#:~:text=IndexPattern), [geo_index_pattern_select.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts#:~:text=IndexPattern), [geo_index_pattern_select.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts#:~:text=IndexPattern) | - | | | [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/single_field_select.d.ts#:~:text=IFieldType), [single_field_select.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/single_field_select.d.ts#:~:text=IFieldType)+ 16 more | 8.1 | | | [entity_index_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx#:~:text=IIndexPattern), [entity_index_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx#:~:text=IIndexPattern), [entity_index_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx#:~:text=IIndexPattern), [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=IIndexPattern), [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=IIndexPattern), [boundary_index_expression.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=IIndexPattern), [index.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx#:~:text=IIndexPattern)+ 1 more | - | | | [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/single_field_select.tsx#:~:text=IFieldType), [single_field_select.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/single_field_select.d.ts#:~:text=IFieldType), [single_field_select.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/single_field_select.d.ts#:~:text=IFieldType)+ 16 more | 8.1 | +| | [geo_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx#:~:text=IndexPattern), [geo_index_pattern_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx#:~:text=IndexPattern), [geo_index_pattern_select.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts#:~:text=IndexPattern), [geo_index_pattern_select.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts#:~:text=IndexPattern) | - | @@ -624,25 +811,23 @@ warning: This document is auto-generated and is meant to be viewed inside our ex -## timelion - -| Deprecated API | Reference location(s) | Remove By | -| ---------------|-----------|-----------| -| | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/timelion/public/plugin.ts#:~:text=esFilters), [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/timelion/public/plugin.ts#:~:text=esFilters) | 8.1 | -| | [saved_sheets.ts](https://github.com/elastic/kibana/tree/master/src/plugins/timelion/public/services/saved_sheets.ts#:~:text=SavedObjectLoader), [saved_sheets.ts](https://github.com/elastic/kibana/tree/master/src/plugins/timelion/public/services/saved_sheets.ts#:~:text=SavedObjectLoader) | - | -| | [_saved_sheet.ts](https://github.com/elastic/kibana/tree/master/src/plugins/timelion/public/services/_saved_sheet.ts#:~:text=SavedObjectClass) | - | -| | [application.ts](https://github.com/elastic/kibana/tree/master/src/plugins/timelion/public/application.ts#:~:text=appBasePath) | - | - - - ## transform | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts#:~:text=IndexPatternsContract), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts#:~:text=IndexPatternsContract), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts#:~:text=IndexPatternsContract) | - | +| | [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/common/types/index_pattern.ts#:~:text=IndexPattern), [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/common/types/index_pattern.ts#:~:text=IndexPattern), [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/common/types/index_pattern.ts#:~:text=IndexPattern), [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/common/types/index_pattern.ts#:~:text=IndexPattern), [wizard.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx#:~:text=IndexPattern), [wizard.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx#:~:text=IndexPattern), [get_pivot_dropdown_options.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/get_pivot_dropdown_options.ts#:~:text=IndexPattern), [get_pivot_dropdown_options.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/get_pivot_dropdown_options.ts#:~:text=IndexPattern), [filter_agg_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.tsx#:~:text=IndexPattern), [filter_agg_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.tsx#:~:text=IndexPattern)+ 10 more | - | | | [es_index_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/services/es_index_service.ts#:~:text=IIndexPattern), [es_index_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/services/es_index_service.ts#:~:text=IIndexPattern), [transforms.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/server/routes/api/transforms.ts#:~:text=IIndexPattern), [transforms.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/server/routes/api/transforms.ts#:~:text=IIndexPattern) | - | +| | [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts#:~:text=IndexPatternAttributes), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts#:~:text=IndexPatternAttributes) | - | +| | [step_create_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx#:~:text=indexPatterns), [step_details_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx#:~:text=indexPatterns), [use_search_items.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/hooks/use_search_items/use_search_items.ts#:~:text=indexPatterns), [use_clone_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/transform_management/components/action_clone/use_clone_action.tsx#:~:text=indexPatterns), [use_action_discover.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/transform_management/components/action_discover/use_action_discover.tsx#:~:text=indexPatterns), [edit_transform_flyout_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/edit_transform_flyout_form.tsx#:~:text=indexPatterns), [use_edit_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/transform_management/components/action_edit/use_edit_action.tsx#:~:text=indexPatterns) | - | | | [use_search_bar.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_search_bar.ts#:~:text=esKuery), [use_search_bar.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_search_bar.ts#:~:text=esKuery), [use_search_bar.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_search_bar.ts#:~:text=esKuery) | 8.1 | | | [use_search_bar.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_search_bar.ts#:~:text=esQuery), [use_search_bar.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/hooks/use_search_bar.ts#:~:text=esQuery), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts#:~:text=esQuery), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts#:~:text=esQuery), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts#:~:text=esQuery) | 8.1 | +| | [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts#:~:text=IndexPatternAttributes), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts#:~:text=IndexPatternAttributes) | - | +| | [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts#:~:text=IndexPatternsContract), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts#:~:text=IndexPatternsContract), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts#:~:text=IndexPatternsContract) | - | +| | [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/common/types/index_pattern.ts#:~:text=IndexPattern), [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/common/types/index_pattern.ts#:~:text=IndexPattern), [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/common/types/index_pattern.ts#:~:text=IndexPattern), [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/common/types/index_pattern.ts#:~:text=IndexPattern), [wizard.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx#:~:text=IndexPattern), [wizard.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx#:~:text=IndexPattern), [get_pivot_dropdown_options.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/get_pivot_dropdown_options.ts#:~:text=IndexPattern), [get_pivot_dropdown_options.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/get_pivot_dropdown_options.ts#:~:text=IndexPattern), [filter_agg_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.tsx#:~:text=IndexPattern), [filter_agg_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.tsx#:~:text=IndexPattern)+ 10 more | - | | | [es_index_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/services/es_index_service.ts#:~:text=IIndexPattern), [es_index_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/services/es_index_service.ts#:~:text=IIndexPattern), [transforms.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/server/routes/api/transforms.ts#:~:text=IIndexPattern), [transforms.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/server/routes/api/transforms.ts#:~:text=IIndexPattern) | - | +| | [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts#:~:text=IndexPatternAttributes), [common.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts#:~:text=IndexPatternAttributes) | - | +| | [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/common/types/index_pattern.ts#:~:text=IndexPattern), [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/common/types/index_pattern.ts#:~:text=IndexPattern), [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/common/types/index_pattern.ts#:~:text=IndexPattern), [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/common/types/index_pattern.ts#:~:text=IndexPattern), [wizard.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx#:~:text=IndexPattern), [wizard.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx#:~:text=IndexPattern), [get_pivot_dropdown_options.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/get_pivot_dropdown_options.ts#:~:text=IndexPattern), [get_pivot_dropdown_options.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/get_pivot_dropdown_options.ts#:~:text=IndexPattern), [filter_agg_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.tsx#:~:text=IndexPattern), [filter_agg_form.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.tsx#:~:text=IndexPattern)+ 10 more | - | | | [license.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/transform/server/services/license.ts#:~:text=license%24) | - | @@ -651,10 +836,21 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [external_links.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/upgrade_assistant/public/application/components/overview/fix_deprecation_logs_step/external_links.tsx#:~:text=indexPatterns) | - | | | [reindex_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts#:~:text=license%24), [reindex_service.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts#:~:text=license%24), [reindex_service.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts#:~:text=license%24) | - | +## uptime + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/uptime/public/state/reducers/index_pattern.ts#:~:text=IndexPattern), [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/uptime/public/state/reducers/index_pattern.ts#:~:text=IndexPattern), [update_kuery_string.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/uptime/public/hooks/update_kuery_string.ts#:~:text=IndexPattern), [update_kuery_string.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/uptime/public/hooks/update_kuery_string.ts#:~:text=IndexPattern) | - | +| | [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/uptime/public/state/reducers/index_pattern.ts#:~:text=IndexPattern), [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/uptime/public/state/reducers/index_pattern.ts#:~:text=IndexPattern), [update_kuery_string.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/uptime/public/hooks/update_kuery_string.ts#:~:text=IndexPattern), [update_kuery_string.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/uptime/public/hooks/update_kuery_string.ts#:~:text=IndexPattern) | - | +| | [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/uptime/public/state/reducers/index_pattern.ts#:~:text=IndexPattern), [index_pattern.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/uptime/public/state/reducers/index_pattern.ts#:~:text=IndexPattern), [update_kuery_string.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/uptime/public/hooks/update_kuery_string.ts#:~:text=IndexPattern), [update_kuery_string.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/uptime/public/hooks/update_kuery_string.ts#:~:text=IndexPattern) | - | + + + ## urlDrilldown | Deprecated API | Reference location(s) | Remove By | @@ -669,8 +865,14 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [agg_type_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts#:~:text=IndexPattern), [agg_type_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts#:~:text=IndexPattern), [agg_type_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts#:~:text=IndexPattern), [editor_config.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/utils/editor_config.ts#:~:text=IndexPattern), [editor_config.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/utils/editor_config.ts#:~:text=IndexPattern), [agg_params_helper.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_params_helper.ts#:~:text=IndexPattern), [agg_params_helper.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_params_helper.ts#:~:text=IndexPattern), [agg_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_select.tsx#:~:text=IndexPattern), [agg_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_select.tsx#:~:text=IndexPattern), [agg_params.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_params.tsx#:~:text=IndexPattern)+ 7 more | - | +| | [agg_type_field_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts#:~:text=IndexPatternField), [agg_type_field_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts#:~:text=IndexPatternField), [agg_type_field_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts#:~:text=IndexPatternField), [agg_param_props.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_param_props.ts#:~:text=IndexPatternField), [agg_param_props.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_param_props.ts#:~:text=IndexPatternField), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/controls/field.tsx#:~:text=IndexPatternField), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/controls/field.tsx#:~:text=IndexPatternField), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/controls/field.tsx#:~:text=IndexPatternField), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/controls/field.tsx#:~:text=IndexPatternField), [top_field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/controls/top_field.tsx#:~:text=IndexPatternField)+ 14 more | - | | | [reducers.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/sidebar/state/reducers.ts#:~:text=toJSON), [reducers.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/sidebar/state/reducers.ts#:~:text=toJSON), [reducers.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/sidebar/state/reducers.ts#:~:text=toJSON), [sidebar.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/sidebar/sidebar.tsx#:~:text=toJSON) | 8.1 | +| | [agg_type_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts#:~:text=IndexPattern), [agg_type_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts#:~:text=IndexPattern), [agg_type_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts#:~:text=IndexPattern), [editor_config.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/utils/editor_config.ts#:~:text=IndexPattern), [editor_config.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/utils/editor_config.ts#:~:text=IndexPattern), [agg_params_helper.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_params_helper.ts#:~:text=IndexPattern), [agg_params_helper.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_params_helper.ts#:~:text=IndexPattern), [agg_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_select.tsx#:~:text=IndexPattern), [agg_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_select.tsx#:~:text=IndexPattern), [agg_params.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_params.tsx#:~:text=IndexPattern)+ 7 more | - | +| | [agg_type_field_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts#:~:text=IndexPatternField), [agg_type_field_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts#:~:text=IndexPatternField), [agg_type_field_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts#:~:text=IndexPatternField), [agg_param_props.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_param_props.ts#:~:text=IndexPatternField), [agg_param_props.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_param_props.ts#:~:text=IndexPatternField), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/controls/field.tsx#:~:text=IndexPatternField), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/controls/field.tsx#:~:text=IndexPatternField), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/controls/field.tsx#:~:text=IndexPatternField), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/controls/field.tsx#:~:text=IndexPatternField), [top_field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/controls/top_field.tsx#:~:text=IndexPatternField)+ 14 more | - | | | [reducers.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/sidebar/state/reducers.ts#:~:text=toJSON), [reducers.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/sidebar/state/reducers.ts#:~:text=toJSON), [reducers.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/sidebar/state/reducers.ts#:~:text=toJSON), [sidebar.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/sidebar/sidebar.tsx#:~:text=toJSON) | 8.1 | +| | [agg_type_field_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts#:~:text=IndexPatternField), [agg_type_field_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts#:~:text=IndexPatternField), [agg_type_field_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_field_filters.ts#:~:text=IndexPatternField), [agg_param_props.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_param_props.ts#:~:text=IndexPatternField), [agg_param_props.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_param_props.ts#:~:text=IndexPatternField), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/controls/field.tsx#:~:text=IndexPatternField), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/controls/field.tsx#:~:text=IndexPatternField), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/controls/field.tsx#:~:text=IndexPatternField), [field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/controls/field.tsx#:~:text=IndexPatternField), [top_field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/controls/top_field.tsx#:~:text=IndexPatternField)+ 14 more | - | +| | [agg_type_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts#:~:text=IndexPattern), [agg_type_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts#:~:text=IndexPattern), [agg_type_filters.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/agg_filters/agg_type_filters.ts#:~:text=IndexPattern), [editor_config.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/utils/editor_config.ts#:~:text=IndexPattern), [editor_config.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/utils/editor_config.ts#:~:text=IndexPattern), [agg_params_helper.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_params_helper.ts#:~:text=IndexPattern), [agg_params_helper.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_params_helper.ts#:~:text=IndexPattern), [agg_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_select.tsx#:~:text=IndexPattern), [agg_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_select.tsx#:~:text=IndexPattern), [agg_params.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/agg_params.tsx#:~:text=IndexPattern)+ 7 more | - | | | [sidebar_title.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx#:~:text=SavedObject), [sidebar_title.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx#:~:text=SavedObject), [sidebar_title.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx#:~:text=SavedObject), [sidebar.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/sidebar/sidebar.tsx#:~:text=SavedObject), [sidebar.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/public/components/sidebar/sidebar.tsx#:~:text=SavedObject), [sidebar.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/target/types/public/components/sidebar/sidebar.d.ts#:~:text=SavedObject), [sidebar.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/target/types/public/components/sidebar/sidebar.d.ts#:~:text=SavedObject), [sidebar_title.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/target/types/public/components/sidebar/sidebar_title.d.ts#:~:text=SavedObject), [sidebar_title.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/target/types/public/components/sidebar/sidebar_title.d.ts#:~:text=SavedObject), [sidebar_title.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_default_editor/target/types/public/components/sidebar/sidebar_title.d.ts#:~:text=SavedObject) | - | @@ -679,7 +881,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_metric/public/plugin.ts#:~:text=fieldFormats) | - | +| | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/metric/public/plugin.ts#:~:text=fieldFormats) | - | @@ -696,8 +898,11 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_table/public/plugin.ts#:~:text=fieldFormats) | - | -| | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_table/public/plugin.ts#:~:text=AsyncPlugin), [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_table/public/plugin.ts#:~:text=AsyncPlugin), [plugin.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_table/target/types/public/plugin.d.ts#:~:text=AsyncPlugin), [plugin.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_table/target/types/public/plugin.d.ts#:~:text=AsyncPlugin) | - | +| | [table_vis_controller.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/table/public/legacy/table_vis_controller.test.ts#:~:text=IndexPattern), [table_vis_controller.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/table/public/legacy/table_vis_controller.test.ts#:~:text=IndexPattern) | - | +| | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/table/public/plugin.ts#:~:text=fieldFormats) | - | +| | [table_vis_controller.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/table/public/legacy/table_vis_controller.test.ts#:~:text=IndexPattern), [table_vis_controller.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/table/public/legacy/table_vis_controller.test.ts#:~:text=IndexPattern) | - | +| | [table_vis_controller.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/table/public/legacy/table_vis_controller.test.ts#:~:text=IndexPattern), [table_vis_controller.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/table/public/legacy/table_vis_controller.test.ts#:~:text=IndexPattern) | - | +| | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/table/public/plugin.ts#:~:text=AsyncPlugin), [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/table/public/plugin.ts#:~:text=AsyncPlugin), [plugin.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/table/target/types/public/plugin.d.ts#:~:text=AsyncPlugin), [plugin.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/table/target/types/public/plugin.d.ts#:~:text=AsyncPlugin) | - | @@ -705,12 +910,15 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [timelion_vis_component.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/components/timelion_vis_component.tsx#:~:text=RangeFilterParams), [timelion_vis_component.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/components/timelion_vis_component.tsx#:~:text=RangeFilterParams), [timelion_vis_renderer.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/timelion_vis_renderer.tsx#:~:text=RangeFilterParams), [timelion_vis_renderer.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/timelion_vis_renderer.tsx#:~:text=RangeFilterParams), [timelion_vis_component.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/legacy/timelion_vis_component.tsx#:~:text=RangeFilterParams), [timelion_vis_component.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/legacy/timelion_vis_component.tsx#:~:text=RangeFilterParams) | 8.1 | -| | [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts#:~:text=esQuery), [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts#:~:text=esQuery), [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts#:~:text=esQuery) | 8.1 | -| | [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts#:~:text=Filter), [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts#:~:text=Filter), [timelion_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/timelion_vis_fn.ts#:~:text=Filter), [timelion_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/timelion_vis_fn.ts#:~:text=Filter) | 8.1 | -| | [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts#:~:text=Filter), [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts#:~:text=Filter), [timelion_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/timelion_vis_fn.ts#:~:text=Filter), [timelion_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/timelion_vis_fn.ts#:~:text=Filter) | 8.1 | -| | [timelion_vis_component.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/components/timelion_vis_component.tsx#:~:text=RangeFilterParams), [timelion_vis_component.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/components/timelion_vis_component.tsx#:~:text=RangeFilterParams), [timelion_vis_renderer.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/timelion_vis_renderer.tsx#:~:text=RangeFilterParams), [timelion_vis_renderer.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/timelion_vis_renderer.tsx#:~:text=RangeFilterParams), [timelion_vis_component.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/legacy/timelion_vis_component.tsx#:~:text=RangeFilterParams), [timelion_vis_component.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/legacy/timelion_vis_component.tsx#:~:text=RangeFilterParams) | 8.1 | -| | [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts#:~:text=Filter), [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts#:~:text=Filter), [timelion_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/timelion_vis_fn.ts#:~:text=Filter), [timelion_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timelion/public/timelion_vis_fn.ts#:~:text=Filter) | 8.1 | +| | [plugin_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/helpers/plugin_services.ts#:~:text=IndexPatternsContract), [plugin_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/helpers/plugin_services.ts#:~:text=IndexPatternsContract), [timelion_expression_input_helpers.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/components/timelion_expression_input_helpers.test.ts#:~:text=IndexPatternsContract), [timelion_expression_input_helpers.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/components/timelion_expression_input_helpers.test.ts#:~:text=IndexPatternsContract) | - | +| | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/plugin.ts#:~:text=indexPatterns) | - | +| | [timelion_vis_component.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/components/timelion_vis_component.tsx#:~:text=RangeFilterParams), [timelion_vis_component.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/components/timelion_vis_component.tsx#:~:text=RangeFilterParams), [timelion_vis_renderer.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx#:~:text=RangeFilterParams), [timelion_vis_renderer.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx#:~:text=RangeFilterParams), [timelion_vis_component.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/legacy/timelion_vis_component.tsx#:~:text=RangeFilterParams), [timelion_vis_component.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/legacy/timelion_vis_component.tsx#:~:text=RangeFilterParams) | 8.1 | +| | [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts#:~:text=esQuery), [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts#:~:text=esQuery), [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts#:~:text=esQuery) | 8.1 | +| | [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts#:~:text=Filter), [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts#:~:text=Filter), [timelion_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/timelion_vis_fn.ts#:~:text=Filter), [timelion_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/timelion_vis_fn.ts#:~:text=Filter) | 8.1 | +| | [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts#:~:text=Filter), [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts#:~:text=Filter), [timelion_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/timelion_vis_fn.ts#:~:text=Filter), [timelion_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/timelion_vis_fn.ts#:~:text=Filter) | 8.1 | +| | [timelion_vis_component.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/components/timelion_vis_component.tsx#:~:text=RangeFilterParams), [timelion_vis_component.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/components/timelion_vis_component.tsx#:~:text=RangeFilterParams), [timelion_vis_renderer.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx#:~:text=RangeFilterParams), [timelion_vis_renderer.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx#:~:text=RangeFilterParams), [timelion_vis_component.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/legacy/timelion_vis_component.tsx#:~:text=RangeFilterParams), [timelion_vis_component.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/legacy/timelion_vis_component.tsx#:~:text=RangeFilterParams) | 8.1 | +| | [plugin_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/helpers/plugin_services.ts#:~:text=IndexPatternsContract), [plugin_services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/helpers/plugin_services.ts#:~:text=IndexPatternsContract), [timelion_expression_input_helpers.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/components/timelion_expression_input_helpers.test.ts#:~:text=IndexPatternsContract), [timelion_expression_input_helpers.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/components/timelion_expression_input_helpers.test.ts#:~:text=IndexPatternsContract) | - | +| | [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts#:~:text=Filter), [timelion_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts#:~:text=Filter), [timelion_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/timelion_vis_fn.ts#:~:text=Filter), [timelion_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timelion/public/timelion_vis_fn.ts#:~:text=Filter) | 8.1 | @@ -718,17 +926,22 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=getNonScriptedFields), [fetch_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/lib/fetch_fields.ts#:~:text=getNonScriptedFields) | 8.1 | -| | [abstract_search_strategy.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts#:~:text=IFieldType), [abstract_search_strategy.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts#:~:text=IFieldType) | 8.1 | +| | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=IndexPatternsService), [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=IndexPatternsService), [default_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts#:~:text=IndexPatternsService), [default_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts#:~:text=IndexPatternsService), [cached_index_pattern_fetcher.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts#:~:text=IndexPatternsService), [cached_index_pattern_fetcher.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts#:~:text=IndexPatternsService), [rollup_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts#:~:text=IndexPatternsService), [rollup_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts#:~:text=IndexPatternsService), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/types.ts#:~:text=IndexPatternsService), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/types.ts#:~:text=IndexPatternsService)+ 17 more | - | +| | [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/types/index.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/types/index.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern)+ 13 more | - | +| | [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField) | - | +| | [fetch_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/lib/fetch_fields.ts#:~:text=indexPatterns), [combo_box_select.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/index_pattern_select/combo_box_select.tsx#:~:text=indexPatterns), [query_bar_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/query_bar_wrapper.tsx#:~:text=indexPatterns), [annotation_row.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/annotation_row.tsx#:~:text=indexPatterns), [metrics_type.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/metrics_type.ts#:~:text=indexPatterns), [convert_series_to_datatable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.ts#:~:text=indexPatterns), [timeseries_visualization.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/timeseries_visualization.tsx#:~:text=indexPatterns), [timeseries_visualization.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/timeseries_visualization.tsx#:~:text=indexPatterns) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/plugin.ts#:~:text=fieldFormats) | - | | | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/types.ts#:~:text=EsQueryConfig), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/types.ts#:~:text=EsQueryConfig) | 8.1 | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/types/index.ts#:~:text=Filter), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/types/index.ts#:~:text=Filter) | 8.1 | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/types/index.ts#:~:text=Filter), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/types/index.ts#:~:text=Filter) | 8.1 | | | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/types.ts#:~:text=EsQueryConfig), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/types.ts#:~:text=EsQueryConfig) | 8.1 | -| | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=getNonScriptedFields), [fetch_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/lib/fetch_fields.ts#:~:text=getNonScriptedFields) | 8.1 | -| | [abstract_search_strategy.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts#:~:text=IFieldType), [abstract_search_strategy.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts#:~:text=IFieldType) | 8.1 | -| | [abstract_search_strategy.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts#:~:text=IFieldType), [abstract_search_strategy.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.test.ts#:~:text=IFieldType) | 8.1 | -| | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=getNonScriptedFields), [fetch_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/lib/fetch_fields.ts#:~:text=getNonScriptedFields) | 8.1 | +| | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=IndexPatternsService), [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=IndexPatternsService), [default_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts#:~:text=IndexPatternsService), [default_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts#:~:text=IndexPatternsService), [cached_index_pattern_fetcher.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts#:~:text=IndexPatternsService), [cached_index_pattern_fetcher.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts#:~:text=IndexPatternsService), [rollup_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts#:~:text=IndexPatternsService), [rollup_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts#:~:text=IndexPatternsService), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/types.ts#:~:text=IndexPatternsService), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/types.ts#:~:text=IndexPatternsService)+ 17 more | - | +| | [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/types/index.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/types/index.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern)+ 13 more | - | +| | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=getNonScriptedFields), [fetch_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/lib/fetch_fields.ts#:~:text=getNonScriptedFields) | 8.1 | +| | [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField) | - | +| | [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField) | - | +| | [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/types/index.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/types/index.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern)+ 13 more | - | +| | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=IndexPatternsService), [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=IndexPatternsService), [default_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts#:~:text=IndexPatternsService), [default_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts#:~:text=IndexPatternsService), [cached_index_pattern_fetcher.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts#:~:text=IndexPatternsService), [cached_index_pattern_fetcher.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts#:~:text=IndexPatternsService), [rollup_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts#:~:text=IndexPatternsService), [rollup_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts#:~:text=IndexPatternsService), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/types.ts#:~:text=IndexPatternsService), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/types.ts#:~:text=IndexPatternsService)+ 44 more | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/types/index.ts#:~:text=Filter), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/common/types/index.ts#:~:text=Filter) | 8.1 | | | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/types.ts#:~:text=EsQueryConfig), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/types.ts#:~:text=EsQueryConfig) | 8.1 | @@ -738,12 +951,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_vega/public/vega_request_handler.ts#:~:text=esQuery), [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_vega/public/vega_request_handler.ts#:~:text=esQuery), [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_vega/public/vega_request_handler.ts#:~:text=esQuery) | 8.1 | -| | [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_vega/public/vega_request_handler.ts#:~:text=Filter), [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_vega/public/vega_request_handler.ts#:~:text=Filter) | 8.1 | -| | [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_vega/public/vega_request_handler.ts#:~:text=Filter), [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_vega/public/vega_request_handler.ts#:~:text=Filter) | 8.1 | -| | [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_vega/public/vega_request_handler.ts#:~:text=Filter), [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_vega/public/vega_request_handler.ts#:~:text=Filter) | 8.1 | -| | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_vega/public/plugin.ts#:~:text=injectedMetadata) | - | -| | [search_api.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_vega/public/data_model/search_api.ts#:~:text=injectedMetadata), [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_vega/public/plugin.ts#:~:text=injectedMetadata), [search_api.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_vega/target/types/public/data_model/search_api.d.ts#:~:text=injectedMetadata) | - | +| | [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern) | - | +| | [search_api.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/data_model/search_api.ts#:~:text=indexPatterns), [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_request_handler.ts#:~:text=indexPatterns), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=indexPatterns), [search_api.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/data_model/search_api.test.ts#:~:text=indexPatterns), [search_api.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/data_model/search_api.test.ts#:~:text=indexPatterns), [search_api.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/data_model/search_api.test.ts#:~:text=indexPatterns), [view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_view/vega_map_view/view.test.ts#:~:text=indexPatterns) | - | +| | [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_request_handler.ts#:~:text=esQuery), [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_request_handler.ts#:~:text=esQuery), [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_request_handler.ts#:~:text=esQuery) | 8.1 | +| | [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_request_handler.ts#:~:text=Filter), [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_request_handler.ts#:~:text=Filter) | 8.1 | +| | [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_request_handler.ts#:~:text=Filter), [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_request_handler.ts#:~:text=Filter) | 8.1 | +| | [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern) | - | +| | [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern) | - | +| | [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_request_handler.ts#:~:text=Filter), [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_request_handler.ts#:~:text=Filter) | 8.1 | +| | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/plugin.ts#:~:text=injectedMetadata) | - | +| | [search_api.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/data_model/search_api.ts#:~:text=injectedMetadata), [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/plugin.ts#:~:text=injectedMetadata), [search_api.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/target/types/public/data_model/search_api.d.ts#:~:text=injectedMetadata) | - | @@ -771,11 +988,20 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=IndexPatternsContract), [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=IndexPatternsContract) | - | +| | [vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis.ts#:~:text=IndexPattern), [vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [create_vis_embeddable_from_object.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts#:~:text=IndexPattern), [create_vis_embeddable_from_object.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern) | - | +| | [controls_references.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/controls_references.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [controls_references.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/controls_references.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [timeseries_references.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/timeseries_references.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [timeseries_references.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/timeseries_references.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE) | - | | | [vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis.ts#:~:text=toJSON) | 8.1 | +| | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/plugin.ts#:~:text=indexPatterns) | - | | | [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=esFilters), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=esFilters) | 8.1 | | | [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter) | 8.1 | +| | [controls_references.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/controls_references.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [controls_references.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/controls_references.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [timeseries_references.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/timeseries_references.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [timeseries_references.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/timeseries_references.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE) | - | | | [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter) | 8.1 | +| | [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=IndexPatternsContract), [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=IndexPatternsContract) | - | +| | [vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis.ts#:~:text=IndexPattern), [vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [create_vis_embeddable_from_object.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts#:~:text=IndexPattern), [create_vis_embeddable_from_object.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern) | - | | | [vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis.ts#:~:text=toJSON) | 8.1 | +| | [controls_references.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/controls_references.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [controls_references.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/controls_references.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [timeseries_references.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/timeseries_references.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [timeseries_references.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/timeseries_references.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE), [visualization_saved_object_migrations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/server/migrations/visualization_saved_object_migrations.ts#:~:text=INDEX_PATTERN_SAVED_OBJECT_TYPE) | - | +| | [vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis.ts#:~:text=IndexPattern), [vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/vis_types/types.ts#:~:text=IndexPattern), [create_vis_embeddable_from_object.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts#:~:text=IndexPattern), [create_vis_embeddable_from_object.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/create_vis_embeddable_from_object.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=IndexPattern) | - | | | [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter), [visualize_embeddable.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts#:~:text=Filter) | 8.1 | | | [find_list_items.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/find_list_items.ts#:~:text=SavedObjectLoader), [find_list_items.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/find_list_items.ts#:~:text=SavedObjectLoader), [saved_visualizations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualizations.ts#:~:text=SavedObjectLoader), [saved_visualizations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualizations.ts#:~:text=SavedObjectLoader), [saved_visualizations.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/saved_visualizations.ts#:~:text=SavedObjectLoader), [services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/services.ts#:~:text=SavedObjectLoader), [services.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/services.ts#:~:text=SavedObjectLoader) | - | | | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/types.ts#:~:text=SavedObject), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/types.ts#:~:text=SavedObject), [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=SavedObject), [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=SavedObject), [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=SavedObject), [_saved_vis.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts#:~:text=SavedObject) | - | @@ -787,10 +1013,15 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/components/visualize_top_nav.tsx#:~:text=IndexPattern), [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/components/visualize_top_nav.tsx#:~:text=IndexPattern), [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/components/visualize_top_nav.tsx#:~:text=IndexPattern) | - | +| | [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/components/visualize_top_nav.tsx#:~:text=indexPatterns), [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/components/visualize_top_nav.tsx#:~:text=indexPatterns), [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/plugin.ts#:~:text=indexPatterns), [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/plugin.ts#:~:text=indexPatterns) | - | | | [use_visualize_app_state.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/use/use_visualize_app_state.tsx#:~:text=esFilters), [use_visualize_app_state.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/use/use_visualize_app_state.tsx#:~:text=esFilters), [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/plugin.ts#:~:text=esFilters), [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/plugin.ts#:~:text=esFilters), [get_visualize_list_item_link.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/get_visualize_list_item_link.test.ts#:~:text=esFilters), [get_visualize_list_item_link.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/get_visualize_list_item_link.test.ts#:~:text=esFilters) | 8.1 | -| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/utils.ts#:~:text=Filter), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/utils.ts#:~:text=Filter), [use_linked_search_updates.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/use/use_linked_search_updates.ts#:~:text=Filter), [use_linked_search_updates.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/use/use_linked_search_updates.ts#:~:text=Filter), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/types.d.ts#:~:text=Filter), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/types.d.ts#:~:text=Filter)+ 2 more | 8.1 | -| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/utils.ts#:~:text=Filter), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/utils.ts#:~:text=Filter), [use_linked_search_updates.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/use/use_linked_search_updates.ts#:~:text=Filter), [use_linked_search_updates.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/use/use_linked_search_updates.ts#:~:text=Filter), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/types.d.ts#:~:text=Filter), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/types.d.ts#:~:text=Filter)+ 2 more | 8.1 | -| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/utils.ts#:~:text=Filter), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/utils.ts#:~:text=Filter), [use_linked_search_updates.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/use/use_linked_search_updates.ts#:~:text=Filter), [use_linked_search_updates.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/use/use_linked_search_updates.ts#:~:text=Filter), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/types.d.ts#:~:text=Filter), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/types.d.ts#:~:text=Filter)+ 2 more | 8.1 | +| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/utils.ts#:~:text=Filter), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/utils.ts#:~:text=Filter), [use_linked_search_updates.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/use/use_linked_search_updates.ts#:~:text=Filter), [use_linked_search_updates.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/use/use_linked_search_updates.ts#:~:text=Filter), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/types.d.ts#:~:text=Filter), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/types.d.ts#:~:text=Filter)+ 6 more | 8.1 | +| | [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/common/locator.ts#:~:text=isFilterPinned), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/common/locator.ts#:~:text=isFilterPinned), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/common/locator.ts#:~:text=isFilterPinned) | 8.1 | +| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/utils.ts#:~:text=Filter), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/utils.ts#:~:text=Filter), [use_linked_search_updates.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/use/use_linked_search_updates.ts#:~:text=Filter), [use_linked_search_updates.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/use/use_linked_search_updates.ts#:~:text=Filter), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/types.d.ts#:~:text=Filter), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/types.d.ts#:~:text=Filter)+ 6 more | 8.1 | +| | [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/components/visualize_top_nav.tsx#:~:text=IndexPattern), [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/components/visualize_top_nav.tsx#:~:text=IndexPattern), [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/components/visualize_top_nav.tsx#:~:text=IndexPattern) | - | +| | [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/components/visualize_top_nav.tsx#:~:text=IndexPattern), [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/components/visualize_top_nav.tsx#:~:text=IndexPattern), [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/components/visualize_top_nav.tsx#:~:text=IndexPattern) | - | +| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=Filter), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/utils.ts#:~:text=Filter), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/utils.ts#:~:text=Filter), [use_linked_search_updates.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/use/use_linked_search_updates.ts#:~:text=Filter), [use_linked_search_updates.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/use/use_linked_search_updates.ts#:~:text=Filter), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/types.d.ts#:~:text=Filter), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/types.d.ts#:~:text=Filter)+ 6 more | 8.1 | | | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=SavedObject), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=SavedObject), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=SavedObject), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/types.ts#:~:text=SavedObject), [get_visualization_instance.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/get_visualization_instance.ts#:~:text=SavedObject), [get_visualization_instance.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/utils/get_visualization_instance.ts#:~:text=SavedObject), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/types.d.ts#:~:text=SavedObject), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/types.d.ts#:~:text=SavedObject), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/types.d.ts#:~:text=SavedObject), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/types.d.ts#:~:text=SavedObject)+ 3 more | - | | | [visualize_listing.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/components/visualize_listing.tsx#:~:text=settings), [visualize_listing.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/components/visualize_listing.tsx#:~:text=settings) | - | | | [visualize_top_nav.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/components/visualize_top_nav.tsx#:~:text=onAppLeave), [visualize_editor_common.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/components/visualize_editor_common.tsx#:~:text=onAppLeave), [app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/app.tsx#:~:text=onAppLeave), [index.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/public/application/index.tsx#:~:text=onAppLeave), [app.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/app.d.ts#:~:text=onAppLeave), [index.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/index.d.ts#:~:text=onAppLeave), [visualize_editor_common.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/components/visualize_editor_common.d.ts#:~:text=onAppLeave), [visualize_top_nav.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/visualize/target/types/public/application/components/visualize_top_nav.d.ts#:~:text=onAppLeave) | - | diff --git a/api_docs/dev_tools.json b/api_docs/dev_tools.json index bab8b4a9a999e..4584d740db125 100644 --- a/api_docs/dev_tools.json +++ b/api_docs/dev_tools.json @@ -86,7 +86,7 @@ }, { "parentPluginId": "devTools", - "id": "def-public.DevToolsPlugin.setup.$2.urlForwarding", + "id": "def-public.DevToolsPlugin.setup.$2", "type": "Object", "tags": [], "label": "{ urlForwarding }", @@ -96,7 +96,7 @@ "children": [ { "parentPluginId": "devTools", - "id": "def-public.DevToolsPlugin.setup.$2.urlForwarding.urlForwarding", + "id": "def-public.DevToolsPlugin.setup.$2.urlForwarding", "type": "Object", "tags": [], "label": "urlForwarding", diff --git a/api_docs/discover.json b/api_docs/discover.json index f5571b0ce622a..4daa43c322117 100644 --- a/api_docs/discover.json +++ b/api_docs/discover.json @@ -1009,7 +1009,7 @@ "signature": [ "\"search\"" ], - "path": "src/plugins/discover/public/application/embeddable/constants.ts", + "path": "src/plugins/discover/common/index.ts", "deprecated": false, "initialIsOpen": false } @@ -1121,7 +1121,7 @@ "references": [ { "plugin": "osquery", - "path": "x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_table.tsx" + "path": "x-pack/plugins/osquery/public/scheduled_query_groups/scheduled_query_group_queries_status_table.tsx" }, { "plugin": "osquery", @@ -1310,6 +1310,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "discover", + "id": "def-common.SEARCH_EMBEDDABLE_TYPE", + "type": "string", + "tags": [], + "label": "SEARCH_EMBEDDABLE_TYPE", + "description": [], + "signature": [ + "\"search\"" + ], + "path": "src/plugins/discover/common/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "discover", "id": "def-common.SEARCH_FIELDS_FROM_SOURCE", diff --git a/api_docs/discover.mdx b/api_docs/discover.mdx index 610ec5d90f267..ee34b0c54dccf 100644 --- a/api_docs/discover.mdx +++ b/api_docs/discover.mdx @@ -12,13 +12,13 @@ import discoverObj from './discover.json'; This plugin contains the Discover application and the saved search embeddable. -Contact [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) for questions regarding this plugin. **Code health stats** | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 81 | 0 | 55 | 6 | +| 82 | 0 | 56 | 6 | ## Client diff --git a/api_docs/discover_enhanced.json b/api_docs/discover_enhanced.json index eaa794a40affc..a4ef8ec82ab0e 100644 --- a/api_docs/discover_enhanced.json +++ b/api_docs/discover_enhanced.json @@ -721,7 +721,7 @@ "label": "kibanaLegacy", "description": [], "signature": [ - "{ loadFontAwesome: () => Promise; loadAngularBootstrap: () => Promise; config: Readonly<{} & { defaultAppId: string; }>; } | undefined" + "{ loadFontAwesome: () => Promise; loadAngularBootstrap: () => Promise; } | undefined" ], "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 ecba2f6d0f805..e3a5dd501c076 100644 --- a/api_docs/discover_enhanced.mdx +++ b/api_docs/discover_enhanced.mdx @@ -12,7 +12,7 @@ import discoverEnhancedObj from './discover_enhanced.json'; -Contact [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/embeddable.json b/api_docs/embeddable.json index fdf0ed78da092..ff7f163c5f48e 100644 --- a/api_docs/embeddable.json +++ b/api_docs/embeddable.json @@ -3681,7 +3681,7 @@ }, { "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStateTransfer.navigateToEditor.$2.options", + "id": "def-public.EmbeddableStateTransfer.navigateToEditor.$2", "type": "Object", "tags": [], "label": "options", @@ -3691,7 +3691,7 @@ "children": [ { "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStateTransfer.navigateToEditor.$2.options.path", + "id": "def-public.EmbeddableStateTransfer.navigateToEditor.$2.path", "type": "string", "tags": [], "label": "path", @@ -3704,7 +3704,7 @@ }, { "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStateTransfer.navigateToEditor.$2.options.openInNewTab", + "id": "def-public.EmbeddableStateTransfer.navigateToEditor.$2.openInNewTab", "type": "CompoundType", "tags": [], "label": "openInNewTab", @@ -3717,7 +3717,7 @@ }, { "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStateTransfer.navigateToEditor.$2.options.state", + "id": "def-public.EmbeddableStateTransfer.navigateToEditor.$2.state", "type": "Object", "tags": [], "label": "state", @@ -3778,7 +3778,7 @@ }, { "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStateTransfer.navigateToWithEmbeddablePackage.$2.options", + "id": "def-public.EmbeddableStateTransfer.navigateToWithEmbeddablePackage.$2", "type": "Object", "tags": [], "label": "options", @@ -3788,7 +3788,7 @@ "children": [ { "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStateTransfer.navigateToWithEmbeddablePackage.$2.options.path", + "id": "def-public.EmbeddableStateTransfer.navigateToWithEmbeddablePackage.$2.path", "type": "string", "tags": [], "label": "path", @@ -3801,7 +3801,7 @@ }, { "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStateTransfer.navigateToWithEmbeddablePackage.$2.options.state", + "id": "def-public.EmbeddableStateTransfer.navigateToWithEmbeddablePackage.$2.state", "type": "Object", "tags": [], "label": "state", @@ -5041,7 +5041,7 @@ "children": [ { "parentPluginId": "embeddable", - "id": "def-public.openAddPanelFlyout.$1.options", + "id": "def-public.openAddPanelFlyout.$1", "type": "Object", "tags": [], "label": "options", @@ -5051,7 +5051,7 @@ "children": [ { "parentPluginId": "embeddable", - "id": "def-public.openAddPanelFlyout.$1.options.embeddable", + "id": "def-public.openAddPanelFlyout.$1.embeddable", "type": "Object", "tags": [], "label": "embeddable", @@ -5087,7 +5087,7 @@ }, { "parentPluginId": "embeddable", - "id": "def-public.openAddPanelFlyout.$1.options.getFactory", + "id": "def-public.openAddPanelFlyout.$1.getFactory", "type": "Function", "tags": [], "label": "getFactory", @@ -5159,7 +5159,7 @@ "children": [ { "parentPluginId": "embeddable", - "id": "def-public.embeddableFactoryId", + "id": "def-public.openAddPanelFlyout.$1.getFactory.$1", "type": "string", "tags": [], "label": "embeddableFactoryId", @@ -5171,7 +5171,7 @@ }, { "parentPluginId": "embeddable", - "id": "def-public.openAddPanelFlyout.$1.options.getAllFactories", + "id": "def-public.openAddPanelFlyout.$1.getAllFactories", "type": "Function", "tags": [], "label": "getAllFactories", @@ -5236,7 +5236,7 @@ }, { "parentPluginId": "embeddable", - "id": "def-public.openAddPanelFlyout.$1.options.overlays", + "id": "def-public.openAddPanelFlyout.$1.overlays", "type": "Object", "tags": [], "label": "overlays", @@ -5255,7 +5255,7 @@ }, { "parentPluginId": "embeddable", - "id": "def-public.openAddPanelFlyout.$1.options.notifications", + "id": "def-public.openAddPanelFlyout.$1.notifications", "type": "Object", "tags": [], "label": "notifications", @@ -5274,7 +5274,7 @@ }, { "parentPluginId": "embeddable", - "id": "def-public.openAddPanelFlyout.$1.options.SavedObjectFinder", + "id": "def-public.openAddPanelFlyout.$1.SavedObjectFinder", "type": "CompoundType", "tags": [], "label": "SavedObjectFinder", @@ -5287,7 +5287,7 @@ }, { "parentPluginId": "embeddable", - "id": "def-public.openAddPanelFlyout.$1.options.showCreateNewMenu", + "id": "def-public.openAddPanelFlyout.$1.showCreateNewMenu", "type": "CompoundType", "tags": [], "label": "showCreateNewMenu", @@ -5300,7 +5300,7 @@ }, { "parentPluginId": "embeddable", - "id": "def-public.openAddPanelFlyout.$1.options.reportUiCounter", + "id": "def-public.openAddPanelFlyout.$1.reportUiCounter", "type": "Function", "tags": [], "label": "reportUiCounter", @@ -5711,7 +5711,7 @@ "children": [ { "parentPluginId": "embeddable", - "id": "def-public.props", + "id": "def-public.EmbeddableChildPanelProps.PanelComponent.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -5724,7 +5724,7 @@ }, { "parentPluginId": "embeddable", - "id": "def-public.context", + "id": "def-public.EmbeddableChildPanelProps.PanelComponent.$2", "type": "Any", "tags": [], "label": "context", @@ -8289,7 +8289,7 @@ "section": "def-public.EmbeddableFactory", "text": "EmbeddableFactory" }, - ", \"createFromSavedObject\" | \"isContainerType\" | \"getExplicitInput\" | \"savedObjectMetaData\" | \"canCreateNew\" | \"getDefaultInput\" | \"telemetry\" | \"extract\" | \"inject\" | \"migrations\" | \"grouping\" | \"getIconType\" | \"getDescription\">>" + ", \"telemetry\" | \"inject\" | \"extract\" | \"migrations\" | \"createFromSavedObject\" | \"isContainerType\" | \"getExplicitInput\" | \"savedObjectMetaData\" | \"canCreateNew\" | \"getDefaultInput\" | \"grouping\" | \"getIconType\" | \"getDescription\">>" ], "path": "src/plugins/embeddable/public/lib/embeddables/embeddable_factory_definition.ts", "deprecated": false, @@ -8361,7 +8361,7 @@ "children": [ { "parentPluginId": "embeddable", - "id": "def-public.props", + "id": "def-public.EmbeddablePanelHOC.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -8374,7 +8374,7 @@ }, { "parentPluginId": "embeddable", - "id": "def-public.context", + "id": "def-public.EmbeddablePanelHOC.$2", "type": "Any", "tags": [], "label": "context", @@ -9021,7 +9021,7 @@ "children": [ { "parentPluginId": "embeddable", - "id": "def-public.props", + "id": "def-public.EmbeddableStart.EmbeddablePanel.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -9034,7 +9034,7 @@ }, { "parentPluginId": "embeddable", - "id": "def-public.context", + "id": "def-public.EmbeddableStart.EmbeddablePanel.$2", "type": "Any", "tags": [], "label": "context", @@ -10232,7 +10232,7 @@ "children": [ { "parentPluginId": "embeddable", - "id": "def-common.state", + "id": "def-common.MigrateFunction.$1", "type": "Object", "tags": [], "label": "state", @@ -10245,7 +10245,7 @@ }, { "parentPluginId": "embeddable", - "id": "def-common.version", + "id": "def-common.MigrateFunction.$2", "type": "string", "tags": [], "label": "version", diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index 1880582bb01c4..60b15f305bac9 100644 --- a/api_docs/embeddable.mdx +++ b/api_docs/embeddable.mdx @@ -10,7 +10,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex --- import embeddableObj from './embeddable.json'; - +Adds embeddables service to Kibana Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. diff --git a/api_docs/embeddable_enhanced.mdx b/api_docs/embeddable_enhanced.mdx index 7f2e7ffcffc8c..4963a62296358 100644 --- a/api_docs/embeddable_enhanced.mdx +++ b/api_docs/embeddable_enhanced.mdx @@ -10,7 +10,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex --- import embeddableEnhancedObj from './embeddable_enhanced.json'; - +Extends embeddable plugin with more functionality Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. diff --git a/api_docs/encrypted_saved_objects.json b/api_docs/encrypted_saved_objects.json index 9bd91501c23dd..5432a3772ac96 100644 --- a/api_docs/encrypted_saved_objects.json +++ b/api_docs/encrypted_saved_objects.json @@ -307,7 +307,7 @@ "children": [ { "parentPluginId": "encryptedSavedObjects", - "id": "def-server.encryptedDoc", + "id": "def-server.IsMigrationNeededPredicate.$1", "type": "CompoundType", "tags": [], "label": "encryptedDoc", @@ -422,7 +422,7 @@ "children": [ { "parentPluginId": "encryptedSavedObjects", - "id": "def-server.opts", + "id": "def-server.EncryptedSavedObjectsPluginSetup.createMigration.$1", "type": "Object", "tags": [], "label": "opts", @@ -505,7 +505,7 @@ "children": [ { "parentPluginId": "encryptedSavedObjects", - "id": "def-server.options", + "id": "def-server.EncryptedSavedObjectsPluginStart.getClient.$1", "type": "Object", "tags": [], "label": "options", diff --git a/api_docs/es_ui_shared.json b/api_docs/es_ui_shared.json index 46ba3ac600dcb..bbc5d7b83f0e8 100644 --- a/api_docs/es_ui_shared.json +++ b/api_docs/es_ui_shared.json @@ -352,7 +352,7 @@ "children": [ { "parentPluginId": "esUiShared", - "id": "def-public.__0", + "id": "def-public.JsonEditor.$1", "type": "Object", "tags": [], "label": "__0", @@ -1434,7 +1434,7 @@ "children": [ { "parentPluginId": "esUiShared", - "id": "def-public.arg", + "id": "def-public.OnJsonEditorUpdateHandler.$1", "type": "Object", "tags": [], "label": "arg", @@ -1510,7 +1510,7 @@ "children": [ { "parentPluginId": "esUiShared", - "id": "def-public.indexName", + "id": "def-public.indices.indexNameBeginsWithPeriod.$1", "type": "string", "tags": [], "label": "indexName", @@ -1539,7 +1539,7 @@ "children": [ { "parentPluginId": "esUiShared", - "id": "def-public.indexName", + "id": "def-public.indices.findIllegalCharactersInIndexName.$1", "type": "string", "tags": [], "label": "indexName", @@ -1565,7 +1565,7 @@ "children": [ { "parentPluginId": "esUiShared", - "id": "def-public.indexName", + "id": "def-public.indices.indexNameContainsSpaces.$1", "type": "string", "tags": [], "label": "indexName", diff --git a/api_docs/event_log.json b/api_docs/event_log.json index 52138271ef91f..a4ddd23db6881 100644 --- a/api_docs/event_log.json +++ b/api_docs/event_log.json @@ -365,9 +365,7 @@ "label": "queryEventsBySavedObjects", "description": [], "signature": [ - "(index: string, namespace: string | undefined, type: string, ids: string[], { page, per_page: perPage, start, end, sort_field, sort_order, filter }: ", - "FindOptionsType", - ") => Promise<", + "(queryOptions: QueryOptionsEventsBySavedObjectFilter) => Promise<", { "pluginId": "eventLog", "scope": "server", @@ -383,68 +381,12 @@ { "parentPluginId": "eventLog", "id": "def-server.ClusterClientAdapter.queryEventsBySavedObjects.$1", - "type": "string", - "tags": [], - "label": "index", - "description": [], - "signature": [ - "string" - ], - "path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "eventLog", - "id": "def-server.ClusterClientAdapter.queryEventsBySavedObjects.$2", - "type": "string", - "tags": [], - "label": "namespace", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts", - "deprecated": false, - "isRequired": false - }, - { - "parentPluginId": "eventLog", - "id": "def-server.ClusterClientAdapter.queryEventsBySavedObjects.$3", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string" - ], - "path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "eventLog", - "id": "def-server.ClusterClientAdapter.queryEventsBySavedObjects.$4", - "type": "Array", - "tags": [], - "label": "ids", - "description": [], - "signature": [ - "string[]" - ], - "path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "eventLog", - "id": "def-server.ClusterClientAdapter.queryEventsBySavedObjects.$5", - "type": "CompoundType", + "type": "Object", "tags": [], - "label": "{ page, per_page: perPage, start, end, sort_field, sort_order, filter }", + "label": "queryOptions", "description": [], "signature": [ - "FindOptionsType" + "QueryOptionsEventsBySavedObjectFilter" ], "path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts", "deprecated": false, @@ -498,7 +440,7 @@ "signature": [ "(type: string, ids: string[], options?: Partial<", "FindOptionsType", - "> | undefined) => Promise<", + "> | undefined, legacyIds?: string[] | undefined) => Promise<", { "pluginId": "eventLog", "scope": "server", @@ -554,6 +496,20 @@ "path": "x-pack/plugins/event_log/server/types.ts", "deprecated": false, "isRequired": false + }, + { + "parentPluginId": "eventLog", + "id": "def-server.IEventLogClient.findEventsBySavedObjectIds.$4", + "type": "Array", + "tags": [], + "label": "legacyIds", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "x-pack/plugins/event_log/server/types.ts", + "deprecated": false, + "isRequired": false } ], "returnComment": [] @@ -579,7 +535,7 @@ "label": "logEvent", "description": [], "signature": [ - "(properties: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" + "(properties: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" ], "path": "x-pack/plugins/event_log/server/types.ts", "deprecated": false, @@ -592,7 +548,7 @@ "label": "properties", "description": [], "signature": [ - "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" + "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" ], "path": "x-pack/plugins/event_log/server/types.ts", "deprecated": false, @@ -609,7 +565,7 @@ "label": "startTiming", "description": [], "signature": [ - "(event: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" + "(event: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" ], "path": "x-pack/plugins/event_log/server/types.ts", "deprecated": false, @@ -622,7 +578,7 @@ "label": "event", "description": [], "signature": [ - "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" + "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" ], "path": "x-pack/plugins/event_log/server/types.ts", "deprecated": false, @@ -639,7 +595,7 @@ "label": "stopTiming", "description": [], "signature": [ - "(event: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" + "(event: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => void" ], "path": "x-pack/plugins/event_log/server/types.ts", "deprecated": false, @@ -652,7 +608,7 @@ "label": "event", "description": [], "signature": [ - "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" + "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" ], "path": "x-pack/plugins/event_log/server/types.ts", "deprecated": false, @@ -712,7 +668,7 @@ "label": "data", "description": [], "signature": [ - "(Readonly<{ kibana?: Readonly<{ version?: string | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}> | undefined)[]" + "(Readonly<{ tags?: string[] | undefined; kibana?: Readonly<{ version?: string | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}> | undefined)[]" ], "path": "x-pack/plugins/event_log/server/es/cluster_client_adapter.ts", "deprecated": false @@ -731,7 +687,7 @@ "label": "IEvent", "description": [], "signature": [ - "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" + "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" ], "path": "x-pack/plugins/event_log/generated/schemas.ts", "deprecated": false, @@ -745,7 +701,7 @@ "label": "IValidatedEvent", "description": [], "signature": [ - "Readonly<{ kibana?: Readonly<{ version?: string | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}> | undefined" + "Readonly<{ tags?: string[] | undefined; kibana?: Readonly<{ version?: string | undefined; saved_objects?: Readonly<{ type?: string | undefined; id?: string | undefined; rel?: string | undefined; namespace?: string | undefined; type_id?: string | undefined; } & {}>[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}> | undefined" ], "path": "x-pack/plugins/event_log/generated/schemas.ts", "deprecated": false, @@ -979,7 +935,7 @@ "label": "getLogger", "description": [], "signature": [ - "(properties: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => ", + "(properties: DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined) => ", { "pluginId": "eventLog", "scope": "server", @@ -999,7 +955,7 @@ "label": "properties", "description": [], "signature": [ - "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; tags?: string[] | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" + "DeepPartial[] | undefined; alerting?: Readonly<{ status?: string | undefined; instance_id?: string | undefined; action_group_id?: string | undefined; action_subgroup?: string | undefined; } & {}> | undefined; server_uuid?: string | undefined; task?: Readonly<{ scheduled?: string | undefined; schedule_delay?: number | undefined; } & {}> | undefined; } & {}> | undefined; user?: Readonly<{ name?: string | undefined; } & {}> | undefined; error?: Readonly<{ type?: string | undefined; id?: string | undefined; message?: string | undefined; code?: string | undefined; stack_trace?: string | undefined; } & {}> | undefined; message?: string | undefined; event?: Readonly<{ start?: string | undefined; type?: string[] | undefined; id?: string | undefined; end?: string | undefined; category?: string[] | undefined; url?: string | undefined; code?: string | undefined; original?: string | undefined; action?: string | undefined; kind?: string | undefined; timezone?: string | undefined; severity?: number | undefined; outcome?: string | undefined; created?: string | undefined; dataset?: string | undefined; duration?: number | undefined; hash?: 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?: number | undefined; } & {}> | undefined; rule?: Readonly<{ description?: string | undefined; id?: string | undefined; name?: string | undefined; version?: string | undefined; license?: string | undefined; category?: string | undefined; reference?: string | undefined; author?: string[] | undefined; ruleset?: string | undefined; uuid?: string | undefined; } & {}> | undefined; '@timestamp'?: string | undefined; log?: Readonly<{ logger?: string | undefined; level?: string | undefined; } & {}> | undefined; ecs?: Readonly<{ version?: string | undefined; } & {}> | undefined; } & {}>>> | undefined" ], "path": "x-pack/plugins/event_log/server/types.ts", "deprecated": false, diff --git a/api_docs/event_log.mdx b/api_docs/event_log.mdx index 47d52f0498f87..5132391e624f2 100644 --- a/api_docs/event_log.mdx +++ b/api_docs/event_log.mdx @@ -18,7 +18,7 @@ Contact [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting- | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 70 | 0 | 70 | 4 | +| 67 | 0 | 67 | 4 | ## Server diff --git a/api_docs/expression_error.json b/api_docs/expression_error.json index 954024177c086..8f7dc65eb6e6d 100644 --- a/api_docs/expression_error.json +++ b/api_docs/expression_error.json @@ -69,7 +69,7 @@ "children": [ { "parentPluginId": "expressionError", - "id": "def-public.props", + "id": "def-public.LazyDebugComponent.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -103,7 +103,7 @@ "children": [ { "parentPluginId": "expressionError", - "id": "def-public.props", + "id": "def-public.LazyErrorComponent.$1", "type": "Uncategorized", "tags": [], "label": "props", diff --git a/api_docs/expression_shape.json b/api_docs/expression_shape.json index bb5f38649c4ba..d0ebb9b78a6e0 100644 --- a/api_docs/expression_shape.json +++ b/api_docs/expression_shape.json @@ -74,7 +74,7 @@ "children": [ { "parentPluginId": "expressionShape", - "id": "def-public.props", + "id": "def-public.LazyProgressDrawer.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -136,7 +136,7 @@ "children": [ { "parentPluginId": "expressionShape", - "id": "def-public.props", + "id": "def-public.LazyShapeDrawer.$1", "type": "Uncategorized", "tags": [], "label": "props", diff --git a/api_docs/expression_tagcloud.mdx b/api_docs/expression_tagcloud.mdx index f9a91959b973f..26b10681ff75c 100644 --- a/api_docs/expression_tagcloud.mdx +++ b/api_docs/expression_tagcloud.mdx @@ -12,7 +12,7 @@ import expressionTagcloudObj from './expression_tagcloud.json'; Expression Tagcloud plugin adds a `tagcloud` renderer and function to the expression plugin. The renderer will display the `Wordcloud` chart. -Contact [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/expressions.json b/api_docs/expressions.json index face7ac82d855..31fc7af992f61 100644 --- a/api_docs/expressions.json +++ b/api_docs/expressions.json @@ -1969,7 +1969,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-public.input", + "id": "def-public.ExpressionFunction.fn.$1", "type": "Any", "tags": [], "label": "input", @@ -1982,7 +1982,7 @@ }, { "parentPluginId": "expressions", - "id": "def-public.params", + "id": "def-public.ExpressionFunction.fn.$2", "type": "Object", "tags": [], "label": "params", @@ -1995,7 +1995,7 @@ }, { "parentPluginId": "expressions", - "id": "def-public.handlers", + "id": "def-public.ExpressionFunction.fn.$3", "type": "Uncategorized", "tags": [], "label": "handlers", @@ -2082,7 +2082,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-public.state", + "id": "def-public.ExpressionFunction.telemetry.$1", "type": "Object", "tags": [], "label": "state", @@ -2103,7 +2103,7 @@ }, { "parentPluginId": "expressions", - "id": "def-public.telemetryData", + "id": "def-public.ExpressionFunction.telemetry.$2", "type": "Object", "tags": [], "label": "telemetryData", @@ -2150,7 +2150,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-public.state", + "id": "def-public.ExpressionFunction.extract.$1", "type": "Object", "tags": [], "label": "state", @@ -2205,7 +2205,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-public.state", + "id": "def-public.ExpressionFunction.inject.$1", "type": "Object", "tags": [], "label": "state", @@ -2226,7 +2226,7 @@ }, { "parentPluginId": "expressions", - "id": "def-public.references", + "id": "def-public.ExpressionFunction.inject.$2", "type": "Array", "tags": [], "label": "references", @@ -2621,7 +2621,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-public.domNode", + "id": "def-public.ExpressionRenderer.render.$1", "type": "Object", "tags": [], "label": "domNode", @@ -2634,7 +2634,7 @@ }, { "parentPluginId": "expressions", - "id": "def-public.config", + "id": "def-public.ExpressionRenderer.render.$2", "type": "Uncategorized", "tags": [], "label": "config", @@ -2647,7 +2647,7 @@ }, { "parentPluginId": "expressions", - "id": "def-public.handlers", + "id": "def-public.ExpressionRenderer.render.$3", "type": "Object", "tags": [], "label": "handlers", @@ -2982,7 +2982,7 @@ "id": "def-public.ExpressionRenderHandler.Unnamed.$2", "type": "Object", "tags": [], - "label": "{\n onRenderError,\n renderMode,\n syncColors,\n hasCompatibleActions = async () => false,\n }", + "label": "{\n onRenderError,\n renderMode,\n syncColors,\n interactive,\n hasCompatibleActions = async () => false,\n }", "description": [], "signature": [ "ExpressionRenderHandlerParams" @@ -3212,7 +3212,7 @@ "section": "def-common.ExpressionsService", "text": "ExpressionsService" }, - ", \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">, ", + ", \"inject\" | \"extract\" | \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">, ", { "pluginId": "expressions", "scope": "public", @@ -3286,7 +3286,7 @@ "section": "def-common.ExpressionsService", "text": "ExpressionsService" }, - ", \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">" + ", \"inject\" | \"extract\" | \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">" ], "path": "src/plugins/expressions/public/plugin.ts", "deprecated": false, @@ -3415,7 +3415,7 @@ "section": "def-common.ExpressionsService", "text": "ExpressionsService" }, - ", \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">, ", + ", \"inject\" | \"extract\" | \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">, ", { "pluginId": "expressions", "scope": "public", @@ -3489,7 +3489,7 @@ "section": "def-common.ExpressionsService", "text": "ExpressionsService" }, - ", \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">" + ", \"inject\" | \"extract\" | \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">" ], "path": "src/plugins/expressions/public/plugin.ts", "deprecated": false, @@ -4230,7 +4230,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-public.ast", + "id": "def-public.ExpressionsService.execute.$1", "type": "CompoundType", "tags": [], "label": "ast", @@ -4250,7 +4250,7 @@ }, { "parentPluginId": "expressions", - "id": "def-public.input", + "id": "def-public.ExpressionsService.execute.$2", "type": "Uncategorized", "tags": [], "label": "input", @@ -4263,7 +4263,7 @@ }, { "parentPluginId": "expressions", - "id": "def-public.params", + "id": "def-public.ExpressionsService.execute.$3", "type": "Object", "tags": [], "label": "params", @@ -4603,7 +4603,7 @@ "section": "def-common.ExpressionsService", "text": "ExpressionsService" }, - ", \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">" + ", \"inject\" | \"extract\" | \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">" ], "path": "src/plugins/expressions/common/service/expressions_services.ts", "deprecated": false, @@ -4732,7 +4732,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-public.type", + "id": "def-public.ExpressionType.validate.$1", "type": "Any", "tags": [], "label": "type", @@ -5877,6 +5877,29 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "expressions", + "id": "def-public.createDefaultInspectorAdapters", + "type": "Function", + "tags": [], + "label": "createDefaultInspectorAdapters", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DefaultInspectorAdapters", + "text": "DefaultInspectorAdapters" + } + ], + "path": "src/plugins/expressions/common/util/create_default_inspector_adapters.ts", + "deprecated": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "expressions", "id": "def-public.format", @@ -9136,6 +9159,19 @@ "path": "src/plugins/expressions/public/types/index.ts", "deprecated": false }, + { + "parentPluginId": "expressions", + "id": "def-public.IExpressionLoaderParams.interactive", + "type": "CompoundType", + "tags": [], + "label": "interactive", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/expressions/public/types/index.ts", + "deprecated": false + }, { "parentPluginId": "expressions", "id": "def-public.IExpressionLoaderParams.onRenderError", @@ -9171,7 +9207,7 @@ "label": "renderMode", "description": [], "signature": [ - "\"display\" | \"noInteractivity\" | \"edit\" | \"preview\" | undefined" + "\"edit\" | \"preview\" | \"view\" | undefined" ], "path": "src/plugins/expressions/public/types/index.ts", "deprecated": false @@ -9441,6 +9477,23 @@ "children": [], "returnComment": [] }, + { + "parentPluginId": "expressions", + "id": "def-public.IInterpreterRenderHandlers.isInteractive", + "type": "Function", + "tags": [], + "label": "isInteractive", + "description": [ + "\nThe chart is rendered in a non-interactive environment and should not provide any affordances for interaction like brushing." + ], + "signature": [ + "() => boolean" + ], + "path": "src/plugins/expressions/common/expression_renderers/types.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "expressions", "id": "def-public.IInterpreterRenderHandlers.isSyncColorsEnabled", @@ -10197,7 +10250,7 @@ "\nThis type represents the `type` of any `DatatableColumn` in a `Datatable`.\nits duplicated from KBN_FIELD_TYPES" ], "signature": [ - "\"string\" | \"number\" | \"boolean\" | \"object\" | \"date\" | \"ip\" | \"geo_point\" | \"_source\" | \"attachment\" | \"geo_shape\" | \"murmur3\" | \"unknown\" | \"conflict\" | \"nested\" | \"histogram\" | \"null\"" + "\"string\" | \"number\" | \"boolean\" | \"object\" | \"date\" | \"_source\" | \"attachment\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"murmur3\" | \"unknown\" | \"conflict\" | \"nested\" | \"histogram\" | \"null\"" ], "path": "src/plugins/expressions/common/expression_types/specs/datatable.ts", "deprecated": false, @@ -10427,7 +10480,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-public.props", + "id": "def-public.ExpressionRendererComponent.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -10440,7 +10493,7 @@ }, { "parentPluginId": "expressions", - "id": "def-public.context", + "id": "def-public.ExpressionRendererComponent.$2", "type": "Any", "tags": [], "label": "context", @@ -10498,7 +10551,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-public.input", + "id": "def-public.ExpressionValueConverter.$1", "type": "Uncategorized", "tags": [], "label": "input", @@ -10511,7 +10564,7 @@ }, { "parentPluginId": "expressions", - "id": "def-public.availableTypes", + "id": "def-public.ExpressionValueConverter.$2", "type": "Object", "tags": [], "label": "availableTypes", @@ -10948,7 +11001,43 @@ "\nExpressions public setup contract, extends {@link ExpressionsServiceSetup}" ], "signature": [ - "{ readonly getType: (name: string) => ", + "{ readonly inject: (state: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpression", + "text": "ExpressionAstExpression" + }, + ", references: ", + "SavedObjectReference", + "[]) => ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpression", + "text": "ExpressionAstExpression" + }, + "; readonly extract: (state: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpression", + "text": "ExpressionAstExpression" + }, + ") => { state: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpression", + "text": "ExpressionAstExpression" + }, + "; references: ", + "SavedObjectReference", + "[]; }; readonly getType: (name: string) => ", { "pluginId": "expressions", "scope": "common", @@ -11199,7 +11288,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-public.element", + "id": "def-public.ExpressionsStart.loader.$1", "type": "Object", "tags": [], "label": "element", @@ -11212,7 +11301,7 @@ }, { "parentPluginId": "expressions", - "id": "def-public.expression", + "id": "def-public.ExpressionsStart.loader.$2", "type": "CompoundType", "tags": [], "label": "expression", @@ -11232,7 +11321,7 @@ }, { "parentPluginId": "expressions", - "id": "def-public.params", + "id": "def-public.ExpressionsStart.loader.$3", "type": "Object", "tags": [], "label": "params", @@ -11275,7 +11364,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-public.__0", + "id": "def-public.ExpressionsStart.ReactExpressionRenderer.$1", "type": "Object", "tags": [], "label": "__0", @@ -11319,7 +11408,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-public.element", + "id": "def-public.ExpressionsStart.render.$1", "type": "Object", "tags": [], "label": "element", @@ -11332,7 +11421,7 @@ }, { "parentPluginId": "expressions", - "id": "def-public.data", + "id": "def-public.ExpressionsStart.render.$2", "type": "Any", "tags": [], "label": "data", @@ -11345,7 +11434,7 @@ }, { "parentPluginId": "expressions", - "id": "def-public.options", + "id": "def-public.ExpressionsStart.render.$3", "type": "Object", "tags": [], "label": "options", @@ -13141,7 +13230,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-server.input", + "id": "def-server.ExpressionFunction.fn.$1", "type": "Any", "tags": [], "label": "input", @@ -13154,7 +13243,7 @@ }, { "parentPluginId": "expressions", - "id": "def-server.params", + "id": "def-server.ExpressionFunction.fn.$2", "type": "Object", "tags": [], "label": "params", @@ -13167,7 +13256,7 @@ }, { "parentPluginId": "expressions", - "id": "def-server.handlers", + "id": "def-server.ExpressionFunction.fn.$3", "type": "Uncategorized", "tags": [], "label": "handlers", @@ -13254,7 +13343,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-server.state", + "id": "def-server.ExpressionFunction.telemetry.$1", "type": "Object", "tags": [], "label": "state", @@ -13275,7 +13364,7 @@ }, { "parentPluginId": "expressions", - "id": "def-server.telemetryData", + "id": "def-server.ExpressionFunction.telemetry.$2", "type": "Object", "tags": [], "label": "telemetryData", @@ -13322,7 +13411,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-server.state", + "id": "def-server.ExpressionFunction.extract.$1", "type": "Object", "tags": [], "label": "state", @@ -13377,7 +13466,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-server.state", + "id": "def-server.ExpressionFunction.inject.$1", "type": "Object", "tags": [], "label": "state", @@ -13398,7 +13487,7 @@ }, { "parentPluginId": "expressions", - "id": "def-server.references", + "id": "def-server.ExpressionFunction.inject.$2", "type": "Array", "tags": [], "label": "references", @@ -13793,7 +13882,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-server.domNode", + "id": "def-server.ExpressionRenderer.render.$1", "type": "Object", "tags": [], "label": "domNode", @@ -13806,7 +13895,7 @@ }, { "parentPluginId": "expressions", - "id": "def-server.config", + "id": "def-server.ExpressionRenderer.render.$2", "type": "Uncategorized", "tags": [], "label": "config", @@ -13819,7 +13908,7 @@ }, { "parentPluginId": "expressions", - "id": "def-server.handlers", + "id": "def-server.ExpressionRenderer.render.$3", "type": "Object", "tags": [], "label": "handlers", @@ -14093,7 +14182,7 @@ "section": "def-common.ExpressionsService", "text": "ExpressionsService" }, - ", \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">, ", + ", \"inject\" | \"extract\" | \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">, ", { "pluginId": "expressions", "scope": "common", @@ -14186,7 +14275,7 @@ "section": "def-common.ExpressionsService", "text": "ExpressionsService" }, - ", \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">" + ", \"inject\" | \"extract\" | \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">" ], "path": "src/plugins/expressions/server/plugin.ts", "deprecated": false, @@ -14315,7 +14404,7 @@ "section": "def-common.ExpressionsService", "text": "ExpressionsService" }, - ", \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">, ", + ", \"inject\" | \"extract\" | \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">, ", { "pluginId": "expressions", "scope": "common", @@ -14408,7 +14497,7 @@ "section": "def-common.ExpressionsService", "text": "ExpressionsService" }, - ", \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">" + ", \"inject\" | \"extract\" | \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">" ], "path": "src/plugins/expressions/server/plugin.ts", "deprecated": false, @@ -14556,7 +14645,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-server.type", + "id": "def-server.ExpressionType.validate.$1", "type": "Any", "tags": [], "label": "type", @@ -18373,6 +18462,23 @@ "children": [], "returnComment": [] }, + { + "parentPluginId": "expressions", + "id": "def-server.IInterpreterRenderHandlers.isInteractive", + "type": "Function", + "tags": [], + "label": "isInteractive", + "description": [ + "\nThe chart is rendered in a non-interactive environment and should not provide any affordances for interaction like brushing." + ], + "signature": [ + "() => boolean" + ], + "path": "src/plugins/expressions/common/expression_renderers/types.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "expressions", "id": "def-server.IInterpreterRenderHandlers.isSyncColorsEnabled", @@ -18850,7 +18956,7 @@ "\nThis type represents the `type` of any `DatatableColumn` in a `Datatable`.\nits duplicated from KBN_FIELD_TYPES" ], "signature": [ - "\"string\" | \"number\" | \"boolean\" | \"object\" | \"date\" | \"ip\" | \"geo_point\" | \"_source\" | \"attachment\" | \"geo_shape\" | \"murmur3\" | \"unknown\" | \"conflict\" | \"nested\" | \"histogram\" | \"null\"" + "\"string\" | \"number\" | \"boolean\" | \"object\" | \"date\" | \"_source\" | \"attachment\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"murmur3\" | \"unknown\" | \"conflict\" | \"nested\" | \"histogram\" | \"null\"" ], "path": "src/plugins/expressions/common/expression_types/specs/datatable.ts", "deprecated": false, @@ -19100,7 +19206,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-server.input", + "id": "def-server.ExpressionValueConverter.$1", "type": "Uncategorized", "tags": [], "label": "input", @@ -19113,7 +19219,7 @@ }, { "parentPluginId": "expressions", - "id": "def-server.availableTypes", + "id": "def-server.ExpressionValueConverter.$2", "type": "Object", "tags": [], "label": "availableTypes", @@ -19518,7 +19624,43 @@ "label": "ExpressionsServerSetup", "description": [], "signature": [ - "{ readonly getType: (name: string) => ", + "{ readonly inject: (state: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpression", + "text": "ExpressionAstExpression" + }, + ", references: ", + "SavedObjectReference", + "[]) => ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpression", + "text": "ExpressionAstExpression" + }, + "; readonly extract: (state: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpression", + "text": "ExpressionAstExpression" + }, + ") => { state: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpression", + "text": "ExpressionAstExpression" + }, + "; references: ", + "SavedObjectReference", + "[]; }; readonly getType: (name: string) => ", { "pluginId": "expressions", "scope": "common", @@ -21664,7 +21806,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-common.input", + "id": "def-common.ExpressionFunction.fn.$1", "type": "Any", "tags": [], "label": "input", @@ -21677,7 +21819,7 @@ }, { "parentPluginId": "expressions", - "id": "def-common.params", + "id": "def-common.ExpressionFunction.fn.$2", "type": "Object", "tags": [], "label": "params", @@ -21690,7 +21832,7 @@ }, { "parentPluginId": "expressions", - "id": "def-common.handlers", + "id": "def-common.ExpressionFunction.fn.$3", "type": "Uncategorized", "tags": [], "label": "handlers", @@ -21777,7 +21919,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-common.state", + "id": "def-common.ExpressionFunction.telemetry.$1", "type": "Object", "tags": [], "label": "state", @@ -21798,7 +21940,7 @@ }, { "parentPluginId": "expressions", - "id": "def-common.telemetryData", + "id": "def-common.ExpressionFunction.telemetry.$2", "type": "Object", "tags": [], "label": "telemetryData", @@ -21845,7 +21987,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-common.state", + "id": "def-common.ExpressionFunction.extract.$1", "type": "Object", "tags": [], "label": "state", @@ -21900,7 +22042,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-common.state", + "id": "def-common.ExpressionFunction.inject.$1", "type": "Object", "tags": [], "label": "state", @@ -21921,7 +22063,7 @@ }, { "parentPluginId": "expressions", - "id": "def-common.references", + "id": "def-common.ExpressionFunction.inject.$2", "type": "Array", "tags": [], "label": "references", @@ -22316,7 +22458,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-common.domNode", + "id": "def-common.ExpressionRenderer.render.$1", "type": "Object", "tags": [], "label": "domNode", @@ -22329,7 +22471,7 @@ }, { "parentPluginId": "expressions", - "id": "def-common.config", + "id": "def-common.ExpressionRenderer.render.$2", "type": "Uncategorized", "tags": [], "label": "config", @@ -22342,7 +22484,7 @@ }, { "parentPluginId": "expressions", - "id": "def-common.handlers", + "id": "def-common.ExpressionRenderer.render.$3", "type": "Object", "tags": [], "label": "handlers", @@ -23294,7 +23436,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-common.ast", + "id": "def-common.ExpressionsService.execute.$1", "type": "CompoundType", "tags": [], "label": "ast", @@ -23314,7 +23456,7 @@ }, { "parentPluginId": "expressions", - "id": "def-common.input", + "id": "def-common.ExpressionsService.execute.$2", "type": "Uncategorized", "tags": [], "label": "input", @@ -23327,7 +23469,7 @@ }, { "parentPluginId": "expressions", - "id": "def-common.params", + "id": "def-common.ExpressionsService.execute.$3", "type": "Object", "tags": [], "label": "params", @@ -23667,7 +23809,7 @@ "section": "def-common.ExpressionsService", "text": "ExpressionsService" }, - ", \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">" + ", \"inject\" | \"extract\" | \"getType\" | \"registerType\" | \"getFunction\" | \"getFunctions\" | \"getRenderer\" | \"getRenderers\" | \"getTypes\" | \"registerFunction\" | \"registerRenderer\" | \"run\" | \"fork\">" ], "path": "src/plugins/expressions/common/service/expressions_services.ts", "deprecated": false, @@ -23796,7 +23938,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-common.type", + "id": "def-common.ExpressionType.validate.$1", "type": "Any", "tags": [], "label": "type", @@ -25044,7 +25186,7 @@ }, { "parentPluginId": "expressions", - "id": "def-common.buildResultColumns.$5.options", + "id": "def-common.buildResultColumns.$5", "type": "Object", "tags": [], "label": "options", @@ -25054,7 +25196,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-common.buildResultColumns.$5.options.allowColumnOverwrite", + "id": "def-common.buildResultColumns.$5.allowColumnOverwrite", "type": "boolean", "tags": [], "label": "allowColumnOverwrite", @@ -25068,6 +25210,29 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "expressions", + "id": "def-common.createDefaultInspectorAdapters", + "type": "Function", + "tags": [], + "label": "createDefaultInspectorAdapters", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.DefaultInspectorAdapters", + "text": "DefaultInspectorAdapters" + } + ], + "path": "src/plugins/expressions/common/util/create_default_inspector_adapters.ts", + "deprecated": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "expressions", "id": "def-common.createError", @@ -26425,7 +26590,7 @@ "label": "type", "description": [], "signature": [ - "\"string\" | \"number\" | \"boolean\" | \"object\" | \"date\" | \"ip\" | \"geo_point\" | \"_source\" | \"attachment\" | \"geo_shape\" | \"murmur3\" | \"unknown\" | \"conflict\" | \"nested\" | \"histogram\" | \"null\"" + "\"string\" | \"number\" | \"boolean\" | \"object\" | \"date\" | \"_source\" | \"attachment\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"murmur3\" | \"unknown\" | \"conflict\" | \"nested\" | \"histogram\" | \"null\"" ], "path": "src/plugins/expressions/common/expression_types/specs/datatable.ts", "deprecated": false @@ -30245,6 +30410,23 @@ "children": [], "returnComment": [] }, + { + "parentPluginId": "expressions", + "id": "def-common.IInterpreterRenderHandlers.isInteractive", + "type": "Function", + "tags": [], + "label": "isInteractive", + "description": [ + "\nThe chart is rendered in a non-interactive environment and should not provide any affordances for interaction like brushing." + ], + "signature": [ + "() => boolean" + ], + "path": "src/plugins/expressions/common/expression_renderers/types.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, { "parentPluginId": "expressions", "id": "def-common.IInterpreterRenderHandlers.isSyncColorsEnabled", @@ -31041,7 +31223,7 @@ "\nThis type represents the `type` of any `DatatableColumn` in a `Datatable`.\nits duplicated from KBN_FIELD_TYPES" ], "signature": [ - "\"string\" | \"number\" | \"boolean\" | \"object\" | \"date\" | \"ip\" | \"geo_point\" | \"_source\" | \"attachment\" | \"geo_shape\" | \"murmur3\" | \"unknown\" | \"conflict\" | \"nested\" | \"histogram\" | \"null\"" + "\"string\" | \"number\" | \"boolean\" | \"object\" | \"date\" | \"_source\" | \"attachment\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"murmur3\" | \"unknown\" | \"conflict\" | \"nested\" | \"histogram\" | \"null\"" ], "path": "src/plugins/expressions/common/expression_types/specs/datatable.ts", "deprecated": false, @@ -31828,7 +32010,43 @@ "\nThe public contract that `ExpressionsService` provides to other plugins\nin Kibana Platform in *setup* life-cycle." ], "signature": [ - "{ readonly getType: (name: string) => ", + "{ readonly inject: (state: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpression", + "text": "ExpressionAstExpression" + }, + ", references: ", + "SavedObjectReference", + "[]) => ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpression", + "text": "ExpressionAstExpression" + }, + "; readonly extract: (state: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpression", + "text": "ExpressionAstExpression" + }, + ") => { state: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpression", + "text": "ExpressionAstExpression" + }, + "; references: ", + "SavedObjectReference", + "[]; }; readonly getType: (name: string) => ", { "pluginId": "expressions", "scope": "common", @@ -32026,7 +32244,7 @@ "children": [ { "parentPluginId": "expressions", - "id": "def-common.input", + "id": "def-common.ExpressionValueConverter.$1", "type": "Uncategorized", "tags": [], "label": "input", @@ -32039,7 +32257,7 @@ }, { "parentPluginId": "expressions", - "id": "def-common.availableTypes", + "id": "def-common.ExpressionValueConverter.$2", "type": "Object", "tags": [], "label": "availableTypes", @@ -32505,10 +32723,10 @@ "tags": [], "label": "RenderMode", "description": [ - "\nMode of the expression render environment.\nThis value can be set from a consumer embedding an expression renderer and is accessible\nfrom within the active render function as part of the handlers.\nThe following modes are supported:\n* display (default): The chart is rendered in a container with the main purpose of viewing the chart (e.g. in a container like dashboard or canvas)\n* preview: The chart is rendered in very restricted space (below 100px width and height) and should only show a rough outline\n* edit: The chart is rendered within an editor and configuration elements within the chart should be displayed\n* noInteractivity: The chart is rendered in a non-interactive environment and should not provide any affordances for interaction like brushing" + "\nMode of the expression render environment.\nThis value can be set from a consumer embedding an expression renderer and is accessible\nfrom within the active render function as part of the handlers.\nThe following modes are supported:\n* view (default): The chart is rendered in a container with the main purpose of viewing the chart (e.g. in a container like dashboard or canvas)\n* preview: The chart is rendered in very restricted space (below 100px width and height) and should only show a rough outline\n* edit: The chart is rendered within an editor and configuration elements within the chart should be displayed" ], "signature": [ - "\"display\" | \"noInteractivity\" | \"edit\" | \"preview\"" + "\"edit\" | \"preview\" | \"view\"" ], "path": "src/plugins/expressions/common/expression_renderers/types.ts", "deprecated": false, @@ -35880,7 +36098,7 @@ "label": "types", "description": [], "signature": [ - "(\"number\" | \"boolean\" | \"string\" | \"null\")[]" + "(\"number\" | \"string\" | \"boolean\" | \"null\")[]" ], "path": "src/plugins/expressions/common/expression_functions/specs/map_column.ts", "deprecated": false diff --git a/api_docs/expressions.mdx b/api_docs/expressions.mdx index f549022adda71..4737d9fd0b976 100644 --- a/api_docs/expressions.mdx +++ b/api_docs/expressions.mdx @@ -10,7 +10,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex --- import expressionsObj from './expressions.json'; - +Adds expression runtime to Kibana Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2030 | 65 | 1595 | 4 | +| 2036 | 65 | 1598 | 4 | ## Client diff --git a/api_docs/features.json b/api_docs/features.json index 982c88d5f626c..14910879bdb50 100644 --- a/api_docs/features.json +++ b/api_docs/features.json @@ -2049,7 +2049,7 @@ "children": [ { "parentPluginId": "features", - "id": "def-server.feature", + "id": "def-server.PluginSetupContract.featurePrivilegeIterator.$1", "type": "Object", "tags": [], "label": "feature", @@ -2068,7 +2068,7 @@ }, { "parentPluginId": "features", - "id": "def-server.options", + "id": "def-server.PluginSetupContract.featurePrivilegeIterator.$2", "type": "Object", "tags": [], "label": "options", @@ -2115,7 +2115,7 @@ "children": [ { "parentPluginId": "features", - "id": "def-server.feature", + "id": "def-server.PluginSetupContract.subFeaturePrivilegeIterator.$1", "type": "Object", "tags": [], "label": "feature", @@ -2134,7 +2134,7 @@ }, { "parentPluginId": "features", - "id": "def-server.licenseHasAtLeast", + "id": "def-server.PluginSetupContract.subFeaturePrivilegeIterator.$2", "type": "Function", "tags": [], "label": "licenseHasAtLeast", @@ -2148,7 +2148,7 @@ "children": [ { "parentPluginId": "features", - "id": "def-server.licenseType", + "id": "def-server.PluginSetupContract.subFeaturePrivilegeIterator.$2.$1", "type": "CompoundType", "tags": [], "label": "licenseType", diff --git a/api_docs/field_formats.json b/api_docs/field_formats.json index aacc7f2975fb5..e9470305801fe 100644 --- a/api_docs/field_formats.json +++ b/api_docs/field_formats.json @@ -1739,83 +1739,6 @@ ], "initialIsOpen": false }, - { - "parentPluginId": "fieldFormats", - "id": "def-common.FieldFormatNotFoundError", - "type": "Class", - "tags": [], - "label": "FieldFormatNotFoundError", - "description": [], - "signature": [ - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormatNotFoundError", - "text": "FieldFormatNotFoundError" - }, - " extends Error" - ], - "path": "src/plugins/field_formats/common/errors.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "fieldFormats", - "id": "def-common.FieldFormatNotFoundError.formatId", - "type": "string", - "tags": [], - "label": "formatId", - "description": [], - "path": "src/plugins/field_formats/common/errors.ts", - "deprecated": false - }, - { - "parentPluginId": "fieldFormats", - "id": "def-common.FieldFormatNotFoundError.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/field_formats/common/errors.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "fieldFormats", - "id": "def-common.FieldFormatNotFoundError.Unnamed.$1", - "type": "string", - "tags": [], - "label": "message", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/field_formats/common/errors.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "fieldFormats", - "id": "def-common.FieldFormatNotFoundError.Unnamed.$2", - "type": "string", - "tags": [], - "label": "formatId", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/field_formats/common/errors.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, { "parentPluginId": "fieldFormats", "id": "def-common.FieldFormatsRegistry", @@ -2326,7 +2249,7 @@ "children": [ { "parentPluginId": "fieldFormats", - "id": "def-common.formatId", + "id": "def-common.FieldFormatsRegistry.getInstance.$1", "type": "string", "tags": [], "label": "formatId", @@ -2336,7 +2259,7 @@ }, { "parentPluginId": "fieldFormats", - "id": "def-common.params", + "id": "def-common.FieldFormatsRegistry.getInstance.$2", "type": "Object", "tags": [], "label": "params", @@ -2546,7 +2469,7 @@ "children": [ { "parentPluginId": "fieldFormats", - "id": "def-common.fieldType", + "id": "def-common.FieldFormatsRegistry.getDefaultInstance.$1", "type": "Enum", "tags": [], "label": "fieldType", @@ -2559,7 +2482,7 @@ }, { "parentPluginId": "fieldFormats", - "id": "def-common.esTypes", + "id": "def-common.FieldFormatsRegistry.getDefaultInstance.$2", "type": "Array", "tags": [], "label": "esTypes", @@ -2573,7 +2496,7 @@ }, { "parentPluginId": "fieldFormats", - "id": "def-common.params", + "id": "def-common.FieldFormatsRegistry.getDefaultInstance.$3", "type": "Object", "tags": [], "label": "params", @@ -4255,7 +4178,7 @@ "children": [ { "parentPluginId": "fieldFormats", - "id": "def-common.key", + "id": "def-common.FieldFormatsGetConfigFn.$1", "type": "string", "tags": [], "label": "key", @@ -4265,7 +4188,7 @@ }, { "parentPluginId": "fieldFormats", - "id": "def-common.defaultOverride", + "id": "def-common.FieldFormatsGetConfigFn.$2", "type": "Uncategorized", "tags": [], "label": "defaultOverride", @@ -4406,7 +4329,7 @@ "children": [ { "parentPluginId": "fieldFormats", - "id": "def-common.mapping", + "id": "def-common.FormatFactory.$1", "type": "Object", "tags": [], "label": "mapping", @@ -4479,8 +4402,6 @@ }, ", metaParamsOptions?: Record, defaultFieldConverters?: ", "FieldFormatInstanceType", - "[]) => void; register: (fieldFormats: ", - "FieldFormatInstanceType", "[]) => void; deserialize: ", { "pluginId": "fieldFormats", @@ -4489,7 +4410,9 @@ "section": "def-common.FormatFactory", "text": "FormatFactory" }, - "; getDefaultConfig: (fieldType: ", + "; register: (fieldFormats: ", + "FieldFormatInstanceType", + "[]) => void; getDefaultConfig: (fieldType: ", "KBN_FIELD_TYPES", ", esTypes?: ", "ES_FIELD_TYPES", diff --git a/api_docs/field_formats.mdx b/api_docs/field_formats.mdx index 097ed65543147..8dcd794982310 100644 --- a/api_docs/field_formats.mdx +++ b/api_docs/field_formats.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 268 | 26 | 238 | 10 | +| 263 | 26 | 233 | 10 | ## Client diff --git a/api_docs/fleet.json b/api_docs/fleet.json index 4fbf843179c9c..4131c8c969e58 100644 --- a/api_docs/fleet.json +++ b/api_docs/fleet.json @@ -562,7 +562,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-public.props", + "id": "def-public.PackageAssetsExtension.Component.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -661,7 +661,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-public.props", + "id": "def-public.PackageCustomExtension.Component.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -893,7 +893,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-public.props", + "id": "def-public.PackagePolicyCreateExtension.Component.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -965,7 +965,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-public.PackagePolicyCreateExtensionComponentProps.onChange.$1.opts", + "id": "def-public.PackagePolicyCreateExtensionComponentProps.onChange.$1", "type": "Object", "tags": [], "label": "opts", @@ -975,7 +975,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-public.PackagePolicyCreateExtensionComponentProps.onChange.$1.opts.isValid", + "id": "def-public.PackagePolicyCreateExtensionComponentProps.onChange.$1.isValid", "type": "boolean", "tags": [], "label": "isValid", @@ -987,7 +987,7 @@ }, { "parentPluginId": "fleet", - "id": "def-public.PackagePolicyCreateExtensionComponentProps.onChange.$1.opts.updatedPolicy", + "id": "def-public.PackagePolicyCreateExtensionComponentProps.onChange.$1.updatedPolicy", "type": "Object", "tags": [], "label": "updatedPolicy", @@ -1097,7 +1097,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-public.props", + "id": "def-public.PackagePolicyEditExtension.Component.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -1190,7 +1190,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-public.PackagePolicyEditExtensionComponentProps.onChange.$1.opts", + "id": "def-public.PackagePolicyEditExtensionComponentProps.onChange.$1", "type": "Object", "tags": [], "label": "opts", @@ -1200,7 +1200,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-public.PackagePolicyEditExtensionComponentProps.onChange.$1.opts.isValid", + "id": "def-public.PackagePolicyEditExtensionComponentProps.onChange.$1.isValid", "type": "boolean", "tags": [], "label": "isValid", @@ -1212,7 +1212,7 @@ }, { "parentPluginId": "fleet", - "id": "def-public.PackagePolicyEditExtensionComponentProps.onChange.$1.opts.updatedPolicy", + "id": "def-public.PackagePolicyEditExtensionComponentProps.onChange.$1.updatedPolicy", "type": "Object", "tags": [], "label": "updatedPolicy", @@ -1585,7 +1585,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-public.extensionPoint", + "id": "def-public.UIExtensionRegistrationCallback.$1", "type": "CompoundType", "tags": [], "label": "extensionPoint", @@ -2295,7 +2295,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-public.extensionPoint", + "id": "def-public.FleetStart.registerExtension.$1", "type": "CompoundType", "tags": [], "label": "extensionPoint", @@ -2500,7 +2500,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-server.soClient", + "id": "def-server.AgentPolicyServiceInterface.get.$1", "type": "Object", "tags": [], "label": "soClient", @@ -2813,7 +2813,7 @@ }, { "parentPluginId": "fleet", - "id": "def-server.id", + "id": "def-server.AgentPolicyServiceInterface.get.$2", "type": "string", "tags": [], "label": "id", @@ -2823,7 +2823,7 @@ }, { "parentPluginId": "fleet", - "id": "def-server.withPackagePolicies", + "id": "def-server.AgentPolicyServiceInterface.get.$3", "type": "boolean", "tags": [], "label": "withPackagePolicies", @@ -2865,7 +2865,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-server.soClient", + "id": "def-server.AgentPolicyServiceInterface.list.$1", "type": "Object", "tags": [], "label": "soClient", @@ -3178,7 +3178,7 @@ }, { "parentPluginId": "fleet", - "id": "def-server.options", + "id": "def-server.AgentPolicyServiceInterface.list.$2", "type": "CompoundType", "tags": [], "label": "options", @@ -3215,7 +3215,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-server.soClient", + "id": "def-server.AgentPolicyServiceInterface.getDefaultAgentPolicyId.$1", "type": "Object", "tags": [], "label": "soClient", @@ -3560,7 +3560,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-server.soClient", + "id": "def-server.AgentPolicyServiceInterface.getFullAgentPolicy.$1", "type": "Object", "tags": [], "label": "soClient", @@ -3873,7 +3873,7 @@ }, { "parentPluginId": "fleet", - "id": "def-server.id", + "id": "def-server.AgentPolicyServiceInterface.getFullAgentPolicy.$2", "type": "string", "tags": [], "label": "id", @@ -3883,7 +3883,7 @@ }, { "parentPluginId": "fleet", - "id": "def-server.options", + "id": "def-server.AgentPolicyServiceInterface.getFullAgentPolicy.$3", "type": "Object", "tags": [], "label": "options", @@ -3928,7 +3928,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-server.soClient", + "id": "def-server.AgentPolicyServiceInterface.getByIds.$1", "type": "Object", "tags": [], "label": "soClient", @@ -4241,7 +4241,7 @@ }, { "parentPluginId": "fleet", - "id": "def-server.ids", + "id": "def-server.AgentPolicyServiceInterface.getByIds.$2", "type": "Array", "tags": [], "label": "ids", @@ -4254,7 +4254,7 @@ }, { "parentPluginId": "fleet", - "id": "def-server.options", + "id": "def-server.AgentPolicyServiceInterface.getByIds.$3", "type": "Object", "tags": [], "label": "options", @@ -4316,7 +4316,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-server.esClient", + "id": "def-server.AgentService.getAgent.$1", "type": "CompoundType", "tags": [], "label": "esClient", @@ -4324,7 +4324,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"count\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"count\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", @@ -4339,7 +4339,7 @@ }, { "parentPluginId": "fleet", - "id": "def-server.agentId", + "id": "def-server.AgentService.getAgent.$2", "type": "string", "tags": [], "label": "agentId", @@ -4608,7 +4608,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-server.esClient", + "id": "def-server.AgentService.listAgents.$1", "type": "CompoundType", "tags": [], "label": "esClient", @@ -4616,7 +4616,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"count\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"count\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", @@ -4631,7 +4631,7 @@ }, { "parentPluginId": "fleet", - "id": "def-server.options", + "id": "def-server.AgentService.listAgents.$2", "type": "CompoundType", "tags": [], "label": "options", @@ -5195,7 +5195,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-server.options", + "id": "def-server.PackageService.getInstallation.$1", "type": "Object", "tags": [], "label": "options", @@ -5318,7 +5318,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-server.newPackagePolicy", + "id": "def-server.PostPackagePolicyCreateCallback.$1", "type": "Object", "tags": [], "label": "newPackagePolicy", @@ -5337,7 +5337,7 @@ }, { "parentPluginId": "fleet", - "id": "def-server.context", + "id": "def-server.PostPackagePolicyCreateCallback.$2", "type": "Object", "tags": [], "label": "context", @@ -5356,7 +5356,7 @@ }, { "parentPluginId": "fleet", - "id": "def-server.request", + "id": "def-server.PostPackagePolicyCreateCallback.$3", "type": "Object", "tags": [], "label": "request", @@ -5403,7 +5403,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-server.deletedPackagePolicies", + "id": "def-server.PostPackagePolicyDeleteCallback.$1", "type": "Object", "tags": [], "label": "deletedPackagePolicies", @@ -5474,7 +5474,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-server.updatePackagePolicy", + "id": "def-server.PutPackagePolicyUpdateCallback.$1", "type": "Object", "tags": [], "label": "updatePackagePolicy", @@ -5493,7 +5493,7 @@ }, { "parentPluginId": "fleet", - "id": "def-server.context", + "id": "def-server.PutPackagePolicyUpdateCallback.$2", "type": "Object", "tags": [], "label": "context", @@ -5512,7 +5512,7 @@ }, { "parentPluginId": "fleet", - "id": "def-server.request", + "id": "def-server.PutPackagePolicyUpdateCallback.$3", "type": "Object", "tags": [], "label": "request", @@ -6361,7 +6361,7 @@ "children": [ { "parentPluginId": "fleet", - "id": "def-common.o", + "id": "def-common.entries.$1", "type": "Uncategorized", "tags": [], "label": "o", @@ -6391,7 +6391,7 @@ "section": "def-common.FullAgentPolicy", "text": "FullAgentPolicy" }, - ") => string" + ", toYaml: (obj: any, opts?: jsyaml.DumpOptions | undefined) => string) => string" ], "path": "x-pack/plugins/fleet/common/services/full_agent_policy_to_yaml.ts", "deprecated": false, @@ -6415,6 +6415,20 @@ "path": "x-pack/plugins/fleet/common/services/full_agent_policy_to_yaml.ts", "deprecated": false, "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-common.fullAgentPolicyToYaml.$2", + "type": "Function", + "tags": [], + "label": "toYaml", + "description": [], + "signature": [ + "typeof jsyaml.safeDump" + ], + "path": "x-pack/plugins/fleet/common/services/full_agent_policy_to_yaml.ts", + "deprecated": false, + "isRequired": true } ], "returnComment": [], @@ -6981,7 +6995,7 @@ "section": "def-common.PackageInfo", "text": "PackageInfo" }, - ") => ", + ", safeLoadYaml: (yaml: string) => any) => ", { "pluginId": "fleet", "scope": "common", @@ -7032,6 +7046,20 @@ "path": "x-pack/plugins/fleet/common/services/validate_package_policy.ts", "deprecated": false, "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-common.validatePackagePolicy.$3", + "type": "Function", + "tags": [], + "label": "safeLoadYaml", + "description": [], + "signature": [ + "(yaml: string) => any" + ], + "path": "x-pack/plugins/fleet/common/services/validate_package_policy.ts", + "deprecated": false, + "isRequired": true } ], "returnComment": [], @@ -7061,7 +7089,7 @@ "section": "def-common.RegistryVarsEntry", "text": "RegistryVarsEntry" }, - ") => string[] | null" + ", varName: string, safeLoadYaml: (yaml: string) => any) => string[] | null" ], "path": "x-pack/plugins/fleet/common/services/validate_package_policy.ts", "deprecated": false, @@ -7105,6 +7133,34 @@ "path": "x-pack/plugins/fleet/common/services/validate_package_policy.ts", "deprecated": false, "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-common.validatePackagePolicyConfig.$3", + "type": "string", + "tags": [], + "label": "varName", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/plugins/fleet/common/services/validate_package_policy.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-common.validatePackagePolicyConfig.$4", + "type": "Function", + "tags": [], + "label": "safeLoadYaml", + "description": [], + "signature": [ + "(yaml: string) => any" + ], + "path": "x-pack/plugins/fleet/common/services/validate_package_policy.ts", + "deprecated": false, + "isRequired": true } ], "returnComment": [], diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index 62690379e3838..890b1deec314f 100644 --- a/api_docs/fleet.mdx +++ b/api_docs/fleet.mdx @@ -18,7 +18,7 @@ Contact [Fleet](https://github.com/orgs/elastic/teams/fleet) for questions regar | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 1166 | 15 | 1065 | 11 | +| 1170 | 15 | 1069 | 11 | ## Client diff --git a/api_docs/home.json b/api_docs/home.json index 04a4bd8fd7daf..e6ba63fddef98 100644 --- a/api_docs/home.json +++ b/api_docs/home.json @@ -434,7 +434,7 @@ "children": [ { "parentPluginId": "home", - "id": "def-public.props", + "id": "def-public.TutorialDirectoryHeaderLinkComponent.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -447,7 +447,7 @@ }, { "parentPluginId": "home", - "id": "def-public.context", + "id": "def-public.TutorialDirectoryHeaderLinkComponent.$2", "type": "Any", "tags": [], "label": "context", @@ -477,7 +477,7 @@ "children": [ { "parentPluginId": "home", - "id": "def-public.props", + "id": "def-public.TutorialDirectoryNoticeComponent.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -490,7 +490,7 @@ }, { "parentPluginId": "home", - "id": "def-public.context", + "id": "def-public.TutorialDirectoryNoticeComponent.$2", "type": "Any", "tags": [], "label": "context", @@ -520,7 +520,7 @@ "children": [ { "parentPluginId": "home", - "id": "def-public.props", + "id": "def-public.TutorialModuleNoticeComponent.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -533,7 +533,7 @@ }, { "parentPluginId": "home", - "id": "def-public.context", + "id": "def-public.TutorialModuleNoticeComponent.$2", "type": "Any", "tags": [], "label": "context", @@ -1029,7 +1029,7 @@ "children": [ { "parentPluginId": "home", - "id": "def-server.context", + "id": "def-server.TutorialProvider.$1", "type": "Object", "tags": [], "label": "context", diff --git a/api_docs/index_pattern_editor.json b/api_docs/index_pattern_editor.json index 7a316de34674a..689ac05ff4698 100644 --- a/api_docs/index_pattern_editor.json +++ b/api_docs/index_pattern_editor.json @@ -194,7 +194,7 @@ "children": [ { "parentPluginId": "indexPatternEditor", - "id": "def-public.props", + "id": "def-public.PluginStart.IndexPatternEditorComponent.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -207,7 +207,7 @@ }, { "parentPluginId": "indexPatternEditor", - "id": "def-public.context", + "id": "def-public.PluginStart.IndexPatternEditorComponent.$2", "type": "Any", "tags": [], "label": "context", diff --git a/api_docs/index_pattern_field_editor.json b/api_docs/index_pattern_field_editor.json index 25cb2cb1d6ea9..ffc484237af19 100644 --- a/api_docs/index_pattern_field_editor.json +++ b/api_docs/index_pattern_field_editor.json @@ -249,7 +249,7 @@ "children": [ { "parentPluginId": "indexPatternFieldEditor", - "id": "def-public.FormatEditorProps.onChange.$1.newParams", + "id": "def-public.FormatEditorProps.onChange.$1", "type": "Object", "tags": [], "label": "newParams", @@ -259,7 +259,7 @@ "children": [ { "parentPluginId": "indexPatternFieldEditor", - "id": "def-public.FormatEditorProps.onChange.$1.newParams.Unnamed", + "id": "def-public.FormatEditorProps.onChange.$1.Unnamed", "type": "Any", "tags": [], "label": "Unnamed", @@ -291,7 +291,7 @@ "children": [ { "parentPluginId": "indexPatternFieldEditor", - "id": "def-public.error", + "id": "def-public.FormatEditorProps.onError.$1", "type": "string", "tags": [], "label": "error", @@ -731,7 +731,7 @@ "children": [ { "parentPluginId": "indexPatternFieldEditor", - "id": "def-public.props", + "id": "def-public.PluginStart.DeleteRuntimeFieldProvider.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -744,7 +744,7 @@ }, { "parentPluginId": "indexPatternFieldEditor", - "id": "def-public.context", + "id": "def-public.PluginStart.DeleteRuntimeFieldProvider.$2", "type": "Any", "tags": [], "label": "context", diff --git a/api_docs/infra.json b/api_docs/infra.json index 5e40eab3a0c0f..ef40586c65d8d 100644 --- a/api_docs/infra.json +++ b/api_docs/infra.json @@ -145,7 +145,7 @@ "children": [ { "parentPluginId": "infra", - "id": "def-public.val", + "id": "def-public.FORMATTERS.number.$1", "type": "number", "tags": [], "label": "val", @@ -173,7 +173,7 @@ "children": [ { "parentPluginId": "infra", - "id": "def-public.bytes", + "id": "def-public.FORMATTERS.abbreviatedNumber.$1", "type": "number", "tags": [], "label": "bytes", @@ -201,7 +201,7 @@ "children": [ { "parentPluginId": "infra", - "id": "def-public.bytes", + "id": "def-public.FORMATTERS.bytes.$1", "type": "number", "tags": [], "label": "bytes", @@ -229,7 +229,7 @@ "children": [ { "parentPluginId": "infra", - "id": "def-public.bytes", + "id": "def-public.FORMATTERS.bits.$1", "type": "number", "tags": [], "label": "bytes", @@ -255,7 +255,7 @@ "children": [ { "parentPluginId": "infra", - "id": "def-public.val", + "id": "def-public.FORMATTERS.percent.$1", "type": "number", "tags": [], "label": "val", @@ -281,7 +281,7 @@ "children": [ { "parentPluginId": "infra", - "id": "def-public.val", + "id": "def-public.FORMATTERS.highPercision.$1", "type": "number", "tags": [], "label": "val", diff --git a/api_docs/inspector.json b/api_docs/inspector.json index a664d83be259b..964b5b25814a4 100644 --- a/api_docs/inspector.json +++ b/api_docs/inspector.json @@ -168,6 +168,8 @@ "section": "def-public.CoreStart", "text": "CoreStart" }, + ", startDeps: ", + "InspectorPluginStartDeps", ") => { isAvailable: (adapters?: ", { "pluginId": "inspector", @@ -224,6 +226,20 @@ "path": "src/plugins/inspector/public/plugin.tsx", "deprecated": false, "isRequired": true + }, + { + "parentPluginId": "inspector", + "id": "def-public.InspectorPublicPlugin.start.$2", + "type": "Object", + "tags": [], + "label": "startDeps", + "description": [], + "signature": [ + "InspectorPluginStartDeps" + ], + "path": "src/plugins/inspector/public/plugin.tsx", + "deprecated": false, + "isRequired": true } ], "returnComment": [] @@ -299,7 +315,7 @@ "signature": [ "(name: string, params?: ", "RequestParams", - ") => ", + ", startTime?: number) => ", { "pluginId": "inspector", "scope": "common", @@ -333,13 +349,31 @@ "type": "Object", "tags": [], "label": "params", - "description": [], + "description": [ + "Additional arguments for the request." + ], "signature": [ "RequestParams" ], "path": "src/plugins/inspector/common/adapters/request/request_adapter.ts", "deprecated": false, "isRequired": true + }, + { + "parentPluginId": "inspector", + "id": "def-public.RequestAdapter.start.$3", + "type": "number", + "tags": [], + "label": "startTime", + "description": [ + "Set an optional start time for the request" + ], + "signature": [ + "number" + ], + "path": "src/plugins/inspector/common/adapters/request/request_adapter.ts", + "deprecated": false, + "isRequired": true } ], "returnComment": [ @@ -400,7 +434,13 @@ "description": [], "signature": [ "() => ", - "Request", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Request", + "text": "Request" + }, "[]" ], "path": "src/plugins/inspector/common/adapters/request/request_adapter.ts", @@ -444,7 +484,13 @@ "label": "request", "description": [], "signature": [ - "Request" + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Request", + "text": "Request" + } ], "path": "src/plugins/inspector/common/adapters/request/request_responder.ts", "deprecated": false, @@ -986,6 +1032,139 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "inspector", + "id": "def-public.Request", + "type": "Interface", + "tags": [], + "label": "Request", + "description": [], + "signature": [ + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Request", + "text": "Request" + }, + " extends ", + "RequestParams" + ], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "inspector", + "id": "def-public.Request.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false + }, + { + "parentPluginId": "inspector", + "id": "def-public.Request.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false + }, + { + "parentPluginId": "inspector", + "id": "def-public.Request.json", + "type": "Uncategorized", + "tags": [], + "label": "json", + "description": [], + "signature": [ + "object | undefined" + ], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false + }, + { + "parentPluginId": "inspector", + "id": "def-public.Request.response", + "type": "Object", + "tags": [], + "label": "response", + "description": [], + "signature": [ + "Response", + " | undefined" + ], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false + }, + { + "parentPluginId": "inspector", + "id": "def-public.Request.startTime", + "type": "number", + "tags": [], + "label": "startTime", + "description": [], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false + }, + { + "parentPluginId": "inspector", + "id": "def-public.Request.stats", + "type": "Object", + "tags": [], + "label": "stats", + "description": [], + "signature": [ + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.RequestStatistics", + "text": "RequestStatistics" + }, + " | undefined" + ], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false + }, + { + "parentPluginId": "inspector", + "id": "def-public.Request.status", + "type": "Enum", + "tags": [], + "label": "status", + "description": [], + "signature": [ + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.RequestStatus", + "text": "RequestStatus" + } + ], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false + }, + { + "parentPluginId": "inspector", + "id": "def-public.Request.time", + "type": "number", + "tags": [], + "label": "time", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "inspector", "id": "def-public.RequestStatistic", @@ -1134,7 +1313,7 @@ "children": [ { "parentPluginId": "inspector", - "id": "def-public.view", + "id": "def-public.Setup.registerView.$1", "type": "Object", "tags": [], "label": "view", @@ -1392,7 +1571,7 @@ "signature": [ "(name: string, params?: ", "RequestParams", - ") => ", + ", startTime?: number) => ", { "pluginId": "inspector", "scope": "common", @@ -1426,13 +1605,31 @@ "type": "Object", "tags": [], "label": "params", - "description": [], + "description": [ + "Additional arguments for the request." + ], "signature": [ "RequestParams" ], "path": "src/plugins/inspector/common/adapters/request/request_adapter.ts", "deprecated": false, "isRequired": true + }, + { + "parentPluginId": "inspector", + "id": "def-common.RequestAdapter.start.$3", + "type": "number", + "tags": [], + "label": "startTime", + "description": [ + "Set an optional start time for the request" + ], + "signature": [ + "number" + ], + "path": "src/plugins/inspector/common/adapters/request/request_adapter.ts", + "deprecated": false, + "isRequired": true } ], "returnComment": [ @@ -1493,7 +1690,13 @@ "description": [], "signature": [ "() => ", - "Request", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Request", + "text": "Request" + }, "[]" ], "path": "src/plugins/inspector/common/adapters/request/request_adapter.ts", @@ -1537,7 +1740,13 @@ "label": "request", "description": [], "signature": [ - "Request" + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Request", + "text": "Request" + } ], "path": "src/plugins/inspector/common/adapters/request/request_responder.ts", "deprecated": false, @@ -1826,6 +2035,139 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "inspector", + "id": "def-common.Request", + "type": "Interface", + "tags": [], + "label": "Request", + "description": [], + "signature": [ + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Request", + "text": "Request" + }, + " extends ", + "RequestParams" + ], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "inspector", + "id": "def-common.Request.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false + }, + { + "parentPluginId": "inspector", + "id": "def-common.Request.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false + }, + { + "parentPluginId": "inspector", + "id": "def-common.Request.json", + "type": "Uncategorized", + "tags": [], + "label": "json", + "description": [], + "signature": [ + "object | undefined" + ], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false + }, + { + "parentPluginId": "inspector", + "id": "def-common.Request.response", + "type": "Object", + "tags": [], + "label": "response", + "description": [], + "signature": [ + "Response", + " | undefined" + ], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false + }, + { + "parentPluginId": "inspector", + "id": "def-common.Request.startTime", + "type": "number", + "tags": [], + "label": "startTime", + "description": [], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false + }, + { + "parentPluginId": "inspector", + "id": "def-common.Request.stats", + "type": "Object", + "tags": [], + "label": "stats", + "description": [], + "signature": [ + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.RequestStatistics", + "text": "RequestStatistics" + }, + " | undefined" + ], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false + }, + { + "parentPluginId": "inspector", + "id": "def-common.Request.status", + "type": "Enum", + "tags": [], + "label": "status", + "description": [], + "signature": [ + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.RequestStatus", + "text": "RequestStatus" + } + ], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false + }, + { + "parentPluginId": "inspector", + "id": "def-common.Request.time", + "type": "number", + "tags": [], + "label": "time", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "src/plugins/inspector/common/adapters/request/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "inspector", "id": "def-common.RequestStatistic", diff --git a/api_docs/inspector.mdx b/api_docs/inspector.mdx index d2626b2d5b1ec..2b1be2406e618 100644 --- a/api_docs/inspector.mdx +++ b/api_docs/inspector.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 102 | 6 | 79 | 4 | +| 123 | 6 | 96 | 4 | ## Client diff --git a/api_docs/interactive_setup.json b/api_docs/interactive_setup.json index 58493ba648122..b10a3bd9f149a 100644 --- a/api_docs/interactive_setup.json +++ b/api_docs/interactive_setup.json @@ -20,6 +20,85 @@ "classes": [], "functions": [], "interfaces": [ + { + "parentPluginId": "interactiveSetup", + "id": "def-common.Certificate", + "type": "Interface", + "tags": [], + "label": "Certificate", + "description": [], + "path": "src/plugins/interactive_setup/common/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "interactiveSetup", + "id": "def-common.Certificate.issuer", + "type": "Object", + "tags": [], + "label": "issuer", + "description": [], + "signature": [ + "{ C?: string | undefined; ST?: string | undefined; L?: string | undefined; O?: string | undefined; OU?: string | undefined; CN?: string | undefined; }" + ], + "path": "src/plugins/interactive_setup/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "interactiveSetup", + "id": "def-common.Certificate.valid_from", + "type": "string", + "tags": [], + "label": "valid_from", + "description": [], + "path": "src/plugins/interactive_setup/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "interactiveSetup", + "id": "def-common.Certificate.valid_to", + "type": "string", + "tags": [], + "label": "valid_to", + "description": [], + "path": "src/plugins/interactive_setup/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "interactiveSetup", + "id": "def-common.Certificate.subject", + "type": "Object", + "tags": [], + "label": "subject", + "description": [], + "signature": [ + "{ C?: string | undefined; ST?: string | undefined; L?: string | undefined; O?: string | undefined; OU?: string | undefined; CN?: string | undefined; }" + ], + "path": "src/plugins/interactive_setup/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "interactiveSetup", + "id": "def-common.Certificate.fingerprint256", + "type": "string", + "tags": [], + "label": "fingerprint256", + "description": [], + "path": "src/plugins/interactive_setup/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "interactiveSetup", + "id": "def-common.Certificate.raw", + "type": "string", + "tags": [], + "label": "raw", + "description": [], + "path": "src/plugins/interactive_setup/common/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "interactiveSetup", "id": "def-common.EnrollmentToken", @@ -121,6 +200,53 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "interactiveSetup", + "id": "def-common.PingResult", + "type": "Interface", + "tags": [], + "label": "PingResult", + "description": [], + "path": "src/plugins/interactive_setup/common/types.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "interactiveSetup", + "id": "def-common.PingResult.authRequired", + "type": "boolean", + "tags": [], + "label": "authRequired", + "description": [ + "\nIndicates whether the cluster requires authentication." + ], + "path": "src/plugins/interactive_setup/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "interactiveSetup", + "id": "def-common.PingResult.certificateChain", + "type": "Array", + "tags": [], + "label": "certificateChain", + "description": [ + "\nFull certificate chain of cluster at requested address. Only present if cluster uses HTTPS." + ], + "signature": [ + { + "pluginId": "interactiveSetup", + "scope": "common", + "docId": "kibInteractiveSetupPluginApi", + "section": "def-common.Certificate", + "text": "Certificate" + }, + "[] | undefined" + ], + "path": "src/plugins/interactive_setup/common/types.ts", + "deprecated": false + } + ], + "initialIsOpen": false } ], "enums": [ @@ -138,7 +264,22 @@ "initialIsOpen": false } ], - "misc": [], + "misc": [ + { + "parentPluginId": "interactiveSetup", + "id": "def-common.VERIFICATION_CODE_LENGTH", + "type": "number", + "tags": [], + "label": "VERIFICATION_CODE_LENGTH", + "description": [], + "signature": [ + "6" + ], + "path": "src/plugins/interactive_setup/common/constants.ts", + "deprecated": false, + "initialIsOpen": false + } + ], "objects": [] } } \ No newline at end of file diff --git a/api_docs/interactive_setup.mdx b/api_docs/interactive_setup.mdx index 00767b65e59d5..b38b8168bcfef 100644 --- a/api_docs/interactive_setup.mdx +++ b/api_docs/interactive_setup.mdx @@ -18,7 +18,7 @@ Contact [Platform Security](https://github.com/orgs/elastic/teams/kibana-securit | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 8 | 0 | 0 | 0 | +| 19 | 0 | 9 | 0 | ## Common @@ -28,3 +28,6 @@ Contact [Platform Security](https://github.com/orgs/elastic/teams/kibana-securit ### Enums +### Consts, variables and types + + diff --git a/api_docs/kibana_legacy.json b/api_docs/kibana_legacy.json index ccb56e5b8a28c..7753ea9057e0c 100644 --- a/api_docs/kibana_legacy.json +++ b/api_docs/kibana_legacy.json @@ -12,43 +12,6 @@ "path": "src/plugins/kibana_legacy/public/plugin.ts", "deprecated": false, "children": [ - { - "parentPluginId": "kibanaLegacy", - "id": "def-public.KibanaLegacyPlugin.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/kibana_legacy/public/plugin.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "kibanaLegacy", - "id": "def-public.KibanaLegacyPlugin.Unnamed.$1", - "type": "Object", - "tags": [], - "label": "initializerContext", - "description": [], - "signature": [ - { - "pluginId": "core", - "scope": "public", - "docId": "kibCorePluginApi", - "section": "def-public.PluginInitializerContext", - "text": "PluginInitializerContext" - }, - ">" - ], - "path": "src/plugins/kibana_legacy/public/plugin.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, { "parentPluginId": "kibanaLegacy", "id": "def-public.KibanaLegacyPlugin.setup", @@ -65,7 +28,7 @@ "section": "def-public.CoreSetup", "text": "CoreSetup" }, - "<{}, { loadFontAwesome: () => Promise; loadAngularBootstrap: () => Promise; config: Readonly<{} & { defaultAppId: string; }>; }>) => {}" + "<{}, { loadFontAwesome: () => Promise; loadAngularBootstrap: () => Promise; }>) => {}" ], "path": "src/plugins/kibana_legacy/public/plugin.ts", "deprecated": false, @@ -85,7 +48,7 @@ "section": "def-public.CoreSetup", "text": "CoreSetup" }, - "<{}, { loadFontAwesome: () => Promise; loadAngularBootstrap: () => Promise; config: Readonly<{} & { defaultAppId: string; }>; }>" + "<{}, { loadFontAwesome: () => Promise; loadAngularBootstrap: () => Promise; }>" ], "path": "src/plugins/kibana_legacy/public/plugin.ts", "deprecated": false, @@ -102,7 +65,7 @@ "label": "start", "description": [], "signature": [ - "({ application, http: { basePath }, uiSettings }: ", + "({ uiSettings }: ", { "pluginId": "core", "scope": "public", @@ -110,7 +73,7 @@ "section": "def-public.CoreStart", "text": "CoreStart" }, - ") => { loadFontAwesome: () => Promise; loadAngularBootstrap: () => Promise; config: Readonly<{} & { defaultAppId: string; }>; }" + ") => { loadFontAwesome: () => Promise; loadAngularBootstrap: () => Promise; }" ], "path": "src/plugins/kibana_legacy/public/plugin.ts", "deprecated": false, @@ -120,7 +83,7 @@ "id": "def-public.KibanaLegacyPlugin.start.$1", "type": "Object", "tags": [], - "label": "{ application, http: { basePath }, uiSettings }", + "label": "{ uiSettings }", "description": [], "signature": [ { @@ -305,7 +268,7 @@ }, { "parentPluginId": "kibanaLegacy", - "id": "def-public.configureAppAngularModule.$2.newPlatform", + "id": "def-public.configureAppAngularModule.$2", "type": "Object", "tags": [], "label": "newPlatform", @@ -315,7 +278,7 @@ "children": [ { "parentPluginId": "kibanaLegacy", - "id": "def-public.configureAppAngularModule.$2.newPlatform.core", + "id": "def-public.configureAppAngularModule.$2.core", "type": "Object", "tags": [], "label": "core", @@ -334,7 +297,7 @@ }, { "parentPluginId": "kibanaLegacy", - "id": "def-public.configureAppAngularModule.$2.newPlatform.env", + "id": "def-public.configureAppAngularModule.$2.env", "type": "Object", "tags": [], "label": "env", @@ -401,7 +364,7 @@ "children": [ { "parentPluginId": "kibanaLegacy", - "id": "def-public.options", + "id": "def-public.createTopNavHelper.$1", "type": "Unknown", "tags": [], "label": "options", @@ -1092,7 +1055,7 @@ "children": [ { "parentPluginId": "kibanaLegacy", - "id": "def-public.provider", + "id": "def-public.IPrivate.$1", "type": "Function", "tags": [], "label": "provider", @@ -1106,7 +1069,7 @@ "children": [ { "parentPluginId": "kibanaLegacy", - "id": "def-public.injectable", + "id": "def-public.IPrivate.$1.$1", "type": "Array", "tags": [], "label": "injectable", @@ -1158,7 +1121,7 @@ "label": "KibanaLegacyStart", "description": [], "signature": [ - "{ loadFontAwesome: () => Promise; loadAngularBootstrap: () => Promise; config: Readonly<{} & { defaultAppId: string; }>; }" + "{ loadFontAwesome: () => Promise; loadAngularBootstrap: () => Promise; }" ], "path": "src/plugins/kibana_legacy/public/plugin.ts", "deprecated": false, diff --git a/api_docs/kibana_legacy.mdx b/api_docs/kibana_legacy.mdx index 5b826d4ad494e..f9b560605beb7 100644 --- a/api_docs/kibana_legacy.mdx +++ b/api_docs/kibana_legacy.mdx @@ -12,13 +12,13 @@ import kibanaLegacyObj from './kibana_legacy.json'; -Contact [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. **Code health stats** | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 70 | 3 | 66 | 0 | +| 68 | 3 | 64 | 0 | ## Client diff --git a/api_docs/kibana_react.json b/api_docs/kibana_react.json index 763ff415b9d5e..da7ed650981dc 100644 --- a/api_docs/kibana_react.json +++ b/api_docs/kibana_react.json @@ -135,7 +135,7 @@ "children": [ { "parentPluginId": "kibanaReact", - "id": "def-public.filter", + "id": "def-public.TableListView.debouncedFetch.$1", "type": "string", "tags": [], "label": "filter", @@ -220,7 +220,7 @@ "children": [ { "parentPluginId": "kibanaReact", - "id": "def-public.TableListView.setFilter.$1.queryText", + "id": "def-public.TableListView.setFilter.$1", "type": "Object", "tags": [], "label": "{ queryText }", @@ -230,7 +230,7 @@ "children": [ { "parentPluginId": "kibanaReact", - "id": "def-public.TableListView.setFilter.$1.queryText.queryText", + "id": "def-public.TableListView.setFilter.$1.queryText", "type": "string", "tags": [], "label": "queryText", @@ -992,7 +992,7 @@ "children": [ { "parentPluginId": "kibanaReact", - "id": "def-public.props", + "id": "def-public.KibanaContextProvider.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -1005,7 +1005,7 @@ }, { "parentPluginId": "kibanaReact", - "id": "def-public.context", + "id": "def-public.KibanaContextProvider.$2", "type": "Any", "tags": [], "label": "context", @@ -1304,7 +1304,7 @@ "label": "overviewPageActions", "description": [], "signature": [ - "({ addBasePath, application, hidden, showDevToolsLink, showManagementLink, }: Props) => (JSX.Element | null)[]" + "({ addDataHref, application, devToolsHref, hidden, managementHref, showDevToolsLink, showManagementLink, }: Props) => (JSX.Element | null)[]" ], "path": "src/plugins/kibana_react/public/overview_page/overview_page_actions/overview_page_actions.tsx", "deprecated": false, @@ -1314,7 +1314,7 @@ "id": "def-public.overviewPageActions.$1", "type": "Object", "tags": [], - "label": "{\n addBasePath,\n application,\n hidden,\n showDevToolsLink,\n showManagementLink,\n}", + "label": "{\n addDataHref,\n application,\n devToolsHref,\n hidden,\n managementHref,\n showDevToolsLink,\n showManagementLink,\n}", "description": [], "signature": [ "Props" @@ -2423,7 +2423,7 @@ "children": [ { "parentPluginId": "kibanaReact", - "id": "def-public.props", + "id": "def-public.KibanaReactContext.Provider.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -2436,7 +2436,7 @@ }, { "parentPluginId": "kibanaReact", - "id": "def-public.context", + "id": "def-public.KibanaReactContext.Provider.$2", "type": "Any", "tags": [], "label": "context", @@ -2473,7 +2473,7 @@ "children": [ { "parentPluginId": "kibanaReact", - "id": "def-public.props", + "id": "def-public.KibanaReactContext.Consumer.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -6387,7 +6387,7 @@ "children": [ { "parentPluginId": "kibanaReact", - "id": "def-common.first", + "id": "def-common.createGlobalStyle.$1", "type": "CompoundType", "tags": [], "label": "first", @@ -6405,7 +6405,7 @@ }, { "parentPluginId": "kibanaReact", - "id": "def-common.interpolations", + "id": "def-common.createGlobalStyle.$2", "type": "Array", "tags": [], "label": "interpolations", @@ -6600,7 +6600,7 @@ "children": [ { "parentPluginId": "kibanaReact", - "id": "def-common.strings", + "id": "def-common.keyframes.$1", "type": "CompoundType", "tags": [], "label": "strings", @@ -6614,7 +6614,7 @@ }, { "parentPluginId": "kibanaReact", - "id": "def-common.interpolations", + "id": "def-common.keyframes.$2", "type": "Array", "tags": [], "label": "interpolations", @@ -6661,7 +6661,7 @@ "children": [ { "parentPluginId": "kibanaReact", - "id": "def-common.component", + "id": "def-common.withTheme.$1", "type": "Uncategorized", "tags": [], "label": "component", @@ -6695,7 +6695,7 @@ "label": "eui", "description": [], "signature": [ - "{ paddingSizes: { xs: string; s: string; m: string; l: string; xl: string; }; avatarSizing: { s: { size: string; 'font-size': string; }; m: { size: string; 'font-size': string; }; l: { size: string; 'font-size': string; }; xl: { size: string; 'font-size': string; }; }; euiBadgeGroupGutterTypes: { gutterExtraSmall: string; gutterSmall: string; }; euiBreadcrumbSpacing: string; euiBreadcrumbTruncateWidth: string; euiButtonEmptyTypes: { primary: string; danger: string; disabled: string; ghost: string; text: string; success: string; warning: string; }; euiCallOutTypes: { primary: string; success: string; warning: string; danger: string; }; euiCardSpacing: string; euiCardBottomNodeHeight: string; euiCardSelectButtonBorders: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardSelectButtonBackgrounds: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiCheckableCardPadding: string; euiCodeBlockPaddingModifiers: { paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiCollapsibleNavGroupLightBackgroundColor: string; euiCollapsibleNavGroupDarkBackgroundColor: string; euiCollapsibleNavGroupDarkHighContrastColor: string; euiColorPickerValueRange0: string; euiColorPickerValueRange1: string; euiColorPickerSaturationRange0: string; euiColorPickerSaturationRange1: string; euiColorPickerIndicatorSize: string; euiColorPickerWidth: string; euiColorPaletteDisplaySizes: { sizeExtraSmall: string; sizeSmall: string; sizeMedium: string; }; euiContextMenuWidth: string; euiControlBarBackground: string; euiControlBarText: string; euiControlBarBorderColor: string; euiControlBarInitialHeight: string; euiControlBarMaxHeight: string; euiControlBarHeights: { s: string; m: string; l: string; }; euiDataGridPrefix: string; euiDataGridStyles: string; euiDataGridColumnResizerWidth: string; euiDataGridPopoverMaxHeight: string; euiDataGridCellPaddingS: string; euiDataGridCellPaddingM: string; euiDataGridCellPaddingL: string; euiDataGridVerticalBorder: string; euiDatePickerCalendarWidth: string; euiSuperDatePickerWidth: string; euiSuperDatePickerButtonWidth: string; euiDragAndDropSpacing: { s: string; m: string; l: string; }; euiExpressionColors: { subdued: string; primary: string; success: string; secondary: string; warning: string; danger: string; accent: string; }; euiFacetGutterSizes: { gutterNone: number; gutterSmall: string; gutterMedium: string; gutterLarge: string; }; gutterTypes: { gutterExtraSmall: string; gutterSmall: string; gutterMedium: string; gutterLarge: string; gutterExtraLarge: string; }; fractions: { fourths: { percentage: string; count: number; }; thirds: { percentage: string; count: number; }; halves: { percentage: string; count: number; }; single: { percentage: string; count: number; }; }; flyoutSizes: { small: { min: string; width: string; max: string; }; medium: { min: string; width: string; max: string; }; large: { min: string; width: string; max: string; }; }; euiFlyoutBorder: string; euiFlyoutPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiFilePickerTallHeight: string; euiRangeLevelColors: { primary: string; success: string; warning: string; danger: string; }; textareaResizing: { vertical: string; horizontal: string; both: string; none: string; }; euiHeaderLinksGutterSizes: { gutterXS: string; gutterS: string; gutterM: string; gutterL: string; }; ruleMargins: { marginXSmall: string; marginSmall: string; marginMedium: string; marginLarge: string; marginXLarge: string; marginXXLarge: string; }; euiIconLoadingOpacity: number; euiIconColors: { accent: string; danger: string; ghost: string; primary: string; secondary: string; success: string; subdued: string; text: string; warning: string; inherit: string; }; euiIconSizes: { small: string; medium: string; large: string; xLarge: string; xxLarge: string; }; euiKeyPadMenuSize: string; euiKeyPadMenuMarginSize: string; euiLinkColors: { subdued: string; primary: string; secondary: string; success: string; accent: string; warning: string; danger: string; text: string; ghost: string; }; euiListGroupItemHoverBackground: string; euiListGroupItemHoverBackgroundGhost: string; euiListGroupGutterTypes: { gutterSmall: string; gutterMedium: string; }; euiListGroupItemColorTypes: { primary: string; text: string; subdued: string; ghost: string; }; euiListGroupItemSizeTypes: { xSmall: string; small: string; medium: string; large: string; }; euiGradientStartStop: string; euiGradientMiddle: string; euiMarkdownEditorMinHeight: string; euiPopoverArrowSize: string; euiPopoverTranslateDistance: string; euiProgressSizes: { xs: string; s: string; m: string; l: string; }; euiProgressColors: { primary: string; secondary: string; success: string; warning: string; danger: string; accent: string; subdued: string; vis0: string; vis1: string; vis2: string; vis3: string; vis4: string; vis5: string; vis6: string; vis7: string; vis8: string; vis9: string; customColor: string; }; euiResizableButtonTransitionSpeed: string; euiResizableButtonSize: string; euiSelectableListItemBorder: string; euiSelectableListItemPadding: string; euiSelectableTemplateSitewideTypes: { application: { color: string; 'font-weight': number; }; deployment: { color: string; 'font-weight': number; }; article: { color: string; 'font-weight': number; }; case: { color: string; 'font-weight': number; }; platform: { color: string; 'font-weight': number; }; }; euiSideNavEmphasizedBackgroundColor: string; euiSideNavRootTextcolor: string; euiSideNavBranchTextcolor: string; euiSideNavSelectedTextcolor: string; euiSideNavDisabledTextcolor: string; spacerSizes: { xs: string; s: string; m: string; l: string; xl: string; xxl: string; }; euiStepNumberSize: string; euiStepNumberSmallSize: string; euiStepNumberMargin: string; euiStepStatusColorsToFade: { warning: string; danger: string; disabled: string; incomplete: string; }; euiSuggestItemColors: { tint0: string; tint1: string; tint2: string; tint3: string; tint4: string; tint5: string; tint6: string; tint7: string; tint8: string; tint9: string; tint10: string; }; euiTableCellContentPadding: string; euiTableCellContentPaddingCompressed: string; euiTableCellCheckboxWidth: string; euiTableActionsAreaWidth: string; euiTableHoverColor: string; euiTableSelectedColor: string; euiTableHoverSelectedColor: string; euiTableActionsBorderColor: string; euiTableHoverClickableColor: string; euiTableFocusClickableColor: string; euiTabFontSize: string; euiTabFontSizeS: string; euiTabFontSizeL: string; euiTextColors: { default: string; subdued: string; secondary: string; success: string; accent: string; warning: string; danger: string; ghost: string; inherit: string; }; euiTextConstrainedMaxWidth: string; euiToastWidth: string; euiToastTypes: { primary: string; success: string; warning: string; danger: string; }; euiTokenGrayColor: string; euiTokenTypes: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; gray: { graphic: string; behindText: string; }; }; euiTokenTypeKeys: string; euiContrastRatioText: number; euiContrastRatioGraphic: number; euiContrastRatioDisabled: number; euiAnimSlightBounce: string; euiAnimSlightResistance: string; euiAnimSpeedExtraFast: string; euiAnimSpeedFast: string; euiAnimSpeedNormal: string; euiAnimSpeedSlow: string; euiAnimSpeedExtraSlow: string; euiBorderWidthThin: string; euiBorderWidthThick: string; euiBorderColor: string; euiBorderRadius: string; euiBorderRadiusSmall: string; euiBorderThick: string; euiBorderThin: string; euiBorderEditable: string; euiButtonHeight: string; euiButtonHeightSmall: string; euiButtonHeightXSmall: string; euiButtonColorDisabled: string; euiButtonColorDisabledText: string; euiButtonColorGhostDisabled: string; euiButtonTypes: { primary: string; accent: string; secondary: string; success: string; warning: string; danger: string; subdued: string; ghost: string; text: string; }; euiColorGhost: string; euiColorInk: string; euiColorPrimary: string; euiColorSecondary: string; euiColorAccent: string; euiColorSuccess: string; euiColorWarning: string; euiColorDanger: string; euiColorEmptyShade: string; euiColorLightestShade: string; euiColorLightShade: string; euiColorMediumShade: string; euiColorDarkShade: string; euiColorDarkestShade: string; euiColorFullShade: string; euiPageBackgroundColor: string; euiColorHighlight: string; euiTextColor: string; euiTitleColor: string; euiTextSubduedColor: string; euiColorDisabled: string; euiColorPrimaryText: string; euiColorSecondaryText: string; euiColorAccentText: string; euiColorWarningText: string; euiColorDangerText: string; euiColorDisabledText: string; euiColorSuccessText: string; euiLinkColor: string; euiPaletteColorBlind: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; }; euiPaletteColorBlindKeys: string; euiColorVis0: string; euiColorVis1: string; euiColorVis2: string; euiColorVis3: string; euiColorVis4: string; euiColorVis5: string; euiColorVis6: string; euiColorVis7: string; euiColorVis8: string; euiColorVis9: string; euiColorVis0_behindText: string; euiColorVis1_behindText: string; euiColorVis2_behindText: string; euiColorVis3_behindText: string; euiColorVis4_behindText: string; euiColorVis5_behindText: string; euiColorVis6_behindText: string; euiColorVis7_behindText: string; euiColorVis8_behindText: string; euiColorVis9_behindText: string; euiColorChartLines: string; euiColorChartBand: string; euiCodeBlockBackgroundColor: string; euiCodeBlockColor: string; euiCodeBlockSelectedBackgroundColor: string; euiCodeBlockCommentColor: string; euiCodeBlockSelectorTagColor: string; euiCodeBlockStringColor: string; euiCodeBlockTagColor: string; euiCodeBlockNameColor: string; euiCodeBlockNumberColor: string; euiCodeBlockKeywordColor: string; euiCodeBlockFunctionTitleColor: string; euiCodeBlockTypeColor: string; euiCodeBlockAttributeColor: string; euiCodeBlockSymbolColor: string; euiCodeBlockParamsColor: string; euiCodeBlockMetaColor: string; euiCodeBlockTitleColor: string; euiCodeBlockSectionColor: string; euiCodeBlockAdditionColor: string; euiCodeBlockDeletionColor: string; euiCodeBlockSelectorClassColor: string; euiCodeBlockSelectorIdColor: string; euiFormMaxWidth: string; euiFormControlHeight: string; euiFormControlCompressedHeight: string; euiFormControlPadding: string; euiFormControlCompressedPadding: string; euiFormControlBorderRadius: number; euiFormControlCompressedBorderRadius: string; euiRadioSize: string; euiCheckBoxSize: string; euiCheckboxBorderRadius: string; euiSwitchHeight: string; euiSwitchWidth: string; euiSwitchThumbSize: string; euiSwitchIconHeight: string; euiSwitchHeightCompressed: string; euiSwitchWidthCompressed: string; euiSwitchThumbSizeCompressed: string; euiSwitchHeightMini: string; euiSwitchWidthMini: string; euiSwitchThumbSizeMini: string; euiFormBackgroundColor: string; euiFormBackgroundDisabledColor: string; euiFormBackgroundReadOnlyColor: string; euiFormBorderOpaqueColor: string; euiFormBorderColor: string; euiFormBorderDisabledColor: string; euiFormCustomControlDisabledIconColor: string; euiFormCustomControlBorderColor: string; euiFormControlDisabledColor: string; euiFormControlBoxShadow: string; euiFormControlPlaceholderText: string; euiFormInputGroupLabelBackground: string; euiFormInputGroupBorder: string; euiSwitchOffColor: string; euiFormControlLayoutGroupInputHeight: string; euiFormControlLayoutGroupInputCompressedHeight: string; euiFormControlLayoutGroupInputCompressedBorderRadius: string; euiRangeTrackColor: string; euiRangeThumbRadius: string; euiRangeThumbHeight: string; euiRangeThumbWidth: string; euiRangeThumbBorderColor: string; euiRangeTrackWidth: string; euiRangeTrackHeight: string; euiRangeTrackBorderWidth: number; euiRangeTrackBorderColor: string; euiRangeTrackRadius: string; euiRangeDisabledOpacity: number; euiRangeHighlightHeight: string; euiHeaderBackgroundColor: string; euiHeaderDarkBackgroundColor: string; euiHeaderBorderColor: string; euiHeaderBreadcrumbColor: string; euiHeaderHeight: string; euiHeaderChildSize: string; euiHeaderHeightCompensation: string; euiPageDefaultMaxWidth: string; euiPageSidebarMinWidth: string; euiPanelPaddingModifiers: { paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiPanelBorderRadiusModifiers: { borderRadiusNone: number; borderRadiusMedium: string; }; euiPanelBackgroundColorModifiers: { transparent: string; plain: string; subdued: string; accent: string; primary: string; success: string; warning: string; danger: string; }; euiBreakpoints: { xs: number; s: string; m: string; l: string; xl: string; }; euiBreakpointKeys: string; euiShadowColor: string; euiShadowColorLarge: string; euiSize: string; euiSizeXS: string; euiSizeS: string; euiSizeM: string; euiSizeL: string; euiSizeXL: string; euiSizeXXL: string; euiButtonMinWidth: string; euiScrollBar: string; euiScrollBarCorner: string; euiScrollBarCornerThin: string; euiFocusRingColor: string; euiFocusRingAnimStartColor: string; euiFocusRingAnimStartSize: string; euiFocusRingAnimStartSizeLarge: string; euiFocusRingSizeLarge: string; euiFocusRingSize: string; euiFocusTransparency: number; euiFocusTransparencyPercent: string; euiFocusBackgroundColor: string; euiTooltipBackgroundColor: string; euiTooltipAnimations: { top: string; left: string; bottom: string; right: string; }; euiFontFamily: string; euiCodeFontFamily: string; euiFontFeatureSettings: string; euiTextScale: string; euiFontSize: string; euiFontSizeXS: string; euiFontSizeS: string; euiFontSizeM: string; euiFontSizeL: string; euiFontSizeXL: string; euiFontSizeXXL: string; euiLineHeight: number; euiBodyLineHeight: number; euiFontWeightLight: number; euiFontWeightRegular: number; euiFontWeightMedium: number; euiFontWeightSemiBold: number; euiFontWeightBold: number; euiCodeFontWeightRegular: number; euiCodeFontWeightBold: number; euiTitles: { xxxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xs: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; s: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; m: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; l: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; }; euiZLevel0: number; euiZLevel1: number; euiZLevel2: number; euiZLevel3: number; euiZLevel4: number; euiZLevel5: number; euiZLevel6: number; euiZLevel7: number; euiZLevel8: number; euiZLevel9: number; euiZToastList: number; euiZModal: number; euiZMask: number; euiZNavigation: number; euiZContentMenu: number; euiZHeader: number; euiZFlyout: number; euiZMaskBelowHeader: number; euiZContent: number; }" + "{ paddingSizes: { xs: string; s: string; m: string; l: string; xl: string; }; avatarSizing: { s: { size: string; 'font-size': string; }; m: { size: string; 'font-size': string; }; l: { size: string; 'font-size': string; }; xl: { size: string; 'font-size': string; }; }; euiBadgeGroupGutterTypes: { gutterExtraSmall: string; gutterSmall: string; }; euiBreadcrumbSpacing: string; euiBreadcrumbTruncateWidth: string; euiButtonEmptyTypes: { primary: string; danger: string; disabled: string; ghost: string; text: string; success: string; warning: string; }; euiCallOutTypes: { primary: string; success: string; warning: string; danger: string; }; euiCardSpacing: string; euiCardBottomNodeHeight: string; euiCardSelectButtonBorders: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardSelectButtonBackgrounds: { text: string; primary: string; success: string; danger: string; ghost: string; }; euiCardPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiCheckableCardPadding: string; euiCodeBlockPaddingModifiers: { paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiCollapsibleNavGroupLightBackgroundColor: string; euiCollapsibleNavGroupDarkBackgroundColor: string; euiCollapsibleNavGroupDarkHighContrastColor: string; euiColorPickerValueRange0: string; euiColorPickerValueRange1: string; euiColorPickerSaturationRange0: string; euiColorPickerSaturationRange1: string; euiColorPickerIndicatorSize: string; euiColorPickerWidth: string; euiColorPaletteDisplaySizes: { sizeExtraSmall: string; sizeSmall: string; sizeMedium: string; }; euiContextMenuWidth: string; euiControlBarBackground: string; euiControlBarText: string; euiControlBarBorderColor: string; euiControlBarInitialHeight: string; euiControlBarMaxHeight: string; euiControlBarHeights: { s: string; m: string; l: string; }; euiDataGridPrefix: string; euiDataGridStyles: string; euiZDataGrid: number; euiZHeaderBelowDataGrid: number; euiDataGridColumnResizerWidth: string; euiDataGridPopoverMaxHeight: string; euiDataGridCellPaddingS: string; euiDataGridCellPaddingM: string; euiDataGridCellPaddingL: string; euiDataGridVerticalBorder: string; euiSuperDatePickerWidth: string; euiSuperDatePickerButtonWidth: string; euiDragAndDropSpacing: { s: string; m: string; l: string; }; euiExpressionColors: { subdued: string; primary: string; success: string; secondary: string; warning: string; danger: string; accent: string; }; euiFacetGutterSizes: { gutterNone: number; gutterSmall: string; gutterMedium: string; gutterLarge: string; }; gutterTypes: { gutterExtraSmall: string; gutterSmall: string; gutterMedium: string; gutterLarge: string; gutterExtraLarge: string; }; fractions: { fourths: { percentage: string; count: number; }; thirds: { percentage: string; count: number; }; halves: { percentage: string; count: number; }; single: { percentage: string; count: number; }; }; flyoutSizes: { small: { min: string; width: string; max: string; }; medium: { min: string; width: string; max: string; }; large: { min: string; width: string; max: string; }; }; euiFlyoutBorder: string; euiFlyoutPaddingModifiers: { paddingNone: number; paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiFilePickerTallHeight: string; euiRangeLevelColors: { primary: string; success: string; warning: string; danger: string; }; textareaResizing: { vertical: string; horizontal: string; both: string; none: string; }; euiHeaderLinksGutterSizes: { gutterXS: string; gutterS: string; gutterM: string; gutterL: string; }; ruleMargins: { marginXSmall: string; marginSmall: string; marginMedium: string; marginLarge: string; marginXLarge: string; marginXXLarge: string; }; euiIconLoadingOpacity: number; euiIconColors: { accent: string; danger: string; ghost: string; primary: string; secondary: string; success: string; subdued: string; text: string; warning: string; inherit: string; }; euiIconSizes: { small: string; medium: string; large: string; xLarge: string; xxLarge: string; }; euiKeyPadMenuSize: string; euiKeyPadMenuMarginSize: string; euiLinkColors: { subdued: string; primary: string; secondary: string; success: string; accent: string; warning: string; danger: string; text: string; ghost: string; }; euiListGroupItemHoverBackground: string; euiListGroupItemHoverBackgroundGhost: string; euiListGroupGutterTypes: { gutterSmall: string; gutterMedium: string; }; euiListGroupItemColorTypes: { primary: string; text: string; subdued: string; ghost: string; }; euiListGroupItemSizeTypes: { xSmall: string; small: string; medium: string; large: string; }; euiGradientStartStop: string; euiGradientMiddle: string; euiMarkdownEditorMinHeight: string; euiPopoverArrowSize: string; euiPopoverTranslateDistance: string; euiProgressSizes: { xs: string; s: string; m: string; l: string; }; euiProgressColors: { primary: string; secondary: string; success: string; warning: string; danger: string; accent: string; subdued: string; vis0: string; vis1: string; vis2: string; vis3: string; vis4: string; vis5: string; vis6: string; vis7: string; vis8: string; vis9: string; customColor: string; }; euiResizableButtonTransitionSpeed: string; euiResizableButtonSize: string; euiSelectableListItemBorder: string; euiSelectableListItemPadding: string; euiSelectableTemplateSitewideTypes: { application: { color: string; 'font-weight': number; }; deployment: { color: string; 'font-weight': number; }; article: { color: string; 'font-weight': number; }; case: { color: string; 'font-weight': number; }; platform: { color: string; 'font-weight': number; }; }; euiSideNavEmphasizedBackgroundColor: string; euiSideNavRootTextcolor: string; euiSideNavBranchTextcolor: string; euiSideNavSelectedTextcolor: string; euiSideNavDisabledTextcolor: string; spacerSizes: { xs: string; s: string; m: string; l: string; xl: string; xxl: string; }; euiStepNumberSize: string; euiStepNumberSmallSize: string; euiStepNumberMargin: string; euiStepStatusColorsToFade: { warning: string; danger: string; disabled: string; incomplete: string; }; euiSuggestItemColors: { tint0: string; tint1: string; tint2: string; tint3: string; tint4: string; tint5: string; tint6: string; tint7: string; tint8: string; tint9: string; tint10: string; }; euiTableCellContentPadding: string; euiTableCellContentPaddingCompressed: string; euiTableCellCheckboxWidth: string; euiTableActionsAreaWidth: string; euiTableHoverColor: string; euiTableSelectedColor: string; euiTableHoverSelectedColor: string; euiTableActionsBorderColor: string; euiTableHoverClickableColor: string; euiTableFocusClickableColor: string; euiTabFontSize: string; euiTabFontSizeS: string; euiTabFontSizeL: string; euiTextColors: { default: string; subdued: string; secondary: string; success: string; accent: string; warning: string; danger: string; ghost: string; inherit: string; }; euiTextConstrainedMaxWidth: string; euiToastWidth: string; euiToastTypes: { primary: string; success: string; warning: string; danger: string; }; euiTokenGrayColor: string; euiTokenTypes: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; gray: { graphic: string; behindText: string; }; }; euiTokenTypeKeys: string; euiContrastRatioText: number; euiContrastRatioGraphic: number; euiContrastRatioDisabled: number; euiDatePickerCalendarWidth: string; euiAnimSlightBounce: string; euiAnimSlightResistance: string; euiAnimSpeedExtraFast: string; euiAnimSpeedFast: string; euiAnimSpeedNormal: string; euiAnimSpeedSlow: string; euiAnimSpeedExtraSlow: string; euiBorderWidthThin: string; euiBorderWidthThick: string; euiBorderColor: string; euiBorderRadius: string; euiBorderRadiusSmall: string; euiBorderThick: string; euiBorderThin: string; euiBorderEditable: string; euiButtonHeight: string; euiButtonHeightSmall: string; euiButtonHeightXSmall: string; euiButtonColorDisabled: string; euiButtonColorDisabledText: string; euiButtonColorGhostDisabled: string; euiButtonTypes: { primary: string; accent: string; secondary: string; success: string; warning: string; danger: string; subdued: string; ghost: string; text: string; }; euiColorGhost: string; euiColorInk: string; euiColorPrimary: string; euiColorSecondary: string; euiColorAccent: string; euiColorSuccess: string; euiColorWarning: string; euiColorDanger: string; euiColorEmptyShade: string; euiColorLightestShade: string; euiColorLightShade: string; euiColorMediumShade: string; euiColorDarkShade: string; euiColorDarkestShade: string; euiColorFullShade: string; euiPageBackgroundColor: string; euiColorHighlight: string; euiTextColor: string; euiTitleColor: string; euiTextSubduedColor: string; euiColorDisabled: string; euiColorPrimaryText: string; euiColorSecondaryText: string; euiColorAccentText: string; euiColorWarningText: string; euiColorDangerText: string; euiColorDisabledText: string; euiColorSuccessText: string; euiLinkColor: string; euiPaletteColorBlind: { euiColorVis0: { graphic: string; behindText: string; }; euiColorVis1: { graphic: string; behindText: string; }; euiColorVis2: { graphic: string; behindText: string; }; euiColorVis3: { graphic: string; behindText: string; }; euiColorVis4: { graphic: string; behindText: string; }; euiColorVis5: { graphic: string; behindText: string; }; euiColorVis6: { graphic: string; behindText: string; }; euiColorVis7: { graphic: string; behindText: string; }; euiColorVis8: { graphic: string; behindText: string; }; euiColorVis9: { graphic: string; behindText: string; }; }; euiPaletteColorBlindKeys: string; euiColorVis0: string; euiColorVis1: string; euiColorVis2: string; euiColorVis3: string; euiColorVis4: string; euiColorVis5: string; euiColorVis6: string; euiColorVis7: string; euiColorVis8: string; euiColorVis9: string; euiColorVis0_behindText: string; euiColorVis1_behindText: string; euiColorVis2_behindText: string; euiColorVis3_behindText: string; euiColorVis4_behindText: string; euiColorVis5_behindText: string; euiColorVis6_behindText: string; euiColorVis7_behindText: string; euiColorVis8_behindText: string; euiColorVis9_behindText: string; euiColorChartLines: string; euiColorChartBand: string; euiCodeBlockBackgroundColor: string; euiCodeBlockColor: string; euiCodeBlockSelectedBackgroundColor: string; euiCodeBlockCommentColor: string; euiCodeBlockSelectorTagColor: string; euiCodeBlockStringColor: string; euiCodeBlockTagColor: string; euiCodeBlockNameColor: string; euiCodeBlockNumberColor: string; euiCodeBlockKeywordColor: string; euiCodeBlockFunctionTitleColor: string; euiCodeBlockTypeColor: string; euiCodeBlockAttributeColor: string; euiCodeBlockSymbolColor: string; euiCodeBlockParamsColor: string; euiCodeBlockMetaColor: string; euiCodeBlockTitleColor: string; euiCodeBlockSectionColor: string; euiCodeBlockAdditionColor: string; euiCodeBlockDeletionColor: string; euiCodeBlockSelectorClassColor: string; euiCodeBlockSelectorIdColor: string; euiFormMaxWidth: string; euiFormControlHeight: string; euiFormControlCompressedHeight: string; euiFormControlPadding: string; euiFormControlCompressedPadding: string; euiFormControlBorderRadius: number; euiFormControlCompressedBorderRadius: string; euiRadioSize: string; euiCheckBoxSize: string; euiCheckboxBorderRadius: string; euiSwitchHeight: string; euiSwitchWidth: string; euiSwitchThumbSize: string; euiSwitchIconHeight: string; euiSwitchHeightCompressed: string; euiSwitchWidthCompressed: string; euiSwitchThumbSizeCompressed: string; euiSwitchHeightMini: string; euiSwitchWidthMini: string; euiSwitchThumbSizeMini: string; euiFormBackgroundColor: string; euiFormBackgroundDisabledColor: string; euiFormBackgroundReadOnlyColor: string; euiFormBorderOpaqueColor: string; euiFormBorderColor: string; euiFormBorderDisabledColor: string; euiFormCustomControlDisabledIconColor: string; euiFormCustomControlBorderColor: string; euiFormControlDisabledColor: string; euiFormControlBoxShadow: string; euiFormControlPlaceholderText: string; euiFormInputGroupLabelBackground: string; euiFormInputGroupBorder: string; euiSwitchOffColor: string; euiFormControlLayoutGroupInputHeight: string; euiFormControlLayoutGroupInputCompressedHeight: string; euiFormControlLayoutGroupInputCompressedBorderRadius: string; euiRangeTrackColor: string; euiRangeThumbRadius: string; euiRangeThumbHeight: string; euiRangeThumbWidth: string; euiRangeThumbBorderColor: string; euiRangeTrackWidth: string; euiRangeTrackHeight: string; euiRangeTrackBorderWidth: number; euiRangeTrackBorderColor: string; euiRangeTrackRadius: string; euiRangeDisabledOpacity: number; euiRangeHighlightHeight: string; euiHeaderBackgroundColor: string; euiHeaderDarkBackgroundColor: string; euiHeaderBorderColor: string; euiHeaderBreadcrumbColor: string; euiHeaderHeight: string; euiHeaderChildSize: string; euiHeaderHeightCompensation: string; euiPageDefaultMaxWidth: string; euiPageSidebarMinWidth: string; euiPanelPaddingModifiers: { paddingSmall: string; paddingMedium: string; paddingLarge: string; }; euiPanelBorderRadiusModifiers: { borderRadiusNone: number; borderRadiusMedium: string; }; euiPanelBackgroundColorModifiers: { transparent: string; plain: string; subdued: string; accent: string; primary: string; success: string; warning: string; danger: string; }; euiBreakpoints: { xs: number; s: string; m: string; l: string; xl: string; }; euiBreakpointKeys: string; euiShadowColor: string; euiShadowColorLarge: string; euiSize: string; euiSizeXS: string; euiSizeS: string; euiSizeM: string; euiSizeL: string; euiSizeXL: string; euiSizeXXL: string; euiButtonMinWidth: string; euiScrollBar: string; euiScrollBarCorner: string; euiScrollBarCornerThin: string; euiFocusRingColor: string; euiFocusRingAnimStartColor: string; euiFocusRingAnimStartSize: string; euiFocusRingAnimStartSizeLarge: string; euiFocusRingSizeLarge: string; euiFocusRingSize: string; euiFocusTransparency: number; euiFocusTransparencyPercent: string; euiFocusBackgroundColor: string; euiTooltipBackgroundColor: string; euiTooltipAnimations: { top: string; left: string; bottom: string; right: string; }; euiFontFamily: string; euiCodeFontFamily: string; euiFontFeatureSettings: string; euiTextScale: string; euiFontSize: string; euiFontSizeXS: string; euiFontSizeS: string; euiFontSizeM: string; euiFontSizeL: string; euiFontSizeXL: string; euiFontSizeXXL: string; euiLineHeight: number; euiBodyLineHeight: number; euiFontWeightLight: number; euiFontWeightRegular: number; euiFontWeightMedium: number; euiFontWeightSemiBold: number; euiFontWeightBold: number; euiCodeFontWeightRegular: number; euiCodeFontWeightBold: number; euiTitles: { xxxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xxs: { 'font-size': string; 'line-height': string; 'font-weight': number; }; xs: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; s: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; m: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; l: { 'font-size': string; 'line-height': string; 'font-weight': number; 'letter-spacing': string; }; }; euiZLevel0: number; euiZLevel1: number; euiZLevel2: number; euiZLevel3: number; euiZLevel4: number; euiZLevel5: number; euiZLevel6: number; euiZLevel7: number; euiZLevel8: number; euiZLevel9: number; euiZToastList: number; euiZModal: number; euiZMask: number; euiZNavigation: number; euiZContentMenu: number; euiZHeader: number; euiZFlyout: number; euiZMaskBelowHeader: number; euiZContent: number; }" ], "path": "src/plugins/kibana_react/common/eui_styled_components.tsx", "deprecated": false diff --git a/api_docs/kibana_utils.json b/api_docs/kibana_utils.json index 7dbe642f7eb15..e5d4fef66b872 100644 --- a/api_docs/kibana_utils.json +++ b/api_docs/kibana_utils.json @@ -95,7 +95,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.data", + "id": "def-public.Defer.resolve.$1", "type": "Uncategorized", "tags": [], "label": "data", @@ -124,7 +124,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.error", + "id": "def-public.Defer.reject.$1", "type": "Any", "tags": [], "label": "error", @@ -814,7 +814,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.ResizeChecker.Unnamed.$2.args", + "id": "def-public.ResizeChecker.Unnamed.$2", "type": "Object", "tags": [], "label": "args", @@ -824,7 +824,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.ResizeChecker.Unnamed.$2.args.disabled", + "id": "def-public.ResizeChecker.Unnamed.$2.disabled", "type": "CompoundType", "tags": [], "label": "disabled", @@ -1464,7 +1464,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.o", + "id": "def-public.calculateObjectHash.$1", "type": "Uncategorized", "tags": [], "label": "o", @@ -1630,7 +1630,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlStateStorage.$1.useHashfalsehistoryonGetErroronSetError", + "id": "def-public.createKbnUrlStateStorage.$1", "type": "Object", "tags": [], "label": "{\n useHash = false,\n history,\n onGetError,\n onSetError,\n }", @@ -1640,7 +1640,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlStateStorage.$1.useHashfalsehistoryonGetErroronSetError.useHash", + "id": "def-public.createKbnUrlStateStorage.$1.useHash", "type": "boolean", "tags": [], "label": "useHash", @@ -1650,7 +1650,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlStateStorage.$1.useHashfalsehistoryonGetErroronSetError.history", + "id": "def-public.createKbnUrlStateStorage.$1.history", "type": "Object", "tags": [], "label": "history", @@ -1664,7 +1664,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlStateStorage.$1.useHashfalsehistoryonGetErroronSetError.onGetError", + "id": "def-public.createKbnUrlStateStorage.$1.onGetError", "type": "Function", "tags": [], "label": "onGetError", @@ -1677,7 +1677,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlStateStorage.$1.useHashfalsehistoryonGetErroronSetError.onGetError.$1", + "id": "def-public.createKbnUrlStateStorage.$1.onGetError.$1", "type": "Object", "tags": [], "label": "error", @@ -1694,7 +1694,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlStateStorage.$1.useHashfalsehistoryonGetErroronSetError.onSetError", + "id": "def-public.createKbnUrlStateStorage.$1.onSetError", "type": "Function", "tags": [], "label": "onSetError", @@ -1707,7 +1707,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlStateStorage.$1.useHashfalsehistoryonGetErroronSetError.onSetError.$1", + "id": "def-public.createKbnUrlStateStorage.$1.onSetError.$1", "type": "Object", "tags": [], "label": "error", @@ -1772,7 +1772,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlTracker.$1.baseUrldefaultSubUrlstorageKeystateParamsnavLinkUpdater$toastNotificationshistorygetHistorystorageshouldTrackUrlUpdatereturntrueonBeforeNavLinkSavednewNavLinknewNavLink", + "id": "def-public.createKbnUrlTracker.$1", "type": "Object", "tags": [], "label": "{\n baseUrl,\n defaultSubUrl,\n storageKey,\n stateParams,\n navLinkUpdater$,\n toastNotifications,\n history,\n getHistory,\n storage,\n shouldTrackUrlUpdate = () => {\n return true;\n },\n onBeforeNavLinkSaved = (newNavLink) => newNavLink,\n}", @@ -1782,7 +1782,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlTracker.$1.baseUrldefaultSubUrlstorageKeystateParamsnavLinkUpdater$toastNotificationshistorygetHistorystorageshouldTrackUrlUpdatereturntrueonBeforeNavLinkSavednewNavLinknewNavLink.baseUrl", + "id": "def-public.createKbnUrlTracker.$1.baseUrl", "type": "string", "tags": [], "label": "baseUrl", @@ -1794,7 +1794,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlTracker.$1.baseUrldefaultSubUrlstorageKeystateParamsnavLinkUpdater$toastNotificationshistorygetHistorystorageshouldTrackUrlUpdatereturntrueonBeforeNavLinkSavednewNavLinknewNavLink.defaultSubUrl", + "id": "def-public.createKbnUrlTracker.$1.defaultSubUrl", "type": "string", "tags": [], "label": "defaultSubUrl", @@ -1806,7 +1806,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlTracker.$1.baseUrldefaultSubUrlstorageKeystateParamsnavLinkUpdater$toastNotificationshistorygetHistorystorageshouldTrackUrlUpdatereturntrueonBeforeNavLinkSavednewNavLinknewNavLink.stateParams", + "id": "def-public.createKbnUrlTracker.$1.stateParams", "type": "Array", "tags": [], "label": "stateParams", @@ -1823,7 +1823,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlTracker.$1.baseUrldefaultSubUrlstorageKeystateParamsnavLinkUpdater$toastNotificationshistorygetHistorystorageshouldTrackUrlUpdatereturntrueonBeforeNavLinkSavednewNavLinknewNavLink.storageKey", + "id": "def-public.createKbnUrlTracker.$1.storageKey", "type": "string", "tags": [], "label": "storageKey", @@ -1835,7 +1835,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlTracker.$1.baseUrldefaultSubUrlstorageKeystateParamsnavLinkUpdater$toastNotificationshistorygetHistorystorageshouldTrackUrlUpdatereturntrueonBeforeNavLinkSavednewNavLinknewNavLink.navLinkUpdater$", + "id": "def-public.createKbnUrlTracker.$1.navLinkUpdater$", "type": "Object", "tags": [], "label": "navLinkUpdater$", @@ -1859,7 +1859,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlTracker.$1.baseUrldefaultSubUrlstorageKeystateParamsnavLinkUpdater$toastNotificationshistorygetHistorystorageshouldTrackUrlUpdatereturntrueonBeforeNavLinkSavednewNavLinknewNavLink.toastNotifications", + "id": "def-public.createKbnUrlTracker.$1.toastNotifications", "type": "Object", "tags": [], "label": "toastNotifications", @@ -2020,7 +2020,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlTracker.$1.baseUrldefaultSubUrlstorageKeystateParamsnavLinkUpdater$toastNotificationshistorygetHistorystorageshouldTrackUrlUpdatereturntrueonBeforeNavLinkSavednewNavLinknewNavLink.history", + "id": "def-public.createKbnUrlTracker.$1.history", "type": "Object", "tags": [], "label": "history", @@ -2036,7 +2036,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlTracker.$1.baseUrldefaultSubUrlstorageKeystateParamsnavLinkUpdater$toastNotificationshistorygetHistorystorageshouldTrackUrlUpdatereturntrueonBeforeNavLinkSavednewNavLinknewNavLink.getHistory", + "id": "def-public.createKbnUrlTracker.$1.getHistory", "type": "Function", "tags": [], "label": "getHistory", @@ -2055,7 +2055,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlTracker.$1.baseUrldefaultSubUrlstorageKeystateParamsnavLinkUpdater$toastNotificationshistorygetHistorystorageshouldTrackUrlUpdatereturntrueonBeforeNavLinkSavednewNavLinknewNavLink.storage", + "id": "def-public.createKbnUrlTracker.$1.storage", "type": "Object", "tags": [], "label": "storage", @@ -2070,7 +2070,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlTracker.$1.baseUrldefaultSubUrlstorageKeystateParamsnavLinkUpdater$toastNotificationshistorygetHistorystorageshouldTrackUrlUpdatereturntrueonBeforeNavLinkSavednewNavLinknewNavLink.shouldTrackUrlUpdate", + "id": "def-public.createKbnUrlTracker.$1.shouldTrackUrlUpdate", "type": "Function", "tags": [], "label": "shouldTrackUrlUpdate", @@ -2085,7 +2085,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlTracker.$1.baseUrldefaultSubUrlstorageKeystateParamsnavLinkUpdater$toastNotificationshistorygetHistorystorageshouldTrackUrlUpdatereturntrueonBeforeNavLinkSavednewNavLinknewNavLink.shouldTrackUrlUpdate.$1", + "id": "def-public.createKbnUrlTracker.$1.shouldTrackUrlUpdate.$1", "type": "string", "tags": [], "label": "pathname", @@ -2104,7 +2104,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlTracker.$1.baseUrldefaultSubUrlstorageKeystateParamsnavLinkUpdater$toastNotificationshistorygetHistorystorageshouldTrackUrlUpdatereturntrueonBeforeNavLinkSavednewNavLinknewNavLink.onBeforeNavLinkSaved", + "id": "def-public.createKbnUrlTracker.$1.onBeforeNavLinkSaved", "type": "Function", "tags": [], "label": "onBeforeNavLinkSaved", @@ -2119,7 +2119,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.createKbnUrlTracker.$1.baseUrldefaultSubUrlstorageKeystateParamsnavLinkUpdater$toastNotificationshistorygetHistorystorageshouldTrackUrlUpdatereturntrueonBeforeNavLinkSavednewNavLinknewNavLink.onBeforeNavLinkSaved.$1", + "id": "def-public.createKbnUrlTracker.$1.onBeforeNavLinkSaved.$1", "type": "string", "tags": [], "label": "newNavLink", @@ -2974,7 +2974,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.getStateFromKbnUrl.$3.getFromHashQuerytrue", + "id": "def-public.getStateFromKbnUrl.$3", "type": "Object", "tags": [], "label": "{ getFromHashQuery = true }", @@ -2984,7 +2984,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.getStateFromKbnUrl.$3.getFromHashQuerytrue.getFromHashQuery", + "id": "def-public.getStateFromKbnUrl.$3.getFromHashQuery", "type": "boolean", "tags": [], "label": "getFromHashQuery", @@ -3043,7 +3043,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.getStatesFromKbnUrl.$3.getFromHashQuerytrue", + "id": "def-public.getStatesFromKbnUrl.$3", "type": "Object", "tags": [], "label": "{ getFromHashQuery = true }", @@ -3053,7 +3053,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.getStatesFromKbnUrl.$3.getFromHashQuerytrue.getFromHashQuery", + "id": "def-public.getStatesFromKbnUrl.$3.getFromHashQuery", "type": "boolean", "tags": [], "label": "getFromHashQuery", @@ -3083,7 +3083,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.query", + "id": "def-public.hashQuery.$1", "type": "Object", "tags": [], "label": "query", @@ -3096,7 +3096,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.options", + "id": "def-public.hashQuery.$2", "type": "Object", "tags": [], "label": "options", @@ -3126,7 +3126,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.url", + "id": "def-public.hashUrl.$1", "type": "string", "tags": [], "label": "url", @@ -3293,7 +3293,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.redirectWhenMissing.$1.historynavigateToAppbasePathmappingtoastNotificationsonBeforeRedirect", + "id": "def-public.redirectWhenMissing.$1", "type": "Object", "tags": [], "label": "{\n history,\n navigateToApp,\n basePath,\n mapping,\n toastNotifications,\n onBeforeRedirect,\n}", @@ -3303,7 +3303,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.redirectWhenMissing.$1.historynavigateToAppbasePathmappingtoastNotificationsonBeforeRedirect.history", + "id": "def-public.redirectWhenMissing.$1.history", "type": "Object", "tags": [], "label": "history", @@ -3317,7 +3317,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.redirectWhenMissing.$1.historynavigateToAppbasePathmappingtoastNotificationsonBeforeRedirect.navigateToApp", + "id": "def-public.redirectWhenMissing.$1.navigateToApp", "type": "Function", "tags": [], "label": "navigateToApp", @@ -3339,7 +3339,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.appId", + "id": "def-public.redirectWhenMissing.$1.navigateToApp.$1", "type": "string", "tags": [], "label": "appId", @@ -3349,7 +3349,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.options", + "id": "def-public.redirectWhenMissing.$1.navigateToApp.$2", "type": "Object", "tags": [], "label": "options", @@ -3371,7 +3371,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.redirectWhenMissing.$1.historynavigateToAppbasePathmappingtoastNotificationsonBeforeRedirect.basePath", + "id": "def-public.redirectWhenMissing.$1.basePath", "type": "Object", "tags": [], "label": "basePath", @@ -3390,7 +3390,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.redirectWhenMissing.$1.historynavigateToAppbasePathmappingtoastNotificationsonBeforeRedirect.mapping", + "id": "def-public.redirectWhenMissing.$1.mapping", "type": "CompoundType", "tags": [], "label": "mapping", @@ -3405,7 +3405,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.redirectWhenMissing.$1.historynavigateToAppbasePathmappingtoastNotificationsonBeforeRedirect.toastNotifications", + "id": "def-public.redirectWhenMissing.$1.toastNotifications", "type": "Object", "tags": [], "label": "toastNotifications", @@ -3566,7 +3566,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.redirectWhenMissing.$1.historynavigateToAppbasePathmappingtoastNotificationsonBeforeRedirect.onBeforeRedirect", + "id": "def-public.redirectWhenMissing.$1.onBeforeRedirect", "type": "Function", "tags": [], "label": "onBeforeRedirect", @@ -3589,7 +3589,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.redirectWhenMissing.$1.historynavigateToAppbasePathmappingtoastNotificationsonBeforeRedirect.onBeforeRedirect.$1", + "id": "def-public.redirectWhenMissing.$1.onBeforeRedirect.$1", "type": "Object", "tags": [], "label": "error", @@ -3860,7 +3860,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.setStateToKbnUrl.$3.useHashfalsestoreInHashQuerytrue", + "id": "def-public.setStateToKbnUrl.$3", "type": "Object", "tags": [], "label": "{ useHash = false, storeInHashQuery = true }", @@ -3870,7 +3870,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.setStateToKbnUrl.$3.useHashfalsestoreInHashQuerytrue.useHash", + "id": "def-public.setStateToKbnUrl.$3.useHash", "type": "boolean", "tags": [], "label": "useHash", @@ -3880,7 +3880,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.setStateToKbnUrl.$3.useHashfalsestoreInHashQuerytrue.storeInHashQuery", + "id": "def-public.setStateToKbnUrl.$3.storeInHashQuery", "type": "CompoundType", "tags": [], "label": "storeInHashQuery", @@ -4053,7 +4053,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.query", + "id": "def-public.unhashQuery.$1", "type": "Object", "tags": [], "label": "query", @@ -4066,7 +4066,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.options", + "id": "def-public.unhashQuery.$2", "type": "Object", "tags": [], "label": "options", @@ -4096,7 +4096,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.url", + "id": "def-public.unhashUrl.$1", "type": "string", "tags": [], "label": "url", @@ -4749,7 +4749,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.IKbnUrlStateStorage.set.$3.opts", + "id": "def-public.IKbnUrlStateStorage.set.$3", "type": "Object", "tags": [], "label": "opts", @@ -4759,7 +4759,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.IKbnUrlStateStorage.set.$3.opts.replace", + "id": "def-public.IKbnUrlStateStorage.set.$3.replace", "type": "boolean", "tags": [], "label": "replace", @@ -5566,7 +5566,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.state", + "id": "def-public.ReduxLikeStateContainer.reducer.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -5579,7 +5579,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.action", + "id": "def-public.ReduxLikeStateContainer.reducer.$2", "type": "Object", "tags": [], "label": "action", @@ -6019,7 +6019,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.previous", + "id": "def-public.Comparator.$1", "type": "Uncategorized", "tags": [], "label": "previous", @@ -6032,7 +6032,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.current", + "id": "def-public.Comparator.$2", "type": "Uncategorized", "tags": [], "label": "current", @@ -6072,7 +6072,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.mapStateToProp", + "id": "def-public.Connect.$1", "type": "Function", "tags": [], "label": "mapStateToProp", @@ -6086,7 +6086,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.state", + "id": "def-public.Connect.$1.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -6120,7 +6120,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.action", + "id": "def-public.Dispatch.$1", "type": "Uncategorized", "tags": [], "label": "action", @@ -6158,7 +6158,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.state", + "id": "def-public.EnsurePureSelector.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -6190,7 +6190,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.state", + "id": "def-public.EnsurePureTransition.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -6238,7 +6238,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.state", + "id": "def-public.MapStateToProps.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -6290,7 +6290,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.store", + "id": "def-public.Middleware.$1", "type": "Object", "tags": [], "label": "store", @@ -6330,7 +6330,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.state", + "id": "def-public.PureSelector.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -6403,7 +6403,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.args", + "id": "def-public.PureSelectorToSelector.$1", "type": "Uncategorized", "tags": [], "label": "args", @@ -6437,7 +6437,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.state", + "id": "def-public.Reducer.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -6450,7 +6450,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.action", + "id": "def-public.Reducer.$2", "type": "Object", "tags": [], "label": "action", @@ -6481,7 +6481,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.args", + "id": "def-public.Selector.$1", "type": "Uncategorized", "tags": [], "label": "args", @@ -6511,7 +6511,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.value", + "id": "def-public.Set.$1", "type": "Uncategorized", "tags": [], "label": "value", @@ -6691,7 +6691,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.query", + "id": "def-public.url.encodeQuery.$1", "type": "Object", "tags": [], "label": "query", @@ -6705,7 +6705,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.encodeFunction", + "id": "def-public.url.encodeQuery.$2", "type": "Function", "tags": [], "label": "encodeFunction", @@ -6719,7 +6719,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.val", + "id": "def-public.url.encodeQuery.$2.$1", "type": "string", "tags": [], "label": "val", @@ -6729,7 +6729,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.pctEncodeSpaces", + "id": "def-public.url.encodeQuery.$2.$2", "type": "CompoundType", "tags": [], "label": "pctEncodeSpaces", @@ -6744,7 +6744,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.pctEncodeSpaces", + "id": "def-public.url.encodeQuery.$3", "type": "boolean", "tags": [], "label": "pctEncodeSpaces", @@ -6770,7 +6770,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.val", + "id": "def-public.url.encodeUriQuery.$1", "type": "string", "tags": [], "label": "val", @@ -6780,7 +6780,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.pctEncodeSpaces", + "id": "def-public.url.encodeUriQuery.$2", "type": "boolean", "tags": [], "label": "pctEncodeSpaces", @@ -6806,7 +6806,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-public.params", + "id": "def-public.url.addQueryParam.$1", "type": "string", "tags": [], "label": "params", @@ -6816,7 +6816,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.key", + "id": "def-public.url.addQueryParam.$2", "type": "string", "tags": [], "label": "key", @@ -6826,7 +6826,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-public.value", + "id": "def-public.url.addQueryParam.$3", "type": "string", "tags": [], "label": "value", @@ -7677,7 +7677,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-server.value", + "id": "def-server.Set.$1", "type": "Uncategorized", "tags": [], "label": "value", @@ -7723,7 +7723,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-server.query", + "id": "def-server.url.encodeQuery.$1", "type": "Object", "tags": [], "label": "query", @@ -7737,7 +7737,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-server.encodeFunction", + "id": "def-server.url.encodeQuery.$2", "type": "Function", "tags": [], "label": "encodeFunction", @@ -7751,7 +7751,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-server.val", + "id": "def-server.url.encodeQuery.$2.$1", "type": "string", "tags": [], "label": "val", @@ -7761,7 +7761,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-server.pctEncodeSpaces", + "id": "def-server.url.encodeQuery.$2.$2", "type": "CompoundType", "tags": [], "label": "pctEncodeSpaces", @@ -7776,7 +7776,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-server.pctEncodeSpaces", + "id": "def-server.url.encodeQuery.$3", "type": "boolean", "tags": [], "label": "pctEncodeSpaces", @@ -7802,7 +7802,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-server.val", + "id": "def-server.url.encodeUriQuery.$1", "type": "string", "tags": [], "label": "val", @@ -7812,7 +7812,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-server.pctEncodeSpaces", + "id": "def-server.url.encodeUriQuery.$2", "type": "boolean", "tags": [], "label": "pctEncodeSpaces", @@ -7838,7 +7838,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-server.params", + "id": "def-server.url.addQueryParam.$1", "type": "string", "tags": [], "label": "params", @@ -7848,7 +7848,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-server.key", + "id": "def-server.url.addQueryParam.$2", "type": "string", "tags": [], "label": "key", @@ -7858,7 +7858,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-server.value", + "id": "def-server.url.addQueryParam.$3", "type": "string", "tags": [], "label": "value", @@ -7971,7 +7971,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.data", + "id": "def-common.Defer.resolve.$1", "type": "Uncategorized", "tags": [], "label": "data", @@ -8000,7 +8000,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.error", + "id": "def-common.Defer.reject.$1", "type": "Any", "tags": [], "label": "error", @@ -8510,7 +8510,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.o", + "id": "def-common.calculateObjectHash.$1", "type": "Uncategorized", "tags": [], "label": "o", @@ -9022,7 +9022,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.glob", + "id": "def-common.makeRegEx.$1", "type": "string", "tags": [], "label": "glob", @@ -10117,7 +10117,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.state", + "id": "def-common.ReduxLikeStateContainer.reducer.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -10130,7 +10130,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-common.action", + "id": "def-common.ReduxLikeStateContainer.reducer.$2", "type": "Object", "tags": [], "label": "action", @@ -10556,7 +10556,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.previous", + "id": "def-common.Comparator.$1", "type": "Uncategorized", "tags": [], "label": "previous", @@ -10569,7 +10569,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-common.current", + "id": "def-common.Comparator.$2", "type": "Uncategorized", "tags": [], "label": "current", @@ -10609,7 +10609,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.mapStateToProp", + "id": "def-common.Connect.$1", "type": "Function", "tags": [], "label": "mapStateToProp", @@ -10623,7 +10623,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.state", + "id": "def-common.Connect.$1.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -10657,7 +10657,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.action", + "id": "def-common.Dispatch.$1", "type": "Uncategorized", "tags": [], "label": "action", @@ -10695,7 +10695,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.state", + "id": "def-common.EnsurePureSelector.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -10727,7 +10727,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.state", + "id": "def-common.EnsurePureTransition.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -10775,7 +10775,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.state", + "id": "def-common.MapStateToProps.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -10827,7 +10827,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.store", + "id": "def-common.Middleware.$1", "type": "Object", "tags": [], "label": "store", @@ -10859,7 +10859,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.state", + "id": "def-common.MigrateFunction.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -10946,7 +10946,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.state", + "id": "def-common.PersistableStateMigrateFn.$1", "type": "Object", "tags": [], "label": "state", @@ -10959,7 +10959,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-common.version", + "id": "def-common.PersistableStateMigrateFn.$2", "type": "string", "tags": [], "label": "version", @@ -10994,7 +10994,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.state", + "id": "def-common.PureSelector.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -11067,7 +11067,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.args", + "id": "def-common.PureSelectorToSelector.$1", "type": "Uncategorized", "tags": [], "label": "args", @@ -11101,7 +11101,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.state", + "id": "def-common.Reducer.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -11114,7 +11114,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-common.action", + "id": "def-common.Reducer.$2", "type": "Object", "tags": [], "label": "action", @@ -11145,7 +11145,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.args", + "id": "def-common.Selector.$1", "type": "Uncategorized", "tags": [], "label": "args", @@ -11175,7 +11175,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.value", + "id": "def-common.Set.$1", "type": "Uncategorized", "tags": [], "label": "value", @@ -11271,7 +11271,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.query", + "id": "def-common.url.encodeQuery.$1", "type": "Object", "tags": [], "label": "query", @@ -11285,7 +11285,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-common.encodeFunction", + "id": "def-common.url.encodeQuery.$2", "type": "Function", "tags": [], "label": "encodeFunction", @@ -11299,7 +11299,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.val", + "id": "def-common.url.encodeQuery.$2.$1", "type": "string", "tags": [], "label": "val", @@ -11309,7 +11309,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-common.pctEncodeSpaces", + "id": "def-common.url.encodeQuery.$2.$2", "type": "CompoundType", "tags": [], "label": "pctEncodeSpaces", @@ -11324,7 +11324,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-common.pctEncodeSpaces", + "id": "def-common.url.encodeQuery.$3", "type": "boolean", "tags": [], "label": "pctEncodeSpaces", @@ -11350,7 +11350,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.val", + "id": "def-common.url.encodeUriQuery.$1", "type": "string", "tags": [], "label": "val", @@ -11360,7 +11360,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-common.pctEncodeSpaces", + "id": "def-common.url.encodeUriQuery.$2", "type": "boolean", "tags": [], "label": "pctEncodeSpaces", @@ -11386,7 +11386,7 @@ "children": [ { "parentPluginId": "kibanaUtils", - "id": "def-common.params", + "id": "def-common.url.addQueryParam.$1", "type": "string", "tags": [], "label": "params", @@ -11396,7 +11396,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-common.key", + "id": "def-common.url.addQueryParam.$2", "type": "string", "tags": [], "label": "key", @@ -11406,7 +11406,7 @@ }, { "parentPluginId": "kibanaUtils", - "id": "def-common.value", + "id": "def-common.url.addQueryParam.$3", "type": "string", "tags": [], "label": "value", diff --git a/api_docs/lens.json b/api_docs/lens.json index 9d95f42c1cfcf..dce599589f905 100644 --- a/api_docs/lens.json +++ b/api_docs/lens.json @@ -332,7 +332,7 @@ "label": "operationType", "description": [], "signature": [ - "\"range\" | \"filters\" | \"count\" | \"max\" | \"min\" | \"date_histogram\" | \"sum\" | \"average\" | \"percentile\" | \"terms\" | \"median\" | \"cumulative_sum\" | \"moving_average\" | \"math\" | \"overall_sum\" | \"overall_min\" | \"overall_max\" | \"overall_average\" | \"counter_rate\" | \"differences\" | \"unique_count\" | \"last_value\" | \"formula\" | undefined" + "\"range\" | \"filters\" | \"max\" | \"min\" | \"count\" | \"date_histogram\" | \"sum\" | \"average\" | \"percentile\" | \"terms\" | \"median\" | \"cumulative_sum\" | \"moving_average\" | \"math\" | \"overall_sum\" | \"overall_min\" | \"overall_max\" | \"overall_average\" | \"counter_rate\" | \"differences\" | \"unique_count\" | \"last_value\" | \"formula\" | undefined" ], "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts", "deprecated": false @@ -686,7 +686,7 @@ }, { "parentPluginId": "lens", - "id": "def-public.LensPublicStart.navigateToPrefilledEditor.$2.options", + "id": "def-public.LensPublicStart.navigateToPrefilledEditor.$2", "type": "Object", "tags": [], "label": "options", @@ -696,7 +696,7 @@ "children": [ { "parentPluginId": "lens", - "id": "def-public.LensPublicStart.navigateToPrefilledEditor.$2.options.openInNewTab", + "id": "def-public.LensPublicStart.navigateToPrefilledEditor.$2.openInNewTab", "type": "CompoundType", "tags": [], "label": "openInNewTab", @@ -709,7 +709,7 @@ }, { "parentPluginId": "lens", - "id": "def-public.LensPublicStart.navigateToPrefilledEditor.$2.options.originatingApp", + "id": "def-public.LensPublicStart.navigateToPrefilledEditor.$2.originatingApp", "type": "string", "tags": [], "label": "originatingApp", @@ -722,7 +722,7 @@ }, { "parentPluginId": "lens", - "id": "def-public.LensPublicStart.navigateToPrefilledEditor.$2.options.originatingPath", + "id": "def-public.LensPublicStart.navigateToPrefilledEditor.$2.originatingPath", "type": "string", "tags": [], "label": "originatingPath", @@ -900,7 +900,7 @@ "label": "dataType", "description": [], "signature": [ - "\"string\" | \"number\" | \"boolean\" | \"date\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"histogram\" | \"document\"" + "\"string\" | \"number\" | \"boolean\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"histogram\" | \"document\"" ], "path": "x-pack/plugins/lens/public/types.ts", "deprecated": false @@ -1837,7 +1837,7 @@ "label": "DataType", "description": [], "signature": [ - "\"string\" | \"number\" | \"boolean\" | \"date\" | \"ip\" | \"geo_point\" | \"geo_shape\" | \"histogram\" | \"document\"" + "\"string\" | \"number\" | \"boolean\" | \"date\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"histogram\" | \"document\"" ], "path": "x-pack/plugins/lens/public/types.ts", "deprecated": false, @@ -2210,7 +2210,7 @@ "\nA union type of all available operation types. The operation type is a unique id of an operation.\nEach column is assigned to exactly one operation type." ], "signature": [ - "\"range\" | \"filters\" | \"count\" | \"max\" | \"min\" | \"date_histogram\" | \"sum\" | \"average\" | \"percentile\" | \"terms\" | \"median\" | \"cumulative_sum\" | \"moving_average\" | \"math\" | \"overall_sum\" | \"overall_min\" | \"overall_max\" | \"overall_average\" | \"counter_rate\" | \"differences\" | \"unique_count\" | \"last_value\" | \"formula\"" + "\"range\" | \"filters\" | \"max\" | \"min\" | \"count\" | \"date_histogram\" | \"sum\" | \"average\" | \"percentile\" | \"terms\" | \"median\" | \"cumulative_sum\" | \"moving_average\" | \"math\" | \"overall_sum\" | \"overall_min\" | \"overall_max\" | \"overall_average\" | \"counter_rate\" | \"differences\" | \"unique_count\" | \"last_value\" | \"formula\"" ], "path": "x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts", "deprecated": false, @@ -2819,7 +2819,7 @@ "label": "state", "description": [], "signature": [ - "{ datasourceMetaData: { filterableIndexPatterns: { id: string; title: string; }[]; }; datasourceStates: { indexpattern: { currentIndexPatternId: string; layers: Record; }>; }; }; visualization: VisualizationState; query: ", + "{ datasourceMetaData: { filterableIndexPatterns: { id: string; title: string; }[]; }; datasourceStates: { indexpattern: { currentIndexPatternId: string; layers: Record; }>; }; }; visualization: VisualizationState; query: ", "Query", "; filters: ", "Filter", @@ -2992,7 +2992,43 @@ "label": "expressions", "description": [], "signature": [ - "{ readonly getType: (name: string) => ", + "{ readonly inject: (state: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpression", + "text": "ExpressionAstExpression" + }, + ", references: ", + "SavedObjectReference", + "[]) => ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpression", + "text": "ExpressionAstExpression" + }, + "; readonly extract: (state: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpression", + "text": "ExpressionAstExpression" + }, + ") => { state: ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ExpressionAstExpression", + "text": "ExpressionAstExpression" + }, + "; references: ", + "SavedObjectReference", + "[]; }; readonly getType: (name: string) => ", { "pluginId": "expressions", "scope": "common", @@ -3238,11 +3274,11 @@ "section": "def-server.LensDocShapePost712", "text": "LensDocShapePost712" }, - ", \"title\" | \"expression\" | \"visualizationType\"> & { state: Pick<{ datasourceMetaData: { filterableIndexPatterns: { id: string; title: string; }[]; }; datasourceStates: { indexpattern: { currentIndexPatternId: string; layers: Record; }>; }; }; visualization: unknown; query: ", + ", \"title\" | \"expression\" | \"visualizationType\"> & { state: Pick<{ datasourceMetaData: { filterableIndexPatterns: { id: string; title: string; }[]; }; datasourceStates: { indexpattern: { currentIndexPatternId: string; layers: Record; }>; }; }; visualization: unknown; query: ", "Query", "; filters: ", "Filter", - "[]; }, \"filters\" | \"query\" | \"visualization\" | \"datasourceMetaData\"> & { datasourceStates: { indexpattern: Pick<{ currentIndexPatternId: string; layers: Record; }>; }, \"currentIndexPatternId\"> & { layers: Record; }, never> & { columns: Record; }>; }; }; }; }" + "[]; }, \"filters\" | \"query\" | \"visualization\" | \"datasourceMetaData\"> & { datasourceStates: { indexpattern: Pick<{ currentIndexPatternId: string; layers: Record; }>; }, \"currentIndexPatternId\"> & { layers: Record; }, never> & { columns: Record; }>; }; }; }; }" ], "path": "x-pack/plugins/lens/server/migrations/types.ts", "deprecated": false, @@ -3264,11 +3300,11 @@ "section": "def-server.LensDocShapePost712", "text": "LensDocShapePost712" }, - ", \"title\" | \"expression\" | \"visualizationType\"> & { state: Pick<{ datasourceMetaData: { filterableIndexPatterns: { id: string; title: string; }[]; }; datasourceStates: { indexpattern: { currentIndexPatternId: string; layers: Record; }>; }; }; visualization: unknown; query: ", + ", \"title\" | \"expression\" | \"visualizationType\"> & { state: Pick<{ datasourceMetaData: { filterableIndexPatterns: { id: string; title: string; }[]; }; datasourceStates: { indexpattern: { currentIndexPatternId: string; layers: Record; }>; }; }; visualization: unknown; query: ", "Query", "; filters: ", "Filter", - "[]; }, \"filters\" | \"query\" | \"visualization\" | \"datasourceMetaData\"> & { datasourceStates: { indexpattern: Pick<{ currentIndexPatternId: string; layers: Record; }>; }, \"currentIndexPatternId\"> & { layers: Record; }, never> & { columns: Record; }>; }; }; }; }" + "[]; }, \"filters\" | \"query\" | \"visualization\" | \"datasourceMetaData\"> & { datasourceStates: { indexpattern: Pick<{ currentIndexPatternId: string; layers: Record; }>; }, \"currentIndexPatternId\"> & { layers: Record; }, never> & { columns: Record; }>; }; }; }; }" ], "path": "x-pack/plugins/lens/server/migrations/types.ts", "deprecated": false, @@ -3282,7 +3318,7 @@ "label": "OperationTypePost712", "description": [], "signature": [ - "\"range\" | \"filters\" | \"count\" | \"max\" | \"min\" | \"date_histogram\" | \"sum\" | \"average\" | \"percentile\" | \"terms\" | \"median\" | \"cumulative_sum\" | \"moving_average\" | \"counter_rate\" | \"differences\" | \"unique_count\" | \"last_value\"" + "\"range\" | \"filters\" | \"max\" | \"min\" | \"count\" | \"date_histogram\" | \"sum\" | \"average\" | \"percentile\" | \"terms\" | \"median\" | \"cumulative_sum\" | \"moving_average\" | \"counter_rate\" | \"differences\" | \"unique_count\" | \"last_value\"" ], "path": "x-pack/plugins/lens/server/migrations/types.ts", "deprecated": false, @@ -3296,7 +3332,53 @@ "label": "OperationTypePre712", "description": [], "signature": [ - "\"range\" | \"filters\" | \"count\" | \"max\" | \"min\" | \"date_histogram\" | \"sum\" | \"percentile\" | \"terms\" | \"avg\" | \"median\" | \"cumulative_sum\" | \"derivative\" | \"moving_average\" | \"cardinality\" | \"counter_rate\" | \"last_value\"" + "\"range\" | \"filters\" | \"max\" | \"min\" | \"count\" | \"date_histogram\" | \"sum\" | \"percentile\" | \"terms\" | \"avg\" | \"median\" | \"cumulative_sum\" | \"derivative\" | \"moving_average\" | \"cardinality\" | \"counter_rate\" | \"last_value\"" + ], + "path": "x-pack/plugins/lens/server/migrations/types.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "lens", + "id": "def-server.VisState716", + "type": "Type", + "tags": [], + "label": "VisState716", + "description": [], + "signature": [ + "{ columns: { palette?: ", + { + "pluginId": "charts", + "scope": "common", + "docId": "kibChartsPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, + "<", + { + "pluginId": "lens", + "scope": "common", + "docId": "kibLensPluginApi", + "section": "def-common.CustomPaletteParams", + "text": "CustomPaletteParams" + }, + "> | undefined; colorMode?: \"none\" | \"text\" | \"cell\" | undefined; }[]; } | { palette?: ", + { + "pluginId": "charts", + "scope": "common", + "docId": "kibChartsPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, + "<", + { + "pluginId": "lens", + "scope": "common", + "docId": "kibLensPluginApi", + "section": "def-common.CustomPaletteParams", + "text": "CustomPaletteParams" + }, + "> | undefined; }" ], "path": "x-pack/plugins/lens/server/migrations/types.ts", "deprecated": false, @@ -4209,7 +4291,7 @@ "children": [ { "parentPluginId": "lens", - "id": "def-common.mapping", + "id": "def-common.FormatFactory.$1", "type": "Object", "tags": [], "label": "mapping", diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index 27987a349628c..308d91993a799 100644 --- a/api_docs/lens.mdx +++ b/api_docs/lens.mdx @@ -12,13 +12,13 @@ import lensObj from './lens.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 [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. **Code health stats** | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 246 | 0 | 228 | 23 | +| 247 | 0 | 229 | 23 | ## Client diff --git a/api_docs/licensing.json b/api_docs/licensing.json index 7c115d73327bd..c363aea16420e 100644 --- a/api_docs/licensing.json +++ b/api_docs/licensing.json @@ -628,19 +628,7 @@ "initialIsOpen": false } ], - "enums": [ - { - "parentPluginId": "licensing", - "id": "def-public.LICENSE_TYPE", - "type": "Enum", - "tags": [], - "label": "LICENSE_TYPE", - "description": [], - "path": "x-pack/plugins/licensing/common/types.ts", - "deprecated": false, - "initialIsOpen": false - } - ], + "enums": [], "misc": [ { "parentPluginId": "licensing", @@ -2409,7 +2397,7 @@ "children": [ { "parentPluginId": "licensing", - "id": "def-server.license", + "id": "def-server.CheckLicense.$1", "type": "Object", "tags": [], "label": "license", diff --git a/api_docs/licensing.mdx b/api_docs/licensing.mdx index 681979516efd1..a09339c9cf17e 100644 --- a/api_docs/licensing.mdx +++ b/api_docs/licensing.mdx @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 118 | 0 | 43 | 8 | +| 117 | 0 | 42 | 8 | ## Client @@ -31,9 +31,6 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que ### Interfaces -### Enums - - ### Consts, variables and types diff --git a/api_docs/lists.json b/api_docs/lists.json index 1659d6ee2a5b5..363f63da45ff3 100644 --- a/api_docs/lists.json +++ b/api_docs/lists.json @@ -410,7 +410,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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -480,7 +480,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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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; }>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -514,7 +514,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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -548,7 +548,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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -682,7 +682,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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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; }>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -726,7 +726,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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -764,7 +764,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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -830,7 +830,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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -862,7 +862,7 @@ "signature": [ "({ listId, filter, perPage, page, 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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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; } | 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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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; } | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -894,7 +894,7 @@ "signature": [ "({ listId, filter, perPage, page, 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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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; } | 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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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; } | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -926,7 +926,7 @@ "signature": [ "({ perPage, page, 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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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; } | 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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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; } | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -992,7 +992,7 @@ "signature": [ "({ filter, perPage, page, 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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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; } | 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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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; } | null>" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts", "deprecated": false, @@ -1097,7 +1097,7 @@ "signature": [ "({ id }: ", "GetListOptions", - ") => Promise<{ _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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" + ") => Promise<{ _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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1129,7 +1129,7 @@ "signature": [ "({ id, deserializer, immutable, serializer, name, description, type, meta, version, }: ", "CreateListOptions", - ") => Promise<{ _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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" + ") => Promise<{ _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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1161,7 +1161,7 @@ "signature": [ "({ id, deserializer, serializer, name, description, immutable, type, meta, version, }: ", "CreateListIfItDoesNotExistOptions", - ") => Promise<{ _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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" + ") => Promise<{ _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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1493,7 +1493,7 @@ "signature": [ "({ id }: ", "DeleteListItemOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1525,7 +1525,7 @@ "signature": [ "({ listId, value, type, }: ", "DeleteListItemByValueOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1557,7 +1557,7 @@ "signature": [ "({ id }: ", "DeleteListOptions", - ") => Promise<{ _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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" + ") => Promise<{ _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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1621,7 +1621,7 @@ "signature": [ "({ deserializer, serializer, type, listId, stream, meta, version, }: ", "ImportListItemsToStreamOptions", - ") => Promise<{ _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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" + ") => Promise<{ _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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1653,7 +1653,7 @@ "signature": [ "({ listId, value, type, }: ", "GetListItemByValueOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1685,7 +1685,7 @@ "signature": [ "({ id, deserializer, serializer, listId, value, type, meta, }: ", "CreateListItemOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1717,7 +1717,7 @@ "signature": [ "({ _version, id, value, meta, }: ", "UpdateListItemOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1749,7 +1749,7 @@ "signature": [ "({ _version, id, name, description, meta, version, }: ", "UpdateListOptions", - ") => Promise<{ _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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" + ") => Promise<{ _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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1781,7 +1781,7 @@ "signature": [ "({ id }: ", "GetListItemOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1813,7 +1813,7 @@ "signature": [ "({ type, listId, value, }: ", "GetListItemsByValueOptions", - ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" + ") => Promise<{ _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1845,7 +1845,7 @@ "signature": [ "({ type, listId, value, }: ", "SearchListItemByValuesOptions", - ") => Promise<{ items: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]; value: unknown; }[]>" + ") => Promise<{ items: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]; value: unknown; }[]>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1877,7 +1877,7 @@ "signature": [ "({ filter, currentIndexPosition, perPage, page, sortField, sortOrder, searchAfter, }: ", "FindListOptions", - ") => Promise<{ 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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }>" + ") => Promise<{ 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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; version: number; }[]; page: number; per_page: number; total: number; }>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1909,7 +1909,7 @@ "signature": [ "({ listId, filter, currentIndexPosition, perPage, page, sortField, sortOrder, searchAfter, }: ", "FindListItemOptions", - ") => Promise<{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]; page: number; per_page: number; total: number; } | null>" + ") => Promise<{ cursor: string; data: { _version: string | undefined; created_at: string; created_by: string; deserializer: string | undefined; id: string; list_id: string; meta: object | undefined; serializer: string | undefined; tie_breaker_id: string; type: \"boolean\" | \"date\" | \"keyword\" | \"ip_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_range\"; updated_at: string; updated_by: string; value: string; }[]; page: number; per_page: number; total: number; } | null>" ], "path": "x-pack/plugins/lists/server/services/lists/list_client.ts", "deprecated": false, @@ -1968,7 +1968,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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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; })[]" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", "deprecated": false @@ -2122,7 +2122,7 @@ "children": [ { "parentPluginId": "lists", - "id": "def-server.savedObjectsClient", + "id": "def-server.ListPluginSetup.getExceptionListClient.$1", "type": "Object", "tags": [], "label": "savedObjectsClient", @@ -2435,7 +2435,7 @@ }, { "parentPluginId": "lists", - "id": "def-server.user", + "id": "def-server.ListPluginSetup.getExceptionListClient.$2", "type": "string", "tags": [], "label": "user", @@ -2476,7 +2476,7 @@ "children": [ { "parentPluginId": "lists", - "id": "def-server.esClient", + "id": "def-server.ListPluginSetup.getListClient.$1", "type": "CompoundType", "tags": [], "label": "esClient", @@ -2484,7 +2484,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"count\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"count\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", @@ -2499,7 +2499,7 @@ }, { "parentPluginId": "lists", - "id": "def-server.spaceId", + "id": "def-server.ListPluginSetup.getListClient.$2", "type": "string", "tags": [], "label": "spaceId", @@ -2509,7 +2509,7 @@ }, { "parentPluginId": "lists", - "id": "def-server.user", + "id": "def-server.ListPluginSetup.getListClient.$3", "type": "string", "tags": [], "label": "user", @@ -2623,7 +2623,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\" | \"long\" | \"double\" | \"ip\" | \"geo_point\" | \"date_nanos\" | \"ip_range\" | \"date_range\" | \"geo_shape\" | \"text\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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_range\" | \"date_range\" | \"geo_point\" | \"geo_shape\" | \"ip\" | \"long\" | \"double\" | \"text\" | \"date_nanos\" | \"shape\" | \"short\" | \"binary\" | \"float\" | \"half_float\" | \"integer\" | \"byte\" | \"long_range\" | \"integer_range\" | \"float_range\" | \"double_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; })[]" ], "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts", "deprecated": false diff --git a/api_docs/management.json b/api_docs/management.json index 5ec2da0cdf204..4084cd41bbeb1 100644 --- a/api_docs/management.json +++ b/api_docs/management.json @@ -51,7 +51,7 @@ "children": [ { "parentPluginId": "management", - "id": "def-public.params", + "id": "def-public.ManagementApp.mount.$1", "type": "Object", "tags": [], "label": "params", @@ -590,7 +590,7 @@ "children": [ { "parentPluginId": "management", - "id": "def-public.params", + "id": "def-public.RegisterManagementAppArgs.mount.$1", "type": "Object", "tags": [], "label": "params", diff --git a/api_docs/management.mdx b/api_docs/management.mdx index 36cc53caa1b74..75442078212e5 100644 --- a/api_docs/management.mdx +++ b/api_docs/management.mdx @@ -12,7 +12,7 @@ import managementObj from './management.json'; -Contact [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/maps.json b/api_docs/maps.json index 7a4ba52cc803b..86cc9f7f36195 100644 --- a/api_docs/maps.json +++ b/api_docs/maps.json @@ -482,7 +482,7 @@ "children": [ { "parentPluginId": "maps", - "id": "def-public.MapEmbeddable._dispatchSetQuery.$1.forceRefresh", + "id": "def-public.MapEmbeddable._dispatchSetQuery.$1", "type": "Object", "tags": [], "label": "{ forceRefresh }", @@ -492,7 +492,7 @@ "children": [ { "parentPluginId": "maps", - "id": "def-public.MapEmbeddable._dispatchSetQuery.$1.forceRefresh.forceRefresh", + "id": "def-public.MapEmbeddable._dispatchSetQuery.$1.forceRefresh", "type": "boolean", "tags": [], "label": "forceRefresh", @@ -1036,7 +1036,7 @@ "children": [ { "parentPluginId": "maps", - "id": "def-public.RenderTooltipContentParams.loadFeatureProperties.$1.layerIdfeatureIdmbProperties", + "id": "def-public.RenderTooltipContentParams.loadFeatureProperties.$1", "type": "Object", "tags": [], "label": "{\n layerId,\n featureId,\n mbProperties,\n }", @@ -1046,7 +1046,7 @@ "children": [ { "parentPluginId": "maps", - "id": "def-public.RenderTooltipContentParams.loadFeatureProperties.$1.layerIdfeatureIdmbProperties.layerId", + "id": "def-public.RenderTooltipContentParams.loadFeatureProperties.$1.layerId", "type": "string", "tags": [], "label": "layerId", @@ -1056,7 +1056,7 @@ }, { "parentPluginId": "maps", - "id": "def-public.RenderTooltipContentParams.loadFeatureProperties.$1.layerIdfeatureIdmbProperties.featureId", + "id": "def-public.RenderTooltipContentParams.loadFeatureProperties.$1.featureId", "type": "CompoundType", "tags": [], "label": "featureId", @@ -1069,7 +1069,7 @@ }, { "parentPluginId": "maps", - "id": "def-public.RenderTooltipContentParams.loadFeatureProperties.$1.layerIdfeatureIdmbProperties.mbProperties", + "id": "def-public.RenderTooltipContentParams.loadFeatureProperties.$1.mbProperties", "type": "CompoundType", "tags": [], "label": "mbProperties", @@ -1100,7 +1100,7 @@ "children": [ { "parentPluginId": "maps", - "id": "def-public.RenderTooltipContentParams.loadFeatureGeometry.$1.layerIdfeatureId", + "id": "def-public.RenderTooltipContentParams.loadFeatureGeometry.$1", "type": "Object", "tags": [], "label": "{\n layerId,\n featureId,\n }", @@ -1110,7 +1110,7 @@ "children": [ { "parentPluginId": "maps", - "id": "def-public.RenderTooltipContentParams.loadFeatureGeometry.$1.layerIdfeatureId.layerId", + "id": "def-public.RenderTooltipContentParams.loadFeatureGeometry.$1.layerId", "type": "string", "tags": [], "label": "layerId", @@ -1120,7 +1120,7 @@ }, { "parentPluginId": "maps", - "id": "def-public.RenderTooltipContentParams.loadFeatureGeometry.$1.layerIdfeatureId.featureId", + "id": "def-public.RenderTooltipContentParams.loadFeatureGeometry.$1.featureId", "type": "CompoundType", "tags": [], "label": "featureId", @@ -2567,7 +2567,7 @@ "children": [ { "parentPluginId": "maps", - "id": "def-common.value", + "id": "def-common.FieldFormatter.$1", "type": "CompoundType", "tags": [], "label": "value", diff --git a/api_docs/maps_ems.json b/api_docs/maps_ems.json index aa5ed81bdd130..264b19d2b26d6 100644 --- a/api_docs/maps_ems.json +++ b/api_docs/maps_ems.json @@ -347,7 +347,7 @@ "children": [ { "parentPluginId": "mapsEms", - "id": "def-public.IServiceSettings.setQueryParams.$1.params", + "id": "def-public.IServiceSettings.setQueryParams.$1", "type": "Object", "tags": [], "label": "params", @@ -357,7 +357,7 @@ "children": [ { "parentPluginId": "mapsEms", - "id": "def-public.IServiceSettings.setQueryParams.$1.params.Unnamed", + "id": "def-public.IServiceSettings.setQueryParams.$1.Unnamed", "type": "Any", "tags": [], "label": "Unnamed", @@ -662,20 +662,6 @@ "deprecated": false, "initialIsOpen": false }, - { - "parentPluginId": "mapsEms", - "id": "def-public.LayerConfig", - "type": "Type", - "tags": [], - "label": "LayerConfig", - "description": [], - "signature": [ - "{ readonly name: string; readonly fields: Readonly<{} & { description: string; name: string; }>[]; readonly meta: Readonly<{} & { feature_collection_path: string; }>; readonly format: Readonly<{} & { type: string; }>; readonly url: string; readonly attribution: string; }" - ], - "path": "src/plugins/maps_ems/config.ts", - "deprecated": false, - "initialIsOpen": false - }, { "parentPluginId": "mapsEms", "id": "def-public.MapsEmsConfig", @@ -684,7 +670,7 @@ "label": "MapsEmsConfig", "description": [], "signature": [ - "{ readonly includeElasticMapsService: boolean; readonly proxyElasticMapsServiceInMaps: boolean; readonly regionmap: Readonly<{} & { layers: Readonly<{} & { name: string; fields: Readonly<{} & { description: string; name: string; }>[]; meta: Readonly<{} & { feature_collection_path: string; }>; format: Readonly<{} & { type: string; }>; url: string; attribution: string; }>[]; includeElasticMapsService: boolean; }>; readonly tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; readonly manifestServiceUrl: string; readonly emsUrl: string; readonly emsFileApiUrl: string; readonly emsTileApiUrl: string; readonly emsLandingPageUrl: string; readonly emsFontLibraryUrl: string; readonly emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }" + "{ readonly proxyElasticMapsServiceInMaps: boolean; readonly tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; readonly includeElasticMapsService: boolean; readonly manifestServiceUrl: string; readonly emsUrl: string; readonly emsFileApiUrl: string; readonly emsTileApiUrl: string; readonly emsLandingPageUrl: string; readonly emsFontLibraryUrl: string; readonly emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }" ], "path": "src/plugins/maps_ems/config.ts", "deprecated": false, @@ -758,7 +744,7 @@ "label": "config", "description": [], "signature": [ - "{ readonly includeElasticMapsService: boolean; readonly proxyElasticMapsServiceInMaps: boolean; readonly regionmap: Readonly<{} & { layers: Readonly<{} & { name: string; fields: Readonly<{} & { description: string; name: string; }>[]; meta: Readonly<{} & { feature_collection_path: string; }>; format: Readonly<{} & { type: string; }>; url: string; attribution: string; }>[]; includeElasticMapsService: boolean; }>; readonly tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; readonly manifestServiceUrl: string; readonly emsUrl: string; readonly emsFileApiUrl: string; readonly emsTileApiUrl: string; readonly emsLandingPageUrl: string; readonly emsFontLibraryUrl: string; readonly emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }" + "{ readonly proxyElasticMapsServiceInMaps: boolean; readonly tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; readonly includeElasticMapsService: boolean; readonly manifestServiceUrl: string; readonly emsUrl: string; readonly emsFileApiUrl: string; readonly emsTileApiUrl: string; readonly emsLandingPageUrl: string; readonly emsFontLibraryUrl: string; readonly emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }" ], "path": "src/plugins/maps_ems/public/index.ts", "deprecated": false @@ -859,7 +845,7 @@ "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, - "[]; meta: Readonly<{} & { feature_collection_path: string; }>; format: Readonly<{} & { type: string; }>; url: string; attribution: string; }>[]; includeElasticMapsService: boolean; }>; tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; manifestServiceUrl: string; emsUrl: string; emsFileApiUrl: string; emsTileApiUrl: string; emsLandingPageUrl: string; emsFontLibraryUrl: string; emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }>>" + "; }>; includeElasticMapsService: boolean; manifestServiceUrl: string; emsUrl: string; emsFileApiUrl: string; emsTileApiUrl: string; emsLandingPageUrl: string; emsFontLibraryUrl: string; emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }>>" ], "path": "src/plugins/maps_ems/server/index.ts", "deprecated": false @@ -892,7 +878,7 @@ "section": "def-server.PluginInitializerContext", "text": "PluginInitializerContext" }, - "[]; meta: Readonly<{} & { feature_collection_path: string; }>; format: Readonly<{} & { type: string; }>; url: string; attribution: string; }>[]; includeElasticMapsService: boolean; }>; tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; manifestServiceUrl: string; emsUrl: string; emsFileApiUrl: string; emsTileApiUrl: string; emsLandingPageUrl: string; emsFontLibraryUrl: string; emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }>>" + "; }>; includeElasticMapsService: boolean; manifestServiceUrl: string; emsUrl: string; emsFileApiUrl: string; emsTileApiUrl: string; emsLandingPageUrl: string; emsFontLibraryUrl: string; emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }>>" ], "path": "src/plugins/maps_ems/server/index.ts", "deprecated": false, @@ -917,7 +903,7 @@ "section": "def-server.CoreSetup", "text": "CoreSetup" }, - ") => { config: Readonly<{} & { includeElasticMapsService: boolean; proxyElasticMapsServiceInMaps: boolean; regionmap: Readonly<{} & { layers: Readonly<{} & { name: string; fields: Readonly<{} & { description: string; name: string; }>[]; meta: Readonly<{} & { feature_collection_path: string; }>; format: Readonly<{} & { type: string; }>; url: string; attribution: string; }>[]; includeElasticMapsService: boolean; }>; tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; manifestServiceUrl: string; emsUrl: string; emsFileApiUrl: string; emsTileApiUrl: string; emsLandingPageUrl: string; emsFontLibraryUrl: string; emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }>; }" + ") => { config: Readonly<{} & { proxyElasticMapsServiceInMaps: boolean; tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; includeElasticMapsService: boolean; manifestServiceUrl: string; emsUrl: string; emsFileApiUrl: string; emsTileApiUrl: string; emsLandingPageUrl: string; emsFontLibraryUrl: string; emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }>; }" ], "path": "src/plugins/maps_ems/server/index.ts", "deprecated": false, @@ -985,7 +971,7 @@ "label": "config", "description": [], "signature": [ - "{ readonly includeElasticMapsService: boolean; readonly proxyElasticMapsServiceInMaps: boolean; readonly regionmap: Readonly<{} & { layers: Readonly<{} & { name: string; fields: Readonly<{} & { description: string; name: string; }>[]; meta: Readonly<{} & { feature_collection_path: string; }>; format: Readonly<{} & { type: string; }>; url: string; attribution: string; }>[]; includeElasticMapsService: boolean; }>; readonly tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; readonly manifestServiceUrl: string; readonly emsUrl: string; readonly emsFileApiUrl: string; readonly emsTileApiUrl: string; readonly emsLandingPageUrl: string; readonly emsFontLibraryUrl: string; readonly emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }" + "{ readonly proxyElasticMapsServiceInMaps: boolean; readonly tilemap: Readonly<{ url?: string | undefined; } & { options: Readonly<{ default?: boolean | undefined; tileSize?: number | undefined; subdomains?: string[] | undefined; errorTileUrl?: string | undefined; tms?: boolean | undefined; reuseTiles?: boolean | undefined; bounds?: number[] | undefined; } & { attribution: string; minZoom: number; maxZoom: number; }>; }>; readonly includeElasticMapsService: boolean; readonly manifestServiceUrl: string; readonly emsUrl: string; readonly emsFileApiUrl: string; readonly emsTileApiUrl: string; readonly emsLandingPageUrl: string; readonly emsFontLibraryUrl: string; readonly emsTileLayerId: Readonly<{} & { bright: string; desaturated: string; dark: string; }>; }" ], "path": "src/plugins/maps_ems/server/index.ts", "deprecated": false diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index dbd799c2b9f9d..c1367bf5cc970 100644 --- a/api_docs/maps_ems.mdx +++ b/api_docs/maps_ems.mdx @@ -18,7 +18,7 @@ Contact [GIS](https://github.com/orgs/elastic/teams/kibana-gis) for questions re | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 75 | 1 | 75 | 0 | +| 74 | 1 | 74 | 0 | ## Client diff --git a/api_docs/metrics_entities.json b/api_docs/metrics_entities.json index 0758412d4006a..2816f019eb3fe 100644 --- a/api_docs/metrics_entities.json +++ b/api_docs/metrics_entities.json @@ -50,7 +50,7 @@ "children": [ { "parentPluginId": "metricsEntities", - "id": "def-server.esClient", + "id": "def-server.MetricsEntitiesPluginSetup.getMetricsEntitiesClient.$1", "type": "CompoundType", "tags": [], "label": "esClient", @@ -58,7 +58,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"count\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"count\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", diff --git a/api_docs/ml.json b/api_docs/ml.json index cd2438e61e602..3dd23f2a5d214 100644 --- a/api_docs/ml.json +++ b/api_docs/ml.json @@ -1024,7 +1024,7 @@ }, "<", "MlAnomalyDetectionAlertParams", - ">, \"enabled\" | \"id\" | \"name\" | \"params\" | \"actions\" | \"throttle\" | \"tags\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">[] | undefined" + ">, \"enabled\" | \"id\" | \"name\" | \"tags\" | \"params\" | \"actions\" | \"throttle\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">[] | undefined" ], "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/summary_job.ts", "deprecated": false @@ -1085,7 +1085,7 @@ "children": [ { "parentPluginId": "ml", - "id": "def-public.__0", + "id": "def-public.UseIndexDataReturnType.renderCellValue.$1", "type": "Object", "tags": [], "label": "__0", @@ -1252,7 +1252,7 @@ "children": [ { "parentPluginId": "ml", - "id": "def-public.__0", + "id": "def-public.RenderCellValue.$1", "type": "Object", "tags": [], "label": "__0", @@ -2859,7 +2859,7 @@ }, "<", "MlAnomalyDetectionAlertParams", - ">, \"enabled\" | \"id\" | \"name\" | \"params\" | \"actions\" | \"throttle\" | \"tags\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">[] | undefined" + ">, \"enabled\" | \"id\" | \"name\" | \"tags\" | \"params\" | \"actions\" | \"throttle\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">[] | undefined" ], "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/summary_job.ts", "deprecated": false diff --git a/api_docs/navigation.json b/api_docs/navigation.json index 914bfd12594f6..5224795d5e42b 100644 --- a/api_docs/navigation.json +++ b/api_docs/navigation.json @@ -318,7 +318,7 @@ "children": [ { "parentPluginId": "navigation", - "id": "def-public.anchorElement", + "id": "def-public.TopNavMenuData.run.$1", "type": "Object", "tags": [], "label": "anchorElement", @@ -471,7 +471,7 @@ "section": "def-public.SearchBarProps", "text": "SearchBarProps" }, - ", \"filters\" | \"query\" | \"isClearable\" | \"placeholder\" | \"isLoading\" | \"indexPatterns\" | \"customSubmitButton\" | \"screenTitle\" | \"dataTestSubj\" | \"showQueryBar\" | \"showQueryInput\" | \"showFilterBar\" | \"showDatePicker\" | \"showAutoRefreshOnly\" | \"isRefreshPaused\" | \"refreshInterval\" | \"dateRangeFrom\" | \"dateRangeTo\" | \"showSaveQuery\" | \"savedQuery\" | \"onQueryChange\" | \"onQuerySubmit\" | \"onSaved\" | \"onSavedQueryUpdated\" | \"onClearSavedQuery\" | \"onRefresh\" | \"indicateNoData\" | \"iconType\" | \"nonKqlMode\" | \"nonKqlModeHelpText\" | \"displayStyle\" | \"onFiltersUpdated\" | \"onRefreshChange\"> & { config?: ", + ", \"filters\" | \"query\" | \"savedQuery\" | \"isClearable\" | \"placeholder\" | \"isLoading\" | \"indexPatterns\" | \"customSubmitButton\" | \"screenTitle\" | \"dataTestSubj\" | \"showQueryBar\" | \"showQueryInput\" | \"showFilterBar\" | \"showDatePicker\" | \"showAutoRefreshOnly\" | \"isRefreshPaused\" | \"refreshInterval\" | \"dateRangeFrom\" | \"dateRangeTo\" | \"showSaveQuery\" | \"onQueryChange\" | \"onQuerySubmit\" | \"onSaved\" | \"onSavedQueryUpdated\" | \"onClearSavedQuery\" | \"onRefresh\" | \"indicateNoData\" | \"iconType\" | \"nonKqlMode\" | \"nonKqlModeHelpText\" | \"displayStyle\" | \"onFiltersUpdated\" | \"onRefreshChange\"> & { config?: ", { "pluginId": "navigation", "scope": "public", @@ -611,7 +611,7 @@ "children": [ { "parentPluginId": "navigation", - "id": "def-public.menuItem", + "id": "def-public.NavigationPublicPluginSetup.registerMenuItem.$1", "type": "Object", "tags": [], "label": "menuItem", diff --git a/api_docs/observability.json b/api_docs/observability.json index 0da10c019c3df..8476973fabc4b 100644 --- a/api_docs/observability.json +++ b/api_docs/observability.json @@ -222,7 +222,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.getApmTraceUrl.$1.traceIdrangeFromrangeTo", + "id": "def-public.getApmTraceUrl.$1", "type": "Object", "tags": [], "label": "{\n traceId,\n rangeFrom,\n rangeTo,\n}", @@ -232,7 +232,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.getApmTraceUrl.$1.traceIdrangeFromrangeTo.traceId", + "id": "def-public.getApmTraceUrl.$1.traceId", "type": "string", "tags": [], "label": "traceId", @@ -242,7 +242,7 @@ }, { "parentPluginId": "observability", - "id": "def-public.getApmTraceUrl.$1.traceIdrangeFromrangeTo.rangeFrom", + "id": "def-public.getApmTraceUrl.$1.rangeFrom", "type": "string", "tags": [], "label": "rangeFrom", @@ -252,7 +252,7 @@ }, { "parentPluginId": "observability", - "id": "def-public.getApmTraceUrl.$1.traceIdrangeFromrangeTo.rangeTo", + "id": "def-public.getApmTraceUrl.$1.rangeTo", "type": "string", "tags": [], "label": "rangeTo", @@ -348,7 +348,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.props", + "id": "def-public.LazyAlertsFlyout.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -483,7 +483,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.SectionSubtitle.$1.children", + "id": "def-public.SectionSubtitle.$1", "type": "Object", "tags": [], "label": "{ children }", @@ -493,7 +493,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.SectionSubtitle.$1.children.children", + "id": "def-public.SectionSubtitle.$1.children", "type": "CompoundType", "tags": [], "label": "children", @@ -525,7 +525,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.SectionTitle.$1.children", + "id": "def-public.SectionTitle.$1", "type": "Object", "tags": [], "label": "{ children }", @@ -535,7 +535,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.SectionTitle.$1.children.children", + "id": "def-public.SectionTitle.$1.children", "type": "CompoundType", "tags": [], "label": "children", @@ -646,7 +646,11 @@ "RecursivePartial", "<", "CrosshairStyle", - "> | undefined; markSizeRatio?: number | undefined; }" + "> | undefined; markSizeRatio?: number | undefined; goal?: ", + "RecursivePartial", + "<", + "GoalStyles", + "> | undefined; }" ], "path": "x-pack/plugins/observability/public/hooks/use_chart_theme.tsx", "deprecated": false, @@ -699,7 +703,7 @@ }, { "parentPluginId": "observability", - "id": "def-public.useFetcher.$3.options", + "id": "def-public.useFetcher.$3", "type": "Object", "tags": [], "label": "options", @@ -709,7 +713,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.useFetcher.$3.options.preservePreviousData", + "id": "def-public.useFetcher.$3.preservePreviousData", "type": "CompoundType", "tags": [], "label": "preservePreviousData", @@ -876,7 +880,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.useUiTracker.$1.appdefaultApp", + "id": "def-public.useUiTracker.$1", "type": "Object", "tags": [], "label": "{\n app: defaultApp,\n}", @@ -886,7 +890,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.useUiTracker.$1.appdefaultApp.app", + "id": "def-public.useUiTracker.$1.app", "type": "CompoundType", "tags": [], "label": "app", @@ -1135,7 +1139,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.fetchDataParams", + "id": "def-public.DataHandler.fetchData.$1", "type": "Object", "tags": [], "label": "fetchDataParams", @@ -1186,7 +1190,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.params", + "id": "def-public.DataHandler.hasData.$1", "type": "Object", "tags": [], "label": "params", @@ -2105,7 +2109,7 @@ "signature": [ "(options: { fields: OutputOf<", "Optional", - "<{ readonly \"kibana.alert.rule.rule_type_id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.consumer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.producer\": { readonly type: \"keyword\"; }; readonly \"kibana.space_ids\": { readonly type: \"keyword\"; readonly array: true; readonly required: true; }; readonly \"kibana.alert.uuid\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.id\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.start\": { readonly type: \"date\"; }; readonly \"kibana.alert.end\": { readonly type: \"date\"; }; readonly \"kibana.alert.duration.us\": { readonly type: \"long\"; }; readonly \"kibana.alert.severity\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.status\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.evaluation.threshold\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.alert.evaluation.value\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"ecs.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.risk_score\": { readonly type: \"float\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_user\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.system_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.action_group\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.author\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.category\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.uuid\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.description\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.enabled\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.from\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.interval\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.license\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.name\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.note\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.references\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.risk_score_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_id\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_name_override\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.to\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.type\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly tags: { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly '@timestamp': { readonly type: \"date\"; readonly array: false; readonly required: true; }; readonly 'event.kind': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'event.action': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; }, \"tags\" | \"event.kind\" | \"ecs.version\" | \"event.action\" | \"kibana.alert.action_group\" | \"kibana.alert.duration.us\" | \"kibana.alert.end\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.id\" | \"kibana.alert.rule.producer\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"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.risk_score\" | \"kibana.alert.rule.risk_score_mapping\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.severity\" | \"kibana.alert.rule.severity_mapping\" | \"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\" | \"kibana.alert.start\" | \"kibana.alert.severity\" | \"kibana.alert.status\" | \"kibana.alert.system_status\" | \"kibana.alert.uuid\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.alert.rule.uuid\" | \"kibana.alert.rule.category\" | \"kibana.version\">> & Record; formatters: { asDuration: (value: number | null | undefined, { defaultValue, extended }?: FormatterOptions) => string; asPercent: (numerator: number | null | undefined, denominator: number | undefined, fallbackResult?: string) => string; }; }) => { reason: string; link: string; }" + "<{ readonly \"kibana.alert.rule.rule_type_id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.consumer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.producer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.space_ids\": { readonly type: \"keyword\"; readonly array: true; readonly required: true; }; readonly \"kibana.alert.uuid\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.instance.id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.start\": { readonly type: \"date\"; }; readonly \"kibana.alert.end\": { readonly type: \"date\"; }; readonly \"kibana.alert.duration.us\": { readonly type: \"long\"; }; readonly \"kibana.alert.severity\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.status\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.evaluation.threshold\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.alert.evaluation.value\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.version\": { readonly type: \"version\"; readonly array: false; readonly required: false; }; readonly \"ecs.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.risk_score\": { readonly type: \"float\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_user\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.system_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.action_group\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.author\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.category\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.uuid\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.created_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.description\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.enabled\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.from\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.interval\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.license\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.name\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.note\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.references\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.risk_score_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_id\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_name_override\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.to\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.type\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly tags: { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly '@timestamp': { readonly type: \"date\"; readonly array: false; readonly required: true; }; readonly 'event.kind': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'event.action': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; }, \"tags\" | \"event.kind\" | \"ecs.version\" | \"event.action\" | \"kibana.alert.action_group\" | \"kibana.alert.duration.us\" | \"kibana.alert.end\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"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.note\" | \"kibana.alert.rule.references\" | \"kibana.alert.rule.risk_score\" | \"kibana.alert.rule.risk_score_mapping\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.severity\" | \"kibana.alert.rule.severity_mapping\" | \"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\" | \"kibana.alert.start\" | \"kibana.alert.severity\" | \"kibana.alert.system_status\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.version\">> & Record; formatters: { asDuration: (value: number | null | undefined, { defaultValue, extended }?: FormatterOptions) => string; asPercent: (numerator: number | null | undefined, denominator: number | undefined, fallbackResult?: string) => string; }; }) => { reason: string; link: string; }" ], "path": "x-pack/plugins/observability/public/rules/create_observability_rule_type_registry.ts", "deprecated": false, @@ -2113,7 +2117,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.options", + "id": "def-public.ObservabilityRuleTypeModel.format.$1", "type": "Object", "tags": [], "label": "options", @@ -2121,7 +2125,7 @@ "signature": [ "{ fields: OutputOf<", "Optional", - "<{ readonly \"kibana.alert.rule.rule_type_id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.consumer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.producer\": { readonly type: \"keyword\"; }; readonly \"kibana.space_ids\": { readonly type: \"keyword\"; readonly array: true; readonly required: true; }; readonly \"kibana.alert.uuid\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.id\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.start\": { readonly type: \"date\"; }; readonly \"kibana.alert.end\": { readonly type: \"date\"; }; readonly \"kibana.alert.duration.us\": { readonly type: \"long\"; }; readonly \"kibana.alert.severity\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.status\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.evaluation.threshold\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.alert.evaluation.value\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"ecs.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.risk_score\": { readonly type: \"float\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_user\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.system_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.action_group\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.author\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.category\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.uuid\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.description\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.enabled\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.from\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.interval\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.license\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.name\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.note\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.references\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.risk_score_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_id\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_name_override\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.to\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.type\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly tags: { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly '@timestamp': { readonly type: \"date\"; readonly array: false; readonly required: true; }; readonly 'event.kind': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'event.action': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; }, \"tags\" | \"event.kind\" | \"ecs.version\" | \"event.action\" | \"kibana.alert.action_group\" | \"kibana.alert.duration.us\" | \"kibana.alert.end\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.id\" | \"kibana.alert.rule.producer\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"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.risk_score\" | \"kibana.alert.rule.risk_score_mapping\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.severity\" | \"kibana.alert.rule.severity_mapping\" | \"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\" | \"kibana.alert.start\" | \"kibana.alert.severity\" | \"kibana.alert.status\" | \"kibana.alert.system_status\" | \"kibana.alert.uuid\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.alert.rule.uuid\" | \"kibana.alert.rule.category\" | \"kibana.version\">> & Record; formatters: { asDuration: (value: number | null | undefined, { defaultValue, extended }?: FormatterOptions) => string; asPercent: (numerator: number | null | undefined, denominator: number | undefined, fallbackResult?: string) => string; }; }" + "<{ readonly \"kibana.alert.rule.rule_type_id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.consumer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.producer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.space_ids\": { readonly type: \"keyword\"; readonly array: true; readonly required: true; }; readonly \"kibana.alert.uuid\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.instance.id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.start\": { readonly type: \"date\"; }; readonly \"kibana.alert.end\": { readonly type: \"date\"; }; readonly \"kibana.alert.duration.us\": { readonly type: \"long\"; }; readonly \"kibana.alert.severity\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.status\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.evaluation.threshold\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.alert.evaluation.value\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.version\": { readonly type: \"version\"; readonly array: false; readonly required: false; }; readonly \"ecs.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.risk_score\": { readonly type: \"float\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_user\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.system_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.action_group\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.author\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.category\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.uuid\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.created_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.description\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.enabled\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.from\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.interval\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.license\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.name\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.note\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.references\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.risk_score_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_id\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_name_override\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.to\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.type\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly tags: { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly '@timestamp': { readonly type: \"date\"; readonly array: false; readonly required: true; }; readonly 'event.kind': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'event.action': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; }, \"tags\" | \"event.kind\" | \"ecs.version\" | \"event.action\" | \"kibana.alert.action_group\" | \"kibana.alert.duration.us\" | \"kibana.alert.end\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"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.note\" | \"kibana.alert.rule.references\" | \"kibana.alert.rule.risk_score\" | \"kibana.alert.rule.risk_score_mapping\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.severity\" | \"kibana.alert.rule.severity_mapping\" | \"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\" | \"kibana.alert.start\" | \"kibana.alert.severity\" | \"kibana.alert.system_status\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.version\">> & Record; formatters: { asDuration: (value: number | null | undefined, { defaultValue, extended }?: FormatterOptions) => string; asPercent: (numerator: number | null | undefined, denominator: number | undefined, fallbackResult?: string) => string; }; }" ], "path": "x-pack/plugins/observability/public/rules/create_observability_rule_type_registry.ts", "deprecated": false @@ -2248,7 +2252,7 @@ "label": "operationType", "description": [], "signature": [ - "\"range\" | \"filters\" | \"count\" | \"max\" | \"min\" | \"date_histogram\" | \"sum\" | \"average\" | \"percentile\" | \"terms\" | \"median\" | \"cumulative_sum\" | \"moving_average\" | \"math\" | \"overall_sum\" | \"overall_min\" | \"overall_max\" | \"overall_average\" | \"counter_rate\" | \"differences\" | \"unique_count\" | \"last_value\" | \"formula\" | undefined" + "\"range\" | \"filters\" | \"max\" | \"min\" | \"count\" | \"date_histogram\" | \"sum\" | \"average\" | \"percentile\" | \"terms\" | \"median\" | \"cumulative_sum\" | \"moving_average\" | \"math\" | \"overall_sum\" | \"overall_min\" | \"overall_max\" | \"overall_average\" | \"counter_rate\" | \"differences\" | \"unique_count\" | \"last_value\" | \"formula\" | undefined" ], "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/types.ts", "deprecated": false @@ -2819,7 +2823,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.fetchDataParams", + "id": "def-public.FetchData.$1", "type": "Object", "tags": [], "label": "fetchDataParams", @@ -2871,7 +2875,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.params", + "id": "def-public.HasData.$1", "type": "Object", "tags": [], "label": "params", @@ -2952,7 +2956,7 @@ "signature": [ "(options: { fields: OutputOf<", "Optional", - "<{ readonly \"kibana.alert.rule.rule_type_id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.consumer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.producer\": { readonly type: \"keyword\"; }; readonly \"kibana.space_ids\": { readonly type: \"keyword\"; readonly array: true; readonly required: true; }; readonly \"kibana.alert.uuid\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.id\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.start\": { readonly type: \"date\"; }; readonly \"kibana.alert.end\": { readonly type: \"date\"; }; readonly \"kibana.alert.duration.us\": { readonly type: \"long\"; }; readonly \"kibana.alert.severity\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.status\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.evaluation.threshold\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.alert.evaluation.value\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"ecs.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.risk_score\": { readonly type: \"float\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_user\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.system_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.action_group\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.author\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.category\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.uuid\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.description\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.enabled\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.from\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.interval\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.license\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.name\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.note\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.references\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.risk_score_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_id\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_name_override\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.to\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.type\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly tags: { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly '@timestamp': { readonly type: \"date\"; readonly array: false; readonly required: true; }; readonly 'event.kind': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'event.action': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; }, \"tags\" | \"event.kind\" | \"ecs.version\" | \"event.action\" | \"kibana.alert.action_group\" | \"kibana.alert.duration.us\" | \"kibana.alert.end\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.id\" | \"kibana.alert.rule.producer\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"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.risk_score\" | \"kibana.alert.rule.risk_score_mapping\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.severity\" | \"kibana.alert.rule.severity_mapping\" | \"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\" | \"kibana.alert.start\" | \"kibana.alert.severity\" | \"kibana.alert.status\" | \"kibana.alert.system_status\" | \"kibana.alert.uuid\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.alert.rule.uuid\" | \"kibana.alert.rule.category\" | \"kibana.version\">> & Record; formatters: { asDuration: (value: number | null | undefined, { defaultValue, extended }?: FormatterOptions) => string; asPercent: (numerator: number | null | undefined, denominator: number | undefined, fallbackResult?: string) => string; }; }) => { reason: string; link: string; }" + "<{ readonly \"kibana.alert.rule.rule_type_id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.consumer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.producer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.space_ids\": { readonly type: \"keyword\"; readonly array: true; readonly required: true; }; readonly \"kibana.alert.uuid\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.instance.id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.start\": { readonly type: \"date\"; }; readonly \"kibana.alert.end\": { readonly type: \"date\"; }; readonly \"kibana.alert.duration.us\": { readonly type: \"long\"; }; readonly \"kibana.alert.severity\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.status\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.evaluation.threshold\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.alert.evaluation.value\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.version\": { readonly type: \"version\"; readonly array: false; readonly required: false; }; readonly \"ecs.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.risk_score\": { readonly type: \"float\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_user\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.system_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.action_group\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.author\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.category\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.uuid\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.created_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.description\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.enabled\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.from\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.interval\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.license\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.name\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.note\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.references\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.risk_score_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_id\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_name_override\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.to\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.type\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly tags: { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly '@timestamp': { readonly type: \"date\"; readonly array: false; readonly required: true; }; readonly 'event.kind': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'event.action': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; }, \"tags\" | \"event.kind\" | \"ecs.version\" | \"event.action\" | \"kibana.alert.action_group\" | \"kibana.alert.duration.us\" | \"kibana.alert.end\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"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.note\" | \"kibana.alert.rule.references\" | \"kibana.alert.rule.risk_score\" | \"kibana.alert.rule.risk_score_mapping\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.severity\" | \"kibana.alert.rule.severity_mapping\" | \"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\" | \"kibana.alert.start\" | \"kibana.alert.severity\" | \"kibana.alert.system_status\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.version\">> & Record; formatters: { asDuration: (value: number | null | undefined, { defaultValue, extended }?: FormatterOptions) => string; asPercent: (numerator: number | null | undefined, denominator: number | undefined, fallbackResult?: string) => string; }; }) => { reason: string; link: string; }" ], "path": "x-pack/plugins/observability/public/rules/create_observability_rule_type_registry.ts", "deprecated": false, @@ -2960,7 +2964,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.options", + "id": "def-public.ObservabilityRuleTypeFormatter.$1", "type": "Object", "tags": [], "label": "options", @@ -2968,7 +2972,7 @@ "signature": [ "{ fields: OutputOf<", "Optional", - "<{ readonly \"kibana.alert.rule.rule_type_id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.consumer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.producer\": { readonly type: \"keyword\"; }; readonly \"kibana.space_ids\": { readonly type: \"keyword\"; readonly array: true; readonly required: true; }; readonly \"kibana.alert.uuid\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.id\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.start\": { readonly type: \"date\"; }; readonly \"kibana.alert.end\": { readonly type: \"date\"; }; readonly \"kibana.alert.duration.us\": { readonly type: \"long\"; }; readonly \"kibana.alert.severity\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.status\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.evaluation.threshold\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.alert.evaluation.value\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"ecs.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.risk_score\": { readonly type: \"float\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_user\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.system_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.action_group\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.author\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.category\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.uuid\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.description\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.enabled\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.from\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.interval\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.license\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.name\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.note\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.references\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.risk_score_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_id\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_name_override\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.to\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.type\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly tags: { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly '@timestamp': { readonly type: \"date\"; readonly array: false; readonly required: true; }; readonly 'event.kind': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'event.action': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; }, \"tags\" | \"event.kind\" | \"ecs.version\" | \"event.action\" | \"kibana.alert.action_group\" | \"kibana.alert.duration.us\" | \"kibana.alert.end\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.id\" | \"kibana.alert.rule.producer\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"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.risk_score\" | \"kibana.alert.rule.risk_score_mapping\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.severity\" | \"kibana.alert.rule.severity_mapping\" | \"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\" | \"kibana.alert.start\" | \"kibana.alert.severity\" | \"kibana.alert.status\" | \"kibana.alert.system_status\" | \"kibana.alert.uuid\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.alert.rule.uuid\" | \"kibana.alert.rule.category\" | \"kibana.version\">> & Record; formatters: { asDuration: (value: number | null | undefined, { defaultValue, extended }?: FormatterOptions) => string; asPercent: (numerator: number | null | undefined, denominator: number | undefined, fallbackResult?: string) => string; }; }" + "<{ readonly \"kibana.alert.rule.rule_type_id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.consumer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.producer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.space_ids\": { readonly type: \"keyword\"; readonly array: true; readonly required: true; }; readonly \"kibana.alert.uuid\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.instance.id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.start\": { readonly type: \"date\"; }; readonly \"kibana.alert.end\": { readonly type: \"date\"; }; readonly \"kibana.alert.duration.us\": { readonly type: \"long\"; }; readonly \"kibana.alert.severity\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.status\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.evaluation.threshold\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.alert.evaluation.value\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.version\": { readonly type: \"version\"; readonly array: false; readonly required: false; }; readonly \"ecs.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.risk_score\": { readonly type: \"float\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_user\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.system_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.action_group\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.author\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.category\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.uuid\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.created_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.description\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.enabled\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.from\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.interval\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.license\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.name\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.note\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.references\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.risk_score_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_id\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_name_override\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.to\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.type\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly tags: { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly '@timestamp': { readonly type: \"date\"; readonly array: false; readonly required: true; }; readonly 'event.kind': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'event.action': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; }, \"tags\" | \"event.kind\" | \"ecs.version\" | \"event.action\" | \"kibana.alert.action_group\" | \"kibana.alert.duration.us\" | \"kibana.alert.end\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"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.note\" | \"kibana.alert.rule.references\" | \"kibana.alert.rule.risk_score\" | \"kibana.alert.rule.risk_score_mapping\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.severity\" | \"kibana.alert.rule.severity_mapping\" | \"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\" | \"kibana.alert.start\" | \"kibana.alert.severity\" | \"kibana.alert.system_status\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.version\">> & Record; formatters: { asDuration: (value: number | null | undefined, { defaultValue, extended }?: FormatterOptions) => string; asPercent: (numerator: number | null | undefined, denominator: number | undefined, fallbackResult?: string) => string; }; }" ], "path": "x-pack/plugins/observability/public/rules/create_observability_rule_type_registry.ts", "deprecated": false @@ -3099,7 +3103,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-public.__0", + "id": "def-public.UiTracker.$1", "type": "CompoundType", "tags": [], "label": "__0", @@ -3285,7 +3289,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-server.createOrUpdateIndex.$1.indexmappingsclientlogger", + "id": "def-server.createOrUpdateIndex.$1", "type": "Object", "tags": [], "label": "{\n index,\n mappings,\n client,\n logger,\n}", @@ -3295,7 +3299,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-server.createOrUpdateIndex.$1.indexmappingsclientlogger.index", + "id": "def-server.createOrUpdateIndex.$1.index", "type": "string", "tags": [], "label": "index", @@ -3305,7 +3309,7 @@ }, { "parentPluginId": "observability", - "id": "def-server.createOrUpdateIndex.$1.indexmappingsclientlogger.mappings", + "id": "def-server.createOrUpdateIndex.$1.mappings", "type": "CompoundType", "tags": [], "label": "mappings", @@ -3362,7 +3366,7 @@ }, { "parentPluginId": "observability", - "id": "def-server.createOrUpdateIndex.$1.indexmappingsclientlogger.client", + "id": "def-server.createOrUpdateIndex.$1.client", "type": "CompoundType", "tags": [], "label": "client", @@ -3370,7 +3374,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"count\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"count\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", @@ -3385,7 +3389,7 @@ }, { "parentPluginId": "observability", - "id": "def-server.createOrUpdateIndex.$1.indexmappingsclientlogger.logger", + "id": "def-server.createOrUpdateIndex.$1.logger", "type": "Object", "tags": [], "label": "logger", @@ -3983,7 +3987,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-common.value", + "id": "def-common.AsDuration.$1", "type": "CompoundType", "tags": [], "label": "value", @@ -3996,7 +4000,7 @@ }, { "parentPluginId": "observability", - "id": "def-common.__1", + "id": "def-common.AsDuration.$2", "type": "Object", "tags": [], "label": "__1", @@ -4026,7 +4030,7 @@ "children": [ { "parentPluginId": "observability", - "id": "def-common.numerator", + "id": "def-common.AsPercent.$1", "type": "CompoundType", "tags": [], "label": "numerator", @@ -4039,7 +4043,7 @@ }, { "parentPluginId": "observability", - "id": "def-common.denominator", + "id": "def-common.AsPercent.$2", "type": "number", "tags": [], "label": "denominator", @@ -4052,7 +4056,7 @@ }, { "parentPluginId": "observability", - "id": "def-common.fallbackResult", + "id": "def-common.AsPercent.$3", "type": "string", "tags": [], "label": "fallbackResult", diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index c84f754dde13c..42ff4ab43abb9 100644 --- a/api_docs/observability.mdx +++ b/api_docs/observability.mdx @@ -12,7 +12,7 @@ import observabilityObj from './observability.json'; -Contact Observability UI for questions regarding this plugin. +Contact [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/presentation_util.json b/api_docs/presentation_util.json index 259f668787e0f..883091547c5ef 100644 --- a/api_docs/presentation_util.json +++ b/api_docs/presentation_util.json @@ -794,7 +794,7 @@ "children": [ { "parentPluginId": "presentationUtil", - "id": "def-public.props", + "id": "def-public.LazyDashboardPicker.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -828,7 +828,7 @@ "children": [ { "parentPluginId": "presentationUtil", - "id": "def-public.props", + "id": "def-public.LazyLabsBeakerButton.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -862,7 +862,7 @@ "children": [ { "parentPluginId": "presentationUtil", - "id": "def-public.props", + "id": "def-public.LazyLabsFlyout.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -908,7 +908,7 @@ "children": [ { "parentPluginId": "presentationUtil", - "id": "def-public.props", + "id": "def-public.LazySavedObjectSaveModalDashboard.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -2051,7 +2051,7 @@ "children": [ { "parentPluginId": "presentationUtil", - "id": "def-public.params", + "id": "def-public.KibanaPluginServiceFactory.$1", "type": "Object", "tags": [], "label": "params", @@ -2090,7 +2090,7 @@ "children": [ { "parentPluginId": "presentationUtil", - "id": "def-public.params", + "id": "def-public.PluginServiceFactory.$1", "type": "Uncategorized", "tags": [], "label": "params", @@ -2352,7 +2352,7 @@ "children": [ { "parentPluginId": "presentationUtil", - "id": "def-public.props", + "id": "def-public.PresentationUtilPluginStart.ContextProvider.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -2365,7 +2365,7 @@ }, { "parentPluginId": "presentationUtil", - "id": "def-public.context", + "id": "def-public.PresentationUtilPluginStart.ContextProvider.$2", "type": "Any", "tags": [], "label": "context", diff --git a/api_docs/reporting.json b/api_docs/reporting.json index 782a3d4e7e16d..b83afff729cea 100644 --- a/api_docs/reporting.json +++ b/api_docs/reporting.json @@ -345,9 +345,7 @@ "label": "getReportingJobPath", "description": [], "signature": [ - "(exportType: string, jobParams: ", - "BaseParams", - ") => string" + "(exportType: string, jobParams: { layout?: { id: string; dimensions?: { width: number; height: number; } | undefined; } | undefined; objectType: string; title: string; browserTimezone: string; version: string; }) => string" ], "path": "x-pack/plugins/reporting/public/lib/reporting_api_client/reporting_api_client.ts", "deprecated": false, @@ -374,7 +372,7 @@ "label": "jobParams", "description": [], "signature": [ - "BaseParams" + "{ layout?: { id: string; dimensions?: { width: number; height: number; } | undefined; } | undefined; objectType: string; title: string; browserTimezone: string; version: string; }" ], "path": "x-pack/plugins/reporting/public/lib/reporting_api_client/reporting_api_client.ts", "deprecated": false, @@ -391,9 +389,7 @@ "label": "createReportingJob", "description": [], "signature": [ - "(exportType: string, jobParams: ", - "BaseParams", - ") => Promise<", + "(exportType: string, jobParams: { layout?: { id: string; dimensions?: { width: number; height: number; } | undefined; } | undefined; objectType: string; title: string; browserTimezone: string; version: string; }) => Promise<", "Job", ">" ], @@ -422,7 +418,7 @@ "label": "jobParams", "description": [], "signature": [ - "BaseParams" + "{ layout?: { id: string; dimensions?: { width: number; height: number; } | undefined; } | undefined; objectType: string; title: string; browserTimezone: string; version: string; }" ], "path": "x-pack/plugins/reporting/public/lib/reporting_api_client/reporting_api_client.ts", "deprecated": false, @@ -439,9 +435,7 @@ "label": "createImmediateReport", "description": [], "signature": [ - "(baseParams: ", - "BaseParams", - ") => Promise" + "(baseParams: { layout?: { id: string; dimensions?: { width: number; height: number; } | undefined; } | undefined; objectType: string; title: string; browserTimezone: string; version: string; }) => Promise" ], "path": "x-pack/plugins/reporting/public/lib/reporting_api_client/reporting_api_client.ts", "deprecated": false, @@ -454,7 +448,7 @@ "label": "baseParams", "description": [], "signature": [ - "BaseParams" + "{ layout?: { id: string; dimensions?: { width: number; height: number; } | undefined; } | undefined; objectType: string; title: string; browserTimezone: string; version: string; }" ], "path": "x-pack/plugins/reporting/public/lib/reporting_api_client/reporting_api_client.ts", "deprecated": false, @@ -471,10 +465,7 @@ "label": "getDecoratedJobParams", "description": [], "signature": [ - ">(baseParams: T) => ", - "BaseParams" + ">(baseParams: T) => { layout?: { id: string; dimensions?: { width: number; height: number; } | undefined; } | undefined; objectType: string; title: string; browserTimezone: string; version: string; }" ], "path": "x-pack/plugins/reporting/public/lib/reporting_api_client/reporting_api_client.ts", "deprecated": false, diff --git a/api_docs/reporting.mdx b/api_docs/reporting.mdx index ffbf1fdd52380..c0d061ff5ec8d 100644 --- a/api_docs/reporting.mdx +++ b/api_docs/reporting.mdx @@ -18,7 +18,7 @@ Contact [Kibana Reporting Services](https://github.com/orgs/elastic/teams/kibana | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 135 | 0 | 134 | 13 | +| 135 | 0 | 134 | 12 | ## Client diff --git a/api_docs/rule_registry.json b/api_docs/rule_registry.json index 32b747a2ee644..8a33ca2ce242b 100644 --- a/api_docs/rule_registry.json +++ b/api_docs/rule_registry.json @@ -40,7 +40,7 @@ "id": "def-server.AlertsClient.Unnamed.$1", "type": "Object", "tags": [], - "label": "{ auditLogger, authorization, logger, esClient }", + "label": "options", "description": [], "signature": [ "ConstructorOptions" @@ -62,7 +62,7 @@ "signature": [ "({ id, index }: GetAlertParams) => Promise> | undefined>" + "<{ readonly \"kibana.alert.rule.rule_type_id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.consumer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.producer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.space_ids\": { readonly type: \"keyword\"; readonly array: true; readonly required: true; }; readonly \"kibana.alert.uuid\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.instance.id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.start\": { readonly type: \"date\"; }; readonly \"kibana.alert.end\": { readonly type: \"date\"; }; readonly \"kibana.alert.duration.us\": { readonly type: \"long\"; }; readonly \"kibana.alert.severity\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.status\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.evaluation.threshold\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.alert.evaluation.value\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.version\": { readonly type: \"version\"; readonly array: false; readonly required: false; }; readonly \"ecs.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.risk_score\": { readonly type: \"float\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_user\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.system_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.action_group\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.author\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.category\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.uuid\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.created_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.description\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.enabled\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.from\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.interval\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.license\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.name\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.note\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.references\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.risk_score_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_id\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_name_override\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.to\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.type\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly tags: { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly '@timestamp': { readonly type: \"date\"; readonly array: false; readonly required: true; }; readonly 'event.kind': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'event.action': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; }, \"tags\" | \"event.kind\" | \"ecs.version\" | \"event.action\" | \"kibana.alert.action_group\" | \"kibana.alert.duration.us\" | \"kibana.alert.end\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"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.note\" | \"kibana.alert.rule.references\" | \"kibana.alert.rule.risk_score\" | \"kibana.alert.rule.risk_score_mapping\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.severity\" | \"kibana.alert.rule.severity_mapping\" | \"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\" | \"kibana.alert.start\" | \"kibana.alert.severity\" | \"kibana.alert.system_status\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.version\">> | undefined>" ], "path": "x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts", "deprecated": false, @@ -98,7 +98,7 @@ "InlineGet", ">> | undefined; _id: string; _index: string; _primary_term: number; result: ", + "<{ readonly \"kibana.alert.rule.rule_type_id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.consumer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.producer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.space_ids\": { readonly type: \"keyword\"; readonly array: true; readonly required: true; }; readonly \"kibana.alert.uuid\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.instance.id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.start\": { readonly type: \"date\"; }; readonly \"kibana.alert.end\": { readonly type: \"date\"; }; readonly \"kibana.alert.duration.us\": { readonly type: \"long\"; }; readonly \"kibana.alert.severity\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.status\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.evaluation.threshold\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.alert.evaluation.value\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.version\": { readonly type: \"version\"; readonly array: false; readonly required: false; }; readonly \"ecs.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.risk_score\": { readonly type: \"float\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_user\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.system_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.action_group\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.author\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.category\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.uuid\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.created_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.description\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.enabled\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.from\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.interval\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.license\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.name\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.note\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.references\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.risk_score_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_id\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_name_override\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.to\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.type\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly tags: { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly '@timestamp': { readonly type: \"date\"; readonly array: false; readonly required: true; }; readonly 'event.kind': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'event.action': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; }, \"tags\" | \"event.kind\" | \"ecs.version\" | \"event.action\" | \"kibana.alert.action_group\" | \"kibana.alert.duration.us\" | \"kibana.alert.end\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"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.note\" | \"kibana.alert.rule.references\" | \"kibana.alert.rule.risk_score\" | \"kibana.alert.rule.risk_score_mapping\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.severity\" | \"kibana.alert.rule.severity_mapping\" | \"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\" | \"kibana.alert.start\" | \"kibana.alert.severity\" | \"kibana.alert.system_status\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.version\">>> | undefined; _id: string; _index: string; _primary_term: number; result: ", "Result", "; _seq_no: number; _shards: ", "ShardStatistics", @@ -178,14 +178,14 @@ "SearchResponse", ">>>" + "<{ readonly \"kibana.alert.rule.rule_type_id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.consumer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.producer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.space_ids\": { readonly type: \"keyword\"; readonly array: true; readonly required: true; }; readonly \"kibana.alert.uuid\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.instance.id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.start\": { readonly type: \"date\"; }; readonly \"kibana.alert.end\": { readonly type: \"date\"; }; readonly \"kibana.alert.duration.us\": { readonly type: \"long\"; }; readonly \"kibana.alert.severity\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.status\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.evaluation.threshold\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.alert.evaluation.value\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.version\": { readonly type: \"version\"; readonly array: false; readonly required: false; }; readonly \"ecs.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.risk_score\": { readonly type: \"float\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_user\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.system_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.action_group\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.author\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.category\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.uuid\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.created_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.description\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.enabled\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.from\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.interval\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.license\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.name\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.note\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.references\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.risk_score_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_id\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_name_override\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.to\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.type\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly tags: { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly '@timestamp': { readonly type: \"date\"; readonly array: false; readonly required: true; }; readonly 'event.kind': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'event.action': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; }, \"tags\" | \"event.kind\" | \"ecs.version\" | \"event.action\" | \"kibana.alert.action_group\" | \"kibana.alert.duration.us\" | \"kibana.alert.end\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"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.note\" | \"kibana.alert.rule.references\" | \"kibana.alert.rule.risk_score\" | \"kibana.alert.rule.risk_score_mapping\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.severity\" | \"kibana.alert.rule.severity_mapping\" | \"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\" | \"kibana.alert.start\" | \"kibana.alert.severity\" | \"kibana.alert.system_status\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.version\">>>>" ], "path": "x-pack/plugins/rule_registry/server/alert_data_client/alerts_client.ts", "deprecated": false, "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.AlertsClient.find.$1.queryaggs_sourcetrack_total_hitstrackTotalHitssizeindex", + "id": "def-server.AlertsClient.find.$1", "type": "Object", "tags": [], "label": "{\n query,\n aggs,\n _source,\n track_total_hits: trackTotalHits,\n size,\n index,\n }", @@ -195,7 +195,7 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.AlertsClient.find.$1.queryaggs_sourcetrack_total_hitstrackTotalHitssizeindex.query", + "id": "def-server.AlertsClient.find.$1.query", "type": "Uncategorized", "tags": [], "label": "query", @@ -208,7 +208,7 @@ }, { "parentPluginId": "ruleRegistry", - "id": "def-server.AlertsClient.find.$1.queryaggs_sourcetrack_total_hitstrackTotalHitssizeindex.aggs", + "id": "def-server.AlertsClient.find.$1.aggs", "type": "Uncategorized", "tags": [], "label": "aggs", @@ -221,7 +221,7 @@ }, { "parentPluginId": "ruleRegistry", - "id": "def-server.AlertsClient.find.$1.queryaggs_sourcetrack_total_hitstrackTotalHitssizeindex.index", + "id": "def-server.AlertsClient.find.$1.index", "type": "string", "tags": [], "label": "index", @@ -234,7 +234,7 @@ }, { "parentPluginId": "ruleRegistry", - "id": "def-server.AlertsClient.find.$1.queryaggs_sourcetrack_total_hitstrackTotalHitssizeindex.track_total_hits", + "id": "def-server.AlertsClient.find.$1.track_total_hits", "type": "CompoundType", "tags": [], "label": "track_total_hits", @@ -247,7 +247,7 @@ }, { "parentPluginId": "ruleRegistry", - "id": "def-server.AlertsClient.find.$1.queryaggs_sourcetrack_total_hitstrackTotalHitssizeindex._source", + "id": "def-server.AlertsClient.find.$1._source", "type": "Array", "tags": [], "label": "_source", @@ -260,7 +260,7 @@ }, { "parentPluginId": "ruleRegistry", - "id": "def-server.AlertsClient.find.$1.queryaggs_sourcetrack_total_hitstrackTotalHitssizeindex.size", + "id": "def-server.AlertsClient.find.$1.size", "type": "number", "tags": [], "label": "size", @@ -376,6 +376,16 @@ "path": "x-pack/plugins/rule_registry/server/rule_data_client/rule_data_client.ts", "deprecated": false }, + { + "parentPluginId": "ruleRegistry", + "id": "def-server.RuleDataClient.kibanaVersion", + "type": "string", + "tags": [], + "label": "kibanaVersion", + "description": [], + "path": "x-pack/plugins/rule_registry/server/rule_data_client/rule_data_client.ts", + "deprecated": false + }, { "parentPluginId": "ruleRegistry", "id": "def-server.RuleDataClient.isWriteEnabled", @@ -413,7 +423,7 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.RuleDataClient.getReader.$1.options", + "id": "def-server.RuleDataClient.getReader.$1", "type": "Object", "tags": [], "label": "options", @@ -423,7 +433,7 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.RuleDataClient.getReader.$1.options.namespace", + "id": "def-server.RuleDataClient.getReader.$1.namespace", "type": "string", "tags": [], "label": "namespace", @@ -461,7 +471,7 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.RuleDataClient.getWriter.$1.options", + "id": "def-server.RuleDataClient.getWriter.$1", "type": "Object", "tags": [], "label": "options", @@ -471,7 +481,7 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.RuleDataClient.getWriter.$1.options.namespace", + "id": "def-server.RuleDataClient.getWriter.$1.namespace", "type": "string", "tags": [], "label": "namespace", @@ -539,7 +549,7 @@ "tags": [], "label": "getResourcePrefix", "description": [ - "\nReturns a full resource prefix.\n - it's '.alerts' by default\n - it can be adjusted by the user via Kibana config" + "\nReturns a prefix used in the naming scheme of index aliases, templates\nand other Elasticsearch resources that this service creates\nfor alerts-as-data indices." ], "signature": [ "() => string" @@ -556,7 +566,7 @@ "tags": [], "label": "getResourceName", "description": [ - "\nPrepends a relative resource name with a full resource prefix, which\nstarts with '.alerts' and can optionally include a user-defined part in it." + "\nPrepends a relative resource name with the resource prefix." ], "signature": [ "(relativeName: string) => string" @@ -676,24 +686,32 @@ }, { "parentPluginId": "ruleRegistry", - "id": "def-server.RuleDataPluginService.getRegisteredIndexInfo", + "id": "def-server.RuleDataPluginService.findIndexByName", "type": "Function", "tags": [], - "label": "getRegisteredIndexInfo", + "label": "findIndexByName", "description": [ - "\nLooks up the index information associated with the given `registrationContext`." + "\nLooks up the index information associated with the given registration context and dataset." ], "signature": [ - "(registrationContext: string) => ", + "(registrationContext: string, dataset: ", + { + "pluginId": "ruleRegistry", + "scope": "server", + "docId": "kibRuleRegistryPluginApi", + "section": "def-server.Dataset", + "text": "Dataset" + }, + ") => ", "IndexInfo", - " | undefined" + " | null" ], "path": "x-pack/plugins/rule_registry/server/rule_data_plugin_service/rule_data_plugin_service.ts", "deprecated": false, "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.RuleDataPluginService.getRegisteredIndexInfo.$1", + "id": "def-server.RuleDataPluginService.findIndexByName.$1", "type": "string", "tags": [], "label": "registrationContext", @@ -704,11 +722,94 @@ "path": "x-pack/plugins/rule_registry/server/rule_data_plugin_service/rule_data_plugin_service.ts", "deprecated": false, "isRequired": true + }, + { + "parentPluginId": "ruleRegistry", + "id": "def-server.RuleDataPluginService.findIndexByName.$2", + "type": "Enum", + "tags": [], + "label": "dataset", + "description": [], + "signature": [ + { + "pluginId": "ruleRegistry", + "scope": "server", + "docId": "kibRuleRegistryPluginApi", + "section": "def-server.Dataset", + "text": "Dataset" + } + ], + "path": "x-pack/plugins/rule_registry/server/rule_data_plugin_service/rule_data_plugin_service.ts", + "deprecated": false, + "isRequired": true } ], - "returnComment": [ - "the IndexInfo or undefined" - ] + "returnComment": [] + }, + { + "parentPluginId": "ruleRegistry", + "id": "def-server.RuleDataPluginService.findIndicesByFeature", + "type": "Function", + "tags": [], + "label": "findIndicesByFeature", + "description": [ + "\nLooks up the index information associated with the given Kibana \"feature\".\nNote: features are used in RBAC." + ], + "signature": [ + "(featureId: ", + "AlertConsumers", + ", dataset?: ", + { + "pluginId": "ruleRegistry", + "scope": "server", + "docId": "kibRuleRegistryPluginApi", + "section": "def-server.Dataset", + "text": "Dataset" + }, + " | undefined) => ", + "IndexInfo", + "[]" + ], + "path": "x-pack/plugins/rule_registry/server/rule_data_plugin_service/rule_data_plugin_service.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "ruleRegistry", + "id": "def-server.RuleDataPluginService.findIndicesByFeature.$1", + "type": "CompoundType", + "tags": [], + "label": "featureId", + "description": [], + "signature": [ + "AlertConsumers" + ], + "path": "x-pack/plugins/rule_registry/server/rule_data_plugin_service/rule_data_plugin_service.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "ruleRegistry", + "id": "def-server.RuleDataPluginService.findIndicesByFeature.$2", + "type": "CompoundType", + "tags": [], + "label": "dataset", + "description": [], + "signature": [ + { + "pluginId": "ruleRegistry", + "scope": "server", + "docId": "kibRuleRegistryPluginApi", + "section": "def-server.Dataset", + "text": "Dataset" + }, + " | undefined" + ], + "path": "x-pack/plugins/rule_registry/server/rule_data_plugin_service/rule_data_plugin_service.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] } ], "initialIsOpen": false @@ -786,7 +887,7 @@ "section": "def-server.IRuleDataClient", "text": "IRuleDataClient" }, - ", \"indexName\" | \"isWriteEnabled\" | \"getReader\" | \"getWriter\">) => = never, State extends Record = never, InstanceState extends { [x: string]: unknown; } = never, InstanceContext extends { [x: string]: unknown; } = never, ActionGroupIds extends string = never>(wrappedExecutor: ", + ", \"indexName\" | \"kibanaVersion\" | \"isWriteEnabled\" | \"getReader\" | \"getWriter\">) => = never, State extends Record = never, InstanceState extends { [x: string]: unknown; } = never, InstanceContext extends { [x: string]: unknown; } = never, ActionGroupIds extends string = never>(wrappedExecutor: ", { "pluginId": "ruleRegistry", "scope": "server", @@ -841,7 +942,7 @@ "section": "def-server.IRuleDataClient", "text": "IRuleDataClient" }, - ", \"indexName\" | \"isWriteEnabled\" | \"getReader\" | \"getWriter\">" + ", \"indexName\" | \"kibanaVersion\" | \"isWriteEnabled\" | \"getReader\" | \"getWriter\">" ], "path": "x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.ts", "deprecated": false, @@ -900,7 +1001,7 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.createLifecycleRuleTypeFactory.$1.loggerruleDataClient", + "id": "def-server.createLifecycleRuleTypeFactory.$1", "type": "Object", "tags": [], "label": "{\n logger,\n ruleDataClient,\n}", @@ -910,7 +1011,7 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.createLifecycleRuleTypeFactory.$1.loggerruleDataClient.logger", + "id": "def-server.createLifecycleRuleTypeFactory.$1.logger", "type": "Object", "tags": [], "label": "logger", @@ -923,7 +1024,7 @@ }, { "parentPluginId": "ruleRegistry", - "id": "def-server.createLifecycleRuleTypeFactory.$1.loggerruleDataClient.ruleDataClient", + "id": "def-server.createLifecycleRuleTypeFactory.$1.ruleDataClient", "type": "Object", "tags": [], "label": "ruleDataClient", @@ -1072,52 +1173,6 @@ ], "returnComment": [], "initialIsOpen": false - }, - { - "parentPluginId": "ruleRegistry", - "id": "def-server.getRuleData", - "type": "Function", - "tags": [], - "label": "getRuleData", - "description": [], - "signature": [ - "(options: ", - { - "pluginId": "alerting", - "scope": "server", - "docId": "kibAlertingPluginApi", - "section": "def-server.AlertExecutorOptions", - "text": "AlertExecutorOptions" - }, - ") => { \"kibana.alert.rule.rule_type_id\": string; \"kibana.alert.rule.uuid\": string; \"kibana.alert.rule.category\": string; \"kibana.alert.rule.name\": string; tags: string[]; \"kibana.alert.rule.producer\": string; }" - ], - "path": "x-pack/plugins/rule_registry/server/utils/get_rule_executor_data.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "ruleRegistry", - "id": "def-server.getRuleData.$1", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - { - "pluginId": "alerting", - "scope": "server", - "docId": "kibAlertingPluginApi", - "section": "def-server.AlertExecutorOptions", - "text": "AlertExecutorOptions" - }, - "" - ], - "path": "x-pack/plugins/rule_registry/server/utils/get_rule_executor_data.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false } ], "interfaces": [ @@ -1143,16 +1198,6 @@ "path": "x-pack/plugins/rule_registry/server/rule_data_plugin_service/index_options.ts", "deprecated": false }, - { - "parentPluginId": "ruleRegistry", - "id": "def-server.ComponentTemplateOptions.version", - "type": "number", - "tags": [], - "label": "version", - "description": [], - "path": "x-pack/plugins/rule_registry/server/rule_data_plugin_service/index_options.ts", - "deprecated": false - }, { "parentPluginId": "ruleRegistry", "id": "def-server.ComponentTemplateOptions.mappings", @@ -1310,7 +1355,8 @@ "docId": "kibRuleRegistryPluginApi", "section": "def-server.IndexTemplateOptions", "text": "IndexTemplateOptions" - } + }, + " | undefined" ], "path": "x-pack/plugins/rule_registry/server/rule_data_plugin_service/index_options.ts", "deprecated": false @@ -1362,16 +1408,6 @@ "path": "x-pack/plugins/rule_registry/server/rule_data_plugin_service/index_options.ts", "deprecated": false, "children": [ - { - "parentPluginId": "ruleRegistry", - "id": "def-server.IndexTemplateOptions.version", - "type": "number", - "tags": [], - "label": "version", - "description": [], - "path": "x-pack/plugins/rule_registry/server/rule_data_plugin_service/index_options.ts", - "deprecated": false - }, { "parentPluginId": "ruleRegistry", "id": "def-server.IndexTemplateOptions._meta", @@ -1408,6 +1444,16 @@ "path": "x-pack/plugins/rule_registry/server/rule_data_client/types.ts", "deprecated": false }, + { + "parentPluginId": "ruleRegistry", + "id": "def-server.IRuleDataClient.kibanaVersion", + "type": "string", + "tags": [], + "label": "kibanaVersion", + "description": [], + "path": "x-pack/plugins/rule_registry/server/rule_data_client/types.ts", + "deprecated": false + }, { "parentPluginId": "ruleRegistry", "id": "def-server.IRuleDataClient.isWriteEnabled", @@ -1445,7 +1491,7 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.IRuleDataClient.getReader.$1.options", + "id": "def-server.IRuleDataClient.getReader.$1", "type": "Object", "tags": [], "label": "options", @@ -1455,7 +1501,7 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.IRuleDataClient.getReader.$1.options.namespace", + "id": "def-server.IRuleDataClient.getReader.$1.namespace", "type": "string", "tags": [], "label": "namespace", @@ -1493,7 +1539,7 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.IRuleDataClient.getWriter.$1.options", + "id": "def-server.IRuleDataClient.getWriter.$1", "type": "Object", "tags": [], "label": "options", @@ -1503,7 +1549,7 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.IRuleDataClient.getWriter.$1.options.namespace", + "id": "def-server.IRuleDataClient.getWriter.$1.namespace", "type": "string", "tags": [], "label": "namespace", @@ -1544,7 +1590,7 @@ "SearchRequest", ">(request: TSearchRequest) => Promise<", "InferSearchResponseOf", - ">, TSearchRequest, { restTotalHitsAsInt: false; }>>" + ">, TSearchRequest, { restTotalHitsAsInt: false; }>>" ], "path": "x-pack/plugins/rule_registry/server/rule_data_client/types.ts", "deprecated": false, @@ -1685,9 +1731,7 @@ "label": "alertWithLifecycle", "description": [], "signature": [ - "(alert: { id: string; fields: Record & Partial>, \"tags\" | \"@timestamp\" | \"event.kind\" | \"ecs.version\" | \"event.action\" | \"kibana.alert.action_group\" | \"kibana.alert.duration.us\" | \"kibana.alert.end\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.rule.consumer\" | \"kibana.alert.rule.producer\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"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.risk_score\" | \"kibana.alert.rule.risk_score_mapping\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.severity\" | \"kibana.alert.rule.severity_mapping\" | \"kibana.alert.rule.tags\" | \"kibana.alert.rule.to\" | \"kibana.alert.rule.type\" | \"kibana.alert.rule.rule_type_id\" | \"kibana.alert.rule.updated_at\" | \"kibana.alert.rule.updated_by\" | \"kibana.alert.rule.version\" | \"kibana.alert.start\" | \"kibana.alert.severity\" | \"kibana.alert.status\" | \"kibana.alert.system_status\" | \"kibana.alert.uuid\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.alert.rule.uuid\" | \"kibana.alert.rule.category\" | \"kibana.space_ids\" | \"kibana.version\">>; }) => Pick<", + "(alert: { id: string; fields: ExplicitAlertFields; }) => Pick<", "AlertInstance", ", \"getState\" | \"replaceState\" | \"scheduleActions\" | \"scheduleActionsWithSubGroup\">" ], @@ -1697,15 +1741,13 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.alert", + "id": "def-server.LifecycleAlertServices.alertWithLifecycle.$1", "type": "Object", "tags": [], "label": "alert", "description": [], "signature": [ - "{ id: string; fields: Record & Partial>, \"tags\" | \"@timestamp\" | \"event.kind\" | \"ecs.version\" | \"event.action\" | \"kibana.alert.action_group\" | \"kibana.alert.duration.us\" | \"kibana.alert.end\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.rule.consumer\" | \"kibana.alert.rule.producer\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"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.risk_score\" | \"kibana.alert.rule.risk_score_mapping\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.severity\" | \"kibana.alert.rule.severity_mapping\" | \"kibana.alert.rule.tags\" | \"kibana.alert.rule.to\" | \"kibana.alert.rule.type\" | \"kibana.alert.rule.rule_type_id\" | \"kibana.alert.rule.updated_at\" | \"kibana.alert.rule.updated_by\" | \"kibana.alert.rule.version\" | \"kibana.alert.start\" | \"kibana.alert.severity\" | \"kibana.alert.status\" | \"kibana.alert.system_status\" | \"kibana.alert.uuid\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.alert.rule.uuid\" | \"kibana.alert.rule.category\" | \"kibana.space_ids\" | \"kibana.version\">>; }" + "{ id: string; fields: ExplicitAlertFields; }" ], "path": "x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.ts", "deprecated": false @@ -1757,7 +1799,7 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.alerts", + "id": "def-server.PersistenceServices.alertWithPersistence.$1", "type": "Array", "tags": [], "label": "alerts", @@ -1770,7 +1812,7 @@ }, { "parentPluginId": "ruleRegistry", - "id": "def-server.refresh", + "id": "def-server.PersistenceServices.alertWithPersistence.$2", "type": "CompoundType", "tags": [], "label": "refresh", @@ -1821,82 +1863,6 @@ } ], "initialIsOpen": false - }, - { - "parentPluginId": "ruleRegistry", - "id": "def-server.RuleExecutorData", - "type": "Interface", - "tags": [], - "label": "RuleExecutorData", - "description": [], - "path": "x-pack/plugins/rule_registry/server/utils/get_rule_executor_data.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "ruleRegistry", - "id": "def-server.RuleExecutorData.ALERT_RULE_CATEGORY", - "type": "string", - "tags": [], - "label": "[ALERT_RULE_CATEGORY]", - "description": [], - "path": "x-pack/plugins/rule_registry/server/utils/get_rule_executor_data.ts", - "deprecated": false - }, - { - "parentPluginId": "ruleRegistry", - "id": "def-server.RuleExecutorData.ALERT_RULE_TYPE_ID", - "type": "string", - "tags": [], - "label": "[ALERT_RULE_TYPE_ID]", - "description": [], - "path": "x-pack/plugins/rule_registry/server/utils/get_rule_executor_data.ts", - "deprecated": false - }, - { - "parentPluginId": "ruleRegistry", - "id": "def-server.RuleExecutorData.ALERT_RULE_UUID", - "type": "string", - "tags": [], - "label": "[ALERT_RULE_UUID]", - "description": [], - "path": "x-pack/plugins/rule_registry/server/utils/get_rule_executor_data.ts", - "deprecated": false - }, - { - "parentPluginId": "ruleRegistry", - "id": "def-server.RuleExecutorData.ALERT_RULE_NAME", - "type": "string", - "tags": [], - "label": "[ALERT_RULE_NAME]", - "description": [], - "path": "x-pack/plugins/rule_registry/server/utils/get_rule_executor_data.ts", - "deprecated": false - }, - { - "parentPluginId": "ruleRegistry", - "id": "def-server.RuleExecutorData.ALERT_RULE_PRODUCER", - "type": "string", - "tags": [], - "label": "[ALERT_RULE_PRODUCER]", - "description": [], - "path": "x-pack/plugins/rule_registry/server/utils/get_rule_executor_data.ts", - "deprecated": false - }, - { - "parentPluginId": "ruleRegistry", - "id": "def-server.RuleExecutorData.TAGS", - "type": "Array", - "tags": [], - "label": "[TAGS]", - "description": [], - "signature": [ - "string[]" - ], - "path": "x-pack/plugins/rule_registry/server/utils/get_rule_executor_data.ts", - "deprecated": false - } - ], - "initialIsOpen": false } ], "enums": [ @@ -1989,7 +1955,7 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.options", + "id": "def-server.CreatePersistenceRuleTypeFactory.$1", "type": "Object", "tags": [], "label": "options", @@ -2045,6 +2011,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "ruleRegistry", + "id": "def-server.INDEX_PREFIX_FOR_BACKING_INDICES", + "type": "string", + "tags": [], + "label": "INDEX_PREFIX_FOR_BACKING_INDICES", + "description": [], + "signature": [ + "\".internal.alerts\"" + ], + "path": "x-pack/plugins/rule_registry/server/config.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "ruleRegistry", "id": "def-server.LifecycleAlertService", @@ -2053,9 +2033,7 @@ "label": "LifecycleAlertService", "description": [], "signature": [ - "(alert: { id: string; fields: Record & Partial>, \"tags\" | \"@timestamp\" | \"event.kind\" | \"ecs.version\" | \"event.action\" | \"kibana.alert.action_group\" | \"kibana.alert.duration.us\" | \"kibana.alert.end\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.rule.consumer\" | \"kibana.alert.rule.producer\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"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.risk_score\" | \"kibana.alert.rule.risk_score_mapping\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.severity\" | \"kibana.alert.rule.severity_mapping\" | \"kibana.alert.rule.tags\" | \"kibana.alert.rule.to\" | \"kibana.alert.rule.type\" | \"kibana.alert.rule.rule_type_id\" | \"kibana.alert.rule.updated_at\" | \"kibana.alert.rule.updated_by\" | \"kibana.alert.rule.version\" | \"kibana.alert.start\" | \"kibana.alert.severity\" | \"kibana.alert.status\" | \"kibana.alert.system_status\" | \"kibana.alert.uuid\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.alert.rule.uuid\" | \"kibana.alert.rule.category\" | \"kibana.space_ids\" | \"kibana.version\">>; }) => Pick<", + "(alert: { id: string; fields: ExplicitAlertFields; }) => Pick<", "AlertInstance", ", \"getState\" | \"replaceState\" | \"scheduleActions\" | \"scheduleActionsWithSubGroup\">" ], @@ -2065,15 +2043,13 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.alert", + "id": "def-server.LifecycleAlertService.$1", "type": "Object", "tags": [], "label": "alert", "description": [], "signature": [ - "{ id: string; fields: Record & Partial>, \"tags\" | \"@timestamp\" | \"event.kind\" | \"ecs.version\" | \"event.action\" | \"kibana.alert.action_group\" | \"kibana.alert.duration.us\" | \"kibana.alert.end\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.rule.consumer\" | \"kibana.alert.rule.producer\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"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.risk_score\" | \"kibana.alert.rule.risk_score_mapping\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.severity\" | \"kibana.alert.rule.severity_mapping\" | \"kibana.alert.rule.tags\" | \"kibana.alert.rule.to\" | \"kibana.alert.rule.type\" | \"kibana.alert.rule.rule_type_id\" | \"kibana.alert.rule.updated_at\" | \"kibana.alert.rule.updated_by\" | \"kibana.alert.rule.version\" | \"kibana.alert.start\" | \"kibana.alert.severity\" | \"kibana.alert.status\" | \"kibana.alert.system_status\" | \"kibana.alert.uuid\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.alert.rule.uuid\" | \"kibana.alert.rule.category\" | \"kibana.space_ids\" | \"kibana.version\">>; }" + "{ id: string; fields: ExplicitAlertFields; }" ], "path": "x-pack/plugins/rule_registry/server/utils/create_lifecycle_executor.ts", "deprecated": false @@ -2107,7 +2083,7 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.options", + "id": "def-server.LifecycleRuleExecutor.$1", "type": "CompoundType", "tags": [], "label": "options", @@ -2121,7 +2097,7 @@ "section": "def-server.AlertExecutorOptions", "text": "AlertExecutorOptions" }, - ", \"name\" | \"params\" | \"tags\" | \"spaceId\" | \"rule\" | \"createdBy\" | \"updatedBy\" | \"previousStartedAt\" | \"state\" | \"alertId\" | \"namespace\" | \"startedAt\"> & { services: ", + ", \"name\" | \"tags\" | \"params\" | \"spaceId\" | \"rule\" | \"createdBy\" | \"updatedBy\" | \"previousStartedAt\" | \"state\" | \"alertId\" | \"namespace\" | \"startedAt\"> & { services: ", { "pluginId": "alerting", "scope": "server", @@ -2191,7 +2167,7 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.query", + "id": "def-server.PersistenceAlertQueryService.$1", "type": "Object", "tags": [], "label": "query", @@ -2227,7 +2203,7 @@ "children": [ { "parentPluginId": "ruleRegistry", - "id": "def-server.alerts", + "id": "def-server.PersistenceAlertService.$1", "type": "Array", "tags": [], "label": "alerts", @@ -2240,7 +2216,7 @@ }, { "parentPluginId": "ruleRegistry", - "id": "def-server.refresh", + "id": "def-server.PersistenceAlertService.$2", "type": "CompoundType", "tags": [], "label": "refresh", @@ -2262,7 +2238,7 @@ "label": "RuleRegistryPluginConfig", "description": [], "signature": [ - "{ readonly enabled: boolean; readonly write: Readonly<{} & { enabled: boolean; }>; readonly unsafe: Readonly<{} & { legacyMultiTenancy: Readonly<{} & { enabled: boolean; }>; }>; }" + "{ readonly enabled: boolean; readonly write: Readonly<{} & { enabled: boolean; }>; readonly unsafe: Readonly<{} & { legacyMultiTenancy: Readonly<{} & { enabled: boolean; }>; indexUpgrade: Readonly<{} & { enabled: boolean; }>; }>; }" ], "path": "x-pack/plugins/rule_registry/server/config.ts", "deprecated": false, @@ -2456,7 +2432,7 @@ "signature": [ "(input: unknown) => OutputOf<", "Optional", - "<{ readonly \"kibana.alert.rule.rule_type_id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.consumer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.producer\": { readonly type: \"keyword\"; }; readonly \"kibana.space_ids\": { readonly type: \"keyword\"; readonly array: true; readonly required: true; }; readonly \"kibana.alert.uuid\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.id\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.start\": { readonly type: \"date\"; }; readonly \"kibana.alert.end\": { readonly type: \"date\"; }; readonly \"kibana.alert.duration.us\": { readonly type: \"long\"; }; readonly \"kibana.alert.severity\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.status\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.evaluation.threshold\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.alert.evaluation.value\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"ecs.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.risk_score\": { readonly type: \"float\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_user\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.system_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.action_group\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.author\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.category\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.uuid\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.description\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.enabled\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.from\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.interval\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.license\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.name\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.note\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.references\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.risk_score_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_id\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_name_override\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.to\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.type\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly tags: { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly '@timestamp': { readonly type: \"date\"; readonly array: false; readonly required: true; }; readonly 'event.kind': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'event.action': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; }, \"tags\" | \"event.kind\" | \"ecs.version\" | \"event.action\" | \"kibana.alert.action_group\" | \"kibana.alert.duration.us\" | \"kibana.alert.end\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.id\" | \"kibana.alert.rule.producer\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"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.risk_score\" | \"kibana.alert.rule.risk_score_mapping\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.severity\" | \"kibana.alert.rule.severity_mapping\" | \"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\" | \"kibana.alert.start\" | \"kibana.alert.severity\" | \"kibana.alert.status\" | \"kibana.alert.system_status\" | \"kibana.alert.uuid\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.alert.rule.uuid\" | \"kibana.alert.rule.category\" | \"kibana.version\">>" + "<{ readonly \"kibana.alert.rule.rule_type_id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.consumer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.rule.producer\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.space_ids\": { readonly type: \"keyword\"; readonly array: true; readonly required: true; }; readonly \"kibana.alert.uuid\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.instance.id\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.start\": { readonly type: \"date\"; }; readonly \"kibana.alert.end\": { readonly type: \"date\"; }; readonly \"kibana.alert.duration.us\": { readonly type: \"long\"; }; readonly \"kibana.alert.severity\": { readonly type: \"keyword\"; }; readonly \"kibana.alert.status\": { readonly type: \"keyword\"; readonly required: true; }; readonly \"kibana.alert.evaluation.threshold\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.alert.evaluation.value\": { readonly type: \"scaled_float\"; readonly scaling_factor: 100; }; readonly \"kibana.version\": { readonly type: \"version\"; readonly array: false; readonly required: false; }; readonly \"ecs.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.risk_score\": { readonly type: \"float\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_user\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.workflow_reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.system_status\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.action_group\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.reason\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.author\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.category\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.uuid\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.created_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.created_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.description\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.enabled\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.from\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.interval\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.license\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.name\": { readonly type: \"keyword\"; readonly array: false; readonly required: true; }; readonly \"kibana.alert.rule.note\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.references\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.risk_score_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_id\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.rule_name_override\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.severity_mapping\": { readonly type: \"object\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.tags\": { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly \"kibana.alert.rule.to\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.type\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_at\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.updated_by\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.version\": { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly tags: { readonly type: \"keyword\"; readonly array: true; readonly required: false; }; readonly '@timestamp': { readonly type: \"date\"; readonly array: false; readonly required: true; }; readonly 'event.kind': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; readonly 'event.action': { readonly type: \"keyword\"; readonly array: false; readonly required: false; }; }, \"tags\" | \"event.kind\" | \"ecs.version\" | \"event.action\" | \"kibana.alert.action_group\" | \"kibana.alert.duration.us\" | \"kibana.alert.end\" | \"kibana.alert.evaluation.threshold\" | \"kibana.alert.evaluation.value\" | \"kibana.alert.reason\" | \"kibana.alert.rule.author\" | \"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.note\" | \"kibana.alert.rule.references\" | \"kibana.alert.rule.risk_score\" | \"kibana.alert.rule.risk_score_mapping\" | \"kibana.alert.rule.rule_id\" | \"kibana.alert.rule.rule_name_override\" | \"kibana.alert.rule.severity\" | \"kibana.alert.rule.severity_mapping\" | \"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\" | \"kibana.alert.start\" | \"kibana.alert.severity\" | \"kibana.alert.system_status\" | \"kibana.alert.workflow_reason\" | \"kibana.alert.workflow_status\" | \"kibana.alert.workflow_user\" | \"kibana.version\">>" ], "path": "x-pack/plugins/rule_registry/common/parse_technical_fields.ts", "deprecated": false, diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index d80d3340f3369..775cebd477af9 100644 --- a/api_docs/rule_registry.mdx +++ b/api_docs/rule_registry.mdx @@ -18,7 +18,7 @@ Contact [RAC](https://github.com/orgs/elastic/teams/rac) for questions regarding | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 136 | 0 | 114 | 7 | +| 132 | 0 | 109 | 7 | ## Server diff --git a/api_docs/runtime_fields.json b/api_docs/runtime_fields.json index 8348666426fa9..5ec4c49670b08 100644 --- a/api_docs/runtime_fields.json +++ b/api_docs/runtime_fields.json @@ -152,7 +152,7 @@ "children": [ { "parentPluginId": "runtimeFields", - "id": "def-public.e", + "id": "def-public.FormState.submit.$1", "type": "CompoundType", "tags": [], "label": "e", @@ -330,7 +330,7 @@ "label": "type", "description": [], "signature": [ - "\"boolean\" | \"date\" | \"keyword\" | \"long\" | \"double\" | \"ip\"" + "\"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"long\" | \"double\"" ], "path": "x-pack/plugins/runtime_fields/public/types.ts", "deprecated": false @@ -363,7 +363,7 @@ "description": [], "signature": [ "ComboBoxOption", - "<\"boolean\" | \"date\" | \"keyword\" | \"long\" | \"double\" | \"ip\">[]" + "<\"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"long\" | \"double\">[]" ], "path": "x-pack/plugins/runtime_fields/public/constants.ts", "deprecated": false, @@ -377,7 +377,7 @@ "label": "RuntimeType", "description": [], "signature": [ - "\"boolean\" | \"date\" | \"keyword\" | \"long\" | \"double\" | \"ip\"" + "\"boolean\" | \"date\" | \"keyword\" | \"ip\" | \"long\" | \"double\"" ], "path": "x-pack/plugins/runtime_fields/public/types.ts", "deprecated": false, diff --git a/api_docs/saved_objects.json b/api_docs/saved_objects.json index 2a9dfcd2d2f73..d400068df4f83 100644 --- a/api_docs/saved_objects.json +++ b/api_docs/saved_objects.json @@ -57,7 +57,7 @@ "children": [ { "parentPluginId": "savedObjects", - "id": "def-public.props", + "id": "def-public.SavedObjectFinderUi.propTypes.onChoose.$1", "type": "Object", "tags": [], "label": "props", @@ -70,7 +70,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.propName", + "id": "def-public.SavedObjectFinderUi.propTypes.onChoose.$2", "type": "string", "tags": [], "label": "propName", @@ -80,7 +80,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.componentName", + "id": "def-public.SavedObjectFinderUi.propTypes.onChoose.$3", "type": "string", "tags": [], "label": "componentName", @@ -90,7 +90,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.location", + "id": "def-public.SavedObjectFinderUi.propTypes.onChoose.$4", "type": "string", "tags": [], "label": "location", @@ -100,7 +100,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.propFullName", + "id": "def-public.SavedObjectFinderUi.propTypes.onChoose.$5", "type": "string", "tags": [], "label": "propFullName", @@ -129,7 +129,7 @@ "children": [ { "parentPluginId": "savedObjects", - "id": "def-public.props", + "id": "def-public.SavedObjectFinderUi.propTypes.noItemsMessage.$1", "type": "Object", "tags": [], "label": "props", @@ -142,7 +142,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.propName", + "id": "def-public.SavedObjectFinderUi.propTypes.noItemsMessage.$2", "type": "string", "tags": [], "label": "propName", @@ -152,7 +152,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.componentName", + "id": "def-public.SavedObjectFinderUi.propTypes.noItemsMessage.$3", "type": "string", "tags": [], "label": "componentName", @@ -162,7 +162,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.location", + "id": "def-public.SavedObjectFinderUi.propTypes.noItemsMessage.$4", "type": "string", "tags": [], "label": "location", @@ -172,7 +172,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.propFullName", + "id": "def-public.SavedObjectFinderUi.propTypes.noItemsMessage.$5", "type": "string", "tags": [], "label": "propFullName", @@ -199,7 +199,7 @@ "children": [ { "parentPluginId": "savedObjects", - "id": "def-public.props", + "id": "def-public.SavedObjectFinderUi.propTypes.savedObjectMetaData.$1", "type": "Object", "tags": [], "label": "props", @@ -212,7 +212,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.propName", + "id": "def-public.SavedObjectFinderUi.propTypes.savedObjectMetaData.$2", "type": "string", "tags": [], "label": "propName", @@ -222,7 +222,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.componentName", + "id": "def-public.SavedObjectFinderUi.propTypes.savedObjectMetaData.$3", "type": "string", "tags": [], "label": "componentName", @@ -232,7 +232,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.location", + "id": "def-public.SavedObjectFinderUi.propTypes.savedObjectMetaData.$4", "type": "string", "tags": [], "label": "location", @@ -242,7 +242,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.propFullName", + "id": "def-public.SavedObjectFinderUi.propTypes.savedObjectMetaData.$5", "type": "string", "tags": [], "label": "propFullName", @@ -269,7 +269,7 @@ "children": [ { "parentPluginId": "savedObjects", - "id": "def-public.props", + "id": "def-public.SavedObjectFinderUi.propTypes.initialPageSize.$1", "type": "Object", "tags": [], "label": "props", @@ -282,7 +282,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.propName", + "id": "def-public.SavedObjectFinderUi.propTypes.initialPageSize.$2", "type": "string", "tags": [], "label": "propName", @@ -292,7 +292,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.componentName", + "id": "def-public.SavedObjectFinderUi.propTypes.initialPageSize.$3", "type": "string", "tags": [], "label": "componentName", @@ -302,7 +302,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.location", + "id": "def-public.SavedObjectFinderUi.propTypes.initialPageSize.$4", "type": "string", "tags": [], "label": "location", @@ -312,7 +312,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.propFullName", + "id": "def-public.SavedObjectFinderUi.propTypes.initialPageSize.$5", "type": "string", "tags": [], "label": "propFullName", @@ -339,7 +339,7 @@ "children": [ { "parentPluginId": "savedObjects", - "id": "def-public.props", + "id": "def-public.SavedObjectFinderUi.propTypes.fixedPageSize.$1", "type": "Object", "tags": [], "label": "props", @@ -352,7 +352,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.propName", + "id": "def-public.SavedObjectFinderUi.propTypes.fixedPageSize.$2", "type": "string", "tags": [], "label": "propName", @@ -362,7 +362,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.componentName", + "id": "def-public.SavedObjectFinderUi.propTypes.fixedPageSize.$3", "type": "string", "tags": [], "label": "componentName", @@ -372,7 +372,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.location", + "id": "def-public.SavedObjectFinderUi.propTypes.fixedPageSize.$4", "type": "string", "tags": [], "label": "location", @@ -382,7 +382,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.propFullName", + "id": "def-public.SavedObjectFinderUi.propTypes.fixedPageSize.$5", "type": "string", "tags": [], "label": "propFullName", @@ -409,7 +409,7 @@ "children": [ { "parentPluginId": "savedObjects", - "id": "def-public.props", + "id": "def-public.SavedObjectFinderUi.propTypes.showFilter.$1", "type": "Object", "tags": [], "label": "props", @@ -422,7 +422,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.propName", + "id": "def-public.SavedObjectFinderUi.propTypes.showFilter.$2", "type": "string", "tags": [], "label": "propName", @@ -432,7 +432,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.componentName", + "id": "def-public.SavedObjectFinderUi.propTypes.showFilter.$3", "type": "string", "tags": [], "label": "componentName", @@ -442,7 +442,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.location", + "id": "def-public.SavedObjectFinderUi.propTypes.showFilter.$4", "type": "string", "tags": [], "label": "location", @@ -452,7 +452,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.propFullName", + "id": "def-public.SavedObjectFinderUi.propTypes.showFilter.$5", "type": "string", "tags": [], "label": "propFullName", @@ -664,22 +664,6 @@ "plugin": "savedObjectsManagement", "path": "src/plugins/saved_objects_management/public/services/service_registry.ts" }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts" - }, { "plugin": "savedObjectsManagement", "path": "src/plugins/saved_objects_management/public/lib/create_field_list.ts" @@ -695,26 +679,6 @@ { "plugin": "savedObjectsManagement", "path": "src/plugins/saved_objects_management/public/management_section/object_view/components/form.tsx" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts" - }, - { - "plugin": "timelion", - "path": "src/plugins/timelion/public/services/saved_sheets.ts" - }, - { - "plugin": "timelion", - "path": "src/plugins/timelion/public/services/saved_sheets.ts" } ], "children": [ @@ -979,7 +943,7 @@ "children": [ { "parentPluginId": "savedObjects", - "id": "def-public.SavedObjectLoader.mapSavedObjectApiHits.$1.attributesidreferences", + "id": "def-public.SavedObjectLoader.mapSavedObjectApiHits.$1", "type": "Object", "tags": [], "label": "{\n attributes,\n id,\n references = [],\n }", @@ -989,7 +953,7 @@ "children": [ { "parentPluginId": "savedObjects", - "id": "def-public.SavedObjectLoader.mapSavedObjectApiHits.$1.attributesidreferences.attributes", + "id": "def-public.SavedObjectLoader.mapSavedObjectApiHits.$1.attributes", "type": "Object", "tags": [], "label": "attributes", @@ -1002,7 +966,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.SavedObjectLoader.mapSavedObjectApiHits.$1.attributesidreferences.id", + "id": "def-public.SavedObjectLoader.mapSavedObjectApiHits.$1.id", "type": "string", "tags": [], "label": "id", @@ -1012,7 +976,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.SavedObjectLoader.mapSavedObjectApiHits.$1.attributesidreferences.references", + "id": "def-public.SavedObjectLoader.mapSavedObjectApiHits.$1.references", "type": "Array", "tags": [], "label": "references", @@ -1448,7 +1412,7 @@ "children": [ { "parentPluginId": "savedObjects", - "id": "def-public.isErrorNonFatal.$1.error", + "id": "def-public.isErrorNonFatal.$1", "type": "Object", "tags": [], "label": "error", @@ -1458,7 +1422,7 @@ "children": [ { "parentPluginId": "savedObjects", - "id": "def-public.isErrorNonFatal.$1.error.message", + "id": "def-public.isErrorNonFatal.$1.message", "type": "string", "tags": [], "label": "message", @@ -1588,7 +1552,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.saveWithConfirmation.$2.savedObject", + "id": "def-public.saveWithConfirmation.$2", "type": "Object", "tags": [], "label": "savedObject", @@ -1598,7 +1562,7 @@ "children": [ { "parentPluginId": "savedObjects", - "id": "def-public.saveWithConfirmation.$2.savedObject.getEsType", + "id": "def-public.saveWithConfirmation.$2.getEsType", "type": "Function", "tags": [], "label": "getEsType", @@ -1613,7 +1577,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.saveWithConfirmation.$2.savedObject.title", + "id": "def-public.saveWithConfirmation.$2.title", "type": "string", "tags": [], "label": "title", @@ -1623,7 +1587,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.saveWithConfirmation.$2.savedObject.displayName", + "id": "def-public.saveWithConfirmation.$2.displayName", "type": "string", "tags": [], "label": "displayName", @@ -1657,7 +1621,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.saveWithConfirmation.$4.services", + "id": "def-public.saveWithConfirmation.$4", "type": "Object", "tags": [], "label": "services", @@ -1667,7 +1631,7 @@ "children": [ { "parentPluginId": "savedObjects", - "id": "def-public.saveWithConfirmation.$4.services.savedObjectsClient", + "id": "def-public.saveWithConfirmation.$4.savedObjectsClient", "type": "Object", "tags": [], "label": "savedObjectsClient", @@ -1794,7 +1758,7 @@ }, { "parentPluginId": "savedObjects", - "id": "def-public.saveWithConfirmation.$4.services.overlays", + "id": "def-public.saveWithConfirmation.$4.overlays", "type": "Object", "tags": [], "label": "overlays", @@ -2146,6 +2110,10 @@ "path": "src/plugins/saved_objects/public/types.ts", "deprecated": true, "references": [ + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_route.tsx" + }, { "plugin": "savedObjectsTaggingOss", "path": "src/plugins/saved_objects_tagging_oss/public/api.ts" @@ -2166,6 +2134,14 @@ "plugin": "discover", "path": "src/plugins/discover/public/saved_searches/_saved_search.ts" }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_route.tsx" + }, + { + "plugin": "discover", + "path": "src/plugins/discover/public/application/apps/main/discover_main_route.tsx" + }, { "plugin": "visualizations", "path": "src/plugins/visualizations/public/saved_visualizations/_saved_vis.ts" @@ -2230,22 +2206,6 @@ "plugin": "dashboard", "path": "src/plugins/dashboard/public/application/actions/clone_panel_action.tsx" }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts" - }, { "plugin": "visualize", "path": "src/plugins/visualize/public/application/types.ts" @@ -2290,30 +2250,6 @@ "plugin": "visDefaultEditor", "path": "src/plugins/vis_default_editor/public/components/sidebar/sidebar.tsx" }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts" - }, - { - "plugin": "savedObjectsManagement", - "path": "src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts" - }, { "plugin": "visualize", "path": "src/plugins/visualize/target/types/public/application/types.d.ts" @@ -3286,7 +3222,7 @@ "children": [ { "parentPluginId": "savedObjects", - "id": "def-public.services", + "id": "def-public.SavedObjectDecoratorConfig.factory.$1", "type": "Object", "tags": [], "label": "services", @@ -3795,7 +3731,7 @@ "children": [ { "parentPluginId": "savedObjects", - "id": "def-public.services", + "id": "def-public.SavedObjectDecoratorFactory.$1", "type": "Object", "tags": [], "label": "services", @@ -3916,10 +3852,6 @@ { "plugin": "dashboard", "path": "src/plugins/dashboard/public/saved_dashboards/saved_dashboard.ts" - }, - { - "plugin": "timelion", - "path": "src/plugins/timelion/public/services/_saved_sheet.ts" } ] }, @@ -3958,6 +3890,14 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/routes/list_page/maps_list_view.tsx" }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/apps/listing_route.tsx" + }, + { + "plugin": "graph", + "path": "x-pack/plugins/graph/public/apps/listing_route.tsx" + }, { "plugin": "visualize", "path": "src/plugins/visualize/public/application/components/visualize_listing.tsx" diff --git a/api_docs/saved_objects_management.json b/api_docs/saved_objects_management.json index f66576a8bedff..84bfebb23717a 100644 --- a/api_docs/saved_objects_management.json +++ b/api_docs/saved_objects_management.json @@ -469,32 +469,6 @@ "path": "src/plugins/saved_objects_management/public/lib/process_import_response.ts", "deprecated": false }, - { - "parentPluginId": "savedObjectsManagement", - "id": "def-public.ProcessedImportResponse.conflictedSavedObjectsLinkedToSavedSearches", - "type": "Uncategorized", - "tags": [], - "label": "conflictedSavedObjectsLinkedToSavedSearches", - "description": [], - "signature": [ - "undefined" - ], - "path": "src/plugins/saved_objects_management/public/lib/process_import_response.ts", - "deprecated": false - }, - { - "parentPluginId": "savedObjectsManagement", - "id": "def-public.ProcessedImportResponse.conflictedSearchDocs", - "type": "Uncategorized", - "tags": [], - "label": "conflictedSearchDocs", - "description": [], - "signature": [ - "undefined" - ], - "path": "src/plugins/saved_objects_management/public/lib/process_import_response.ts", - "deprecated": false - }, { "parentPluginId": "savedObjectsManagement", "id": "def-public.ProcessedImportResponse.importWarnings", diff --git a/api_docs/saved_objects_management.mdx b/api_docs/saved_objects_management.mdx index d48fc7634d7de..9dc78f44889f2 100644 --- a/api_docs/saved_objects_management.mdx +++ b/api_docs/saved_objects_management.mdx @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 106 | 0 | 93 | 0 | +| 104 | 0 | 91 | 0 | ## Client diff --git a/api_docs/saved_objects_tagging_oss.json b/api_docs/saved_objects_tagging_oss.json index eb9d9a733dced..2e6485256ca00 100644 --- a/api_docs/saved_objects_tagging_oss.json +++ b/api_docs/saved_objects_tagging_oss.json @@ -833,7 +833,7 @@ "children": [ { "parentPluginId": "savedObjectsTaggingOss", - "id": "def-public.props", + "id": "def-public.SavedObjectsTaggingApiUiComponent.TagList.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -846,7 +846,7 @@ }, { "parentPluginId": "savedObjectsTaggingOss", - "id": "def-public.context", + "id": "def-public.SavedObjectsTaggingApiUiComponent.TagList.$2", "type": "Any", "tags": [], "label": "context", @@ -885,7 +885,7 @@ "children": [ { "parentPluginId": "savedObjectsTaggingOss", - "id": "def-public.props", + "id": "def-public.SavedObjectsTaggingApiUiComponent.TagSelector.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -898,7 +898,7 @@ }, { "parentPluginId": "savedObjectsTaggingOss", - "id": "def-public.context", + "id": "def-public.SavedObjectsTaggingApiUiComponent.TagSelector.$2", "type": "Any", "tags": [], "label": "context", @@ -937,7 +937,7 @@ "children": [ { "parentPluginId": "savedObjectsTaggingOss", - "id": "def-public.props", + "id": "def-public.SavedObjectsTaggingApiUiComponent.SavedObjectSaveModalTagSelector.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -950,7 +950,7 @@ }, { "parentPluginId": "savedObjectsTaggingOss", - "id": "def-public.context", + "id": "def-public.SavedObjectsTaggingApiUiComponent.SavedObjectSaveModalTagSelector.$2", "type": "Any", "tags": [], "label": "context", @@ -1093,7 +1093,7 @@ "children": [ { "parentPluginId": "savedObjectsTaggingOss", - "id": "def-public.object", + "id": "def-public.SavedObjectTagDecoratorTypeGuard.$1", "type": "Object", "tags": [], "label": "object", diff --git a/api_docs/screenshot_mode.json b/api_docs/screenshot_mode.json index 0f875acc8b10f..fe8106b922392 100644 --- a/api_docs/screenshot_mode.json +++ b/api_docs/screenshot_mode.json @@ -198,7 +198,7 @@ "children": [ { "parentPluginId": "screenshotMode", - "id": "def-server.request", + "id": "def-server.ScreenshotModePluginSetup.isScreenshotMode.$1", "type": "Object", "tags": [], "label": "request", @@ -273,7 +273,7 @@ "children": [ { "parentPluginId": "screenshotMode", - "id": "def-server.request", + "id": "def-server.ScreenshotModePluginStart.isScreenshotMode.$1", "type": "Object", "tags": [], "label": "request", diff --git a/api_docs/security_solution.json b/api_docs/security_solution.json index 7403e8386ce6a..b6a064ded2090 100644 --- a/api_docs/security_solution.json +++ b/api_docs/security_solution.json @@ -273,7 +273,7 @@ "signature": [ "Pick<", "TGridModel", - ", \"columns\" | \"filters\" | \"title\" | \"id\" | \"sort\" | \"version\" | \"isLoading\" | \"dateRange\" | \"defaultColumns\" | \"savedObjectId\" | \"dataProviders\" | \"deletedEventIds\" | \"excludedRowRendererIds\" | \"expandedDetail\" | \"graphEventId\" | \"kqlQuery\" | \"indexNames\" | \"isSelectAllChecked\" | \"itemsPerPage\" | \"itemsPerPageOptions\" | \"loadingEventIds\" | \"showCheckboxes\" | \"selectedEventIds\"> & { activeTab: ", + ", \"columns\" | \"filters\" | \"title\" | \"id\" | \"sort\" | \"version\" | \"isLoading\" | \"filterManager\" | \"dateRange\" | \"defaultColumns\" | \"savedObjectId\" | \"unit\" | \"dataProviders\" | \"deletedEventIds\" | \"documentType\" | \"excludedRowRendererIds\" | \"expandedDetail\" | \"footerText\" | \"graphEventId\" | \"kqlQuery\" | \"queryFields\" | \"indexNames\" | \"isSelectAllChecked\" | \"itemsPerPage\" | \"itemsPerPageOptions\" | \"loadingEventIds\" | \"loadingText\" | \"selectAll\" | \"showCheckboxes\" | \"selectedEventIds\"> & { activeTab: ", { "pluginId": "securitySolution", "scope": "common", @@ -412,7 +412,7 @@ "label": "config", "description": [], "signature": [ - "Readonly<{} & { enabled: boolean; signalsIndex: string; maxRuleImportExportSize: number; maxRuleImportPayloadBytes: number; maxTimelineImportExportSize: number; maxTimelineImportPayloadBytes: number; alertMergeStrategy: \"allFields\" | \"missingFields\" | \"noFields\"; enableExperimental: string[]; endpointResultListDefaultFirstPageIndex: number; endpointResultListDefaultPageSize: number; packagerTaskInterval: string; prebuiltRulesFromFileSystem: boolean; prebuiltRulesFromSavedObjects: boolean; }>" + "Readonly<{} & { enabled: boolean; signalsIndex: string; maxRuleImportExportSize: number; maxRuleImportPayloadBytes: number; maxTimelineImportExportSize: number; maxTimelineImportPayloadBytes: number; alertMergeStrategy: \"allFields\" | \"missingFields\" | \"noFields\"; alertIgnoreFields: string[]; enableExperimental: string[]; endpointResultListDefaultFirstPageIndex: number; endpointResultListDefaultPageSize: number; packagerTaskInterval: string; prebuiltRulesFromFileSystem: boolean; prebuiltRulesFromSavedObjects: boolean; }>" ], "path": "x-pack/plugins/security_solution/server/client/client.ts", "deprecated": false, @@ -845,7 +845,7 @@ "label": "ConfigType", "description": [], "signature": [ - "{ readonly enabled: boolean; readonly signalsIndex: string; readonly maxRuleImportExportSize: number; readonly maxRuleImportPayloadBytes: number; readonly maxTimelineImportExportSize: number; readonly maxTimelineImportPayloadBytes: number; readonly alertMergeStrategy: \"allFields\" | \"missingFields\" | \"noFields\"; readonly enableExperimental: string[]; readonly endpointResultListDefaultFirstPageIndex: number; readonly endpointResultListDefaultPageSize: number; readonly packagerTaskInterval: string; readonly prebuiltRulesFromFileSystem: boolean; readonly prebuiltRulesFromSavedObjects: boolean; }" + "{ readonly enabled: boolean; readonly signalsIndex: string; readonly maxRuleImportExportSize: number; readonly maxRuleImportPayloadBytes: number; readonly maxTimelineImportExportSize: number; readonly maxTimelineImportPayloadBytes: number; readonly alertMergeStrategy: \"allFields\" | \"missingFields\" | \"noFields\"; readonly alertIgnoreFields: string[]; readonly enableExperimental: string[]; readonly endpointResultListDefaultFirstPageIndex: number; readonly endpointResultListDefaultPageSize: number; readonly packagerTaskInterval: string; readonly prebuiltRulesFromFileSystem: boolean; readonly prebuiltRulesFromSavedObjects: boolean; }" ], "path": "x-pack/plugins/security_solution/server/config.ts", "deprecated": false, @@ -1030,16 +1030,6 @@ "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false, "children": [ - { - "parentPluginId": "securitySolution", - "id": "def-common.ActionProps.ariaRowindex", - "type": "number", - "tags": [], - "label": "ariaRowindex", - "description": [], - "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false - }, { "parentPluginId": "securitySolution", "id": "def-common.ActionProps.action", @@ -1095,14 +1085,21 @@ }, { "parentPluginId": "securitySolution", - "id": "def-common.ActionProps.width", + "id": "def-common.ActionProps.ariaRowindex", "type": "number", "tags": [], - "label": "width", + "label": "ariaRowindex", + "description": [], + "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", + "deprecated": false + }, + { + "parentPluginId": "securitySolution", + "id": "def-common.ActionProps.checked", + "type": "boolean", + "tags": [], + "label": "checked", "description": [], - "signature": [ - "number | undefined" - ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false }, @@ -1128,42 +1125,49 @@ }, { "parentPluginId": "securitySolution", - "id": "def-common.ActionProps.checked", - "type": "boolean", + "id": "def-common.ActionProps.data", + "type": "Array", "tags": [], - "label": "checked", + "label": "data", "description": [], + "signature": [ + { + "pluginId": "timelines", + "scope": "common", + "docId": "kibTimelinesPluginApi", + "section": "def-common.TimelineNonEcsData", + "text": "TimelineNonEcsData" + }, + "[]" + ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false }, { "parentPluginId": "securitySolution", - "id": "def-common.ActionProps.onRowSelected", - "type": "Function", + "id": "def-common.ActionProps.disabled", + "type": "CompoundType", "tags": [], - "label": "onRowSelected", + "label": "disabled", "description": [], "signature": [ - "({ eventIds, isSelected, }: { eventIds: string[]; isSelected: boolean; }) => void" + "boolean | undefined" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "securitySolution", - "id": "def-common.__0", - "type": "Object", - "tags": [], - "label": "__0", - "description": [], - "signature": [ - "{ eventIds: string[]; isSelected: boolean; }" - ], - "path": "x-pack/plugins/timelines/common/types/timeline/store.ts", - "deprecated": false - } - ] + "deprecated": false + }, + { + "parentPluginId": "securitySolution", + "id": "def-common.ActionProps.ecsData", + "type": "Object", + "tags": [], + "label": "ecsData", + "description": [], + "signature": [ + "Ecs" + ], + "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", + "deprecated": false }, { "parentPluginId": "securitySolution", @@ -1177,123 +1181,139 @@ }, { "parentPluginId": "securitySolution", - "id": "def-common.ActionProps.loadingEventIds", + "id": "def-common.ActionProps.eventIdToNoteIds", "type": "Object", "tags": [], - "label": "loadingEventIds", + "label": "eventIdToNoteIds", "description": [], "signature": [ - "readonly string[]" + "Readonly> | undefined" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false }, { "parentPluginId": "securitySolution", - "id": "def-common.ActionProps.onEventDetailsPanelOpened", - "type": "Function", + "id": "def-common.ActionProps.index", + "type": "number", "tags": [], - "label": "onEventDetailsPanelOpened", + "label": "index", "description": [], - "signature": [ - "() => void" - ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "deprecated": false }, { "parentPluginId": "securitySolution", - "id": "def-common.ActionProps.showCheckboxes", - "type": "boolean", + "id": "def-common.ActionProps.isEventPinned", + "type": "CompoundType", "tags": [], - "label": "showCheckboxes", + "label": "isEventPinned", "description": [], + "signature": [ + "boolean | undefined" + ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false }, { "parentPluginId": "securitySolution", - "id": "def-common.ActionProps.data", - "type": "Array", + "id": "def-common.ActionProps.isEventViewer", + "type": "CompoundType", "tags": [], - "label": "data", + "label": "isEventViewer", "description": [], "signature": [ - { - "pluginId": "timelines", - "scope": "common", - "docId": "kibTimelinesPluginApi", - "section": "def-common.TimelineNonEcsData", - "text": "TimelineNonEcsData" - }, - "[]" + "boolean | undefined" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false }, { "parentPluginId": "securitySolution", - "id": "def-common.ActionProps.ecsData", + "id": "def-common.ActionProps.loadingEventIds", "type": "Object", "tags": [], - "label": "ecsData", + "label": "loadingEventIds", "description": [], "signature": [ - "Ecs" + "readonly string[]" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false }, { "parentPluginId": "securitySolution", - "id": "def-common.ActionProps.index", - "type": "number", + "id": "def-common.ActionProps.onEventDetailsPanelOpened", + "type": "Function", "tags": [], - "label": "index", + "label": "onEventDetailsPanelOpened", "description": [], + "signature": [ + "() => void" + ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false + "deprecated": false, + "children": [], + "returnComment": [] }, { "parentPluginId": "securitySolution", - "id": "def-common.ActionProps.eventIdToNoteIds", - "type": "Object", + "id": "def-common.ActionProps.onRowSelected", + "type": "Function", "tags": [], - "label": "eventIdToNoteIds", + "label": "onRowSelected", "description": [], "signature": [ - "Readonly> | undefined" + "({ eventIds, isSelected, }: { eventIds: string[]; isSelected: boolean; }) => void" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "securitySolution", + "id": "def-common.ActionProps.onRowSelected.$1", + "type": "Object", + "tags": [], + "label": "__0", + "description": [], + "signature": [ + "{ eventIds: string[]; isSelected: boolean; }" + ], + "path": "x-pack/plugins/timelines/common/types/timeline/store.ts", + "deprecated": false + } + ] }, { "parentPluginId": "securitySolution", - "id": "def-common.ActionProps.isEventPinned", - "type": "CompoundType", + "id": "def-common.ActionProps.onRuleChange", + "type": "Function", "tags": [], - "label": "isEventPinned", + "label": "onRuleChange", "description": [], "signature": [ - "boolean | undefined" + "(() => void) | undefined" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false + "deprecated": false, + "children": [], + "returnComment": [] }, { "parentPluginId": "securitySolution", - "id": "def-common.ActionProps.isEventViewer", - "type": "CompoundType", + "id": "def-common.ActionProps.refetch", + "type": "Function", "tags": [], - "label": "isEventViewer", + "label": "refetch", "description": [], "signature": [ - "boolean | undefined" + "(() => void) | undefined" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false + "deprecated": false, + "children": [], + "returnComment": [] }, { "parentPluginId": "securitySolution", @@ -1307,13 +1327,13 @@ }, { "parentPluginId": "securitySolution", - "id": "def-common.ActionProps.setEventsLoading", + "id": "def-common.ActionProps.setEventsDeleted", "type": "Function", "tags": [], - "label": "setEventsLoading", + "label": "setEventsDeleted", "description": [], "signature": [ - "(params: { eventIds: string[]; isLoading: boolean; }) => void" + "(params: { eventIds: string[]; isDeleted: boolean; }) => void" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false, @@ -1321,13 +1341,13 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.params", + "id": "def-common.ActionProps.setEventsDeleted.$1", "type": "Object", "tags": [], "label": "params", "description": [], "signature": [ - "{ eventIds: string[]; isLoading: boolean; }" + "{ eventIds: string[]; isDeleted: boolean; }" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false @@ -1336,13 +1356,13 @@ }, { "parentPluginId": "securitySolution", - "id": "def-common.ActionProps.setEventsDeleted", + "id": "def-common.ActionProps.setEventsLoading", "type": "Function", "tags": [], - "label": "setEventsDeleted", + "label": "setEventsLoading", "description": [], "signature": [ - "(params: { eventIds: string[]; isDeleted: boolean; }) => void" + "(params: { eventIds: string[]; isLoading: boolean; }) => void" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false, @@ -1350,13 +1370,13 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.params", + "id": "def-common.ActionProps.setEventsLoading.$1", "type": "Object", "tags": [], "label": "params", "description": [], "signature": [ - "{ eventIds: string[]; isDeleted: boolean; }" + "{ eventIds: string[]; isLoading: boolean; }" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false @@ -1365,33 +1385,13 @@ }, { "parentPluginId": "securitySolution", - "id": "def-common.ActionProps.refetch", - "type": "Function", - "tags": [], - "label": "refetch", - "description": [], - "signature": [ - "(() => void) | undefined" - ], - "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "securitySolution", - "id": "def-common.ActionProps.onRuleChange", - "type": "Function", + "id": "def-common.ActionProps.showCheckboxes", + "type": "boolean", "tags": [], - "label": "onRuleChange", + "label": "showCheckboxes", "description": [], - "signature": [ - "(() => void) | undefined" - ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "deprecated": false }, { "parentPluginId": "securitySolution", @@ -1450,6 +1450,19 @@ "deprecated": false, "children": [], "returnComment": [] + }, + { + "parentPluginId": "securitySolution", + "id": "def-common.ActionProps.width", + "type": "number", + "tags": [], + "label": "width", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", + "deprecated": false } ], "initialIsOpen": false @@ -2874,7 +2887,7 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.ColumnRenderer.renderColumn.$1.columnNameeventIdfieldtimelineIdtruncatevalueslinkValues", + "id": "def-common.ColumnRenderer.renderColumn.$1", "type": "Object", "tags": [], "label": "{\n columnName,\n eventId,\n field,\n timelineId,\n truncate,\n values,\n linkValues,\n }", @@ -2884,7 +2897,7 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.ColumnRenderer.renderColumn.$1.columnNameeventIdfieldtimelineIdtruncatevalueslinkValues.columnName", + "id": "def-common.ColumnRenderer.renderColumn.$1.columnName", "type": "string", "tags": [], "label": "columnName", @@ -2894,7 +2907,7 @@ }, { "parentPluginId": "securitySolution", - "id": "def-common.ColumnRenderer.renderColumn.$1.columnNameeventIdfieldtimelineIdtruncatevalueslinkValues.eventId", + "id": "def-common.ColumnRenderer.renderColumn.$1.eventId", "type": "string", "tags": [], "label": "eventId", @@ -2904,7 +2917,7 @@ }, { "parentPluginId": "securitySolution", - "id": "def-common.ColumnRenderer.renderColumn.$1.columnNameeventIdfieldtimelineIdtruncatevalueslinkValues.field", + "id": "def-common.ColumnRenderer.renderColumn.$1.field", "type": "CompoundType", "tags": [], "label": "field", @@ -2912,7 +2925,7 @@ "signature": [ "Pick<", "EuiDataGridColumn", - ", \"id\" | \"display\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", + ", \"id\" | \"schema\" | \"display\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", { "pluginId": "timelines", "scope": "common", @@ -2937,7 +2950,7 @@ }, { "parentPluginId": "securitySolution", - "id": "def-common.ColumnRenderer.renderColumn.$1.columnNameeventIdfieldtimelineIdtruncatevalueslinkValues.timelineId", + "id": "def-common.ColumnRenderer.renderColumn.$1.timelineId", "type": "string", "tags": [], "label": "timelineId", @@ -2947,7 +2960,7 @@ }, { "parentPluginId": "securitySolution", - "id": "def-common.ColumnRenderer.renderColumn.$1.columnNameeventIdfieldtimelineIdtruncatevalueslinkValues.truncate", + "id": "def-common.ColumnRenderer.renderColumn.$1.truncate", "type": "CompoundType", "tags": [], "label": "truncate", @@ -2960,7 +2973,7 @@ }, { "parentPluginId": "securitySolution", - "id": "def-common.ColumnRenderer.renderColumn.$1.columnNameeventIdfieldtimelineIdtruncatevalueslinkValues.values", + "id": "def-common.ColumnRenderer.renderColumn.$1.values", "type": "CompoundType", "tags": [], "label": "values", @@ -2973,7 +2986,7 @@ }, { "parentPluginId": "securitySolution", - "id": "def-common.ColumnRenderer.renderColumn.$1.columnNameeventIdfieldtimelineIdtruncatevalueslinkValues.linkValues", + "id": "def-common.ColumnRenderer.renderColumn.$1.linkValues", "type": "CompoundType", "tags": [], "label": "linkValues", @@ -5259,7 +5272,7 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.HeaderActionProps.onSelectAll.$1.isSelected", + "id": "def-common.HeaderActionProps.onSelectAll.$1", "type": "Object", "tags": [], "label": "{ isSelected }", @@ -5269,7 +5282,7 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.HeaderActionProps.onSelectAll.$1.isSelected.isSelected", + "id": "def-common.HeaderActionProps.onSelectAll.$1.isSelected", "type": "boolean", "tags": [], "label": "isSelected", @@ -14694,7 +14707,7 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.RowRenderer.renderRow.$1.browserFieldsdataisDraggabletimelineId", + "id": "def-common.RowRenderer.renderRow.$1", "type": "Object", "tags": [], "label": "{\n browserFields,\n data,\n isDraggable,\n timelineId,\n }", @@ -14704,7 +14717,7 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.RowRenderer.renderRow.$1.browserFieldsdataisDraggabletimelineId.browserFields", + "id": "def-common.RowRenderer.renderRow.$1.browserFields", "type": "Object", "tags": [], "label": "browserFields", @@ -14725,7 +14738,7 @@ }, { "parentPluginId": "securitySolution", - "id": "def-common.RowRenderer.renderRow.$1.browserFieldsdataisDraggabletimelineId.data", + "id": "def-common.RowRenderer.renderRow.$1.data", "type": "Object", "tags": [], "label": "data", @@ -14738,7 +14751,7 @@ }, { "parentPluginId": "securitySolution", - "id": "def-common.RowRenderer.renderRow.$1.browserFieldsdataisDraggabletimelineId.isDraggable", + "id": "def-common.RowRenderer.renderRow.$1.isDraggable", "type": "boolean", "tags": [], "label": "isDraggable", @@ -14748,7 +14761,7 @@ }, { "parentPluginId": "securitySolution", - "id": "def-common.RowRenderer.renderRow.$1.browserFieldsdataisDraggabletimelineId.timelineId", + "id": "def-common.RowRenderer.renderRow.$1.timelineId", "type": "string", "tags": [], "label": "timelineId", @@ -15688,6 +15701,19 @@ "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "children": [ + { + "parentPluginId": "securitySolution", + "id": "def-common.TimelineEventsAllStrategyResponse.consumers", + "type": "Object", + "tags": [], + "label": "consumers", + "description": [], + "signature": [ + "{ [x: string]: number; }" + ], + "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "deprecated": false + }, { "parentPluginId": "securitySolution", "id": "def-common.TimelineEventsAllStrategyResponse.edges", @@ -16758,6 +16784,26 @@ "path": "x-pack/plugins/security_solution/common/types/timeline/store.ts", "deprecated": false }, + { + "parentPluginId": "securitySolution", + "id": "def-common.TimelinePersistInput.defaultColumns", + "type": "Array", + "tags": [], + "label": "defaultColumns", + "description": [], + "signature": [ + { + "pluginId": "timelines", + "scope": "common", + "docId": "kibTimelinesPluginApi", + "section": "def-common.ColumnHeaderOptions", + "text": "ColumnHeaderOptions" + }, + "[] | undefined" + ], + "path": "x-pack/plugins/security_solution/common/types/timeline/store.ts", + "deprecated": false + }, { "parentPluginId": "securitySolution", "id": "def-common.TimelinePersistInput.itemsPerPage", @@ -19107,7 +19153,7 @@ "signature": [ "Pick<", "EuiDataGridColumn", - ", \"id\" | \"display\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", + ", \"id\" | \"schema\" | \"display\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", { "pluginId": "timelines", "scope": "common", @@ -20335,7 +20381,7 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.nextPage", + "id": "def-common.OnChangePage.$1", "type": "number", "tags": [], "label": "nextPage", @@ -20362,7 +20408,7 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.columnId", + "id": "def-common.OnColumnRemoved.$1", "type": "string", "tags": [], "label": "columnId", @@ -20389,7 +20435,7 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.__0", + "id": "def-common.OnColumnResized.$1", "type": "Object", "tags": [], "label": "__0", @@ -20429,7 +20475,7 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.sorted", + "id": "def-common.OnColumnSorted.$1", "type": "Object", "tags": [], "label": "sorted", @@ -20475,7 +20521,7 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.sorted", + "id": "def-common.OnColumnsSorted.$1", "type": "Array", "tags": [], "label": "sorted", @@ -20515,7 +20561,7 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.eventId", + "id": "def-common.OnPinEvent.$1", "type": "string", "tags": [], "label": "eventId", @@ -20544,7 +20590,7 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.__0", + "id": "def-common.OnRowSelected.$1", "type": "Object", "tags": [], "label": "__0", @@ -20576,7 +20622,7 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.__0", + "id": "def-common.OnSelectAll.$1", "type": "Object", "tags": [], "label": "__0", @@ -20608,7 +20654,7 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.eventId", + "id": "def-common.OnUnPinEvent.$1", "type": "string", "tags": [], "label": "eventId", @@ -20645,7 +20691,7 @@ "children": [ { "parentPluginId": "securitySolution", - "id": "def-common.columns", + "id": "def-common.OnUpdateColumns.$1", "type": "Array", "tags": [], "label": "columns", @@ -22033,7 +22079,9 @@ "label": "TimelineExpandedDetail", "description": [], "signature": [ - "{ query?: { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; refetch?: (() => void) | undefined; } | undefined; } | Record | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: ", + "{ query?: { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; refetch?: (() => void) | undefined; ecsData?: ", + "Ecs", + " | undefined; } | undefined; } | Record | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: ", { "pluginId": "securitySolution", "scope": "common", @@ -22041,7 +22089,9 @@ "section": "def-common.FlowTarget", "text": "FlowTarget" }, - "; } | undefined; } | undefined; graph?: { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; refetch?: (() => void) | undefined; } | undefined; } | Record | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: ", + "; } | undefined; } | undefined; graph?: { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; refetch?: (() => void) | undefined; ecsData?: ", + "Ecs", + " | undefined; } | undefined; } | Record | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: ", { "pluginId": "securitySolution", "scope": "common", @@ -22049,7 +22099,9 @@ "section": "def-common.FlowTarget", "text": "FlowTarget" }, - "; } | undefined; } | undefined; notes?: { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; refetch?: (() => void) | undefined; } | undefined; } | Record | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: ", + "; } | undefined; } | undefined; notes?: { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; refetch?: (() => void) | undefined; ecsData?: ", + "Ecs", + " | undefined; } | undefined; } | Record | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: ", { "pluginId": "securitySolution", "scope": "common", @@ -22057,7 +22109,9 @@ "section": "def-common.FlowTarget", "text": "FlowTarget" }, - "; } | undefined; } | undefined; pinned?: { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; refetch?: (() => void) | undefined; } | undefined; } | Record | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: ", + "; } | undefined; } | undefined; pinned?: { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; refetch?: (() => void) | undefined; ecsData?: ", + "Ecs", + " | undefined; } | undefined; } | Record | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: ", { "pluginId": "securitySolution", "scope": "common", @@ -22065,7 +22119,9 @@ "section": "def-common.FlowTarget", "text": "FlowTarget" }, - "; } | undefined; } | undefined; eql?: { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; refetch?: (() => void) | undefined; } | undefined; } | Record | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: ", + "; } | undefined; } | undefined; eql?: { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; refetch?: (() => void) | undefined; ecsData?: ", + "Ecs", + " | undefined; } | undefined; } | Record | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: ", { "pluginId": "securitySolution", "scope": "common", @@ -22087,7 +22143,9 @@ "label": "TimelineExpandedDetailType", "description": [], "signature": [ - "{ panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; refetch?: (() => void) | undefined; } | undefined; } | Record | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: ", + "{ panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; refetch?: (() => void) | undefined; ecsData?: ", + "Ecs", + " | undefined; } | undefined; } | Record | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: ", { "pluginId": "securitySolution", "scope": "common", @@ -22109,7 +22167,9 @@ "label": "TimelineExpandedEventType", "description": [], "signature": [ - "{ panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; refetch?: (() => void) | undefined; } | undefined; } | Record" + "{ panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; refetch?: (() => void) | undefined; ecsData?: ", + "Ecs", + " | undefined; } | undefined; } | Record" ], "path": "x-pack/plugins/security_solution/common/types/timeline/index.ts", "deprecated": false, @@ -22586,7 +22646,9 @@ "label": "ToggleDetailPanel", "description": [], "signature": [ - "({ panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; refetch?: (() => void) | undefined; } | undefined; } & { tabType?: ", + "({ panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; refetch?: (() => void) | undefined; ecsData?: ", + "Ecs", + " | undefined; } | undefined; } & { tabType?: ", { "pluginId": "securitySolution", "scope": "common", diff --git a/api_docs/security_solution.mdx b/api_docs/security_solution.mdx index ec30be95b4e94..65601bbd75fda 100644 --- a/api_docs/security_solution.mdx +++ b/api_docs/security_solution.mdx @@ -18,7 +18,7 @@ Contact [Security solution](https://github.com/orgs/elastic/teams/security-solut | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 1335 | 8 | 1282 | 28 | +| 1338 | 8 | 1285 | 29 | ## Client diff --git a/api_docs/share.json b/api_docs/share.json index bc57c9a01795d..e63a819d4d668 100644 --- a/api_docs/share.json +++ b/api_docs/share.json @@ -362,8 +362,16 @@ "description": [], "signature": [ "(opts: ", - "RedirectOptions", - ") => URLSearchParams" + { + "pluginId": "share", + "scope": "public", + "docId": "kibSharePluginApi", + "section": "def-public.RedirectOptions", + "text": "RedirectOptions" + }, + "<", + "SerializableRecord", + ">) => URLSearchParams" ], "path": "src/plugins/share/public/url_service/redirect/util/format_search_params.ts", "deprecated": false, @@ -376,7 +384,16 @@ "label": "opts", "description": [], "signature": [ - "RedirectOptions" + { + "pluginId": "share", + "scope": "public", + "docId": "kibSharePluginApi", + "section": "def-public.RedirectOptions", + "text": "RedirectOptions" + }, + "<", + "SerializableRecord", + ">" ], "path": "src/plugins/share/public/url_service/redirect/util/format_search_params.ts", "deprecated": false, @@ -397,7 +414,16 @@ ], "signature": [ "(urlSearch: string) => ", - "RedirectOptions" + { + "pluginId": "share", + "scope": "public", + "docId": "kibSharePluginApi", + "section": "def-public.RedirectOptions", + "text": "RedirectOptions" + }, + "<", + "SerializableRecord", + ">" ], "path": "src/plugins/share/public/url_service/redirect/util/parse_search_params.ts", "deprecated": false, @@ -896,6 +922,68 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "share", + "id": "def-public.RedirectOptions", + "type": "Interface", + "tags": [], + "label": "RedirectOptions", + "description": [], + "signature": [ + { + "pluginId": "share", + "scope": "public", + "docId": "kibSharePluginApi", + "section": "def-public.RedirectOptions", + "text": "RedirectOptions" + }, + "

" + ], + "path": "src/plugins/share/public/url_service/redirect/redirect_manager.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "share", + "id": "def-public.RedirectOptions.id", + "type": "string", + "tags": [], + "label": "id", + "description": [ + "Locator ID." + ], + "path": "src/plugins/share/public/url_service/redirect/redirect_manager.ts", + "deprecated": false + }, + { + "parentPluginId": "share", + "id": "def-public.RedirectOptions.version", + "type": "string", + "tags": [], + "label": "version", + "description": [ + "Kibana version when locator params where generated." + ], + "path": "src/plugins/share/public/url_service/redirect/redirect_manager.ts", + "deprecated": false + }, + { + "parentPluginId": "share", + "id": "def-public.RedirectOptions.params", + "type": "Uncategorized", + "tags": [], + "label": "params", + "description": [ + "Locator params." + ], + "signature": [ + "P" + ], + "path": "src/plugins/share/public/url_service/redirect/redirect_manager.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "share", "id": "def-public.ShareContext", @@ -1737,8 +1825,16 @@ "; url: ", "UrlService", "; navigate(options: ", - "RedirectOptions", - "): void; }" + { + "pluginId": "share", + "scope": "public", + "docId": "kibSharePluginApi", + "section": "def-public.RedirectOptions", + "text": "RedirectOptions" + }, + "<", + "SerializableRecord", + ">): void; }" ], "path": "src/plugins/share/public/plugin.ts", "deprecated": false, @@ -1766,8 +1862,16 @@ "; url: ", "UrlService", "; navigate(options: ", - "RedirectOptions", - "): void; }" + { + "pluginId": "share", + "scope": "public", + "docId": "kibSharePluginApi", + "section": "def-public.RedirectOptions", + "text": "RedirectOptions" + }, + "<", + "SerializableRecord", + ">): void; }" ], "path": "src/plugins/share/public/plugin.ts", "deprecated": false, diff --git a/api_docs/share.mdx b/api_docs/share.mdx index 659218ce1d6a2..26f3b61dfa80b 100644 --- a/api_docs/share.mdx +++ b/api_docs/share.mdx @@ -10,7 +10,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex --- import shareObj from './share.json'; - +Adds URL Service and sharing capabilities to Kibana Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 126 | 1 | 86 | 8 | +| 130 | 1 | 87 | 7 | ## Client diff --git a/api_docs/spaces.json b/api_docs/spaces.json index 5aca604cf9784..cc1222240b1de 100644 --- a/api_docs/spaces.json +++ b/api_docs/spaces.json @@ -1173,7 +1173,7 @@ "children": [ { "parentPluginId": "spaces", - "id": "def-public.props", + "id": "def-public.SpacesApiUiComponent.getSpacesContextProvider.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -1212,7 +1212,7 @@ "children": [ { "parentPluginId": "spaces", - "id": "def-public.props", + "id": "def-public.SpacesApiUiComponent.getShareToSpaceFlyout.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -1251,7 +1251,7 @@ "children": [ { "parentPluginId": "spaces", - "id": "def-public.props", + "id": "def-public.SpacesApiUiComponent.getCopyToSpaceFlyout.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -1290,7 +1290,7 @@ "children": [ { "parentPluginId": "spaces", - "id": "def-public.props", + "id": "def-public.SpacesApiUiComponent.getSpaceList.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -1329,7 +1329,7 @@ "children": [ { "parentPluginId": "spaces", - "id": "def-public.props", + "id": "def-public.SpacesApiUiComponent.getLegacyUrlConflict.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -1368,7 +1368,7 @@ "children": [ { "parentPluginId": "spaces", - "id": "def-public.props", + "id": "def-public.SpacesApiUiComponent.getSpaceAvatar.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -1680,7 +1680,7 @@ "children": [ { "parentPluginId": "spaces", - "id": "def-public.props", + "id": "def-public.LazyComponentFn.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -3111,7 +3111,7 @@ "children": [ { "parentPluginId": "spaces", - "id": "def-server.request", + "id": "def-server.SpacesClientRepositoryFactory.$1", "type": "Object", "tags": [], "label": "request", @@ -3131,7 +3131,7 @@ }, { "parentPluginId": "spaces", - "id": "def-server.savedObjectsStart", + "id": "def-server.SpacesClientRepositoryFactory.$2", "type": "Object", "tags": [], "label": "savedObjectsStart", @@ -3194,7 +3194,7 @@ "children": [ { "parentPluginId": "spaces", - "id": "def-server.request", + "id": "def-server.SpacesClientWrapper.$1", "type": "Object", "tags": [], "label": "request", @@ -3214,7 +3214,7 @@ }, { "parentPluginId": "spaces", - "id": "def-server.baseClient", + "id": "def-server.SpacesClientWrapper.$2", "type": "Object", "tags": [], "label": "baseClient", diff --git a/api_docs/task_manager.json b/api_docs/task_manager.json index 6f37738e381e6..80f5318297581 100644 --- a/api_docs/task_manager.json +++ b/api_docs/task_manager.json @@ -150,7 +150,7 @@ }, { "parentPluginId": "taskManager", - "id": "def-server.TaskManagerPlugin.setup.$2.plugins", + "id": "def-server.TaskManagerPlugin.setup.$2", "type": "Object", "tags": [], "label": "plugins", @@ -160,7 +160,7 @@ "children": [ { "parentPluginId": "taskManager", - "id": "def-server.TaskManagerPlugin.setup.$2.plugins.usageCollection", + "id": "def-server.TaskManagerPlugin.setup.$2.usageCollection", "type": "Object", "tags": [], "label": "usageCollection", @@ -887,7 +887,7 @@ "children": [ { "parentPluginId": "taskManager", - "id": "def-server.context", + "id": "def-server.TaskRunCreatorFunction.$1", "type": "Object", "tags": [], "label": "context", diff --git a/api_docs/telemetry_collection_manager.json b/api_docs/telemetry_collection_manager.json index 2d59a5d7e482b..86bbef80c9af8 100644 --- a/api_docs/telemetry_collection_manager.json +++ b/api_docs/telemetry_collection_manager.json @@ -74,7 +74,7 @@ "signature": [ "Pick<", "KibanaClient", - ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"count\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + ", \"get\" | \"delete\" | \"create\" | \"index\" | \"update\" | \"closePointInTime\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"emit\" | \"on\" | \"once\" | \"off\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"count\" | \"danglingIndices\" | \"dataFrameTransformDeprecated\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", "TransportRequestParams", ", options?: ", "TransportRequestOptions", @@ -537,7 +537,7 @@ "children": [ { "parentPluginId": "telemetryCollectionManager", - "id": "def-server.config", + "id": "def-server.ClusterDetailsGetter.$1", "type": "Object", "tags": [], "label": "config", @@ -556,7 +556,7 @@ }, { "parentPluginId": "telemetryCollectionManager", - "id": "def-server.context", + "id": "def-server.ClusterDetailsGetter.$2", "type": "Object", "tags": [], "label": "context", @@ -616,7 +616,7 @@ "children": [ { "parentPluginId": "telemetryCollectionManager", - "id": "def-server.clustersDetails", + "id": "def-server.StatsGetter.$1", "type": "Array", "tags": [], "label": "clustersDetails", @@ -636,7 +636,7 @@ }, { "parentPluginId": "telemetryCollectionManager", - "id": "def-server.config", + "id": "def-server.StatsGetter.$2", "type": "Object", "tags": [], "label": "config", @@ -655,7 +655,7 @@ }, { "parentPluginId": "telemetryCollectionManager", - "id": "def-server.context", + "id": "def-server.StatsGetter.$3", "type": "Object", "tags": [], "label": "context", @@ -762,7 +762,7 @@ "children": [ { "parentPluginId": "telemetryCollectionManager", - "id": "def-server.optInStatus", + "id": "def-server.TelemetryCollectionManagerPluginSetup.getOptInStats.$1", "type": "boolean", "tags": [], "label": "optInStatus", @@ -772,7 +772,7 @@ }, { "parentPluginId": "telemetryCollectionManager", - "id": "def-server.config", + "id": "def-server.TelemetryCollectionManagerPluginSetup.getOptInStats.$2", "type": "CompoundType", "tags": [], "label": "config", @@ -865,7 +865,7 @@ "children": [ { "parentPluginId": "telemetryCollectionManager", - "id": "def-server.optInStatus", + "id": "def-server.TelemetryCollectionManagerPluginStart.getOptInStats.$1", "type": "boolean", "tags": [], "label": "optInStatus", @@ -875,7 +875,7 @@ }, { "parentPluginId": "telemetryCollectionManager", - "id": "def-server.config", + "id": "def-server.TelemetryCollectionManagerPluginStart.getOptInStats.$2", "type": "CompoundType", "tags": [], "label": "config", diff --git a/api_docs/timelines.json b/api_docs/timelines.json index 4a72336f8c13c..95eb212150fd0 100644 --- a/api_docs/timelines.json +++ b/api_docs/timelines.json @@ -117,7 +117,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.focusColumn.$1.colindexAttributecontainerElementariaColindexariaRowindexrowindexAttribute", + "id": "def-public.focusColumn.$1", "type": "Object", "tags": [], "label": "{\n colindexAttribute,\n containerElement,\n ariaColindex,\n ariaRowindex,\n rowindexAttribute,\n}", @@ -127,7 +127,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.focusColumn.$1.colindexAttributecontainerElementariaColindexariaRowindexrowindexAttribute.colindexAttribute", + "id": "def-public.focusColumn.$1.colindexAttribute", "type": "string", "tags": [], "label": "colindexAttribute", @@ -137,7 +137,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.focusColumn.$1.colindexAttributecontainerElementariaColindexariaRowindexrowindexAttribute.containerElement", + "id": "def-public.focusColumn.$1.containerElement", "type": "CompoundType", "tags": [], "label": "containerElement", @@ -150,7 +150,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.focusColumn.$1.colindexAttributecontainerElementariaColindexariaRowindexrowindexAttribute.ariaColindex", + "id": "def-public.focusColumn.$1.ariaColindex", "type": "number", "tags": [], "label": "ariaColindex", @@ -160,7 +160,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.focusColumn.$1.colindexAttributecontainerElementariaColindexariaRowindexrowindexAttribute.ariaRowindex", + "id": "def-public.focusColumn.$1.ariaRowindex", "type": "number", "tags": [], "label": "ariaRowindex", @@ -170,7 +170,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.focusColumn.$1.colindexAttributecontainerElementariaColindexariaRowindexrowindexAttribute.rowindexAttribute", + "id": "def-public.focusColumn.$1.rowindexAttribute", "type": "string", "tags": [], "label": "rowindexAttribute", @@ -201,7 +201,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.getFocusedAriaColindexCell.$1.containerElementtableClassName", + "id": "def-public.getFocusedAriaColindexCell.$1", "type": "Object", "tags": [], "label": "{\n containerElement,\n tableClassName,\n}", @@ -211,7 +211,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.getFocusedAriaColindexCell.$1.containerElementtableClassName.containerElement", + "id": "def-public.getFocusedAriaColindexCell.$1.containerElement", "type": "CompoundType", "tags": [], "label": "containerElement", @@ -224,7 +224,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.getFocusedAriaColindexCell.$1.containerElementtableClassName.tableClassName", + "id": "def-public.getFocusedAriaColindexCell.$1.tableClassName", "type": "string", "tags": [], "label": "tableClassName", @@ -255,7 +255,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.getFocusedDataColindexCell.$1.containerElementtableClassName", + "id": "def-public.getFocusedDataColindexCell.$1", "type": "Object", "tags": [], "label": "{\n containerElement,\n tableClassName,\n}", @@ -265,7 +265,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.getFocusedDataColindexCell.$1.containerElementtableClassName.containerElement", + "id": "def-public.getFocusedDataColindexCell.$1.containerElement", "type": "CompoundType", "tags": [], "label": "containerElement", @@ -278,7 +278,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.getFocusedDataColindexCell.$1.containerElementtableClassName.tableClassName", + "id": "def-public.getFocusedDataColindexCell.$1.tableClassName", "type": "string", "tags": [], "label": "tableClassName", @@ -323,6 +323,53 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "timelines", + "id": "def-public.getPageRowIndex", + "type": "Function", + "tags": [], + "label": "getPageRowIndex", + "description": [ + "\nrowIndex is bigger than `data.length` for pages with page numbers bigger than one.\nFor that reason, we must calculate `rowIndex % itemsPerPage`.\n\nEx:\nGiven `rowIndex` is `13` and `itemsPerPage` is `10`.\nIt means that the `activePage` is `2` and the `pageRowIndex` is `3`\n\n**Warning**:\nBe careful with array out of bounds. `pageRowIndex` can be bigger or equal to `data.length`\n in the scenario where the user changes the event status (Open, Acknowledged, Closed)." + ], + "signature": [ + "(rowIndex: number, itemsPerPage: number) => number" + ], + "path": "x-pack/plugins/timelines/common/utils/pagination.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "timelines", + "id": "def-public.getPageRowIndex.$1", + "type": "number", + "tags": [], + "label": "rowIndex", + "description": [], + "signature": [ + "number" + ], + "path": "x-pack/plugins/timelines/common/utils/pagination.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "timelines", + "id": "def-public.getPageRowIndex.$2", + "type": "number", + "tags": [], + "label": "itemsPerPage", + "description": [], + "signature": [ + "number" + ], + "path": "x-pack/plugins/timelines/common/utils/pagination.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "timelines", "id": "def-public.getRowRendererClassName", @@ -386,7 +433,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.getTableSkipFocus.$1.containerElementgetFocusedCellshiftKeytableHasFocustableClassName", + "id": "def-public.getTableSkipFocus.$1", "type": "Object", "tags": [], "label": "{\n containerElement,\n getFocusedCell,\n shiftKey,\n tableHasFocus,\n tableClassName,\n}", @@ -396,7 +443,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.getTableSkipFocus.$1.containerElementgetFocusedCellshiftKeytableHasFocustableClassName.containerElement", + "id": "def-public.getTableSkipFocus.$1.containerElement", "type": "CompoundType", "tags": [], "label": "containerElement", @@ -409,7 +456,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.getTableSkipFocus.$1.containerElementgetFocusedCellshiftKeytableHasFocustableClassName.getFocusedCell", + "id": "def-public.getTableSkipFocus.$1.getFocusedCell", "type": "Function", "tags": [], "label": "getFocusedCell", @@ -423,7 +470,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.__0", + "id": "def-public.getTableSkipFocus.$1.getFocusedCell.$1", "type": "Object", "tags": [], "label": "__0", @@ -438,7 +485,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.getTableSkipFocus.$1.containerElementgetFocusedCellshiftKeytableHasFocustableClassName.shiftKey", + "id": "def-public.getTableSkipFocus.$1.shiftKey", "type": "boolean", "tags": [], "label": "shiftKey", @@ -448,7 +495,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.getTableSkipFocus.$1.containerElementgetFocusedCellshiftKeytableHasFocustableClassName.tableHasFocus", + "id": "def-public.getTableSkipFocus.$1.tableHasFocus", "type": "Function", "tags": [], "label": "tableHasFocus", @@ -461,7 +508,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.getTableSkipFocus.$1.containerElementgetFocusedCellshiftKeytableHasFocustableClassName.tableHasFocus.$1", + "id": "def-public.getTableSkipFocus.$1.tableHasFocus.$1", "type": "CompoundType", "tags": [], "label": "containerElement", @@ -478,7 +525,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.getTableSkipFocus.$1.containerElementgetFocusedCellshiftKeytableHasFocustableClassName.tableClassName", + "id": "def-public.getTableSkipFocus.$1.tableClassName", "type": "string", "tags": [], "label": "tableClassName", @@ -548,7 +595,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.handleSkipFocus.$1.onSkipFocusBackwardsonSkipFocusForwardskipFocus", + "id": "def-public.handleSkipFocus.$1", "type": "Object", "tags": [], "label": "{\n onSkipFocusBackwards,\n onSkipFocusForward,\n skipFocus,\n}", @@ -558,7 +605,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.handleSkipFocus.$1.onSkipFocusBackwardsonSkipFocusForwardskipFocus.onSkipFocusBackwards", + "id": "def-public.handleSkipFocus.$1.onSkipFocusBackwards", "type": "Function", "tags": [], "label": "onSkipFocusBackwards", @@ -573,7 +620,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.handleSkipFocus.$1.onSkipFocusBackwardsonSkipFocusForwardskipFocus.onSkipFocusForward", + "id": "def-public.handleSkipFocus.$1.onSkipFocusForward", "type": "Function", "tags": [], "label": "onSkipFocusForward", @@ -588,7 +635,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.handleSkipFocus.$1.onSkipFocusBackwardsonSkipFocusForwardskipFocus.skipFocus", + "id": "def-public.handleSkipFocus.$1.skipFocus", "type": "CompoundType", "tags": [], "label": "skipFocus", @@ -795,7 +842,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.onKeyDownFocusHandler.$1.colindexAttributecontainerElementeventmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute", + "id": "def-public.onKeyDownFocusHandler.$1", "type": "Object", "tags": [], "label": "{\n colindexAttribute,\n containerElement,\n event,\n maxAriaColindex,\n maxAriaRowindex,\n onColumnFocused,\n rowindexAttribute,\n}", @@ -805,7 +852,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.onKeyDownFocusHandler.$1.colindexAttributecontainerElementeventmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.colindexAttribute", + "id": "def-public.onKeyDownFocusHandler.$1.colindexAttribute", "type": "string", "tags": [], "label": "colindexAttribute", @@ -815,7 +862,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.onKeyDownFocusHandler.$1.colindexAttributecontainerElementeventmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.containerElement", + "id": "def-public.onKeyDownFocusHandler.$1.containerElement", "type": "CompoundType", "tags": [], "label": "containerElement", @@ -828,7 +875,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.onKeyDownFocusHandler.$1.colindexAttributecontainerElementeventmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.event", + "id": "def-public.onKeyDownFocusHandler.$1.event", "type": "Object", "tags": [], "label": "event", @@ -841,7 +888,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.onKeyDownFocusHandler.$1.colindexAttributecontainerElementeventmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.maxAriaColindex", + "id": "def-public.onKeyDownFocusHandler.$1.maxAriaColindex", "type": "number", "tags": [], "label": "maxAriaColindex", @@ -851,7 +898,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.onKeyDownFocusHandler.$1.colindexAttributecontainerElementeventmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.maxAriaRowindex", + "id": "def-public.onKeyDownFocusHandler.$1.maxAriaRowindex", "type": "number", "tags": [], "label": "maxAriaRowindex", @@ -861,7 +908,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.onKeyDownFocusHandler.$1.colindexAttributecontainerElementeventmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.onColumnFocused", + "id": "def-public.onKeyDownFocusHandler.$1.onColumnFocused", "type": "Function", "tags": [], "label": "onColumnFocused", @@ -875,7 +922,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.__0", + "id": "def-public.onKeyDownFocusHandler.$1.onColumnFocused.$1", "type": "Object", "tags": [], "label": "__0", @@ -890,7 +937,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.onKeyDownFocusHandler.$1.colindexAttributecontainerElementeventmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.rowindexAttribute", + "id": "def-public.onKeyDownFocusHandler.$1.rowindexAttribute", "type": "string", "tags": [], "label": "rowindexAttribute", @@ -921,7 +968,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.skipFocusInContainerTo.$1.containerElementclassName", + "id": "def-public.skipFocusInContainerTo.$1", "type": "Object", "tags": [], "label": "{\n containerElement,\n className,\n}", @@ -931,7 +978,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.skipFocusInContainerTo.$1.containerElementclassName.containerElement", + "id": "def-public.skipFocusInContainerTo.$1.containerElement", "type": "CompoundType", "tags": [], "label": "containerElement", @@ -944,7 +991,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.skipFocusInContainerTo.$1.containerElementclassName.className", + "id": "def-public.skipFocusInContainerTo.$1.className", "type": "string", "tags": [], "label": "className", @@ -976,7 +1023,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.props", + "id": "def-public.StatefulFieldsBrowser.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -1056,7 +1103,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.state", + "id": "def-public.tGridReducer.$1", "type": "Uncategorized", "tags": [], "label": "state", @@ -1069,7 +1116,7 @@ }, { "parentPluginId": "timelines", - "id": "def-public.action", + "id": "def-public.tGridReducer.$2", "type": "Object", "tags": [], "label": "action", @@ -1091,7 +1138,7 @@ "label": "useStatusBulkActionItems", "description": [], "signature": [ - "({ eventIds, currentStatus, query, indexName, setEventsLoading, setEventsDeleted, onUpdateSuccess, onUpdateFailure, }: ", + "({ eventIds, currentStatus, query, indexName, setEventsLoading, setEventsDeleted, onUpdateSuccess, onUpdateFailure, timelineId, }: ", { "pluginId": "timelines", "scope": "common", @@ -1109,7 +1156,7 @@ "id": "def-public.useStatusBulkActionItems.$1", "type": "Object", "tags": [], - "label": "{\n eventIds,\n currentStatus,\n query,\n indexName,\n setEventsLoading,\n setEventsDeleted,\n onUpdateSuccess,\n onUpdateFailure,\n}", + "label": "{\n eventIds,\n currentStatus,\n query,\n indexName,\n setEventsLoading,\n setEventsDeleted,\n onUpdateSuccess,\n onUpdateFailure,\n timelineId,\n}", "description": [], "signature": [ { @@ -1546,7 +1593,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-public.__0", + "id": "def-public.OnColumnFocused.$1", "type": "Object", "tags": [], "label": "__0", @@ -1593,7 +1640,7 @@ "EuiDataGridColumn", ", \"id\" | \"display\" | \"displayAsText\" | \"initialWidth\"> & Pick<", "EuiDataGridColumn", - ", \"id\" | \"display\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", + ", \"id\" | \"schema\" | \"display\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", { "pluginId": "timelines", "scope": "common", @@ -1621,11 +1668,19 @@ "section": "def-common.SortColumnTimeline", "text": "SortColumnTimeline" }, - "[]; version: string | null; isLoading: boolean; dateRange: { start: string; end: string; }; defaultColumns: (Pick<", + "[]; version: string | null; isLoading: boolean; filterManager?: ", + { + "pluginId": "data", + "scope": "public", + "docId": "kibDataQueryPluginApi", + "section": "def-public.FilterManager", + "text": "FilterManager" + }, + " | undefined; dateRange: { start: string; end: string; }; defaultColumns: (Pick<", "EuiDataGridColumn", ", \"id\" | \"display\" | \"displayAsText\" | \"initialWidth\"> & Pick<", "EuiDataGridColumn", - ", \"id\" | \"display\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", + ", \"id\" | \"schema\" | \"display\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", { "pluginId": "timelines", "scope": "common", @@ -1643,7 +1698,7 @@ }, "; description?: string | undefined; example?: string | undefined; format?: string | undefined; linkField?: string | undefined; placeholder?: string | undefined; subType?: ", "IFieldSubType", - " | undefined; type?: string | undefined; })[]; savedObjectId: string | null; dataProviders: ", + " | undefined; type?: string | undefined; })[]; savedObjectId: string | null; unit?: ((n: number) => React.ReactNode) | undefined; dataProviders: ", { "pluginId": "timelines", "scope": "common", @@ -1651,7 +1706,7 @@ "section": "def-common.DataProvider", "text": "DataProvider" }, - "[]; deletedEventIds: string[]; excludedRowRendererIds: ", + "[]; deletedEventIds: string[]; documentType: string; excludedRowRendererIds: ", { "pluginId": "timelines", "scope": "common", @@ -1667,7 +1722,7 @@ "section": "def-common.TimelineExpandedDetail", "text": "TimelineExpandedDetail" }, - "; graphEventId?: string | undefined; kqlQuery: { filterQuery: ", + "; footerText?: React.ReactNode; graphEventId?: string | undefined; kqlQuery: { filterQuery: ", { "pluginId": "timelines", "scope": "common", @@ -1675,7 +1730,7 @@ "section": "def-common.SerializedFilterQuery", "text": "SerializedFilterQuery" }, - " | null; }; indexNames: string[]; isSelectAllChecked: boolean; itemsPerPage: number; itemsPerPageOptions: number[]; loadingEventIds: string[]; showCheckboxes: boolean; selectedEventIds: Record" + ], + "path": "x-pack/plugins/timelines/public/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "timelines", "id": "def-public.tGridActions", @@ -2306,7 +2377,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.focusColumn.$1.colindexAttributecontainerElementariaColindexariaRowindexrowindexAttribute", + "id": "def-common.focusColumn.$1", "type": "Object", "tags": [], "label": "{\n colindexAttribute,\n containerElement,\n ariaColindex,\n ariaRowindex,\n rowindexAttribute,\n}", @@ -2316,7 +2387,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.focusColumn.$1.colindexAttributecontainerElementariaColindexariaRowindexrowindexAttribute.colindexAttribute", + "id": "def-common.focusColumn.$1.colindexAttribute", "type": "string", "tags": [], "label": "colindexAttribute", @@ -2326,7 +2397,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.focusColumn.$1.colindexAttributecontainerElementariaColindexariaRowindexrowindexAttribute.containerElement", + "id": "def-common.focusColumn.$1.containerElement", "type": "CompoundType", "tags": [], "label": "containerElement", @@ -2339,7 +2410,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.focusColumn.$1.colindexAttributecontainerElementariaColindexariaRowindexrowindexAttribute.ariaColindex", + "id": "def-common.focusColumn.$1.ariaColindex", "type": "number", "tags": [], "label": "ariaColindex", @@ -2349,7 +2420,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.focusColumn.$1.colindexAttributecontainerElementariaColindexariaRowindexrowindexAttribute.ariaRowindex", + "id": "def-common.focusColumn.$1.ariaRowindex", "type": "number", "tags": [], "label": "ariaRowindex", @@ -2359,7 +2430,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.focusColumn.$1.colindexAttributecontainerElementariaColindexariaRowindexrowindexAttribute.rowindexAttribute", + "id": "def-common.focusColumn.$1.rowindexAttribute", "type": "string", "tags": [], "label": "rowindexAttribute", @@ -2423,7 +2494,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.focusedCellHasMoreFocusableChildren.$1.focusedCellshiftKey", + "id": "def-common.focusedCellHasMoreFocusableChildren.$1", "type": "Object", "tags": [], "label": "{\n focusedCell,\n shiftKey,\n}", @@ -2433,7 +2504,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.focusedCellHasMoreFocusableChildren.$1.focusedCellshiftKey.focusedCell", + "id": "def-common.focusedCellHasMoreFocusableChildren.$1.focusedCell", "type": "CompoundType", "tags": [], "label": "focusedCell", @@ -2446,7 +2517,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.focusedCellHasMoreFocusableChildren.$1.focusedCellshiftKey.shiftKey", + "id": "def-common.focusedCellHasMoreFocusableChildren.$1.shiftKey", "type": "boolean", "tags": [], "label": "shiftKey", @@ -2510,7 +2581,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getColindex.$1.colindexAttributeelement", + "id": "def-common.getColindex.$1", "type": "Object", "tags": [], "label": "{\n colindexAttribute,\n element,\n}", @@ -2520,7 +2591,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getColindex.$1.colindexAttributeelement.colindexAttribute", + "id": "def-common.getColindex.$1.colindexAttribute", "type": "string", "tags": [], "label": "colindexAttribute", @@ -2530,7 +2601,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getColindex.$1.colindexAttributeelement.element", + "id": "def-common.getColindex.$1.element", "type": "CompoundType", "tags": [], "label": "element", @@ -2564,7 +2635,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getElementWithMatchingAriaColindex.$1.ariaColindexcolindexAttributeelement", + "id": "def-common.getElementWithMatchingAriaColindex.$1", "type": "Object", "tags": [], "label": "{\n ariaColindex,\n colindexAttribute,\n element,\n}", @@ -2574,7 +2645,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getElementWithMatchingAriaColindex.$1.ariaColindexcolindexAttributeelement.ariaColindex", + "id": "def-common.getElementWithMatchingAriaColindex.$1.ariaColindex", "type": "number", "tags": [], "label": "ariaColindex", @@ -2584,7 +2655,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getElementWithMatchingAriaColindex.$1.ariaColindexcolindexAttributeelement.colindexAttribute", + "id": "def-common.getElementWithMatchingAriaColindex.$1.colindexAttribute", "type": "string", "tags": [], "label": "colindexAttribute", @@ -2594,7 +2665,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getElementWithMatchingAriaColindex.$1.ariaColindexcolindexAttributeelement.element", + "id": "def-common.getElementWithMatchingAriaColindex.$1.element", "type": "CompoundType", "tags": [], "label": "element", @@ -2626,7 +2697,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getFirstNonVisibleAriaRowindex.$1.focusedAriaRowindexelementeventmaxAriaRowindexrowindexAttribute", + "id": "def-common.getFirstNonVisibleAriaRowindex.$1", "type": "Object", "tags": [], "label": "{\n focusedAriaRowindex,\n element,\n event,\n maxAriaRowindex,\n rowindexAttribute,\n}", @@ -2636,7 +2707,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getFirstNonVisibleAriaRowindex.$1.focusedAriaRowindexelementeventmaxAriaRowindexrowindexAttribute.focusedAriaRowindex", + "id": "def-common.getFirstNonVisibleAriaRowindex.$1.focusedAriaRowindex", "type": "number", "tags": [], "label": "focusedAriaRowindex", @@ -2646,7 +2717,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getFirstNonVisibleAriaRowindex.$1.focusedAriaRowindexelementeventmaxAriaRowindexrowindexAttribute.element", + "id": "def-common.getFirstNonVisibleAriaRowindex.$1.element", "type": "CompoundType", "tags": [], "label": "element", @@ -2659,7 +2730,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getFirstNonVisibleAriaRowindex.$1.focusedAriaRowindexelementeventmaxAriaRowindexrowindexAttribute.event", + "id": "def-common.getFirstNonVisibleAriaRowindex.$1.event", "type": "Object", "tags": [], "label": "event", @@ -2672,7 +2743,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getFirstNonVisibleAriaRowindex.$1.focusedAriaRowindexelementeventmaxAriaRowindexrowindexAttribute.maxAriaRowindex", + "id": "def-common.getFirstNonVisibleAriaRowindex.$1.maxAriaRowindex", "type": "number", "tags": [], "label": "maxAriaRowindex", @@ -2682,7 +2753,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getFirstNonVisibleAriaRowindex.$1.focusedAriaRowindexelementeventmaxAriaRowindexrowindexAttribute.rowindexAttribute", + "id": "def-common.getFirstNonVisibleAriaRowindex.$1.rowindexAttribute", "type": "string", "tags": [], "label": "rowindexAttribute", @@ -2713,7 +2784,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getFirstOrLastAriaRowindex.$1.eventmaxAriaRowindex", + "id": "def-common.getFirstOrLastAriaRowindex.$1", "type": "Object", "tags": [], "label": "{\n event,\n maxAriaRowindex,\n}", @@ -2723,7 +2794,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getFirstOrLastAriaRowindex.$1.eventmaxAriaRowindex.event", + "id": "def-common.getFirstOrLastAriaRowindex.$1.event", "type": "Object", "tags": [], "label": "event", @@ -2736,7 +2807,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getFirstOrLastAriaRowindex.$1.eventmaxAriaRowindex.maxAriaRowindex", + "id": "def-common.getFirstOrLastAriaRowindex.$1.maxAriaRowindex", "type": "number", "tags": [], "label": "maxAriaRowindex", @@ -2808,7 +2879,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getFocusedAriaColindexCell.$1.containerElementtableClassName", + "id": "def-common.getFocusedAriaColindexCell.$1", "type": "Object", "tags": [], "label": "{\n containerElement,\n tableClassName,\n}", @@ -2818,7 +2889,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getFocusedAriaColindexCell.$1.containerElementtableClassName.containerElement", + "id": "def-common.getFocusedAriaColindexCell.$1.containerElement", "type": "CompoundType", "tags": [], "label": "containerElement", @@ -2831,7 +2902,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getFocusedAriaColindexCell.$1.containerElementtableClassName.tableClassName", + "id": "def-common.getFocusedAriaColindexCell.$1.tableClassName", "type": "string", "tags": [], "label": "tableClassName", @@ -2862,7 +2933,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getFocusedColumn.$1.colindexAttributeelement", + "id": "def-common.getFocusedColumn.$1", "type": "Object", "tags": [], "label": "{\n colindexAttribute,\n element,\n}", @@ -2872,7 +2943,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getFocusedColumn.$1.colindexAttributeelement.colindexAttribute", + "id": "def-common.getFocusedColumn.$1.colindexAttribute", "type": "string", "tags": [], "label": "colindexAttribute", @@ -2882,7 +2953,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getFocusedColumn.$1.colindexAttributeelement.element", + "id": "def-common.getFocusedColumn.$1.element", "type": "CompoundType", "tags": [], "label": "element", @@ -2916,7 +2987,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getFocusedDataColindexCell.$1.containerElementtableClassName", + "id": "def-common.getFocusedDataColindexCell.$1", "type": "Object", "tags": [], "label": "{\n containerElement,\n tableClassName,\n}", @@ -2926,7 +2997,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getFocusedDataColindexCell.$1.containerElementtableClassName.containerElement", + "id": "def-common.getFocusedDataColindexCell.$1.containerElement", "type": "CompoundType", "tags": [], "label": "containerElement", @@ -2939,7 +3010,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getFocusedDataColindexCell.$1.containerElementtableClassName.tableClassName", + "id": "def-common.getFocusedDataColindexCell.$1.tableClassName", "type": "string", "tags": [], "label": "tableClassName", @@ -2970,7 +3041,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getFocusedRow.$1.rowindexAttributeelement", + "id": "def-common.getFocusedRow.$1", "type": "Object", "tags": [], "label": "{\n rowindexAttribute,\n element,\n}", @@ -2980,7 +3051,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getFocusedRow.$1.rowindexAttributeelement.rowindexAttribute", + "id": "def-common.getFocusedRow.$1.rowindexAttribute", "type": "string", "tags": [], "label": "rowindexAttribute", @@ -2990,7 +3061,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getFocusedRow.$1.rowindexAttributeelement.element", + "id": "def-common.getFocusedRow.$1.element", "type": "CompoundType", "tags": [], "label": "element", @@ -3057,7 +3128,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getNewAriaColindex.$1.focusedAriaColindexfocusOnmaxAriaColindex", + "id": "def-common.getNewAriaColindex.$1", "type": "Object", "tags": [], "label": "{\n focusedAriaColindex,\n focusOn,\n maxAriaColindex,\n}", @@ -3067,7 +3138,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getNewAriaColindex.$1.focusedAriaColindexfocusOnmaxAriaColindex.focusedAriaColindex", + "id": "def-common.getNewAriaColindex.$1.focusedAriaColindex", "type": "number", "tags": [], "label": "focusedAriaColindex", @@ -3077,7 +3148,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getNewAriaColindex.$1.focusedAriaColindexfocusOnmaxAriaColindex.focusOn", + "id": "def-common.getNewAriaColindex.$1.focusOn", "type": "CompoundType", "tags": [], "label": "focusOn", @@ -3090,7 +3161,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getNewAriaColindex.$1.focusedAriaColindexfocusOnmaxAriaColindex.maxAriaColindex", + "id": "def-common.getNewAriaColindex.$1.maxAriaColindex", "type": "number", "tags": [], "label": "maxAriaColindex", @@ -3121,7 +3192,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getNewAriaRowindex.$1.focusedAriaRowindexfocusOnmaxAriaRowindex", + "id": "def-common.getNewAriaRowindex.$1", "type": "Object", "tags": [], "label": "{\n focusedAriaRowindex,\n focusOn,\n maxAriaRowindex,\n}", @@ -3131,7 +3202,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getNewAriaRowindex.$1.focusedAriaRowindexfocusOnmaxAriaRowindex.focusedAriaRowindex", + "id": "def-common.getNewAriaRowindex.$1.focusedAriaRowindex", "type": "number", "tags": [], "label": "focusedAriaRowindex", @@ -3141,7 +3212,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getNewAriaRowindex.$1.focusedAriaRowindexfocusOnmaxAriaRowindex.focusOn", + "id": "def-common.getNewAriaRowindex.$1.focusOn", "type": "CompoundType", "tags": [], "label": "focusOn", @@ -3154,7 +3225,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getNewAriaRowindex.$1.focusedAriaRowindexfocusOnmaxAriaRowindex.maxAriaRowindex", + "id": "def-common.getNewAriaRowindex.$1.maxAriaRowindex", "type": "number", "tags": [], "label": "maxAriaRowindex", @@ -3216,7 +3287,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getRowByAriaRowindex.$1.ariaRowindexelementrowindexAttribute", + "id": "def-common.getRowByAriaRowindex.$1", "type": "Object", "tags": [], "label": "{\n ariaRowindex,\n element,\n rowindexAttribute,\n}", @@ -3226,7 +3297,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getRowByAriaRowindex.$1.ariaRowindexelementrowindexAttribute.ariaRowindex", + "id": "def-common.getRowByAriaRowindex.$1.ariaRowindex", "type": "number", "tags": [], "label": "ariaRowindex", @@ -3236,7 +3307,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getRowByAriaRowindex.$1.ariaRowindexelementrowindexAttribute.element", + "id": "def-common.getRowByAriaRowindex.$1.element", "type": "CompoundType", "tags": [], "label": "element", @@ -3249,7 +3320,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getRowByAriaRowindex.$1.ariaRowindexelementrowindexAttribute.rowindexAttribute", + "id": "def-common.getRowByAriaRowindex.$1.rowindexAttribute", "type": "string", "tags": [], "label": "rowindexAttribute", @@ -3280,7 +3351,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getRowindex.$1.rowindexAttributeelement", + "id": "def-common.getRowindex.$1", "type": "Object", "tags": [], "label": "{\n rowindexAttribute,\n element,\n}", @@ -3290,7 +3361,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getRowindex.$1.rowindexAttributeelement.rowindexAttribute", + "id": "def-common.getRowindex.$1.rowindexAttribute", "type": "string", "tags": [], "label": "rowindexAttribute", @@ -3300,7 +3371,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getRowindex.$1.rowindexAttributeelement.element", + "id": "def-common.getRowindex.$1.element", "type": "CompoundType", "tags": [], "label": "element", @@ -3380,7 +3451,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getTableSkipFocus.$1.containerElementgetFocusedCellshiftKeytableHasFocustableClassName", + "id": "def-common.getTableSkipFocus.$1", "type": "Object", "tags": [], "label": "{\n containerElement,\n getFocusedCell,\n shiftKey,\n tableHasFocus,\n tableClassName,\n}", @@ -3390,7 +3461,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getTableSkipFocus.$1.containerElementgetFocusedCellshiftKeytableHasFocustableClassName.containerElement", + "id": "def-common.getTableSkipFocus.$1.containerElement", "type": "CompoundType", "tags": [], "label": "containerElement", @@ -3403,7 +3474,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getTableSkipFocus.$1.containerElementgetFocusedCellshiftKeytableHasFocustableClassName.getFocusedCell", + "id": "def-common.getTableSkipFocus.$1.getFocusedCell", "type": "Function", "tags": [], "label": "getFocusedCell", @@ -3417,7 +3488,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.__0", + "id": "def-common.getTableSkipFocus.$1.getFocusedCell.$1", "type": "Object", "tags": [], "label": "__0", @@ -3432,7 +3503,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getTableSkipFocus.$1.containerElementgetFocusedCellshiftKeytableHasFocustableClassName.shiftKey", + "id": "def-common.getTableSkipFocus.$1.shiftKey", "type": "boolean", "tags": [], "label": "shiftKey", @@ -3442,7 +3513,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getTableSkipFocus.$1.containerElementgetFocusedCellshiftKeytableHasFocustableClassName.tableHasFocus", + "id": "def-common.getTableSkipFocus.$1.tableHasFocus", "type": "Function", "tags": [], "label": "tableHasFocus", @@ -3455,7 +3526,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.getTableSkipFocus.$1.containerElementgetFocusedCellshiftKeytableHasFocustableClassName.tableHasFocus.$1", + "id": "def-common.getTableSkipFocus.$1.tableHasFocus.$1", "type": "CompoundType", "tags": [], "label": "containerElement", @@ -3472,7 +3543,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.getTableSkipFocus.$1.containerElementgetFocusedCellshiftKeytableHasFocustableClassName.tableClassName", + "id": "def-common.getTableSkipFocus.$1.tableClassName", "type": "string", "tags": [], "label": "tableClassName", @@ -3556,7 +3627,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.handleSkipFocus.$1.onSkipFocusBackwardsonSkipFocusForwardskipFocus", + "id": "def-common.handleSkipFocus.$1", "type": "Object", "tags": [], "label": "{\n onSkipFocusBackwards,\n onSkipFocusForward,\n skipFocus,\n}", @@ -3566,7 +3637,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.handleSkipFocus.$1.onSkipFocusBackwardsonSkipFocusForwardskipFocus.onSkipFocusBackwards", + "id": "def-common.handleSkipFocus.$1.onSkipFocusBackwards", "type": "Function", "tags": [], "label": "onSkipFocusBackwards", @@ -3581,7 +3652,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.handleSkipFocus.$1.onSkipFocusBackwardsonSkipFocusForwardskipFocus.onSkipFocusForward", + "id": "def-common.handleSkipFocus.$1.onSkipFocusForward", "type": "Function", "tags": [], "label": "onSkipFocusForward", @@ -3596,7 +3667,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.handleSkipFocus.$1.onSkipFocusBackwardsonSkipFocusForwardskipFocus.skipFocus", + "id": "def-common.handleSkipFocus.$1.skipFocus", "type": "CompoundType", "tags": [], "label": "skipFocus", @@ -4176,7 +4247,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.onArrowKeyDown.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute", + "id": "def-common.onArrowKeyDown.$1", "type": "Object", "tags": [], "label": "{\n colindexAttribute,\n containerElement,\n event,\n focusedAriaColindex,\n focusedAriaRowindex,\n maxAriaColindex,\n maxAriaRowindex,\n onColumnFocused,\n rowindexAttribute,\n}", @@ -4186,7 +4257,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.onArrowKeyDown.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.colindexAttribute", + "id": "def-common.onArrowKeyDown.$1.colindexAttribute", "type": "string", "tags": [], "label": "colindexAttribute", @@ -4196,7 +4267,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onArrowKeyDown.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.containerElement", + "id": "def-common.onArrowKeyDown.$1.containerElement", "type": "CompoundType", "tags": [], "label": "containerElement", @@ -4209,7 +4280,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onArrowKeyDown.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.event", + "id": "def-common.onArrowKeyDown.$1.event", "type": "Object", "tags": [], "label": "event", @@ -4222,7 +4293,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onArrowKeyDown.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.focusedAriaColindex", + "id": "def-common.onArrowKeyDown.$1.focusedAriaColindex", "type": "number", "tags": [], "label": "focusedAriaColindex", @@ -4232,7 +4303,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onArrowKeyDown.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.focusedAriaRowindex", + "id": "def-common.onArrowKeyDown.$1.focusedAriaRowindex", "type": "number", "tags": [], "label": "focusedAriaRowindex", @@ -4242,7 +4313,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onArrowKeyDown.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.maxAriaColindex", + "id": "def-common.onArrowKeyDown.$1.maxAriaColindex", "type": "number", "tags": [], "label": "maxAriaColindex", @@ -4252,7 +4323,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onArrowKeyDown.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.maxAriaRowindex", + "id": "def-common.onArrowKeyDown.$1.maxAriaRowindex", "type": "number", "tags": [], "label": "maxAriaRowindex", @@ -4262,7 +4333,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onArrowKeyDown.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.onColumnFocused", + "id": "def-common.onArrowKeyDown.$1.onColumnFocused", "type": "Function", "tags": [], "label": "onColumnFocused", @@ -4282,7 +4353,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onArrowKeyDown.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.rowindexAttribute", + "id": "def-common.onArrowKeyDown.$1.rowindexAttribute", "type": "string", "tags": [], "label": "rowindexAttribute", @@ -4354,7 +4425,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.onHomeEndDown.$1.colindexAttributecontainerElementeventfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute", + "id": "def-common.onHomeEndDown.$1", "type": "Object", "tags": [], "label": "{\n colindexAttribute,\n containerElement,\n event,\n focusedAriaRowindex,\n maxAriaColindex,\n maxAriaRowindex,\n onColumnFocused,\n rowindexAttribute,\n}", @@ -4364,7 +4435,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.onHomeEndDown.$1.colindexAttributecontainerElementeventfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.colindexAttribute", + "id": "def-common.onHomeEndDown.$1.colindexAttribute", "type": "string", "tags": [], "label": "colindexAttribute", @@ -4374,7 +4445,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onHomeEndDown.$1.colindexAttributecontainerElementeventfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.containerElement", + "id": "def-common.onHomeEndDown.$1.containerElement", "type": "CompoundType", "tags": [], "label": "containerElement", @@ -4387,7 +4458,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onHomeEndDown.$1.colindexAttributecontainerElementeventfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.event", + "id": "def-common.onHomeEndDown.$1.event", "type": "Object", "tags": [], "label": "event", @@ -4400,7 +4471,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onHomeEndDown.$1.colindexAttributecontainerElementeventfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.focusedAriaRowindex", + "id": "def-common.onHomeEndDown.$1.focusedAriaRowindex", "type": "number", "tags": [], "label": "focusedAriaRowindex", @@ -4410,7 +4481,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onHomeEndDown.$1.colindexAttributecontainerElementeventfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.maxAriaColindex", + "id": "def-common.onHomeEndDown.$1.maxAriaColindex", "type": "number", "tags": [], "label": "maxAriaColindex", @@ -4420,7 +4491,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onHomeEndDown.$1.colindexAttributecontainerElementeventfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.maxAriaRowindex", + "id": "def-common.onHomeEndDown.$1.maxAriaRowindex", "type": "number", "tags": [], "label": "maxAriaRowindex", @@ -4430,7 +4501,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onHomeEndDown.$1.colindexAttributecontainerElementeventfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.onColumnFocused", + "id": "def-common.onHomeEndDown.$1.onColumnFocused", "type": "Function", "tags": [], "label": "onColumnFocused", @@ -4450,7 +4521,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onHomeEndDown.$1.colindexAttributecontainerElementeventfocusedAriaRowindexmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.rowindexAttribute", + "id": "def-common.onHomeEndDown.$1.rowindexAttribute", "type": "string", "tags": [], "label": "rowindexAttribute", @@ -4489,7 +4560,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.onKeyDownFocusHandler.$1.colindexAttributecontainerElementeventmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute", + "id": "def-common.onKeyDownFocusHandler.$1", "type": "Object", "tags": [], "label": "{\n colindexAttribute,\n containerElement,\n event,\n maxAriaColindex,\n maxAriaRowindex,\n onColumnFocused,\n rowindexAttribute,\n}", @@ -4499,7 +4570,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.onKeyDownFocusHandler.$1.colindexAttributecontainerElementeventmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.colindexAttribute", + "id": "def-common.onKeyDownFocusHandler.$1.colindexAttribute", "type": "string", "tags": [], "label": "colindexAttribute", @@ -4509,7 +4580,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onKeyDownFocusHandler.$1.colindexAttributecontainerElementeventmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.containerElement", + "id": "def-common.onKeyDownFocusHandler.$1.containerElement", "type": "CompoundType", "tags": [], "label": "containerElement", @@ -4522,7 +4593,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onKeyDownFocusHandler.$1.colindexAttributecontainerElementeventmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.event", + "id": "def-common.onKeyDownFocusHandler.$1.event", "type": "Object", "tags": [], "label": "event", @@ -4535,7 +4606,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onKeyDownFocusHandler.$1.colindexAttributecontainerElementeventmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.maxAriaColindex", + "id": "def-common.onKeyDownFocusHandler.$1.maxAriaColindex", "type": "number", "tags": [], "label": "maxAriaColindex", @@ -4545,7 +4616,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onKeyDownFocusHandler.$1.colindexAttributecontainerElementeventmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.maxAriaRowindex", + "id": "def-common.onKeyDownFocusHandler.$1.maxAriaRowindex", "type": "number", "tags": [], "label": "maxAriaRowindex", @@ -4555,7 +4626,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onKeyDownFocusHandler.$1.colindexAttributecontainerElementeventmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.onColumnFocused", + "id": "def-common.onKeyDownFocusHandler.$1.onColumnFocused", "type": "Function", "tags": [], "label": "onColumnFocused", @@ -4569,7 +4640,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.__0", + "id": "def-common.onKeyDownFocusHandler.$1.onColumnFocused.$1", "type": "Object", "tags": [], "label": "__0", @@ -4584,7 +4655,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onKeyDownFocusHandler.$1.colindexAttributecontainerElementeventmaxAriaColindexmaxAriaRowindexonColumnFocusedrowindexAttribute.rowindexAttribute", + "id": "def-common.onKeyDownFocusHandler.$1.rowindexAttribute", "type": "string", "tags": [], "label": "rowindexAttribute", @@ -4623,7 +4694,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.onPageDownOrPageUp.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaRowindexonColumnFocusedrowindexAttribute", + "id": "def-common.onPageDownOrPageUp.$1", "type": "Object", "tags": [], "label": "{\n colindexAttribute,\n containerElement,\n event,\n focusedAriaColindex,\n focusedAriaRowindex,\n maxAriaRowindex,\n onColumnFocused,\n rowindexAttribute,\n}", @@ -4633,7 +4704,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.onPageDownOrPageUp.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaRowindexonColumnFocusedrowindexAttribute.colindexAttribute", + "id": "def-common.onPageDownOrPageUp.$1.colindexAttribute", "type": "string", "tags": [], "label": "colindexAttribute", @@ -4643,7 +4714,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onPageDownOrPageUp.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaRowindexonColumnFocusedrowindexAttribute.containerElement", + "id": "def-common.onPageDownOrPageUp.$1.containerElement", "type": "CompoundType", "tags": [], "label": "containerElement", @@ -4656,7 +4727,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onPageDownOrPageUp.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaRowindexonColumnFocusedrowindexAttribute.event", + "id": "def-common.onPageDownOrPageUp.$1.event", "type": "Object", "tags": [], "label": "event", @@ -4669,7 +4740,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onPageDownOrPageUp.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaRowindexonColumnFocusedrowindexAttribute.focusedAriaColindex", + "id": "def-common.onPageDownOrPageUp.$1.focusedAriaColindex", "type": "number", "tags": [], "label": "focusedAriaColindex", @@ -4679,7 +4750,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onPageDownOrPageUp.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaRowindexonColumnFocusedrowindexAttribute.focusedAriaRowindex", + "id": "def-common.onPageDownOrPageUp.$1.focusedAriaRowindex", "type": "number", "tags": [], "label": "focusedAriaRowindex", @@ -4689,7 +4760,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onPageDownOrPageUp.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaRowindexonColumnFocusedrowindexAttribute.maxAriaRowindex", + "id": "def-common.onPageDownOrPageUp.$1.maxAriaRowindex", "type": "number", "tags": [], "label": "maxAriaRowindex", @@ -4699,7 +4770,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onPageDownOrPageUp.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaRowindexonColumnFocusedrowindexAttribute.onColumnFocused", + "id": "def-common.onPageDownOrPageUp.$1.onColumnFocused", "type": "Function", "tags": [], "label": "onColumnFocused", @@ -4719,7 +4790,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.onPageDownOrPageUp.$1.colindexAttributecontainerElementeventfocusedAriaColindexfocusedAriaRowindexmaxAriaRowindexonColumnFocusedrowindexAttribute.rowindexAttribute", + "id": "def-common.onPageDownOrPageUp.$1.rowindexAttribute", "type": "string", "tags": [], "label": "rowindexAttribute", @@ -4750,7 +4821,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.skipFocusInContainerTo.$1.containerElementclassName", + "id": "def-common.skipFocusInContainerTo.$1", "type": "Object", "tags": [], "label": "{\n containerElement,\n className,\n}", @@ -4760,7 +4831,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.skipFocusInContainerTo.$1.containerElementclassName.containerElement", + "id": "def-common.skipFocusInContainerTo.$1.containerElement", "type": "CompoundType", "tags": [], "label": "containerElement", @@ -4773,7 +4844,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.skipFocusInContainerTo.$1.containerElementclassName.className", + "id": "def-common.skipFocusInContainerTo.$1.className", "type": "string", "tags": [], "label": "className", @@ -4832,16 +4903,6 @@ "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false, "children": [ - { - "parentPluginId": "timelines", - "id": "def-common.ActionProps.ariaRowindex", - "type": "number", - "tags": [], - "label": "ariaRowindex", - "description": [], - "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false - }, { "parentPluginId": "timelines", "id": "def-common.ActionProps.action", @@ -4897,14 +4958,21 @@ }, { "parentPluginId": "timelines", - "id": "def-common.ActionProps.width", + "id": "def-common.ActionProps.ariaRowindex", "type": "number", "tags": [], - "label": "width", + "label": "ariaRowindex", + "description": [], + "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-common.ActionProps.checked", + "type": "boolean", + "tags": [], + "label": "checked", "description": [], - "signature": [ - "number | undefined" - ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false }, @@ -4930,42 +4998,49 @@ }, { "parentPluginId": "timelines", - "id": "def-common.ActionProps.checked", - "type": "boolean", + "id": "def-common.ActionProps.data", + "type": "Array", "tags": [], - "label": "checked", + "label": "data", "description": [], + "signature": [ + { + "pluginId": "timelines", + "scope": "common", + "docId": "kibTimelinesPluginApi", + "section": "def-common.TimelineNonEcsData", + "text": "TimelineNonEcsData" + }, + "[]" + ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false }, { "parentPluginId": "timelines", - "id": "def-common.ActionProps.onRowSelected", - "type": "Function", + "id": "def-common.ActionProps.disabled", + "type": "CompoundType", "tags": [], - "label": "onRowSelected", + "label": "disabled", "description": [], "signature": [ - "({ eventIds, isSelected, }: { eventIds: string[]; isSelected: boolean; }) => void" + "boolean | undefined" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "timelines", - "id": "def-common.__0", - "type": "Object", - "tags": [], - "label": "__0", - "description": [], - "signature": [ - "{ eventIds: string[]; isSelected: boolean; }" - ], - "path": "x-pack/plugins/timelines/common/types/timeline/store.ts", - "deprecated": false - } - ] + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-common.ActionProps.ecsData", + "type": "Object", + "tags": [], + "label": "ecsData", + "description": [], + "signature": [ + "Ecs" + ], + "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", + "deprecated": false }, { "parentPluginId": "timelines", @@ -4979,123 +5054,139 @@ }, { "parentPluginId": "timelines", - "id": "def-common.ActionProps.loadingEventIds", + "id": "def-common.ActionProps.eventIdToNoteIds", "type": "Object", "tags": [], - "label": "loadingEventIds", + "label": "eventIdToNoteIds", "description": [], "signature": [ - "readonly string[]" + "Readonly> | undefined" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false }, { "parentPluginId": "timelines", - "id": "def-common.ActionProps.onEventDetailsPanelOpened", - "type": "Function", + "id": "def-common.ActionProps.index", + "type": "number", "tags": [], - "label": "onEventDetailsPanelOpened", + "label": "index", "description": [], - "signature": [ - "() => void" - ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "deprecated": false }, { "parentPluginId": "timelines", - "id": "def-common.ActionProps.showCheckboxes", - "type": "boolean", + "id": "def-common.ActionProps.isEventPinned", + "type": "CompoundType", "tags": [], - "label": "showCheckboxes", + "label": "isEventPinned", "description": [], + "signature": [ + "boolean | undefined" + ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false }, { "parentPluginId": "timelines", - "id": "def-common.ActionProps.data", - "type": "Array", + "id": "def-common.ActionProps.isEventViewer", + "type": "CompoundType", "tags": [], - "label": "data", + "label": "isEventViewer", "description": [], "signature": [ - { - "pluginId": "timelines", - "scope": "common", - "docId": "kibTimelinesPluginApi", - "section": "def-common.TimelineNonEcsData", - "text": "TimelineNonEcsData" - }, - "[]" + "boolean | undefined" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false }, { "parentPluginId": "timelines", - "id": "def-common.ActionProps.ecsData", + "id": "def-common.ActionProps.loadingEventIds", "type": "Object", "tags": [], - "label": "ecsData", + "label": "loadingEventIds", "description": [], "signature": [ - "Ecs" + "readonly string[]" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false }, { "parentPluginId": "timelines", - "id": "def-common.ActionProps.index", - "type": "number", + "id": "def-common.ActionProps.onEventDetailsPanelOpened", + "type": "Function", "tags": [], - "label": "index", + "label": "onEventDetailsPanelOpened", "description": [], + "signature": [ + "() => void" + ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false + "deprecated": false, + "children": [], + "returnComment": [] }, { "parentPluginId": "timelines", - "id": "def-common.ActionProps.eventIdToNoteIds", - "type": "Object", + "id": "def-common.ActionProps.onRowSelected", + "type": "Function", "tags": [], - "label": "eventIdToNoteIds", + "label": "onRowSelected", "description": [], "signature": [ - "Readonly> | undefined" + "({ eventIds, isSelected, }: { eventIds: string[]; isSelected: boolean; }) => void" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "timelines", + "id": "def-common.ActionProps.onRowSelected.$1", + "type": "Object", + "tags": [], + "label": "__0", + "description": [], + "signature": [ + "{ eventIds: string[]; isSelected: boolean; }" + ], + "path": "x-pack/plugins/timelines/common/types/timeline/store.ts", + "deprecated": false + } + ] }, { "parentPluginId": "timelines", - "id": "def-common.ActionProps.isEventPinned", - "type": "CompoundType", + "id": "def-common.ActionProps.onRuleChange", + "type": "Function", "tags": [], - "label": "isEventPinned", + "label": "onRuleChange", "description": [], "signature": [ - "boolean | undefined" + "(() => void) | undefined" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false + "deprecated": false, + "children": [], + "returnComment": [] }, { "parentPluginId": "timelines", - "id": "def-common.ActionProps.isEventViewer", - "type": "CompoundType", + "id": "def-common.ActionProps.refetch", + "type": "Function", "tags": [], - "label": "isEventViewer", + "label": "refetch", "description": [], "signature": [ - "boolean | undefined" + "(() => void) | undefined" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false + "deprecated": false, + "children": [], + "returnComment": [] }, { "parentPluginId": "timelines", @@ -5109,13 +5200,13 @@ }, { "parentPluginId": "timelines", - "id": "def-common.ActionProps.setEventsLoading", + "id": "def-common.ActionProps.setEventsDeleted", "type": "Function", "tags": [], - "label": "setEventsLoading", + "label": "setEventsDeleted", "description": [], "signature": [ - "(params: { eventIds: string[]; isLoading: boolean; }) => void" + "(params: { eventIds: string[]; isDeleted: boolean; }) => void" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false, @@ -5123,13 +5214,13 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.params", + "id": "def-common.ActionProps.setEventsDeleted.$1", "type": "Object", "tags": [], "label": "params", "description": [], "signature": [ - "{ eventIds: string[]; isLoading: boolean; }" + "{ eventIds: string[]; isDeleted: boolean; }" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false @@ -5138,13 +5229,13 @@ }, { "parentPluginId": "timelines", - "id": "def-common.ActionProps.setEventsDeleted", + "id": "def-common.ActionProps.setEventsLoading", "type": "Function", "tags": [], - "label": "setEventsDeleted", + "label": "setEventsLoading", "description": [], "signature": [ - "(params: { eventIds: string[]; isDeleted: boolean; }) => void" + "(params: { eventIds: string[]; isLoading: boolean; }) => void" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false, @@ -5152,13 +5243,13 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.params", + "id": "def-common.ActionProps.setEventsLoading.$1", "type": "Object", "tags": [], "label": "params", "description": [], "signature": [ - "{ eventIds: string[]; isDeleted: boolean; }" + "{ eventIds: string[]; isLoading: boolean; }" ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false @@ -5167,33 +5258,13 @@ }, { "parentPluginId": "timelines", - "id": "def-common.ActionProps.refetch", - "type": "Function", - "tags": [], - "label": "refetch", - "description": [], - "signature": [ - "(() => void) | undefined" - ], - "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "timelines", - "id": "def-common.ActionProps.onRuleChange", - "type": "Function", + "id": "def-common.ActionProps.showCheckboxes", + "type": "boolean", "tags": [], - "label": "onRuleChange", + "label": "showCheckboxes", "description": [], - "signature": [ - "(() => void) | undefined" - ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", - "deprecated": false, - "children": [], - "returnComment": [] + "deprecated": false }, { "parentPluginId": "timelines", @@ -5252,6 +5323,19 @@ "deprecated": false, "children": [], "returnComment": [] + }, + { + "parentPluginId": "timelines", + "id": "def-common.ActionProps.width", + "type": "number", + "tags": [], + "label": "width", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", + "deprecated": false } ], "initialIsOpen": false @@ -5982,7 +6066,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.ColumnRenderer.renderColumn.$1.columnNameeventIdfieldtimelineIdtruncatevalueslinkValues", + "id": "def-common.ColumnRenderer.renderColumn.$1", "type": "Object", "tags": [], "label": "{\n columnName,\n eventId,\n field,\n timelineId,\n truncate,\n values,\n linkValues,\n }", @@ -5992,7 +6076,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.ColumnRenderer.renderColumn.$1.columnNameeventIdfieldtimelineIdtruncatevalueslinkValues.columnName", + "id": "def-common.ColumnRenderer.renderColumn.$1.columnName", "type": "string", "tags": [], "label": "columnName", @@ -6002,7 +6086,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.ColumnRenderer.renderColumn.$1.columnNameeventIdfieldtimelineIdtruncatevalueslinkValues.eventId", + "id": "def-common.ColumnRenderer.renderColumn.$1.eventId", "type": "string", "tags": [], "label": "eventId", @@ -6012,7 +6096,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.ColumnRenderer.renderColumn.$1.columnNameeventIdfieldtimelineIdtruncatevalueslinkValues.field", + "id": "def-common.ColumnRenderer.renderColumn.$1.field", "type": "CompoundType", "tags": [], "label": "field", @@ -6020,7 +6104,7 @@ "signature": [ "Pick<", "EuiDataGridColumn", - ", \"id\" | \"display\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", + ", \"id\" | \"schema\" | \"display\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", { "pluginId": "timelines", "scope": "common", @@ -6045,7 +6129,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.ColumnRenderer.renderColumn.$1.columnNameeventIdfieldtimelineIdtruncatevalueslinkValues.timelineId", + "id": "def-common.ColumnRenderer.renderColumn.$1.timelineId", "type": "string", "tags": [], "label": "timelineId", @@ -6055,7 +6139,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.ColumnRenderer.renderColumn.$1.columnNameeventIdfieldtimelineIdtruncatevalueslinkValues.truncate", + "id": "def-common.ColumnRenderer.renderColumn.$1.truncate", "type": "CompoundType", "tags": [], "label": "truncate", @@ -6068,7 +6152,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.ColumnRenderer.renderColumn.$1.columnNameeventIdfieldtimelineIdtruncatevalueslinkValues.values", + "id": "def-common.ColumnRenderer.renderColumn.$1.values", "type": "CompoundType", "tags": [], "label": "values", @@ -6081,7 +6165,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.ColumnRenderer.renderColumn.$1.columnNameeventIdfieldtimelineIdtruncatevalueslinkValues.linkValues", + "id": "def-common.ColumnRenderer.renderColumn.$1.linkValues", "type": "CompoundType", "tags": [], "label": "linkValues", @@ -8055,7 +8139,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.HeaderActionProps.onSelectAll.$1.isSelected", + "id": "def-common.HeaderActionProps.onSelectAll.$1", "type": "Object", "tags": [], "label": "{ isSelected }", @@ -8065,7 +8149,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.HeaderActionProps.onSelectAll.$1.isSelected.isSelected", + "id": "def-common.HeaderActionProps.onSelectAll.$1.isSelected", "type": "boolean", "tags": [], "label": "isSelected", @@ -9085,7 +9169,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.RowRenderer.renderRow.$1.browserFieldsdataisDraggabletimelineId", + "id": "def-common.RowRenderer.renderRow.$1", "type": "Object", "tags": [], "label": "{\n browserFields,\n data,\n isDraggable,\n timelineId,\n }", @@ -9095,7 +9179,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.RowRenderer.renderRow.$1.browserFieldsdataisDraggabletimelineId.browserFields", + "id": "def-common.RowRenderer.renderRow.$1.browserFields", "type": "Object", "tags": [], "label": "browserFields", @@ -9116,7 +9200,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.RowRenderer.renderRow.$1.browserFieldsdataisDraggabletimelineId.data", + "id": "def-common.RowRenderer.renderRow.$1.data", "type": "Object", "tags": [], "label": "data", @@ -9129,7 +9213,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.RowRenderer.renderRow.$1.browserFieldsdataisDraggabletimelineId.isDraggable", + "id": "def-common.RowRenderer.renderRow.$1.isDraggable", "type": "boolean", "tags": [], "label": "isDraggable", @@ -9139,7 +9223,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.RowRenderer.renderRow.$1.browserFieldsdataisDraggabletimelineId.timelineId", + "id": "def-common.RowRenderer.renderRow.$1.timelineId", "type": "string", "tags": [], "label": "timelineId", @@ -9629,7 +9713,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.params", + "id": "def-common.StatusBulkActionsProps.setEventsLoading.$1", "type": "Object", "tags": [], "label": "params", @@ -9658,7 +9742,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.params", + "id": "def-common.StatusBulkActionsProps.setEventsDeleted.$1", "type": "Object", "tags": [], "label": "params", @@ -9710,6 +9794,19 @@ ], "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-common.StatusBulkActionsProps.timelineId", + "type": "string", + "tags": [], + "label": "timelineId", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", + "deprecated": false } ], "initialIsOpen": false @@ -10083,6 +10180,19 @@ "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "children": [ + { + "parentPluginId": "timelines", + "id": "def-common.TimelineEventsAllStrategyResponse.consumers", + "type": "Object", + "tags": [], + "label": "consumers", + "description": [], + "signature": [ + "{ [x: string]: number; }" + ], + "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "deprecated": false + }, { "parentPluginId": "timelines", "id": "def-common.TimelineEventsAllStrategyResponse.edges", @@ -12521,7 +12631,7 @@ "signature": [ "Pick<", "EuiDataGridColumn", - ", \"id\" | \"display\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", + ", \"id\" | \"schema\" | \"display\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", { "pluginId": "timelines", "scope": "common", @@ -12900,7 +13010,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.__0", + "id": "def-common.GetFocusedCell.$1", "type": "Object", "tags": [], "label": "__0", @@ -13101,7 +13211,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.nextPage", + "id": "def-common.OnChangePage.$1", "type": "number", "tags": [], "label": "nextPage", @@ -13128,7 +13238,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.__0", + "id": "def-common.OnColumnFocused.$1", "type": "Object", "tags": [], "label": "__0", @@ -13158,7 +13268,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.columnId", + "id": "def-common.OnColumnRemoved.$1", "type": "string", "tags": [], "label": "columnId", @@ -13185,7 +13295,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.__0", + "id": "def-common.OnColumnResized.$1", "type": "Object", "tags": [], "label": "__0", @@ -13225,7 +13335,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.sorted", + "id": "def-common.OnColumnSorted.$1", "type": "Object", "tags": [], "label": "sorted", @@ -13271,7 +13381,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.sorted", + "id": "def-common.OnColumnsSorted.$1", "type": "Array", "tags": [], "label": "sorted", @@ -13311,7 +13421,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.eventId", + "id": "def-common.OnPinEvent.$1", "type": "string", "tags": [], "label": "eventId", @@ -13340,7 +13450,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.__0", + "id": "def-common.OnRowSelected.$1", "type": "Object", "tags": [], "label": "__0", @@ -13372,7 +13482,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.__0", + "id": "def-common.OnSelectAll.$1", "type": "Object", "tags": [], "label": "__0", @@ -13404,7 +13514,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.eventId", + "id": "def-common.OnUnPinEvent.$1", "type": "string", "tags": [], "label": "eventId", @@ -13433,7 +13543,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.status", + "id": "def-common.OnUpdateAlertStatusError.$1", "type": "CompoundType", "tags": [], "label": "status", @@ -13446,7 +13556,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.error", + "id": "def-common.OnUpdateAlertStatusError.$2", "type": "Object", "tags": [], "label": "error", @@ -13478,7 +13588,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.updated", + "id": "def-common.OnUpdateAlertStatusSuccess.$1", "type": "number", "tags": [], "label": "updated", @@ -13488,7 +13598,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.conflicts", + "id": "def-common.OnUpdateAlertStatusSuccess.$2", "type": "number", "tags": [], "label": "conflicts", @@ -13498,7 +13608,7 @@ }, { "parentPluginId": "timelines", - "id": "def-common.status", + "id": "def-common.OnUpdateAlertStatusSuccess.$3", "type": "CompoundType", "tags": [], "label": "status", @@ -13538,7 +13648,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.columns", + "id": "def-common.OnUpdateColumns.$1", "type": "Array", "tags": [], "label": "columns", @@ -13847,7 +13957,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.params", + "id": "def-common.SetEventsDeleted.$1", "type": "Object", "tags": [], "label": "params", @@ -13877,7 +13987,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.params", + "id": "def-common.SetEventsLoading.$1", "type": "Object", "tags": [], "label": "params", @@ -14079,7 +14189,7 @@ "\nA `TGridCellAction` function accepts `data`, where each row of data is\nrepresented as a `TimelineNonEcsData[]`. For example, `data[0]` would\ncontain a `TimelineNonEcsData[]` with the first row of data.\n\nA `TGridCellAction` returns a function that has access to all the\n`EuiDataGridColumnCellActionProps`, _plus_ access to `data`,\n which enables code like the following example to be written:\n\nExample:\n```\n({ data }: { data: TimelineNonEcsData[][] }) => ({ rowIndex, columnId, Component }) => {\n const value = getMappedNonEcsValue({\n data: data[rowIndex], // access a specific row's values\n fieldName: columnId,\n });\n\n return (\n alert(`row ${rowIndex} col ${columnId} has value ${value}`)} iconType=\"heart\">\n {'Love it'}\n \n );\n};\n```" ], "signature": [ - "({ browserFields, data, timelineId, }: { browserFields: Readonly (props: ", + "[][]; timelineId: string; pageSize: number; }) => (props: ", "EuiDataGridColumnCellActionProps", ") => React.ReactNode" ], @@ -14105,7 +14215,7 @@ "children": [ { "parentPluginId": "timelines", - "id": "def-common.__0", + "id": "def-common.TGridCellAction.$1", "type": "Object", "tags": [], "label": "__0", @@ -14127,7 +14237,7 @@ "section": "def-common.TimelineNonEcsData", "text": "TimelineNonEcsData" }, - "[][]; timelineId: string; }" + "[][]; timelineId: string; pageSize: number; }" ], "path": "x-pack/plugins/timelines/common/types/timeline/columns/index.tsx", "deprecated": false @@ -14171,7 +14281,17 @@ "label": "TimelineExpandedDetail", "description": [], "signature": [ - "{ query?: Record | { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; } | undefined; } | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: FlowTarget; } | undefined; } | undefined; graph?: Record | { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; } | undefined; } | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: FlowTarget; } | undefined; } | undefined; notes?: Record | { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; } | undefined; } | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: FlowTarget; } | undefined; } | undefined; pinned?: Record | { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; } | undefined; } | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: FlowTarget; } | undefined; } | undefined; eql?: Record | { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; } | undefined; } | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: FlowTarget; } | undefined; } | undefined; }" + "{ query?: Record | { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; ecsData?: ", + "Ecs", + " | undefined; } | undefined; } | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: FlowTarget; } | undefined; } | undefined; graph?: Record | { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; ecsData?: ", + "Ecs", + " | undefined; } | undefined; } | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: FlowTarget; } | undefined; } | undefined; notes?: Record | { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; ecsData?: ", + "Ecs", + " | undefined; } | undefined; } | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: FlowTarget; } | undefined; } | undefined; pinned?: Record | { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; ecsData?: ", + "Ecs", + " | undefined; } | undefined; } | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: FlowTarget; } | undefined; } | undefined; eql?: Record | { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; ecsData?: ", + "Ecs", + " | undefined; } | undefined; } | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: FlowTarget; } | undefined; } | undefined; }" ], "path": "x-pack/plugins/timelines/common/types/timeline/index.ts", "deprecated": false, @@ -14185,7 +14305,9 @@ "label": "TimelineExpandedDetailType", "description": [], "signature": [ - "Record | { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; } | undefined; } | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: FlowTarget; } | undefined; }" + "Record | { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; ecsData?: ", + "Ecs", + " | undefined; } | undefined; } | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: FlowTarget; } | undefined; }" ], "path": "x-pack/plugins/timelines/common/types/timeline/index.ts", "deprecated": false, @@ -14199,7 +14321,9 @@ "label": "TimelineExpandedEventType", "description": [], "signature": [ - "Record | { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; } | undefined; }" + "Record | { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; ecsData?: ", + "Ecs", + " | undefined; } | undefined; }" ], "path": "x-pack/plugins/timelines/common/types/timeline/index.ts", "deprecated": false, @@ -14676,7 +14800,9 @@ "section": "def-common.TimelineTabs", "text": "TimelineTabs" }, - " | undefined; timelineId: string; }) | ({ panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; } | undefined; } & { tabType?: ", + " | undefined; timelineId: string; }) | ({ panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; ecsData?: ", + "Ecs", + " | undefined; } | undefined; } & { tabType?: ", { "pluginId": "timelines", "scope": "common", diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index 5e943046bc989..248a82715348c 100644 --- a/api_docs/timelines.mdx +++ b/api_docs/timelines.mdx @@ -18,7 +18,7 @@ Contact [Security solution](https://github.com/orgs/elastic/teams/security-solut | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 960 | 6 | 840 | 24 | +| 967 | 6 | 846 | 25 | ## Client diff --git a/api_docs/triggers_actions_ui.json b/api_docs/triggers_actions_ui.json index c647f97a507a1..eeb23ea589d99 100644 --- a/api_docs/triggers_actions_ui.json +++ b/api_docs/triggers_actions_ui.json @@ -187,7 +187,7 @@ "children": [ { "parentPluginId": "triggersActionsUi", - "id": "def-public.props", + "id": "def-public.ActionForm.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -221,7 +221,7 @@ "children": [ { "parentPluginId": "triggersActionsUi", - "id": "def-public.props", + "id": "def-public.AlertConditions.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -255,7 +255,7 @@ "children": [ { "parentPluginId": "triggersActionsUi", - "id": "def-public.props", + "id": "def-public.AlertConditionsGroup.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -287,7 +287,7 @@ "children": [ { "parentPluginId": "triggersActionsUi", - "id": "def-public.props", + "id": "def-public.ConnectorAddFlyout.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -319,7 +319,7 @@ "children": [ { "parentPluginId": "triggersActionsUi", - "id": "def-public.props", + "id": "def-public.ConnectorEditFlyout.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -351,7 +351,7 @@ "children": [ { "parentPluginId": "triggersActionsUi", - "id": "def-public.props", + "id": "def-public.ForLastExpression.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -668,7 +668,7 @@ "children": [ { "parentPluginId": "triggersActionsUi", - "id": "def-public.props", + "id": "def-public.GroupByExpression.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -713,7 +713,7 @@ "children": [ { "parentPluginId": "triggersActionsUi", - "id": "def-public.loadActionTypes.$1.http", + "id": "def-public.loadActionTypes.$1", "type": "Object", "tags": [], "label": "{ http }", @@ -723,7 +723,7 @@ "children": [ { "parentPluginId": "triggersActionsUi", - "id": "def-public.loadActionTypes.$1.http.http", + "id": "def-public.loadActionTypes.$1.http", "type": "Object", "tags": [], "label": "http", @@ -764,7 +764,7 @@ "children": [ { "parentPluginId": "triggersActionsUi", - "id": "def-public.props", + "id": "def-public.OfExpression.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -796,7 +796,7 @@ "children": [ { "parentPluginId": "triggersActionsUi", - "id": "def-public.props", + "id": "def-public.ThresholdExpression.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -828,7 +828,7 @@ "children": [ { "parentPluginId": "triggersActionsUi", - "id": "def-public.props", + "id": "def-public.ValueExpression.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -860,7 +860,7 @@ "children": [ { "parentPluginId": "triggersActionsUi", - "id": "def-public.props", + "id": "def-public.WhenExpression.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -1196,7 +1196,7 @@ "children": [ { "parentPluginId": "triggersActionsUi", - "id": "def-public.props", + "id": "def-public.AlertTypeModel.alertParamsExpression.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -1353,7 +1353,7 @@ "label": "setAlertProperty", "description": [], "signature": [ - "(key: Prop, value: Pick<", + "(key: Prop, value: Pick<", { "pluginId": "alerting", "scope": "common", @@ -1361,7 +1361,7 @@ "section": "def-common.Alert", "text": "Alert" }, - ", \"enabled\" | \"id\" | \"name\" | \"params\" | \"actions\" | \"throttle\" | \"tags\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">[Prop] | null) => void" + ", \"enabled\" | \"id\" | \"name\" | \"tags\" | \"params\" | \"actions\" | \"throttle\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">[Prop] | null) => void" ], "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", "deprecated": false, @@ -1396,7 +1396,7 @@ "section": "def-common.Alert", "text": "Alert" }, - ", \"enabled\" | \"id\" | \"name\" | \"params\" | \"actions\" | \"throttle\" | \"tags\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">[Prop] | null" + ", \"enabled\" | \"id\" | \"name\" | \"tags\" | \"params\" | \"actions\" | \"throttle\" | \"alertTypeId\" | \"consumer\" | \"schedule\" | \"scheduledTaskId\" | \"createdBy\" | \"updatedBy\" | \"createdAt\" | \"updatedAt\" | \"apiKeyOwner\" | \"notifyWhen\" | \"muteAll\" | \"mutedInstanceIds\" | \"executionStatus\">[Prop] | null" ], "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", "deprecated": false, @@ -1797,6 +1797,16 @@ "path": "x-pack/plugins/triggers_actions_ui/public/application/app.tsx", "deprecated": false }, + { + "parentPluginId": "triggersActionsUi", + "id": "def-public.TriggersAndActionsUiServices.isCloud", + "type": "boolean", + "tags": [], + "label": "isCloud", + "description": [], + "path": "x-pack/plugins/triggers_actions_ui/public/application/app.tsx", + "deprecated": false + }, { "parentPluginId": "triggersActionsUi", "id": "def-public.TriggersAndActionsUiServices.setBreadcrumbs", @@ -1840,11 +1850,11 @@ "signature": [ "{ get: (id: string) => ", "ActionTypeModel", - "; register: (objectType: ", + "; list: () => ", "ActionTypeModel", - ") => void; has: (id: string) => boolean; list: () => ", + "[]; register: (objectType: ", "ActionTypeModel", - "[]; }" + ") => void; has: (id: string) => boolean; }" ], "path": "x-pack/plugins/triggers_actions_ui/public/application/app.tsx", "deprecated": false @@ -1865,7 +1875,7 @@ "section": "def-public.AlertTypeModel", "text": "AlertTypeModel" }, - ">; register: (objectType: ", + ">; list: () => ", { "pluginId": "triggersActionsUi", "scope": "public", @@ -1873,7 +1883,7 @@ "section": "def-public.AlertTypeModel", "text": "AlertTypeModel" }, - ">) => void; has: (id: string) => boolean; list: () => ", + ">[]; register: (objectType: ", { "pluginId": "triggersActionsUi", "scope": "public", @@ -1881,7 +1891,7 @@ "section": "def-public.AlertTypeModel", "text": "AlertTypeModel" }, - ">[]; }" + ">) => void; has: (id: string) => boolean; }" ], "path": "x-pack/plugins/triggers_actions_ui/public/application/app.tsx", "deprecated": false @@ -2073,11 +2083,11 @@ "signature": [ "{ get: (id: string) => ", "ActionTypeModel", - "; register: (objectType: ", + "; list: () => ", "ActionTypeModel", - ") => void; has: (id: string) => boolean; list: () => ", + "[]; register: (objectType: ", "ActionTypeModel", - "[]; }" + ") => void; has: (id: string) => boolean; }" ], "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", "deprecated": false, @@ -2105,7 +2115,7 @@ "label": "Alert", "description": [], "signature": [ - "{ enabled: boolean; id: string; name: string; params: Record; actions: ", + "{ enabled: boolean; id: string; name: string; tags: string[]; params: Record; actions: ", { "pluginId": "alerting", "scope": "common", @@ -2113,7 +2123,7 @@ "section": "def-common.AlertAction", "text": "AlertAction" }, - "[]; throttle: string | null; tags: string[]; alertTypeId: string; consumer: string; schedule: ", + "[]; throttle: string | null; alertTypeId: string; consumer: string; schedule: ", { "pluginId": "alerting", "scope": "common", @@ -2207,7 +2217,7 @@ "section": "def-public.AlertTypeModel", "text": "AlertTypeModel" }, - ">; register: (objectType: ", + ">; list: () => ", { "pluginId": "triggersActionsUi", "scope": "public", @@ -2215,7 +2225,7 @@ "section": "def-public.AlertTypeModel", "text": "AlertTypeModel" }, - ">) => void; has: (id: string) => boolean; list: () => ", + ">[]; register: (objectType: ", { "pluginId": "triggersActionsUi", "scope": "public", @@ -2223,7 +2233,7 @@ "section": "def-public.AlertTypeModel", "text": "AlertTypeModel" }, - ">[]; }" + ">) => void; has: (id: string) => boolean; }" ], "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", "deprecated": false, diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index fe7e22d7a79a4..4bdd41535d348 100644 --- a/api_docs/triggers_actions_ui.mdx +++ b/api_docs/triggers_actions_ui.mdx @@ -18,7 +18,7 @@ Contact [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting- | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 238 | 1 | 229 | 18 | +| 239 | 1 | 230 | 18 | ## Client diff --git a/api_docs/ui_actions.json b/api_docs/ui_actions.json index aa7642d19cf14..0edefce127a25 100644 --- a/api_docs/ui_actions.json +++ b/api_docs/ui_actions.json @@ -83,7 +83,7 @@ "signature": [ "Map>" + ">" ], "path": "src/plugins/ui_actions/public/service/ui_actions_service.ts", "deprecated": false diff --git a/api_docs/ui_actions.mdx b/api_docs/ui_actions.mdx index 8f7b240a8249a..6c5d6381c3b7c 100644 --- a/api_docs/ui_actions.mdx +++ b/api_docs/ui_actions.mdx @@ -10,7 +10,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex --- import uiActionsObj from './ui_actions.json'; - +Adds UI Actions service to Kibana Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. diff --git a/api_docs/ui_actions_enhanced.json b/api_docs/ui_actions_enhanced.json index b48903c983d70..5464a5d884472 100644 --- a/api_docs/ui_actions_enhanced.json +++ b/api_docs/ui_actions_enhanced.json @@ -483,7 +483,7 @@ "children": [ { "parentPluginId": "uiActionsEnhanced", - "id": "def-public.props", + "id": "def-public.ActionFactory.ReactCollectConfig.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -496,7 +496,7 @@ }, { "parentPluginId": "uiActionsEnhanced", - "id": "def-public.context", + "id": "def-public.ActionFactory.ReactCollectConfig.$2", "type": "Any", "tags": [], "label": "context", @@ -525,7 +525,7 @@ "children": [ { "parentPluginId": "uiActionsEnhanced", - "id": "def-public.context", + "id": "def-public.ActionFactory.createConfig.$1", "type": "Uncategorized", "tags": [], "label": "context", @@ -554,7 +554,7 @@ "children": [ { "parentPluginId": "uiActionsEnhanced", - "id": "def-public.config", + "id": "def-public.ActionFactory.isConfigValid.$1", "type": "Uncategorized", "tags": [], "label": "config", @@ -567,7 +567,7 @@ }, { "parentPluginId": "uiActionsEnhanced", - "id": "def-public.context", + "id": "def-public.ActionFactory.isConfigValid.$2", "type": "Uncategorized", "tags": [], "label": "context", @@ -823,7 +823,9 @@ "section": "def-common.SerializedEvent", "text": "SerializedEvent" }, - ", telemetryData: Record) => Record" + ", telemetryData: Record) => Record" ], "path": "x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts", "deprecated": false, @@ -856,7 +858,9 @@ "label": "telemetryData", "description": [], "signature": [ - "Record" + "Record" ], "path": "x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts", "deprecated": false, @@ -2600,7 +2604,7 @@ "children": [ { "parentPluginId": "uiActionsEnhanced", - "id": "def-public.context", + "id": "def-public.DrilldownDefinition.createConfig.$1", "type": "Uncategorized", "tags": [], "label": "context", @@ -2653,7 +2657,7 @@ "tags": [], "label": "isConfigValid", "description": [ - "\nA validator function for the config object. Should always return a boolean\ngiven any input." + "\nA validator function for the config object. Should always return a boolean." ], "signature": [ "(config: Config, context: FactoryContext) => boolean" @@ -2664,7 +2668,7 @@ "children": [ { "parentPluginId": "uiActionsEnhanced", - "id": "def-public.config", + "id": "def-public.DrilldownDefinition.isConfigValid.$1", "type": "Uncategorized", "tags": [], "label": "config", @@ -2677,7 +2681,7 @@ }, { "parentPluginId": "uiActionsEnhanced", - "id": "def-public.context", + "id": "def-public.DrilldownDefinition.isConfigValid.$2", "type": "Uncategorized", "tags": [], "label": "context", @@ -2951,7 +2955,7 @@ "tags": [], "label": "id", "description": [ - "\nAny string that uniquely identifies this item in a list of `DrilldownTemplate[]`." + "\nA string that uniquely identifies this item in a list of `DrilldownTemplate[]`." ], "path": "x-pack/plugins/ui_actions_enhanced/public/drilldowns/drilldown_manager/types.ts", "deprecated": false @@ -3409,7 +3413,7 @@ }, ">>,Pick<", "UiActionsServiceEnhancements", - ", \"telemetry\" | \"extract\" | \"inject\" | \"getActionFactory\" | \"hasActionFactory\" | \"getActionFactories\">" + ", \"telemetry\" | \"inject\" | \"extract\" | \"getActionFactory\" | \"hasActionFactory\" | \"getActionFactories\">" ], "path": "x-pack/plugins/ui_actions_enhanced/public/plugin.ts", "deprecated": false, @@ -3432,7 +3436,7 @@ "children": [ { "parentPluginId": "uiActionsEnhanced", - "id": "def-public.props", + "id": "def-public.StartContract.DrilldownManager.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -3445,7 +3449,7 @@ }, { "parentPluginId": "uiActionsEnhanced", - "id": "def-public.context", + "id": "def-public.StartContract.DrilldownManager.$2", "type": "Any", "tags": [], "label": "context", diff --git a/api_docs/ui_actions_enhanced.mdx b/api_docs/ui_actions_enhanced.mdx index 890dad000e717..09beac0717759 100644 --- a/api_docs/ui_actions_enhanced.mdx +++ b/api_docs/ui_actions_enhanced.mdx @@ -10,7 +10,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex --- import uiActionsEnhancedObj from './ui_actions_enhanced.json'; - +Extends UI Actions plugin with more functionality Contact [Kibana App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. diff --git a/api_docs/url_forwarding.json b/api_docs/url_forwarding.json index c725024257646..6957bd8e028e9 100644 --- a/api_docs/url_forwarding.json +++ b/api_docs/url_forwarding.json @@ -28,7 +28,7 @@ "section": "def-public.CoreSetup", "text": "CoreSetup" }, - "<{}, { navigateToDefaultApp: ({ overwriteHash }?: { overwriteHash: boolean; }) => void; navigateToLegacyKibanaUrl: (hash: string) => { navigated: boolean; }; getForwards: () => ", + "<{}, { navigateToLegacyKibanaUrl: (hash: string) => { navigated: boolean; }; getForwards: () => ", { "pluginId": "urlForwarding", "scope": "public", @@ -56,7 +56,7 @@ "section": "def-public.CoreSetup", "text": "CoreSetup" }, - "<{}, { navigateToDefaultApp: ({ overwriteHash }?: { overwriteHash: boolean; }) => void; navigateToLegacyKibanaUrl: (hash: string) => { navigated: boolean; }; getForwards: () => ", + "<{}, { navigateToLegacyKibanaUrl: (hash: string) => { navigated: boolean; }; getForwards: () => ", { "pluginId": "urlForwarding", "scope": "public", @@ -81,7 +81,7 @@ "label": "start", "description": [], "signature": [ - "({ application, http: { basePath }, uiSettings }: ", + "({ application, http: { basePath } }: ", { "pluginId": "core", "scope": "public", @@ -89,7 +89,7 @@ "section": "def-public.CoreStart", "text": "CoreStart" }, - ", { kibanaLegacy }: { kibanaLegacy: { loadFontAwesome: () => Promise; loadAngularBootstrap: () => Promise; config: Readonly<{} & { defaultAppId: string; }>; }; }) => { navigateToDefaultApp: ({ overwriteHash }?: { overwriteHash: boolean; }) => void; navigateToLegacyKibanaUrl: (hash: string) => { navigated: boolean; }; getForwards: () => ", + ") => { navigateToLegacyKibanaUrl: (hash: string) => { navigated: boolean; }; getForwards: () => ", { "pluginId": "urlForwarding", "scope": "public", @@ -107,7 +107,7 @@ "id": "def-public.UrlForwardingPlugin.start.$1", "type": "Object", "tags": [], - "label": "{ application, http: { basePath }, uiSettings }", + "label": "{ application, http: { basePath } }", "description": [], "signature": [ { @@ -121,49 +121,9 @@ "path": "src/plugins/url_forwarding/public/plugin.ts", "deprecated": false, "isRequired": true - }, - { - "parentPluginId": "urlForwarding", - "id": "def-public.UrlForwardingPlugin.start.$2.kibanaLegacy", - "type": "Object", - "tags": [], - "label": "{ kibanaLegacy }", - "description": [], - "path": "src/plugins/url_forwarding/public/plugin.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "urlForwarding", - "id": "def-public.UrlForwardingPlugin.start.$2.kibanaLegacy.kibanaLegacy", - "type": "Object", - "tags": [], - "label": "kibanaLegacy", - "description": [], - "signature": [ - "{ loadFontAwesome: () => Promise; loadAngularBootstrap: () => Promise; config: Readonly<{} & { defaultAppId: string; }>; }" - ], - "path": "src/plugins/url_forwarding/public/plugin.ts", - "deprecated": false - } - ] } ], "returnComment": [] - }, - { - "parentPluginId": "urlForwarding", - "id": "def-public.UrlForwardingPlugin.stop", - "type": "Function", - "tags": [], - "label": "stop", - "description": [], - "signature": [ - "() => void" - ], - "path": "src/plugins/url_forwarding/public/plugin.ts", - "deprecated": false, - "children": [], - "returnComment": [] } ], "initialIsOpen": false @@ -259,7 +219,7 @@ "label": "UrlForwardingStart", "description": [], "signature": [ - "{ navigateToDefaultApp: ({ overwriteHash }?: { overwriteHash: boolean; }) => void; navigateToLegacyKibanaUrl: (hash: string) => { navigated: boolean; }; getForwards: () => ", + "{ navigateToLegacyKibanaUrl: (hash: string) => { navigated: boolean; }; getForwards: () => ", { "pluginId": "urlForwarding", "scope": "public", diff --git a/api_docs/url_forwarding.mdx b/api_docs/url_forwarding.mdx index 1a4b28e9eb533..2a6fe2f30e73d 100644 --- a/api_docs/url_forwarding.mdx +++ b/api_docs/url_forwarding.mdx @@ -12,13 +12,13 @@ import urlForwardingObj from './url_forwarding.json'; -Contact [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. **Code health stats** | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 15 | 0 | 15 | 0 | +| 12 | 0 | 12 | 0 | ## Client diff --git a/api_docs/usage_collection.json b/api_docs/usage_collection.json index cf9dbb0b037b6..a41ca4a4b3127 100644 --- a/api_docs/usage_collection.json +++ b/api_docs/usage_collection.json @@ -409,7 +409,7 @@ "children": [ { "parentPluginId": "usageCollection", - "id": "def-server.context", + "id": "def-server.ICollector.fetch.$1", "type": "CompoundType", "tags": [], "label": "context", @@ -751,7 +751,7 @@ "children": [ { "parentPluginId": "usageCollection", - "id": "def-server.context", + "id": "def-server.CollectorFetchMethod.$1", "type": "CompoundType", "tags": [], "label": "context", diff --git a/api_docs/vis_default_editor.json b/api_docs/vis_default_editor.json index fe449aa5fdd6d..883d846e67bb8 100644 --- a/api_docs/vis_default_editor.json +++ b/api_docs/vis_default_editor.json @@ -901,7 +901,7 @@ "children": [ { "parentPluginId": "visDefaultEditor", - "id": "def-public.paramName", + "id": "def-public.SetColorRangeValue.$1", "type": "string", "tags": [], "label": "paramName", @@ -911,7 +911,7 @@ }, { "parentPluginId": "visDefaultEditor", - "id": "def-public.value", + "id": "def-public.SetColorRangeValue.$2", "type": "Array", "tags": [], "label": "value", @@ -956,7 +956,7 @@ "children": [ { "parentPluginId": "visDefaultEditor", - "id": "def-public.paramName", + "id": "def-public.SetColorSchemaOptionsValue.$1", "type": "Uncategorized", "tags": [], "label": "paramName", @@ -969,7 +969,7 @@ }, { "parentPluginId": "visDefaultEditor", - "id": "def-public.value", + "id": "def-public.SetColorSchemaOptionsValue.$2", "type": "Uncategorized", "tags": [], "label": "value", diff --git a/api_docs/vis_default_editor.mdx b/api_docs/vis_default_editor.mdx index 037b520e12e2b..608b2478b1cd0 100644 --- a/api_docs/vis_default_editor.mdx +++ b/api_docs/vis_default_editor.mdx @@ -12,7 +12,7 @@ import visDefaultEditorObj from './vis_default_editor.json'; The default editor used in most aggregation-based visualizations. -Contact [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/vis_type_pie.mdx b/api_docs/vis_type_pie.mdx index 0c97bed029b72..dfa84fd6578b4 100644 --- a/api_docs/vis_type_pie.mdx +++ b/api_docs/vis_type_pie.mdx @@ -12,7 +12,7 @@ import visTypePieObj from './vis_type_pie.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 [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/vis_type_table.json b/api_docs/vis_type_table.json index bb75ded4e7b63..3b649cd9b0d09 100644 --- a/api_docs/vis_type_table.json +++ b/api_docs/vis_type_table.json @@ -27,7 +27,7 @@ "tags": [], "label": "TableVisParams", "description": [], - "path": "src/plugins/vis_type_table/common/types.ts", + "path": "src/plugins/vis_types/table/common/types.ts", "deprecated": false, "children": [ { @@ -40,7 +40,7 @@ "signature": [ "number | \"\"" ], - "path": "src/plugins/vis_type_table/common/types.ts", + "path": "src/plugins/vis_types/table/common/types.ts", "deprecated": false }, { @@ -50,7 +50,7 @@ "tags": [], "label": "showPartialRows", "description": [], - "path": "src/plugins/vis_type_table/common/types.ts", + "path": "src/plugins/vis_types/table/common/types.ts", "deprecated": false }, { @@ -60,7 +60,7 @@ "tags": [], "label": "showMetricsAtAllLevels", "description": [], - "path": "src/plugins/vis_type_table/common/types.ts", + "path": "src/plugins/vis_types/table/common/types.ts", "deprecated": false }, { @@ -70,7 +70,7 @@ "tags": [], "label": "showToolbar", "description": [], - "path": "src/plugins/vis_type_table/common/types.ts", + "path": "src/plugins/vis_types/table/common/types.ts", "deprecated": false }, { @@ -80,7 +80,7 @@ "tags": [], "label": "showTotal", "description": [], - "path": "src/plugins/vis_type_table/common/types.ts", + "path": "src/plugins/vis_types/table/common/types.ts", "deprecated": false }, { @@ -99,7 +99,7 @@ "text": "AggTypes" } ], - "path": "src/plugins/vis_type_table/common/types.ts", + "path": "src/plugins/vis_types/table/common/types.ts", "deprecated": false }, { @@ -109,7 +109,7 @@ "tags": [], "label": "percentageCol", "description": [], - "path": "src/plugins/vis_type_table/common/types.ts", + "path": "src/plugins/vis_types/table/common/types.ts", "deprecated": false }, { @@ -122,7 +122,7 @@ "signature": [ "boolean | undefined" ], - "path": "src/plugins/vis_type_table/common/types.ts", + "path": "src/plugins/vis_types/table/common/types.ts", "deprecated": false } ], @@ -137,7 +137,7 @@ "tags": [], "label": "AggTypes", "description": [], - "path": "src/plugins/vis_type_table/common/types.ts", + "path": "src/plugins/vis_types/table/common/types.ts", "deprecated": false, "initialIsOpen": false } @@ -153,7 +153,7 @@ "signature": [ "\"table\"" ], - "path": "src/plugins/vis_type_table/common/types.ts", + "path": "src/plugins/vis_types/table/common/types.ts", "deprecated": false, "initialIsOpen": false } diff --git a/api_docs/vis_type_table.mdx b/api_docs/vis_type_table.mdx index 25472049bbb8a..31ff1da19faab 100644 --- a/api_docs/vis_type_table.mdx +++ b/api_docs/vis_type_table.mdx @@ -12,7 +12,7 @@ import visTypeTableObj from './vis_type_table.json'; Registers the datatable aggregation-based visualization. Currently it contains two implementations, the one based on EUI datagrid and the angular one. The second one is going to be removed in future minors. -Contact [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/vis_type_timelion.json b/api_docs/vis_type_timelion.json index bfa67ba268e64..decb94234c64d 100644 --- a/api_docs/vis_type_timelion.json +++ b/api_docs/vis_type_timelion.json @@ -14,7 +14,7 @@ "tags": [], "label": "_LEGACY_", "description": [], - "path": "src/plugins/vis_type_timelion/public/index.ts", + "path": "src/plugins/vis_types/timelion/public/index.ts", "deprecated": false, "children": [ { @@ -24,7 +24,7 @@ "tags": [], "label": "DEFAULT_TIME_FORMAT", "description": [], - "path": "src/plugins/vis_type_timelion/public/index.ts", + "path": "src/plugins/vis_types/timelion/public/index.ts", "deprecated": false }, { @@ -37,58 +37,58 @@ "signature": [ "(from: number, to: number, size: number, interval: string, min: string) => string" ], - "path": "src/plugins/vis_type_timelion/public/index.ts", + "path": "src/plugins/vis_types/timelion/public/index.ts", "deprecated": false, "returnComment": [], "children": [ { "parentPluginId": "visTypeTimelion", - "id": "def-public.from", + "id": "def-public._LEGACY_.calculateInterval.$1", "type": "number", "tags": [], "label": "from", "description": [], - "path": "src/plugins/vis_type_timelion/common/lib/calculate_interval.ts", + "path": "src/plugins/vis_types/timelion/common/lib/calculate_interval.ts", "deprecated": false }, { "parentPluginId": "visTypeTimelion", - "id": "def-public.to", + "id": "def-public._LEGACY_.calculateInterval.$2", "type": "number", "tags": [], "label": "to", "description": [], - "path": "src/plugins/vis_type_timelion/common/lib/calculate_interval.ts", + "path": "src/plugins/vis_types/timelion/common/lib/calculate_interval.ts", "deprecated": false }, { "parentPluginId": "visTypeTimelion", - "id": "def-public.size", + "id": "def-public._LEGACY_.calculateInterval.$3", "type": "number", "tags": [], "label": "size", "description": [], - "path": "src/plugins/vis_type_timelion/common/lib/calculate_interval.ts", + "path": "src/plugins/vis_types/timelion/common/lib/calculate_interval.ts", "deprecated": false }, { "parentPluginId": "visTypeTimelion", - "id": "def-public.interval", + "id": "def-public._LEGACY_.calculateInterval.$4", "type": "string", "tags": [], "label": "interval", "description": [], - "path": "src/plugins/vis_type_timelion/common/lib/calculate_interval.ts", + "path": "src/plugins/vis_types/timelion/common/lib/calculate_interval.ts", "deprecated": false }, { "parentPluginId": "visTypeTimelion", - "id": "def-public.min", + "id": "def-public._LEGACY_.calculateInterval.$5", "type": "string", "tags": [], "label": "min", "description": [], - "path": "src/plugins/vis_type_timelion/common/lib/calculate_interval.ts", + "path": "src/plugins/vis_types/timelion/common/lib/calculate_interval.ts", "deprecated": false } ] @@ -105,18 +105,18 @@ "ParsedExpression", ">" ], - "path": "src/plugins/vis_type_timelion/public/index.ts", + "path": "src/plugins/vis_types/timelion/public/index.ts", "deprecated": false, "returnComment": [], "children": [ { "parentPluginId": "visTypeTimelion", - "id": "def-public.input", + "id": "def-public._LEGACY_.parseTimelionExpressionAsync.$1", "type": "string", "tags": [], "label": "input", "description": [], - "path": "src/plugins/vis_type_timelion/common/parser_async.ts", + "path": "src/plugins/vis_types/timelion/common/parser_async.ts", "deprecated": false } ] @@ -137,7 +137,7 @@ "LegacyAxis", "): string; }" ], - "path": "src/plugins/vis_type_timelion/public/index.ts", + "path": "src/plugins/vis_types/timelion/public/index.ts", "deprecated": false, "returnComment": [], "children": [] @@ -160,13 +160,13 @@ }, ") => string" ], - "path": "src/plugins/vis_type_timelion/public/index.ts", + "path": "src/plugins/vis_types/timelion/public/index.ts", "deprecated": false, "returnComment": [], "children": [ { "parentPluginId": "visTypeTimelion", - "id": "def-public.config", + "id": "def-public._LEGACY_.getTimezone.$1", "type": "Object", "tags": [], "label": "config", @@ -180,7 +180,7 @@ "text": "IUiSettingsClient" } ], - "path": "src/plugins/vis_type_timelion/public/helpers/get_timezone.ts", + "path": "src/plugins/vis_types/timelion/public/helpers/get_timezone.ts", "deprecated": false } ] @@ -203,13 +203,13 @@ }, ") => (esInterval: any) => any" ], - "path": "src/plugins/vis_type_timelion/public/index.ts", + "path": "src/plugins/vis_types/timelion/public/index.ts", "deprecated": false, "returnComment": [], "children": [ { "parentPluginId": "visTypeTimelion", - "id": "def-public.config", + "id": "def-public._LEGACY_.xaxisFormatterProvider.$1", "type": "Object", "tags": [], "label": "config", @@ -223,7 +223,7 @@ "text": "IUiSettingsClient" } ], - "path": "src/plugins/vis_type_timelion/public/helpers/xaxis_formatter.ts", + "path": "src/plugins/vis_types/timelion/public/helpers/xaxis_formatter.ts", "deprecated": false } ] @@ -240,7 +240,7 @@ "IAxis", ") => number[]" ], - "path": "src/plugins/vis_type_timelion/public/index.ts", + "path": "src/plugins/vis_types/timelion/public/index.ts", "deprecated": false, "returnComment": [], "children": [] @@ -256,7 +256,7 @@ "tags": [], "label": "VisTypeTimelionPluginStart", "description": [], - "path": "src/plugins/vis_type_timelion/public/plugin.ts", + "path": "src/plugins/vis_types/timelion/public/plugin.ts", "deprecated": false, "children": [ { @@ -275,7 +275,7 @@ "TimelionFunctionArgsSuggestion", "[]; }" ], - "path": "src/plugins/vis_type_timelion/public/plugin.ts", + "path": "src/plugins/vis_types/timelion/public/plugin.ts", "deprecated": false, "returnComment": [], "children": [] @@ -291,7 +291,7 @@ "tags": [], "label": "VisTypeTimelionPluginSetup", "description": [], - "path": "src/plugins/vis_type_timelion/public/plugin.ts", + "path": "src/plugins/vis_types/timelion/public/plugin.ts", "deprecated": false, "children": [ { @@ -301,7 +301,7 @@ "tags": [], "label": "isUiEnabled", "description": [], - "path": "src/plugins/vis_type_timelion/public/plugin.ts", + "path": "src/plugins/vis_types/timelion/public/plugin.ts", "deprecated": false } ], @@ -322,7 +322,7 @@ "description": [ "\nDescribes public Timelion plugin contract returned at the `setup` stage." ], - "path": "src/plugins/vis_type_timelion/server/plugin.ts", + "path": "src/plugins/vis_types/timelion/server/plugin.ts", "deprecated": false, "children": [ { @@ -332,7 +332,7 @@ "tags": [], "label": "uiEnabled", "description": [], - "path": "src/plugins/vis_type_timelion/server/plugin.ts", + "path": "src/plugins/vis_types/timelion/server/plugin.ts", "deprecated": false } ], diff --git a/api_docs/vis_type_timelion.mdx b/api_docs/vis_type_timelion.mdx index b8d9ae388d0b7..3616bb6054b26 100644 --- a/api_docs/vis_type_timelion.mdx +++ b/api_docs/vis_type_timelion.mdx @@ -12,7 +12,7 @@ import visTypeTimelionObj from './vis_type_timelion.json'; Registers the timelion visualization. Also contains the backend for both timelion app and timelion visualization. -Contact [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/vis_type_timeseries.mdx b/api_docs/vis_type_timeseries.mdx index 645c5e6e841bc..abdc4801664b9 100644 --- a/api_docs/vis_type_timeseries.mdx +++ b/api_docs/vis_type_timeseries.mdx @@ -12,7 +12,7 @@ import visTypeTimeseriesObj from './vis_type_timeseries.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 [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/vis_type_vega.json b/api_docs/vis_type_vega.json index 88a5bda07a2f2..1ecbc7c48f289 100644 --- a/api_docs/vis_type_vega.json +++ b/api_docs/vis_type_vega.json @@ -22,7 +22,7 @@ "tags": [], "label": "VisTypeVegaPluginStart", "description": [], - "path": "src/plugins/vis_type_vega/server/types.ts", + "path": "src/plugins/vis_types/vega/server/types.ts", "deprecated": false, "children": [], "lifecycle": "start", @@ -35,7 +35,7 @@ "tags": [], "label": "VisTypeVegaPluginSetup", "description": [], - "path": "src/plugins/vis_type_vega/server/types.ts", + "path": "src/plugins/vis_types/vega/server/types.ts", "deprecated": false, "children": [], "lifecycle": "setup", diff --git a/api_docs/vis_type_vega.mdx b/api_docs/vis_type_vega.mdx index 3890dace227a6..7bb64a0dc1721 100644 --- a/api_docs/vis_type_vega.mdx +++ b/api_docs/vis_type_vega.mdx @@ -12,7 +12,7 @@ import visTypeVegaObj from './vis_type_vega.json'; Registers the vega visualization. Is the elastic version of vega and vega-lite libraries. -Contact [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/vis_type_vislib.json b/api_docs/vis_type_vislib.json index c6780ddd5010b..6e52424223125 100644 --- a/api_docs/vis_type_vislib.json +++ b/api_docs/vis_type_vislib.json @@ -39,7 +39,7 @@ "label": "type", "description": [], "signature": [ - "\"histogram\" | \"heatmap\" | \"metric\" | \"area\" | \"line\" | \"horizontal_bar\" | \"pie\" | \"point_series\" | \"gauge\" | \"goal\"" + "\"goal\" | \"histogram\" | \"heatmap\" | \"metric\" | \"area\" | \"line\" | \"horizontal_bar\" | \"pie\" | \"point_series\" | \"gauge\"" ], "path": "src/plugins/vis_types/vislib/public/types.ts", "deprecated": false @@ -338,7 +338,7 @@ "label": "VislibChartType", "description": [], "signature": [ - "\"histogram\" | \"heatmap\" | \"metric\" | \"area\" | \"line\" | \"horizontal_bar\" | \"pie\" | \"point_series\" | \"gauge\" | \"goal\"" + "\"goal\" | \"histogram\" | \"heatmap\" | \"metric\" | \"area\" | \"line\" | \"horizontal_bar\" | \"pie\" | \"point_series\" | \"gauge\"" ], "path": "src/plugins/vis_types/vislib/public/types.ts", "deprecated": false, diff --git a/api_docs/vis_type_vislib.mdx b/api_docs/vis_type_vislib.mdx index 7ac6915ef2944..96b922e8d2066 100644 --- a/api_docs/vis_type_vislib.mdx +++ b/api_docs/vis_type_vislib.mdx @@ -12,7 +12,7 @@ import visTypeVislibObj from './vis_type_vislib.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 [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/vis_type_xy.json b/api_docs/vis_type_xy.json index 410357dc42495..cea919f1d64d3 100644 --- a/api_docs/vis_type_xy.json +++ b/api_docs/vis_type_xy.json @@ -904,7 +904,7 @@ "children": [ { "parentPluginId": "visTypeXy", - "id": "def-public.showElasticChartsOptions", + "id": "def-public.xyVisTypes.area.$1", "type": "boolean", "tags": [], "label": "showElasticChartsOptions", @@ -931,7 +931,7 @@ "children": [ { "parentPluginId": "visTypeXy", - "id": "def-public.showElasticChartsOptions", + "id": "def-public.xyVisTypes.line.$1", "type": "boolean", "tags": [], "label": "showElasticChartsOptions", @@ -958,7 +958,7 @@ "children": [ { "parentPluginId": "visTypeXy", - "id": "def-public.showElasticChartsOptions", + "id": "def-public.xyVisTypes.histogram.$1", "type": "boolean", "tags": [], "label": "showElasticChartsOptions", @@ -985,7 +985,7 @@ "children": [ { "parentPluginId": "visTypeXy", - "id": "def-public.showElasticChartsOptions", + "id": "def-public.xyVisTypes.horizontalBar.$1", "type": "boolean", "tags": [], "label": "showElasticChartsOptions", diff --git a/api_docs/vis_type_xy.mdx b/api_docs/vis_type_xy.mdx index 7ec3079931651..3ada19b687b89 100644 --- a/api_docs/vis_type_xy.mdx +++ b/api_docs/vis_type_xy.mdx @@ -12,7 +12,7 @@ import visTypeXyObj from './vis_type_xy.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 [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/visualizations.json b/api_docs/visualizations.json index ec8f8939d3ccd..a5230d4981bf9 100644 --- a/api_docs/visualizations.json +++ b/api_docs/visualizations.json @@ -365,7 +365,7 @@ "children": [ { "parentPluginId": "visualizations", - "id": "def-public.vis", + "id": "def-public.BaseVisType.toExpressionAst.$1", "type": "Object", "tags": [], "label": "vis", @@ -385,7 +385,7 @@ }, { "parentPluginId": "visualizations", - "id": "def-public.params", + "id": "def-public.BaseVisType.toExpressionAst.$2", "type": "Object", "tags": [], "label": "params", @@ -1324,13 +1324,7 @@ "text": "SavedVisState" }, "<", - { - "pluginId": "visualizations", - "scope": "common", - "docId": "kibVisualizationsPluginApi", - "section": "def-common.VisParams", - "text": "VisParams" - }, + "SerializableRecord", ">" ], "path": "src/plugins/visualizations/public/legacy/vis_update_state.d.ts", @@ -1711,93 +1705,6 @@ ], "initialIsOpen": false }, - { - "parentPluginId": "visualizations", - "id": "def-public.SavedVisState", - "type": "Interface", - "tags": [], - "label": "SavedVisState", - "description": [], - "signature": [ - { - "pluginId": "visualizations", - "scope": "common", - "docId": "kibVisualizationsPluginApi", - "section": "def-common.SavedVisState", - "text": "SavedVisState" - }, - "" - ], - "path": "src/plugins/visualizations/common/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "visualizations", - "id": "def-public.SavedVisState.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "path": "src/plugins/visualizations/common/types.ts", - "deprecated": false - }, - { - "parentPluginId": "visualizations", - "id": "def-public.SavedVisState.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "path": "src/plugins/visualizations/common/types.ts", - "deprecated": false - }, - { - "parentPluginId": "visualizations", - "id": "def-public.SavedVisState.params", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "TVisParams" - ], - "path": "src/plugins/visualizations/common/types.ts", - "deprecated": false - }, - { - "parentPluginId": "visualizations", - "id": "def-public.SavedVisState.aggs", - "type": "Array", - "tags": [], - "label": "aggs", - "description": [], - "signature": [ - "Pick & Pick<{ type: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IAggType", - "text": "IAggType" - }, - "; }, \"type\"> & Pick<{ type: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IAggType", - "text": "IAggType" - }, - "; }, never>, \"type\" | \"enabled\" | \"id\" | \"schema\" | \"params\">[]" - ], - "path": "src/plugins/visualizations/common/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, { "parentPluginId": "visualizations", "id": "def-public.Schema", @@ -2196,25 +2103,9 @@ "label": "aggs", "description": [], "signature": [ - "Pick & Pick<{ type: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IAggType", - "text": "IAggType" - }, - "; }, \"type\"> & Pick<{ type: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IAggType", - "text": "IAggType" - }, - "; }, never>, \"type\" | \"enabled\" | \"id\" | \"schema\" | \"params\">[]" + " | undefined; schema?: string | undefined; }[]" ], "path": "src/plugins/visualizations/public/vis.ts", "deprecated": false @@ -3412,7 +3303,7 @@ "children": [ { "parentPluginId": "visualizations", - "id": "def-public.vis", + "id": "def-public.VisTypeDefinition.toExpressionAst.$1", "type": "Object", "tags": [], "label": "vis", @@ -3432,7 +3323,7 @@ }, { "parentPluginId": "visualizations", - "id": "def-public.params", + "id": "def-public.VisTypeDefinition.toExpressionAst.$2", "type": "Object", "tags": [], "label": "params", @@ -4012,6 +3903,22 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "visualizations", + "id": "def-public.SavedVisState", + "type": "Type", + "tags": [], + "label": "SavedVisState", + "description": [], + "signature": [ + "{ title: string; type: string; params: TVisParams; aggs: { type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", + "SerializableRecord", + " | undefined; schema?: string | undefined; }[]; }" + ], + "path": "src/plugins/visualizations/common/types.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "visualizations", "id": "def-public.VisToExpressionAst", @@ -4060,7 +3967,7 @@ "children": [ { "parentPluginId": "visualizations", - "id": "def-public.vis", + "id": "def-public.VisToExpressionAst.$1", "type": "Object", "tags": [], "label": "vis", @@ -4080,7 +3987,7 @@ }, { "parentPluginId": "visualizations", - "id": "def-public.params", + "id": "def-public.VisToExpressionAst.$2", "type": "Object", "tags": [], "label": "params", @@ -4124,7 +4031,7 @@ "signature": [ "\"visualization\"" ], - "path": "src/plugins/visualizations/public/embeddable/constants.ts", + "path": "src/plugins/visualizations/common/constants.ts", "deprecated": false, "initialIsOpen": false }, @@ -4342,7 +4249,43 @@ "label": "VisualizeEmbeddableFactoryContract", "description": [], "signature": [ - "{ readonly type: \"visualization\"; create: (input: ", + "{ readonly type: \"visualization\"; inject: (_state: ", + { + "pluginId": "embeddable", + "scope": "common", + "docId": "kibEmbeddablePluginApi", + "section": "def-common.EmbeddableStateWithType", + "text": "EmbeddableStateWithType" + }, + ", references: ", + "SavedObjectReference", + "[]) => ", + { + "pluginId": "embeddable", + "scope": "common", + "docId": "kibEmbeddablePluginApi", + "section": "def-common.EmbeddableStateWithType", + "text": "EmbeddableStateWithType" + }, + "; extract: (_state: ", + { + "pluginId": "embeddable", + "scope": "common", + "docId": "kibEmbeddablePluginApi", + "section": "def-common.EmbeddableStateWithType", + "text": "EmbeddableStateWithType" + }, + ") => { state: ", + { + "pluginId": "embeddable", + "scope": "common", + "docId": "kibEmbeddablePluginApi", + "section": "def-common.EmbeddableStateWithType", + "text": "EmbeddableStateWithType" + }, + "; references: ", + "SavedObjectReference", + "[]; }; create: (input: ", { "pluginId": "visualizations", "scope": "public", @@ -4454,43 +4397,7 @@ "section": "def-public.SavedObjectMetaData", "text": "SavedObjectMetaData" }, - "; extract: (_state: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - ") => { state: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - "; references: ", - "SavedObjectReference", - "[]; }; inject: (_state: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - ", references: ", - "SavedObjectReference", - "[]) => ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - "; getCurrentAppId: () => Promise; checkTitle: (props: ", + "; getCurrentAppId: () => Promise; checkTitle: (props: ", { "pluginId": "savedObjects", "scope": "public", @@ -4826,7 +4733,7 @@ "children": [ { "parentPluginId": "visualizations", - "id": "def-public.savedVis", + "id": "def-public.VisualizationsStart.convertToSerializedVis.$1", "type": "Object", "tags": [], "label": "savedVis", @@ -4884,7 +4791,7 @@ "children": [ { "parentPluginId": "visualizations", - "id": "def-public.vis", + "id": "def-public.VisualizationsStart.convertFromSerializedVis.$1", "type": "Object", "tags": [], "label": "vis", @@ -4930,7 +4837,7 @@ "children": [ { "parentPluginId": "visualizations", - "id": "def-public.__0", + "id": "def-public.VisualizationsStart.showNewVisModal.$1", "type": "Object", "tags": [], "label": "__0", @@ -5271,7 +5178,15 @@ "section": "def-common.Datatable", "text": "Datatable" }, - ", Arguments, ", + ", ", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.Arguments", + "text": "Arguments" + }, + ", ", { "pluginId": "expressions", "scope": "common", @@ -5317,86 +5232,51 @@ "interfaces": [ { "parentPluginId": "visualizations", - "id": "def-common.SavedVisState", + "id": "def-common.Arguments", "type": "Interface", "tags": [], - "label": "SavedVisState", + "label": "Arguments", "description": [], - "signature": [ - { - "pluginId": "visualizations", - "scope": "common", - "docId": "kibVisualizationsPluginApi", - "section": "def-common.SavedVisState", - "text": "SavedVisState" - }, - "" - ], - "path": "src/plugins/visualizations/common/types.ts", + "path": "src/plugins/visualizations/common/expression_functions/vis_dimension.ts", "deprecated": false, "children": [ { "parentPluginId": "visualizations", - "id": "def-common.SavedVisState.title", - "type": "string", + "id": "def-common.Arguments.accessor", + "type": "CompoundType", "tags": [], - "label": "title", + "label": "accessor", "description": [], - "path": "src/plugins/visualizations/common/types.ts", + "signature": [ + "string | number" + ], + "path": "src/plugins/visualizations/common/expression_functions/vis_dimension.ts", "deprecated": false }, { "parentPluginId": "visualizations", - "id": "def-common.SavedVisState.type", + "id": "def-common.Arguments.format", "type": "string", "tags": [], - "label": "type", - "description": [], - "path": "src/plugins/visualizations/common/types.ts", - "deprecated": false - }, - { - "parentPluginId": "visualizations", - "id": "def-common.SavedVisState.params", - "type": "Uncategorized", - "tags": [], - "label": "params", + "label": "format", "description": [], "signature": [ - "TVisParams" + "string | undefined" ], - "path": "src/plugins/visualizations/common/types.ts", + "path": "src/plugins/visualizations/common/expression_functions/vis_dimension.ts", "deprecated": false }, { "parentPluginId": "visualizations", - "id": "def-common.SavedVisState.aggs", - "type": "Array", + "id": "def-common.Arguments.formatParams", + "type": "string", "tags": [], - "label": "aggs", + "label": "formatParams", "description": [], "signature": [ - "Pick & Pick<{ type: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IAggType", - "text": "IAggType" - }, - "; }, \"type\"> & Pick<{ type: ", - { - "pluginId": "data", - "scope": "common", - "docId": "kibDataSearchPluginApi", - "section": "def-common.IAggType", - "text": "IAggType" - }, - "; }, never>, \"type\" | \"enabled\" | \"id\" | \"schema\" | \"params\">[]" + "string | undefined" ], - "path": "src/plugins/visualizations/common/types.ts", + "path": "src/plugins/visualizations/common/expression_functions/vis_dimension.ts", "deprecated": false } ], @@ -5599,6 +5479,22 @@ "path": "src/plugins/visualizations/common/expression_functions/vis_dimension.ts", "deprecated": false, "initialIsOpen": false + }, + { + "parentPluginId": "visualizations", + "id": "def-common.SavedVisState", + "type": "Type", + "tags": [], + "label": "SavedVisState", + "description": [], + "signature": [ + "{ title: string; type: string; params: TVisParams; aggs: { type: string; enabled?: boolean | undefined; id?: string | undefined; params?: {} | ", + "SerializableRecord", + " | undefined; schema?: string | undefined; }[]; }" + ], + "path": "src/plugins/visualizations/common/types.ts", + "deprecated": false, + "initialIsOpen": false } ], "objects": [] diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index 6eaadf84dc66c..012db4b9db9d8 100644 --- a/api_docs/visualizations.mdx +++ b/api_docs/visualizations.mdx @@ -12,13 +12,13 @@ import visualizationsObj from './visualizations.json'; Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable. -Contact [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. **Code health stats** | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 279 | 13 | 261 | 15 | +| 275 | 13 | 257 | 15 | ## Client diff --git a/api_docs/visualize.json b/api_docs/visualize.json index 7fb68e8a8877f..7cafece8d41af 100644 --- a/api_docs/visualize.json +++ b/api_docs/visualize.json @@ -230,7 +230,7 @@ "tags": [], "label": "VisualizeConstants", "description": [], - "path": "src/plugins/visualize/public/application/visualize_constants.ts", + "path": "src/plugins/visualize/common/constants.ts", "deprecated": false, "children": [ { @@ -240,7 +240,7 @@ "tags": [], "label": "VISUALIZE_BASE_PATH", "description": [], - "path": "src/plugins/visualize/public/application/visualize_constants.ts", + "path": "src/plugins/visualize/common/constants.ts", "deprecated": false }, { @@ -250,7 +250,7 @@ "tags": [], "label": "LANDING_PAGE_PATH", "description": [], - "path": "src/plugins/visualize/public/application/visualize_constants.ts", + "path": "src/plugins/visualize/common/constants.ts", "deprecated": false }, { @@ -260,7 +260,7 @@ "tags": [], "label": "WIZARD_STEP_1_PAGE_PATH", "description": [], - "path": "src/plugins/visualize/public/application/visualize_constants.ts", + "path": "src/plugins/visualize/common/constants.ts", "deprecated": false }, { @@ -270,7 +270,7 @@ "tags": [], "label": "WIZARD_STEP_2_PAGE_PATH", "description": [], - "path": "src/plugins/visualize/public/application/visualize_constants.ts", + "path": "src/plugins/visualize/common/constants.ts", "deprecated": false }, { @@ -280,7 +280,7 @@ "tags": [], "label": "CREATE_PATH", "description": [], - "path": "src/plugins/visualize/public/application/visualize_constants.ts", + "path": "src/plugins/visualize/common/constants.ts", "deprecated": false }, { @@ -290,7 +290,7 @@ "tags": [], "label": "EDIT_PATH", "description": [], - "path": "src/plugins/visualize/public/application/visualize_constants.ts", + "path": "src/plugins/visualize/common/constants.ts", "deprecated": false }, { @@ -300,7 +300,7 @@ "tags": [], "label": "EDIT_BY_VALUE_PATH", "description": [], - "path": "src/plugins/visualize/public/application/visualize_constants.ts", + "path": "src/plugins/visualize/common/constants.ts", "deprecated": false }, { @@ -310,7 +310,7 @@ "tags": [], "label": "APP_ID", "description": [], - "path": "src/plugins/visualize/public/application/visualize_constants.ts", + "path": "src/plugins/visualize/common/constants.ts", "deprecated": false } ], diff --git a/api_docs/visualize.mdx b/api_docs/visualize.mdx index 3628c53cc81b9..0d387e370c1a0 100644 --- a/api_docs/visualize.mdx +++ b/api_docs/visualize.mdx @@ -12,7 +12,7 @@ import visualizeObj from './visualize.json'; Contains the visualize application which includes the listing page and the app frame, which will load the visualization's editor. -Contact [Kibana App](https://github.com/orgs/elastic/teams/kibana-app) for questions regarding this plugin. +Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) for questions regarding this plugin. **Code health stats** diff --git a/dev_docs/key_concepts/anatomy_of_a_plugin.mdx b/dev_docs/key_concepts/anatomy_of_a_plugin.mdx index b22bc6f101998..3739f907c3d87 100644 --- a/dev_docs/key_concepts/anatomy_of_a_plugin.mdx +++ b/dev_docs/key_concepts/anatomy_of_a_plugin.mdx @@ -32,6 +32,7 @@ plugins/ plugin.ts common index.ts + jest.config.js ``` ### kibana.json @@ -209,6 +210,29 @@ considerations related to how plugins integrate with core APIs and APIs exposed `common/index.ts` is the entry-point into code that can be used both server-side or client side. +### jest.config.js + +If you are adding unit tests (which we recommend), you will need to add a `jest.config.js` file. Here is an example file that you would use if adding a plugin into the `examples` directory. + +```js +module.exports = { + // Default Jest settings, defined in kbn-test package + preset: '@kbn/test', + // The root of the directory containing package.json + rootDir: '../../..', + // The directory which Jest should use to search for files in + roots: ['/src/plugins/demo'], + // The directory where Jest should output plugin coverage details, e.g. html report + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/demo', + // A list of reporter names that Jest uses when writing coverage reports, default: ["json"] + // "text" is available in console and is good for quick check + // "html" helps to dig into specific files and fix coverage + coverageReporters: ['text', 'html'], + // An array of regexp pattern strings that matched files to include/exclude for code coverage + collectCoverageFrom: ['/src/plugins/demo/{common,public,server}/**/*.{ts,tsx}'], +}; +``` + ## How plugin's interact with each other, and Core The lifecycle-specific contracts exposed by core services are always passed as the first argument to the equivalent lifecycle function in a plugin. diff --git a/dev_docs/key_concepts/performance.mdx b/dev_docs/key_concepts/performance.mdx new file mode 100644 index 0000000000000..f7b71b0258914 --- /dev/null +++ b/dev_docs/key_concepts/performance.mdx @@ -0,0 +1,106 @@ +--- +id: kibDevPerformance +slug: /kibana-dev-docs/performance +title: Performance +summary: Performance tips for Kibana development. +date: 2021-09-02 +tags: ['kibana', 'onboarding', 'dev', 'performance'] +--- + +## Keep Kibana fast + +*tl;dr*: Load as much code lazily as possible. Everyone loves snappy +applications with a responsive UI and hates spinners. Users deserve the +best experience whether they run Kibana locally or +in the cloud, regardless of their hardware and environment. + +There are 2 main aspects of the perceived speed of an application: loading time +and responsiveness to user actions. Kibana loads and bootstraps *all* +the plugins whenever a user lands on any page. It means that +every new application affects the overall _loading performance_, as plugin code is +loaded _eagerly_ to initialize the plugin and provide plugin API to dependent +plugins. + +However, it’s usually not necessary that the whole plugin code should be loaded +and initialized at once. The plugin could keep on loading code covering API functionality +on Kibana bootstrap, but load UI related code lazily on-demand, when an +application page or management section is mounted. +Always prefer to import UI root components lazily when possible (such as in `mount` +handlers). Even if their size may seem negligible, they are likely using +some heavy-weight libraries that will also be removed from the initial +plugin bundle, therefore, reducing its size by a significant amount. + +```ts +import type { Plugin, CoreSetup, AppMountParameters } from 'kibana/public'; +export class MyPlugin implements Plugin { + setup(core: CoreSetup, plugins: SetupDeps) { + core.application.register({ + id: 'app', + title: 'My app', + async mount(params: AppMountParameters) { + const { mountApp } = await import('./app/mount_app'); + return mountApp(await core.getStartServices(), params); + }, + }); + plugins.management.sections.section.kibana.registerApp({ + id: 'app', + title: 'My app', + order: 1, + async mount(params) { + const { mountManagementSection } = await import('./app/mount_management_section'); + return mountManagementSection(coreSetup, params); + }, + }); + return { + doSomething() {}, + }; + } +} +``` + +### Understanding plugin bundle size + +Kibana Platform plugins are pre-built with `@kbn/optimizer` +and distributed as package artifacts. This means that it is no +longer necessary for us to include the `optimizer` in the +distributable version of Kibana Every plugin artifact contains all +plugin dependencies required to run the plugin, except some +stateful dependencies shared across plugin bundles via +`@kbn/ui-shared-deps`. This means that plugin artifacts _tend to +be larger_ than they were in the legacy platform. To understand the +current size of your plugin artifact, run `@kbn/optimizer` with: + +```bash +node scripts/build_kibana_platform_plugins.js --dist --profile --focus=my_plugin +``` + +and check the output in the `target` sub-folder of your plugin folder: + +```bash +ls -lh plugins/my_plugin/target/public/ +# output +# an async chunk loaded on demand +... 262K 0.plugin.js +# eagerly loaded chunk +... 50K my_plugin.plugin.js +``` + +You might see at least one js bundle - `my_plugin.plugin.js`. This is +the _only_ artifact loaded by Kibana during bootstrap in the +browser. The rule of thumb is to keep its size as small as possible. +Other lazily loaded parts of your plugin will be present in the same folder as +separate chunks under `{number}.myplugin.js` names. If you want to +investigate what your plugin bundle consists of, you need to run +`@kbn/optimizer` with `--profile` flag to generate a +[webpack stats file](https://webpack.js.org/api/stats/). + +```bash +node scripts/build_kibana_platform_plugins.js --dist --no-examples --profile +``` + +Many OSS tools allow you to analyze the generated stats file: + +* [An official tool](https://webpack.github.io/analyse/#modules) from +Webpack authors +* [webpack-visualizer](https://chrisbateman.github.io/webpack-visualizer/) +* [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) diff --git a/dev_docs/troubleshooting.mdx b/dev_docs/troubleshooting.mdx new file mode 100644 index 0000000000000..f624a8cd77507 --- /dev/null +++ b/dev_docs/troubleshooting.mdx @@ -0,0 +1,28 @@ +--- +id: kibTroubleshooting +slug: /kibana-dev-docs/troubleshooting +title: Troubleshooting +summary: A collection of tips for working around strange issues. +date: 2021-09-08 +tags: ['kibana', 'onboarding', 'dev', 'troubleshooting'] +--- + +### Typescript issues + +When switching branches, sometimes the TypeScript cache can get mixed up and show some invalid errors. If you run into TypeScript issues (invalid errors, or if it's taking too long to build types), here a few things to try. + +1. Build TypeScript references with the clean command. + +``` +node scripts/build_ts_refs --clean +``` + +2. Restore your repository to a totally fresh state by running `git clean` + +``` +# dry-run the clean to see what will be deleted +git clean -fdxn -e /config -e /.vscode + +# review the files which will be deleted, consider adding some more excludes (-e) +# re-run without the dry-run (-n) flag to actually delete the files +``` diff --git a/dev_docs/tutorials/testing_plugins.mdx b/dev_docs/tutorials/testing_plugins.mdx index 55b662421cbd0..bc92af33d3493 100644 --- a/dev_docs/tutorials/testing_plugins.mdx +++ b/dev_docs/tutorials/testing_plugins.mdx @@ -928,6 +928,17 @@ describe('Case migrations v7.7.0 -> v7.8.0', () => { }); ``` +You can generate code coverage report for a single plugin. + +```bash +yarn jest --coverage --config src/plugins/console/jest.config.js +``` + +Html report should be available in `target/kibana-coverage/jest/src/plugins/console` path + +We run code coverage daily on CI and ["Kibana Stats cluster"](https://kibana-stats.elastic.dev/s/code-coverage/app/home) +can be used to view statistics. The report combines code coverage for all jest tests within Kibana repository. + #### Integration testing With more complicated migrations, the behavior of the migration may be dependent on values from other plugins which may be difficult or even impossible to test with unit tests. You need to actually bootstrap Kibana, load the plugins, and diff --git a/docs/CHANGELOG.asciidoc b/docs/CHANGELOG.asciidoc index 96a7e57ef3e4f..3b783f795558d 100644 --- a/docs/CHANGELOG.asciidoc +++ b/docs/CHANGELOG.asciidoc @@ -8,25 +8,172 @@ :issue: https://github.com/elastic/kibana/issues/ :pull: https://github.com/elastic/kibana/pull/ -This section summarizes the changes in each release. +Review important information about the {kib} 8.0.0 releases. +* <> * <> -- +[[release-notes-8.0.0-alpha2]] +== {kib} 8.0.0-alpha2 + +coming::[8.0.0-alpha2] + +Review the {kib} 8.0.0-alpha2 changes, then use the <> to complete the upgrade. + +[float] +[[breaking-changes-8.0.0-alpha2]] +=== Breaking changes + +Breaking changes can prevent your application from optimal operation and performance. Review the following breaking changes, then mitigate the impact to your application. + +//tag::notable-breaking-changes[] + +[discrete] +[[breaking-110830]] +.Changes the `GET /api/status` default behavior +[%collapsible] +==== +*Details* + +`GET /api/status` reports a new and more verbose payload. For more information, refer to {kibana-pull}110830[#110830]. + +*Impact* + +To retrieve the {kib} status in the previous format, use `GET /api/status?v7format=true`. +==== + +[discrete] +[[breaking-110738]] +.Removes support for legacy exports +[%collapsible] +==== +*Details* + +In {kib} 8.0.0 and later, the legacy format from {kib} 6.x is unsupported. For more information, refer to {kibana-pull}110738[#110738] + +*Impact* + +Using the user interface to import saved objects is restricted to `.ndjson` format imports. +==== + +[discrete] +[[breaking-109896]] +.Removes `map.regionmap.*` +[%collapsible] +==== +*Details* + +The deprecated `map.regionmap.*` setting in kibana.yml has been removed. For more information, refer to {kibana-pull}109896[#109896]. + +*Impact* + +If you have maps that use `map.regionmap` layers: + +. Remove the `map.regionmap` layer. + +. To recreate the choropleth layer, use <> to index your static vector data into {es}. + +. Create a choropleth layer from the indexed vector data. +==== + +[discrete] +[[breaking-109798]] +.Removes `kibana.defaultAppId` +[%collapsible] +==== +*Details* + +The deprecated `kibana.defaultAppId` setting in kibana.yml, which is also available as `kibana_legacy.defaultAppId`, has been removed. For more information, refer to {kibana-pull}109798[#109798]. + +*Impact* + +When you upgrade, remove `kibana.defaultAppId` from your kibana.yml file. To configure the default route for users when they enter a space, use the <> in *Advanced Settings*. +==== + +[discrete] +[[breaking-109350]] +.Removes `courier:batchSearches` +[%collapsible] +==== +*Details* + +The deprecated `courier:batchSearches` setting in *Advanced Settings* has been removed. For more information, refer to {kibana-pull}109350[#109350]. + +*Impact* + +When you upgrade, the `courier:batchSearches` setting will no longer be available. +==== + +[discrete] +[[breaking-108111]] +.Removes `xpack.task_manager.index` +[%collapsible] +==== +*Details* + +The deprecated `xpack.task_manager.index` setting in kibana.yml has been removed. For more information, refer to {kibana-pull}108111[#108111]. + +*Impact* + +When you upgrade, remove `xpack.task_manager.index` from your kibana.yml file. +==== + +[discrete] +[[breaking-108103]] +.Removes dashboard-only mode +[%collapsible] +==== +*Details* + +The legacy dashboard-only mode has been removed. For more information, refer to {kibana-pull}108103[#108103]. + +*Impact* + +To grant users access to only dashboards, create a new role, then assign only the *Dashboard* feature privilege. For more information, refer to <>. +==== + +[discrete] +[[breaking-105979]] +.Removes `xpack.maps.showMapVisualizationTypes` +[%collapsible] +==== +*Details* + +The deprecated `xpack.maps.showMapVisualizationTypes` setting in kibana.yml has been removed. For more information, refer to {kibana-pull}105979[#105979] + +*Impact* + +When you upgrade, remove `xpack.maps.showMapVisualizationTypes` from your kibana.yml file. +==== + +For the {kib} 8.0.0-alpha1 breaking changes, refer to <>. + +//end::notable-breaking-changes[] + +[float] +[[features-8.0.0-alpha2]] +=== Features +The 8.0.0-alpha2 release adds the following new and notable feature. + +Security:: +* Adds the interactive setup mode {kibana-pull}106881[#106881] + +[float] +[[enhancement-v8.0.0-alpha2]] +=== Enhancements +The 8.0.0-alpha2 release includes the following enhancements. + +Elastic Security:: +For the Elastic Security 8.0.0-alpha2 release information, refer to {security-guide}/release-notes.html[_Elastic Security Solution Release Notes_]. +Security:: +* Interactive setup mode {kibana-pull}106881[#106881] + +[float] +[[fixes-v8.0.0-alpha2]] +=== Bug fix +The 8.0.0-alpha2 release includes the following bug fix. + +Operations:: +* Moves systemd service to /usr/lib/systemd/system {kibana-pull}83571[#83571] [[release-notes-8.0.0-alpha1]] == {kib} 8.0.0-alpha1 -The following changes are released for the first time in {kib} 8.0.0-alpha1. Review the changes, then use the <> to complete the upgrade. +Review the {kib} 8.0.0-alpha1 changes, then use the <> to complete the upgrade. [float] [[breaking-changes-8.0.0]] === Breaking changes -Breaking changes can prevent your application from optimal operation and performance. Review the breaking changes, then mitigrate the impact to your appilication. +Breaking changes can prevent your application from optimal operation and performance. Review the breaking changes, then mitigate the impact to your application. -// tag::notable-breaking-changes[] +//tag::notable-breaking-changes[] [float] [[enterprise-search-change]] @@ -231,6 +378,18 @@ The `logging.useUTC` setting has been removed. For more information, refer to {k The default timezone is UTC. To change the timezone, set `logging.timezone: false` in kibana.yml. Change the timezone when the system, such as a docker container, is configured for a nonlocal timezone. ==== +[discrete] +[[breaking-32049]] +.Removed environment variables `CONFIG_PATH` and `DATA_PATH` +[%collapsible] +==== +*Details* + +The environment variables `CONFIG_PATH` and `DATA_PATH` have been removed. For more information, refer to {kibana-pull}32049[#32049] + +*Impact* + +Use the environment variable `KBN_PATH_CONF` instead of `CONFIG_PATH`. Use the setting `path.data` instead of `DATA_PATH`. +==== + // end::notable-breaking-changes[] [float] @@ -271,8 +430,3 @@ The 8.0.0-alpha1 release includes the following bug fix. Operations:: * Moves systemd service to /usr/lib/systemd/system {kibana-pull}83571[#83571] - -//[[release-notes-8.0.0]] -//== {kib} 8.0.0 - -//coming::[8.0.0] diff --git a/docs/api/features.asciidoc b/docs/api/features.asciidoc index dad3ef75c8117..69f0effb80023 100644 --- a/docs/api/features.asciidoc +++ b/docs/api/features.asciidoc @@ -134,7 +134,6 @@ The API returns the following: "index-pattern", "search", "visualization", - "timelion-sheet", "canvas-workpad" ] }, @@ -152,7 +151,6 @@ The API returns the following: "index-pattern", "search", "visualization", - "timelion-sheet", "canvas-workpad", "dashboard" ] diff --git a/docs/api/role-management/get.asciidoc b/docs/api/role-management/get.asciidoc index d1e9d1e6afa83..b18b2e231774a 100644 --- a/docs/api/role-management/get.asciidoc +++ b/docs/api/role-management/get.asciidoc @@ -73,9 +73,6 @@ The API returns the following: "indexPatterns": [ "read" ], - "timelion": [ - "all" - ], "graph": [ "all" ], diff --git a/docs/api/role-management/put.asciidoc b/docs/api/role-management/put.asciidoc index be46178100095..92750840aca10 100644 --- a/docs/api/role-management/put.asciidoc +++ b/docs/api/role-management/put.asciidoc @@ -94,9 +94,6 @@ $ curl -X PUT api/security/role/my_kibana_role "indexPatterns": [ "read" ], - "timelion": [ - "all" - ], "graph": [ "all" ], diff --git a/docs/api/saved-objects/bulk_create.asciidoc b/docs/api/saved-objects/bulk_create.asciidoc index 5bd3a7587dde9..a935907ef3f11 100644 --- a/docs/api/saved-objects/bulk_create.asciidoc +++ b/docs/api/saved-objects/bulk_create.asciidoc @@ -30,7 +30,7 @@ experimental[] Create multiple {kib} saved objects. ==== Request body `type`:: - (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`, and `timelion-sheet`. + (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`. `id`:: (Optional, string) Specifies an ID instead of using a randomly generated ID. diff --git a/docs/api/saved-objects/bulk_get.asciidoc b/docs/api/saved-objects/bulk_get.asciidoc index 4c6bf4c19a76c..1bcdf7ba33cf4 100644 --- a/docs/api/saved-objects/bulk_get.asciidoc +++ b/docs/api/saved-objects/bulk_get.asciidoc @@ -23,7 +23,7 @@ experimental[] Retrieve multiple {kib} saved objects by ID. ==== Request Body `type`:: - (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`, and `timelion-sheet`. + (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`. `id`:: (Required, string) ID of the retrieved object. The ID includes the {kib} unique identifier or a custom identifier. diff --git a/docs/api/saved-objects/create.asciidoc b/docs/api/saved-objects/create.asciidoc index e7e25c7d3bba6..437bdb497da26 100644 --- a/docs/api/saved-objects/create.asciidoc +++ b/docs/api/saved-objects/create.asciidoc @@ -24,7 +24,7 @@ experimental[] Create {kib} saved objects. (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. ``:: - (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`, and `timelion-sheet`. + (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`. ``:: (Optional, string) Specifies an ID instead of using a randomly generated ID. diff --git a/docs/api/saved-objects/delete.asciidoc b/docs/api/saved-objects/delete.asciidoc index 9c342cb4d843e..ab50fd6e37eac 100644 --- a/docs/api/saved-objects/delete.asciidoc +++ b/docs/api/saved-objects/delete.asciidoc @@ -22,7 +22,7 @@ WARNING: Once you delete a saved object, _it cannot be recovered_. (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. `type`:: - (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`, and `timelion-sheet`. + (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`. `id`:: (Required, string) The object ID that you want to remove. diff --git a/docs/api/saved-objects/get.asciidoc b/docs/api/saved-objects/get.asciidoc index 4c8cd020e0286..cfc591d811227 100644 --- a/docs/api/saved-objects/get.asciidoc +++ b/docs/api/saved-objects/get.asciidoc @@ -21,7 +21,7 @@ experimental[] Retrieve a single {kib} saved object by ID. `type`:: - (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`, and `timelion-sheet`. + (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`. `id`:: (Required, string) The ID of the object to retrieve. diff --git a/docs/api/saved-objects/resolve.asciidoc b/docs/api/saved-objects/resolve.asciidoc index abfad6a0a8150..aa18538975f5f 100644 --- a/docs/api/saved-objects/resolve.asciidoc +++ b/docs/api/saved-objects/resolve.asciidoc @@ -25,7 +25,7 @@ object can be retrieved via the Resolve API using either its new ID or its old I `type`:: - (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`, and `timelion-sheet`. + (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`. `id`:: (Required, string) The ID of the object to retrieve. diff --git a/docs/api/saved-objects/update.asciidoc b/docs/api/saved-objects/update.asciidoc index d237ced8b52d1..2bd95df1adf30 100644 --- a/docs/api/saved-objects/update.asciidoc +++ b/docs/api/saved-objects/update.asciidoc @@ -20,7 +20,7 @@ experimental[] Update the attributes for existing {kib} saved objects. (Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used. `type`:: - (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`, and `timelion-sheet`. + (Required, string) Valid options include `visualization`, `dashboard`, `search`, `index-pattern`, `config`. `id`:: (Required, string) The object ID to update. diff --git a/docs/api/spaces-management/get_all.asciidoc b/docs/api/spaces-management/get_all.asciidoc index e76848da80efb..3c95b1b904441 100644 --- a/docs/api/spaces-management/get_all.asciidoc +++ b/docs/api/spaces-management/get_all.asciidoc @@ -70,7 +70,7 @@ The API returns the following: "id": "sales", "name": "Sales", "initials": "MK", - "disabledFeatures": ["discover", "timelion"], + "disabledFeatures": ["discover"], "imageUrl": "" } ] @@ -124,7 +124,7 @@ The API returns the following: "id": "sales", "name": "Sales", "initials": "MK", - "disabledFeatures": ["discover", "timelion"], + "disabledFeatures": ["discover"], "imageUrl": "", "authorizedPurposes": { "any": true, diff --git a/docs/api/spaces-management/post.asciidoc b/docs/api/spaces-management/post.asciidoc index 1abfffd1c736f..28d60caa0d333 100644 --- a/docs/api/spaces-management/post.asciidoc +++ b/docs/api/spaces-management/post.asciidoc @@ -54,7 +54,7 @@ $ curl -X POST api/spaces/space "description" : "This is the Marketing Space", "color": "#aabbcc", "initials": "MK", - "disabledFeatures": ["timelion"], + "disabledFeatures": [], "imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAABACAYAAABC6cT1AAAGf0lEQVRoQ+3abYydRRUH8N882xYo0IqagEVjokQJKAiKBjXExC9G/aCkGowCIghCkRcrVSSKIu/FEiqgGL6gBIlAYrAqUTH6hZgQFVEMKlQFfItWoQWhZe8z5uzMLdvbfbkLxb13d+fbvfe588x/zpn/+Z9zJpmnI81T3BaAzzfLL1h8weLzZAcWXH2eGHo7zAWLL1h8nuzAjFw9G1N6Kzq8HnuM36MR8iibF3Fv4q+7cv8yDV6K13bYq2furSP8Ag8ncr/vnSnwRViJT2GfCV7yL1yHGxLb+l3EdM9lluNEnIC9xz+f2ZL4Er6Z2DrdXN3fZwp8CU7OfDHxggle8lTLbQ1nJ/7Z7yKmey5zYGZt4h2IzR8/trRc2PDlxJPTzfVcgJ+CC0wMPOa9F6cm7up3EVM9V9386MxliVdM8GwAv6hh/awCz/w7lY25OtF5ruBz4ZLP42NYNrDAFbC3YPWuILnMAfgq3oaRQQYea/stViV+sgssvjKzLvGySeaaNVfP4d7Btokgvxj/bblgpueuF1hmWcyTCmfE3J3M1lTcv0vMswM88zR+jpw4osu6me8kzkpsfLZWzxyRuabO22buxxOJ12FxnXfWgEe83pB5sOE47BsLymzscOoi7nw2JJfZreUjiUsTyzKPZm5NvBDvSuw268AzNzV8H5/Am+qCnsAXgpgSW2Zq9cyKlksbPlTd+te4quWNieMHBfiNDdciYnwsdI/MaOaWhnMTf54J8CqNj8x8JXFIZltYu+HqlmNT8YSBsHgAPw/vxvlVV4du/s0oaxbxg0TbL/jMni0nNcVjQq7+HZfgtpbzBg342TgQ63AkmsymxBW4IjE6A+D7Vzd/fyWxIM/VuCe+HzTgZ2Jpy/kNJ2FJLmLm24mPJ/42A+Bvrxt4SISwlhsaPodH26LZB8rVA3inwwebsrixJCZzX+KMxI/7AV61eVh3DV6Mx3EOvh4kN6jAg8nfUCXm4d1wE66OyxNPTQc+s3/o/MoXizL3JE5O3F3P/uBZPPF4Zr+Wi5uSO48ZPRdyCwn7YB/A35m5KhWNHox4fcNnIs0ddOCRSBxf8+cQG+Huf0l8NJVYP+nI7NXy2ar4QqIGm69JfKPOE2w/mBavCzwM11R2D+ChsUO7hyUfmwx55qDM1xJvqZ7y08TpifuGBfjeURVJnNIVGpkNiXNS0ds7jcySDitDCCWW56LJ10fRo8sNA+3qXUSZD2CtQlZh9T+1rB7h9oliembflnMbzqgSNZKbKGHdPm7OwXb1CvQ1metSETMpszmzvikCJNh/h5E5PHNl4qga/+/cxqrdeWDYgIe7X5L4cGJPJX2940lOX8pD41FnFnc4riluvQKbK0dcHJFi2IBHNTQSlguru4d2/wPOTNzRA3x5y+U1E1uqWDkETOT026XuUJzx6u7ReLhSYenQ7uHua0fKZmwfmcPqsQjxE5WVONcRxn7X89zgn/EKPMRMxOVQXmP18Mx3q3b/Y/0cQE/IhFtHESMsHFlZ1Ml3CH3DZPHImY+pxcKumNmYirtvqMBfhMuU6s3iqOQkTsMPe1tCQwO8Ajs0lxr7W+vnp1MJc9EgCNd/cy6x+9D4veXmprj5wxMw/3C4egW6zzgZOlYZzfwo3F2J7ael0pJamvlPKgWNKFft1AAcKotXoFEbD7kaoSoQPVKB35+5KHF0lai/rJo+up87jWEE/qqqwY+qrL21LWLm95lPJ16ppKw31XC3PXYPJauPEx7B6BHCgrSizRs18qiaRp8tlN3ueCTYPHH9RNaunjI8Z7wLYpT3jZSCYXQ8e9vTsRE/q+no3XMKeObgGtaintbb/AvXj4JDkNw/5hrwYPfIvlZFUbLn7G5q+eQIN09Vnho6cqvnM/Lt99RixH49wO8K0ZL41WTWHoQzvsNVkOheZqKhEGpsp3SzB+BBtZAYve7uOR9tuTaaB6l0XScdYfEQPpkTUyHEGP+XqyDBzu+NBCITUjNWHynkrbWKOuWFn1xKzqsyx0bdvS78odp0+N503Zao0uCsWuSIDku8/7EO60b41vN5+Ses9BKlTdvd8bhp9EBvJjWJAIn/vxwHe6b3tSk6JFPV4nq85oAOrx555v/x/rh3E6Lo+bnuNS4uB4Cuq0ZfvO8X1rM6q/+vnjLVqZq7v83onttc2oYF4HPJmv1gWbB4P7s0l55ZsPhcsmY/WBYs3s8uzaVn5q3F/wf70mRuBCtbjQAAAABJRU5ErkJggg==" } -------------------------------------------------- diff --git a/docs/apm/correlations.asciidoc b/docs/apm/correlations.asciidoc index c0c18433c9021..2165994b8372f 100644 --- a/docs/apm/correlations.asciidoc +++ b/docs/apm/correlations.asciidoc @@ -58,68 +58,34 @@ out, you can begin viewing sample traces to continue your investigation. [[correlations-error-rate]] ==== Find failed transaction correlations -The correlations on the *Error rate* tab help you discover which fields are -contributing to failed transactions. - -By default, a number of attributes commonly known to cause performance issues, -like version, infrastructure, and location, are included, but all are completely -customizable to your APM data. Find something interesting? A quick click of a -button will auto-query your data as you work to resolve the underlying issue. - -The error rate over time chart visualizes the change in error rate over the selected time frame. -Correlated attributes are sorted by _Impact_–a visual representation of the -{ref}/search-aggregations-bucket-significantterms-aggregation.html[significant terms aggregation] -score that powers correlations. -Attributes with a high impact, or attributes present in a large percentage of failed transactions, -may contribute to increased error rates. - -To find error rate correlations, hover over each potentially correlated attribute to -compare the error rate distribution of transactions with and without the selected attribute. - -For example, in the screenshot below, the field `url.original` and value `http://localhost:3100...` -existed in 100% of failed transactions between 6:00 and 10:30. +beta::[] + +The correlations on the *Failed transaction correlations* tab help you discover +which attributes are most influential in distinguishing between transaction +failures and successes. In this context, the success or failure of a transaction +is determined by its {ecs-ref}/ecs-event.html#field-event-outcome[event.outcome] +value. For example, APM agents set the `event.outcome` to `failure` when an HTTP +transaction returns a `5xx` status code. + +// The chart highlights the failed transactions in the overall latency distribution for the transaction group. +If there are attributes that have a statistically significant correlation with +failed transactions, they are listed in a table. The table is sorted by scores, +which are mapped to high, medium, or low impact levels. Attributes with high +impact levels are more likely to contribute to failed transactions. +// By default, the attribute with the highest score is added to the chart. To see a different attribute in the chart, hover over its row in the table. + +For example, in the screenshot below, the field +`kubernetes.pod.name` and value `frontend-node-59dff47885-fl5lb` has a medium +impact level and existed in 19% of the failed transactions. [role="screenshot"] -image::apm/images/error-rate-hover.png[Correlations errors hover effect] - -Select the `+` filter to create a new query in the {apm-app} for transactions with -`url.original: http://localhost:3100...`. With the "noise" now filtered out, -you can begin viewing sample traces to continue your investigation. - -As you sift through erroneous transactions, you'll likely notice other interesting attributes. -Return to the correlations fly-out and select *Customize fields* to search on these new attributes. -You may need to do this a few times–each time filtering out more and more noise and bringing you -closer to a diagnosis. - -[discrete] -[[correlations-customize-fields]] -===== Customize fields - -By default, a handful of attributes commonly known to cause performance issues -are included in the analysis on the *Error rate* tab. You can add and remove -fields under the **Customize fields** dropdown. - -The following fields are selected by default. To keep the default list -manageable, only the first six matching fields with wildcards are used. - -**Frontend (RUM) agent:** - -* `labels.*` -* `user.*` -* `user_agent.name` -* `user_agent.os.name` -* `url.original` - -**Backend agents:** +image::apm/images/correlations-failed-transactions.png[Failed transaction correlations] -* `labels.*` -* `host.ip` -* `service.node.name` -* `service.version` +TIP: Some details, such as the failure and success percentages, are available +only when the +<> +advanced setting is enabled. -[TIP] -==== -* Want to start over? Select **reset** to clear your customizations. -* The *Latency* tab does not have a **Customize fields** dropdown, since it -automatically considers all relevant fields in the transactions. -==== +Select the `+` filter to create a new query in the {apm-app} for transactions +with this attribute. You might do his for multiple attributes--each time +filtering out more and more noise and bringing you closer to a diagnosis. \ No newline at end of file diff --git a/docs/apm/images/correlations-failed-transactions.png b/docs/apm/images/correlations-failed-transactions.png new file mode 100644 index 0000000000000..3258b44f7097b Binary files /dev/null and b/docs/apm/images/correlations-failed-transactions.png differ diff --git a/docs/apm/images/error-rate-hover.png b/docs/apm/images/error-rate-hover.png deleted file mode 100644 index 69f0009309318..0000000000000 Binary files a/docs/apm/images/error-rate-hover.png and /dev/null differ diff --git a/docs/developer/contributing/development-tests.asciidoc b/docs/developer/contributing/development-tests.asciidoc index e7a36d2866728..340e122b44c1b 100644 --- a/docs/developer/contributing/development-tests.asciidoc +++ b/docs/developer/contributing/development-tests.asciidoc @@ -56,6 +56,14 @@ kibana/src/plugins/dashboard/server$ yarn test:jest --coverage yarn jest --coverage --verbose --config /home/tyler/elastic/kibana/src/plugins/dashboard/jest.config.js server ---- +You can generate code coverage report for a single plugin. + +[source,bash] +---- +yarn jest --coverage --config src/plugins/console/jest.config.js +---- + +Html report is available in target/kibana-coverage/jest/path/to/plugin [discrete] === Running browser automation tests diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index e9925014d5a71..55c53129ba499 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -172,10 +172,6 @@ in Kibana, e.g. visualizations. It has the form of a flyout panel. |Utilities for building Kibana plugins. -|{kib-repo}blob/{branch}/src/plugins/legacy_export/README.md[legacyExport] -|The legacyExport plugin adds support for the legacy saved objects export format. - - |{kib-repo}blob/{branch}/src/plugins/management/README.md[management] |This plugins contains the "Stack Management" page framework. It offers navigation and an API to link individual managment section into it. This plugin does not contain any individual @@ -239,11 +235,6 @@ generating deep links to other apps, and creating short URLs. |This plugin adds the Advanced Settings section for the Usage and Security Data collection (aka Telemetry). -|{kib-repo}blob/{branch}/src/plugins/timelion/README.md[timelion] -|Contains the deprecated timelion application. For the timelion visualization, -which also contains the timelion APIs and backend, look at the vis_type_timelion plugin. - - |<> |UI Actions plugins provides API to manage *triggers* and *actions*. @@ -286,7 +277,7 @@ The plugin exposes the static DefaultEditorController class to consume. |The markdown visualization that can be used to place text panels on dashboards. -|{kib-repo}blob/{branch}/src/plugins/vis_type_metric[visTypeMetric] +|{kib-repo}blob/{branch}/src/plugins/vis_types/metric[visTypeMetric] |WARNING: Missing README. @@ -294,15 +285,15 @@ The plugin exposes the static DefaultEditorController class to consume. |WARNING: Missing README. -|{kib-repo}blob/{branch}/src/plugins/vis_type_table/README.md[visTypeTable] +|{kib-repo}blob/{branch}/src/plugins/vis_types/table/README.md[visTypeTable] |Contains the data table visualization, that allows presenting data in a simple table format. -|{kib-repo}blob/{branch}/src/plugins/vis_type_tagcloud[visTypeTagcloud] +|{kib-repo}blob/{branch}/src/plugins/vis_types/tagcloud[visTypeTagcloud] |WARNING: Missing README. -|{kib-repo}blob/{branch}/src/plugins/vis_type_timelion/README.md[visTypeTimelion] +|{kib-repo}blob/{branch}/src/plugins/vis_types/timelion/README.md[visTypeTimelion] |Contains the timelion visualization and the timelion backend. @@ -310,7 +301,7 @@ The plugin exposes the static DefaultEditorController class to consume. |WARNING: Missing README. -|{kib-repo}blob/{branch}/src/plugins/vis_type_vega[visTypeVega] +|{kib-repo}blob/{branch}/src/plugins/vis_types/vega[visTypeVega] |WARNING: Missing README. @@ -350,7 +341,7 @@ The plugin exposes the static DefaultEditorController class to consume. |{kib-repo}blob/{branch}/x-pack/plugins/apm/readme.md[apm] -|To access an elasticsearch instance that has live data you have two options: +|Local setup documentation |{kib-repo}blob/{branch}/x-pack/plugins/banners/README.md[banners] @@ -400,7 +391,7 @@ security and spaces filtering as well as performing audit logging. |{kib-repo}blob/{branch}/x-pack/plugins/enterprise_search/README.md[enterpriseSearch] -|This plugin provides beta Kibana user interfaces for managing the Enterprise Search solution and its products, App Search and Workplace Search. +|This plugin provides Kibana user interfaces for managing the Enterprise Search solution and its products, App Search and Workplace Search. |{kib-repo}blob/{branch}/x-pack/plugins/event_log/README.md[eventLog] diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.hasheaderbanner_.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.hasheaderbanner_.md new file mode 100644 index 0000000000000..6ce0671eb5230 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.hasheaderbanner_.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [ChromeStart](./kibana-plugin-core-public.chromestart.md) > [hasHeaderBanner$](./kibana-plugin-core-public.chromestart.hasheaderbanner_.md) + +## ChromeStart.hasHeaderBanner$() method + +Get an observable of the current header banner presence state. + +Signature: + +```typescript +hasHeaderBanner$(): Observable; +``` +Returns: + +`Observable` + diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.md index 7285b4a00a0ec..ffc77dd653c0f 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.md @@ -57,6 +57,7 @@ core.chrome.setHelpExtension(elem => { | [getHelpExtension$()](./kibana-plugin-core-public.chromestart.gethelpextension_.md) | Get an observable of the current custom help conttent | | [getIsNavDrawerLocked$()](./kibana-plugin-core-public.chromestart.getisnavdrawerlocked_.md) | Get an observable of the current locked state of the nav drawer. | | [getIsVisible$()](./kibana-plugin-core-public.chromestart.getisvisible_.md) | Get an observable of the current visibility state of the chrome. | +| [hasHeaderBanner$()](./kibana-plugin-core-public.chromestart.hasheaderbanner_.md) | Get an observable of the current header banner presence state. | | [setBadge(badge)](./kibana-plugin-core-public.chromestart.setbadge.md) | Override the current badge | | [setBreadcrumbs(newBreadcrumbs)](./kibana-plugin-core-public.chromestart.setbreadcrumbs.md) | Override the current set of breadcrumbs | | [setBreadcrumbsAppendExtension(breadcrumbsAppendExtension)](./kibana-plugin-core-public.chromestart.setbreadcrumbsappendextension.md) | Mount an element next to the last breadcrumb | diff --git a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md index bc6075176cd22..f40f52db55de9 100644 --- a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md +++ b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md @@ -12,6 +12,10 @@ readonly links: { readonly apm: { readonly kibanaSettings: string; readonly supportedServiceMaps: string; + readonly customLinks: string; + readonly droppedTransactionSpans: string; + readonly upgrading: string; + readonly metaData: string; }; readonly canvas: { readonly guide: string; @@ -184,7 +188,16 @@ readonly links: { timeUnits: string; updateTransform: string; }>; - readonly observability: Record; + readonly observability: Readonly<{ + guide: string; + infrastructureThreshold: string; + logsThreshold: string; + metricsThreshold: string; + monitorStatus: string; + monitorUptime: string; + tlsCertificate: string; + uptimeDurationAnomaly: string; + }>; readonly alerting: Record; readonly maps: Record; readonly monitoring: Record; diff --git a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md index aa3f958018041..2499227d20ad4 100644 --- a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md +++ b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md @@ -17,5 +17,5 @@ export interface DocLinksStart | --- | --- | --- | | [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinksstart.doc_link_version.md) | string | | | [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinksstart.elastic_website_url.md) | string | | -| [links](./kibana-plugin-core-public.doclinksstart.links.md) | {
readonly settings: string;
readonly canvas: {
readonly guide: string;
};
readonly dashboard: {
readonly guide: string;
readonly drilldowns: string;
readonly drilldownsTriggerPicker: string;
readonly urlDrilldownTemplateSyntax: string;
readonly urlDrilldownVariables: string;
};
readonly discover: Record<string, string>;
readonly filebeat: {
readonly base: string;
readonly installation: string;
readonly configuration: string;
readonly elasticsearchOutput: string;
readonly elasticsearchModule: string;
readonly startup: string;
readonly exportedFields: string;
readonly suricataModule: string;
readonly zeekModule: string;
};
readonly auditbeat: {
readonly base: string;
readonly auditdModule: string;
readonly systemModule: string;
};
readonly metricbeat: {
readonly base: string;
readonly configure: string;
readonly httpEndpoint: string;
readonly install: string;
readonly start: string;
};
readonly enterpriseSearch: {
readonly base: string;
readonly appSearchBase: string;
readonly workplaceSearchBase: string;
};
readonly heartbeat: {
readonly base: string;
};
readonly libbeat: {
readonly getStarted: string;
};
readonly logstash: {
readonly base: string;
};
readonly functionbeat: {
readonly base: string;
};
readonly winlogbeat: {
readonly base: string;
};
readonly aggs: {
readonly composite: string;
readonly composite_missing_bucket: string;
readonly date_histogram: string;
readonly date_range: string;
readonly date_format_pattern: string;
readonly filter: string;
readonly filters: string;
readonly geohash_grid: string;
readonly histogram: string;
readonly ip_range: string;
readonly range: string;
readonly significant_terms: string;
readonly terms: string;
readonly avg: string;
readonly avg_bucket: string;
readonly max_bucket: string;
readonly min_bucket: string;
readonly sum_bucket: string;
readonly cardinality: string;
readonly count: string;
readonly cumulative_sum: string;
readonly derivative: string;
readonly geo_bounds: string;
readonly geo_centroid: string;
readonly max: string;
readonly median: string;
readonly min: string;
readonly moving_avg: string;
readonly percentile_ranks: string;
readonly serial_diff: string;
readonly std_dev: string;
readonly sum: string;
readonly top_hits: string;
};
readonly runtimeFields: {
readonly overview: string;
readonly mapping: string;
};
readonly scriptedFields: {
readonly scriptFields: string;
readonly scriptAggs: string;
readonly painless: string;
readonly painlessApi: string;
readonly painlessLangSpec: string;
readonly painlessSyntax: string;
readonly painlessWalkthrough: string;
readonly luceneExpressions: string;
};
readonly search: {
readonly sessions: string;
readonly sessionLimits: string;
};
readonly indexPatterns: {
readonly introduction: string;
readonly fieldFormattersNumber: string;
readonly fieldFormattersString: string;
readonly runtimeFields: string;
};
readonly addData: string;
readonly kibana: string;
readonly upgradeAssistant: string;
readonly rollupJobs: string;
readonly elasticsearch: Record<string, string>;
readonly siem: {
readonly privileges: string;
readonly guide: string;
readonly gettingStarted: string;
readonly ml: string;
readonly ruleChangeLog: string;
readonly detectionsReq: string;
readonly networkMap: string;
};
readonly query: {
readonly eql: string;
readonly kueryQuerySyntax: string;
readonly luceneQuerySyntax: string;
readonly percolate: string;
readonly queryDsl: string;
readonly autocompleteChanges: string;
};
readonly date: {
readonly dateMath: string;
readonly dateMathIndexNames: string;
};
readonly management: Record<string, string>;
readonly ml: Record<string, string>;
readonly transforms: Record<string, string>;
readonly visualize: Record<string, string>;
readonly apis: Readonly<{
bulkIndexAlias: string;
byteSizeUnits: string;
createAutoFollowPattern: string;
createFollower: string;
createIndex: string;
createSnapshotLifecyclePolicy: string;
createRoleMapping: string;
createRoleMappingTemplates: string;
createRollupJobsRequest: string;
createApiKey: string;
createPipeline: string;
createTransformRequest: string;
cronExpressions: string;
executeWatchActionModes: string;
indexExists: string;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
painlessExecuteAPIContexts: string;
putComponentTemplateMetadata: string;
putSnapshotLifecyclePolicy: string;
putIndexTemplateV1: string;
putWatch: string;
simulatePipeline: string;
timeUnits: string;
updateTransform: string;
}>;
readonly observability: Record<string, string>;
readonly alerting: Record<string, string>;
readonly maps: Record<string, string>;
readonly monitoring: Record<string, string>;
readonly security: Readonly<{
apiKeyServiceSettings: string;
clusterPrivileges: string;
elasticsearchSettings: string;
elasticsearchEnableSecurity: string;
indicesPrivileges: string;
kibanaTLS: string;
kibanaPrivileges: string;
mappingRoles: string;
mappingRolesFieldRules: string;
runAsPrivilege: string;
}>;
readonly watcher: Record<string, string>;
readonly ccs: Record<string, string>;
readonly plugins: Record<string, string>;
readonly snapshotRestore: Record<string, string>;
readonly ingest: Record<string, string>;
readonly fleet: Readonly<{
guide: string;
fleetServer: string;
fleetServerAddFleetServer: string;
settings: string;
settingsFleetServerHostSettings: string;
troubleshooting: string;
elasticAgent: string;
datastreams: string;
datastreamsNamingScheme: string;
upgradeElasticAgent: string;
upgradeElasticAgent712lower: string;
}>;
readonly ecs: {
readonly guide: string;
};
} | | +| [links](./kibana-plugin-core-public.doclinksstart.links.md) | {
readonly settings: string;
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
readonly customLinks: string;
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;
};
readonly canvas: {
readonly guide: string;
};
readonly dashboard: {
readonly guide: string;
readonly drilldowns: string;
readonly drilldownsTriggerPicker: string;
readonly urlDrilldownTemplateSyntax: string;
readonly urlDrilldownVariables: string;
};
readonly discover: Record<string, string>;
readonly filebeat: {
readonly base: string;
readonly installation: string;
readonly configuration: string;
readonly elasticsearchOutput: string;
readonly elasticsearchModule: string;
readonly startup: string;
readonly exportedFields: string;
readonly suricataModule: string;
readonly zeekModule: string;
};
readonly auditbeat: {
readonly base: string;
readonly auditdModule: string;
readonly systemModule: string;
};
readonly metricbeat: {
readonly base: string;
readonly configure: string;
readonly httpEndpoint: string;
readonly install: string;
readonly start: string;
};
readonly enterpriseSearch: {
readonly base: string;
readonly appSearchBase: string;
readonly workplaceSearchBase: string;
};
readonly heartbeat: {
readonly base: string;
};
readonly libbeat: {
readonly getStarted: string;
};
readonly logstash: {
readonly base: string;
};
readonly functionbeat: {
readonly base: string;
};
readonly winlogbeat: {
readonly base: string;
};
readonly aggs: {
readonly composite: string;
readonly composite_missing_bucket: string;
readonly date_histogram: string;
readonly date_range: string;
readonly date_format_pattern: string;
readonly filter: string;
readonly filters: string;
readonly geohash_grid: string;
readonly histogram: string;
readonly ip_range: string;
readonly range: string;
readonly significant_terms: string;
readonly terms: string;
readonly avg: string;
readonly avg_bucket: string;
readonly max_bucket: string;
readonly min_bucket: string;
readonly sum_bucket: string;
readonly cardinality: string;
readonly count: string;
readonly cumulative_sum: string;
readonly derivative: string;
readonly geo_bounds: string;
readonly geo_centroid: string;
readonly max: string;
readonly median: string;
readonly min: string;
readonly moving_avg: string;
readonly percentile_ranks: string;
readonly serial_diff: string;
readonly std_dev: string;
readonly sum: string;
readonly top_hits: string;
};
readonly runtimeFields: {
readonly overview: string;
readonly mapping: string;
};
readonly scriptedFields: {
readonly scriptFields: string;
readonly scriptAggs: string;
readonly painless: string;
readonly painlessApi: string;
readonly painlessLangSpec: string;
readonly painlessSyntax: string;
readonly painlessWalkthrough: string;
readonly luceneExpressions: string;
};
readonly search: {
readonly sessions: string;
readonly sessionLimits: string;
};
readonly indexPatterns: {
readonly introduction: string;
readonly fieldFormattersNumber: string;
readonly fieldFormattersString: string;
readonly runtimeFields: string;
};
readonly addData: string;
readonly kibana: string;
readonly upgradeAssistant: string;
readonly rollupJobs: string;
readonly elasticsearch: Record<string, string>;
readonly siem: {
readonly privileges: string;
readonly guide: string;
readonly gettingStarted: string;
readonly ml: string;
readonly ruleChangeLog: string;
readonly detectionsReq: string;
readonly networkMap: string;
};
readonly query: {
readonly eql: string;
readonly kueryQuerySyntax: string;
readonly luceneQuerySyntax: string;
readonly percolate: string;
readonly queryDsl: string;
readonly autocompleteChanges: string;
};
readonly date: {
readonly dateMath: string;
readonly dateMathIndexNames: string;
};
readonly management: Record<string, string>;
readonly ml: Record<string, string>;
readonly transforms: Record<string, string>;
readonly visualize: Record<string, string>;
readonly apis: Readonly<{
bulkIndexAlias: string;
byteSizeUnits: string;
createAutoFollowPattern: string;
createFollower: string;
createIndex: string;
createSnapshotLifecyclePolicy: string;
createRoleMapping: string;
createRoleMappingTemplates: string;
createRollupJobsRequest: string;
createApiKey: string;
createPipeline: string;
createTransformRequest: string;
cronExpressions: string;
executeWatchActionModes: string;
indexExists: string;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
painlessExecuteAPIContexts: string;
putComponentTemplateMetadata: string;
putSnapshotLifecyclePolicy: string;
putIndexTemplateV1: string;
putWatch: string;
simulatePipeline: string;
timeUnits: string;
updateTransform: string;
}>;
readonly observability: Readonly<{
guide: string;
infrastructureThreshold: string;
logsThreshold: string;
metricsThreshold: string;
monitorStatus: string;
monitorUptime: string;
tlsCertificate: string;
uptimeDurationAnomaly: string;
}>;
readonly alerting: Record<string, string>;
readonly maps: Record<string, string>;
readonly monitoring: Record<string, string>;
readonly security: Readonly<{
apiKeyServiceSettings: string;
clusterPrivileges: string;
elasticsearchSettings: string;
elasticsearchEnableSecurity: string;
indicesPrivileges: string;
kibanaTLS: string;
kibanaPrivileges: string;
mappingRoles: string;
mappingRolesFieldRules: string;
runAsPrivilege: string;
}>;
readonly watcher: Record<string, string>;
readonly ccs: Record<string, string>;
readonly plugins: Record<string, string>;
readonly snapshotRestore: Record<string, string>;
readonly ingest: Record<string, string>;
readonly fleet: Readonly<{
guide: string;
fleetServer: string;
fleetServerAddFleetServer: string;
settings: string;
settingsFleetServerHostSettings: string;
troubleshooting: string;
elasticAgent: string;
datastreams: string;
datastreamsNamingScheme: string;
upgradeElasticAgent: string;
upgradeElasticAgent712lower: string;
}>;
readonly ecs: {
readonly guide: string;
};
} | | diff --git a/docs/development/core/server/kibana-plugin-core-server.deprecationsservicesetup.md b/docs/development/core/server/kibana-plugin-core-server.deprecationsservicesetup.md index 75732f59f1b3f..7b2cbdecd146a 100644 --- a/docs/development/core/server/kibana-plugin-core-server.deprecationsservicesetup.md +++ b/docs/development/core/server/kibana-plugin-core-server.deprecationsservicesetup.md @@ -25,28 +25,26 @@ import { i18n } from '@kbn/i18n'; async function getDeprecations({ esClient, savedObjectsClient }: GetDeprecationsContext): Promise { const deprecations: DeprecationsDetails[] = []; - const count = await getTimelionSheetsCount(savedObjectsClient); - + const count = await getFooCount(savedObjectsClient); if (count > 0) { - // Example of a manual correctiveAction deprecations.push({ - title: i18n.translate('xpack.timelion.deprecations.worksheetsTitle', { - defaultMessage: 'Found Timelion worksheets.' + title: i18n.translate('xpack.foo.deprecations.title', { + defaultMessage: `Foo's are deprecated` }), - message: i18n.translate('xpack.timelion.deprecations.worksheetsMessage', { - defaultMessage: 'You have {count} Timelion worksheets. The Timelion app will be removed in 8.0. To continue using your Timelion worksheets, migrate them to a dashboard.', + message: i18n.translate('xpack.foo.deprecations.message', { + defaultMessage: `You have {count} Foo's. Migrate your Foo's to a dashboard to continue using them.`, values: { count }, }), documentationUrl: - 'https://www.elastic.co/guide/en/kibana/current/create-panels-with-timelion.html', + 'https://www.elastic.co/guide/en/kibana/current/foo.html', level: 'warning', correctiveActions: { manualSteps: [ - i18n.translate('xpack.timelion.deprecations.worksheets.manualStepOneMessage', { + i18n.translate('xpack.foo.deprecations.manualStepOneMessage', { defaultMessage: 'Navigate to the Kibana Dashboard and click "Create dashboard".', }), - i18n.translate('xpack.timelion.deprecations.worksheets.manualStepTwoMessage', { - defaultMessage: 'Select Timelion from the "New Visualization" window.', + i18n.translate('xpack.foo.deprecations.manualStepTwoMessage', { + defaultMessage: 'Select Foo from the "New Visualization" window.', }), ], api: { diff --git a/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor._constructor_.md b/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor._constructor_.md new file mode 100644 index 0000000000000..ae9df8b406be6 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor._constructor_.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [EventLoopDelaysMonitor](./kibana-plugin-core-server.eventloopdelaysmonitor.md) > [(constructor)](./kibana-plugin-core-server.eventloopdelaysmonitor._constructor_.md) + +## EventLoopDelaysMonitor.(constructor) + +Creating a new instance from EventLoopDelaysMonitor will automatically start tracking event loop delays. + +Signature: + +```typescript +constructor(); +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.collect.md b/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.collect.md new file mode 100644 index 0000000000000..0e07497baf887 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.collect.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [EventLoopDelaysMonitor](./kibana-plugin-core-server.eventloopdelaysmonitor.md) > [collect](./kibana-plugin-core-server.eventloopdelaysmonitor.collect.md) + +## EventLoopDelaysMonitor.collect() method + +Collect gathers event loop delays metrics from nodejs perf\_hooks.monitorEventLoopDelay the histogram calculations start from the last time `reset` was called or this EventLoopDelaysMonitor instance was created. + +Signature: + +```typescript +collect(): IntervalHistogram; +``` +Returns: + +`IntervalHistogram` + +{IntervalHistogram} + diff --git a/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.md b/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.md new file mode 100644 index 0000000000000..21bbd8b48840c --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.md @@ -0,0 +1,26 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [EventLoopDelaysMonitor](./kibana-plugin-core-server.eventloopdelaysmonitor.md) + +## EventLoopDelaysMonitor class + +Signature: + +```typescript +export declare class EventLoopDelaysMonitor +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)()](./kibana-plugin-core-server.eventloopdelaysmonitor._constructor_.md) | | Creating a new instance from EventLoopDelaysMonitor will automatically start tracking event loop delays. | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [collect()](./kibana-plugin-core-server.eventloopdelaysmonitor.collect.md) | | Collect gathers event loop delays metrics from nodejs perf\_hooks.monitorEventLoopDelay the histogram calculations start from the last time reset was called or this EventLoopDelaysMonitor instance was created. | +| [reset()](./kibana-plugin-core-server.eventloopdelaysmonitor.reset.md) | | Resets the collected histogram data. | +| [stop()](./kibana-plugin-core-server.eventloopdelaysmonitor.stop.md) | | Disables updating the interval timer for collecting new data points. | + diff --git a/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.reset.md b/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.reset.md new file mode 100644 index 0000000000000..fdba7a79ebda0 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.reset.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [EventLoopDelaysMonitor](./kibana-plugin-core-server.eventloopdelaysmonitor.md) > [reset](./kibana-plugin-core-server.eventloopdelaysmonitor.reset.md) + +## EventLoopDelaysMonitor.reset() method + +Resets the collected histogram data. + +Signature: + +```typescript +reset(): void; +``` +Returns: + +`void` + diff --git a/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.stop.md b/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.stop.md new file mode 100644 index 0000000000000..25b61434b0061 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.eventloopdelaysmonitor.stop.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [EventLoopDelaysMonitor](./kibana-plugin-core-server.eventloopdelaysmonitor.md) > [stop](./kibana-plugin-core-server.eventloopdelaysmonitor.stop.md) + +## EventLoopDelaysMonitor.stop() method + +Disables updating the interval timer for collecting new data points. + +Signature: + +```typescript +stop(): void; +``` +Returns: + +`void` + diff --git a/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.exceeds.md b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.exceeds.md new file mode 100644 index 0000000000000..664bdb8f24d7b --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.exceeds.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [IntervalHistogram](./kibana-plugin-core-server.intervalhistogram.md) > [exceeds](./kibana-plugin-core-server.intervalhistogram.exceeds.md) + +## IntervalHistogram.exceeds property + +Signature: + +```typescript +exceeds: number; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.fromtimestamp.md b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.fromtimestamp.md new file mode 100644 index 0000000000000..00fa8dcb84430 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.fromtimestamp.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [IntervalHistogram](./kibana-plugin-core-server.intervalhistogram.md) > [fromTimestamp](./kibana-plugin-core-server.intervalhistogram.fromtimestamp.md) + +## IntervalHistogram.fromTimestamp property + +Signature: + +```typescript +fromTimestamp: string; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.lastupdatedat.md b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.lastupdatedat.md new file mode 100644 index 0000000000000..58e75fc2ba437 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.lastupdatedat.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [IntervalHistogram](./kibana-plugin-core-server.intervalhistogram.md) > [lastUpdatedAt](./kibana-plugin-core-server.intervalhistogram.lastupdatedat.md) + +## IntervalHistogram.lastUpdatedAt property + +Signature: + +```typescript +lastUpdatedAt: string; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.max.md b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.max.md new file mode 100644 index 0000000000000..14d7fe6b68c4b --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.max.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [IntervalHistogram](./kibana-plugin-core-server.intervalhistogram.md) > [max](./kibana-plugin-core-server.intervalhistogram.max.md) + +## IntervalHistogram.max property + +Signature: + +```typescript +max: number; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.md b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.md new file mode 100644 index 0000000000000..d7fb889dce322 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.md @@ -0,0 +1,27 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [IntervalHistogram](./kibana-plugin-core-server.intervalhistogram.md) + +## IntervalHistogram interface + +an IntervalHistogram object that samples and reports the event loop delay over time. The delays will be reported in nanoseconds. + +Signature: + +```typescript +export interface IntervalHistogram +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [exceeds](./kibana-plugin-core-server.intervalhistogram.exceeds.md) | number | | +| [fromTimestamp](./kibana-plugin-core-server.intervalhistogram.fromtimestamp.md) | string | | +| [lastUpdatedAt](./kibana-plugin-core-server.intervalhistogram.lastupdatedat.md) | string | | +| [max](./kibana-plugin-core-server.intervalhistogram.max.md) | number | | +| [mean](./kibana-plugin-core-server.intervalhistogram.mean.md) | number | | +| [min](./kibana-plugin-core-server.intervalhistogram.min.md) | number | | +| [percentiles](./kibana-plugin-core-server.intervalhistogram.percentiles.md) | {
50: number;
75: number;
95: number;
99: number;
} | | +| [stddev](./kibana-plugin-core-server.intervalhistogram.stddev.md) | number | | + diff --git a/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.mean.md b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.mean.md new file mode 100644 index 0000000000000..e6794bfa5fe52 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.mean.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [IntervalHistogram](./kibana-plugin-core-server.intervalhistogram.md) > [mean](./kibana-plugin-core-server.intervalhistogram.mean.md) + +## IntervalHistogram.mean property + +Signature: + +```typescript +mean: number; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.min.md b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.min.md new file mode 100644 index 0000000000000..d0eb929601f18 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.min.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [IntervalHistogram](./kibana-plugin-core-server.intervalhistogram.md) > [min](./kibana-plugin-core-server.intervalhistogram.min.md) + +## IntervalHistogram.min property + +Signature: + +```typescript +min: number; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.percentiles.md b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.percentiles.md new file mode 100644 index 0000000000000..b0adc9531c0b1 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.percentiles.md @@ -0,0 +1,16 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [IntervalHistogram](./kibana-plugin-core-server.intervalhistogram.md) > [percentiles](./kibana-plugin-core-server.intervalhistogram.percentiles.md) + +## IntervalHistogram.percentiles property + +Signature: + +```typescript +percentiles: { + 50: number; + 75: number; + 95: number; + 99: number; + }; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.stddev.md b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.stddev.md new file mode 100644 index 0000000000000..bca5ab56cb237 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.intervalhistogram.stddev.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [IntervalHistogram](./kibana-plugin-core-server.intervalhistogram.md) > [stddev](./kibana-plugin-core-server.intervalhistogram.stddev.md) + +## IntervalHistogram.stddev property + +Signature: + +```typescript +stddev: number; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.md b/docs/development/core/server/kibana-plugin-core-server.md index 96bb82c8968df..66c0299669dc4 100644 --- a/docs/development/core/server/kibana-plugin-core-server.md +++ b/docs/development/core/server/kibana-plugin-core-server.md @@ -19,6 +19,7 @@ The plugin integrates with the core system via lifecycle events: `setup` | [BasePath](./kibana-plugin-core-server.basepath.md) | Access or manipulate the Kibana base path | | [CspConfig](./kibana-plugin-core-server.cspconfig.md) | CSP configuration for use in Kibana. | | [ElasticsearchConfig](./kibana-plugin-core-server.elasticsearchconfig.md) | Wrapper of config schema. | +| [EventLoopDelaysMonitor](./kibana-plugin-core-server.eventloopdelaysmonitor.md) | | | [KibanaRequest](./kibana-plugin-core-server.kibanarequest.md) | Kibana specific abstraction for an incoming request. | | [RouteValidationError](./kibana-plugin-core-server.routevalidationerror.md) | Error to return when the validation is not successful. | | [SavedObjectsClient](./kibana-plugin-core-server.savedobjectsclient.md) | | @@ -97,6 +98,7 @@ The plugin integrates with the core system via lifecycle events: `setup` | [IExternalUrlPolicy](./kibana-plugin-core-server.iexternalurlpolicy.md) | A policy describing whether access to an external destination is allowed. | | [IKibanaResponse](./kibana-plugin-core-server.ikibanaresponse.md) | A response data object, expected to returned as a result of [RequestHandler](./kibana-plugin-core-server.requesthandler.md) execution | | [IKibanaSocket](./kibana-plugin-core-server.ikibanasocket.md) | A tiny abstraction for TCP socket. | +| [IntervalHistogram](./kibana-plugin-core-server.intervalhistogram.md) | an IntervalHistogram object that samples and reports the event loop delay over time. The delays will be reported in nanoseconds. | | [IRenderOptions](./kibana-plugin-core-server.irenderoptions.md) | | | [IRouter](./kibana-plugin-core-server.irouter.md) | Registers route handlers for specified resource path and method. See [RouteConfig](./kibana-plugin-core-server.routeconfig.md) and [RequestHandler](./kibana-plugin-core-server.requesthandler.md) for more information about arguments to route registrations. | | [ISavedObjectsPointInTimeFinder](./kibana-plugin-core-server.isavedobjectspointintimefinder.md) | | diff --git a/docs/development/core/server/kibana-plugin-core-server.opsmetrics.md b/docs/development/core/server/kibana-plugin-core-server.opsmetrics.md index 9803c0fbd53cc..1572c1ae3131e 100644 --- a/docs/development/core/server/kibana-plugin-core-server.opsmetrics.md +++ b/docs/development/core/server/kibana-plugin-core-server.opsmetrics.md @@ -19,7 +19,8 @@ export interface OpsMetrics | [collected\_at](./kibana-plugin-core-server.opsmetrics.collected_at.md) | Date | Time metrics were recorded at. | | [concurrent\_connections](./kibana-plugin-core-server.opsmetrics.concurrent_connections.md) | OpsServerMetrics['concurrent_connections'] | number of current concurrent connections to the server | | [os](./kibana-plugin-core-server.opsmetrics.os.md) | OpsOsMetrics | OS related metrics | -| [process](./kibana-plugin-core-server.opsmetrics.process.md) | OpsProcessMetrics | Process related metrics | +| [process](./kibana-plugin-core-server.opsmetrics.process.md) | OpsProcessMetrics | Process related metrics. Deprecated in favor of processes field. | +| [processes](./kibana-plugin-core-server.opsmetrics.processes.md) | OpsProcessMetrics[] | Process related metrics. Reports an array of objects for each kibana pid. | | [requests](./kibana-plugin-core-server.opsmetrics.requests.md) | OpsServerMetrics['requests'] | server requests stats | | [response\_times](./kibana-plugin-core-server.opsmetrics.response_times.md) | OpsServerMetrics['response_times'] | server response time stats | diff --git a/docs/development/core/server/kibana-plugin-core-server.opsmetrics.process.md b/docs/development/core/server/kibana-plugin-core-server.opsmetrics.process.md index b3759fadafc0a..9da2c0644dc84 100644 --- a/docs/development/core/server/kibana-plugin-core-server.opsmetrics.process.md +++ b/docs/development/core/server/kibana-plugin-core-server.opsmetrics.process.md @@ -4,7 +4,11 @@ ## OpsMetrics.process property -Process related metrics +> Warning: This API is now obsolete. +> +> + +Process related metrics. Deprecated in favor of processes field. Signature: diff --git a/docs/development/core/server/kibana-plugin-core-server.opsmetrics.processes.md b/docs/development/core/server/kibana-plugin-core-server.opsmetrics.processes.md new file mode 100644 index 0000000000000..cf1f0a7c54475 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.opsmetrics.processes.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [OpsMetrics](./kibana-plugin-core-server.opsmetrics.md) > [processes](./kibana-plugin-core-server.opsmetrics.processes.md) + +## OpsMetrics.processes property + +Process related metrics. Reports an array of objects for each kibana pid. + +Signature: + +```typescript +processes: OpsProcessMetrics[]; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.opsprocessmetrics.event_loop_delay.md b/docs/development/core/server/kibana-plugin-core-server.opsprocessmetrics.event_loop_delay.md index 239f94e37d00e..d626b9cf8f98c 100644 --- a/docs/development/core/server/kibana-plugin-core-server.opsprocessmetrics.event_loop_delay.md +++ b/docs/development/core/server/kibana-plugin-core-server.opsprocessmetrics.event_loop_delay.md @@ -4,7 +4,7 @@ ## OpsProcessMetrics.event\_loop\_delay property -node event loop delay +mean event loop delay since last collection Signature: diff --git a/docs/development/core/server/kibana-plugin-core-server.opsprocessmetrics.event_loop_delay_histogram.md b/docs/development/core/server/kibana-plugin-core-server.opsprocessmetrics.event_loop_delay_histogram.md new file mode 100644 index 0000000000000..1d870b19f2d1f --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.opsprocessmetrics.event_loop_delay_histogram.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [OpsProcessMetrics](./kibana-plugin-core-server.opsprocessmetrics.md) > [event\_loop\_delay\_histogram](./kibana-plugin-core-server.opsprocessmetrics.event_loop_delay_histogram.md) + +## OpsProcessMetrics.event\_loop\_delay\_histogram property + +node event loop delay histogram since last collection + +Signature: + +```typescript +event_loop_delay_histogram: IntervalHistogram; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.opsprocessmetrics.md b/docs/development/core/server/kibana-plugin-core-server.opsprocessmetrics.md index 79763b783470e..198b668afca60 100644 --- a/docs/development/core/server/kibana-plugin-core-server.opsprocessmetrics.md +++ b/docs/development/core/server/kibana-plugin-core-server.opsprocessmetrics.md @@ -16,7 +16,8 @@ export interface OpsProcessMetrics | Property | Type | Description | | --- | --- | --- | -| [event\_loop\_delay](./kibana-plugin-core-server.opsprocessmetrics.event_loop_delay.md) | number | node event loop delay | +| [event\_loop\_delay\_histogram](./kibana-plugin-core-server.opsprocessmetrics.event_loop_delay_histogram.md) | IntervalHistogram | node event loop delay histogram since last collection | +| [event\_loop\_delay](./kibana-plugin-core-server.opsprocessmetrics.event_loop_delay.md) | number | mean event loop delay since last collection | | [memory](./kibana-plugin-core-server.opsprocessmetrics.memory.md) | {
heap: {
total_in_bytes: number;
used_in_bytes: number;
size_limit: number;
};
resident_set_size_in_bytes: number;
} | process memory usage | | [pid](./kibana-plugin-core-server.opsprocessmetrics.pid.md) | number | pid of the kibana process | | [uptime\_in\_millis](./kibana-plugin-core-server.opsprocessmetrics.uptime_in_millis.md) | number | uptime of the kibana process | diff --git a/docs/management/action-types.asciidoc b/docs/management/action-types.asciidoc index 3d3d7aeb2d777..92adbaf97d8c5 100644 --- a/docs/management/action-types.asciidoc +++ b/docs/management/action-types.asciidoc @@ -135,5 +135,14 @@ image::images/connectors-with-missing-secrets.png[Connectors with missing secret For out-of-the-box and standardized connectors, you can <> before {kib} starts. +[float] +[[montoring-connectors]] +=== Monitoring connectors + +The <> helps you understand the performance of all tasks in your environment. +However, if connectors fail to execute, they will report as successful to Task Manager. The failure stats will not +accurately depict the performance of connectors. + +For more information on connector successes and failures, refer to the <>. include::connectors/index.asciidoc[] diff --git a/docs/management/advanced-options.asciidoc b/docs/management/advanced-options.asciidoc index a4863bd60089b..872fcbbf83385 100644 --- a/docs/management/advanced-options.asciidoc +++ b/docs/management/advanced-options.asciidoc @@ -470,13 +470,6 @@ The default period of time in the Security time filter. [[kibana-timelion-settings]] ==== Timelion -[horizontal] -[[timelion-defaultcolumns]]`timelion:default_columns`:: -The default number of columns to use on a Timelion sheet. - -[[timelion-defaultrows]]`timelion:default_rows`:: -The default number of rows to use on a Timelion sheet. - [[timelion-esdefaultindex]]`timelion:es.default_index`:: The default index when using the `.es()` query. @@ -502,9 +495,6 @@ experimental:[] Used with quandl queries, this is your API key from https://www.quandl.com/[www.quandl.com]. -[[timelion-showtutorial]]`timelion:showTutorial`:: -Shows the Timelion tutorial to users when they first open the Timelion app. - [[timelion-targetbuckets]]`timelion:target_buckets`:: Used for calculating automatic intervals in visualizations, this is the number of buckets to try to represent. @@ -522,17 +512,9 @@ Enables the legacy charts library for timelion charts in Visualize. **This setting is deprecated and will not be supported as of 8.0.** Maps values to specific colors in charts using the *Compatibility* palette. -[[visualization-dimmingopacity]]`visualization:dimmingOpacity`:: -The opacity of the chart items that are dimmed when highlighting another element -of the chart. Use numbers between 0 and 1. The lower the number, the more the highlighted element stands out. - [[visualization-heatmap-maxbuckets]]`visualization:heatmap:maxBuckets`:: The maximum number of buckets a datasource can return. High numbers can have a negative impact on your browser rendering performance. -[[visualization-visualize-chartslibrary]]`visualization:visualize:legacyChartsLibrary`:: -**The legacy XY charts are deprecated and will not be supported as of 7.16.** -The visualize editor uses a new XY charts library with improved performance, color palettes, fill capacity, and more. Enable this option if you prefer to use the legacy charts library. - [[visualization-visualize-pieChartslibrary]]`visualization:visualize:legacyPieChartsLibrary`:: The visualize editor uses new pie charts with improved performance, color palettes, label positioning, and more. Enable this option if you prefer to use to the legacy charts library. diff --git a/docs/management/connectors/action-types/email.asciidoc b/docs/management/connectors/action-types/email.asciidoc index bab04b8052674..131ff5ea5e9f6 100644 --- a/docs/management/connectors/action-types/email.asciidoc +++ b/docs/management/connectors/action-types/email.asciidoc @@ -51,7 +51,7 @@ Use the <> to customize connecto Config defines information for the connector type. -`service`:: The name of a https://nodemailer.com/smtp/well-known/[well-known email service provider]. If `service` is provided, `host`, `port`, and `secure` properties are ignored. For more information on the `gmail` service value, see the https://nodemailer.com/usage/using-gmail/[Nodemailer Gmail documentation]. +`service`:: The name of the email service. If `service` is `elastic_cloud` (for Elastic Cloud notifications) or one of Nodemailer's https://nodemailer.com/smtp/well-known/[well-known email service providers], `host`, `port`, and `secure` properties are ignored. If `service` is `other`, `host` and `port` properties must be defined. For more information on the `gmail` service value, see the https://nodemailer.com/usage/using-gmail/[Nodemailer Gmail documentation]. `from`:: An email address that corresponds to *Sender*. `host`:: A string that corresponds to *Host*. `port`:: A number that corresponds to *Port*. @@ -107,7 +107,7 @@ For other email servers, you can check the list of well-known services that Node [[elasticcloud]] ==== Sending email from Elastic Cloud -IMPORTANT: These instructions require you to link:{cloud}/ec-watcher.html#ec-watcher-whitelist[whitelist] the email addresses that notifications get sent first. +IMPORTANT: These instructions require you to link:{cloud}/ec-watcher.html#ec-watcher-whitelist[allowlist] the email addresses that notifications get sent. Use the following connector settings to send email from Elastic Cloud: diff --git a/docs/management/images/stackManagement-indexPatterns-pinRuntimeField-7.15.png b/docs/management/images/stackManagement-indexPatterns-pinRuntimeField-7.15.png new file mode 100644 index 0000000000000..49d0d4caec00f Binary files /dev/null and b/docs/management/images/stackManagement-indexPatterns-pinRuntimeField-7.15.png differ diff --git a/docs/management/manage-index-patterns.asciidoc b/docs/management/manage-index-patterns.asciidoc index ac07aa833c3b9..08527ffa75d4a 100644 --- a/docs/management/manage-index-patterns.asciidoc +++ b/docs/management/manage-index-patterns.asciidoc @@ -7,60 +7,60 @@ To customize the data fields in your index pattern, you can add runtime fields t [[runtime-fields]] === Explore your data with runtime fields -Runtime fields are fields that you add to documents after you've ingested, and are evaluated at query time. With runtime fields, you allow for a smaller index and faster ingest time so that you can use less resources and reduce your operating costs. You can use runtime fields anywhere index patterns are used. +Runtime fields are fields that you add to documents after you've ingested your data, and are evaluated at query time. With runtime fields, you allow for a smaller index and faster ingest time so that you can use less resources and reduce your operating costs. You can use runtime fields anywhere index patterns are used, for example, you can explore runtime fields in *Discover* and create visualizations with runtime fields for your dashboard. -When you use runtime fields, you can: +With runtime fields, you can: -* Define fields for a specific use without modifying the underlying schema. +* Define fields for a specific use case without modifying the underlying schema. * Override the returned values from index fields. -* Start working on your data without first understanding the structure. +* Start working on your data without understanding the structure. * Add fields to existing documents without reindexing your data. -* Explore runtime field data in *Discover*. - -* Create visualizations with runtime field data using *Lens*, *Maps*, and *TSVB*. - WARNING: Runtime fields can impact {kib} performance. When you run a query, {es} uses the fields you index first to shorten the response time. Index the fields that you commonly search for and filter on, such as `timestamp`, then use runtime fields to limit the number of fields {es} uses to calculate values. -For more information, refer to {ref}/runtime.html[Runtime fields]. +For detailed information on how to use runtime fields with {es}, refer to {ref}/runtime.html[Runtime fields]. [float] [[create-runtime-fields]] -==== Create runtime fields +==== Add runtime fields -Create runtime fields in your index patterns, or create runtime fields in *Discover* and *Lens*. +To add runtime fields to your index patterns, open the index pattern you want to change, then define the field values by emitting a single value using the {ref}/modules-scripting-painless.html[Painless scripting language]. You can also add runtime fields in <> and <>. . Open the main menu, then click *Stack Management > Index Patterns*. . Select the index pattern you want to add the runtime field to, then click *Add field*. -. Enter a *Name* for the runtime field, then select the field *Type*. +. Enter the field *Name*, then select the *Type*. + +. Select *Set custom label*, then enter the label you want to display where the index pattern is used, such as *Discover*. + +. Select *Set value*, then define the script. The script must match the *Type*, or the index pattern fails anywhere it is used. + +. To help you define the script, use the *Preview*: + +* To view the other available fields, use the *Document ID* arrows. + +* To filter the fields list, enter the keyword in *Filter fields*. -. Select *Set value*, then define the field value by emitting a single value using the {ref}/modules-scripting-painless.html[Painless scripting language]. -+ -The script must match the field *Type*, or the script fails. +* To pin frequently used fields to the top of the list, hover over the field, then click image:images/stackManagement-indexPatterns-pinRuntimeField-7.15.png[Icon to pin field to the top of the list]. . Click *Create field*. -+ -For information on how to create runtime fields in *Discover*, refer to <>. -+ -For information on how to create runtime fields in *Lens*, refer to <>. [float] [[runtime-field-examples]] ==== Runtime field examples -Try the runtime field examples on your own using the *Sample web logs* data index pattern. +Try the runtime field examples on your own using the <> data index pattern. [float] [[simple-hello-world-example]] ==== Return a keyword value -To return `Hello World!` value: +Return `Hello World!`: [source,text] ---- @@ -101,7 +101,7 @@ emit(""); [[replace-nulls-with-blanks]] ===== Replace nulls with blanks -Replace null values with none values: +Replace `null` values with `None`: [source,text] ---- @@ -115,7 +115,7 @@ else { } ---- -Specify operating system condition: +Specify the operating system condition: [source,text] ---- diff --git a/docs/maps/maps-getting-started.asciidoc b/docs/maps/maps-getting-started.asciidoc index 548a574293403..64ab6fca0714e 100644 --- a/docs/maps/maps-getting-started.asciidoc +++ b/docs/maps/maps-getting-started.asciidoc @@ -50,13 +50,13 @@ and lighter shades will symbolize countries with less traffic. . In **Statistics source**, set: ** **Index pattern** to **kibana_sample_data_logs** -** **Join field** to **geo.src** +** **Join field** to **geo.dest** . Click **Add layer**. . In **Layer settings**, set: -** **Name** to `Total Requests by Country` +** **Name** to `Total Requests by Destination` ** **Opacity** to 50% . Add a Tooltip field: diff --git a/docs/settings/logging-settings.asciidoc b/docs/settings/logging-settings.asciidoc index aa38d54305eec..77f3bd90a911a 100644 --- a/docs/settings/logging-settings.asciidoc +++ b/docs/settings/logging-settings.asciidoc @@ -4,6 +4,16 @@ Logging settings ++++ +{kib} relies on three high-level entities to set the logging service: appenders, loggers, and root. + +- Appenders define where log messages are displayed (stdout or console) and their layout (`pattern` or `json`). They also allow you to specify if you want the logs stored and, if so, where (file on the disk). +- Loggers define what logging settings, such as the level of verbosity and the appenders, to apply to a particular context. Each log entry context provides information about the service or plugin that emits it and any of its sub-parts, for example, `metrics.ops` or `elasticsearch.query`. +- Root is a logger that applies to all the log entries in {kib}. + +Refer to the <> for common configuration use cases. To learn more about possible configuration values, go to {kibana-ref}/logging-service.html[{kib}'s Logging service]. + +[[log-settings-compatibility]] +==== Backwards compatibility Compatibility with the legacy logging system is assured until the end of the `v7` version. All log messages handled by `root` context (default) are forwarded to the legacy logging service. The logging configuration is validated against the predefined schema and if there are @@ -12,10 +22,12 @@ any issues with it, {kib} will fail to start with the detailed error message. NOTE: When you switch to the new logging configuration, you will start seeing duplicate log entries in both formats. These will be removed when the `default` appender is no longer required. +[[log-settings-examples]] +==== Examples Here are some configuration examples for the most common logging use cases: [[log-to-file-example]] -==== Log to a file +===== Log to a file Log the default log format to a file instead of to stdout (the default). @@ -33,10 +45,10 @@ logging: ---- [[log-in-json-ECS-example]] -==== Log in json format +===== Log in JSON format -Log the default log format to json layout instead of pattern (the default). -With `json` layout log messages will be formatted as JSON strings in https://www.elastic.co/guide/en/ecs/current/ecs-reference.html[ECS format] that includes a timestamp, log level, logger, message text and any other metadata that may be associated with the log message itself +Log the default log format to JSON layout instead of pattern (the default). +With `json` layout, log messages will be formatted as JSON strings in https://www.elastic.co/guide/en/ecs/current/ecs-reference.html[ECS format] that includes a timestamp, log level, logger, message text and any other metadata that may be associated with the log message itself. [source,yaml] ---- @@ -51,7 +63,7 @@ logging: ---- [[log-with-meta-to-stdout]] -==== Log with meta to stdout +===== Log with meta to stdout Include `%meta` in your pattern layout: @@ -69,7 +81,7 @@ logging: ---- [[log-elasticsearch-queries]] -==== Log {es} queries +===== Log {es} queries [source,yaml] -- @@ -89,7 +101,7 @@ logging: -- [[change-overall-log-level]] -==== Change overall log level. +===== Change overall log level [source,yaml] ---- @@ -99,7 +111,7 @@ logging: ---- [[customize-specific-log-records]] -==== Customize specific log records +===== Customize specific log records Here is a detailed configuration example that can be used to configure _loggers_, _appenders_ and _layouts_: [source,yaml] diff --git a/docs/setup/access.asciidoc b/docs/setup/access.asciidoc index fde4243ee4ce3..3fc1aa43f9f29 100644 --- a/docs/setup/access.asciidoc +++ b/docs/setup/access.asciidoc @@ -37,4 +37,21 @@ image::images/kibana-status-page-7_14_0.png[Kibana server status page] For JSON-formatted server status details, use the `localhost:5601/api/status` API endpoint. +[float] +[[not-ready]] +=== {kib} not ready + +If you receive an error that the {kib} `server is not ready`, check the following: + +* The {es} connectivity: ++ +[source,sh] +---- +`curl -XGET elasticsearch_ip_or_hostname:9200/` +---- +* The {kib} logs: +** Linux, DEB or RPM package: `/var/log/kibana/kibana.log` +** Linux, tar.gz package: `$KIBANA_HOME/log/kibana.log` +** Windows: `$KIBANA_HOME\log\kibana.log` +* The health status of `.kibana*` indices diff --git a/docs/setup/docker.asciidoc b/docs/setup/docker.asciidoc index ac55b3b98ff68..cc14e79c54f15 100644 --- a/docs/setup/docker.asciidoc +++ b/docs/setup/docker.asciidoc @@ -93,6 +93,16 @@ services: - ./kibana.yml:/usr/share/kibana/config/kibana.yml -------------------------------------------- +==== Persist the {kib} keystore + +By default, {kib] auto-generates a keystore file for secure settings at startup. To persist your {kibana-ref}/secure-settings.html[secure settings], use the `kibana-keystore` utility to bind-mount the parent directory of the keystore to the container. For example: + +[source,sh] +---- +docker run -it --rm -v full_path_to/config:/usr/share/kibana/config -v full_path_to/data:/usr/share/kibana/data docker.elastic.co/kibana/kibana:7.14.0 bin/kibana-keystore create +docker run -it --rm -v full_path_to/config:/usr/share/kibana/config -v full_path_to/data:/usr/share/kibana/data docker.elastic.co/kibana/kibana:7.14.0 bin/kibana-keystore add test_keystore_setting +---- + [float] [[environment-variable-config]] ==== Environment variable configuration @@ -145,6 +155,7 @@ images: [horizontal] `server.host`:: `"0.0.0.0"` +`server.shutdownTimeout`:: `"5s"` `elasticsearch.hosts`:: `http://elasticsearch:9200` `monitoring.ui.container.elasticsearch.enabled`:: `true` diff --git a/docs/setup/settings.asciidoc b/docs/setup/settings.asciidoc index 203339be638ab..78b776c85c937 100644 --- a/docs/setup/settings.asciidoc +++ b/docs/setup/settings.asciidoc @@ -295,12 +295,6 @@ is an alternative to `elasticsearch.username` and `elasticsearch.password`. | `interpreter.enableInVisualize` | Enables use of interpreter in Visualize. *Default: `true`* -| `kibana.defaultAppId:` - | deprecated:[7.9.0,This setting will be removed in Kibana 8.0.] - Instead, use the <>. - + - The default application to load. *Default: `"home"`* - |[[kibana-index]] `kibana.index:` | deprecated:[7.11.0,This setting will be removed in 8.0.] Multitenancy by changing `kibana.index` will not be supported starting in 8.0. See diff --git a/docs/spaces/images/edit-space-feature-visibility.png b/docs/spaces/images/edit-space-feature-visibility.png index f1852d3cc03b5..b6ee4740e1d20 100644 Binary files a/docs/spaces/images/edit-space-feature-visibility.png and b/docs/spaces/images/edit-space-feature-visibility.png differ diff --git a/docs/spaces/images/edit-space.png b/docs/spaces/images/edit-space.png index 9785dd9e77aba..97d7ec009ade4 100644 Binary files a/docs/spaces/images/edit-space.png and b/docs/spaces/images/edit-space.png differ diff --git a/docs/spaces/images/spaces-roles.png b/docs/spaces/images/spaces-roles.png index 031b319cfad3e..b9003a91092bf 100644 Binary files a/docs/spaces/images/spaces-roles.png and b/docs/spaces/images/spaces-roles.png differ diff --git a/docs/spaces/index.asciidoc b/docs/spaces/index.asciidoc index aeeb7b45ccd8a..6722503eb0323 100644 --- a/docs/spaces/index.asciidoc +++ b/docs/spaces/index.asciidoc @@ -8,29 +8,18 @@ the dashboards and saved objects that belong to that space. {kib} creates a default space for you. After you create your own -spaces, you're asked to choose a space when you log in to Kibana. You can change your +spaces, you're asked to choose a space when you log in to {kib}. You can change your current space at any time by using the menu. [role="screenshot"] image::images/change-space.png["Change current space menu"] -Kibana supports spaces in several ways. You can: - -[[spaces-getting-started]] - -* <> -* <> -* <> -* <> -* <> -* <> - [float] -==== Required permissions +==== Required privileges The `kibana_admin` role or equivalent is required to manage **Spaces**. -TIP: Looking to support multiple tenants? See <> for more information. +TIP: Looking to support multiple tenants? Refer to <> for more information. [float] [[spaces-managing]] @@ -71,14 +60,14 @@ You can't delete the default space, but you can customize it to your liking. === Control feature access based on user needs You have control over which features are visible in each space. -For example, you might hide Dev Tools -in your "Executive" space or show Stack Monitoring only in your "Admin" space. +For example, you might hide *Dev Tools* +in your "Executive" space or show *Stack Monitoring* only in your "Admin" space. You can define which features to show or hide when you add or edit a space. Controlling feature visibility is not a security feature. To secure access to specific features on a per-user basis, you must configure -<>. +<>. [role="screenshot"] image::images/edit-space-feature-visibility.png["Controlling features visiblity"] @@ -87,12 +76,12 @@ image::images/edit-space-feature-visibility.png["Controlling features visiblity" [[spaces-control-user-access]] === Control feature access based on user privileges -When using Kibana with security, you can configure applications and features +When using {kib} with security, you can configure applications and features based on your users’ privileges. This means different roles can have access to different features in the same space. Power users might have privileges to create and edit visualizations and dashboards, -while analysts or executives might have Dashboard and Canvas with read-only privileges. -See <> for details. +while analysts or executives might have read-only privileges for *Dashboard* and *Canvas*. +Refer to <> for details. [role="screenshot"] image::images/spaces-roles.png["Controlling features visiblity"] @@ -105,7 +94,7 @@ To move saved objects between spaces, you can <>. + +When you upgrade {kib}, the default space contains all of your existing saved objects. + -If you are upgrading your -version of {kib}, the default space will contain all of your existing saved objects. diff --git a/docs/user/alerting/rule-types/es-query.asciidoc b/docs/user/alerting/rule-types/es-query.asciidoc index 5615c79a6c9c7..65d39ba170c3c 100644 --- a/docs/user/alerting/rule-types/es-query.asciidoc +++ b/docs/user/alerting/rule-types/es-query.asciidoc @@ -60,4 +60,32 @@ image::user/alerting/images/rule-types-es-query-valid.png[Test {es} query return * An error message is shown if the query is invalid. + [role="screenshot"] -image::user/alerting/images/rule-types-es-query-invalid.png[Test {es} query shows error when invalid] \ No newline at end of file +image::user/alerting/images/rule-types-es-query-invalid.png[Test {es} query shows error when invalid] + +[float] +==== Match de-duplication + +The {es} query rule type performs de-duplication of document matches across rule executions. If you configure the rule with a schedule interval smaller than the time window, and a document matches a query in multiple rule executions, it will be alerted on only once. + +Suppose you have a rule configured to run every minute. The rule uses a time window of 1 hour and checks if there are more than 99 matches for the query. The {es} query rule type will do the following: + +[cols="3*<"] +|=== + +| `Execution 1 (0:00)` +| Rule finds 113 matches in the last hour: `113 > 99` +| Rule is active and user will be alerted. + +| `Execution 2 (0:01)` +| Rule finds 127 matches in the last hour. 105 of the matches are duplicates that were alerted on in Execution 1, so you actually have 22 matches: `22 !> 99` +| No alert. + +| `Execution 3 (0:02)` +| Rule finds 159 matches in the last hour. 88 of the matches are duplicates that were alerted on in Execution 1, so you actually have 71 matches: `71 !> 99` +| No alert. + +| `Execution 4 (0:03)` +| Rule finds 190 matches in the last hour. 71 of them are duplicates that were alerted on in Exeuction 1, so you actually have 119 matches: `119 > 99` +| Rule is active and user will be alerted. + +|=== \ No newline at end of file diff --git a/docs/user/alerting/troubleshooting/alerting-common-issues.asciidoc b/docs/user/alerting/troubleshooting/alerting-common-issues.asciidoc index c57e9876a4118..408b18143f27f 100644 --- a/docs/user/alerting/troubleshooting/alerting-common-issues.asciidoc +++ b/docs/user/alerting/troubleshooting/alerting-common-issues.asciidoc @@ -68,7 +68,7 @@ Rules are taking a long time to execute and are impacting the overall health of [IMPORTANT] ============================================== -By default, only users with a `superuser` role can query the {kib} event log because it is a system index. To enable additional users to execute this query, assign `read` privileges to the `.kibana-event-log*` index. +By default, only users with a `superuser` role can query the experimental[] {kib} event log because it is a system index. To enable additional users to execute this query, assign `read` privileges to the `.kibana-event-log*` index. ============================================== *Solution* diff --git a/docs/user/alerting/troubleshooting/event-log-index.asciidoc b/docs/user/alerting/troubleshooting/event-log-index.asciidoc index fa5b5831c04ee..393b982b279f5 100644 --- a/docs/user/alerting/troubleshooting/event-log-index.asciidoc +++ b/docs/user/alerting/troubleshooting/event-log-index.asciidoc @@ -2,6 +2,8 @@ [[event-log-index]] === Event log index +experimental[] + Use the event log index to determine: * Whether a rule successfully ran but its associated actions did not diff --git a/docs/user/api.asciidoc b/docs/user/api.asciidoc index 82f3355759b67..00aa3c545df69 100644 --- a/docs/user/api.asciidoc +++ b/docs/user/api.asciidoc @@ -51,14 +51,6 @@ Calls to the API endpoints require different operations. To interact with the {k * *DELETE* - Removes the information. -For example, the following `curl` command exports a dashboard: - -[source,sh] --------------------------------------------- -curl -X POST api/kibana/dashboards/export?dashboard=942dcef0-b2cd-11e8-ad8e-85441f0c2e5c --------------------------------------------- -// KIBANA - [float] [[api-request-headers]] === Request headers diff --git a/docs/user/dashboard/aggregation-based.asciidoc b/docs/user/dashboard/aggregation-based.asciidoc index d901ab8deccb8..351e1f5d0825a 100644 --- a/docs/user/dashboard/aggregation-based.asciidoc +++ b/docs/user/dashboard/aggregation-based.asciidoc @@ -187,8 +187,33 @@ TIP: Aggregation-based panels support a maximum of three *Split series*. [role="screenshot"] image:images/bar-chart-tutorial-2.png[Bar chart with sample logs data] +[float] +[[save-the-aggregation-based-panel]] +===== Save and add the panel + +Save the panel to the *Visualize Library* and add it to the dashboard, or add it to the dashboard without saving. + +To save the panel to the *Visualize Library*: + +. Click *Save to library*. + +. Enter the *Title* and add any applicable <>. + +. Make sure that *Add to Dashboard after saving* is selected. + . Click *Save and return*. +To save the panel to the dashboard: + +. Click *Save and return*. + +. Add an optional title to the panel. + +.. In the panel header, click *No Title*. + +.. On the *Customize panel* window, select *Show panel title*. + +.. Enter the *Panel title*, then click *Save*. diff --git a/docs/user/dashboard/aggregation-reference.asciidoc b/docs/user/dashboard/aggregation-reference.asciidoc deleted file mode 100644 index 17bfc19c2e0c9..0000000000000 --- a/docs/user/dashboard/aggregation-reference.asciidoc +++ /dev/null @@ -1,467 +0,0 @@ -[[aggregation-reference]] -== Supported features by panel type - -Each panel type in {kib} supports different features and {ref}/search-aggregations.html[{es} aggregations]. -This reference can help simplify the comparison if you need a specific feature. - - -[float] -[[chart-types]] -=== Supported panel types by editor - -[options="header"] -|=== - -| Type | Lens | TSVB | Agg-based | Vega | Timelion - -| Table -| ✓ -| ✓ -| ✓ -| -| - -| Bar, line, and area -| ✓ -| ✓ -| ✓ -| ✓ -| ✓ - -| Split chart/small multiples -| -| ✓ -| ✓ -| ✓ -| - -| Pie and donut -| ✓ -| -| ✓ -| ✓ -| - -| Sunburst -| ✓ -| -| ✓ -| ✓ -| - -| Treemap -| ✓ -| -| -| ✓ -| - -| Heat map -| ✓ -| ✓ -| ✓ -| ✓ -| - -| Gauge and Goal -| -| ✓ -| ✓ -| ✓ -| - -| Markdown -| -| ✓ -| -| -| - -| Metric -| ✓ -| ✓ -| ✓ -| ✓ -| - -| Tag cloud -| -| -| ✓ -| ✓ -| - -|=== - -[float] -[[table-features]] -=== Table features - -[options="header"] -|=== - -| Type | Lens | TSVB | Agg-based - -| Summary row -| ✓ -| -| ✓ - -| Pivot table -| ✓ -| -| - -| Calculated column -| Formula -| ✓ -| Percent only - -| Color by value -| ✓ -| ✓ -| - -|=== - -[float] -[[xy-features]] -=== Bar, line, area features - -[options="header"] -|=== - -| Type | Lens | TSVB | Agg-based | Vega | Timelion - -| Dense time series -| Customizable -| ✓ -| Customizable -| ✓ -| ✓ - -| Percentage mode -| ✓ -| ✓ -| ✓ -| ✓ -| - -| Break downs -| 1 -| 1 -| 3 -| ∞ -| 1 - -| Custom color with break downs -| -| Only for Filters -| ✓ -| ✓ -| - -| Fit missing values -| ✓ -| -| ✓ -| ✓ -| ✓ - -| Synchronized tooltips -| -| ✓ -| -| -| - -|=== - -[float] -[[bucket-aggregations]] -=== Bucket aggregations - -Vega supports all bucket aggregations because it allows custom queries. - -For information about {es} bucket aggregations, refer to {ref}/search-aggregations-bucket.html[Bucket aggregations]. - -[options="header"] -|=== - -| Type | Lens | TSVB | Agg-based - -| Histogram -| ✓ -| -| ✓ - -| Date histogram -| ✓ -| ✓ -| ✓ - -| Date range -| Use filters -| -| ✓ - -| Filter -| -| ✓ -| - -| Filters -| ✓ -| ✓ -| ✓ - -| GeoHash grid -| -| -| ✓ - -| IP range -| Use filters -| Use filters -| ✓ - -| Range -| ✓ -| Use filters -| ✓ - -| Terms -| ✓ -| ✓ -| ✓ - -| Significant terms -| -| -| ✓ - -|=== - -[float] -[[metrics-aggregations]] -=== Metrics aggregations - -Vega supports all metric aggregations because it allows custom queries. - -For information about {es} metrics aggregations, refer to {ref}/search-aggregations-metrics.html[Metrics aggregations]. - -[options="header"] -|=== - -| Type | Lens | TSVB | Agg-based - -| Metrics with filters -| ✓ -| -| - -| Average, Sum, Max, Min -| ✓ -| ✓ -| ✓ - -| Unique count (Cardinality) -| ✓ -| ✓ -| ✓ - -| Percentiles and Median -| ✓ -| ✓ -| ✓ - -| Percentiles Rank -| -| ✓ -| ✓ - -| Standard deviation -| -| ✓ -| ✓ - -| Sum of squares -| -| ✓ -| - -| Top hit (Last value) -| ✓ -| ✓ -| ✓ - -| Value count -| -| -| ✓ - -| Variance -| -| ✓ -| - -|=== - -[float] -[[pipeline-aggregations]] -=== Pipeline aggregations - -Vega supports all pipeline aggregations because it allows custom queries. - -For information about {es} pipeline aggregations, refer to {ref}/search-aggregations-pipeline.html[Pipeline aggregations]. - -[options="header"] -|=== - -| Type | Lens | TSVB | Agg-based - -| Avg bucket -| <> -| ✓ -| ✓ - -| Derivative -| ✓ -| ✓ -| ✓ - -| Max bucket -| <> -| ✓ -| ✓ - -| Min bucket -| <> -| ✓ -| ✓ - -| Sum bucket -| <> -| ✓ -| ✓ - -| Moving average -| ✓ -| ✓ -| ✓ - -| Cumulative sum -| ✓ -| ✓ -| ✓ - -| Bucket script -| -| -| ✓ - -| Bucket selector -| -| -| - -| Serial differencing -| -| ✓ -| ✓ - -|=== - -[float] -[[custom-functions]] -=== Additional functions - -[options="header"] -|=== - -| Type | Lens | TSVB | Agg-based - -| Counter rate -| ✓ -| ✓ -| - -| <> -| Use <> -| ✓ -| - -| <> -| -| ✓ -| - -| <> -| -| ✓ -| - -| Static value -| -| ✓ -| - - -|=== - -[float] -[[other-features]] -=== Other features - -This comparison is meant for users who are not sure about which {kib} panel type to -build their advanced visualization. - -[options="header"] -|=== - -| Type | Lens | TSVB | Agg-based | Vega | Timelion - -| Math -| ✓ -| ✓ -| -| ✓ -| ✓ - -| Visualize two indices -| ✓ -| ✓ -| -| ✓ -| ✓ - -| Math across indices -| -| -| -| ✓ -| ✓ - -| Time shifts -| ✓ -| ✓ -| -| ✓ -| ✓ - -| Fully custom {es} queries -| -| -| -| ✓ -| - -| Normalize by time -| ✓ -| ✓ -| -| -| - - -|=== diff --git a/docs/user/dashboard/dashboard-troubleshooting.asciidoc b/docs/user/dashboard/dashboard-troubleshooting.asciidoc new file mode 100644 index 0000000000000..d9bf80a5b1996 --- /dev/null +++ b/docs/user/dashboard/dashboard-troubleshooting.asciidoc @@ -0,0 +1,69 @@ +[[dashboard-troubleshooting]] +== Dashboard and visualizations troubleshooting +++++ +Troubleshooting +++++ + +Find solutions to common dashboard and visualization issues. + +[float] +[[defer-loading-panels-below-the-fold]] +=== Improve dashboard loading time + +To improve the dashboard loading time, enable *Defer loading panels below the fold* *Lab*, which loads dashboard panels as they become visible on the dashboard. + +. In the toolbar, click *Labs*. ++ +To enable *Labs*, contact your administrator, or configure the <>. + +. To specify how you want to enable the lab, use the following actions: + +* *{kib}* — Enables the lab in {kib}. + +* *Browser* — Enables the lab for your browser, and persists after you close the browser. + +* *Session* — Enables the lab for this browser session, then resets after you close the browser. + +. Click *Close*. + +[float] +[[migrate-timelion-app-worksheets]] +=== Migrate Timelion app worksheets + +deprecated::[The *Timelion* app is deprecated in 7.0.0, and will be removed in 7.16.0. To prepare for the removal of *Timelion* app, you must migrate *Timelion* app worksheets to a dashboard. + +. Open the main menu, then click *Dashboard*. + +. On the *Dashboards* page, click *Create dashboard*. + +. For each *Timelion* app worksheet, create a visualization with the *Timelion* editor. + +.. On the dashboard, click *All types > Aggregation based*, then select *Timelion*. + +.. In your browser, open a new tab, the open the *Timelion* app. + +.. Select the chart you want to copy, then copy the chart expression. ++ +[role="screenshot"] +image::images/timelion-copy-expression.png[Timelion app chart] + +.. Go to the *Timelion* editor, paste the chart expression in the *Timelion expression* field, then click *Update*. ++ +[role="screenshot"] +image::images/timelion-vis-paste-expression.png[Timelion advanced editor UI] + +. Save the visualization. + +.. In the toolbar, click *Save to library*. + +.. Enter the *Title* and add any applicable <>. + +.. Make sure that *Add to Dashboard after saving* is selected. + +.. Click *Save and return*. ++ +The Timelion visualization panel appears on the dashboard. ++ +[role="screenshot"] +image::user/dashboard/images/timelion-dashboard.png[Final dashboard with saved Timelion app worksheet] + diff --git a/docs/user/dashboard/dashboard.asciidoc b/docs/user/dashboard/dashboard.asciidoc index 6430c5d246dc6..1a9a0087becda 100644 --- a/docs/user/dashboard/dashboard.asciidoc +++ b/docs/user/dashboard/dashboard.asciidoc @@ -1,5 +1,5 @@ [[dashboard]] -= Dashboard += Dashboard and visualizations [partintro] -- @@ -11,14 +11,13 @@ that bring clarity to your data, tell a story about your data, and allow you to [role="screenshot"] image:images/Dashboard_example.png[Example dashboard] -Panels display your data in charts, tables, maps, and more, which allow you to compare your data side-by-side to identify patterns and connections. Dashboards support several editors you can use to create panels, and support many types of panels to display your data. +Panels display your data in charts, tables, maps, and more, which allow you to compare your data side-by-side to identify patterns and connections. Dashboards support several types of panels to display your data, and several options to create panels. [cols="2"] |=== | <> -| Use the *Lens*, *TSVB*, *Vega*, and *Timelion* editors to create visualizations of your data, or create *Aggregation based* visualizations using {es} aggregations. -*Lens* is the recommended editor. +| Use one of the editors to create visualizations of your data. Each editor varies in capabilities for all levels of analysts. | <> | Create beautiful displays of your geographical data. @@ -33,7 +32,10 @@ Panels display your data in charts, tables, maps, and more, which allow you to c | Display a table of live streaming logs. | <> -| Add context to your panels with <>, or add dynamic filters with <>. +| Add interactive filters with *Controls* panels. + +| <> +| Add context to your panels with *Text*. |=== @@ -61,71 +63,115 @@ refer to <>. [[open-the-dashboard]] === Open the dashboard -Begin with an empty dashboard, or open an existing dashboard. +Begin with an empty dashboard, or open an existing dashboard. . Open the main menu, then click *Dashboard*. . On the *Dashboards* page, choose one of the following options: * To start with an empty dashboard, click *Create dashboard*. ++ +When you create a dashboard, you are automatically in edit mode and can make changes to the dashboard. * To open an existing dashboard, click the dashboard *Title* you want to open. ++ +When you open an existing dashboard, you are in view mode. To make changes to the dashboard, click *Edit* in the toolbar. [float] [[create-panels-with-lens]] -=== Add panels +=== Create and add panels + +You create panels using the editors, which you can access from the dashboard toolbar or the *Visualize Library*, or add panels that are saved in the *Visualize Library*, or search results from <>. + +To create panels from the dashboard toolbar, use one of the following options: + +* *Create visualization* — Opens the drag-and-drop editor, which is the recommended way to create visualization panels. + +* *All types* — Opens the menu for all of the editors and panel types. + +To create panels from the *Visualize Library*: -Create and add panels of your data to the dashboard, or add existing panels from the library. +. Open the main menu, then click *Visualize Library*. -* *Create visualization* — Opens *Lens*, the recommended editor to create visualizations of your data. +. Click *Create visualization*, then select an editor. -* *All types* — Select the editor to create the panel, or select the panel type you want to add to the dashboard. +To add existing panels from the *Visualize Library*: -* *Add from library* — Add panels from the *Visualize Library*, including search results from <>. The search results from *Discover* are not aggregated. +. In the dashboard toolbar, click *Add from library*. + +. Click the panel you want to add to the dashboard, then click *X*. + When a panel contains a saved query, both queries are applied. ++ +When you add search results from *Discover* to dashboards, the results are not aggregated. [[tsvb]] [float] [[save-panels]] -=== Save panels +=== Save and add panels -Consider where you want to save the panel in {kib}. You can save the panel just on the dashboard you are working on, or save the panel in the *Visualize Library*. +Consider where you want to save and add the panel in {kib}. [float] [[save-to-visualize-library]] ==== Save to the Visualize Library -To use the panel on *Canvas* workpads and other dashboards, save the panel to the *Visualize Library*. +To use the panel on other dashboards and *Canvas* workpads, save the panel to the *Visualize Library*. When panels are saved in the *Visualize Library*, image:dashboard/images/visualize-library-icon.png[Visualize Library icon] appears in the panel header. -. Click *Save to library*. +If you created the panel from the dashboard: + +. In the editor, click *Save to library*. -. Enter the *Title* and add any applicable *Tags*. +. Enter the *Title* and add any applicable <>. . Make sure that *Add to Dashboard after saving* is selected. . Click *Save and return*. -+ -When panels are saved in the *Visualize Library*, image:dashboard/images/visualize-library-icon.png[Visualize Library icon] appears in the panel header. + +If you created the panel from the *Visualize Library*: + +. In the editor, click *Save*. + +. On the *Save* window, enter the *Title*. + +. Choose one of the following options: + +* To save the panel to a dashboard and the *Visualize Library*, select *Add to library*, add any applicable <>, then click *Save and go to Dashboard*. + +* To save the panel only to the *Visualize Library*, select *None*, add any applicable <>, then click *Save and add to library*. [float] [[save-to-the-dashboard]] ==== Save to the dashboard -Quickly add the panel and return to the dashboard without specifying the save options or adding the panel to the *Visualize Library*. +Return to the dashboard and add the panel without specifying the save options or adding the panel to the *Visualize Library*. -. Click *Save and return*. +If you created the panel from the dashboard: + +. In the editor, click *Save and return*. -. Add more panels to the dashboard, or specify the panel title. +. Add an optional title to the panel. .. In the panel header, click *No Title*. -.. Select *Show panel title*. +.. On the *Customize panel* window, select *Show panel title*. + +.. Enter the *Panel title*, then click *Save*. -.. Enter the *Panel title*. +If you created the panel from the *Visualize Library*: -If you change your mind and want to add the panel to the *Visualize Library*: +. Click *Save*. + +. On the *Save* window, enter the *Title*. + +. Choose one of the following options: + +* If you want to add the panel to an existing dashboard, select *Existing*, select the dashboard from the dropdown, then click *Save and go to Dashboard*. + +* If you want to add the panel to a new dashboard, select *New*, then click *Save and go to Dashboard*. + +To add unsaved dashboard panels to the *Visualize Library*: . Open the panel menu, then select *More > Save to library*. @@ -135,72 +181,61 @@ If you change your mind and want to add the panel to the *Visualize Library*: [[add-text]] == Add context to panels -To provide context to your dashboard panels, add *Text* panels that display important information, instructions, images, and more. - -You create *Text* panels using GitHub-flavored Markdown text. For information about GitHub-flavored Markdown text, click *Help*. +To provide context to your dashboard panels, add *Text* panels that display important information, instructions, images, and more. You create *Text* panels using GitHub-flavored Markdown text. -. From the dashboard, click *All types*, then select *Text*. +. On the dashboard, click image:images/dashboard_createNewTextButton_7.15.0.png[Create New Text button in dashboard toolbar]. . In the *Markdown* field, enter the text, then click *Update*. For example, when you enter: [role="screenshot"] -image::images/markdown_example_1.png[] +image::images/markdown_example_1.png[Markdown text with links] The following instructions are displayed: [role="screenshot"] -image::images/markdown_example_2.png[] +image::images/markdown_example_2.png[Panel with markdown link text] Or when you enter: [role="screenshot"] -image::images/markdown_example_3.png[] +image::images/markdown_example_3.png[Markdown text with image file] The following image is displayed: [role="screenshot"] -image::images/markdown_example_4.png[] +image::images/markdown_example_4.png[Panel with markdown image] -[float] -[[edit-panels]] -== Edit panels +For detailed information about writing on GitHub, click *Help*. -To make changes to the panel, use the panel menu options. +[float] +[[save-the-markdown-panel]] +=== Save and add the panel -. In the toolbar, click *Edit*. +Save the panel to the *Visualize Library* and add it to the dashboard, or add it to the dashboard without saving. -. Open the panel menu, then use the following options: +To save the panel to the *Visualize Library*: -* *Edit lens* — Opens *Lens* so you can make changes to the visualization. +. Click *Save to library*. -* *Edit visualization* — Opens the editor so you can make changes to the panel. -+ -To make changes without changing the original version, open the panel menu, then click *More > Unlink from library*. +. Enter the *Title* and add any applicable <>. -* *Edit panel title* — Opens the *Customize panel* window to change the *Panel title*. +. Make sure that *Add to Dashboard after saving* is selected. -* *More > Replace panel* — Opens the *Visualize Library* so you can select a new panel to replace the existing panel. +. Click *Save and return*. -* *More > Delete from dashboard* — Removes the panel from the dashboard. -+ -If you want to use the panel later, make sure that you save the panel to the *Visualize Library*. +To save the panel to the dashboard: -[float] -[[search-or-filter-your-data]] -== Search and filter your data +. Click *Save and return*. -{kib} supports several ways to search your data and apply {es} filters. You can combine the filters with any panel -filter to display the data want to you see. +. Add an optional title to the panel. -For more information about {kib} and {es} filters, refer to <>. +.. In the panel header, click *No Title*. -To apply a panel-level time filter: +.. On the *Customize panel* window, select *Show panel title*. -. Open the panel menu, then select *More > Customize time range*. - -. Enter the time range you want to view, then click *Add to panel*. +.. Enter the *Panel title*, then click *Save*. [float] [[arrange-panels]] @@ -208,7 +243,7 @@ To apply a panel-level time filter: [[resizing-containers]] == Arrange panels -To compare the data side-by-side, move and arrange the panels. +Compare the data in your panels side-by-side, organize panels by priority, resize the panels so they all appear immediately on the dashboard, and more. In the toolbar, click *Edit*, then use the following options: @@ -219,18 +254,28 @@ In the toolbar, click *Edit*, then use the following options: * To maximize to fullscreen, open the panel menu, then click *More > Maximize panel*. [float] -[[apply-design-options]] -== Apply design options +[[edit-panels]] +== Edit panels -Apply a set of design options to the entire dashboard. +To make changes to the panel, use the panel menu options. -In the toolbar, click *Edit > Options*, then use the following options: +. In the toolbar, click *Edit*. -* *Use margins between panels* — Specifies a margin of space between each panel. +. Open the panel menu, then use the following options: -* *Show panel titles* — Specifies the appearance of titles in the header of each panel. +* *Edit lens* — Opens *Lens* so you can make changes to the visualization. -* *Sync color pallettes across panels* — Specifies whether the color pallette is applied to all panels. +* *Edit visualization* — Opens the editor so you can make changes to the panel. ++ +To make changes without changing the original version, open the panel menu, then click *More > Unlink from library*. + +* *Edit panel title* — Opens the *Customize panel* window to change the *Panel title*. + +* *More > Replace panel* — Opens the *Visualize Library* so you can select a new panel to replace the existing panel. + +* *More > Delete from dashboard* — Removes the panel from the dashboard. ++ +If you want to use the panel later, make sure that you save the panel to the *Visualize Library*. [float] [[duplicate-panels]] @@ -262,78 +307,71 @@ Copy panels from one dashboard to another dashboard. . On the *Copy to dashboard* window, select the dashboard, then click *Copy and go to dashboard*. [float] -[[explore-the-underlying-documents]] -== Explore the underlying documents +[[search-or-filter-your-data]] +== Search and filter your data -You can add additional interactions that allow you to open *Discover* from dashboard panels. To use the interactions, the panel must use only one index pattern. +{kib} supports several ways to search your data and apply {es} filters. You can combine the filters with any panel +filter to display the data want to you see. -Panel interaction:: Opens the data in *Discover* with the current dashboard filters, but does not take the filters -saved with the panel. -+ -To enable panel interactions, refer to <>. -+ -NOTE: In {kib} 7.13 and earlier, the panel interaction is enabled by default. +For more information about {kib} and {es} filters, refer to <>. -Series interaction:: -Opens the series data in *Discover* from inside the panel. -+ -To enable series interactions, refer to <>. +To apply a panel-level time filter: -[float] -[[download-csv]] -== Download panel data +. Open the panel menu, then select *More > Customize time range*. -Download panel data in a CSV file. You can download most panels in a CSV file, but there is a shortcut available -for *Lens* panels. +. Enter the time range you want to view, then click *Add to panel*. [float] -[role="xpack"] -[[download-lens-data]] -=== Download Lens data +[[apply-design-options]] +== Apply design options + +Apply a set of design options to the entire dashboard. + +. If you're in view mode, click *Edit* in the toolbar. -When you download *Lens* panel data, each layer produces a single CSV file with columns. -When you download multiple layers, the file names combine the visualization and layer index names. +. In the toolbar, *Options*, then use the following options: -. Open the *Lens* panel menu +* *Use margins between panels* — Adds a margin of space between each panel. -. Select *More > Download as CSV*. +* *Show panel titles* — Displays the titles in the panels headers. + +* *Sync color pallettes across panels* — Applies the same color palette to all panels on the dashboard. [float] -[[download-other-panel-data]] -=== Download all other panel data +[[save-dashboards]] +== Save dashboards -Download the data for non-*Lens* panels. +When you've finished making changes to the dashboard, save it. -. Open the panel menu, then select *Inspect*. +If you are saving a new dashboard: -. Click *Download CSV*, then select the CSV type from the dropdown: +. In the toolbar, click *Save*. -* *Formatted CSV* — Contains human-readable dates and numbers. +. On the *Save dashboard* window, enter the *Title* and an optional *Description*. -* *Unformatted* — Best used for computer use. -+ -[role="screenshot"] -image:images/Dashboard_inspect.png[Inspect in dashboard] +. Add any applicable <>. -[float] -[[defer-loading-panels-below-the-fold]] -== Improve dashboard loading time +. To save the time filter to the dashboard, select *Store time with dashboard*. -To improve the dashboard loading time, enable the *Defer loading panels below the fold* *Lab*, which loads the dashboard panels as they become visible on the dashboard. +. Click *Save*. -. In the toolbar, click *Labs*. -+ -To enable *Labs*, contact your administrator, or configure the <>. +If you are saving an existing dashboard, click *Save*. + +To exit *Edit* mode, click *Switch to view mode*. + +[float] +[[download-csv]] +== Download panel data -. To specify how you want to enable the lab, use the following actions: +Download panel data in a CSV file. When you download visualization panels with multiple layers, each layer produces a CSV file, and the file names contain the visualization and layer index names. -* *{kib}* — Enables the lab in {kib}. +. Open the panel menu, then select *Inspect*. -* *Browser* — Enables the lab for your browser, and persists after you close the browser. +. Click *Download CSV*, then select the format type from the dropdown: -* *Session* — Enables the lab for this browser session, then resets after you close the browser. +* *Formatted CSV* — Contains human-readable dates and numbers. -. Click *Close*. +* *Unformatted* — Best used for computer use. [float] [[share-the-dashboard]] @@ -355,3 +393,5 @@ include::lens-advanced.asciidoc[] include::create-panels-with-editors.asciidoc[] include::make-dashboards-interactive.asciidoc[] + +include::dashboard-troubleshooting.asciidoc[] diff --git a/docs/user/dashboard/enhance-dashboards.asciidoc b/docs/user/dashboard/enhance-dashboards.asciidoc deleted file mode 100644 index de8af34e6d32e..0000000000000 --- a/docs/user/dashboard/enhance-dashboards.asciidoc +++ /dev/null @@ -1,69 +0,0 @@ -[[enhance-dashboards]] -== Enhance dashboards - -You can add filter panels to interact with the data in your visualization panels, and Markdown panels to add context to the data. -To make your dashboard look the way you want, use the editing options. - -[float] -[[add-controls]] -=== Add controls - -To filter the data on your dashboard in real-time, add a *Controls* panel or use a map panel to <>. - -{kib} supports two types of *Controls*: - -* *Options list* — Filters content based on one or more specified options. The dropdown menu is dynamically populated with the results of a terms aggregation. -For example, use the options list on the sample flight dashboard when you want to filter the data by origin city and destination city. - -* *Range slider* — Filters data within a specified range of numbers. The minimum and maximum values are dynamically populated with the results of a -min and max aggregation. For example, use the range slider when you want to filter the sample flight dashboard by a specific average ticket price. -+ -[role="screenshot"] -image::images/dashboard-controls.png[] - -. On the dashboard, click *All types*, then select *Controls*. - -. Click *Options*, then configure the following options: - -* *Update {kib} filters on each change* — When selected, all interactive inputs create filters that refresh the dashboard. When unselected, - {kib} filters are created only when you click *Apply changes*. - -* *Use time filter* — When selected, the aggregations that generate the options list and time range are connected to the <>. - -* *Pin filters for all applications* — When selected, all filters created by interacting with the inputs are automatically pinned. - -. Click *Update* - -[float] -[[add-text]] -=== Add text - -Add text panels with *Markdown* when you want to provide context to the other panels on your dashboard, such as important information, instructions, and images. - -*Markdown* is a text entry field that accepts GitHub-flavored Markdown text. For information about GitHub-flavored Markdown text, click *Help*. - -. From the dashboard, click *All types*, then select *Text*. - -. In the *Markdown* field, enter the text, then click *Update*. - -For example, when you enter: - -[role="screenshot"] -image::images/markdown_example_1.png[] - -The following instructions are displayed: - -[role="screenshot"] -image::images/markdown_example_2.png[] - -Or when you enter: - -[role="screenshot"] -image::images/markdown_example_3.png[] - -The following image is displayed: - -[role="screenshot"] -image::images/markdown_example_4.png[] - - diff --git a/docs/user/dashboard/images/dashboard_createNewTextButton_7.15.0.png b/docs/user/dashboard/images/dashboard_createNewTextButton_7.15.0.png new file mode 100644 index 0000000000000..f89f2ef5cf249 Binary files /dev/null and b/docs/user/dashboard/images/dashboard_createNewTextButton_7.15.0.png differ diff --git a/docs/user/dashboard/images/markdown_example_1.png b/docs/user/dashboard/images/markdown_example_1.png index 71dd9b76b8caf..8ade6b83cf742 100644 Binary files a/docs/user/dashboard/images/markdown_example_1.png and b/docs/user/dashboard/images/markdown_example_1.png differ diff --git a/docs/user/dashboard/images/markdown_example_2.png b/docs/user/dashboard/images/markdown_example_2.png index f2094c3cbb3f1..e114d33846fdf 100644 Binary files a/docs/user/dashboard/images/markdown_example_2.png and b/docs/user/dashboard/images/markdown_example_2.png differ diff --git a/docs/user/dashboard/images/markdown_example_3.png b/docs/user/dashboard/images/markdown_example_3.png index eca9735b495d0..09a1858a2a932 100644 Binary files a/docs/user/dashboard/images/markdown_example_3.png and b/docs/user/dashboard/images/markdown_example_3.png differ diff --git a/docs/user/dashboard/images/markdown_example_4.png b/docs/user/dashboard/images/markdown_example_4.png index d4a0829fef64e..f0d133fc3641a 100644 Binary files a/docs/user/dashboard/images/markdown_example_4.png and b/docs/user/dashboard/images/markdown_example_4.png differ diff --git a/docs/user/dashboard/images/timelion-dashboard.png b/docs/user/dashboard/images/timelion-dashboard.png new file mode 100644 index 0000000000000..e217dca98d079 Binary files /dev/null and b/docs/user/dashboard/images/timelion-dashboard.png differ diff --git a/docs/user/dashboard/lens.asciidoc b/docs/user/dashboard/lens.asciidoc index 774b50caeba6a..0f130f15c8a77 100644 --- a/docs/user/dashboard/lens.asciidoc +++ b/docs/user/dashboard/lens.asciidoc @@ -1,14 +1,18 @@ [[lens]] -=== Lens +=== Create visualizations with Lens +++++ +Lens +++++ -To create visualization panels with *Lens*, you drag the data fields you want to visualize to the workspace, then *Lens* uses heuristics to apply each field and create a visualization for you. +To create a visualization, drag the data fields you want to visualize to the workspace, then *Lens* uses visualization best practices to apply the fields and create a visualization that best displays the data. With *Lens*, you can: -* Create area, line, and bar charts with multiple layers, indices, and visualization types. -* Change the aggregation function and labels to customize the data. +* Create area, line, and bar charts with layers to display multiple indices and chart types. +* Change the aggregation function to change the data in the visualization. * Perform math on aggregations using *Formula*. -* Use time shifts to compare data for two time intervals, such as month over month. +* Use time shifts to compare the data in two time intervals, such as month over month. +* Create custom tables. ++++ - -
-++++ +[[kibana-home-page]] +[role="screenshot"] +image::images/analytics-home-page.png[Analytics home page] *{kib} is for administrators, analysts, and business users.* As an admin, your role is to manage the Elastic Stack, from creating your deployment to getting {es} data into {kib}, and then -managing the data. As an analyst, your job is to discover insights +managing the data. As an analyst, you're looking to discover insights in the data, visualize your data on dashboards, and share your findings. As a business user, you want to view existing dashboards and drill down into details. *{kib} works with all types of data.* Your data can be structured or unstructured text, -numerical data, time-series data, geospatial data, logs, metrics, security events, -and more. Kibana is designed to use Elasticsearch as a data store. +numerical data, time series data, geospatial data, logs, metrics, security events, +and more. No matter your data, {kib} can help you uncover patterns and relationships and visualize the results. -[float] -[[kibana-home-page]] -=== Where to start - -Start with the home page, where you’re presented options for adding your data. -You can collect data from an app or service or upload a file that contains your data. -If you’re not ready to use your own data, you can add a sample data set. - -The home page provides access to the *Enterprise Search*, *Observability*, and *Security* solutions, -and everything you need to visualize and analyze your data. - -To access all of {kib} features, use the main menu. -Open this menu by clicking the -menu icon. -For a quick reference of all {kib} features, refer to <> - -[role="screenshot"] -image::images/kibana-main-menu.png[Kibana main menu] - [float] [[extend-your-use-case]] === Search, observe, and protect @@ -82,12 +53,13 @@ that it ran in, trace the transaction, and check the overall service availabilit the events and alerts from your environment. Elastic Security helps you defend your organization from threats before damage and loss occur. + [float] [[visualize-and-analyze]] -=== Visualize and analyze +=== Analyze -Data analysis is a core functionality of {kib}. -You can quickly search through large amounts of data, explore fields and values, +Data analysis is a core functionality of {kib}. Quickly search through large amounts +of data, explore fields and values, and then use {kib}’s drag-and-drop interface to rapidly build charts, tables, metrics, and more. [role="screenshot"] @@ -108,14 +80,17 @@ You can limit your results to the most recent documents added to {es}. | *3* | *Visualize.* {kib} provides many options to create visualizations of your data, from -aggregation-based data to time series data. +aggregation-based data to time series data to geo data. <> is your starting point to create visualizations, and then pulling them together to show your data from multiple perspectives. +Use <>, +to give your data +the “wow” factor for display on a big screen. Use *Graph* to explore patterns and relationships. | *4* -| *Present.* With <>, you can display your data on a visually -compelling, pixel-perfect workpad. **Canvas** can give your data -the “wow” factor needed to impress your CEO and captivate coworkers with a big-screen display. +| *Model data behavior.* +Use <> to model the behavior of your data—forecast unusual behavior and +perform outlier detection, regression, and classification analysis. | *5* | *Share.* Ready to <> your findings with a larger audience? {kib} offers many options—embed @@ -123,50 +98,9 @@ a dashboard, share a link, export to PDF, and more. |=== [float] -==== Plot location data on a map -If you’re looking to better understand the “where’’ in your data, your data -analysis journey will also include <>. This app is the right -choice when you’re looking for a spatial pattern, performing ad-hoc location-driven analysis, -or analyzing metrics with a geographic perspective. With *Maps*, you can build -world country maps, administrative region maps, and point-to-point origin-destination maps. -You can also visualize and track movement over space and through time. - -[float] -==== Model data behavior - -To model the behavior of your data, you'll use -<>. -This app can help you extract insights from your data that you might otherwise miss. -You can forecast unusual behavior in your time series data. -You can also perform outlier detection, regression, and classification analysis -on your data and generate annotated results. - -[float] -==== Graph relationships - -Looking to uncover how items in your data are related? -<> is your app. Graphing relationships is useful in a variety of use cases, -from fraud detection to recommendation engines. For example, graph exploration -can help you uncover website vulnerabilities that hackers are targeting, -so you can harden your website. Or, you might provide graph-based -personalized recommendations to your e-commerce customers. - -[float] -[[manage-all-things-stack]] -=== Manage all things Elastic Stack - -{kib}'s <> UIs takes you under the hood, -so you can twist the levers and turn the knobs. You'll find -guided processes for administering all things Elastic Stack, -including data, indices, clusters, alerts, and security. - -[role="screenshot"] -image::images/stack-management.png[Index Management view in Stack Management] - -[float] -==== Manage your data, indices, and clusters +=== Manage your data -{kib} offers these data management tasks—all from the convenience of a UI: +{kib} helps you perform your data management tasks from the convenience of a UI. You can: * Refresh, flush, and clear the cache of your indices. * Define the lifecycle of an index as it ages. @@ -174,71 +108,64 @@ image::images/stack-management.png[Index Management view in Stack Management] * Roll up data from one or more indices into a new, compact index. * Replicate indices on a remote cluster and copy them to a local cluster. -[float] -==== Alert and take action -Detecting and acting on significant shifts and signals in your data is a need -that exists in almost every use case. For example, you might set a rule to notify you when: +For a full list of data management UIs, refer to <>. + +[role="screenshot"] +image::images/stack-management.png[Index Management view in Stack Management] -* A shift occurs in your business critical KPIs. -* System resources, such as memory, CPU and disk space, take a dip. -* An unusually high number of service requests, suspicious processes, and login attempts occurs. -A rule triggers when a specified condition is met. For example, -you can create a rule when the average or max of one of -your metrics exceeds a threshold within a specified time frame. +[float] +=== Alert and take action -When the rule triggers, you can send a notification to a system that is part of -your daily workflow. {kib} integrates with email, Slack, PagerDuty, and ServiceNow, -to name a few. +Detecting and acting on significant shifts and signals in your data is a need +that exists in almost every use case. Alerting allows you to +detect conditions in different {kib} apps and trigger actions when those conditions are met. +For example, you might trigger an alert when a shift occurs in your business critical KPIs or when +memory, CPU, or disk space take a dip. +When the alert triggers, you can send a notification to a system that is part of your daily workflow: +email, Slack, PagerDuty, ServiceNow, and other third party integrations. -A dedicated view for creating, searching, and editing rules is in <>. +A dedicated view for creating, searching, +and editing rules is in <> [role="screenshot"] image::images/rules-and-connectors.png[Rules and Connectors view] - [float] [[organize-and-secure]] -=== Organize your work in spaces +=== Organize content + +You might be managing tens, hundreds, or even thousands of dashboards, visualizations, and other {kib} assets. +{kib} has several features for keeping your content organized. -Want to share {kib}’s goodness with other people or teams without overwhelming them? You can do so -with <>, built for organizing your visualizations, dashboards, and index patterns. + +[float] +[[organize-in-spaces]] +==== Collect related items in a space + +{kib} +<> is built for organizing your visualizations, dashboards, and {data-sources}. Think of a space as its own mini {kib} installation—it’s isolated from all other spaces, so you can tailor it to your specific needs without impacting others. -[role="screenshot"] -image::images/select-your-space.png[Space selector view] - Most of {kib}’s entities are space-aware, including dashboards, visualizations, index patterns, *Canvas* workpads, graphs, tags, and machine learning jobs. -In addition: - -* **Elastic Security** is space-aware, so the timelines and investigations -you open in one space will not be available to other spaces. - -* **Observability** is currently partially space-aware, but will be enhanced to become fully space-aware. - -* Most of the **Stack Management** features are not space aware because they -are primarily used to manage features of {es}, which serves as a shared data store for all spaces. - -* Alerts are space-aware and work nicely with the {kib} role-based access control -model to allow you secure access to them, depending on the alert type and your user roles. -For example, roles with no access to an app will not have access to its alerts. +[role="screenshot"] +image::images/select-your-space.png[Space selector view] [float] -==== Control feature visibility +==== Organize your content with tags -You can take spaces one step further and control which features are visible -within each space. For example, you might hide **Dev Tools** in your "Marketing" -space or show **Stack Monitoring** only in your "Engineering" space. +Tags are keywords or labels that you assign to {kib} saved objects, +such as dashboards and visualizations, so you can classify them in a way that is meaningful to you. +For example, if you tag objects with “design”, you can search and +filter on the tag to see related objects. +Tags are also good for grouping content into categories within a space. -Controlling feature visibility is not a security feature. To secure access -to specific features on a per-user basis, you must configure -<>. - -[role="screenshot"] -image::spaces/images/edit-space-feature-visibility.png[Features Controls view] +Don’t worry if you have hundreds of dashboards that need to be tagged. Use <> +in *Stack Management* to create your tags, then assign and delete +them in bulk operations. [float] [[intro-kibana-Security]] @@ -291,22 +218,14 @@ users’ behavior. For more information, see <>. - -|Add data -|The Add data page, available from the home page. - -|See the full list of {kib} features -|The https://www.elastic.co/kibana/features[{kib} features page on elastic.co] - -2+|*Build a search experience* - -|Create a search experience for your workplace -|https://www.elastic.co/guide/en/workplace-search/current/workplace-search-getting-started.html[Workplace Search] - -|Build a search experience for your app -|https://www.elastic.co/guide/en/app-search/current/getting-started.html[App Search] - - -2+|*Monitor, analyze, and react to events* - -|Monitor software services and applications in real-time by collecting performance information -|{observability-guide}/apm.html[APM] - -|Monitor the availability of your sites and services -|{observability-guide}/monitor-uptime.html[Uptime] - -|Search, filter, and tail all your logs -|{observability-guide}/monitor-logs.html[Logs] +This example searches for visualizations with the tag `design` . -|Analyze metrics from your infrastructure, apps, and services -|{observability-guide}/analyze-metrics.html[Metrics] - -2+|*Prevent, detect, and respond to threats* - -|Create and manage rules for suspicious source events, and view the alerts these rules create. -|{security-guide}/detection-engine-overview.html[Detections] - -|View all hosts and host-related security events. -|{security-guide}/hosts-overview.html[Hosts] - -|View key network activity metrics via an interactive map. -|{security-guide}/network-page-overview.html[Network] - -|Investigate alerts and complex threats, such as lateral movement of malware across hosts in your network. -|{security-guide}/timelines-ui.html[Timelines] - -|Create and track security issues -|{security-guide}/cases-overview.html[Cases] - -|View and manage hosts that are running Endpoint Security -|{security-guide}/admin-page-ov.html[Administration] - -2+| *Analyze and visualize your data* - -|Know what’s in your data -|<> - -|Create charts and other visualizations -|<> - -|Show your data from different perspectives -|<> - -|Work with location data -|<> - -|Create a presentation of your data -|<> - -|Generate models for your data’s behavior -|<> - -|Explore connections in your data -|<> - -|Share your data -|<>, <>, <> - -2+|*Administer your Kibana instance* - -|Manage your Elasticsearch data -|< Data>> - -|Set up rules -|< Rules and Connectors>> - -|Organize your workspace and users -|< Spaces>> +[role="screenshot"] +image::images/tags-search.png[Example of searching for tags] -|Define user roles and privileges -|< Users>> -|Customize {kib} to suit your needs -|< Advanced Settings>> +[float] +=== View all {kib} has to offer -|=== +To view the full list of {kib} apps and features, go to https://www.elastic.co/kibana/features[{kib} features]. [float] [[try-kibana]] -=== How to get help +=== Get help -Using our in-product guidance can help you get up and running, faster. -Click the help icon image:images/intro-help-icon.png[Help icon in navigation bar] +Click image:images/intro-help-icon.png[Help icon in navigation bar] for help with questions or to provide feedback. To keep up with what’s new and changed in Elastic, click the celebration icon in the global header. diff --git a/docs/user/production-considerations/alerting-production-considerations.asciidoc b/docs/user/production-considerations/alerting-production-considerations.asciidoc index 57cc2a72a8895..cd8a60a1d5fe3 100644 --- a/docs/user/production-considerations/alerting-production-considerations.asciidoc +++ b/docs/user/production-considerations/alerting-production-considerations.asciidoc @@ -54,6 +54,8 @@ Predicting the buffer required to account for actions depends heavily on the rul [[event-log-ilm]] === Event log index lifecycle managment +experimental[] + Alerts and actions log activity in a set of "event log" indices. These indices are configured with an index lifecycle management (ILM) policy, which you can customize. The default policy rolls over the index when it reaches 50GB, or after 30 days. Indices over 90 days old are deleted. The name of the index policy is `kibana-event-log-policy`. {kib} creates the index policy on startup, if it doesn't already exist. The index policy can be customized for your environment, but {kib} never modifies the index policy after creating it. diff --git a/docs/user/production-considerations/task-manager-health-monitoring.asciidoc b/docs/user/production-considerations/task-manager-health-monitoring.asciidoc index 3321a9d0c02a1..b07a01906b895 100644 --- a/docs/user/production-considerations/task-manager-health-monitoring.asciidoc +++ b/docs/user/production-considerations/task-manager-health-monitoring.asciidoc @@ -111,6 +111,7 @@ a| Runtime | This section tracks excution performance of Task Manager, tracking task _drift_, worker _load_, and execution stats broken down by type, including duration and execution results. + a| Capacity Estimation | This section provides a rough estimate about the sufficiency of its capacity. As the name suggests, these are estimates based on historical data and should not be used as predictions. Use these estimations when following the Task Manager <>. @@ -123,6 +124,14 @@ The root `status` indicates the `status` of the system overall. The Runtime `status` indicates whether task executions have exceeded any of the <>. An `OK` status means none of the threshold have been exceeded. A `Warning` status means that at least one warning threshold has been exceeded. An `Error` status means that at least one error threshold has been exceeded. +[IMPORTANT] +============================================== +Some tasks (such as <>) will incorrectly report their status as successful even if the task failed. +The runtime and workload block will return data about success and failures and will not take this into consideration. + +To get a better sense of action failures, please refer to the <> for more accurate context into failures and successes. +============================================== + The Capacity Estimation `status` indicates the sufficiency of the observed capacity. An `OK` status means capacity is sufficient. A `Warning` status means that capacity is sufficient for the scheduled recurring tasks, but non-recurring tasks often cause the cluster to exceed capacity. An `Error` status means that there is insufficient capacity across all types of tasks. By monitoring the `status` of the system overall, and the `status` of specific task types of interest, you can evaluate the health of the {kib} Task Management system. diff --git a/package.json b/package.json index e603190c72698..628fd320ea046 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,6 @@ "**/pdfkit/crypto-js": "4.0.0", "**/react-syntax-highlighter": "^15.3.1", "**/react-syntax-highlighter/**/highlight.js": "^10.4.1", - "**/request": "^2.88.2", "**/trim": "1.0.1", "**/typescript": "4.1.3", "**/underscore": "^1.13.1" @@ -100,7 +99,7 @@ "@elastic/datemath": "link:bazel-bin/packages/elastic-datemath", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.19", "@elastic/ems-client": "7.15.0", - "@elastic/eui": "37.3.1", + "@elastic/eui": "37.6.0", "@elastic/filesaver": "1.1.2", "@elastic/good": "^9.0.1-kibana3", "@elastic/maki": "6.3.0", @@ -155,6 +154,7 @@ "@kbn/server-http-tools": "link:bazel-bin/packages/kbn-server-http-tools", "@kbn/server-route-repository": "link:bazel-bin/packages/kbn-server-route-repository", "@kbn/std": "link:bazel-bin/packages/kbn-std", + "@kbn/timelion-grammar": "link:bazel-bin/packages/kbn-timelion-grammar", "@kbn/tinymath": "link:bazel-bin/packages/kbn-tinymath", "@kbn/typed-react-router-config": "link:bazel-bin/packages/kbn-typed-react-router-config", "@kbn/ui-framework": "link:bazel-bin/packages/kbn-ui-framework", @@ -184,15 +184,11 @@ "JSONStream": "1.3.5", "abort-controller": "^3.0.0", "abortcontroller-polyfill": "^1.4.0", - "ajv": "^6.12.4", "angular": "^1.8.0", "angular-aria": "^1.8.0", - "angular-elastic": "^2.5.1", "angular-recursion": "^1.0.5", - "angular-resource": "1.8.0", "angular-route": "^1.8.0", "angular-sanitize": "^1.8.0", - "angular-sortable-view": "^0.0.17", "antlr4ts": "^0.5.0-alpha.3", "archiver": "^5.2.0", "axios": "^0.21.1", @@ -201,7 +197,6 @@ "brace": "0.11.1", "broadcast-channel": "^3.0.3", "chalk": "^4.1.0", - "check-disk-space": "^2.1.0", "cheerio": "^1.0.0-rc.9", "chokidar": "^3.4.3", "chroma-js": "^1.4.1", @@ -237,15 +232,12 @@ "fflate": "^0.6.9", "file-saver": "^1.3.8", "file-type": "^10.9.0", - "focus-trap-react": "^3.1.1", "font-awesome": "4.7.0", - "formsy-react": "^1.1.5", "fp-ts": "^2.3.1", "geojson-vt": "^3.2.1", "get-port": "^5.0.0", "getopts": "^2.2.5", "getos": "^3.1.0", - "github-markdown-css": "^2.10.0", "glob": "^7.1.2", "glob-all": "^3.2.1", "globby": "^11.0.3", @@ -323,9 +315,7 @@ "pngjs": "^3.4.0", "polished": "^3.7.2", "prop-types": "^15.7.2", - "proper-lockfile": "^3.2.0", "proxy-from-env": "1.0.0", - "proxyquire": "1.8.0", "puid": "1.0.7", "puppeteer": "^8.0.0", "query-string": "^6.13.2", @@ -341,14 +331,13 @@ "react-dropzone": "^4.2.9", "react-fast-compare": "^2.0.4", "react-grid-layout": "^0.16.2", - "react-input-range": "^1.3.0", "react-intl": "^2.8.0", "react-is": "^16.8.0", "react-markdown": "^4.3.1", "react-moment-proptypes": "^1.7.0", "react-monaco-editor": "^0.41.2", "react-popper-tooltip": "^2.10.1", - "react-query": "^3.21.0", + "react-query": "^3.21.1", "react-redux": "^7.2.0", "react-resizable": "^1.7.5", "react-resize-detector": "^4.2.0", @@ -379,7 +368,6 @@ "regenerator-runtime": "^0.13.3", "remark-parse": "^8.0.3", "remark-stringify": "^9.0.0", - "request": "^2.88.0", "require-in-the-middle": "^5.0.2", "reselect": "^4.0.0", "resize-observer-polyfill": "^1.5.0", @@ -388,7 +376,7 @@ "safe-squel": "^5.12.5", "seedrandom": "^3.0.5", "semver": "^7.3.2", - "set-value": "^3.0.2", + "set-value": "^4.1.0", "source-map-support": "^0.5.19", "stats-lite": "^2.2.0", "strip-ansi": "^6.0.0", @@ -397,7 +385,7 @@ "suricata-sid-db": "^1.0.2", "symbol-observable": "^1.2.0", "tabbable": "1.1.3", - "tar": "4.4.13", + "tar": "^6.1.11", "tinycolor2": "1.4.1", "tinygradient": "0.4.3", "tree-kill": "^1.2.2", @@ -406,10 +394,9 @@ "type-detect": "^4.0.8", "typescript-fsa": "^3.0.0", "typescript-fsa-reducers": "^1.2.2", - "ui-select": "0.19.8", "unified": "^9.2.1", - "unstated": "^2.1.1", "use-resize-observer": "^6.0.0", + "usng.js": "^0.4.5", "utility-types": "^3.10.0", "uuid": "3.3.2", "vega": "^5.19.1", @@ -601,7 +588,6 @@ "@types/prettier": "^2.1.5", "@types/pretty-ms": "^5.0.0", "@types/prop-types": "^15.7.3", - "@types/proper-lockfile": "^3.0.1", "@types/rbush": "^3.0.0", "@types/reach__router": "^1.2.6", "@types/react": "^16.9.36", @@ -619,7 +605,6 @@ "@types/recompose": "^0.30.6", "@types/reduce-reducers": "^1.0.0", "@types/redux-actions": "^2.6.1", - "@types/request": "^2.48.2", "@types/seedrandom": ">=2.0.0 <4.0.0", "@types/selenium-webdriver": "^4.0.9", "@types/semver": "^7", @@ -632,7 +617,7 @@ "@types/styled-components": "^5.1.0", "@types/supertest": "^2.0.5", "@types/tapable": "^1.0.6", - "@types/tar": "^4.0.3", + "@types/tar": "^4.0.5", "@types/tar-fs": "^1.16.1", "@types/tempy": "^0.2.0", "@types/testing-library__jest-dom": "^5.9.5", @@ -696,7 +681,6 @@ "cypress-promise": "^1.1.0", "cypress-real-events": "^1.4.0", "debug": "^2.6.9", - "del-cli": "^3.0.1", "delete-empty": "^2.0.0", "dependency-check": "^4.1.0", "diff": "^4.0.1", @@ -734,7 +718,7 @@ "fetch-mock": "^7.3.9", "file-loader": "^4.2.0", "form-data": "^4.0.0", - "geckodriver": "^1.22.2", + "geckodriver": "^2.0.4", "glob-watcher": "5.0.3", "grunt": "1.3.0", "grunt-available-tasks": "^0.6.3", @@ -830,7 +814,6 @@ "tape": "^5.0.1", "tar-fs": "^2.1.0", "tempy": "^0.3.0", - "terminal-link": "^2.1.1", "terser": "^5.7.1", "terser-webpack-plugin": "^2.1.2", "tough-cookie": "^4.0.0", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index 5c29b4a7eb64b..deec9d6bf5dc0 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -58,6 +58,7 @@ filegroup( "//packages/kbn-telemetry-tools:build", "//packages/kbn-test:build", "//packages/kbn-test-subj-selector:build", + "//packages/kbn-timelion-grammar:build", "//packages/kbn-tinymath:build", "//packages/kbn-typed-react-router-config:build", "//packages/kbn-ui-framework:build", diff --git a/packages/elastic-datemath/.babelrc b/packages/elastic-datemath/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/elastic-datemath/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/elastic-eslint-config-kibana/.eslintrc.js b/packages/elastic-eslint-config-kibana/.eslintrc.js index 38c0c43132564..1c6b96c81afc7 100644 --- a/packages/elastic-eslint-config-kibana/.eslintrc.js +++ b/packages/elastic-eslint-config-kibana/.eslintrc.js @@ -92,5 +92,6 @@ module.exports = { ], '@kbn/eslint/no_async_promise_body': 'error', + '@kbn/eslint/no_async_foreach': 'error', }, }; diff --git a/packages/kbn-ace/.babelrc b/packages/kbn-ace/.babelrc deleted file mode 100644 index 30ffbd24e1f18..0000000000000 --- a/packages/kbn-ace/.babelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"], - "ignore": [ - "src/ace/modes/x_json/worker/x_json.ace.worker.js" - ] -} diff --git a/packages/kbn-ace/BUILD.bazel b/packages/kbn-ace/BUILD.bazel index 5b9c38b16b53a..a13863b765d35 100644 --- a/packages/kbn-ace/BUILD.bazel +++ b/packages/kbn-ace/BUILD.bazel @@ -45,6 +45,8 @@ jsts_transpiler( srcs = SRCS, additional_args = [ "--copy-files", + "--ignore", + "**/*/src/ace/modes/x_json/worker/x_json.ace.worker.js", "--quiet" ], build_pkg_name = package_name(), diff --git a/packages/kbn-alerts/.babelrc b/packages/kbn-alerts/.babelrc deleted file mode 100644 index 40a198521b903..0000000000000 --- a/packages/kbn-alerts/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-alerts/.babelrc.browser b/packages/kbn-alerts/.babelrc.browser deleted file mode 100644 index 71bbfbcd6eb2f..0000000000000 --- a/packages/kbn-alerts/.babelrc.browser +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/webpack_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-alerts/BUILD.bazel b/packages/kbn-alerts/BUILD.bazel index a571380202cd6..91c575346fff7 100644 --- a/packages/kbn-alerts/BUILD.bazel +++ b/packages/kbn-alerts/BUILD.bazel @@ -57,7 +57,7 @@ jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - config_file = ".babelrc.browser" + web = True, ) ts_config( diff --git a/packages/kbn-analytics/.babelrc b/packages/kbn-analytics/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-analytics/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-analytics/.babelrc.browser b/packages/kbn-analytics/.babelrc.browser deleted file mode 100644 index dc6a77bbe0bcd..0000000000000 --- a/packages/kbn-analytics/.babelrc.browser +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/webpack_preset"] -} diff --git a/packages/kbn-analytics/BUILD.bazel b/packages/kbn-analytics/BUILD.bazel index ca8cdcbffbb52..cc65746e890ce 100644 --- a/packages/kbn-analytics/BUILD.bazel +++ b/packages/kbn-analytics/BUILD.bazel @@ -42,7 +42,7 @@ jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - config_file = ".babelrc.browser" + web = True, ) ts_config( diff --git a/packages/kbn-apm-config-loader/.babelrc b/packages/kbn-apm-config-loader/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-apm-config-loader/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-apm-utils/.babelrc b/packages/kbn-apm-utils/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-apm-utils/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-babel-code-parser/.babelrc b/packages/kbn-babel-code-parser/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-babel-code-parser/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-cli-dev-mode/.babelrc b/packages/kbn-cli-dev-mode/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-cli-dev-mode/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-cli-dev-mode/src/get_server_watch_paths.test.ts b/packages/kbn-cli-dev-mode/src/get_server_watch_paths.test.ts index f4017df600a48..1a49faabd8da3 100644 --- a/packages/kbn-cli-dev-mode/src/get_server_watch_paths.test.ts +++ b/packages/kbn-cli-dev-mode/src/get_server_watch_paths.test.ts @@ -67,7 +67,6 @@ it('produces the right watch and ignore list', () => { /x-pack/test/plugin_functional/plugins/resolver_test/docs/**, /x-pack/plugins/reporting/chromium, /x-pack/plugins/security_solution/cypress, - /x-pack/plugins/apm/e2e, /x-pack/plugins/apm/scripts, /x-pack/plugins/canvas/canvas_plugin_src, /x-pack/plugins/cases/server/scripts, diff --git a/packages/kbn-cli-dev-mode/src/get_server_watch_paths.ts b/packages/kbn-cli-dev-mode/src/get_server_watch_paths.ts index b0773fd567635..f08e456940808 100644 --- a/packages/kbn-cli-dev-mode/src/get_server_watch_paths.ts +++ b/packages/kbn-cli-dev-mode/src/get_server_watch_paths.ts @@ -58,7 +58,6 @@ export function getServerWatchPaths({ pluginPaths, pluginScanDirs }: Options) { ...pluginInternalDirsIgnore, fromRoot('x-pack/plugins/reporting/chromium'), fromRoot('x-pack/plugins/security_solution/cypress'), - fromRoot('x-pack/plugins/apm/e2e'), fromRoot('x-pack/plugins/apm/scripts'), fromRoot('x-pack/plugins/canvas/canvas_plugin_src'), // prevents server from restarting twice for Canvas plugin changes, fromRoot('x-pack/plugins/cases/server/scripts'), diff --git a/packages/kbn-config-schema/.babelrc b/packages/kbn-config-schema/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-config-schema/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-config/.babelrc b/packages/kbn-config/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-config/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-config/src/deprecation/types.ts b/packages/kbn-config/src/deprecation/types.ts index 007c3ec54113b..0e1f36121e50e 100644 --- a/packages/kbn-config/src/deprecation/types.ts +++ b/packages/kbn-config/src/deprecation/types.ts @@ -23,6 +23,12 @@ export interface DeprecatedConfigDetails { title?: string; /* The message to be displayed for the deprecation. */ message: string; + /** + * levels: + * - warning: will not break deployment upon upgrade + * - critical: needs to be addressed before upgrade. + */ + level?: 'warning' | 'critical'; /* (optional) set false to prevent the config service from logging the deprecation message. */ silent?: boolean; /* (optional) link to the documentation for more details on the deprecation. */ diff --git a/packages/kbn-crypto/.babelrc b/packages/kbn-crypto/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-crypto/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-dev-utils/.babelrc b/packages/kbn-dev-utils/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-dev-utils/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_reporter.ts b/packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_reporter.ts index 0584ee27aa5f6..a7772aa94e05a 100644 --- a/packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_reporter.ts +++ b/packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_reporter.ts @@ -199,7 +199,7 @@ export class CiStatsReporter { throw error; } - if (error?.response && error.response.status < 502) { + if (error?.response && error.response.status < 500) { // error response from service was received so warn the user and move on this.log.warning( `error reporting ${bodyDesc} [status=${error.response.status}] [resp=${inspect( diff --git a/packages/kbn-dev-utils/src/vscode_config/managed_config_keys.ts b/packages/kbn-dev-utils/src/vscode_config/managed_config_keys.ts index 288bfad02d7f4..8b941e9e4f71f 100644 --- a/packages/kbn-dev-utils/src/vscode_config/managed_config_keys.ts +++ b/packages/kbn-dev-utils/src/vscode_config/managed_config_keys.ts @@ -8,7 +8,7 @@ export interface ManagedConfigKey { key: string; - value: Record; + value: string | Record; } /** @@ -37,4 +37,9 @@ export const MANAGED_CONFIG_KEYS: ManagedConfigKey[] = [ ['**/packages/kbn-pm/dist/index.js']: true, }, }, + { + key: 'typescript.tsdk', + // we use a relative path here so that it works with remote vscode connections + value: './node_modules/typescript/lib', + }, ]; diff --git a/packages/kbn-dev-utils/src/vscode_config/update_vscode_config.test.ts b/packages/kbn-dev-utils/src/vscode_config/update_vscode_config.test.ts index dd57449c21da3..3573acd59559f 100644 --- a/packages/kbn-dev-utils/src/vscode_config/update_vscode_config.test.ts +++ b/packages/kbn-dev-utils/src/vscode_config/update_vscode_config.test.ts @@ -22,6 +22,10 @@ const TEST_KEYS: ManagedConfigKey[] = [ world: [1, 2, 3], }, }, + { + key: 'stringKey', + value: 'foo', + }, ]; const run = (json?: string) => updateVscodeConfig(TEST_KEYS, '', json); @@ -35,7 +39,9 @@ it('updates the passed JSON with the managed settings', () => { "hello": true, // @managed "world": [1, 2, 3] - } + }, + // @managed + "stringKey": "foo" } `); @@ -50,7 +56,9 @@ it('initialized empty or undefined json values', () => { "hello": true, // @managed "world": [1, 2, 3] - } + }, + // @managed + "stringKey": "foo" } `); @@ -63,14 +71,16 @@ it('initialized empty or undefined json values', () => { "hello": true, // @managed "world": [1, 2, 3] - } + }, + // @managed + "stringKey": "foo" } `); }); -it('replaces conflicting managed keys which do not have object values', () => { - expect(run(`{ "key": false }`)).toMatchInlineSnapshot(` +it('replaces conflicting managed keys which do not have matching value types', () => { + expect(run(`{ "key": false, "stringKey": { "a": "B" } }`)).toMatchInlineSnapshot(` // @managed { "key": { @@ -78,7 +88,9 @@ it('replaces conflicting managed keys which do not have object values', () => { "hello": true, // @managed "world": [1, 2, 3] - } + }, + // @managed + "stringKey": "foo" } `); @@ -122,7 +134,9 @@ it('persists comments in the original file', () => { "hello": true, // @managed "world": [1, 2, 3] - } + }, + // @managed + "stringKey": "foo" } `); @@ -148,7 +162,9 @@ it('overrides old values for managed keys', () => { "hello": true, // @managed "world": [1, 2, 3] - } + }, + // @managed + "stringKey": "foo" } `); @@ -176,7 +192,9 @@ it('does not modify properties with leading `// self managed` comment', () => { // self managed "key": { "world": [5] - } + }, + // self managed + "stringKey": "--" } `); @@ -186,7 +204,9 @@ it('does not modify properties with leading `// self managed` comment', () => { // self managed "key": { "world": [5] - } + }, + // self managed + "stringKey": "--" } `); @@ -210,7 +230,9 @@ it('does not modify child properties with leading `// self managed` comment', () "world": [5], // @managed "hello": true - } + }, + // @managed + "stringKey": "foo" } `); @@ -236,7 +258,9 @@ it('does not modify unknown child properties', () => { "world": [5], // @managed "hello": true - } + }, + // @managed + "stringKey": "foo" } `); @@ -262,7 +286,9 @@ it('removes managed properties which are no longer managed', () => { "world": [5], // @managed "hello": true - } + }, + // @managed + "stringKey": "foo" } `); @@ -286,7 +312,9 @@ it('wipes out child keys which conflict with newly managed child keys', () => { "hello": true, // @managed "world": [1, 2, 3] - } + }, + // @managed + "stringKey": "foo" } `); @@ -308,7 +336,9 @@ it('correctly formats info text when specified', () => { "hello": true, // @managed "world": [1, 2, 3] - } + }, + // @managed + "stringKey": "foo" } `); @@ -321,7 +351,10 @@ it('allows "// self managed" comments conflicting with "// @managed" comments to // @managed // self managed "hello": ["world"] - } + }, + // @managed + // self managed + "stringKey": 12345 } `); @@ -333,7 +366,9 @@ it('allows "// self managed" comments conflicting with "// @managed" comments to "hello": ["world"], // @managed "world": [1, 2, 3] - } + }, + // self managed + "stringKey": 12345 } `); diff --git a/packages/kbn-dev-utils/src/vscode_config/update_vscode_config.ts b/packages/kbn-dev-utils/src/vscode_config/update_vscode_config.ts index ac1b5515252dd..42a642ef1b6c4 100644 --- a/packages/kbn-dev-utils/src/vscode_config/update_vscode_config.ts +++ b/packages/kbn-dev-utils/src/vscode_config/update_vscode_config.ts @@ -25,11 +25,20 @@ const isManaged = (node?: t.Node) => (c) => c.type === 'CommentLine' && c.value.trim().toLocaleLowerCase() === '@managed' ); -const isSelfManaged = (node?: t.Node) => - !!node?.leadingComments?.some( +const isSelfManaged = (node?: t.Node) => { + const result = !!node?.leadingComments?.some( (c) => c.type === 'CommentLine' && c.value.trim().toLocaleLowerCase() === 'self managed' ); + // if we find a node which is both managed and self managed remove the managed comment + if (result && node && isManaged(node)) { + node.leadingComments = + node.leadingComments?.filter((c) => c.value.trim() !== '@managed') ?? null; + } + + return result; +}; + const remove = (arr: T[], value: T) => { const index = arr.indexOf(value); if (index > -1) { @@ -37,16 +46,16 @@ const remove = (arr: T[], value: T) => { } }; -const createManagedChildProp = (key: string, value: any) => { +const createManagedProp = (key: string, value: any) => { const childProp = t.objectProperty(t.stringLiteral(key), parseExpression(JSON.stringify(value))); t.addComment(childProp, 'leading', ' @managed', true); return childProp; }; -const createManagedProp = (key: string, value: Record) => { +const createObjectPropOfManagedValues = (key: string, value: Record) => { return t.objectProperty( t.stringLiteral(key), - t.objectExpression(Object.entries(value).map(([k, v]) => createManagedChildProp(k, v))) + t.objectExpression(Object.entries(value).map(([k, v]) => createManagedProp(k, v))) ); }; @@ -57,8 +66,16 @@ const createManagedProp = (key: string, value: Record) => { * @param key the key name to add * @param value managed value which should be set at `key` */ -const addManagedProp = (ast: t.ObjectExpression, key: string, value: Record) => { - ast.properties.push(createManagedProp(key, value)); +const addManagedProp = ( + ast: t.ObjectExpression, + key: string, + value: string | Record +) => { + ast.properties.push( + typeof value === 'string' + ? createManagedProp(key, value) + : createObjectPropOfManagedValues(key, value) + ); }; /** @@ -72,7 +89,7 @@ const addManagedProp = (ast: t.ObjectExpression, key: string, value: Record + value: string | Record ) => { remove(ast.properties, existing); addManagedProp(ast, existing.key.value, value); @@ -98,15 +115,11 @@ const mergeManagedProperties = ( if (!existing) { // add the new managed prop - properties.push(createManagedChildProp(key, value)); + properties.push(createManagedProp(key, value)); continue; } if (isSelfManaged(existing)) { - // strip "// @managed" comment if conflicting with "// self managed" - existing.leadingComments = (existing.leadingComments ?? []).filter( - (c) => c.value.trim() !== '@managed' - ); continue; } @@ -119,7 +132,7 @@ const mergeManagedProperties = ( // take over the unmanaged child prop by deleting the previous prop and replacing it // with a brand new one remove(properties, existing); - properties.push(createManagedChildProp(key, value)); + properties.push(createManagedProp(key, value)); } // iterate through the props to find "// @managed" props which are no longer in @@ -170,20 +183,29 @@ export function updateVscodeConfig(keys: ManagedConfigKey[], infoText: string, j continue; } - if (existingProp && existingProp.value.type === 'ObjectExpression') { - // setting exists and is an object so merge properties of `value` with it - mergeManagedProperties(existingProp.value.properties, value); + if (typeof value === 'object') { + if (existingProp && existingProp.value.type === 'ObjectExpression') { + // setting exists and is an object so merge properties of `value` with it + mergeManagedProperties(existingProp.value.properties, value); + continue; + } + + if (existingProp) { + // setting exists but its value is not an object expression so replace it + replaceManagedProp(ast, existingProp, value); + continue; + } + + // setting isn't in config file so create it + addManagedProp(ast, key, value); continue; } if (existingProp) { - // setting exists but its value is not an object expression so replace it replaceManagedProp(ast, existingProp, value); - continue; + } else { + addManagedProp(ast, key, value); } - - // setting isn't in config file so create it - addManagedProp(ast, key, value); } ast.leadingComments = [ diff --git a/packages/kbn-docs-utils/.babelrc b/packages/kbn-docs-utils/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-docs-utils/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/buid_api_declaration.test.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/buid_api_declaration.test.ts index ce7f93826d1da..7002f72ae2db0 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/buid_api_declaration.test.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/buid_api_declaration.test.ts @@ -13,7 +13,7 @@ import { ToolingLog, KibanaPlatformPlugin } from '@kbn/dev-utils'; import { TypeKind, ApiScope } from '../types'; import { getKibanaPlatformPlugin } from '../tests/kibana_platform_plugin_mock'; import { getDeclarationNodesForPluginScope } from '../get_declaration_nodes_for_plugin'; -import { buildApiDeclaration } from './build_api_declaration'; +import { buildApiDeclarationTopNode } from './build_api_declaration'; import { isNamedNode } from '../tsmorph_utils'; const log = new ToolingLog({ @@ -42,8 +42,7 @@ beforeAll(() => { it('Test number primitive doc def', () => { const node = nodes.find((n) => getNodeName(n) === 'aNum'); expect(node).toBeDefined(); - const def = buildApiDeclaration({ - node: node!, + const def = buildApiDeclarationTopNode(node!, { plugins, log, currentPluginId: plugins[0].manifest.id, @@ -57,8 +56,7 @@ it('Test number primitive doc def', () => { it('Function type is exported as type with signature', () => { const node = nodes.find((n) => getNodeName(n) === 'FnWithGeneric'); expect(node).toBeDefined(); - const def = buildApiDeclaration({ - node: node!, + const def = buildApiDeclarationTopNode(node!, { plugins, log, currentPluginId: plugins[0].manifest.id, @@ -73,8 +71,7 @@ it('Function type is exported as type with signature', () => { it('Test Interface Kind doc def', () => { const node = nodes.find((n) => getNodeName(n) === 'ExampleInterface'); expect(node).toBeDefined(); - const def = buildApiDeclaration({ - node: node!, + const def = buildApiDeclarationTopNode(node!, { plugins, log, currentPluginId: plugins[0].manifest.id, @@ -90,8 +87,7 @@ it('Test Interface Kind doc def', () => { it('Test union export', () => { const node = nodes.find((n) => getNodeName(n) === 'aUnionProperty'); expect(node).toBeDefined(); - const def = buildApiDeclaration({ - node: node!, + const def = buildApiDeclarationTopNode(node!, { plugins, log, currentPluginId: plugins[0].manifest.id, @@ -104,8 +100,7 @@ it('Test union export', () => { it('Function inside interface has a label', () => { const node = nodes.find((n) => getNodeName(n) === 'ExampleInterface'); expect(node).toBeDefined(); - const def = buildApiDeclaration({ - node: node!, + const def = buildApiDeclarationTopNode(node!, { plugins, log, currentPluginId: plugins[0].manifest.id, @@ -122,8 +117,7 @@ it('Function inside interface has a label', () => { it('Test ReactElement signature', () => { const node = nodes.find((n) => getNodeName(n) === 'AReactElementFn'); expect(node).toBeDefined(); - const def = buildApiDeclaration({ - node: node!, + const def = buildApiDeclarationTopNode(node!, { plugins, log, currentPluginId: plugins[0].manifest.id, diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_api_declaration.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_api_declaration.ts index 3d54cda5cf0fc..2f6b03de15b7a 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_api_declaration.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_api_declaration.ts @@ -11,7 +11,7 @@ import { ToolingLog, KibanaPlatformPlugin } from '@kbn/dev-utils'; import { buildClassDec } from './build_class_dec'; import { buildFunctionDec } from './build_function_dec'; import { isNamedNode } from '../tsmorph_utils'; -import { AnchorLink, ApiDeclaration } from '../types'; +import { ApiDeclaration } from '../types'; import { buildVariableDec } from './build_variable_dec'; import { buildTypeLiteralDec } from './build_type_literal_dec'; import { ApiScope } from '../types'; @@ -19,6 +19,27 @@ import { buildInterfaceDec } from './build_interface_dec'; import { buildBasicApiDeclaration } from './build_basic_api_declaration'; import { buildFunctionTypeDec } from './build_function_type_dec'; import { buildCallSignatureDec } from './build_call_signature_dec'; +import { BuildApiDecOpts } from './types'; +import { buildApiId } from './utils'; + +export function buildApiDeclarationTopNode( + node: Node, + opts: { + plugins: KibanaPlatformPlugin[]; + log: ToolingLog; + currentPluginId: string; + captureReferences: boolean; + parentApiId?: string; + scope: ApiScope; + } +) { + const name = isNamedNode(node) ? node.getName() : 'Unnamed'; + return buildApiDeclaration(node, { + ...opts, + name, + id: buildApiId(name, `def-${opts.scope}`), + }); +} /** * A potentially recursive function, depending on the node type, that builds a JSON like structure @@ -26,69 +47,31 @@ import { buildCallSignatureDec } from './build_call_signature_dec'; * interfaces, objects and functions will have children for their properties, members and parameters. * * @param node The ts-morph node to build an ApiDeclaration for. - * @param plugins The list of plugins registered is used for building cross plugin links by looking up - * the plugin by import path. We could accomplish the same thing via a regex on the import path, but this lets us - * decouple plugin path from plugin id. - * @param log Logs messages to console. - * @param pluginName The name of the plugin this declaration belongs to. - * @param scope The scope this declaration belongs to (server, public, or common). - * @param parentApiId If this declaration is nested inside another declaration, it should have a parent id. This - * is used to create the anchor link to this API item. - * @param captureReferences if false, references will only be captured for deprecated APIs. Capturing references - * can be time consuming so this is only set to true if explicitly requested via the `--references` flag. - * @param name An optional name to pass through which will be used instead of node.getName, if it - * exists. For some types, like Parameters, the name comes on the parent node, but we want the doc def - * to be built from the TypedNode + * @param opts Various options and settings */ -export function buildApiDeclaration({ - node, - plugins, - log, - currentPluginId, - scope, - captureReferences, - parentApiId, - name, -}: { - node: Node; - plugins: KibanaPlatformPlugin[]; - log: ToolingLog; - currentPluginId: string; - scope: ApiScope; - captureReferences: boolean; - parentApiId?: string; - name?: string; -}): ApiDeclaration { - const apiName = name ? name : isNamedNode(node) ? node.getName() : 'Unnamed'; - const apiId = parentApiId ? parentApiId + '.' + apiName : apiName; - const anchorLink: AnchorLink = { scope, pluginName: currentPluginId, apiName: apiId }; - +export function buildApiDeclaration(node: Node, opts: BuildApiDecOpts): ApiDeclaration { if (Node.isClassDeclaration(node)) { - return buildClassDec(node, plugins, anchorLink, currentPluginId, log, captureReferences); + return buildClassDec(node, opts); } else if (Node.isInterfaceDeclaration(node)) { - return buildInterfaceDec(node, plugins, anchorLink, currentPluginId, log, captureReferences); + return buildInterfaceDec(node, opts); } else if ( Node.isPropertySignature(node) && node.getTypeNode() && Node.isFunctionTypeNode(node.getTypeNode()!) ) { // This code path covers optional properties on interfaces, otherwise they lost their children. Yes, a bit strange. - return buildFunctionTypeDec({ - node, - typeNode: node.getTypeNode()! as FunctionTypeNode, - plugins, - anchorLink, - currentPluginId, - log, - captureReferences, - }); + return buildFunctionTypeDec(node, node.getTypeNode()! as FunctionTypeNode, opts); } else if ( Node.isMethodSignature(node) || Node.isFunctionDeclaration(node) || Node.isMethodDeclaration(node) || Node.isConstructorDeclaration(node) ) { - return buildFunctionDec({ node, plugins, anchorLink, currentPluginId, log, captureReferences }); + return buildFunctionDec(node, { + ...opts, + // Use "Constructor" if applicable, instead of the default "Unnamed" + name: Node.isConstructorDeclaration(node) ? 'Constructor' : node.getName() || 'Unnamed', + }); } else if ( Node.isPropertySignature(node) || Node.isPropertyDeclaration(node) || @@ -96,17 +79,9 @@ export function buildApiDeclaration({ Node.isPropertyAssignment(node) || Node.isVariableDeclaration(node) ) { - return buildVariableDec(node, plugins, anchorLink, currentPluginId, log, captureReferences); + return buildVariableDec(node, opts); } else if (Node.isTypeLiteralNode(node)) { - return buildTypeLiteralDec( - node, - plugins, - anchorLink, - currentPluginId, - log, - apiName, - captureReferences - ); + return buildTypeLiteralDec(node, opts); } // Without this types that are functions won't include comments on parameters. e.g. @@ -117,28 +92,11 @@ export function buildApiDeclaration({ // if (node.getType().getCallSignatures().length > 0) { if (node.getType().getCallSignatures().length > 1) { - log.warning(`Not handling more than one call signature for node ${apiName}`); + opts.log.warning(`Not handling more than one call signature for node ${opts.name}`); } else { - return buildCallSignatureDec({ - signature: node.getType().getCallSignatures()[0], - log, - captureReferences, - plugins, - anchorLink, - currentPluginId, - name: apiName, - node, - }); + return buildCallSignatureDec(node, node.getType().getCallSignatures()[0], opts); } } - return buildBasicApiDeclaration({ - currentPluginId, - anchorLink, - node, - plugins, - captureReferences, - log, - apiName, - }); + return buildBasicApiDeclaration(node, opts); } diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_arrow_fn_dec.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_arrow_fn_dec.ts index c714165a0922c..251abd28ed9d4 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_arrow_fn_dec.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_arrow_fn_dec.ts @@ -6,8 +6,6 @@ * Side Public License, v 1. */ -import { ToolingLog, KibanaPlatformPlugin } from '@kbn/dev-utils'; - import { ArrowFunction, VariableDeclaration, @@ -16,24 +14,17 @@ import { ShorthandPropertyAssignment, PropertyAssignment, } from 'ts-morph'; -import { AnchorLink, ApiDeclaration, TypeKind } from '../types'; +import { ApiDeclaration, TypeKind } from '../types'; import { buildApiDecsForParameters } from './build_parameter_decs'; import { getSignature } from './get_signature'; import { getJSDocReturnTagComment, getJSDocs } from './js_doc_utils'; import { buildBasicApiDeclaration } from './build_basic_api_declaration'; +import { BuildApiDecOpts } from './types'; /** * Arrow functions are handled differently than regular functions because you need the arrow function * initializer as well as the node. The initializer is where the parameters are grabbed from and the * signature, while the node has the comments and name. - * - * @param node - * @param initializer - * @param plugins - * @param anchorLink - * @param log - * @param captureReferences if false, references will only be captured for deprecated APIs. Capturing references - * can be time consuming so this is only set to true if explicitly requested via the `--references` flag */ export function getArrowFunctionDec( node: @@ -43,34 +34,14 @@ export function getArrowFunctionDec( | ShorthandPropertyAssignment | PropertyAssignment, initializer: ArrowFunction, - plugins: KibanaPlatformPlugin[], - anchorLink: AnchorLink, - currentPluginId: string, - log: ToolingLog, - captureReferences: boolean + opts: BuildApiDecOpts ): ApiDeclaration { return { - ...buildBasicApiDeclaration({ - currentPluginId, - anchorLink, - node, - plugins, - captureReferences, - log, - apiName: node.getName(), - }), + ...buildBasicApiDeclaration(node, opts), type: TypeKind.FunctionKind, - children: buildApiDecsForParameters( - initializer.getParameters(), - plugins, - anchorLink, - currentPluginId, - log, - captureReferences, - getJSDocs(node) - ), + children: buildApiDecsForParameters(initializer.getParameters(), opts, getJSDocs(node)), // need to override the signature - use the initializer, not the node. - signature: getSignature(initializer, plugins, log), + signature: getSignature(initializer, opts.plugins, opts.log), returnComment: getJSDocReturnTagComment(node), }; } diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_basic_api_declaration.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_basic_api_declaration.ts index 523bdca600597..0066e0df96f6a 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_basic_api_declaration.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_basic_api_declaration.ts @@ -6,49 +6,32 @@ * Side Public License, v 1. */ -import { KibanaPlatformPlugin, ToolingLog } from '@kbn/dev-utils'; import { JSDocTag, Node } from 'ts-morph'; -import { AnchorLink, ApiDeclaration } from '../types'; -import { getApiSectionId } from '../utils'; +import { ApiDeclaration } from '../types'; import { maybeCollectReferences } from './get_references'; import { getSignature } from './get_signature'; import { getTypeKind } from './get_type_kind'; import { getCommentsFromNode, getJSDocTags } from './js_doc_utils'; +import { BuildApiDecOpts } from './types'; import { getSourceForNode } from './utils'; /** * @returns an ApiDeclaration with common functionality that every node shares. Type specific attributes, like * children or references, still need to be added in. */ -export function buildBasicApiDeclaration({ - node, - plugins, - anchorLink, - apiName, - log, - currentPluginId, - captureReferences, -}: { - node: Node; - plugins: KibanaPlatformPlugin[]; - apiName: string; - log: ToolingLog; - anchorLink: AnchorLink; - currentPluginId: string; - captureReferences: boolean; -}): ApiDeclaration { +export function buildBasicApiDeclaration(node: Node, opts: BuildApiDecOpts): ApiDeclaration { const tags = getJSDocTags(node); const deprecated = tags.find((t) => t.getTagName() === 'deprecated') !== undefined; const removeByTag = tags.find((t) => t.getTagName() === 'removeBy'); const apiDec = { - parentPluginId: currentPluginId, - id: getApiSectionId(anchorLink), + parentPluginId: opts.currentPluginId, + id: opts.id, type: getTypeKind(node), tags: getTagNames(tags), - label: apiName, + label: opts.name, description: getCommentsFromNode(node), - signature: getSignature(node, plugins, log), + signature: getSignature(node, opts.plugins, opts.log), path: getSourceForNode(node), deprecated, removeBy: removeByTag ? removeByTag.getComment() : undefined, @@ -56,12 +39,9 @@ export function buildBasicApiDeclaration({ return { ...apiDec, references: maybeCollectReferences({ - captureReferences, + ...opts, apiDec, node, - plugins, - currentPluginId, - log, }), }; } diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_call_signature_dec.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_call_signature_dec.ts index 6069655c52f60..569bd005875f1 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_call_signature_dec.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_call_signature_dec.ts @@ -6,59 +6,29 @@ * Side Public License, v 1. */ -import { KibanaPlatformPlugin, ToolingLog } from '@kbn/dev-utils'; import { Node, Signature } from 'ts-morph'; -import { AnchorLink, ApiDeclaration } from '../types'; +import { ApiDeclaration } from '../types'; import { buildApiDeclaration } from './build_api_declaration'; import { buildBasicApiDeclaration } from './build_basic_api_declaration'; import { getJSDocParamComment, getJSDocReturnTagComment } from './js_doc_utils'; +import { BuildApiDecOpts } from './types'; +import { buildApiId, getOptsForChildWithName } from './utils'; -export function buildCallSignatureDec({ - signature, - node, - plugins, - captureReferences, - currentPluginId, - anchorLink, - log, - name, -}: { - signature: Signature; - name: string; - plugins: KibanaPlatformPlugin[]; - anchorLink: AnchorLink; - log: ToolingLog; - captureReferences: boolean; - currentPluginId: string; - node: Node; -}) { +export function buildCallSignatureDec(node: Node, signature: Signature, opts: BuildApiDecOpts) { return { - ...buildBasicApiDeclaration({ - node, - plugins, - anchorLink, - apiName: name, - currentPluginId, - captureReferences, - log, - }), + ...buildBasicApiDeclaration(node, opts), returnComment: getJSDocReturnTagComment(node), - children: signature.getParameters().reduce((kids, p) => { + children: signature.getParameters().reduce((kids, p, index) => { if (p.getDeclarations().length === 1) { kids.push({ - ...buildApiDeclaration({ - node: p.getDeclarations()[0], - log, - captureReferences, - plugins, - scope: anchorLink.scope, - name: p.getName(), - currentPluginId, + ...buildApiDeclaration(p.getDeclarations()[0], { + ...getOptsForChildWithName(p.getName(), opts), + id: buildApiId(`$${index + 1}`, opts.id), }), description: getJSDocParamComment(node, p.getName()), }); } else { - log.warning(`Losing information on parameter ${p.getName()}`); + opts.log.warning(`Losing information on parameter ${p.getName()}`); } return kids; }, [] as ApiDeclaration[]), diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_class_dec.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_class_dec.ts index 468d003187c65..4c3465742f081 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_class_dec.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_class_dec.ts @@ -6,44 +6,21 @@ * Side Public License, v 1. */ -import { ToolingLog, KibanaPlatformPlugin } from '@kbn/dev-utils'; import { ClassDeclaration } from 'ts-morph'; -import { AnchorLink, ApiDeclaration, TypeKind } from '../types'; +import { ApiDeclaration, TypeKind } from '../types'; import { buildApiDeclaration } from './build_api_declaration'; -import { isPrivate } from './utils'; +import { getOptsForChild, isPrivate } from './utils'; import { isInternal } from '../utils'; import { buildBasicApiDeclaration } from './build_basic_api_declaration'; +import { BuildApiDecOpts } from './types'; -export function buildClassDec( - node: ClassDeclaration, - plugins: KibanaPlatformPlugin[], - anchorLink: AnchorLink, - currentPluginId: string, - log: ToolingLog, - captureReferences: boolean -): ApiDeclaration { +export function buildClassDec(node: ClassDeclaration, opts: BuildApiDecOpts): ApiDeclaration { return { - ...buildBasicApiDeclaration({ - currentPluginId, - anchorLink, - node, - plugins, - log, - captureReferences, - apiName: node.getName() || 'Missing label', - }), + ...buildBasicApiDeclaration(node, opts), type: TypeKind.ClassKind, children: node.getMembers().reduce((acc, m) => { if (!isPrivate(m)) { - const child = buildApiDeclaration({ - node: m, - plugins, - log, - currentPluginId: anchorLink.pluginName, - scope: anchorLink.scope, - captureReferences, - parentApiId: anchorLink.apiName, - }); + const child = buildApiDeclaration(m, getOptsForChild(m, opts)); if (!isInternal(child)) { acc.push(child); } diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_function_dec.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_function_dec.ts index c387b551a3002..3ba688f1ee284 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_function_dec.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_function_dec.ts @@ -10,61 +10,26 @@ import { FunctionDeclaration, MethodDeclaration, ConstructorDeclaration, - Node, MethodSignature, } from 'ts-morph'; -import { ToolingLog, KibanaPlatformPlugin } from '@kbn/dev-utils'; import { buildApiDecsForParameters } from './build_parameter_decs'; -import { AnchorLink, ApiDeclaration, TypeKind } from '../types'; +import { ApiDeclaration, TypeKind } from '../types'; import { getJSDocReturnTagComment, getJSDocs } from './js_doc_utils'; import { buildBasicApiDeclaration } from './build_basic_api_declaration'; +import { BuildApiDecOpts } from './types'; /** * Takes the various function-like node declaration types and converts them into an ApiDeclaration. - * @param node - * @param plugins - * @param anchorLink - * @param log */ -export function buildFunctionDec({ - node, - plugins, - anchorLink, - currentPluginId, - log, - captureReferences, -}: { - node: FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | MethodSignature; - plugins: KibanaPlatformPlugin[]; - anchorLink: AnchorLink; - currentPluginId: string; - log: ToolingLog; - captureReferences: boolean; -}): ApiDeclaration { - const label = Node.isConstructorDeclaration(node) - ? 'Constructor' - : node.getName() || '(WARN: Missing name)'; +export function buildFunctionDec( + node: FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | MethodSignature, + opts: BuildApiDecOpts +): ApiDeclaration { const fn = { - ...buildBasicApiDeclaration({ - currentPluginId, - anchorLink, - node, - captureReferences, - plugins, - log, - apiName: label, - }), + ...buildBasicApiDeclaration(node, opts), type: TypeKind.FunctionKind, - children: buildApiDecsForParameters( - node.getParameters(), - plugins, - anchorLink, - currentPluginId, - log, - captureReferences, - getJSDocs(node) - ), + children: buildApiDecsForParameters(node.getParameters(), opts, getJSDocs(node)), returnComment: getJSDocReturnTagComment(node), }; return fn; diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_function_type_dec.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_function_type_dec.ts index e8137e9e7536d..1c98ea99ec392 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_function_type_dec.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_function_type_dec.ts @@ -7,53 +7,25 @@ */ import { PropertySignature } from 'ts-morph'; -import { ToolingLog, KibanaPlatformPlugin } from '@kbn/dev-utils'; import { FunctionTypeNode } from 'ts-morph'; import { buildApiDecsForParameters } from './build_parameter_decs'; -import { AnchorLink, ApiDeclaration, TypeKind } from '../types'; +import { ApiDeclaration, TypeKind } from '../types'; import { getJSDocReturnTagComment, getJSDocs } from './js_doc_utils'; import { buildBasicApiDeclaration } from './build_basic_api_declaration'; +import { BuildApiDecOpts } from './types'; /** * Takes the various function-type node declaration types and converts them into an ApiDeclaration. */ -export function buildFunctionTypeDec({ - node, - typeNode, - plugins, - anchorLink, - currentPluginId, - log, - captureReferences, -}: { - node: PropertySignature; - typeNode: FunctionTypeNode; - plugins: KibanaPlatformPlugin[]; - anchorLink: AnchorLink; - currentPluginId: string; - log: ToolingLog; - captureReferences: boolean; -}): ApiDeclaration { +export function buildFunctionTypeDec( + node: PropertySignature, + typeNode: FunctionTypeNode, + opts: BuildApiDecOpts +): ApiDeclaration { const fn = { - ...buildBasicApiDeclaration({ - currentPluginId, - anchorLink, - node, - captureReferences, - plugins, - log, - apiName: node.getName(), - }), + ...buildBasicApiDeclaration(node, opts), type: TypeKind.FunctionKind, - children: buildApiDecsForParameters( - typeNode.getParameters(), - plugins, - anchorLink, - currentPluginId, - log, - captureReferences, - getJSDocs(node) - ), + children: buildApiDecsForParameters(typeNode.getParameters(), opts, getJSDocs(node)), returnComment: getJSDocReturnTagComment(node), }; return fn; diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_interface_dec.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_interface_dec.ts index da5302caee29a..b26469f3917a0 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_interface_dec.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_interface_dec.ts @@ -6,42 +6,26 @@ * Side Public License, v 1. */ -import { ToolingLog, KibanaPlatformPlugin } from '@kbn/dev-utils'; import { InterfaceDeclaration } from 'ts-morph'; -import { AnchorLink, ApiDeclaration, TypeKind } from '../types'; +import { ApiDeclaration, TypeKind } from '../types'; import { buildApiDeclaration } from './build_api_declaration'; import { isInternal } from '../utils'; import { buildBasicApiDeclaration } from './build_basic_api_declaration'; +import { BuildApiDecOpts } from './types'; +import { getOptsForChild } from './utils'; export function buildInterfaceDec( node: InterfaceDeclaration, - plugins: KibanaPlatformPlugin[], - anchorLink: AnchorLink, - currentPluginId: string, - log: ToolingLog, - captureReferences: boolean + opts: BuildApiDecOpts ): ApiDeclaration { return { - ...buildBasicApiDeclaration({ - currentPluginId, - anchorLink, - node, - plugins, - log, - captureReferences, - apiName: node.getName(), + ...buildBasicApiDeclaration(node, { + ...opts, + name: node.getName(), }), type: TypeKind.InterfaceKind, children: node.getMembers().reduce((acc, m) => { - const child = buildApiDeclaration({ - node: m, - plugins, - log, - currentPluginId: anchorLink.pluginName, - scope: anchorLink.scope, - captureReferences, - parentApiId: anchorLink.apiName, - }); + const child = buildApiDeclaration(m, getOptsForChild(m, opts)); if (!isInternal(child)) { acc.push(child); } diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_parameter_decs.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_parameter_decs.ts index 192e27c3de6e9..f93e7a76d4457 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_parameter_decs.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_parameter_decs.ts @@ -7,77 +7,43 @@ */ import { ParameterDeclaration, JSDoc, SyntaxKind } from 'ts-morph'; -import { ToolingLog, KibanaPlatformPlugin } from '@kbn/dev-utils'; import { extractImportReferences } from './extract_import_refs'; -import { AnchorLink, ApiDeclaration } from '../types'; +import { ApiDeclaration } from '../types'; import { buildApiDeclaration } from './build_api_declaration'; import { getJSDocParamComment } from './js_doc_utils'; import { buildBasicApiDeclaration } from './build_basic_api_declaration'; +import { BuildApiDecOpts } from './types'; +import { buildApiId, getOptsForChild } from './utils'; /** * A helper function to capture function parameters, whether it comes from an arrow function, a regular function or * a function type. - * - * @param params - * @param plugins - * @param anchorLink - * @param log - * @param jsDocs */ export function buildApiDecsForParameters( params: ParameterDeclaration[], - plugins: KibanaPlatformPlugin[], - parentAnchorLink: AnchorLink, - currentPluginId: string, - log: ToolingLog, - captureReferences: boolean, + parentOpts: BuildApiDecOpts, jsDocs?: JSDoc[] ): ApiDeclaration[] { - let paramIndex = 0; - return params.reduce((acc, param) => { - paramIndex++; - const apiName = param.getName(); - // Destructured parameters can make these ids look ugly. Instead of parameter name, use an index for the position. - const apiId = parentAnchorLink.apiName - ? parentAnchorLink.apiName + `.$${paramIndex}` - : `$${paramIndex}`; - const anchorLink: AnchorLink = { - scope: parentAnchorLink.scope, - pluginName: parentAnchorLink.pluginName, - apiName: apiId, + return params.reduce((acc, param, index) => { + const id = buildApiId(`$${index + 1}`, parentOpts.id); + const opts = { + ...getOptsForChild(param, parentOpts), + id, }; - log.debug(`Getting parameter doc def for ${apiName} of kind ${param.getKindName()}`); + + opts.log.debug(`Getting parameter doc def for ${opts.name} of kind ${param.getKindName()}`); // Literal types are non primitives that aren't references to other types. We add them as a more // defined node, with children. // If we don't want the docs to be too deeply nested we could avoid this special handling. if (param.getTypeNode() && param.getTypeNode()!.getKind() === SyntaxKind.TypeLiteral) { - acc.push( - buildApiDeclaration({ - node: param.getTypeNode()!, - plugins, - log, - currentPluginId: anchorLink.pluginName, - scope: anchorLink.scope, - captureReferences, - parentApiId: anchorLink.apiName, - name: apiName, - }) - ); + acc.push(buildApiDeclaration(param.getTypeNode()!, opts)); } else { - const apiDec = buildBasicApiDeclaration({ - currentPluginId, - anchorLink, - node: param, - plugins, - log, - apiName, - captureReferences, - }); + const apiDec = buildBasicApiDeclaration(param, opts); acc.push({ ...apiDec, isRequired: param.getType().isNullable() === false, - signature: extractImportReferences(param.getType().getText(), plugins, log), - description: jsDocs ? getJSDocParamComment(jsDocs, apiName) : [], + signature: extractImportReferences(param.getType().getText(), opts.plugins, opts.log), + description: jsDocs ? getJSDocParamComment(jsDocs, opts.name) : [], }); } return acc; diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_type_literal_dec.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_type_literal_dec.ts index 5a74aeefcd2a7..48f8f005d70b8 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_type_literal_dec.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_type_literal_dec.ts @@ -6,55 +6,24 @@ * Side Public License, v 1. */ -import { ToolingLog, KibanaPlatformPlugin } from '@kbn/dev-utils'; import { TypeLiteralNode } from 'ts-morph'; -import { AnchorLink, ApiDeclaration, TypeKind } from '../types'; +import { ApiDeclaration, TypeKind } from '../types'; import { buildApiDeclaration } from './build_api_declaration'; import { buildBasicApiDeclaration } from './build_basic_api_declaration'; +import { BuildApiDecOpts } from './types'; +import { getOptsForChild } from './utils'; /** * This captures function parameters that are object types, and makes sure their * properties are recursively walked so they are expandable in the docs. * * The test verifying `crazyFunction` will fail without this special handling. - * - * @param node - * @param plugins - * @param anchorLink - * @param log - * @param name */ -export function buildTypeLiteralDec( - node: TypeLiteralNode, - plugins: KibanaPlatformPlugin[], - anchorLink: AnchorLink, - currentPluginId: string, - log: ToolingLog, - name: string, - captureReferences: boolean -): ApiDeclaration { +export function buildTypeLiteralDec(node: TypeLiteralNode, opts: BuildApiDecOpts): ApiDeclaration { return { - ...buildBasicApiDeclaration({ - currentPluginId, - anchorLink, - node, - plugins, - log, - captureReferences, - apiName: name, - }), + ...buildBasicApiDeclaration(node, opts), type: TypeKind.ObjectKind, - children: node.getMembers().map((m) => - buildApiDeclaration({ - node: m, - plugins, - log, - currentPluginId: anchorLink.pluginName, - scope: anchorLink.scope, - captureReferences, - parentApiId: anchorLink.apiName, - }) - ), + children: node.getMembers().map((m) => buildApiDeclaration(m, getOptsForChild(m, opts))), // Override the signature, we don't want it for objects, it'll get too big. signature: undefined, }; diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_variable_dec.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_variable_dec.ts index 7a363f93f2efa..31bbc669eefd4 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_variable_dec.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_variable_dec.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import { ToolingLog, KibanaPlatformPlugin } from '@kbn/dev-utils'; import { VariableDeclaration, Node, @@ -16,21 +15,18 @@ import { ShorthandPropertyAssignment, } from 'ts-morph'; import { isInternal } from '../utils'; -import { AnchorLink, ApiDeclaration, TypeKind } from '../types'; +import { ApiDeclaration, TypeKind } from '../types'; import { getArrowFunctionDec } from './build_arrow_fn_dec'; import { buildApiDeclaration } from './build_api_declaration'; import { buildBasicApiDeclaration } from './build_basic_api_declaration'; import { buildCallSignatureDec } from './build_call_signature_dec'; +import { BuildApiDecOpts } from './types'; +import { getOptsForChild } from './utils'; /** * Special handling for objects and arrow functions which are variable or property node types. * Objects and arrow functions need their children extracted recursively. This uses the name from the * node, but checks for an initializer to get inline arrow functions and objects defined recursively. - * - * @param node - * @param plugins - * @param anchorLink - * @param log */ export function buildVariableDec( node: @@ -39,36 +35,16 @@ export function buildVariableDec( | PropertyDeclaration | PropertySignature | ShorthandPropertyAssignment, - plugins: KibanaPlatformPlugin[], - anchorLink: AnchorLink, - currentPluginId: string, - log: ToolingLog, - captureReferences: boolean + opts: BuildApiDecOpts ): ApiDeclaration { const initializer = node.getInitializer(); if (initializer && Node.isObjectLiteralExpression(initializer)) { // Recursively list object properties as children. return { - ...buildBasicApiDeclaration({ - node, - plugins, - anchorLink, - apiName: node.getName(), - currentPluginId, - captureReferences, - log, - }), + ...buildBasicApiDeclaration(node, opts), type: TypeKind.ObjectKind, children: initializer.getProperties().reduce((acc, prop) => { - const child = buildApiDeclaration({ - node: prop, - plugins, - log, - currentPluginId: anchorLink.pluginName, - scope: anchorLink.scope, - captureReferences, - parentApiId: anchorLink.apiName, - }); + const child = buildApiDeclaration(prop, getOptsForChild(prop, opts)); if (!isInternal(child)) { acc.push(child); } @@ -78,42 +54,17 @@ export function buildVariableDec( signature: undefined, }; } else if (initializer && Node.isArrowFunction(initializer)) { - return getArrowFunctionDec( - node, - initializer, - plugins, - anchorLink, - currentPluginId, - log, - captureReferences - ); + return getArrowFunctionDec(node, initializer, opts); } // Without this the test "Property on interface pointing to generic function type exported with link" will fail. if (node.getType().getCallSignatures().length > 0) { if (node.getType().getCallSignatures().length > 1) { - log.warning(`Not handling more than one call signature for node ${node.getName()}`); + opts.log.warning(`Not handling more than one call signature for node ${node.getName()}`); } else { - return buildCallSignatureDec({ - signature: node.getType().getCallSignatures()[0], - log, - captureReferences, - plugins, - anchorLink, - currentPluginId, - name: node.getName(), - node, - }); + return buildCallSignatureDec(node, node.getType().getCallSignatures()[0], opts); } } - return buildBasicApiDeclaration({ - currentPluginId, - anchorLink, - node, - plugins, - log, - captureReferences, - apiName: node.getName(), - }); + return buildBasicApiDeclaration(node, opts); } diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/extract_import_refs.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/extract_import_refs.ts index 850f4b760d86b..74a9cbac59399 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/extract_import_refs.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/extract_import_refs.ts @@ -56,9 +56,8 @@ export function extractImportReferences( } } else { const section = getApiSectionId({ - pluginName: plugin.manifest.id, scope: getScopeFromPath(path, plugin, log), - apiName: name, + id: name, }); texts.push({ pluginId: plugin.manifest.id, diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/types.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/types.ts new file mode 100644 index 0000000000000..bbe49cc2345a2 --- /dev/null +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { KibanaPlatformPlugin, ToolingLog } from '@kbn/dev-utils'; +import { ApiScope } from '../types'; + +export interface BuildApiDecOpts { + plugins: KibanaPlatformPlugin[]; + log: ToolingLog; + currentPluginId: string; + /** + * Whether or not to collect references. This can take a very long time so it can be turned on only for a single plugin. + */ + captureReferences: boolean; + /** + * User facing name of the API item. + */ + name: string; + /** + * What scope the API Item is defined in (common, server, or public) + */ + scope: ApiScope; + /** + * Unique id of this API item. + */ + id: string; +} diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/utils.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/utils.ts index b33b27c6d3223..6a4177f53a973 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/utils.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/utils.ts @@ -8,6 +8,8 @@ import Path from 'path'; import { REPO_ROOT } from '@kbn/utils'; import { ParameterDeclaration, ClassMemberTypes, Node } from 'ts-morph'; +import { BuildApiDecOpts } from './types'; +import { isNamedNode } from '../tsmorph_utils'; // Collect any paths encountered that are not in the correct scope folder. // APIs inside these folders will cause issues with the API docs system. The @@ -30,3 +32,28 @@ export function getSourceForNode(node: Node): string { const path = getRelativePath(node.getSourceFile().getFilePath()); return path; } + +export function buildApiId(id: string, parentId?: string): string { + const clean = id.replace(/[^A-Za-z_.$0-9]+/g, ''); + return parentId ? `${parentId}.${clean}` : clean; +} + +export function buildParentApiId(parentName: string, parentsParentApiId?: string) { + return parentsParentApiId ? `${parentsParentApiId}.${parentName}` : parentName; +} + +export function getOptsForChild(node: Node, parentOpts: BuildApiDecOpts): BuildApiDecOpts { + const name = isNamedNode(node) ? node.getName() : 'Unnamed'; + return getOptsForChildWithName(name, parentOpts); +} + +export function getOptsForChildWithName( + name: string, + parentOpts: BuildApiDecOpts +): BuildApiDecOpts { + return { + ...parentOpts, + name, + id: buildApiId(name, parentOpts.id), + }; +} diff --git a/packages/kbn-docs-utils/src/api_docs/get_plugin_api.ts b/packages/kbn-docs-utils/src/api_docs/get_plugin_api.ts index 5fecb596cb027..d41d66b5dd189 100644 --- a/packages/kbn-docs-utils/src/api_docs/get_plugin_api.ts +++ b/packages/kbn-docs-utils/src/api_docs/get_plugin_api.ts @@ -11,7 +11,7 @@ import { Node, Project } from 'ts-morph'; import { ToolingLog, KibanaPlatformPlugin } from '@kbn/dev-utils'; import { ApiScope, Lifecycle } from './types'; import { ApiDeclaration, PluginApi } from './types'; -import { buildApiDeclaration } from './build_api_declarations/build_api_declaration'; +import { buildApiDeclarationTopNode } from './build_api_declarations/build_api_declaration'; import { getDeclarationNodesForPluginScope } from './get_declaration_nodes_for_plugin'; import { getSourceFileMatching } from './tsmorph_utils'; @@ -55,8 +55,7 @@ function getDeclarations( const contractTypes = getContractTypes(project, plugin, scope); const declarations = nodes.reduce((acc, node) => { - const apiDec = buildApiDeclaration({ - node, + const apiDec = buildApiDeclarationTopNode(node, { plugins, log, currentPluginId: plugin.manifest.id, diff --git a/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/fns.ts b/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/fns.ts index 356da0afbd8fe..c2a932f7d9134 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/fns.ts +++ b/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/fns.ts @@ -56,19 +56,15 @@ export const arrowFn = ( * this is how destructured arguements should be commented. * * @param obj A very crazy parameter that is destructured when passing in. - * @param objWithFn Im an object with a function. Destructed! - * @param objWithFn.fn A fn. - * @param objWithStr Im an object with a string. Destructed! - * @param objWithStr.str A str. * * @returns I have no idea. * */ export const crazyFunction = ( obj: { hi: string }, - { fn }: { fn: (foo: { param: string }) => number }, + { fn1, fn2 }: { fn1: (foo: { param: string }) => number; fn2: () => void }, { str }: { str: string } -) => () => () => fn({ param: str }); +) => () => () => fn1({ param: str }); export const fnWithNonExportedRef = (a: ImNotExportedFromIndex) => a; diff --git a/packages/kbn-docs-utils/src/api_docs/tests/api_doc_suite.test.ts b/packages/kbn-docs-utils/src/api_docs/tests/api_doc_suite.test.ts index 0d567632346f1..389289d6576b0 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/api_doc_suite.test.ts +++ b/packages/kbn-docs-utils/src/api_docs/tests/api_doc_suite.test.ts @@ -191,13 +191,20 @@ describe('functions', () => { const hi = obj?.children?.find((c) => c.label === 'hi'); expect(hi).toBeDefined(); - const obj2 = fn?.children?.find((c) => c.label === '{ fn }'); + const obj2 = fn?.children?.find((c) => c.label === '{ fn1, fn2 }'); expect(obj2).toBeDefined(); - expect(obj2!.children?.length).toBe(1); + expect(obj2!.children?.length).toBe(2); + expect(obj2!.id).toBe('def-public.crazyFunction.$2'); - const fn2 = obj2?.children?.find((c) => c.label === 'fn'); - expect(fn2).toBeDefined(); - expect(fn2?.type).toBe(TypeKind.FunctionKind); + const fn1 = obj2?.children?.find((c) => c.label === 'fn1'); + expect(fn1).toBeDefined(); + expect(fn1?.type).toBe(TypeKind.FunctionKind); + expect(fn1!.id).toBe('def-public.crazyFunction.$2.fn1'); + + const fn3 = fn1?.children?.find((c) => c.label === 'foo'); + expect(fn3).toBeDefined(); + expect(fn3?.type).toBe(TypeKind.ObjectKind); + expect(fn3!.id).toBe('def-public.crazyFunction.$2.fn1.$1'); }); it('Fn with internal tag is not exported', () => { @@ -551,6 +558,7 @@ describe('interfaces and classes', () => { const fn = exampleInterface?.children?.find((c) => c.label === 'fnTypeWithGeneric'); expect(fn).toBeDefined(); + expect(fn!.id).toBe('def-public.ExampleInterface.fnTypeWithGeneric'); // `fnTypeWithGeneric` is defined as: // fnTypeWithGeneric: FnTypeWithGeneric; @@ -560,6 +568,11 @@ describe('interfaces and classes', () => { // to be a function, and thus this doesn't show up as a single referenced type with no kids. If we ever fixed that, // it would be find to change expectations here to be no children and TypeKind instead of FunctionKind. expect(fn?.children).toBeDefined(); + + const t = fn!.children?.find((c) => c.label === 't'); + expect(t).toBeDefined(); + expect(t!.id).toBe('def-public.ExampleInterface.fnTypeWithGeneric.$1'); + expect(fn?.type).toBe(TypeKind.FunctionKind); expect(fn?.signature).toBeDefined(); expect(linkCount(fn!.signature!)).toBe(2); diff --git a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json index a63f726a8ca45..37366d84fef21 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json +++ b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json @@ -367,14 +367,14 @@ "\nWho would write such a complicated function?? Ewwww.\n\nAccording to https://jsdoc.app/tags-param.html#parameters-with-properties,\nthis is how destructured arguements should be commented.\n" ], "signature": [ - "(obj: { hi: string; }, { fn }: { fn: (foo: { param: string; }) => number; }, { str }: { str: string; }) => () => () => number" + "(obj: { hi: string; }, { fn1, fn2 }: { fn1: (foo: { param: string; }) => number; fn2: () => void; }, { str }: { str: string; }) => () => () => number" ], "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/fns.ts", "deprecated": false, "children": [ { "parentPluginId": "pluginA", - "id": "def-public.crazyFunction.$1.obj", + "id": "def-public.crazyFunction.$1", "type": "Object", "tags": [], "label": "obj", @@ -384,7 +384,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.crazyFunction.$1.obj.hi", + "id": "def-public.crazyFunction.$1.hi", "type": "string", "tags": [], "label": "hi", @@ -396,20 +396,20 @@ }, { "parentPluginId": "pluginA", - "id": "def-public.crazyFunction.$2.fn", + "id": "def-public.crazyFunction.$2", "type": "Object", "tags": [], - "label": "{ fn }", + "label": "{ fn1, fn2 }", "description": [], "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/fns.ts", "deprecated": false, "children": [ { "parentPluginId": "pluginA", - "id": "def-public.crazyFunction.$2.fn.fn", + "id": "def-public.crazyFunction.$2.fn1", "type": "Function", "tags": [], - "label": "fn", + "label": "fn1", "description": [], "signature": [ "(foo: { param: string; }) => number" @@ -419,7 +419,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.crazyFunction.$2.fn.fn.$1.foo", + "id": "def-public.crazyFunction.$2.fn1.$1", "type": "Object", "tags": [], "label": "foo", @@ -429,7 +429,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.crazyFunction.$2.fn.fn.$1.foo.param", + "id": "def-public.crazyFunction.$2.fn1.$1.param", "type": "string", "tags": [], "label": "param", @@ -441,12 +441,27 @@ } ], "returnComment": [] + }, + { + "parentPluginId": "pluginA", + "id": "def-public.crazyFunction.$2.fn2", + "type": "Function", + "tags": [], + "label": "fn2", + "description": [], + "signature": [ + "() => void" + ], + "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/fns.ts", + "deprecated": false, + "children": [], + "returnComment": [] } ] }, { "parentPluginId": "pluginA", - "id": "def-public.crazyFunction.$3.str", + "id": "def-public.crazyFunction.$3", "type": "Object", "tags": [], "label": "{ str }", @@ -456,7 +471,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.crazyFunction.$3.str.str", + "id": "def-public.crazyFunction.$3.str", "type": "string", "tags": [], "label": "str", @@ -863,7 +878,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.t", + "id": "def-public.ExampleInterface.fnTypeWithGeneric.$1", "type": "Uncategorized", "tags": [], "label": "t", @@ -876,7 +891,7 @@ }, { "parentPluginId": "pluginA", - "id": "def-public.p", + "id": "def-public.ExampleInterface.fnTypeWithGeneric.$2", "type": "Object", "tags": [], "label": "p", @@ -954,7 +969,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.t", + "id": "def-public.ImAnObject.foo.$1", "type": "Uncategorized", "tags": [], "label": "t", @@ -1042,7 +1057,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.t", + "id": "def-public.MyProps.bar.$1", "type": "Uncategorized", "tags": [], "label": "t", @@ -1299,7 +1314,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.t", + "id": "def-public.FnTypeWithGeneric.$1", "type": "Uncategorized", "tags": [], "label": "t", @@ -1314,7 +1329,7 @@ }, { "parentPluginId": "pluginA", - "id": "def-public.p", + "id": "def-public.FnTypeWithGeneric.$2", "type": "Object", "tags": [], "label": "p", @@ -1360,7 +1375,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.t", + "id": "def-public.FnWithGeneric.$1", "type": "Uncategorized", "tags": [], "label": "t", @@ -1536,7 +1551,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.a", + "id": "def-public.NotAnArrowFnType.$1", "type": "string", "tags": [], "label": "a", @@ -1546,7 +1561,7 @@ }, { "parentPluginId": "pluginA", - "id": "def-public.b", + "id": "def-public.NotAnArrowFnType.$2", "type": "number", "tags": [], "label": "b", @@ -1559,7 +1574,7 @@ }, { "parentPluginId": "pluginA", - "id": "def-public.c", + "id": "def-public.NotAnArrowFnType.$3", "type": "Array", "tags": [], "label": "c", @@ -1572,7 +1587,7 @@ }, { "parentPluginId": "pluginA", - "id": "def-public.d", + "id": "def-public.NotAnArrowFnType.$4", "type": "CompoundType", "tags": [], "label": "d", @@ -1608,7 +1623,7 @@ }, { "parentPluginId": "pluginA", - "id": "def-public.e", + "id": "def-public.NotAnArrowFnType.$5", "type": "string", "tags": [], "label": "e", @@ -1708,7 +1723,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.a", + "id": "def-public.aPretendNamespaceObj.notAnArrowFn.$1", "type": "string", "tags": [], "label": "a", @@ -1718,7 +1733,7 @@ }, { "parentPluginId": "pluginA", - "id": "def-public.b", + "id": "def-public.aPretendNamespaceObj.notAnArrowFn.$2", "type": "number", "tags": [], "label": "b", @@ -1731,7 +1746,7 @@ }, { "parentPluginId": "pluginA", - "id": "def-public.c", + "id": "def-public.aPretendNamespaceObj.notAnArrowFn.$3", "type": "Array", "tags": [], "label": "c", @@ -1744,7 +1759,7 @@ }, { "parentPluginId": "pluginA", - "id": "def-public.d", + "id": "def-public.aPretendNamespaceObj.notAnArrowFn.$4", "type": "CompoundType", "tags": [], "label": "d", @@ -1780,7 +1795,7 @@ }, { "parentPluginId": "pluginA", - "id": "def-public.e", + "id": "def-public.aPretendNamespaceObj.notAnArrowFn.$5", "type": "string", "tags": [], "label": "e", @@ -1835,7 +1850,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.a", + "id": "def-public.aPretendNamespaceObj.aPropertyMisdirection.$1", "type": "string", "tags": [], "label": "a", @@ -1845,7 +1860,7 @@ }, { "parentPluginId": "pluginA", - "id": "def-public.b", + "id": "def-public.aPretendNamespaceObj.aPropertyMisdirection.$2", "type": "number", "tags": [], "label": "b", @@ -1858,7 +1873,7 @@ }, { "parentPluginId": "pluginA", - "id": "def-public.c", + "id": "def-public.aPretendNamespaceObj.aPropertyMisdirection.$3", "type": "Array", "tags": [], "label": "c", @@ -1871,7 +1886,7 @@ }, { "parentPluginId": "pluginA", - "id": "def-public.d", + "id": "def-public.aPretendNamespaceObj.aPropertyMisdirection.$4", "type": "CompoundType", "tags": [], "label": "d", @@ -1907,7 +1922,7 @@ }, { "parentPluginId": "pluginA", - "id": "def-public.e", + "id": "def-public.aPretendNamespaceObj.aPropertyMisdirection.$5", "type": "string", "tags": [], "label": "e", @@ -2094,7 +2109,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.Setup.getSearchService2.$1.searchSpec", + "id": "def-public.Setup.getSearchService2.$1", "type": "Object", "tags": [], "label": "searchSpec", @@ -2104,7 +2119,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.Setup.getSearchService2.$1.searchSpec.username", + "id": "def-public.Setup.getSearchService2.$1.username", "type": "string", "tags": [], "label": "username", @@ -2114,7 +2129,7 @@ }, { "parentPluginId": "pluginA", - "id": "def-public.Setup.getSearchService2.$1.searchSpec.password", + "id": "def-public.Setup.getSearchService2.$1.password", "type": "string", "tags": [], "label": "password", @@ -2179,7 +2194,7 @@ }, { "parentPluginId": "pluginA", - "id": "def-public.Setup.doTheThing.$3.thingThree", + "id": "def-public.Setup.doTheThing.$3", "type": "Object", "tags": [], "label": "thingThree", @@ -2189,7 +2204,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.Setup.doTheThing.$3.thingThree.nestedVar", + "id": "def-public.Setup.doTheThing.$3.nestedVar", "type": "number", "tags": [], "label": "nestedVar", @@ -2219,7 +2234,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.Setup.fnWithInlineParams.$1.obj", + "id": "def-public.Setup.fnWithInlineParams.$1", "type": "Object", "tags": [], "label": "obj", @@ -2229,7 +2244,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.Setup.fnWithInlineParams.$1.obj.fn", + "id": "def-public.Setup.fnWithInlineParams.$1.fn", "type": "Function", "tags": [], "label": "fn", @@ -2242,7 +2257,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.Setup.fnWithInlineParams.$1.obj.fn.$1.foo", + "id": "def-public.Setup.fnWithInlineParams.$1.fn.$1", "type": "Object", "tags": [], "label": "foo", @@ -2252,7 +2267,7 @@ "children": [ { "parentPluginId": "pluginA", - "id": "def-public.Setup.fnWithInlineParams.$1.obj.fn.$1.foo.param", + "id": "def-public.Setup.fnWithInlineParams.$1.fn.$1.param", "type": "string", "tags": [], "label": "param", diff --git a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.mdx b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.mdx index 797231b058d9b..e4c1eb0f0d421 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.mdx +++ b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.mdx @@ -12,7 +12,7 @@ import pluginAObj from './plugin_a.json'; - +Contact Kibana Core for questions regarding this plugin. **Code health stats** diff --git a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a_foo.mdx b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a_foo.mdx index 0e0ca7b200f06..0d952cb34d0da 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a_foo.mdx +++ b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a_foo.mdx @@ -12,7 +12,7 @@ import pluginAFooObj from './plugin_a_foo.json'; - +Contact Kibana Core for questions regarding this plugin. **Code health stats** diff --git a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_b.mdx b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_b.mdx index dd1103d9b4d7f..67b93a8db6d9c 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_b.mdx +++ b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_b.mdx @@ -12,7 +12,7 @@ import pluginBObj from './plugin_b.json'; - +Contact Kibana Core for questions regarding this plugin. **Code health stats** diff --git a/packages/kbn-docs-utils/src/api_docs/types.ts b/packages/kbn-docs-utils/src/api_docs/types.ts index 28bd2328e6abf..8e4a2ca70bac2 100644 --- a/packages/kbn-docs-utils/src/api_docs/types.ts +++ b/packages/kbn-docs-utils/src/api_docs/types.ts @@ -6,22 +6,6 @@ * Side Public License, v 1. */ -export interface AnchorLink { - /** - * The plugin that contains the API being referenced. - */ - pluginName: string; - /** - * It's possible the client and the server both emit an API with - * the same name so we need scope in here to add uniqueness. - */ - scope: ApiScope; - /** - * The name of the api. - */ - apiName: string; -} - /** * The kinds of typescript types we want to show in the docs. `Unknown` is used if * we aren't accounting for a particular type. See {@link getPropertyTypeKind} diff --git a/packages/kbn-docs-utils/src/api_docs/utils.ts b/packages/kbn-docs-utils/src/api_docs/utils.ts index bca0ae5e4fad0..c599695502027 100644 --- a/packages/kbn-docs-utils/src/api_docs/utils.ts +++ b/packages/kbn-docs-utils/src/api_docs/utils.ts @@ -7,15 +7,7 @@ */ import path from 'path'; import { KibanaPlatformPlugin, ToolingLog } from '@kbn/dev-utils'; -import { - AnchorLink, - ApiDeclaration, - ScopeApi, - TypeKind, - Lifecycle, - PluginApi, - ApiScope, -} from './types'; +import { ApiDeclaration, ScopeApi, TypeKind, Lifecycle, PluginApi, ApiScope } from './types'; function capitalize(str: string): string { return str.charAt(0).toUpperCase() + str.slice(1); @@ -107,11 +99,10 @@ export function getPluginApiDocId( return `kib${capitalize(snakeToCamel(cleanName)) + capitalize(service)}PluginApi`; } -export function getApiSectionId(link: AnchorLink) { +export function getApiSectionId({ id, scope }: { id: string; scope: ApiScope }) { // Clean up the name. Things like destructured function parameters can have really long names with brackets and commas. - const cleanName = link.apiName.replace(/[^A-Za-z_.$0-9]+/g, ''); - const id = `def-${link.scope}.${cleanName}`; - return id; + const cleanName = id.replace(/[^A-Za-z_.$0-9]+/g, ''); + return `def-${scope}.${cleanName}`; } export function countScopeApi(api: ScopeApi): number { diff --git a/packages/kbn-es-archiver/.babelrc b/packages/kbn-es-archiver/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-es-archiver/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-es-query/.babelrc b/packages/kbn-es-query/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-es-query/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-es-query/.babelrc.browser b/packages/kbn-es-query/.babelrc.browser deleted file mode 100644 index dc6a77bbe0bcd..0000000000000 --- a/packages/kbn-es-query/.babelrc.browser +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/webpack_preset"] -} diff --git a/packages/kbn-es-query/BUILD.bazel b/packages/kbn-es-query/BUILD.bazel index d4a531d308f6e..b3d861d937c8b 100644 --- a/packages/kbn-es-query/BUILD.bazel +++ b/packages/kbn-es-query/BUILD.bazel @@ -76,7 +76,7 @@ jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - config_file = ".babelrc.browser" + web = True, ) ts_config( diff --git a/packages/kbn-es/.babelrc b/packages/kbn-es/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-es/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-es/src/cluster.js b/packages/kbn-es/src/cluster.js index 32709fc608617..ac4380da88be0 100644 --- a/packages/kbn-es/src/cluster.js +++ b/packages/kbn-es/src/cluster.js @@ -278,7 +278,8 @@ exports.Cluster = class Cluster { // especially because we currently run many instances of ES on the same machine during CI // inital and max must be the same, so we only need to check the max if (!esJavaOpts.includes('Xmx')) { - esJavaOpts += ' -Xms1g -Xmx1g'; + // 1536m === 1.5g + esJavaOpts += ' -Xms1536m -Xmx1536m'; } this._log.debug('ES_JAVA_OPTS: %s', esJavaOpts.trim()); diff --git a/packages/kbn-es/src/integration_tests/cluster.test.js b/packages/kbn-es/src/integration_tests/cluster.test.js index 34220b08d2120..c196a89a6b090 100644 --- a/packages/kbn-es/src/integration_tests/cluster.test.js +++ b/packages/kbn-es/src/integration_tests/cluster.test.js @@ -368,7 +368,7 @@ describe('#run()', () => { const cluster = new Cluster({ log }); await cluster.run(); - expect(execa.mock.calls[0][2].env.ES_JAVA_OPTS).toEqual('-Xms1g -Xmx1g'); + expect(execa.mock.calls[0][2].env.ES_JAVA_OPTS).toMatchInlineSnapshot(`"-Xms1536m -Xmx1536m"`); }); it('allows Java heap to be overwritten', async () => { @@ -378,7 +378,7 @@ describe('#run()', () => { const cluster = new Cluster({ log }); await cluster.run(); - expect(execa.mock.calls[0][2].env.ES_JAVA_OPTS).toEqual('-Xms5g -Xmx5g'); + expect(execa.mock.calls[0][2].env.ES_JAVA_OPTS).toMatchInlineSnapshot(`"-Xms5g -Xmx5g"`); }); }); diff --git a/packages/kbn-eslint-plugin-eslint/index.js b/packages/kbn-eslint-plugin-eslint/index.js index cf96cd9e801ba..a37d3c762a748 100644 --- a/packages/kbn-eslint-plugin-eslint/index.js +++ b/packages/kbn-eslint-plugin-eslint/index.js @@ -14,5 +14,6 @@ module.exports = { module_migration: require('./rules/module_migration'), no_export_all: require('./rules/no_export_all'), no_async_promise_body: require('./rules/no_async_promise_body'), + no_async_foreach: require('./rules/no_async_foreach'), }, }; diff --git a/packages/kbn-eslint-plugin-eslint/rules/no_async_foreach.js b/packages/kbn-eslint-plugin-eslint/rules/no_async_foreach.js new file mode 100644 index 0000000000000..d76d6a61a659b --- /dev/null +++ b/packages/kbn-eslint-plugin-eslint/rules/no_async_foreach.js @@ -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. + */ + +const tsEstree = require('@typescript-eslint/typescript-estree'); +const esTypes = tsEstree.AST_NODE_TYPES; + +/** @typedef {import("eslint").Rule.RuleModule} Rule */ +/** @typedef {import("@typescript-eslint/typescript-estree").TSESTree.Node} Node */ +/** @typedef {import("@typescript-eslint/typescript-estree").TSESTree.CallExpression} CallExpression */ +/** @typedef {import("@typescript-eslint/typescript-estree").TSESTree.FunctionExpression} FunctionExpression */ +/** @typedef {import("@typescript-eslint/typescript-estree").TSESTree.ArrowFunctionExpression} ArrowFunctionExpression */ +/** @typedef {import("eslint").Rule.RuleFixer} Fixer */ + +const ERROR_MSG = + 'Passing an async function to .forEach() prevents promise rejections from being handled. Use asyncForEach() or similar helper from "@kbn/std" instead.'; + +/** + * @param {Node} node + * @returns {node is ArrowFunctionExpression | FunctionExpression} + */ +const isFunc = (node) => + node.type === esTypes.ArrowFunctionExpression || node.type === esTypes.FunctionExpression; + +/** + * @param {any} context + * @param {CallExpression} node + */ +const isAsyncForEachCall = (node) => { + return ( + node.callee.type === esTypes.MemberExpression && + node.callee.property.type === esTypes.Identifier && + node.callee.property.name === 'forEach' && + node.arguments.length >= 1 && + isFunc(node.arguments[0]) && + node.arguments[0].async + ); +}; + +/** @type {Rule} */ +module.exports = { + meta: { + fixable: 'code', + schema: [], + }, + create: (context) => ({ + CallExpression(_) { + const node = /** @type {CallExpression} */ (_); + + if (isAsyncForEachCall(node)) { + context.report({ + message: ERROR_MSG, + loc: node.arguments[0].loc, + }); + } + }, + }), +}; diff --git a/packages/kbn-eslint-plugin-eslint/rules/no_async_foreach.test.js b/packages/kbn-eslint-plugin-eslint/rules/no_async_foreach.test.js new file mode 100644 index 0000000000000..19c26fa8cc77b --- /dev/null +++ b/packages/kbn-eslint-plugin-eslint/rules/no_async_foreach.test.js @@ -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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +const { RuleTester } = require('eslint'); +const rule = require('./no_async_foreach'); +const dedent = require('dedent'); + +const ruleTester = new RuleTester({ + parser: require.resolve('@typescript-eslint/parser'), + parserOptions: { + sourceType: 'module', + ecmaVersion: 2018, + ecmaFeatures: { + jsx: true, + }, + }, +}); + +ruleTester.run('@kbn/eslint/no_async_foreach', rule, { + valid: [ + { + code: dedent` + array.forEach((a) => { + b(a) + }) + `, + }, + { + code: dedent` + array.forEach(function (a) { + b(a) + }) + `, + }, + ], + + invalid: [ + { + code: dedent` + array.forEach(async (a) => { + await b(a) + }) + `, + errors: [ + { + line: 1, + message: + 'Passing an async function to .forEach() prevents promise rejections from being handled. Use asyncForEach() or similar helper from "@kbn/std" instead.', + }, + ], + }, + { + code: dedent` + array.forEach(async function (a) { + await b(a) + }) + `, + errors: [ + { + line: 1, + message: + 'Passing an async function to .forEach() prevents promise rejections from being handled. Use asyncForEach() or similar helper from "@kbn/std" instead.', + }, + ], + }, + ], +}); diff --git a/packages/kbn-field-types/.babelrc b/packages/kbn-field-types/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-field-types/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-i18n/.babelrc b/packages/kbn-i18n/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-i18n/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-i18n/.babelrc.browser b/packages/kbn-i18n/.babelrc.browser deleted file mode 100644 index dc6a77bbe0bcd..0000000000000 --- a/packages/kbn-i18n/.babelrc.browser +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/webpack_preset"] -} diff --git a/packages/kbn-i18n/BUILD.bazel b/packages/kbn-i18n/BUILD.bazel index 62d5fb1d75a46..49d5603b2c516 100644 --- a/packages/kbn-i18n/BUILD.bazel +++ b/packages/kbn-i18n/BUILD.bazel @@ -65,7 +65,7 @@ jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - config_file = ".babelrc.browser" + web = True, ) ts_config( diff --git a/packages/kbn-interpreter/.babelrc b/packages/kbn-interpreter/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-interpreter/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-io-ts-utils/.babelrc b/packages/kbn-io-ts-utils/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-io-ts-utils/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-legacy-logging/.babelrc b/packages/kbn-legacy-logging/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-legacy-logging/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-logging/.babelrc b/packages/kbn-logging/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-logging/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-mapbox-gl/.babelrc b/packages/kbn-mapbox-gl/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-mapbox-gl/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-monaco/.babelrc b/packages/kbn-monaco/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-monaco/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-monaco/.babelrc.browser b/packages/kbn-monaco/.babelrc.browser deleted file mode 100644 index dc6a77bbe0bcd..0000000000000 --- a/packages/kbn-monaco/.babelrc.browser +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/webpack_preset"] -} diff --git a/packages/kbn-monaco/BUILD.bazel b/packages/kbn-monaco/BUILD.bazel index 3656210cb6b1b..d2d9bf3f9a00c 100644 --- a/packages/kbn-monaco/BUILD.bazel +++ b/packages/kbn-monaco/BUILD.bazel @@ -56,7 +56,7 @@ jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - config_file = ".babelrc.browser" + web = True, ) webpack( diff --git a/packages/kbn-optimizer/.babelrc b/packages/kbn-optimizer/.babelrc deleted file mode 100644 index 1685d1644d94a..0000000000000 --- a/packages/kbn-optimizer/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"], - "ignore": ["**/*.test.js"] -} diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 77bbeabb7f73b..69cfffe1f08f0 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -34,7 +34,7 @@ pageLoadAssetSize: indexPatternManagement: 28222 indexPatternEditor: 25000 infra: 184320 - fleet: 465774 + fleet: 250000 ingestPipelines: 58003 inputControlVis: 172675 inspector: 148711 @@ -70,7 +70,6 @@ pageLoadAssetSize: spaces: 57868 telemetry: 51957 telemetryManagementSection: 38586 - timelion: 29920 transform: 41007 triggersActionsUi: 100000 uiActions: 97717 @@ -112,7 +111,7 @@ pageLoadAssetSize: expressionImage: 19288 expressionMetric: 22238 expressionShape: 34008 - interactiveSetup: 70000 + interactiveSetup: 80000 expressionTagcloud: 27505 expressions: 239290 securitySolution: 231753 diff --git a/packages/kbn-plugin-generator/.babelrc b/packages/kbn-plugin-generator/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-plugin-generator/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-plugin-helpers/.babelrc b/packages/kbn-plugin-helpers/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-plugin-helpers/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js index c7f4bbe253777..822bf8eb231b0 100644 --- a/packages/kbn-pm/dist/index.js +++ b/packages/kbn-pm/dist/index.js @@ -27495,16 +27495,23 @@ function isIdentifierChar(code) { function isIdentifierName(name) { let isFirst = true; - for (let _i = 0, _Array$from = Array.from(name); _i < _Array$from.length; _i++) { - const char = _Array$from[_i]; - const cp = char.codePointAt(0); + for (let i = 0; i < name.length; i++) { + let cp = name.charCodeAt(i); + + if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) { + const trail = name.charCodeAt(++i); + + if ((trail & 0xfc00) === 0xdc00) { + cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); + } + } if (isFirst) { + isFirst = false; + if (!isIdentifierStart(cp)) { return false; } - - isFirst = false; } else if (!isIdentifierChar(cp)) { return false; } @@ -59643,7 +59650,7 @@ class CiStatsReporter { throw error; } - if (error !== null && error !== void 0 && error.response && error.response.status < 502) { + if (error !== null && error !== void 0 && error.response && error.response.status < 500) { // error response from service was received so warn the user and move on this.log.warning(`error reporting ${bodyDesc} [status=${error.response.status}] [resp=${(0, _util.inspect)(error.response.data)}]`); return; diff --git a/packages/kbn-rule-data-utils/.babelrc b/packages/kbn-rule-data-utils/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-rule-data-utils/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-securitysolution-autocomplete/.babelrc b/packages/kbn-securitysolution-autocomplete/.babelrc deleted file mode 100644 index 40a198521b903..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-autocomplete/.babelrc.browser b/packages/kbn-securitysolution-autocomplete/.babelrc.browser deleted file mode 100644 index 71bbfbcd6eb2f..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/.babelrc.browser +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/webpack_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-autocomplete/BUILD.bazel b/packages/kbn-securitysolution-autocomplete/BUILD.bazel index 53cd7b4f8d3e1..ac90a0479ce2a 100644 --- a/packages/kbn-securitysolution-autocomplete/BUILD.bazel +++ b/packages/kbn-securitysolution-autocomplete/BUILD.bazel @@ -72,7 +72,7 @@ jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - config_file = ".babelrc.browser" + web = True, ) ts_config( diff --git a/packages/kbn-securitysolution-es-utils/.babelrc b/packages/kbn-securitysolution-es-utils/.babelrc deleted file mode 100644 index 40a198521b903..0000000000000 --- a/packages/kbn-securitysolution-es-utils/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-hook-utils/.babelrc b/packages/kbn-securitysolution-hook-utils/.babelrc deleted file mode 100644 index b17a19d6faf3f..0000000000000 --- a/packages/kbn-securitysolution-hook-utils/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-hook-utils/.babelrc.browser b/packages/kbn-securitysolution-hook-utils/.babelrc.browser deleted file mode 100644 index 71bbfbcd6eb2f..0000000000000 --- a/packages/kbn-securitysolution-hook-utils/.babelrc.browser +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/webpack_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-hook-utils/BUILD.bazel b/packages/kbn-securitysolution-hook-utils/BUILD.bazel index de007b34eeb21..bc7fd3bce1412 100644 --- a/packages/kbn-securitysolution-hook-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-hook-utils/BUILD.bazel @@ -54,7 +54,7 @@ jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - config_file = ".babelrc.browser" + web = True, ) ts_config( diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/.babelrc b/packages/kbn-securitysolution-io-ts-alerting-types/.babelrc deleted file mode 100644 index b17a19d6faf3f..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/.babelrc.browser b/packages/kbn-securitysolution-io-ts-alerting-types/.babelrc.browser deleted file mode 100644 index 71bbfbcd6eb2f..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/.babelrc.browser +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/webpack_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel index 940c6d589da11..cdee3a2f92540 100644 --- a/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel @@ -55,7 +55,7 @@ jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - config_file = ".babelrc.browser" + web = True, ) ts_config( diff --git a/packages/kbn-securitysolution-io-ts-list-types/.babelrc b/packages/kbn-securitysolution-io-ts-list-types/.babelrc deleted file mode 100644 index 40a198521b903..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-io-ts-list-types/.babelrc.browser b/packages/kbn-securitysolution-io-ts-list-types/.babelrc.browser deleted file mode 100644 index 71bbfbcd6eb2f..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/.babelrc.browser +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/webpack_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel index 07ed552cdc408..ff4f2e80cbd37 100644 --- a/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel @@ -53,7 +53,7 @@ jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - config_file = ".babelrc.browser" + web = True, ) ts_config( diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts index 1909bcb1bcc2e..31f763101c258 100644 --- a/packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts +++ b/packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts @@ -40,7 +40,7 @@ export interface UseExceptionListsProps { http: HttpStart; namespaceTypes: NamespaceType[]; notifications: NotificationsStart; - pagination?: Pagination; + initialPagination?: Pagination; showTrustedApps: boolean; showEventFilters: boolean; } diff --git a/packages/kbn-securitysolution-io-ts-types/.babelrc b/packages/kbn-securitysolution-io-ts-types/.babelrc deleted file mode 100644 index 40a198521b903..0000000000000 --- a/packages/kbn-securitysolution-io-ts-types/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-io-ts-types/.babelrc.browser b/packages/kbn-securitysolution-io-ts-types/.babelrc.browser deleted file mode 100644 index 71bbfbcd6eb2f..0000000000000 --- a/packages/kbn-securitysolution-io-ts-types/.babelrc.browser +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/webpack_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-io-ts-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-types/BUILD.bazel index adabf9708a59f..fe2247ac0b614 100644 --- a/packages/kbn-securitysolution-io-ts-types/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-types/BUILD.bazel @@ -53,7 +53,7 @@ jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - config_file = ".babelrc.browser" + web = True, ) ts_config( diff --git a/packages/kbn-securitysolution-io-ts-utils/.babelrc b/packages/kbn-securitysolution-io-ts-utils/.babelrc deleted file mode 100644 index 40a198521b903..0000000000000 --- a/packages/kbn-securitysolution-io-ts-utils/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-io-ts-utils/.babelrc.browser b/packages/kbn-securitysolution-io-ts-utils/.babelrc.browser deleted file mode 100644 index 71bbfbcd6eb2f..0000000000000 --- a/packages/kbn-securitysolution-io-ts-utils/.babelrc.browser +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/webpack_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel b/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel index 346bd19451abd..24819bdd16a33 100644 --- a/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel @@ -57,7 +57,7 @@ jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - config_file = ".babelrc.browser" + web = True, ) ts_config( diff --git a/packages/kbn-securitysolution-list-api/.babelrc b/packages/kbn-securitysolution-list-api/.babelrc deleted file mode 100644 index 40a198521b903..0000000000000 --- a/packages/kbn-securitysolution-list-api/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-list-api/.babelrc.browser b/packages/kbn-securitysolution-list-api/.babelrc.browser deleted file mode 100644 index 71bbfbcd6eb2f..0000000000000 --- a/packages/kbn-securitysolution-list-api/.babelrc.browser +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/webpack_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-list-api/BUILD.bazel b/packages/kbn-securitysolution-list-api/BUILD.bazel index 6858a9389119f..52a134456cdd9 100644 --- a/packages/kbn-securitysolution-list-api/BUILD.bazel +++ b/packages/kbn-securitysolution-list-api/BUILD.bazel @@ -56,7 +56,7 @@ jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - config_file = ".babelrc.browser" + web = True, ) ts_config( diff --git a/packages/kbn-securitysolution-list-constants/.babelrc b/packages/kbn-securitysolution-list-constants/.babelrc deleted file mode 100644 index 40a198521b903..0000000000000 --- a/packages/kbn-securitysolution-list-constants/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-list-constants/.babelrc.browser b/packages/kbn-securitysolution-list-constants/.babelrc.browser deleted file mode 100644 index 71bbfbcd6eb2f..0000000000000 --- a/packages/kbn-securitysolution-list-constants/.babelrc.browser +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/webpack_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-list-constants/BUILD.bazel b/packages/kbn-securitysolution-list-constants/BUILD.bazel index 9b3de9520f6a1..db4dd94091abf 100644 --- a/packages/kbn-securitysolution-list-constants/BUILD.bazel +++ b/packages/kbn-securitysolution-list-constants/BUILD.bazel @@ -45,7 +45,7 @@ jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - config_file = ".babelrc.browser" + web = True, ) ts_config( diff --git a/packages/kbn-securitysolution-list-hooks/.babelrc b/packages/kbn-securitysolution-list-hooks/.babelrc deleted file mode 100644 index 40a198521b903..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-list-hooks/.babelrc.browser b/packages/kbn-securitysolution-list-hooks/.babelrc.browser deleted file mode 100644 index 71bbfbcd6eb2f..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/.babelrc.browser +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/webpack_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-list-hooks/BUILD.bazel b/packages/kbn-securitysolution-list-hooks/BUILD.bazel index ba8c579bb97de..2a9666bd1429e 100644 --- a/packages/kbn-securitysolution-list-hooks/BUILD.bazel +++ b/packages/kbn-securitysolution-list-hooks/BUILD.bazel @@ -62,7 +62,7 @@ jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - config_file = ".babelrc.browser" + web = True, ) ts_config( diff --git a/packages/kbn-securitysolution-list-hooks/src/use_exception_lists/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_exception_lists/index.ts index 0bd4c6c705668..722a7918c4127 100644 --- a/packages/kbn-securitysolution-list-hooks/src/use_exception_lists/index.ts +++ b/packages/kbn-securitysolution-list-hooks/src/use_exception_lists/index.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { useEffect, useMemo, useRef, useState } from 'react'; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import type { ExceptionListSchema, UseExceptionListsProps, @@ -17,7 +17,19 @@ import { fetchExceptionLists } from '@kbn/securitysolution-list-api'; import { getFilters } from '@kbn/securitysolution-list-utils'; export type Func = () => void; -export type ReturnExceptionLists = [boolean, ExceptionListSchema[], Pagination, Func | null]; +export type ReturnExceptionLists = [ + loading: boolean, + exceptionLists: ExceptionListSchema[], + pagination: Pagination, + setPagination: React.Dispatch>, + fetchLists: Func | null +]; + +const DEFAULT_PAGINATION = { + page: 1, + perPage: 20, + total: 0, +}; /** * Hook for fetching ExceptionLists @@ -29,17 +41,13 @@ export type ReturnExceptionLists = [boolean, ExceptionListSchema[], Pagination, * @param notifications kibana service for displaying toasters * @param showTrustedApps boolean - include/exclude trusted app lists * @param showEventFilters boolean - include/exclude event filters lists - * @param pagination + * @param initialPagination * */ export const useExceptionLists = ({ errorMessage, http, - pagination = { - page: 1, - perPage: 20, - total: 0, - }, + initialPagination = DEFAULT_PAGINATION, filterOptions = {}, namespaceTypes, notifications, @@ -47,9 +55,9 @@ export const useExceptionLists = ({ showEventFilters = false, }: UseExceptionListsProps): ReturnExceptionLists => { const [exceptionLists, setExceptionLists] = useState([]); - const [paginationInfo, setPagination] = useState(pagination); + const [pagination, setPagination] = useState(initialPagination); const [loading, setLoading] = useState(true); - const fetchExceptionListsRef = useRef(null); + const abortCtrlRef = useRef(); const namespaceTypesAsString = useMemo(() => namespaceTypes.join(','), [namespaceTypes]); const filters = useMemo( @@ -58,66 +66,57 @@ export const useExceptionLists = ({ [namespaceTypes, filterOptions, showTrustedApps, showEventFilters] ); - useEffect(() => { - let isSubscribed = true; - const abortCtrl = new AbortController(); + const fetchData = useCallback(async (): Promise => { + try { + setLoading(true); - const fetchData = async (): Promise => { - try { - setLoading(true); + abortCtrlRef.current = new AbortController(); - const { page, per_page: perPage, total, data } = await fetchExceptionLists({ - filters, - http, - namespaceTypes: namespaceTypesAsString, - pagination: { - page: pagination.page, - perPage: pagination.perPage, - }, - signal: abortCtrl.signal, - }); + const { page, per_page: perPage, total, data } = await fetchExceptionLists({ + filters, + http, + namespaceTypes: namespaceTypesAsString, + pagination: { + page: pagination.page, + perPage: pagination.perPage, + }, + signal: abortCtrlRef.current.signal, + }); - if (isSubscribed) { - setPagination({ - page, - perPage, - total, - }); - setExceptionLists(data); - setLoading(false); - } - } catch (error) { - if (isSubscribed) { - notifications.toasts.addError(error, { - title: errorMessage, - }); - setExceptionLists([]); - setPagination({ - page: 1, - perPage: 20, - total: 0, - }); - setLoading(false); - } + setPagination({ + page, + perPage, + total, + }); + setExceptionLists(data); + setLoading(false); + } catch (error) { + if (error.name !== 'AbortError') { + notifications.toasts.addError(error, { + title: errorMessage, + }); + setExceptionLists([]); + setPagination(DEFAULT_PAGINATION); + setLoading(false); } - }; - - fetchData(); - - fetchExceptionListsRef.current = fetchData; - return (): void => { - isSubscribed = false; - abortCtrl.abort(); - }; + } }, [ errorMessage, - notifications, - pagination.page, - pagination.perPage, filters, - namespaceTypesAsString, http, + namespaceTypesAsString, + notifications.toasts, + pagination.page, + pagination.perPage, ]); - return [loading, exceptionLists, paginationInfo, fetchExceptionListsRef.current]; + useEffect(() => { + fetchData(); + + return (): void => { + abortCtrlRef.current?.abort(); + }; + }, [fetchData]); + + return [loading, exceptionLists, pagination, setPagination, fetchData]; }; diff --git a/packages/kbn-securitysolution-list-utils/.babelrc b/packages/kbn-securitysolution-list-utils/.babelrc deleted file mode 100644 index 40a198521b903..0000000000000 --- a/packages/kbn-securitysolution-list-utils/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-list-utils/.babelrc.browser b/packages/kbn-securitysolution-list-utils/.babelrc.browser deleted file mode 100644 index 71bbfbcd6eb2f..0000000000000 --- a/packages/kbn-securitysolution-list-utils/.babelrc.browser +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/webpack_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-list-utils/BUILD.bazel b/packages/kbn-securitysolution-list-utils/BUILD.bazel index 4701723286eff..eb33eb1a03b66 100644 --- a/packages/kbn-securitysolution-list-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-list-utils/BUILD.bazel @@ -58,7 +58,7 @@ jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - config_file = ".babelrc.browser" + web = True, ) ts_config( diff --git a/packages/kbn-securitysolution-t-grid/.babelrc b/packages/kbn-securitysolution-t-grid/.babelrc deleted file mode 100644 index 40a198521b903..0000000000000 --- a/packages/kbn-securitysolution-t-grid/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-t-grid/.babelrc.browser b/packages/kbn-securitysolution-t-grid/.babelrc.browser deleted file mode 100644 index 71bbfbcd6eb2f..0000000000000 --- a/packages/kbn-securitysolution-t-grid/.babelrc.browser +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/webpack_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-securitysolution-t-grid/BUILD.bazel b/packages/kbn-securitysolution-t-grid/BUILD.bazel index f9a6a5d7934ad..dd4e73af95720 100644 --- a/packages/kbn-securitysolution-t-grid/BUILD.bazel +++ b/packages/kbn-securitysolution-t-grid/BUILD.bazel @@ -54,7 +54,7 @@ jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - config_file = ".babelrc.browser" + web = True, ) ts_config( diff --git a/packages/kbn-securitysolution-utils/.babelrc b/packages/kbn-securitysolution-utils/.babelrc deleted file mode 100644 index 40a198521b903..0000000000000 --- a/packages/kbn-securitysolution-utils/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"], - "ignore": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/kbn-server-http-tools/.babelrc b/packages/kbn-server-http-tools/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-server-http-tools/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-server-route-repository/.babelrc b/packages/kbn-server-route-repository/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-server-route-repository/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-spec-to-console/README.md b/packages/kbn-spec-to-console/README.md index a0e654713f61b..be0ada5e38850 100644 --- a/packages/kbn-spec-to-console/README.md +++ b/packages/kbn-spec-to-console/README.md @@ -29,3 +29,8 @@ yarn spec_to_console -g "/rest-api-spec/src/main/reso * Request bodies * Data fetched at runtime: indices, fields, snapshots, etc * Ad hoc additions + +### Updating the script +When converting query params defined in the REST API specs to console autocompletion definitions, the script relies on a set of known conversion rules specified in [lib/convert/params.js](https://github.com/elastic/kibana/blob/master/packages/kbn-spec-to-console/lib/convert/params.js). +For example, `"keep_on_completion":{"type":"boolean"}` from REST API specs is converted to `"keep_on_completion": "__flag__"` in console autocomplete definitions. +When an unknown parameter type is encountered in REST API specs, the script will throw an `Unexpected type error` and the file [lib/convert/params.js](https://github.com/elastic/kibana/blob/master/packages/kbn-spec-to-console/lib/convert/params.js) needs to be updated by adding a new conversion rule. \ No newline at end of file diff --git a/packages/kbn-std/.babelrc b/packages/kbn-std/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-std/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-std/BUILD.bazel b/packages/kbn-std/BUILD.bazel index 571d3c061c138..182722c642238 100644 --- a/packages/kbn-std/BUILD.bazel +++ b/packages/kbn-std/BUILD.bazel @@ -9,7 +9,10 @@ SOURCE_FILES = glob( [ "src/**/*.ts", ], - exclude = ["**/*.test.*"], + exclude = [ + "**/*.test.*", + "**/test_helpers.ts", + ], ) SRCS = SOURCE_FILES diff --git a/packages/kbn-std/src/index.ts b/packages/kbn-std/src/index.ts index d79594c97cec7..33b40c20039f2 100644 --- a/packages/kbn-std/src/index.ts +++ b/packages/kbn-std/src/index.ts @@ -18,3 +18,11 @@ export { unset } from './unset'; export { getFlattenedObject } from './get_flattened_object'; export { ensureNoUnsafeProperties } from './ensure_no_unsafe_properties'; export * from './rxjs_7'; +export { + map$, + mapWithLimit$, + asyncMap, + asyncMapWithLimit, + asyncForEach, + asyncForEachWithLimit, +} from './iteration'; diff --git a/packages/kbn-std/src/iteration/for_each.test.ts b/packages/kbn-std/src/iteration/for_each.test.ts new file mode 100644 index 0000000000000..a10c204ffa4ea --- /dev/null +++ b/packages/kbn-std/src/iteration/for_each.test.ts @@ -0,0 +1,81 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 { asyncForEach, asyncForEachWithLimit } from './for_each'; +import { list, sleep } from './test_helpers'; + +jest.mock('./observable'); +const mockMapWithLimit$: jest.Mock = jest.requireMock('./observable').mapWithLimit$; + +beforeEach(() => { + jest.clearAllMocks(); +}); + +describe('asyncForEachWithLimit', () => { + it('calls mapWithLimit$ and resolves with undefined when it completes', async () => { + const iter = list(10); + const limit = 5; + const fn = jest.fn(); + + const result$ = new Rx.Subject(); + mockMapWithLimit$.mockImplementation(() => result$); + const promise = asyncForEachWithLimit(iter, limit, fn); + + let resolved = false; + promise.then(() => (resolved = true)); + + expect(mockMapWithLimit$).toHaveBeenCalledTimes(1); + expect(mockMapWithLimit$).toHaveBeenCalledWith(iter, limit, fn); + + expect(resolved).toBe(false); + result$.next(1); + result$.next(2); + result$.next(3); + + await sleep(10); + expect(resolved).toBe(false); + + result$.complete(); + await expect(promise).resolves.toBe(undefined); + }); + + it('resolves when iterator is empty', async () => { + mockMapWithLimit$.mockImplementation((x) => Rx.from(x)); + await expect(asyncForEachWithLimit([], 100, async () => 'foo')).resolves.toBe(undefined); + }); +}); + +describe('asyncForEach', () => { + it('calls mapWithLimit$ without limit and resolves with undefined when it completes', async () => { + const iter = list(10); + const fn = jest.fn(); + + const result$ = new Rx.Subject(); + mockMapWithLimit$.mockImplementation(() => result$); + const promise = asyncForEach(iter, fn); + + let resolved = false; + promise.then(() => (resolved = true)); + + expect(mockMapWithLimit$).toHaveBeenCalledTimes(1); + expect(mockMapWithLimit$).toHaveBeenCalledWith(iter, Infinity, fn); + + expect(resolved).toBe(false); + result$.next(1); + result$.next(2); + result$.next(3); + + await sleep(10); + expect(resolved).toBe(false); + + result$.complete(); + await expect(promise).resolves.toBe(undefined); + }); +}); diff --git a/packages/kbn-std/src/iteration/for_each.ts b/packages/kbn-std/src/iteration/for_each.ts new file mode 100644 index 0000000000000..bd23d2e0e6c11 --- /dev/null +++ b/packages/kbn-std/src/iteration/for_each.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 { defaultIfEmpty } from 'rxjs/operators'; + +import { lastValueFrom } from '../rxjs_7'; +import { mapWithLimit$ } from './observable'; +import { IterableInput, AsyncMapFn } from './types'; + +/** + * Creates a promise which resolves with `undefined` after calling `fn` for each + * item in `iterable`. `fn` can return either a Promise or Observable. If `fn` + * returns observables then they will properly abort if an error occurs. + * + * @param iterable Items to iterate + * @param fn Function to call for each item + */ +export async function asyncForEach(iterable: IterableInput, fn: AsyncMapFn) { + await lastValueFrom(mapWithLimit$(iterable, Infinity, fn).pipe(defaultIfEmpty())); +} + +/** + * Creates a promise which resolves with `undefined` after calling `fn` for each + * item in `iterable`. `fn` can return either a Promise or Observable. If `fn` + * returns observables then they will properly abort if an error occurs. + * + * The number of concurrent executions of `fn` is limited by `limit`. + * + * @param iterable Items to iterate + * @param limit Maximum number of operations to run in parallel + * @param fn Function to call for each item + */ +export async function asyncForEachWithLimit( + iterable: IterableInput, + limit: number, + fn: AsyncMapFn +) { + await lastValueFrom(mapWithLimit$(iterable, limit, fn).pipe(defaultIfEmpty())); +} diff --git a/packages/kbn-std/src/iteration/index.ts b/packages/kbn-std/src/iteration/index.ts new file mode 100644 index 0000000000000..e9ed7655270b0 --- /dev/null +++ b/packages/kbn-std/src/iteration/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 * from './observable'; +export * from './for_each'; +export * from './map'; diff --git a/packages/kbn-std/src/iteration/map.test.ts b/packages/kbn-std/src/iteration/map.test.ts new file mode 100644 index 0000000000000..33331961c0807 --- /dev/null +++ b/packages/kbn-std/src/iteration/map.test.ts @@ -0,0 +1,82 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 { mapTo } from 'rxjs/operators'; + +import { asyncMap, asyncMapWithLimit } from './map'; +import { list } from './test_helpers'; + +jest.mock('./observable'); +const mapWithLimit$: jest.Mock = jest.requireMock('./observable').mapWithLimit$; +mapWithLimit$.mockImplementation(jest.requireActual('./observable').mapWithLimit$); + +beforeEach(() => { + jest.clearAllMocks(); +}); + +describe('asyncMapWithLimit', () => { + it('calls mapWithLimit$ and resolves with properly sorted results', async () => { + const iter = list(10); + const limit = 5; + const fn = jest.fn((n) => (n % 2 ? Rx.timer(n) : Rx.timer(n * 4)).pipe(mapTo(n))); + const result = await asyncMapWithLimit(iter, limit, fn); + + expect(result).toMatchInlineSnapshot(` + Array [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + ] + `); + + expect(mapWithLimit$).toHaveBeenCalledTimes(1); + expect(mapWithLimit$).toHaveBeenCalledWith(iter, limit, expect.any(Function)); + }); + + it.each([ + [list(0), []] as const, + [list(1), ['foo']] as const, + [list(2), ['foo', 'foo']] as const, + ])('resolves when iterator is %p', async (input, output) => { + await expect(asyncMapWithLimit(input, 100, async () => 'foo')).resolves.toEqual(output); + }); +}); + +describe('asyncMap', () => { + it('calls mapWithLimit$ without limit and resolves with undefined when it completes', async () => { + const iter = list(10); + const fn = jest.fn((n) => (n % 2 ? Rx.timer(n) : Rx.timer(n * 4)).pipe(mapTo(n))); + const result = await asyncMap(iter, fn); + + expect(result).toMatchInlineSnapshot(` + Array [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + ] + `); + + expect(mapWithLimit$).toHaveBeenCalledTimes(1); + expect(mapWithLimit$).toHaveBeenCalledWith(iter, Infinity, expect.any(Function)); + }); +}); diff --git a/packages/kbn-std/src/iteration/map.ts b/packages/kbn-std/src/iteration/map.ts new file mode 100644 index 0000000000000..4c8d65df57f37 --- /dev/null +++ b/packages/kbn-std/src/iteration/map.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { from } from 'rxjs'; +import { toArray } from 'rxjs/operators'; +import { lastValueFrom } from '../rxjs_7'; + +import { IterableInput, AsyncMapFn, AsyncMapResult } from './types'; +import { mapWithLimit$ } from './observable'; + +const getAllResults = (input: AsyncMapResult) => lastValueFrom(from(input).pipe(toArray())); + +/** + * Creates a promise whose values is the array of results produced by calling `fn` for + * each item in `iterable`. `fn` can return either a Promise or Observable. If `fn` + * returns observables then they will properly abort if an error occurs. + * + * The result array follows the order of the input iterable, even though the calls + * to `fn` may not. (so avoid side effects) + * + * @param iterable Items to iterate + * @param fn Function to call for each item. Result is added/concatenated into the result array in place of the input value + */ +export async function asyncMap(iterable: IterableInput, fn: AsyncMapFn) { + return await asyncMapWithLimit(iterable, Infinity, fn); +} + +/** + * Creates a promise whose values is the array of results produced by calling `fn` for + * each item in `iterable`. `fn` can return either a Promise or Observable. If `fn` + * returns observables then they will properly abort if an error occurs. + * + * The number of concurrent executions of `fn` is limited by `limit`. + * + * The result array follows the order of the input iterable, even though the calls + * to `fn` may not. (so avoid side effects) + * + * @param iterable Items to iterate + * @param limit Maximum number of operations to run in parallel + * @param fn Function to call for each item. Result is added/concatenated into the result array in place of the input value + */ +export async function asyncMapWithLimit( + iterable: IterableInput, + limit: number, + fn: AsyncMapFn +) { + const results$ = mapWithLimit$( + iterable, + limit, + async (item, i) => [i, await getAllResults(fn(item, i))] as const + ); + + const results = await getAllResults(results$); + + return results + .sort(([a], [b]) => a - b) + .reduce((acc: T2[], [, result]) => acc.concat(result), []); +} diff --git a/packages/kbn-std/src/iteration/observable.test.ts b/packages/kbn-std/src/iteration/observable.test.ts new file mode 100644 index 0000000000000..e84750e08148d --- /dev/null +++ b/packages/kbn-std/src/iteration/observable.test.ts @@ -0,0 +1,81 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 { toArray } from 'rxjs/operators'; +import { lastValueFrom } from '../rxjs_7'; + +import { map$, mapWithLimit$ } from './observable'; +import { list, sleep, generator } from './test_helpers'; + +beforeEach(() => { + jest.clearAllMocks(); +}); + +describe('mapWithLimit$', () => { + it('calls the fn for each item and produced each item on the stream with limit 1', async () => { + let maxConcurrency = 0; + let active = 0; + const limit = Math.random() > 0.5 ? 20 : 40; + + const results = await lastValueFrom( + mapWithLimit$(list(100), limit, async (n) => { + active += 1; + if (active > maxConcurrency) { + maxConcurrency = active; + } + await sleep(5); + active -= 1; + return n; + }).pipe(toArray()) + ); + + expect(maxConcurrency).toBe(limit); + expect(results).toHaveLength(100); + for (const [n, i] of results.entries()) { + expect(n).toBe(i); + } + }); + + it.each([ + ['empty array', [], []] as const, + ['empty generator', generator(0), []] as const, + ['generator', generator(5), [0, 1, 2, 3, 4]] as const, + ['set', new Set([5, 4, 3, 2, 1]), [5, 4, 3, 2, 1]] as const, + ['observable', Rx.of(1, 2, 3, 4, 5), [1, 2, 3, 4, 5]] as const, + ])('works with %p', async (_, iter, expected) => { + const mock = jest.fn(async (n) => n); + const results = await lastValueFrom(mapWithLimit$(iter, 1, mock).pipe(toArray())); + expect(results).toEqual(expected); + }); +}); + +describe('map$', () => { + it('applies no limit to mapWithLimit$', async () => { + let maxConcurrency = 0; + let active = 0; + + const results = await lastValueFrom( + map$(list(100), async (n) => { + active += 1; + if (active > maxConcurrency) { + maxConcurrency = active; + } + await sleep(5); + active -= 1; + return n; + }).pipe(toArray()) + ); + + expect(maxConcurrency).toBe(100); + expect(results).toHaveLength(100); + for (const [n, i] of results.entries()) { + expect(n).toBe(i); + } + }); +}); diff --git a/packages/kbn-std/src/iteration/observable.ts b/packages/kbn-std/src/iteration/observable.ts new file mode 100644 index 0000000000000..d11bdd44e52d5 --- /dev/null +++ b/packages/kbn-std/src/iteration/observable.ts @@ -0,0 +1,49 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { from } from 'rxjs'; +import { mergeMap } from 'rxjs/operators'; + +import { IterableInput, AsyncMapFn } from './types'; + +/** + * Creates an observable whose values are the result of calling `fn` for each + * item in `iterable`. `fn` can return either a Promise or an Observable. If + * `fn` returns observables then they will properly abort if an error occurs. + * + * Results are emitted as soon as they are available so their order is very + * likely to not match their order in the input `array`. + * + * @param iterable Items to iterate + * @param fn Function to call for each item. Result is added/concatenated into the result array in place of the input value + */ +export function map$(iterable: IterableInput, fn: AsyncMapFn) { + return from(iterable).pipe(mergeMap(fn)); +} + +/** + * Creates an observable whose values are the result of calling `fn` for each + * item in `iterable`. `fn` can return either a Promise or an Observable. If + * `fn` returns observables then they will properly abort if an error occurs. + * + * The number of concurrent executions of `fn` is limited by `limit`. + * + * Results are emitted as soon as they are available so their order is very + * likely to not match their order in the input `array`. + * + * @param iterable Items to iterate + * @param limit Maximum number of operations to run in parallel + * @param fn Function to call for each item. Result is added/concatenated into the result array in place of the input value + */ +export function mapWithLimit$( + iterable: IterableInput, + limit: number, + fn: AsyncMapFn +) { + return from(iterable).pipe(mergeMap(fn, limit)); +} diff --git a/packages/kbn-std/src/iteration/test_helpers.ts b/packages/kbn-std/src/iteration/test_helpers.ts new file mode 100644 index 0000000000000..e5f7699b090ce --- /dev/null +++ b/packages/kbn-std/src/iteration/test_helpers.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 const list = (size: number) => Array.from({ length: size }, (_, i) => i); + +export const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms)); + +export const generator = function* (size: number) { + for (const n of list(size)) { + yield n; + } +}; diff --git a/packages/kbn-std/src/iteration/types.ts b/packages/kbn-std/src/iteration/types.ts new file mode 100644 index 0000000000000..6e0bfd9f22d7f --- /dev/null +++ b/packages/kbn-std/src/iteration/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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Subscribable } from 'rxjs'; + +export type IterableInput = Iterable | Subscribable; +export type AsyncMapResult = Promise | Subscribable; +export type AsyncMapFn = (item: T1, i: number) => AsyncMapResult; diff --git a/packages/kbn-storybook/.babelrc b/packages/kbn-storybook/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-storybook/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-telemetry-tools/.babelrc b/packages/kbn-telemetry-tools/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-telemetry-tools/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-test/.babelrc b/packages/kbn-test/.babelrc deleted file mode 100644 index 1685d1644d94a..0000000000000 --- a/packages/kbn-test/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"], - "ignore": ["**/*.test.js"] -} diff --git a/packages/kbn-test/src/kbn_client/kbn_client_plugins.ts b/packages/kbn-test/src/kbn_client/kbn_client_plugins.ts index c730091c1478b..25c3d7e156e91 100644 --- a/packages/kbn-test/src/kbn_client/kbn_client_plugins.ts +++ b/packages/kbn-test/src/kbn_client/kbn_client_plugins.ts @@ -8,26 +8,14 @@ import { KbnClientStatus } from './kbn_client_status'; -const PLUGIN_STATUS_ID = /^plugin:(.+?)@/; - export class KbnClientPlugins { constructor(private readonly status: KbnClientStatus) {} /** * Get a list of plugin ids that are enabled on the server */ public async getEnabledIds() { - const pluginIds: string[] = []; const apiResp = await this.status.get(); - for (const status of apiResp.status.statuses) { - if (status.id) { - const match = status.id.match(PLUGIN_STATUS_ID); - if (match) { - pluginIds.push(match[1]); - } - } - } - - return pluginIds; + return Object.keys(apiResp.status.plugins); } } diff --git a/packages/kbn-test/src/kbn_client/kbn_client_status.ts b/packages/kbn-test/src/kbn_client/kbn_client_status.ts index 26c46917ae8dd..3b1995c8ab36a 100644 --- a/packages/kbn-test/src/kbn_client/kbn_client_status.ts +++ b/packages/kbn-test/src/kbn_client/kbn_client_status.ts @@ -9,13 +9,11 @@ import { KbnClientRequester } from './kbn_client_requester'; interface Status { - state: 'green' | 'red' | 'yellow'; - title?: string; - id?: string; - icon: string; - message: string; - uiColor: string; - since: string; + level: 'available' | 'degraded' | 'unavailable' | 'critical'; + summary: string; + detail?: string; + documentationUrl?: string; + meta?: Record; } interface ApiResponseStatus { @@ -29,7 +27,8 @@ interface ApiResponseStatus { }; status: { overall: Status; - statuses: Status[]; + core: Record; + plugins: Record; }; metrics: unknown; } @@ -44,6 +43,9 @@ export class KbnClientStatus { const { data } = await this.requester.request({ method: 'GET', path: 'api/status', + query: { + v8format: true, + }, // Status endpoint returns 503 if any services are in an unavailable state ignoreErrors: [503], }); @@ -55,6 +57,6 @@ export class KbnClientStatus { */ public async getOverallState() { const status = await this.get(); - return status.status.overall.state; + return status.status.overall.level; } } diff --git a/packages/kbn-timelion-grammar/BUILD.bazel b/packages/kbn-timelion-grammar/BUILD.bazel new file mode 100644 index 0000000000000..9302e650630f3 --- /dev/null +++ b/packages/kbn-timelion-grammar/BUILD.bazel @@ -0,0 +1,46 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm") +load("@npm//peggy:index.bzl", "peggy") + +PKG_BASE_NAME = "kbn-timelion-grammar" +PKG_REQUIRE_NAME = "@kbn/timelion-grammar" + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +peggy( + name = "grammar", + data = [ + ":grammar/chain.peggy" + ], + output_dir = True, + args = [ + "-o", + "$(@D)/chain.js", + "./%s/grammar/chain.peggy" % package_name() + ], +) + +js_library( + name = PKG_BASE_NAME, + srcs = NPM_MODULE_EXTRA_FILES + [ + ":grammar" + ], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [ + ":%s" % PKG_BASE_NAME, + ] +) + +filegroup( + name = "build", + srcs = [ + ":npm_module", + ], + visibility = ["//visibility:public"], +) diff --git a/src/plugins/vis_type_timelion/common/chain.peg b/packages/kbn-timelion-grammar/grammar/chain.peggy similarity index 100% rename from src/plugins/vis_type_timelion/common/chain.peg rename to packages/kbn-timelion-grammar/grammar/chain.peggy diff --git a/packages/kbn-timelion-grammar/package.json b/packages/kbn-timelion-grammar/package.json new file mode 100644 index 0000000000000..04b88b002fc47 --- /dev/null +++ b/packages/kbn-timelion-grammar/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/timelion-grammar", + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0", + "private": true, + "main": "grammar/chain.js" + } \ No newline at end of file diff --git a/packages/kbn-tinymath/babel.config.js b/packages/kbn-tinymath/babel.config.js deleted file mode 100644 index b4a118df51af5..0000000000000 --- a/packages/kbn-tinymath/babel.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 = { - env: { - web: { - presets: ['@kbn/babel-preset/webpack_preset'], - }, - node: { - presets: ['@kbn/babel-preset/node_preset'], - }, - }, - ignore: ['**/*.test.ts', '**/*.test.tsx'], -}; diff --git a/packages/kbn-typed-react-router-config/.babelrc b/packages/kbn-typed-react-router-config/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-typed-react-router-config/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-typed-react-router-config/.babelrc.browser b/packages/kbn-typed-react-router-config/.babelrc.browser deleted file mode 100644 index dc6a77bbe0bcd..0000000000000 --- a/packages/kbn-typed-react-router-config/.babelrc.browser +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/webpack_preset"] -} diff --git a/packages/kbn-typed-react-router-config/BUILD.bazel b/packages/kbn-typed-react-router-config/BUILD.bazel index be346f8321fad..7fccc53bd7449 100644 --- a/packages/kbn-typed-react-router-config/BUILD.bazel +++ b/packages/kbn-typed-react-router-config/BUILD.bazel @@ -56,7 +56,7 @@ jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - config_file = ".babelrc.browser" + web = True, ) ts_config( diff --git a/packages/kbn-typed-react-router-config/src/create_router.test.tsx b/packages/kbn-typed-react-router-config/src/create_router.test.tsx index 3fb37f813e2e1..61ba8eb157ee3 100644 --- a/packages/kbn-typed-react-router-config/src/create_router.test.tsx +++ b/packages/kbn-typed-react-router-config/src/create_router.test.tsx @@ -43,17 +43,23 @@ describe('createRouter', () => { }), }, { - path: '/services/:serviceName', + path: '/services', element: <>, - params: t.type({ - path: t.type({ - serviceName: t.string, - }), - query: t.type({ - transactionType: t.string, - environment: t.string, - }), - }), + children: [ + { + element: <>, + path: '/services/{serviceName}', + params: t.type({ + path: t.type({ + serviceName: t.string, + }), + query: t.type({ + transactionType: t.string, + environment: t.string, + }), + }), + }, + ], }, { path: '/traces', @@ -131,7 +137,7 @@ describe('createRouter', () => { '/services/opbeans-java?rangeFrom=now-15m&rangeTo=now&environment=production&transactionType=request' ); - const serviceOverviewParams = router.getParams('/services/:serviceName', history.location); + const serviceOverviewParams = router.getParams('/services/{serviceName}', history.location); expect(serviceOverviewParams).toEqual({ path: { @@ -250,7 +256,7 @@ describe('createRouter', () => { describe('link', () => { it('returns a link for the given route', () => { - const serviceOverviewLink = router.link('/services/:serviceName', { + const serviceOverviewLink = router.link('/services/{serviceName}', { path: { serviceName: 'opbeans-java' }, query: { rangeFrom: 'now-15m', diff --git a/packages/kbn-typed-react-router-config/src/create_router.ts b/packages/kbn-typed-react-router-config/src/create_router.ts index 370d8b48e53b4..7f2ac818fc9b9 100644 --- a/packages/kbn-typed-react-router-config/src/create_router.ts +++ b/packages/kbn-typed-react-router-config/src/create_router.ts @@ -25,22 +25,24 @@ import { Route, Router } from './types'; const deepExactRt: typeof deepExactRtTyped = deepExactRtNonTyped; const mergeRt: typeof mergeRtTyped = mergeRtNonTyped; +function toReactRouterPath(path: string) { + return path.replace(/(?:{([^\/]+)})/, ':$1'); +} + export function createRouter(routes: TRoutes): Router { const routesByReactRouterConfig = new Map(); const reactRouterConfigsByRoute = new Map(); const reactRouterConfigs = routes.map((route) => toReactRouterConfigRoute(route)); - function toReactRouterConfigRoute(route: Route, prefix: string = ''): ReactRouterConfig { - const path = `${prefix}${route.path}`.replace(/\/{2,}/g, '/').replace(/\/$/, '') || '/'; + function toReactRouterConfigRoute(route: Route): ReactRouterConfig { const reactRouterConfig: ReactRouterConfig = { component: () => route.element, routes: - (route.children as Route[] | undefined)?.map((child) => - toReactRouterConfigRoute(child, path) - ) ?? [], + (route.children as Route[] | undefined)?.map((child) => toReactRouterConfigRoute(child)) ?? + [], exact: !route.children?.length, - path, + path: toReactRouterPath(route.path), }; routesByReactRouterConfig.set(reactRouterConfig, route); @@ -71,11 +73,11 @@ export function createRouter(routes: TRoutes): Router match.route.path === path); + : findLastIndex(matches, (match) => match.route.path === toReactRouterPath(path)); if (matchIndex !== -1) { break; @@ -135,11 +137,12 @@ export function createRouter(routes: TRoutes): Router { - return part.startsWith(':') ? paramsWithBuiltInDefaults.path[part.split(':')[1]] : part; + const match = part.match(/(?:{([a-zA-Z]+)})/); + return match ? paramsWithBuiltInDefaults.path[match[1]] : part; }) .join('/'); - const matches = matchRoutesConfig(reactRouterConfigs, path); + const matches = matchRoutesConfig(reactRouterConfigs, toReactRouterPath(path)); if (!matches.length) { throw new Error(`No matching route found for ${path}`); diff --git a/packages/kbn-typed-react-router-config/src/types/index.ts b/packages/kbn-typed-react-router-config/src/types/index.ts index 4d26d2879d5e7..e6c70001ef4b6 100644 --- a/packages/kbn-typed-react-router-config/src/types/index.ts +++ b/packages/kbn-typed-react-router-config/src/types/index.ts @@ -13,7 +13,97 @@ import { RequiredKeys, ValuesType } from 'utility-types'; // import { unconst } from '../unconst'; import { NormalizePath } from './utils'; -export type PathsOf = keyof MapRoutes & string; +type PathsOfRoute = + | TRoute['path'] + | (TRoute extends { children: Route[] } + ? AppendPath | PathsOf + : never); + +export type PathsOf = TRoutes extends [] + ? never + : TRoutes extends [Route] + ? PathsOfRoute + : TRoutes extends [Route, Route] + ? PathsOfRoute | PathsOfRoute + : TRoutes extends [Route, Route, Route] + ? PathsOfRoute | PathsOfRoute | PathsOfRoute + : TRoutes extends [Route, Route, Route, Route] + ? + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + : TRoutes extends [Route, Route, Route, Route, Route] + ? + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + : TRoutes extends [Route, Route, Route, Route, Route, Route] + ? + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + : TRoutes extends [Route, Route, Route, Route, Route, Route, Route] + ? + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + : TRoutes extends [Route, Route, Route, Route, Route, Route, Route, Route] + ? + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + : TRoutes extends [Route, Route, Route, Route, Route, Route, Route, Route, Route] + ? + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + : TRoutes extends [Route, Route, Route, Route, Route, Route, Route, Route, Route, Route] + ? + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + : TRoutes extends [Route, Route, Route, Route, Route, Route, Route, Route, Route, Route, Route] + ? + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + | PathsOfRoute + : string; export interface RouteMatch { route: TRoute; @@ -167,29 +257,17 @@ type MaybeUnion, U extends Record> = [key in keyof U]: key extends keyof T ? T[key] | U[key] : U[key]; }; -type MapRoute< - TRoute extends Route, - TPrefix extends string, - TParents extends Route[] = [] -> = TRoute extends Route +type MapRoute = TRoute extends Route ? MaybeUnion< { - [key in AppendPath]: TRoute & { parents: TParents }; + [key in TRoute['path']]: TRoute & { parents: TParents }; }, TRoute extends { children: Route[] } ? MaybeUnion< - MapRoutes< - TRoute['children'], - AppendPath, - [...TParents, TRoute] - >, + MapRoutes, { - [key in AppendPath>]: ValuesType< - MapRoutes< - TRoute['children'], - AppendPath, - [...TParents, TRoute] - > + [key in AppendPath]: ValuesType< + MapRoutes >; } > @@ -197,74 +275,68 @@ type MapRoute< > : {}; -type MapRoutes< - TRoutes, - TPrefix extends string = '', - TParents extends Route[] = [] -> = TRoutes extends [Route] - ? MapRoute +type MapRoutes = TRoutes extends [Route] + ? MapRoute : TRoutes extends [Route, Route] - ? MapRoute & MapRoute + ? MapRoute & MapRoute : TRoutes extends [Route, Route, Route] - ? MapRoute & - MapRoute & - MapRoute + ? MapRoute & MapRoute & MapRoute : TRoutes extends [Route, Route, Route, Route] - ? MapRoute & - MapRoute & - MapRoute & - MapRoute + ? MapRoute & + MapRoute & + MapRoute & + MapRoute : TRoutes extends [Route, Route, Route, Route, Route] - ? MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute + ? MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute : TRoutes extends [Route, Route, Route, Route, Route, Route] - ? MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute + ? MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute : TRoutes extends [Route, Route, Route, Route, Route, Route, Route] - ? MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute + ? MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute : TRoutes extends [Route, Route, Route, Route, Route, Route, Route, Route] - ? MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute + ? MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute : TRoutes extends [Route, Route, Route, Route, Route, Route, Route, Route, Route] - ? MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute + ? MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute : TRoutes extends [Route, Route, Route, Route, Route, Route, Route, Route, Route, Route] - ? MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute & - MapRoute + ? MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute & + MapRoute : {}; // const element = null as any; @@ -279,11 +351,11 @@ type MapRoutes< // element, // children: [ // { -// path: '/agent-configuration', +// path: '/settings/agent-configuration', // element, // }, // { -// path: '/agent-configuration/create', +// path: '/settings/agent-configuration/create', // element, // params: t.partial({ // query: t.partial({ @@ -292,7 +364,7 @@ type MapRoutes< // }), // }, // { -// path: '/agent-configuration/edit', +// path: '/settings/agent-configuration/edit', // element, // params: t.partial({ // query: t.partial({ @@ -301,23 +373,23 @@ type MapRoutes< // }), // }, // { -// path: '/apm-indices', +// path: '/settings/apm-indices', // element, // }, // { -// path: '/customize-ui', +// path: '/settings/customize-ui', // element, // }, // { -// path: '/schema', +// path: '/settings/schema', // element, // }, // { -// path: '/anomaly-detection', +// path: '/settings/anomaly-detection', // element, // }, // { -// path: '/', +// path: '/settings', // element, // }, // ], @@ -346,15 +418,15 @@ type MapRoutes< // ]), // children: [ // { -// path: '/overview', +// path: '/services/:serviceName/overview', // element, // }, // { -// path: '/transactions', +// path: '/services/:serviceName/transactions', // element, // }, // { -// path: '/errors', +// path: '/services/:serviceName/errors', // element, // children: [ // { @@ -367,7 +439,7 @@ type MapRoutes< // }), // }, // { -// path: '/', +// path: '/services/:serviceName', // element, // params: t.partial({ // query: t.partial({ @@ -381,19 +453,19 @@ type MapRoutes< // ], // }, // { -// path: '/foo', +// path: '/services/:serviceName/foo', // element, // }, // { -// path: '/bar', +// path: '/services/:serviceName/bar', // element, // }, // { -// path: '/baz', +// path: '/services/:serviceName/baz', // element, // }, // { -// path: '/', +// path: '/services/:serviceName', // element, // }, // ], @@ -436,6 +508,7 @@ type MapRoutes< // type Bar = ValuesType>['route']['path']; // type Foo = OutputOf; +// type Baz = OutputOf; // const { path }: Foo = {} as any; diff --git a/packages/kbn-ui-framework/README.md b/packages/kbn-ui-framework/README.md index fe36d202c5fbe..820b272cd65cb 100644 --- a/packages/kbn-ui-framework/README.md +++ b/packages/kbn-ui-framework/README.md @@ -21,4 +21,7 @@ You can run `node scripts/jest --watch` to watch for changes and run the tests a You can run `node scripts/jest --coverage` to generate a code coverage report to see how fully-tested the code is. +You can run `node scripts/jest --config path/to/plugin/jest.config.js --coverage` to generate +a code coverage report for a single plugin. + See the documentation in [`scripts/jest.js`](../scripts/jest.js) for more options. \ No newline at end of file diff --git a/packages/kbn-ui-shared-deps/.babelrc b/packages/kbn-ui-shared-deps/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-ui-shared-deps/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-ui-shared-deps/src/entry.js b/packages/kbn-ui-shared-deps/src/entry.js index 20e26ca6a2864..7544e6953f3e9 100644 --- a/packages/kbn-ui-shared-deps/src/entry.js +++ b/packages/kbn-ui-shared-deps/src/entry.js @@ -55,3 +55,5 @@ export const KbnAnalytics = require('@kbn/analytics'); export const KbnStd = require('@kbn/std'); export const SaferLodashSet = require('@elastic/safer-lodash-set'); export const RisonNode = require('rison-node'); +export const History = require('history'); +export const Classnames = require('classnames'); diff --git a/packages/kbn-ui-shared-deps/src/index.js b/packages/kbn-ui-shared-deps/src/index.js index 291c7c471d27c..31e5e2c3b1e8e 100644 --- a/packages/kbn-ui-shared-deps/src/index.js +++ b/packages/kbn-ui-shared-deps/src/index.js @@ -100,6 +100,8 @@ exports.externals = { '@kbn/std': '__kbnSharedDeps__.KbnStd', '@elastic/safer-lodash-set': '__kbnSharedDeps__.SaferLodashSet', 'rison-node': '__kbnSharedDeps__.RisonNode', + history: '__kbnSharedDeps__.History', + classnames: '__kbnSharedDeps__.Classnames', }; /** diff --git a/packages/kbn-utility-types/.babelrc b/packages/kbn-utility-types/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-utility-types/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-utils/.babelrc b/packages/kbn-utils/.babelrc deleted file mode 100644 index 7da72d1779128..0000000000000 --- a/packages/kbn-utils/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@kbn/babel-preset/node_preset"] -} diff --git a/packages/kbn-utils/src/path/index.ts b/packages/kbn-utils/src/path/index.ts index 9835179a61e9d..9ee699c22c30c 100644 --- a/packages/kbn-utils/src/path/index.ts +++ b/packages/kbn-utils/src/path/index.ts @@ -15,24 +15,19 @@ const isString = (v: any): v is string => typeof v === 'string'; const CONFIG_PATHS = [ process.env.KBN_PATH_CONF && join(process.env.KBN_PATH_CONF, 'kibana.yml'), - process.env.KIBANA_PATH_CONF && join(process.env.KIBANA_PATH_CONF, 'kibana.yml'), - process.env.CONFIG_PATH, // deprecated + process.env.KIBANA_PATH_CONF && join(process.env.KIBANA_PATH_CONF, 'kibana.yml'), // deprecated join(REPO_ROOT, 'config/kibana.yml'), '/etc/kibana/kibana.yml', ].filter(isString); const CONFIG_DIRECTORIES = [ process.env.KBN_PATH_CONF, - process.env.KIBANA_PATH_CONF, + process.env.KIBANA_PATH_CONF, // deprecated join(REPO_ROOT, 'config'), '/etc/kibana', ].filter(isString); -const DATA_PATHS = [ - process.env.DATA_PATH, // deprecated - join(REPO_ROOT, 'data'), - '/var/lib/kibana', -].filter(isString); +const DATA_PATHS = [join(REPO_ROOT, 'data'), '/var/lib/kibana'].filter(isString); function findFile(paths: string[]) { const availablePath = paths.find((configPath) => { diff --git a/renovate.json5 b/renovate.json5 index b1464ad5040f0..602b8bc35f4a1 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -74,6 +74,21 @@ labels: ['Feature:Vega', 'Team:VisEditors'], enabled: true, }, + { + groupName: 'platform security modules', + packageNames: [ + 'broadcast-channel', + 'jsonwebtoken', '@types/jsonwebtoken', + 'node-forge', '@types/node-forge', + 'require-in-the-middle', + 'tough-cookie', '@types/tough-cookie', + 'xml-crypto', '@types/xml-crypto' + ], + reviewers: ['team:kibana-security'], + matchBaseBranches: ['master'], + labels: ['Team:Security', 'release_note:skip', 'auto-backport'], + enabled: true, + }, ], }, } diff --git a/rfcs/text/0007_lifecycle_unblocked.md b/rfcs/text/0007_lifecycle_unblocked.md index cb978d3dcd7ba..3f347891b2ba8 100644 --- a/rfcs/text/0007_lifecycle_unblocked.md +++ b/rfcs/text/0007_lifecycle_unblocked.md @@ -342,7 +342,6 @@ functions and will be impacted: 2. [tile_map](https://github.com/elastic/kibana/blob/6039709929caf0090a4130b8235f3a53bd04ed84/src/legacy/core_plugins/tile_map/public/plugin.ts#L62) 3. [vis_type_table](https://github.com/elastic/kibana/blob/6039709929caf0090a4130b8235f3a53bd04ed84/src/legacy/core_plugins/vis_type_table/public/plugin.ts#L61) 4. [vis_type_vega](https://github.com/elastic/kibana/blob/6039709929caf0090a4130b8235f3a53bd04ed84/src/legacy/core_plugins/vis_type_vega/public/plugin.ts#L59) -5. [timelion](https://github.com/elastic/kibana/blob/9d69b72a5f200e58220231035b19da852fc6b0a5/src/plugins/timelion/server/plugin.ts#L40) 6. [code](https://github.com/elastic/kibana/blob/5049b460b47d4ae3432e1d9219263bb4be441392/x-pack/legacy/plugins/code/server/plugin.ts#L129-L149) 7. [spaces](https://github.com/elastic/kibana/blob/096c7ee51136327f778845c636d7c4f1188e5db2/x-pack/legacy/plugins/spaces/server/new_platform/plugin.ts#L95) 8. [licensing](https://github.com/elastic/kibana/blob/4667c46caef26f8f47714504879197708debae32/x-pack/plugins/licensing/server/plugin.ts) diff --git a/scripts/functional_tests.js b/scripts/functional_tests.js index aa6e1831f5e71..032a28477bc90 100644 --- a/scripts/functional_tests.js +++ b/scripts/functional_tests.js @@ -13,7 +13,6 @@ const alwaysImportedTests = [ require.resolve('../test/ui_capabilities/newsfeed_err/config.ts'), require.resolve('../test/new_visualize_flow/config.ts'), require.resolve('../test/security_functional/config.ts'), - require.resolve('../test/functional/config.legacy.ts'), ]; // eslint-disable-next-line no-restricted-syntax const onlyNotInCoverageTests = [ diff --git a/scripts/kibana_verification_code.js b/scripts/kibana_verification_code.js new file mode 100644 index 0000000000000..42e3e54b9d4c8 --- /dev/null +++ b/scripts/kibana_verification_code.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 and the Server Side Public License, v 1; you may 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/cli_verification_code/dev'); diff --git a/src/cli_verification_code/cli_verification_code.js b/src/cli_verification_code/cli_verification_code.js new file mode 100644 index 0000000000000..7ed83e8211c3c --- /dev/null +++ b/src/cli_verification_code/cli_verification_code.js @@ -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 { kibanaPackageJson, getDataPath } from '@kbn/utils'; +import path from 'path'; +import fs from 'fs'; +import chalk from 'chalk'; + +import Command from '../cli/command'; + +const program = new Command('bin/kibana-verification-code'); + +program + .version(kibanaPackageJson.version) + .description('Tool to get Kibana verification code') + .action(() => { + const fpath = path.join(getDataPath(), 'verification_code'); + try { + const code = fs.readFileSync(fpath).toString(); + console.log( + `Your verification code is: ${chalk.black.bgCyanBright( + ` ${code.substr(0, 3)} ${code.substr(3)} ` + )}` + ); + } catch (error) { + console.log(`Couldn't find verification code. + +If Kibana hasn't been configured yet, restart Kibana to generate a new code. + +Otherwise, you can safely ignore this message and start using Kibana.`); + } + }); + +program.parse(process.argv); diff --git a/src/cli_verification_code/dev.js b/src/cli_verification_code/dev.js new file mode 100644 index 0000000000000..e424f6b7bec91 --- /dev/null +++ b/src/cli_verification_code/dev.js @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +require('../setup_node_env'); +require('./cli_verification_code'); diff --git a/src/cli_verification_code/dist.js b/src/cli_verification_code/dist.js new file mode 100644 index 0000000000000..6f7e63591a96d --- /dev/null +++ b/src/cli_verification_code/dist.js @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +require('../setup_node_env/dist'); +require('./cli_verification_code'); diff --git a/src/core/public/_variables.scss b/src/core/public/_variables.scss index f6ff5619bfc53..6c21c9760be97 100644 --- a/src/core/public/_variables.scss +++ b/src/core/public/_variables.scss @@ -1,7 +1,7 @@ @import '@elastic/eui/src/global_styling/variables/header'; // height of the header banner -$kbnHeaderBannerHeight: $euiSizeXL; +$kbnHeaderBannerHeight: $euiSizeXL; // This value is also declared in `/x-pack/plugins/canvas/common/lib/constants.ts` // total height of the header (when the banner is *not* present) $kbnHeaderOffset: $euiHeaderHeightCompensation * 2; // total height of the header when the banner is present diff --git a/src/core/public/chrome/chrome_service.mock.ts b/src/core/public/chrome/chrome_service.mock.ts index 347b81abf6d51..a92179ca9283c 100644 --- a/src/core/public/chrome/chrome_service.mock.ts +++ b/src/core/public/chrome/chrome_service.mock.ts @@ -54,6 +54,7 @@ const createStartContractMock = () => { getCustomNavLink$: jest.fn(), setCustomNavLink: jest.fn(), setHeaderBanner: jest.fn(), + hasHeaderBanner$: jest.fn(), getBodyClasses$: jest.fn(), }; startContract.navLinks.getAll.mockReturnValue([]); @@ -65,6 +66,7 @@ const createStartContractMock = () => { startContract.getHelpExtension$.mockReturnValue(new BehaviorSubject(undefined)); startContract.getIsNavDrawerLocked$.mockReturnValue(new BehaviorSubject(false)); startContract.getBodyClasses$.mockReturnValue(new BehaviorSubject([])); + startContract.hasHeaderBanner$.mockReturnValue(new BehaviorSubject(false)); return startContract; }; diff --git a/src/core/public/chrome/chrome_service.test.ts b/src/core/public/chrome/chrome_service.test.ts index 8df8d76a13c46..b3815c02674e1 100644 --- a/src/core/public/chrome/chrome_service.test.ts +++ b/src/core/public/chrome/chrome_service.test.ts @@ -390,6 +390,19 @@ describe('start', () => { }); }); + describe('header banner', () => { + it('updates/emits the state of the header banner', async () => { + const { chrome, service } = await start(); + const promise = chrome.hasHeaderBanner$().pipe(toArray()).toPromise(); + + chrome.setHeaderBanner({ content: () => () => undefined }); + chrome.setHeaderBanner(undefined); + service.stop(); + + await expect(promise).resolves.toEqual([false, true, false]); + }); + }); + describe('erase chrome fields', () => { it('while switching an app', async () => { const startDeps = defaultStartDeps([new FakeApp('alpha')]); diff --git a/src/core/public/chrome/chrome_service.tsx b/src/core/public/chrome/chrome_service.tsx index 5740e1739280a..8c8b264b094cc 100644 --- a/src/core/public/chrome/chrome_service.tsx +++ b/src/core/public/chrome/chrome_service.tsx @@ -273,6 +273,13 @@ export class ChromeService { headerBanner$.next(headerBanner); }, + hasHeaderBanner$: () => { + return headerBanner$.pipe( + takeUntil(this.stop$), + map((banner) => Boolean(banner)) + ); + }, + getBodyClasses$: () => bodyClasses$.pipe(takeUntil(this.stop$)), }; } diff --git a/src/core/public/chrome/types.ts b/src/core/public/chrome/types.ts index 813f385fc94d2..98987678d64cd 100644 --- a/src/core/public/chrome/types.ts +++ b/src/core/public/chrome/types.ts @@ -168,6 +168,11 @@ export interface ChromeStart { * @remarks Using `undefined` when invoking this API will remove the banner. */ setHeaderBanner(headerBanner?: ChromeUserBanner): void; + + /** + * Get an observable of the current header banner presence state. + */ + hasHeaderBanner$(): Observable; } /** @internal */ diff --git a/src/core/public/core_app/status/lib/load_status.test.ts b/src/core/public/core_app/status/lib/load_status.test.ts index e412192ea00ee..73c697c3d55aa 100644 --- a/src/core/public/core_app/status/lib/load_status.test.ts +++ b/src/core/public/core_app/status/lib/load_status.test.ts @@ -9,6 +9,7 @@ import { StatusResponse } from '../../../../types/status'; import { httpServiceMock } from '../../../http/http_service.mock'; import { notificationServiceMock } from '../../../notifications/notifications_service.mock'; +import { mocked } from '../../../../server/metrics/event_loop_delays/event_loop_delays_monitor.mocks'; import { loadStatus } from './load_status'; const mockedResponse: StatusResponse = { @@ -61,6 +62,7 @@ const mockedResponse: StatusResponse = { }, }, process: { + pid: 1, memory: { heap: { size_limit: 1000000, @@ -70,9 +72,25 @@ const mockedResponse: StatusResponse = { resident_set_size_in_bytes: 1, }, event_loop_delay: 1, - pid: 1, + event_loop_delay_histogram: mocked.createHistogram(), uptime_in_millis: 1, }, + processes: [ + { + pid: 1, + memory: { + heap: { + size_limit: 1000000, + used_in_bytes: 100, + total_in_bytes: 0, + }, + resident_set_size_in_bytes: 1, + }, + event_loop_delay: 1, + event_loop_delay_histogram: mocked.createHistogram(), + uptime_in_millis: 1, + }, + ], response_times: { avg_in_millis: 4000, max_in_millis: 8000, diff --git a/src/core/public/core_app/status/lib/load_status.ts b/src/core/public/core_app/status/lib/load_status.ts index a5cc18ffd6c16..e65764771f0fc 100644 --- a/src/core/public/core_app/status/lib/load_status.ts +++ b/src/core/public/core_app/status/lib/load_status.ts @@ -145,7 +145,7 @@ export async function loadStatus({ let response: StatusResponse; try { - response = await http.get('/api/status', { query: { v8format: true } }); + response = await http.get('/api/status'); } catch (e) { // API returns a 503 response if not all services are available. // In this case, we want to treat this as a successful API call, so that we can diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts index f3ef7c550e57d..72fa6c5553f77 100644 --- a/src/core/public/doc_links/doc_links_service.ts +++ b/src/core/public/doc_links/doc_links_service.ts @@ -24,6 +24,7 @@ export class DocLinksService { const KIBANA_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/`; const FLEET_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/fleet/${DOC_LINK_VERSION}/`; const PLUGIN_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/plugins/${DOC_LINK_VERSION}/`; + const APM_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/apm/`; return deepFreeze({ DOC_LINK_VERSION, @@ -33,6 +34,10 @@ export class DocLinksService { apm: { kibanaSettings: `${KIBANA_DOCS}apm-settings-in-kibana.html`, supportedServiceMaps: `${KIBANA_DOCS}service-maps.html#service-maps-supported`, + customLinks: `${KIBANA_DOCS}custom-links.html`, + droppedTransactionSpans: `${APM_DOCS}get-started/master/transaction-spans.html#dropped-spans`, + upgrading: `${APM_DOCS}server/master/upgrading.html`, + metaData: `${APM_DOCS}get-started/master/metadata.html`, }, canvas: { guide: `${KIBANA_DOCS}canvas.html`, @@ -268,7 +273,6 @@ export class DocLinksService { }, visualize: { guide: `${KIBANA_DOCS}dashboard.html`, - timelionDeprecation: `${KIBANA_DOCS}timelion.html`, lens: `${ELASTIC_WEBSITE_URL}what-is/kibana-lens`, lensPanels: `${KIBANA_DOCS}lens.html`, maps: `${ELASTIC_WEBSITE_URL}maps`, @@ -277,6 +281,13 @@ export class DocLinksService { }, observability: { guide: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/index.html`, + infrastructureThreshold: `{ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/infrastructure-threshold-alert.html`, + logsThreshold: `{ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/logs-threshold-alert.html`, + metricsThreshold: `{ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/metrics-threshold-alert.html`, + monitorStatus: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/monitor-status-alert.html`, + monitorUptime: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/monitor-uptime.html`, + tlsCertificate: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/tls-certificate-alert.html`, + uptimeDurationAnomaly: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/duration-anomaly-alert.html`, }, alerting: { guide: `${KIBANA_DOCS}create-and-manage-rules.html`, @@ -458,6 +469,10 @@ export interface DocLinksStart { readonly apm: { readonly kibanaSettings: string; readonly supportedServiceMaps: string; + readonly customLinks: string; + readonly droppedTransactionSpans: string; + readonly upgrading: string; + readonly metaData: string; }; readonly canvas: { readonly guide: string; @@ -630,7 +645,16 @@ export interface DocLinksStart { timeUnits: string; updateTransform: string; }>; - readonly observability: Record; + readonly observability: Readonly<{ + guide: string; + infrastructureThreshold: string; + logsThreshold: string; + metricsThreshold: string; + monitorStatus: string; + monitorUptime: string; + tlsCertificate: string; + uptimeDurationAnomaly: string; + }>; readonly alerting: Record; readonly maps: Record; readonly monitoring: Record; diff --git a/src/core/public/i18n/i18n_eui_mapping.tsx b/src/core/public/i18n/i18n_eui_mapping.tsx index 4175dac712e82..2fe9657bce8c9 100644 --- a/src/core/public/i18n/i18n_eui_mapping.tsx +++ b/src/core/public/i18n/i18n_eui_mapping.tsx @@ -218,11 +218,13 @@ export const getEuiContextMapping = (): EuiTokensObject => { 'euiColumnActions.hideColumn': i18n.translate('core.euiColumnActions.hideColumn', { defaultMessage: 'Hide column', }), - 'euiColumnActions.sort': ({ schemaLabel }: EuiValues) => - i18n.translate('core.euiColumnActions.sort', { - defaultMessage: 'Sort {schemaLabel}', - values: { schemaLabel }, - }), + 'euiColumnActions.sort': ({ schemaLabel }: EuiValues) => ( + + ), 'euiColumnActions.moveLeft': i18n.translate('core.euiColumnActions.moveLeft', { defaultMessage: 'Move left', }), diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index f18e1dc26bd87..8d3291d590476 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -355,6 +355,7 @@ export interface ChromeStart { getHelpExtension$(): Observable; getIsNavDrawerLocked$(): Observable; getIsVisible$(): Observable; + hasHeaderBanner$(): Observable; navControls: ChromeNavControls; navLinks: ChromeNavLinks; recentlyAccessed: ChromeRecentlyAccessed; @@ -476,6 +477,10 @@ export interface DocLinksStart { readonly apm: { readonly kibanaSettings: string; readonly supportedServiceMaps: string; + readonly customLinks: string; + readonly droppedTransactionSpans: string; + readonly upgrading: string; + readonly metaData: string; }; readonly canvas: { readonly guide: string; @@ -648,7 +653,16 @@ export interface DocLinksStart { timeUnits: string; updateTransform: string; }>; - readonly observability: Record; + readonly observability: Readonly<{ + guide: string; + infrastructureThreshold: string; + logsThreshold: string; + metricsThreshold: string; + monitorStatus: string; + monitorUptime: string; + tlsCertificate: string; + uptimeDurationAnomaly: string; + }>; readonly alerting: Record; readonly maps: Record; readonly monitoring: Record; diff --git a/src/core/public/rendering/_base.scss b/src/core/public/rendering/_base.scss index 92ba28ff70887..18e564abf822f 100644 --- a/src/core/public/rendering/_base.scss +++ b/src/core/public/rendering/_base.scss @@ -49,6 +49,12 @@ &.kbnBody--hasHeaderBanner { @include kbnAffordForHeader($kbnHeaderOffsetWithBanner); + + // Prevents banners from covering full screen data grids + .euiDataGrid--fullScreen { + height: calc(100vh - #{$kbnHeaderBannerHeight}); + top: $kbnHeaderBannerHeight; + } } &.kbnBody--chromeHidden { @include kbnAffordForHeader(0); diff --git a/src/core/server/config/deprecation/core_deprecations.test.ts b/src/core/server/config/deprecation/core_deprecations.test.ts index 759e2375ce987..d3a4d7f997062 100644 --- a/src/core/server/config/deprecation/core_deprecations.test.ts +++ b/src/core/server/config/deprecation/core_deprecations.test.ts @@ -18,37 +18,19 @@ describe('core deprecations', () => { process.env = { ...initialEnv }; }); - describe('configPath', () => { - it('logs a warning if CONFIG_PATH environ variable is set', () => { - process.env.CONFIG_PATH = 'somepath'; + describe('kibanaPathConf', () => { + it('logs a warning if KIBANA_PATH_CONF environ variable is set', () => { + process.env.KIBANA_PATH_CONF = 'somepath'; const { messages } = applyCoreDeprecations(); expect(messages).toMatchInlineSnapshot(` Array [ - "Environment variable \\"CONFIG_PATH\\" is deprecated. It has been replaced with \\"KBN_PATH_CONF\\" pointing to a config folder", + "Environment variable \\"KIBANA_PATH_CONF\\" is deprecated. It has been replaced with \\"KBN_PATH_CONF\\" pointing to a config folder", ] `); }); - it('does not log a warning if CONFIG_PATH environ variable is unset', () => { - delete process.env.CONFIG_PATH; - const { messages } = applyCoreDeprecations(); - expect(messages).toHaveLength(0); - }); - }); - - describe('dataPath', () => { - it('logs a warning if DATA_PATH environ variable is set', () => { - process.env.DATA_PATH = 'somepath'; - const { messages } = applyCoreDeprecations(); - expect(messages).toMatchInlineSnapshot(` - Array [ - "Environment variable \\"DATA_PATH\\" will be removed. It has been replaced with kibana.yml setting \\"path.data\\"", - ] - `); - }); - - it('does not log a warning if DATA_PATH environ variable is unset', () => { - delete process.env.DATA_PATH; + it('does not log a warning if KIBANA_PATH_CONF environ variable is unset', () => { + delete process.env.KIBANA_PATH_CONF; const { messages } = applyCoreDeprecations(); expect(messages).toHaveLength(0); }); diff --git a/src/core/server/config/deprecation/core_deprecations.ts b/src/core/server/config/deprecation/core_deprecations.ts index 222f92321d917..a929a937988e8 100644 --- a/src/core/server/config/deprecation/core_deprecations.ts +++ b/src/core/server/config/deprecation/core_deprecations.ts @@ -8,24 +8,13 @@ import { ConfigDeprecationProvider, ConfigDeprecation } from '@kbn/config'; -const configPathDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecation) => { - if (process.env?.CONFIG_PATH) { +const kibanaPathConf: ConfigDeprecation = (settings, fromPath, addDeprecation) => { + if (process.env?.KIBANA_PATH_CONF) { addDeprecation({ - message: `Environment variable "CONFIG_PATH" is deprecated. It has been replaced with "KBN_PATH_CONF" pointing to a config folder`, - correctiveActions: { - manualSteps: ['Use "KBN_PATH_CONF" instead of "CONFIG_PATH" to point to a config folder.'], - }, - }); - } -}; - -const dataPathDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecation) => { - if (process.env?.DATA_PATH) { - addDeprecation({ - message: `Environment variable "DATA_PATH" will be removed. It has been replaced with kibana.yml setting "path.data"`, + message: `Environment variable "KIBANA_PATH_CONF" is deprecated. It has been replaced with "KBN_PATH_CONF" pointing to a config folder`, correctiveActions: { manualSteps: [ - `Set 'path.data' in the config file or CLI flag with the value of the environment variable "DATA_PATH".`, + 'Use "KBN_PATH_CONF" instead of "KIBANA_PATH_CONF" to point to a config folder.', ], }, }); @@ -124,28 +113,6 @@ const cspRulesDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecati } }; -const mapManifestServiceUrlDeprecation: ConfigDeprecation = ( - settings, - fromPath, - addDeprecation -) => { - if (settings.map?.manifestServiceUrl) { - addDeprecation({ - message: - 'You should no longer use the map.manifestServiceUrl setting in kibana.yml to configure the location ' + - 'of the Elastic Maps Service settings. These settings have moved to the "map.emsTileApiUrl" and ' + - '"map.emsFileApiUrl" settings instead. These settings are for development use only and should not be ' + - 'modified for use in production environments.', - correctiveActions: { - manualSteps: [ - `Use "map.emsTileApiUrl" and "map.emsFileApiUrl" config instead of "map.manifestServiceUrl".`, - `These settings are for development use only and should not be modified for use in production environments.`, - ], - }, - }); - } -}; - const opsLoggingEventDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecation) => { if (settings.logging?.events?.ops) { addDeprecation({ @@ -388,7 +355,6 @@ const logFilterDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecat export const coreDeprecationProvider: ConfigDeprecationProvider = ({ rename, unusedFromRoot }) => [ unusedFromRoot('savedObjects.indexCheckTimeout'), unusedFromRoot('server.xsrf.token'), - unusedFromRoot('maps.manifestServiceUrl'), unusedFromRoot('optimize.lazy'), unusedFromRoot('optimize.lazyPort'), unusedFromRoot('optimize.lazyHost'), @@ -414,11 +380,9 @@ export const coreDeprecationProvider: ConfigDeprecationProvider = ({ rename, unu rename('cpuacct.cgroup.path.override', 'ops.cGroupOverrides.cpuAcctPath'), rename('server.xsrf.whitelist', 'server.xsrf.allowlist'), rewriteCorsSettings, - configPathDeprecation, - dataPathDeprecation, + kibanaPathConf, rewriteBasePathDeprecation, cspRulesDeprecation, - mapManifestServiceUrlDeprecation, opsLoggingEventDeprecation, requestLoggingEventDeprecation, timezoneLoggingDeprecation, diff --git a/src/core/server/core_usage_data/core_usage_data_service.mock.ts b/src/core/server/core_usage_data/core_usage_data_service.mock.ts index 941ac5afacb40..331a3bbb9c028 100644 --- a/src/core/server/core_usage_data/core_usage_data_service.mock.ts +++ b/src/core/server/core_usage_data/core_usage_data_service.mock.ts @@ -10,12 +10,14 @@ import { PublicMethodsOf } from '@kbn/utility-types'; import { BehaviorSubject } from 'rxjs'; import { CoreUsageDataService } from './core_usage_data_service'; import { coreUsageStatsClientMock } from './core_usage_stats_client.mock'; -import { CoreUsageData, CoreUsageDataSetup, CoreUsageDataStart } from './types'; +import { CoreUsageData, InternalCoreUsageDataSetup, CoreUsageDataStart } from './types'; const createSetupContractMock = (usageStatsClient = coreUsageStatsClientMock.create()) => { - const setupContract: jest.Mocked = { + const setupContract: jest.Mocked = { registerType: jest.fn(), getClient: jest.fn().mockReturnValue(usageStatsClient), + registerUsageCounter: jest.fn(), + incrementUsageCounter: jest.fn(), }; return setupContract; }; diff --git a/src/core/server/core_usage_data/core_usage_data_service.test.ts b/src/core/server/core_usage_data/core_usage_data_service.test.ts index 478cfe5daff46..3c05069d3cd07 100644 --- a/src/core/server/core_usage_data/core_usage_data_service.test.ts +++ b/src/core/server/core_usage_data/core_usage_data_service.test.ts @@ -150,6 +150,50 @@ describe('CoreUsageDataService', () => { expect(usageStatsClient).toBeInstanceOf(CoreUsageStatsClient); }); }); + + describe('Usage Counter', () => { + it('registers a usage counter and uses it to increment the counters', async () => { + const http = httpServiceMock.createInternalSetupContract(); + const metrics = metricsServiceMock.createInternalSetupContract(); + const savedObjectsStartPromise = Promise.resolve( + savedObjectsServiceMock.createStartContract() + ); + const changedDeprecatedConfigPath$ = configServiceMock.create().getDeprecatedConfigPath$(); + const coreUsageData = service.setup({ + http, + metrics, + savedObjectsStartPromise, + changedDeprecatedConfigPath$, + }); + const myUsageCounter = { incrementCounter: jest.fn() }; + coreUsageData.registerUsageCounter(myUsageCounter); + coreUsageData.incrementUsageCounter({ counterName: 'test' }); + expect(myUsageCounter.incrementCounter).toHaveBeenCalledWith({ counterName: 'test' }); + }); + + it('swallows errors when provided increment counter fails', async () => { + const http = httpServiceMock.createInternalSetupContract(); + const metrics = metricsServiceMock.createInternalSetupContract(); + const savedObjectsStartPromise = Promise.resolve( + savedObjectsServiceMock.createStartContract() + ); + const changedDeprecatedConfigPath$ = configServiceMock.create().getDeprecatedConfigPath$(); + const coreUsageData = service.setup({ + http, + metrics, + savedObjectsStartPromise, + changedDeprecatedConfigPath$, + }); + const myUsageCounter = { + incrementCounter: jest.fn(() => { + throw new Error('Something is really wrong'); + }), + }; + coreUsageData.registerUsageCounter(myUsageCounter); + expect(() => coreUsageData.incrementUsageCounter({ counterName: 'test' })).not.toThrow(); + expect(myUsageCounter.incrementCounter).toHaveBeenCalledWith({ counterName: 'test' }); + }); + }); }); describe('start', () => { diff --git a/src/core/server/core_usage_data/core_usage_data_service.ts b/src/core/server/core_usage_data/core_usage_data_service.ts index 73f63d4d634df..ce9013d9437d6 100644 --- a/src/core/server/core_usage_data/core_usage_data_service.ts +++ b/src/core/server/core_usage_data/core_usage_data_service.ts @@ -27,7 +27,7 @@ import type { CoreServicesUsageData, CoreUsageData, CoreUsageDataStart, - CoreUsageDataSetup, + InternalCoreUsageDataSetup, ConfigUsageData, CoreConfigUsageData, } from './types'; @@ -39,6 +39,7 @@ import { LEGACY_URL_ALIAS_TYPE } from '../saved_objects/object_types'; import { CORE_USAGE_STATS_TYPE } from './constants'; import { CoreUsageStatsClient } from './core_usage_stats_client'; import { MetricsServiceSetup, OpsMetrics } from '..'; +import { CoreIncrementUsageCounter } from './types'; export type ExposedConfigsToUsage = Map>; @@ -86,7 +87,8 @@ const isCustomIndex = (index: string) => { return index !== '.kibana'; }; -export class CoreUsageDataService implements CoreService { +export class CoreUsageDataService + implements CoreService { private logger: Logger; private elasticsearchConfig?: ElasticsearchConfigType; private configService: CoreContext['configService']; @@ -98,6 +100,7 @@ export class CoreUsageDataService implements CoreService {}; // Initially set to noop constructor(core: CoreContext) { this.logger = core.logger.get('core-usage-stats-service'); @@ -495,7 +498,24 @@ export class CoreUsageDataService implements CoreService { + this.incrementUsageCounter = (params) => usageCounter.incrementCounter(params); + }, + incrementUsageCounter: (params) => { + try { + this.incrementUsageCounter(params); + } catch (e) { + // Self-defense mechanism since the handler is externally registered + this.logger.debug('Failed to increase the usage counter'); + this.logger.debug(e); + } + }, + }; + + return contract; } start({ savedObjects, elasticsearch, exposedConfigsToUsage }: StartDeps) { diff --git a/src/core/server/core_usage_data/core_usage_stats_client.mock.ts b/src/core/server/core_usage_data/core_usage_stats_client.mock.ts index 1c9c0b8fae579..35471234676b1 100644 --- a/src/core/server/core_usage_data/core_usage_stats_client.mock.ts +++ b/src/core/server/core_usage_data/core_usage_stats_client.mock.ts @@ -23,6 +23,8 @@ const createUsageStatsClientMock = () => incrementSavedObjectsImport: jest.fn().mockResolvedValue(null), incrementSavedObjectsResolveImportErrors: jest.fn().mockResolvedValue(null), incrementSavedObjectsExport: jest.fn().mockResolvedValue(null), + incrementLegacyDashboardsImport: jest.fn().mockResolvedValue(null), + incrementLegacyDashboardsExport: jest.fn().mockResolvedValue(null), } as unknown) as jest.Mocked); export const coreUsageStatsClientMock = { diff --git a/src/core/server/core_usage_data/core_usage_stats_client.test.ts b/src/core/server/core_usage_data/core_usage_stats_client.test.ts index 384e3d7b932c1..d14c248bfa1b7 100644 --- a/src/core/server/core_usage_data/core_usage_stats_client.test.ts +++ b/src/core/server/core_usage_data/core_usage_stats_client.test.ts @@ -25,6 +25,8 @@ import { IMPORT_STATS_PREFIX, RESOLVE_IMPORT_STATS_PREFIX, EXPORT_STATS_PREFIX, + LEGACY_DASHBOARDS_IMPORT_STATS_PREFIX, + LEGACY_DASHBOARDS_EXPORT_STATS_PREFIX, } from './core_usage_stats_client'; import { CoreUsageStatsClient } from '.'; import { DEFAULT_NAMESPACE_STRING } from '../saved_objects/service/lib/utils'; @@ -1007,4 +1009,114 @@ describe('CoreUsageStatsClient', () => { ); }); }); + + describe('#incrementLegacyDashboardsImport', () => { + it('does not throw an error if repository incrementCounter operation fails', async () => { + const { usageStatsClient, repositoryMock } = setup(); + repositoryMock.incrementCounter.mockRejectedValue(new Error('Oh no!')); + + const request = httpServerMock.createKibanaRequest(); + await expect( + usageStatsClient.incrementLegacyDashboardsImport({ + request, + } as IncrementSavedObjectsExportOptions) + ).resolves.toBeUndefined(); + expect(repositoryMock.incrementCounter).toHaveBeenCalled(); + }); + + it('handles the default namespace string and first party request appropriately', async () => { + const { usageStatsClient, repositoryMock } = setup(DEFAULT_NAMESPACE_STRING); + + const request = httpServerMock.createKibanaRequest({ headers: firstPartyRequestHeaders }); + await usageStatsClient.incrementLegacyDashboardsImport({ + request, + } as IncrementSavedObjectsExportOptions); + expect(repositoryMock.incrementCounter).toHaveBeenCalledTimes(1); + expect(repositoryMock.incrementCounter).toHaveBeenCalledWith( + CORE_USAGE_STATS_TYPE, + CORE_USAGE_STATS_ID, + [ + `${LEGACY_DASHBOARDS_IMPORT_STATS_PREFIX}.total`, + `${LEGACY_DASHBOARDS_IMPORT_STATS_PREFIX}.namespace.default.total`, + `${LEGACY_DASHBOARDS_IMPORT_STATS_PREFIX}.namespace.default.kibanaRequest.yes`, + ], + incrementOptions + ); + }); + + it('handles a non-default space and and third party request appropriately', async () => { + const { usageStatsClient, repositoryMock } = setup('foo'); + + const request = httpServerMock.createKibanaRequest(); + await usageStatsClient.incrementLegacyDashboardsImport({ + request, + } as IncrementSavedObjectsExportOptions); + expect(repositoryMock.incrementCounter).toHaveBeenCalledTimes(1); + expect(repositoryMock.incrementCounter).toHaveBeenCalledWith( + CORE_USAGE_STATS_TYPE, + CORE_USAGE_STATS_ID, + [ + `${LEGACY_DASHBOARDS_IMPORT_STATS_PREFIX}.total`, + `${LEGACY_DASHBOARDS_IMPORT_STATS_PREFIX}.namespace.custom.total`, + `${LEGACY_DASHBOARDS_IMPORT_STATS_PREFIX}.namespace.custom.kibanaRequest.no`, + ], + incrementOptions + ); + }); + }); + + describe('#incrementLegacyDashboardsExport', () => { + it('does not throw an error if repository incrementCounter operation fails', async () => { + const { usageStatsClient, repositoryMock } = setup(); + repositoryMock.incrementCounter.mockRejectedValue(new Error('Oh no!')); + + const request = httpServerMock.createKibanaRequest(); + await expect( + usageStatsClient.incrementLegacyDashboardsExport({ + request, + } as IncrementSavedObjectsExportOptions) + ).resolves.toBeUndefined(); + expect(repositoryMock.incrementCounter).toHaveBeenCalled(); + }); + + it('handles the default namespace string and first party request appropriately', async () => { + const { usageStatsClient, repositoryMock } = setup(DEFAULT_NAMESPACE_STRING); + + const request = httpServerMock.createKibanaRequest({ headers: firstPartyRequestHeaders }); + await usageStatsClient.incrementLegacyDashboardsExport({ + request, + } as IncrementSavedObjectsExportOptions); + expect(repositoryMock.incrementCounter).toHaveBeenCalledTimes(1); + expect(repositoryMock.incrementCounter).toHaveBeenCalledWith( + CORE_USAGE_STATS_TYPE, + CORE_USAGE_STATS_ID, + [ + `${LEGACY_DASHBOARDS_EXPORT_STATS_PREFIX}.total`, + `${LEGACY_DASHBOARDS_EXPORT_STATS_PREFIX}.namespace.default.total`, + `${LEGACY_DASHBOARDS_EXPORT_STATS_PREFIX}.namespace.default.kibanaRequest.yes`, + ], + incrementOptions + ); + }); + + it('handles a non-default space and and third party request appropriately', async () => { + const { usageStatsClient, repositoryMock } = setup('foo'); + + const request = httpServerMock.createKibanaRequest(); + await usageStatsClient.incrementLegacyDashboardsExport({ + request, + } as IncrementSavedObjectsExportOptions); + expect(repositoryMock.incrementCounter).toHaveBeenCalledTimes(1); + expect(repositoryMock.incrementCounter).toHaveBeenCalledWith( + CORE_USAGE_STATS_TYPE, + CORE_USAGE_STATS_ID, + [ + `${LEGACY_DASHBOARDS_EXPORT_STATS_PREFIX}.total`, + `${LEGACY_DASHBOARDS_EXPORT_STATS_PREFIX}.namespace.custom.total`, + `${LEGACY_DASHBOARDS_EXPORT_STATS_PREFIX}.namespace.custom.kibanaRequest.no`, + ], + incrementOptions + ); + }); + }); }); diff --git a/src/core/server/core_usage_data/core_usage_stats_client.ts b/src/core/server/core_usage_data/core_usage_stats_client.ts index 29d6e875c7962..fb5340f164207 100644 --- a/src/core/server/core_usage_data/core_usage_stats_client.ts +++ b/src/core/server/core_usage_data/core_usage_stats_client.ts @@ -45,6 +45,9 @@ export const UPDATE_STATS_PREFIX = 'apiCalls.savedObjectsUpdate'; export const IMPORT_STATS_PREFIX = 'apiCalls.savedObjectsImport'; export const RESOLVE_IMPORT_STATS_PREFIX = 'apiCalls.savedObjectsResolveImportErrors'; export const EXPORT_STATS_PREFIX = 'apiCalls.savedObjectsExport'; +export const LEGACY_DASHBOARDS_IMPORT_STATS_PREFIX = 'apiCalls.legacyDashboardImport'; +export const LEGACY_DASHBOARDS_EXPORT_STATS_PREFIX = 'apiCalls.legacyDashboardExport'; + export const REPOSITORY_RESOLVE_OUTCOME_STATS = { EXACT_MATCH: 'savedObjectsRepository.resolvedOutcome.exactMatch', ALIAS_MATCH: 'savedObjectsRepository.resolvedOutcome.aliasMatch', @@ -73,6 +76,8 @@ const ALL_COUNTER_FIELDS = [ `${RESOLVE_IMPORT_STATS_PREFIX}.createNewCopiesEnabled.yes`, `${RESOLVE_IMPORT_STATS_PREFIX}.createNewCopiesEnabled.no`, ...getFieldsForCounter(EXPORT_STATS_PREFIX), + ...getFieldsForCounter(LEGACY_DASHBOARDS_IMPORT_STATS_PREFIX), + ...getFieldsForCounter(LEGACY_DASHBOARDS_EXPORT_STATS_PREFIX), `${EXPORT_STATS_PREFIX}.allTypesSelected.yes`, `${EXPORT_STATS_PREFIX}.allTypesSelected.no`, // Saved Objects Repository counters; these are included here for stats collection, but are incremented in the repository itself @@ -170,6 +175,14 @@ export class CoreUsageStatsClient { await this.updateUsageStats(counterFieldNames, EXPORT_STATS_PREFIX, options); } + public async incrementLegacyDashboardsImport(options: BaseIncrementOptions) { + await this.updateUsageStats([], LEGACY_DASHBOARDS_IMPORT_STATS_PREFIX, options); + } + + public async incrementLegacyDashboardsExport(options: BaseIncrementOptions) { + await this.updateUsageStats([], LEGACY_DASHBOARDS_EXPORT_STATS_PREFIX, options); + } + private async updateUsageStats( counterFieldNames: string[], prefix: string, diff --git a/src/core/server/core_usage_data/index.ts b/src/core/server/core_usage_data/index.ts index a5c62c75f62d5..4687446bdb3a3 100644 --- a/src/core/server/core_usage_data/index.ts +++ b/src/core/server/core_usage_data/index.ts @@ -7,7 +7,15 @@ */ export { CORE_USAGE_STATS_TYPE, CORE_USAGE_STATS_ID } from './constants'; -export type { CoreUsageDataSetup, ConfigUsageData, CoreUsageDataStart } from './types'; +export type { + InternalCoreUsageDataSetup, + ConfigUsageData, + CoreUsageDataStart, + CoreUsageDataSetup, + CoreUsageCounter, + CoreIncrementUsageCounter, + CoreIncrementCounterParams, +} from './types'; export { CoreUsageDataService } from './core_usage_data_service'; export { CoreUsageStatsClient, REPOSITORY_RESOLVE_OUTCOME_STATS } from './core_usage_stats_client'; diff --git a/src/core/server/core_usage_data/types.ts b/src/core/server/core_usage_data/types.ts index 563a2a337cc8d..006f9848e8f3e 100644 --- a/src/core/server/core_usage_data/types.ts +++ b/src/core/server/core_usage_data/types.ts @@ -110,6 +110,21 @@ export interface CoreUsageStats { 'apiCalls.savedObjectsExport.namespace.custom.kibanaRequest.no'?: number; 'apiCalls.savedObjectsExport.allTypesSelected.yes'?: number; 'apiCalls.savedObjectsExport.allTypesSelected.no'?: number; + // Legacy Dashboard Import/Export API + 'apiCalls.legacyDashboardExport.total'?: number; + 'apiCalls.legacyDashboardExport.namespace.default.total'?: number; + 'apiCalls.legacyDashboardExport.namespace.default.kibanaRequest.yes'?: number; + 'apiCalls.legacyDashboardExport.namespace.default.kibanaRequest.no'?: number; + 'apiCalls.legacyDashboardExport.namespace.custom.total'?: number; + 'apiCalls.legacyDashboardExport.namespace.custom.kibanaRequest.yes'?: number; + 'apiCalls.legacyDashboardExport.namespace.custom.kibanaRequest.no'?: number; + 'apiCalls.legacyDashboardImport.total'?: number; + 'apiCalls.legacyDashboardImport.namespace.default.total'?: number; + 'apiCalls.legacyDashboardImport.namespace.default.kibanaRequest.yes'?: number; + 'apiCalls.legacyDashboardImport.namespace.default.kibanaRequest.no'?: number; + 'apiCalls.legacyDashboardImport.namespace.custom.total'?: number; + 'apiCalls.legacyDashboardImport.namespace.custom.kibanaRequest.yes'?: number; + 'apiCalls.legacyDashboardImport.namespace.custom.kibanaRequest.no'?: number; // Saved Objects Repository counters 'savedObjectsRepository.resolvedOutcome.exactMatch'?: number; 'savedObjectsRepository.resolvedOutcome.aliasMatch'?: number; @@ -280,12 +295,59 @@ export interface CoreConfigUsageData { }; } +/** + * @internal Details about the counter to be incremented + */ +export interface CoreIncrementCounterParams { + /** The name of the counter **/ + counterName: string; + /** The counter type ("count" by default) **/ + counterType?: string; + /** Increment the counter by this number (1 if not specified) **/ + incrementBy?: number; +} + +/** + * @internal + * Method to call whenever an event occurs, so the counter can be increased. + */ +export type CoreIncrementUsageCounter = (params: CoreIncrementCounterParams) => void; + +/** + * @internal + * API to track whenever an event occurs, so the core can report them. + */ +export interface CoreUsageCounter { + /** @internal {@link CoreIncrementUsageCounter} **/ + incrementCounter: CoreIncrementUsageCounter; +} + /** @internal */ -export interface CoreUsageDataSetup { +export interface InternalCoreUsageDataSetup extends CoreUsageDataSetup { registerType( typeRegistry: ISavedObjectTypeRegistry & Pick ): void; getClient(): CoreUsageStatsClient; + + /** @internal {@link CoreIncrementUsageCounter} **/ + incrementUsageCounter: CoreIncrementUsageCounter; +} + +/** + * Internal API for registering the Usage Tracker used for Core's usage data payload. + * + * @note This API should never be used to drive application logic and is only + * intended for telemetry purposes. + * + * @internal + */ +export interface CoreUsageDataSetup { + /** + * @internal + * API for a usage tracker plugin to inject the {@link CoreUsageCounter} to use + * when tracking events. + */ + registerUsageCounter: (usageCounter: CoreUsageCounter) => void; } /** diff --git a/src/core/server/deprecations/README.mdx b/src/core/server/deprecations/README.mdx index 197b25ac909c3..533f607c3d4c2 100644 --- a/src/core/server/deprecations/README.mdx +++ b/src/core/server/deprecations/README.mdx @@ -139,7 +139,6 @@ Plugins are responsible for registering any deprecations during the `setup` life the deprecations service. Examples of non-config deprecations include things like -- timelion sheets - kibana_user security roles This service is not intended to be used for non-user facing deprecations or cases where the deprecation diff --git a/src/core/server/deprecations/deprecations_service.test.ts b/src/core/server/deprecations/deprecations_service.test.ts index 0e8aaf3de49c9..bc0dbcef4a5b6 100644 --- a/src/core/server/deprecations/deprecations_service.test.ts +++ b/src/core/server/deprecations/deprecations_service.test.ts @@ -66,7 +66,7 @@ describe('DeprecationsService', () => { const deprecationsRegistry = mockDeprecationsRegistry.create(); const getDeprecationsContext = mockDeprecationsRegistry.createGetDeprecationsContext(); - it('registers config deprecations', () => { + it('registers config deprecations', async () => { const deprecationsService = new DeprecationsService(coreContext); coreContext.configService.getHandledDeprecatedConfigs.mockReturnValue([ [ @@ -93,7 +93,7 @@ describe('DeprecationsService', () => { expect(deprecationsFactory.getRegistry).toBeCalledTimes(1); expect(deprecationsFactory.getRegistry).toBeCalledWith('testDomain'); expect(deprecationsRegistry.registerDeprecations).toBeCalledTimes(1); - const configDeprecations = deprecationsRegistry.registerDeprecations.mock.calls[0][0].getDeprecations( + const configDeprecations = await deprecationsRegistry.registerDeprecations.mock.calls[0][0].getDeprecations( getDeprecationsContext ); expect(configDeprecations).toMatchInlineSnapshot(` @@ -115,5 +115,31 @@ describe('DeprecationsService', () => { ] `); }); + + it('accepts `level` field overrides', async () => { + const deprecationsService = new DeprecationsService(coreContext); + coreContext.configService.getHandledDeprecatedConfigs.mockReturnValue([ + [ + 'testDomain', + [ + { + message: 'testMessage', + level: 'warning', + correctiveActions: { + manualSteps: ['step a'], + }, + }, + ], + ], + ]); + + deprecationsFactory.getRegistry.mockReturnValue(deprecationsRegistry); + deprecationsService['registerConfigDeprecationsInfo'](deprecationsFactory); + + const configDeprecations = await deprecationsRegistry.registerDeprecations.mock.calls[0][0].getDeprecations( + getDeprecationsContext + ); + expect(configDeprecations[0].level).toBe('warning'); + }); }); }); diff --git a/src/core/server/deprecations/deprecations_service.ts b/src/core/server/deprecations/deprecations_service.ts index c41567d88a2aa..bc981c21ba975 100644 --- a/src/core/server/deprecations/deprecations_service.ts +++ b/src/core/server/deprecations/deprecations_service.ts @@ -37,28 +37,26 @@ import { SavedObjectsClientContract } from '../saved_objects/types'; * * async function getDeprecations({ esClient, savedObjectsClient }: GetDeprecationsContext): Promise { * const deprecations: DeprecationsDetails[] = []; - * const count = await getTimelionSheetsCount(savedObjectsClient); - * + * const count = await getFooCount(savedObjectsClient); * if (count > 0) { - * // Example of a manual correctiveAction * deprecations.push({ - * title: i18n.translate('xpack.timelion.deprecations.worksheetsTitle', { - * defaultMessage: 'Timelion worksheets are deprecated' + * title: i18n.translate('xpack.foo.deprecations.title', { + * defaultMessage: `Foo's are deprecated` * }), - * message: i18n.translate('xpack.timelion.deprecations.worksheetsMessage', { - * defaultMessage: 'You have {count} Timelion worksheets. Migrate your Timelion worksheets to a dashboard to continue using them.', + * message: i18n.translate('xpack.foo.deprecations.message', { + * defaultMessage: `You have {count} Foo's. Migrate your Foo's to a dashboard to continue using them.`, * values: { count }, * }), * documentationUrl: - * 'https://www.elastic.co/guide/en/kibana/current/create-panels-with-timelion.html', + * 'https://www.elastic.co/guide/en/kibana/current/foo.html', * level: 'warning', * correctiveActions: { * manualSteps: [ - * i18n.translate('xpack.timelion.deprecations.worksheets.manualStepOneMessage', { + * i18n.translate('xpack.foo.deprecations.manualStepOneMessage', { * defaultMessage: 'Navigate to the Kibana Dashboard and click "Create dashboard".', * }), - * i18n.translate('xpack.timelion.deprecations.worksheets.manualStepTwoMessage', { - * defaultMessage: 'Select Timelion from the "New Visualization" window.', + * i18n.translate('xpack.foo.deprecations.manualStepTwoMessage', { + * defaultMessage: 'Select Foo from the "New Visualization" window.', * }), * ], * api: { @@ -186,17 +184,21 @@ export class DeprecationsService deprecationsRegistry.registerDeprecations({ getDeprecations: () => { return deprecationsContexts.map( - ({ title, message, correctiveActions, documentationUrl }) => { - return { - title: title || `${domainId} has a deprecated setting`, - level: 'critical', - deprecationType: 'config', - message, - correctiveActions, - documentationUrl, - requireRestart: true, - }; - } + ({ + title = `${domainId} has a deprecated setting`, + level = 'critical', + message, + correctiveActions, + documentationUrl, + }) => ({ + title, + level, + message, + correctiveActions, + documentationUrl, + deprecationType: 'config', + requireRestart: true, + }) ); }, }); diff --git a/src/core/server/elasticsearch/deprecations/deprecation_provider.ts b/src/core/server/elasticsearch/deprecations/deprecation_provider.ts new file mode 100644 index 0000000000000..d085af0d96008 --- /dev/null +++ b/src/core/server/elasticsearch/deprecations/deprecation_provider.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 type { RegisterDeprecationsConfig } from '../../deprecations'; +import { getScriptingDisabledDeprecations } from './scripting_disabled_deprecation'; + +export const getElasticsearchDeprecationsProvider = (): RegisterDeprecationsConfig => { + return { + getDeprecations: async (context) => { + return [...(await getScriptingDisabledDeprecations({ esClient: context.esClient }))]; + }, + }; +}; diff --git a/src/core/server/elasticsearch/deprecations/index.ts b/src/core/server/elasticsearch/deprecations/index.ts new file mode 100644 index 0000000000000..4f67c0103b0a1 --- /dev/null +++ b/src/core/server/elasticsearch/deprecations/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 { getElasticsearchDeprecationsProvider } from './deprecation_provider'; diff --git a/src/core/server/elasticsearch/deprecations/is_scripting_disabled.test.ts b/src/core/server/elasticsearch/deprecations/is_scripting_disabled.test.ts new file mode 100644 index 0000000000000..90c5f022bd41c --- /dev/null +++ b/src/core/server/elasticsearch/deprecations/is_scripting_disabled.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { estypes } from '@elastic/elasticsearch'; +import { elasticsearchServiceMock } from '../../elasticsearch/elasticsearch_service.mock'; +import { isInlineScriptingDisabled } from './is_scripting_disabled'; + +describe('isInlineScriptingDisabled', () => { + let client: ReturnType; + + beforeEach(() => { + client = elasticsearchServiceMock.createElasticsearchClient(); + }); + + const mockSettingsValue = (settings: estypes.ClusterGetSettingsResponse) => { + client.cluster.getSettings.mockReturnValue( + elasticsearchServiceMock.createSuccessTransportRequestPromise(settings) + ); + }; + + it('returns `false` if all settings are empty', async () => { + mockSettingsValue({ + transient: {}, + persistent: {}, + defaults: {}, + }); + + expect(await isInlineScriptingDisabled({ client })).toEqual(false); + }); + + it('returns `false` if `defaults.script.allowed_types` is `inline`', async () => { + mockSettingsValue({ + transient: {}, + persistent: {}, + defaults: { + 'script.allowed_types': ['inline'], + }, + }); + + expect(await isInlineScriptingDisabled({ client })).toEqual(false); + }); + + it('returns `true` if `defaults.script.allowed_types` is `none`', async () => { + mockSettingsValue({ + transient: {}, + persistent: {}, + defaults: { + 'script.allowed_types': ['none'], + }, + }); + + expect(await isInlineScriptingDisabled({ client })).toEqual(true); + }); + + it('returns `true` if `defaults.script.allowed_types` is `stored`', async () => { + mockSettingsValue({ + transient: {}, + persistent: {}, + defaults: { + 'script.allowed_types': ['stored'], + }, + }); + + expect(await isInlineScriptingDisabled({ client })).toEqual(true); + }); + + it('respect the persistent->defaults priority', async () => { + mockSettingsValue({ + transient: {}, + persistent: { + 'script.allowed_types': ['inline'], + }, + defaults: { + 'script.allowed_types': ['stored'], + }, + }); + + expect(await isInlineScriptingDisabled({ client })).toEqual(false); + }); + + it('respect the transient->persistent priority', async () => { + mockSettingsValue({ + transient: { + 'script.allowed_types': ['stored'], + }, + persistent: { + 'script.allowed_types': ['inline'], + }, + defaults: {}, + }); + + expect(await isInlineScriptingDisabled({ client })).toEqual(true); + }); +}); diff --git a/src/core/server/elasticsearch/deprecations/is_scripting_disabled.ts b/src/core/server/elasticsearch/deprecations/is_scripting_disabled.ts new file mode 100644 index 0000000000000..9f140c71da8a0 --- /dev/null +++ b/src/core/server/elasticsearch/deprecations/is_scripting_disabled.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { ElasticsearchClient } from '../../elasticsearch'; + +const scriptAllowedTypesKey = 'script.allowed_types'; + +export const isInlineScriptingDisabled = async ({ + client, +}: { + client: ElasticsearchClient; +}): Promise => { + const { body: settings } = await client.cluster.getSettings({ + include_defaults: true, + flat_settings: true, + }); + + // priority: transient -> persistent -> default + const scriptAllowedTypes: string[] = + settings.transient[scriptAllowedTypesKey] ?? + settings.persistent[scriptAllowedTypesKey] ?? + settings.defaults![scriptAllowedTypesKey] ?? + []; + + // when unspecified, the setting as a default `[]` value that means that both scriptings are allowed. + const scriptAllowed = scriptAllowedTypes.length === 0 || scriptAllowedTypes.includes('inline'); + + return !scriptAllowed; +}; diff --git a/src/core/server/elasticsearch/deprecations/scripting_disabled_deprecation.test.mocks.ts b/src/core/server/elasticsearch/deprecations/scripting_disabled_deprecation.test.mocks.ts new file mode 100644 index 0000000000000..3c78d2e4ab9f7 --- /dev/null +++ b/src/core/server/elasticsearch/deprecations/scripting_disabled_deprecation.test.mocks.ts @@ -0,0 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export const isInlineScriptingDisabledMock = jest.fn(); +jest.doMock('./is_scripting_disabled', () => ({ + isInlineScriptingDisabled: isInlineScriptingDisabledMock, +})); diff --git a/src/core/server/elasticsearch/deprecations/scripting_disabled_deprecation.test.ts b/src/core/server/elasticsearch/deprecations/scripting_disabled_deprecation.test.ts new file mode 100644 index 0000000000000..1be73310be691 --- /dev/null +++ b/src/core/server/elasticsearch/deprecations/scripting_disabled_deprecation.test.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { isInlineScriptingDisabledMock } from './scripting_disabled_deprecation.test.mocks'; +import { elasticsearchServiceMock } from '../../elasticsearch/elasticsearch_service.mock'; +import { getScriptingDisabledDeprecations } from './scripting_disabled_deprecation'; + +describe('getScriptingDisabledDeprecations', () => { + let esClient: ReturnType; + + beforeEach(() => { + esClient = elasticsearchServiceMock.createScopedClusterClient(); + }); + + afterEach(() => { + isInlineScriptingDisabledMock.mockReset(); + }); + + it('calls `isInlineScriptingDisabled` with the correct arguments', async () => { + await getScriptingDisabledDeprecations({ + esClient, + }); + + expect(isInlineScriptingDisabledMock).toHaveBeenCalledTimes(1); + expect(isInlineScriptingDisabledMock).toHaveBeenCalledWith({ + client: esClient.asInternalUser, + }); + }); + + it('returns no deprecations if scripting is not disabled', async () => { + isInlineScriptingDisabledMock.mockResolvedValue(false); + + const deprecations = await getScriptingDisabledDeprecations({ + esClient, + }); + + expect(deprecations).toHaveLength(0); + }); + + it('returns a deprecation if scripting is disabled', async () => { + isInlineScriptingDisabledMock.mockResolvedValue(true); + + const deprecations = await getScriptingDisabledDeprecations({ + esClient, + }); + + expect(deprecations).toHaveLength(1); + expect(deprecations[0]).toEqual({ + title: expect.any(String), + message: expect.any(String), + level: 'critical', + requireRestart: false, + correctiveActions: { + manualSteps: expect.any(Array), + }, + }); + }); +}); diff --git a/src/core/server/elasticsearch/deprecations/scripting_disabled_deprecation.ts b/src/core/server/elasticsearch/deprecations/scripting_disabled_deprecation.ts new file mode 100644 index 0000000000000..d1e64b8faeeab --- /dev/null +++ b/src/core/server/elasticsearch/deprecations/scripting_disabled_deprecation.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 { i18n } from '@kbn/i18n'; +import type { DeprecationsDetails } from '../../deprecations'; +import { IScopedClusterClient } from '../../elasticsearch'; +import { isInlineScriptingDisabled } from './is_scripting_disabled'; + +interface GetScriptingDisabledDeprecations { + esClient: IScopedClusterClient; +} + +export const getScriptingDisabledDeprecations = async ({ + esClient, +}: GetScriptingDisabledDeprecations): Promise => { + const deprecations: DeprecationsDetails[] = []; + if (await isInlineScriptingDisabled({ client: esClient.asInternalUser })) { + deprecations.push({ + title: i18n.translate('core.elasticsearch.deprecations.scriptingDisabled.title', { + defaultMessage: 'Inline scripting is disabled on elasticsearch', + }), + message: i18n.translate('core.elasticsearch.deprecations.scriptingDisabled.message', { + defaultMessage: + 'Starting in 8.0, Kibana will require inline scripting to be enabled,' + + 'and will fail to start otherwise.', + }), + level: 'critical', + requireRestart: false, + correctiveActions: { + manualSteps: [ + i18n.translate('core.elasticsearch.deprecations.scriptingDisabled.manualSteps.1', { + defaultMessage: 'Set `script.allowed_types=inline` in your elasticsearch config ', + }), + ], + }, + }); + } + return deprecations; +}; diff --git a/src/core/server/elasticsearch/elasticsearch_service.test.ts b/src/core/server/elasticsearch/elasticsearch_service.test.ts index 4c749cba1fd84..d10fec01697a8 100644 --- a/src/core/server/elasticsearch/elasticsearch_service.test.ts +++ b/src/core/server/elasticsearch/elasticsearch_service.test.ts @@ -28,11 +28,13 @@ import { loggingSystemMock } from '../logging/logging_system.mock'; import { httpServiceMock } from '../http/http_service.mock'; import { executionContextServiceMock } from '../execution_context/execution_context_service.mock'; import { configSchema, ElasticsearchConfig } from './elasticsearch_config'; -import { ElasticsearchService } from './elasticsearch_service'; +import { ElasticsearchService, SetupDeps } from './elasticsearch_service'; import { elasticsearchClientMock } from './client/mocks'; +import { deprecationsServiceMock } from '../deprecations/deprecations_service.mock'; import { duration } from 'moment'; import { isValidConnection as isValidConnectionMock } from './is_valid_connection'; import { pollEsNodesVersion as pollEsNodesVersionMocked } from './version_check/ensure_es_version'; + const { pollEsNodesVersion: pollEsNodesVersionActual } = jest.requireActual( './version_check/ensure_es_version' ); @@ -40,20 +42,25 @@ const { pollEsNodesVersion: pollEsNodesVersionActual } = jest.requireActual( const delay = async (durationMs: number) => await new Promise((resolve) => setTimeout(resolve, durationMs)); -let elasticsearchService: ElasticsearchService; const configService = configServiceMock.create(); -const setupDeps = { - http: httpServiceMock.createInternalSetupContract(), - executionContext: executionContextServiceMock.createInternalSetupContract(), -}; +let elasticsearchService: ElasticsearchService; let env: Env; let coreContext: CoreContext; - let mockClusterClientInstance: ReturnType; - let mockConfig$: BehaviorSubject; +let setupDeps: SetupDeps; +let deprecationsSetup: ReturnType; + beforeEach(() => { + deprecationsSetup = deprecationsServiceMock.createInternalSetupContract(); + + setupDeps = { + http: httpServiceMock.createInternalSetupContract(), + executionContext: executionContextServiceMock.createInternalSetupContract(), + deprecations: deprecationsSetup, + }; + env = Env.createDefault(REPO_ROOT, getEnvOptions()); mockConfig$ = new BehaviorSubject({ @@ -174,6 +181,22 @@ describe('#setup', () => { ); }); + it('registers its deprecation provider', async () => { + const registry = deprecationsServiceMock.createSetupContract(); + + deprecationsSetup.getRegistry.mockReturnValue(registry); + + await elasticsearchService.setup(setupDeps); + + expect(deprecationsSetup.getRegistry).toHaveBeenCalledTimes(1); + expect(deprecationsSetup.getRegistry).toHaveBeenCalledWith('elasticsearch'); + + expect(registry.registerDeprecations).toHaveBeenCalledTimes(1); + expect(registry.registerDeprecations).toHaveBeenCalledWith({ + getDeprecations: expect.any(Function), + }); + }); + it('esNodeVersionCompatibility$ only starts polling when subscribed to', async (done) => { const mockedClient = mockClusterClientInstance.asInternalUser; mockedClient.nodes.info.mockImplementation(() => diff --git a/src/core/server/elasticsearch/elasticsearch_service.ts b/src/core/server/elasticsearch/elasticsearch_service.ts index 1e0aa44fcbe19..eebd732749285 100644 --- a/src/core/server/elasticsearch/elasticsearch_service.ts +++ b/src/core/server/elasticsearch/elasticsearch_service.ts @@ -18,6 +18,7 @@ import { ClusterClient, ElasticsearchClientConfig } from './client'; import { ElasticsearchConfig, ElasticsearchConfigType } from './elasticsearch_config'; import type { InternalHttpServiceSetup, GetAuthHeaders } from '../http'; import type { InternalExecutionContextSetup, IExecutionContext } from '../execution_context'; +import type { InternalDeprecationsServiceSetup } from '../deprecations'; import { InternalElasticsearchServicePreboot, InternalElasticsearchServiceSetup, @@ -27,9 +28,11 @@ import type { NodesVersionCompatibility } from './version_check/ensure_es_versio import { pollEsNodesVersion } from './version_check/ensure_es_version'; import { calculateStatus$ } from './status'; import { isValidConnection } from './is_valid_connection'; +import { getElasticsearchDeprecationsProvider } from './deprecations'; -interface SetupDeps { +export interface SetupDeps { http: InternalHttpServiceSetup; + deprecations: InternalDeprecationsServiceSetup; executionContext: InternalExecutionContextSetup; } @@ -78,6 +81,10 @@ export class ElasticsearchService this.executionContextClient = deps.executionContext; this.client = this.createClusterClient('data', config); + deps.deprecations + .getRegistry('elasticsearch') + .registerDeprecations(getElasticsearchDeprecationsProvider()); + const esNodesCompatibility$ = pollEsNodesVersion({ internalClient: this.client.asInternalUser, log: this.log, @@ -96,6 +103,7 @@ export class ElasticsearchService status$: calculateStatus$(esNodesCompatibility$), }; } + public async start(): Promise { if (!this.client || !this.esNodesCompatibility$) { throw new Error('ElasticsearchService needs to be setup before calling start'); diff --git a/src/core/server/elasticsearch/integration_tests/client.test.ts b/src/core/server/elasticsearch/integration_tests/client.test.ts index 6e40c638614bd..83b20761df1ae 100644 --- a/src/core/server/elasticsearch/integration_tests/client.test.ts +++ b/src/core/server/elasticsearch/integration_tests/client.test.ts @@ -96,8 +96,8 @@ describe('fake elasticsearch', () => { test('should return unknown product when it cannot perform the Product check (503 response)', async () => { const resp = await supertest(kibanaHttpServer).get('/api/status').expect(503); - expect(resp.body.status.overall.state).toBe('red'); - expect(resp.body.status.statuses[0].message).toBe( + expect(resp.body.status.overall.level).toBe('critical'); + expect(resp.body.status.core.elasticsearch.summary).toBe( 'Unable to retrieve version information from Elasticsearch nodes. The client noticed that the server is not Elasticsearch and we do not support this unknown product.' ); }); diff --git a/src/core/server/elasticsearch/integration_tests/is_scripting_disabled.test.ts b/src/core/server/elasticsearch/integration_tests/is_scripting_disabled.test.ts new file mode 100644 index 0000000000000..0d235ff2429e4 --- /dev/null +++ b/src/core/server/elasticsearch/integration_tests/is_scripting_disabled.test.ts @@ -0,0 +1,82 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { + createTestServers, + TestElasticsearchUtils, + TestKibanaUtils, +} from '../../../test_helpers/kbn_server'; +import { isInlineScriptingDisabled } from '../deprecations/is_scripting_disabled'; + +describe('isInlineScriptingDisabled', () => { + let esServer: TestElasticsearchUtils; + let kibanaServer: TestKibanaUtils; + + afterEach(async () => { + if (kibanaServer) { + await kibanaServer.stop(); + } + if (esServer) { + await esServer.stop(); + } + }); + + const startServers = async ({ esArgs = [] }: { esArgs?: string[] } = {}) => { + const { startES, startKibana } = createTestServers({ + adjustTimeout: jest.setTimeout, + settings: { + es: { + esArgs, + }, + }, + }); + + esServer = await startES(); + kibanaServer = await startKibana(); + }; + + it('returns false when `script.allowed_types` is unset', async () => { + await startServers({ esArgs: [] }); + + const disabled = await isInlineScriptingDisabled({ + client: kibanaServer.coreStart.elasticsearch.client.asInternalUser, + }); + + expect(disabled).toEqual(false); + }); + + it('returns false when `script.allowed_types` is `inline`', async () => { + await startServers({ esArgs: ['script.allowed_types=inline'] }); + + const disabled = await isInlineScriptingDisabled({ + client: kibanaServer.coreStart.elasticsearch.client.asInternalUser, + }); + + expect(disabled).toEqual(false); + }); + + it('returns true when `script.allowed_types` is `stored`', async () => { + await startServers({ esArgs: ['script.allowed_types=stored'] }); + + const disabled = await isInlineScriptingDisabled({ + client: kibanaServer.coreStart.elasticsearch.client.asInternalUser, + }); + + expect(disabled).toEqual(true); + }); + + it('returns true when `script.allowed_types` is `none', async () => { + await startServers({ esArgs: ['script.allowed_types=none'] }); + + const disabled = await isInlineScriptingDisabled({ + client: kibanaServer.coreStart.elasticsearch.client.asInternalUser, + }); + + expect(disabled).toEqual(true); + }); +}); diff --git a/src/core/server/execution_context/execution_context_service.test.ts b/src/core/server/execution_context/execution_context_service.test.ts index 3fa4de34ebda0..9bb76ad78c49a 100644 --- a/src/core/server/execution_context/execution_context_service.test.ts +++ b/src/core/server/execution_context/execution_context_service.test.ts @@ -109,7 +109,7 @@ describe('ExecutionContextService', () => { expect(loggingSystemMock.collect(core.logger).debug).toMatchInlineSnapshot(` Array [ Array [ - "set the execution context: {\\"type\\":\\"type-a\\",\\"name\\":\\"name-a\\",\\"id\\":\\"id-a\\",\\"description\\":\\"description-a\\"}", + "{\\"type\\":\\"type-a\\",\\"name\\":\\"name-a\\",\\"id\\":\\"id-a\\",\\"description\\":\\"description-a\\"}", ], ] `); @@ -351,7 +351,7 @@ describe('ExecutionContextService', () => { expect(loggingSystemMock.collect(core.logger).debug).toMatchInlineSnapshot(` Array [ Array [ - "stored the execution context: {\\"type\\":\\"type-a\\",\\"name\\":\\"name-a\\",\\"id\\":\\"id-a\\",\\"description\\":\\"description-a\\"}", + "{\\"type\\":\\"type-a\\",\\"name\\":\\"name-a\\",\\"id\\":\\"id-a\\",\\"description\\":\\"description-a\\"}", ], ] `); diff --git a/src/core/server/execution_context/execution_context_service.ts b/src/core/server/execution_context/execution_context_service.ts index 41b225cf1d0f3..d8ff5fca7847d 100644 --- a/src/core/server/execution_context/execution_context_service.ts +++ b/src/core/server/execution_context/execution_context_service.ts @@ -124,7 +124,7 @@ export class ExecutionContextService // we have to use enterWith since Hapi lifecycle model is built on event emitters. // therefore if we wrapped request handler in asyncLocalStorage.run(), we would lose context in other lifecycles. this.contextStore.enterWith(contextContainer); - this.log.debug(`set the execution context: ${JSON.stringify(contextContainer)}`); + this.log.debug(JSON.stringify(contextContainer)); } private withContext( @@ -136,7 +136,7 @@ export class ExecutionContextService } const parent = this.contextStore.getStore(); const contextContainer = new ExecutionContextContainer(context, parent); - this.log.debug(`stored the execution context: ${JSON.stringify(contextContainer)}`); + this.log.debug(JSON.stringify(contextContainer)); return this.contextStore.run(contextContainer, fn); } diff --git a/src/core/server/index.ts b/src/core/server/index.ts index 1c3a0850d3b79..345c95c8d0773 100644 --- a/src/core/server/index.ts +++ b/src/core/server/index.ts @@ -55,7 +55,7 @@ import { CapabilitiesSetup, CapabilitiesStart } from './capabilities'; import { MetricsServiceSetup, MetricsServiceStart } from './metrics'; import { StatusServiceSetup } from './status'; import { AppenderConfigType, appendersSchema, LoggingServiceSetup } from './logging'; -import { CoreUsageDataStart } from './core_usage_data'; +import { CoreUsageDataStart, CoreUsageDataSetup } from './core_usage_data'; import { I18nServiceSetup } from './i18n'; import { DeprecationsServiceSetup, DeprecationsClient } from './deprecations'; // Because of #79265 we need to explicitly import, then export these types for @@ -378,7 +378,9 @@ export type { OpsProcessMetrics, MetricsServiceSetup, MetricsServiceStart, + IntervalHistogram, } from './metrics'; +export { EventLoopDelaysMonitor } from './metrics'; export type { I18nServiceSetup } from './i18n'; export type { @@ -410,7 +412,13 @@ export type { export { ServiceStatusLevels } from './status'; export type { CoreStatus, ServiceStatus, ServiceStatusLevel, StatusServiceSetup } from './status'; -export type { CoreUsageDataStart } from './core_usage_data'; +export type { + CoreUsageDataSetup, + CoreUsageDataStart, + CoreUsageCounter, + CoreIncrementUsageCounter, + CoreIncrementCounterParams, +} from './core_usage_data'; /** * Plugin specific context passed to a route handler. @@ -500,6 +508,8 @@ export interface CoreSetup; + /** @internal {@link CoreUsageDataSetup} */ + coreUsageData: CoreUsageDataSetup; } /** diff --git a/src/core/server/internal_types.ts b/src/core/server/internal_types.ts index 8fc76e8b95743..29187c3963add 100644 --- a/src/core/server/internal_types.ts +++ b/src/core/server/internal_types.ts @@ -36,7 +36,7 @@ import { InternalRenderingServiceSetup } from './rendering'; import { InternalHttpResourcesPreboot, InternalHttpResourcesSetup } from './http_resources'; import { InternalStatusServiceSetup } from './status'; import { InternalLoggingServicePreboot, InternalLoggingServiceSetup } from './logging'; -import { CoreUsageDataStart } from './core_usage_data'; +import { CoreUsageDataStart, InternalCoreUsageDataSetup } from './core_usage_data'; import { I18nServiceSetup } from './i18n'; import { InternalDeprecationsServiceSetup, InternalDeprecationsServiceStart } from './deprecations'; import type { @@ -73,6 +73,7 @@ export interface InternalCoreSetup { logging: InternalLoggingServiceSetup; metrics: InternalMetricsServiceSetup; deprecations: InternalDeprecationsServiceSetup; + coreUsageData: InternalCoreUsageDataSetup; } /** diff --git a/src/core/server/logging/appenders/file/file_appender.ts b/src/core/server/logging/appenders/file/file_appender.ts index be46c261dc996..3c22a37038bcc 100644 --- a/src/core/server/logging/appenders/file/file_appender.ts +++ b/src/core/server/logging/appenders/file/file_appender.ts @@ -65,8 +65,10 @@ export class FileAppender implements DisposableAppender { return resolve(); } - this.outputStream.end(() => { - this.outputStream = undefined; + const outputStream = this.outputStream; + this.outputStream = undefined; + + outputStream.end(() => { resolve(); }); }); diff --git a/src/core/server/metrics/collectors/collector.mock.ts b/src/core/server/metrics/collectors/collector.mock.ts index bf45925bf583f..088156fa2ff5e 100644 --- a/src/core/server/metrics/collectors/collector.mock.ts +++ b/src/core/server/metrics/collectors/collector.mock.ts @@ -8,8 +8,10 @@ import { MetricsCollector } from './types'; -const createCollector = (collectReturnValue: any = {}): jest.Mocked> => { - const collector: jest.Mocked> = { +const createCollector = ( + collectReturnValue: any = {} +): jest.Mocked> => { + const collector: jest.Mocked> = { collect: jest.fn().mockResolvedValue(collectReturnValue), reset: jest.fn(), }; diff --git a/src/core/server/metrics/collectors/mocks.ts b/src/core/server/metrics/collectors/mocks.ts index ad8dd9fa57966..425751899ddc9 100644 --- a/src/core/server/metrics/collectors/mocks.ts +++ b/src/core/server/metrics/collectors/mocks.ts @@ -6,7 +6,8 @@ * Side Public License, v 1. */ -import { MetricsCollector } from './types'; +import type { MetricsCollector } from './types'; +import { createMockOpsProcessMetrics } from './process.mocks'; const createMock = () => { const mocked: jest.Mocked> = { @@ -21,4 +22,5 @@ const createMock = () => { export const collectorMock = { create: createMock, + createOpsProcessMetrics: createMockOpsProcessMetrics, }; diff --git a/src/core/server/metrics/collectors/process.mocks.ts b/src/core/server/metrics/collectors/process.mocks.ts new file mode 100644 index 0000000000000..8ee43394b9251 --- /dev/null +++ b/src/core/server/metrics/collectors/process.mocks.ts @@ -0,0 +1,24 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import { mocked } from '../event_loop_delays/event_loop_delays_monitor.mocks'; +import type { OpsProcessMetrics } from './types'; + +export function createMockOpsProcessMetrics(): OpsProcessMetrics { + const histogram = mocked.createHistogram(); + + return { + memory: { + heap: { total_in_bytes: 1, used_in_bytes: 1, size_limit: 1 }, + resident_set_size_in_bytes: 1, + }, + event_loop_delay: 1, + event_loop_delay_histogram: histogram, + pid: 1, + uptime_in_millis: 1, + }; +} diff --git a/src/core/server/metrics/collectors/process.test.ts b/src/core/server/metrics/collectors/process.test.ts index 0395cd8d597fd..ff861d5c8bef1 100644 --- a/src/core/server/metrics/collectors/process.test.ts +++ b/src/core/server/metrics/collectors/process.test.ts @@ -9,6 +9,7 @@ import v8, { HeapInfo } from 'v8'; import { ProcessMetricsCollector } from './process'; +/* eslint-disable dot-notation */ describe('ProcessMetricsCollector', () => { let collector: ProcessMetricsCollector; @@ -20,28 +21,34 @@ describe('ProcessMetricsCollector', () => { jest.restoreAllMocks(); }); - it('collects pid from the process', async () => { - const metrics = await collector.collect(); + it('collects pid from the process', () => { + const metrics = collector.collect(); - expect(metrics.pid).toEqual(process.pid); + expect(metrics).toHaveLength(1); + expect(metrics[0].pid).toEqual(process.pid); }); - it('collects event loop delay', async () => { - const metrics = await collector.collect(); - - expect(metrics.event_loop_delay).toBeGreaterThan(0); + it('collects event loop delay', () => { + const mockEventLoopDelayMonitor = { collect: jest.fn().mockReturnValue({ mean: 13 }) }; + // @ts-expect-error-next-line readonly private method. + collector['eventLoopDelayMonitor'] = mockEventLoopDelayMonitor; + const metrics = collector.collect(); + expect(metrics).toHaveLength(1); + expect(metrics[0].event_loop_delay).toBe(13); + expect(mockEventLoopDelayMonitor.collect).toBeCalledTimes(1); }); - it('collects uptime info from the process', async () => { + it('collects uptime info from the process', () => { const uptime = 58986; jest.spyOn(process, 'uptime').mockImplementation(() => uptime); - const metrics = await collector.collect(); + const metrics = collector.collect(); - expect(metrics.uptime_in_millis).toEqual(uptime * 1000); + expect(metrics).toHaveLength(1); + expect(metrics[0].uptime_in_millis).toEqual(uptime * 1000); }); - it('collects memory info from the process', async () => { + it('collects memory info from the process', () => { const heapTotal = 58986; const heapUsed = 4688; const heapSizeLimit = 5788; @@ -61,11 +68,12 @@ describe('ProcessMetricsCollector', () => { } as HeapInfo) ); - const metrics = await collector.collect(); + const metrics = collector.collect(); - expect(metrics.memory.heap.total_in_bytes).toEqual(heapTotal); - expect(metrics.memory.heap.used_in_bytes).toEqual(heapUsed); - expect(metrics.memory.heap.size_limit).toEqual(heapSizeLimit); - expect(metrics.memory.resident_set_size_in_bytes).toEqual(rss); + expect(metrics).toHaveLength(1); + expect(metrics[0].memory.heap.total_in_bytes).toEqual(heapTotal); + expect(metrics[0].memory.heap.used_in_bytes).toEqual(heapUsed); + expect(metrics[0].memory.heap.size_limit).toEqual(heapSizeLimit); + expect(metrics[0].memory.resident_set_size_in_bytes).toEqual(rss); }); }); diff --git a/src/core/server/metrics/collectors/process.ts b/src/core/server/metrics/collectors/process.ts index d7ff967114f00..3acfda3e165ee 100644 --- a/src/core/server/metrics/collectors/process.ts +++ b/src/core/server/metrics/collectors/process.ts @@ -7,14 +7,26 @@ */ import v8 from 'v8'; -import { Bench } from '@hapi/hoek'; import { OpsProcessMetrics, MetricsCollector } from './types'; +import { EventLoopDelaysMonitor } from '../event_loop_delays'; -export class ProcessMetricsCollector implements MetricsCollector { - public async collect(): Promise { +export class ProcessMetricsCollector implements MetricsCollector { + static getMainThreadMetrics(processes: OpsProcessMetrics[]): undefined | OpsProcessMetrics { + /** + * Currently Kibana does not support multi-processes. + * Once we have multiple processes we can add a `name` field + * and filter on `name === 'server_worker'` to get the main thread. + */ + return processes[0]; + } + + private readonly eventLoopDelayMonitor = new EventLoopDelaysMonitor(); + + private getCurrentPidMetrics(): OpsProcessMetrics { + const eventLoopDelayHistogram = this.eventLoopDelayMonitor.collect(); const heapStats = v8.getHeapStatistics(); const memoryUsage = process.memoryUsage(); - const [eventLoopDelay] = await Promise.all([getEventLoopDelay()]); + return { memory: { heap: { @@ -25,19 +37,17 @@ export class ProcessMetricsCollector implements MetricsCollector => { - const bench = new Bench(); - return new Promise((resolve) => { - setImmediate(() => { - return resolve(bench.elapsed()); - }); - }); -}; + public reset() { + this.eventLoopDelayMonitor.reset(); + } +} diff --git a/src/core/server/metrics/collectors/types.ts b/src/core/server/metrics/collectors/types.ts index ec9746aaae769..4684e8008f4da 100644 --- a/src/core/server/metrics/collectors/types.ts +++ b/src/core/server/metrics/collectors/types.ts @@ -5,11 +5,13 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ +import { MaybePromise } from '@kbn/utility-types'; +import type { IntervalHistogram } from '../types'; /** Base interface for all metrics gatherers */ export interface MetricsCollector { /** collect the data currently gathered by the collector */ - collect(): Promise; + collect(): MaybePromise; /** reset the internal state of the collector */ reset(): void; } @@ -19,6 +21,8 @@ export interface MetricsCollector { * @public */ export interface OpsProcessMetrics { + /** pid of the kibana process */ + pid: number; /** process memory usage */ memory: { /** heap memory usage */ @@ -33,10 +37,10 @@ export interface OpsProcessMetrics { /** node rss */ resident_set_size_in_bytes: number; }; - /** node event loop delay */ + /** mean event loop delay since last collection*/ event_loop_delay: number; - /** pid of the kibana process */ - pid: number; + /** node event loop delay histogram since last collection */ + event_loop_delay_histogram: IntervalHistogram; /** uptime of the kibana process */ uptime_in_millis: number; } diff --git a/src/core/server/metrics/event_loop_delays/__mocks__/perf_hooks.ts b/src/core/server/metrics/event_loop_delays/__mocks__/perf_hooks.ts new file mode 100644 index 0000000000000..2a5477a1c4e9e --- /dev/null +++ b/src/core/server/metrics/event_loop_delays/__mocks__/perf_hooks.ts @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { mocked } from '../event_loop_delays_monitor.mocks'; + +export const monitorEventLoopDelay = jest.fn().mockImplementation(() => { + const mockedHistogram = mocked.createHistogram(); + + return { + ...mockedHistogram, + enable: jest.fn(), + percentile: jest.fn().mockImplementation((percentile: number) => { + return (mockedHistogram.percentiles as Record)[`${percentile}`]; + }), + disable: jest.fn(), + reset: jest.fn(), + }; +}); diff --git a/src/core/server/metrics/event_loop_delays/event_loop_delays_monitor.mocks.ts b/src/core/server/metrics/event_loop_delays/event_loop_delays_monitor.mocks.ts new file mode 100644 index 0000000000000..ee96668cf3e7c --- /dev/null +++ b/src/core/server/metrics/event_loop_delays/event_loop_delays_monitor.mocks.ts @@ -0,0 +1,51 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +import moment from 'moment'; +import type { EventLoopDelaysMonitor } from './event_loop_delays_monitor'; +import type { IntervalHistogram } from '../types'; + +function createMockHistogram(overwrites: Partial = {}): IntervalHistogram { + const now = Date.now(); + + return { + min: 9093120, + max: 53247999, + mean: 11993238.600747818, + exceeds: 0, + stddev: 1168191.9357543814, + fromTimestamp: moment(now).toISOString(), + lastUpdatedAt: moment(now).toISOString(), + percentiles: { + '50': 12607487, + '75': 12615679, + '95': 12648447, + '99': 12713983, + }, + ...overwrites, + }; +} + +function createMockEventLoopDelaysMonitor() { + const mockCollect = jest.fn(); + const MockEventLoopDelaysMonitor: jest.MockedClass< + typeof EventLoopDelaysMonitor + > = jest.fn().mockReturnValue({ + collect: mockCollect, + reset: jest.fn(), + stop: jest.fn(), + }); + + mockCollect.mockReturnValue(createMockHistogram()); + + return new MockEventLoopDelaysMonitor(); +} + +export const mocked = { + createHistogram: createMockHistogram, + createEventLoopDelaysMonitor: createMockEventLoopDelaysMonitor, +}; diff --git a/src/core/server/metrics/event_loop_delays/event_loop_delays_monitor.test.ts b/src/core/server/metrics/event_loop_delays/event_loop_delays_monitor.test.ts new file mode 100644 index 0000000000000..3e88dbca8f4e7 --- /dev/null +++ b/src/core/server/metrics/event_loop_delays/event_loop_delays_monitor.test.ts @@ -0,0 +1,59 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may 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 dot-notation */ +jest.mock('perf_hooks'); +import { monitorEventLoopDelay } from 'perf_hooks'; +import { EventLoopDelaysMonitor } from './event_loop_delays_monitor'; +import { mocked } from './event_loop_delays_monitor.mocks'; + +describe('EventLoopDelaysMonitor', () => { + beforeAll(() => { + jest.useFakeTimers('modern'); + const mockNow = jest.getRealSystemTime(); + jest.setSystemTime(mockNow); + }); + afterEach(() => jest.clearAllMocks()); + afterAll(() => jest.useRealTimers()); + + test('#constructor enables monitoring', () => { + const eventLoopDelaysMonitor = new EventLoopDelaysMonitor(); + expect(monitorEventLoopDelay).toBeCalledTimes(1); + expect(eventLoopDelaysMonitor['loopMonitor'].enable).toBeCalledTimes(1); + }); + + test('#collect returns event loop delays histogram', () => { + const eventLoopDelaysMonitor = new EventLoopDelaysMonitor(); + expect(eventLoopDelaysMonitor['loopMonitor'].disable).toBeCalledTimes(0); + expect(eventLoopDelaysMonitor['loopMonitor'].enable).toBeCalledTimes(1); + const histogramData = eventLoopDelaysMonitor.collect(); + expect(eventLoopDelaysMonitor['loopMonitor'].disable).toBeCalledTimes(1); + expect(eventLoopDelaysMonitor['loopMonitor'].enable).toBeCalledTimes(2); + expect(eventLoopDelaysMonitor['loopMonitor'].percentile).toHaveBeenNthCalledWith(1, 50); + expect(eventLoopDelaysMonitor['loopMonitor'].percentile).toHaveBeenNthCalledWith(2, 75); + expect(eventLoopDelaysMonitor['loopMonitor'].percentile).toHaveBeenNthCalledWith(3, 95); + expect(eventLoopDelaysMonitor['loopMonitor'].percentile).toHaveBeenNthCalledWith(4, 99); + + // mocked perf_hook returns `mocked.createHistogram()`. + // This ensures that the wiring of the `collect` function is correct. + const mockedHistogram = mocked.createHistogram(); + expect(histogramData).toEqual(mockedHistogram); + }); + + test('#reset resets histogram data', () => { + const eventLoopDelaysMonitor = new EventLoopDelaysMonitor(); + eventLoopDelaysMonitor.reset(); + expect(eventLoopDelaysMonitor['loopMonitor'].reset).toBeCalledTimes(1); + }); + test('#stop disables monitoring event loop delays', () => { + const eventLoopDelaysMonitor = new EventLoopDelaysMonitor(); + expect(eventLoopDelaysMonitor['loopMonitor'].disable).toBeCalledTimes(0); + eventLoopDelaysMonitor.stop(); + expect(eventLoopDelaysMonitor['loopMonitor'].disable).toBeCalledTimes(1); + }); +}); diff --git a/src/core/server/metrics/event_loop_delays/event_loop_delays_monitor.ts b/src/core/server/metrics/event_loop_delays/event_loop_delays_monitor.ts new file mode 100644 index 0000000000000..3dff847f83c9b --- /dev/null +++ b/src/core/server/metrics/event_loop_delays/event_loop_delays_monitor.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 and the Server Side Public License, v 1; you may not 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 { EventLoopDelayMonitor } from 'perf_hooks'; +import { monitorEventLoopDelay } from 'perf_hooks'; +import type { IntervalHistogram } from '../types'; + +export class EventLoopDelaysMonitor { + private readonly loopMonitor: EventLoopDelayMonitor; + private fromTimestamp: Date; + + /** + * Creating a new instance from EventLoopDelaysMonitor will + * automatically start tracking event loop delays. + */ + constructor() { + const monitor = monitorEventLoopDelay(); + monitor.enable(); + this.fromTimestamp = new Date(); + this.loopMonitor = monitor; + } + /** + * Collect gathers event loop delays metrics from nodejs perf_hooks.monitorEventLoopDelay + * the histogram calculations start from the last time `reset` was called or this + * EventLoopDelaysMonitor instance was created. + * @returns {IntervalHistogram} + */ + public collect(): IntervalHistogram { + const lastUpdated = new Date(); + this.loopMonitor.disable(); + const { min, max, mean, exceeds, stddev } = this.loopMonitor; + + const collectedData: IntervalHistogram = { + min, + max, + mean, + exceeds, + stddev, + fromTimestamp: this.fromTimestamp.toISOString(), + lastUpdatedAt: lastUpdated.toISOString(), + percentiles: { + 50: this.loopMonitor.percentile(50), + 75: this.loopMonitor.percentile(75), + 95: this.loopMonitor.percentile(95), + 99: this.loopMonitor.percentile(99), + }, + }; + + this.loopMonitor.enable(); + return collectedData; + } + + /** + * Resets the collected histogram data. + */ + public reset() { + this.loopMonitor.reset(); + this.fromTimestamp = new Date(); + } + + /** + * Disables updating the interval timer for collecting new data points. + */ + public stop() { + this.loopMonitor.disable(); + } +} diff --git a/src/core/server/metrics/event_loop_delays/index.ts b/src/core/server/metrics/event_loop_delays/index.ts new file mode 100644 index 0000000000000..bc9cda18d443b --- /dev/null +++ b/src/core/server/metrics/event_loop_delays/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 { EventLoopDelaysMonitor } from './event_loop_delays_monitor'; diff --git a/src/core/server/metrics/index.ts b/src/core/server/metrics/index.ts index 0631bb2b35801..797a0ae8c3f00 100644 --- a/src/core/server/metrics/index.ts +++ b/src/core/server/metrics/index.ts @@ -12,8 +12,10 @@ export type { MetricsServiceSetup, MetricsServiceStart, OpsMetrics, + IntervalHistogram, } from './types'; export type { OpsProcessMetrics, OpsServerMetrics, OpsOsMetrics } from './collectors'; export { MetricsService } from './metrics_service'; export { opsConfig } from './ops_config'; export type { OpsConfigType } from './ops_config'; +export { EventLoopDelaysMonitor } from './event_loop_delays'; diff --git a/src/core/server/metrics/logging/get_ops_metrics_log.test.ts b/src/core/server/metrics/logging/get_ops_metrics_log.test.ts index e535b9babf92b..2d7a6bebf255e 100644 --- a/src/core/server/metrics/logging/get_ops_metrics_log.test.ts +++ b/src/core/server/metrics/logging/get_ops_metrics_log.test.ts @@ -8,19 +8,15 @@ import { OpsMetrics } from '..'; import { getEcsOpsMetricsLog } from './get_ops_metrics_log'; +import { collectorMock } from '../collectors/mocks'; function createBaseOpsMetrics(): OpsMetrics { + const mockProcess = collectorMock.createOpsProcessMetrics(); + return { collected_at: new Date('2020-01-01 01:00:00'), - process: { - memory: { - heap: { total_in_bytes: 1, used_in_bytes: 1, size_limit: 1 }, - resident_set_size_in_bytes: 1, - }, - event_loop_delay: 1, - pid: 1, - uptime_in_millis: 1, - }, + process: mockProcess, + processes: [mockProcess], os: { platform: 'darwin' as const, platformRelease: 'test', diff --git a/src/core/server/metrics/metrics_service.mock.ts b/src/core/server/metrics/metrics_service.mock.ts index b023824df64d3..5c41e78d8efcb 100644 --- a/src/core/server/metrics/metrics_service.mock.ts +++ b/src/core/server/metrics/metrics_service.mock.ts @@ -8,8 +8,9 @@ import { BehaviorSubject } from 'rxjs'; import type { PublicMethodsOf } from '@kbn/utility-types'; - import type { MetricsService } from './metrics_service'; +import { collectorMock } from './collectors/mocks'; +import { mocked as eventLoopDelaysMonitorMock } from './event_loop_delays/event_loop_delays_monitor.mocks'; import { InternalMetricsServiceSetup, InternalMetricsServiceStart, @@ -22,18 +23,14 @@ const createInternalSetupContractMock = () => { collectionInterval: 30000, getOpsMetrics$: jest.fn(), }; + + const processMock = collectorMock.createOpsProcessMetrics(); + setupContract.getOpsMetrics$.mockReturnValue( new BehaviorSubject({ collected_at: new Date('2020-01-01 01:00:00'), - process: { - memory: { - heap: { total_in_bytes: 1, used_in_bytes: 1, size_limit: 1 }, - resident_set_size_in_bytes: 1, - }, - event_loop_delay: 1, - pid: 1, - uptime_in_millis: 1, - }, + process: processMock, + processes: [processMock], os: { platform: 'darwin' as const, platformRelease: 'test', @@ -81,4 +78,5 @@ export const metricsServiceMock = { createStartContract: createStartContractMock, createInternalSetupContract: createInternalSetupContractMock, createInternalStartContract: createInternalStartContractMock, + createEventLoopDelaysMonitor: eventLoopDelaysMonitorMock.createEventLoopDelaysMonitor, }; diff --git a/src/core/server/metrics/ops_metrics_collector.test.ts b/src/core/server/metrics/ops_metrics_collector.test.ts index 3faa771db1dae..7d263d8b7d6af 100644 --- a/src/core/server/metrics/ops_metrics_collector.test.ts +++ b/src/core/server/metrics/ops_metrics_collector.test.ts @@ -28,7 +28,7 @@ describe('OpsMetricsCollector', () => { describe('#collect', () => { it('gathers metrics from the underlying collectors', async () => { mockOsCollector.collect.mockResolvedValue('osMetrics'); - mockProcessCollector.collect.mockResolvedValue('processMetrics'); + mockProcessCollector.collect.mockResolvedValue(['processMetrics']); mockServerCollector.collect.mockResolvedValue({ requests: 'serverRequestsMetrics', response_times: 'serverTimingMetrics', @@ -43,6 +43,7 @@ describe('OpsMetricsCollector', () => { expect(metrics).toEqual({ collected_at: expect.any(Date), process: 'processMetrics', + processes: ['processMetrics'], os: 'osMetrics', requests: 'serverRequestsMetrics', response_times: 'serverTimingMetrics', diff --git a/src/core/server/metrics/ops_metrics_collector.ts b/src/core/server/metrics/ops_metrics_collector.ts index 74e8b8246d83c..376b10dcccdda 100644 --- a/src/core/server/metrics/ops_metrics_collector.ts +++ b/src/core/server/metrics/ops_metrics_collector.ts @@ -28,14 +28,21 @@ export class OpsMetricsCollector implements MetricsCollector { } public async collect(): Promise { - const [process, os, server] = await Promise.all([ + const [processes, os, server] = await Promise.all([ this.processCollector.collect(), this.osCollector.collect(), this.serverCollector.collect(), ]); + return { collected_at: new Date(), - process, + /** + * Kibana does not yet support multi-process nodes. + * `processes` is just an Array(1) only returning the current process's data + * which is why we can just use processes[0] for `process` + */ + process: processes[0], + processes, os, ...server, }; diff --git a/src/core/server/metrics/types.ts b/src/core/server/metrics/types.ts index d70b8c9ff4208..550a60d0d295a 100644 --- a/src/core/server/metrics/types.ts +++ b/src/core/server/metrics/types.ts @@ -7,7 +7,7 @@ */ import { Observable } from 'rxjs'; -import { OpsProcessMetrics, OpsOsMetrics, OpsServerMetrics } from './collectors'; +import type { OpsProcessMetrics, OpsOsMetrics, OpsServerMetrics } from './collectors'; /** * APIs to retrieves metrics gathered and exposed by the core platform. @@ -51,8 +51,13 @@ export type InternalMetricsServiceStart = MetricsServiceStart; export interface OpsMetrics { /** Time metrics were recorded at. */ collected_at: Date; - /** Process related metrics */ + /** + * Process related metrics. + * @deprecated use the processes field instead. + */ process: OpsProcessMetrics; + /** Process related metrics. Reports an array of objects for each kibana pid.*/ + processes: OpsProcessMetrics[]; /** OS related metrics */ os: OpsOsMetrics; /** server response time stats */ @@ -62,3 +67,37 @@ export interface OpsMetrics { /** number of current concurrent connections to the server */ concurrent_connections: OpsServerMetrics['concurrent_connections']; } + +/** + * an IntervalHistogram object that samples and reports the event loop delay over time. + * The delays will be reported in nanoseconds. + * + * @public + */ +export interface IntervalHistogram { + // The first timestamp the interval timer kicked in for collecting data points. + fromTimestamp: string; + // Last timestamp the interval timer kicked in for collecting data points. + lastUpdatedAt: string; + // The minimum recorded event loop delay. + min: number; + // The maximum recorded event loop delay. + max: number; + // The mean of the recorded event loop delays. + mean: number; + // The number of times the event loop delay exceeded the maximum 1 hour event loop delay threshold. + exceeds: number; + // The standard deviation of the recorded event loop delays. + stddev: number; + // An object detailing the accumulated percentile distribution. + percentiles: { + // 50th percentile of delays of the collected data points. + 50: number; + // 75th percentile of delays of the collected data points. + 75: number; + // 95th percentile of delays of the collected data points. + 95: number; + // 99th percentile of delays of the collected data points. + 99: number; + }; +} diff --git a/src/core/server/mocks.ts b/src/core/server/mocks.ts index b53658b574939..f8b56e81ab188 100644 --- a/src/core/server/mocks.ts +++ b/src/core/server/mocks.ts @@ -169,6 +169,9 @@ function createCoreSetupMock({ metrics: metricsServiceMock.createSetupContract(), deprecations: deprecationsServiceMock.createSetupContract(), executionContext: executionContextServiceMock.createInternalSetupContract(), + coreUsageData: { + registerUsageCounter: coreUsageDataServiceMock.createSetupContract().registerUsageCounter, + }, getStartServices: jest .fn, object, any]>, []>() .mockResolvedValue([createCoreStartMock(), pluginStartDeps, pluginStartContract]), @@ -222,6 +225,7 @@ function createInternalCoreSetupMock() { metrics: metricsServiceMock.createInternalSetupContract(), deprecations: deprecationsServiceMock.createInternalSetupContract(), executionContext: executionContextServiceMock.createInternalSetupContract(), + coreUsageData: coreUsageDataServiceMock.createSetupContract(), }; return setupDeps; } diff --git a/src/core/server/plugins/plugin_context.ts b/src/core/server/plugins/plugin_context.ts index cbefdae525180..bdb4efde9b1fb 100644 --- a/src/core/server/plugins/plugin_context.ts +++ b/src/core/server/plugins/plugin_context.ts @@ -211,6 +211,9 @@ export function createPluginSetupContext( }, getStartServices: () => plugin.startDependencies, deprecations: deps.deprecations.getRegistry(plugin.name), + coreUsageData: { + registerUsageCounter: deps.coreUsageData.registerUsageCounter, + }, }; } diff --git a/src/core/server/saved_objects/deprecations/deprecation_factory.ts b/src/core/server/saved_objects/deprecations/deprecation_factory.ts new file mode 100644 index 0000000000000..670b43bfa7c77 --- /dev/null +++ b/src/core/server/saved_objects/deprecations/deprecation_factory.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 type { RegisterDeprecationsConfig } from '../../deprecations'; +import type { ISavedObjectTypeRegistry } from '../saved_objects_type_registry'; +import type { SavedObjectConfig } from '../saved_objects_config'; +import type { KibanaConfigType } from '../../kibana_config'; +import { getUnknownTypesDeprecations } from './unknown_object_types'; + +interface GetDeprecationProviderOptions { + typeRegistry: ISavedObjectTypeRegistry; + savedObjectsConfig: SavedObjectConfig; + kibanaConfig: KibanaConfigType; + kibanaVersion: string; +} + +export const getSavedObjectsDeprecationsProvider = ( + config: GetDeprecationProviderOptions +): RegisterDeprecationsConfig => { + return { + getDeprecations: async (context) => { + return [ + ...(await getUnknownTypesDeprecations({ + ...config, + esClient: context.esClient, + })), + ]; + }, + }; +}; diff --git a/src/core/server/saved_objects/deprecations/index.ts b/src/core/server/saved_objects/deprecations/index.ts new file mode 100644 index 0000000000000..5cf1590ad43d2 --- /dev/null +++ b/src/core/server/saved_objects/deprecations/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 { getSavedObjectsDeprecationsProvider } from './deprecation_factory'; +export { deleteUnknownTypeObjects } from './unknown_object_types'; diff --git a/src/core/server/saved_objects/deprecations/unknown_object_types.test.mocks.ts b/src/core/server/saved_objects/deprecations/unknown_object_types.test.mocks.ts new file mode 100644 index 0000000000000..312204ad77846 --- /dev/null +++ b/src/core/server/saved_objects/deprecations/unknown_object_types.test.mocks.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export const getIndexForTypeMock = jest.fn(); + +jest.doMock('../service/lib/get_index_for_type', () => ({ + getIndexForType: getIndexForTypeMock, +})); diff --git a/src/core/server/saved_objects/deprecations/unknown_object_types.test.ts b/src/core/server/saved_objects/deprecations/unknown_object_types.test.ts new file mode 100644 index 0000000000000..d7ea73456e236 --- /dev/null +++ b/src/core/server/saved_objects/deprecations/unknown_object_types.test.ts @@ -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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { getIndexForTypeMock } from './unknown_object_types.test.mocks'; + +import { estypes } from '@elastic/elasticsearch'; +import { deleteUnknownTypeObjects, getUnknownTypesDeprecations } from './unknown_object_types'; +import { typeRegistryMock } from '../saved_objects_type_registry.mock'; +import { elasticsearchClientMock } from '../../elasticsearch/client/mocks'; +import type { KibanaConfigType } from '../../kibana_config'; +import type { SavedObjectConfig } from '../saved_objects_config'; +import { SavedObjectsType } from 'kibana/server'; + +const createSearchResponse = (count: number): estypes.SearchResponse => { + return { + hits: { + total: count, + max_score: 0, + hits: new Array(count).fill({}), + }, + } as estypes.SearchResponse; +}; + +describe('unknown saved object types deprecation', () => { + const kibanaVersion = '8.0.0'; + + let typeRegistry: ReturnType; + let esClient: ReturnType; + let kibanaConfig: KibanaConfigType; + let savedObjectsConfig: SavedObjectConfig; + + beforeEach(() => { + typeRegistry = typeRegistryMock.create(); + esClient = elasticsearchClientMock.createScopedClusterClient(); + + typeRegistry.getAllTypes.mockReturnValue([ + { name: 'foo' }, + { name: 'bar' }, + ] as SavedObjectsType[]); + getIndexForTypeMock.mockImplementation(({ type }: { type: string }) => `${type}-index`); + + kibanaConfig = { + index: '.kibana', + enabled: true, + }; + + savedObjectsConfig = { + migration: { + enableV2: true, + }, + } as SavedObjectConfig; + }); + + afterEach(() => { + getIndexForTypeMock.mockReset(); + }); + + describe('getUnknownTypesDeprecations', () => { + beforeEach(() => { + esClient.asInternalUser.search.mockReturnValue( + elasticsearchClientMock.createSuccessTransportRequestPromise(createSearchResponse(0)) + ); + }); + + it('calls `esClient.asInternalUser.search` with the correct parameters', async () => { + await getUnknownTypesDeprecations({ + savedObjectsConfig, + esClient, + typeRegistry, + kibanaConfig, + kibanaVersion, + }); + + expect(esClient.asInternalUser.search).toHaveBeenCalledTimes(1); + expect(esClient.asInternalUser.search).toHaveBeenCalledWith({ + index: ['foo-index', 'bar-index'], + body: { + size: 10000, + query: { + bool: { + must_not: [{ term: { type: 'foo' } }, { term: { type: 'bar' } }], + }, + }, + }, + }); + }); + + it('returns no deprecation if no unknown type docs are found', async () => { + esClient.asInternalUser.search.mockReturnValue( + elasticsearchClientMock.createSuccessTransportRequestPromise(createSearchResponse(0)) + ); + + const deprecations = await getUnknownTypesDeprecations({ + savedObjectsConfig, + esClient, + typeRegistry, + kibanaConfig, + kibanaVersion, + }); + + expect(deprecations.length).toEqual(0); + }); + + it('returns a deprecation if any unknown type docs are found', async () => { + esClient.asInternalUser.search.mockReturnValue( + elasticsearchClientMock.createSuccessTransportRequestPromise(createSearchResponse(1)) + ); + + const deprecations = await getUnknownTypesDeprecations({ + savedObjectsConfig, + esClient, + typeRegistry, + kibanaConfig, + kibanaVersion, + }); + + expect(deprecations.length).toEqual(1); + expect(deprecations[0]).toEqual({ + title: expect.any(String), + message: expect.any(String), + level: 'critical', + requireRestart: false, + deprecationType: undefined, + correctiveActions: { + manualSteps: expect.any(Array), + api: { + path: '/internal/saved_objects/deprecations/_delete_unknown_types', + method: 'POST', + body: {}, + }, + }, + }); + }); + }); + + describe('deleteUnknownTypeObjects', () => { + it('calls `esClient.asInternalUser.search` with the correct parameters', async () => { + await deleteUnknownTypeObjects({ + savedObjectsConfig, + esClient, + typeRegistry, + kibanaConfig, + kibanaVersion, + }); + + expect(esClient.asInternalUser.deleteByQuery).toHaveBeenCalledTimes(1); + expect(esClient.asInternalUser.deleteByQuery).toHaveBeenCalledWith({ + index: ['foo-index', 'bar-index'], + wait_for_completion: false, + body: { + query: { + bool: { + must_not: [{ term: { type: 'foo' } }, { term: { type: 'bar' } }], + }, + }, + }, + }); + }); + }); +}); diff --git a/src/core/server/saved_objects/deprecations/unknown_object_types.ts b/src/core/server/saved_objects/deprecations/unknown_object_types.ts new file mode 100644 index 0000000000000..c966e621ca605 --- /dev/null +++ b/src/core/server/saved_objects/deprecations/unknown_object_types.ts @@ -0,0 +1,172 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { estypes } from '@elastic/elasticsearch'; +import { i18n } from '@kbn/i18n'; +import type { DeprecationsDetails } from '../../deprecations'; +import { IScopedClusterClient } from '../../elasticsearch'; +import { ISavedObjectTypeRegistry } from '../saved_objects_type_registry'; +import { SavedObjectsRawDocSource } from '../serialization'; +import type { KibanaConfigType } from '../../kibana_config'; +import type { SavedObjectConfig } from '../saved_objects_config'; +import { getIndexForType } from '../service/lib'; + +interface UnknownTypesDeprecationOptions { + typeRegistry: ISavedObjectTypeRegistry; + esClient: IScopedClusterClient; + kibanaConfig: KibanaConfigType; + savedObjectsConfig: SavedObjectConfig; + kibanaVersion: string; +} + +const getKnownTypes = (typeRegistry: ISavedObjectTypeRegistry) => + typeRegistry.getAllTypes().map((type) => type.name); + +const getTargetIndices = ({ + types, + typeRegistry, + kibanaVersion, + kibanaConfig, + savedObjectsConfig, +}: { + types: string[]; + typeRegistry: ISavedObjectTypeRegistry; + savedObjectsConfig: SavedObjectConfig; + kibanaConfig: KibanaConfigType; + kibanaVersion: string; +}) => { + return [ + ...new Set( + types.map((type) => + getIndexForType({ + type, + typeRegistry, + migV2Enabled: savedObjectsConfig.migration.enableV2, + kibanaVersion, + defaultIndex: kibanaConfig.index, + }) + ) + ), + ]; +}; + +const getUnknownTypesQuery = (knownTypes: string[]): estypes.QueryDslQueryContainer => { + return { + bool: { + must_not: knownTypes.map((type) => ({ + term: { type }, + })), + }, + }; +}; + +const getUnknownSavedObjects = async ({ + typeRegistry, + esClient, + kibanaConfig, + savedObjectsConfig, + kibanaVersion, +}: UnknownTypesDeprecationOptions) => { + const knownTypes = getKnownTypes(typeRegistry); + const targetIndices = getTargetIndices({ + types: knownTypes, + typeRegistry, + kibanaConfig, + kibanaVersion, + savedObjectsConfig, + }); + const query = getUnknownTypesQuery(knownTypes); + + const { body } = await esClient.asInternalUser.search({ + index: targetIndices, + body: { + size: 10000, + query, + }, + }); + const { hits: unknownDocs } = body.hits; + + return unknownDocs.map((doc) => ({ id: doc._id, type: doc._source?.type ?? 'unknown' })); +}; + +export const getUnknownTypesDeprecations = async ( + options: UnknownTypesDeprecationOptions +): Promise => { + const deprecations: DeprecationsDetails[] = []; + const unknownDocs = await getUnknownSavedObjects(options); + if (unknownDocs.length) { + deprecations.push({ + title: i18n.translate('core.savedObjects.deprecations.unknownTypes.title', { + defaultMessage: 'Saved objects with unknown types are present in Kibana system indices', + }), + message: i18n.translate('core.savedObjects.deprecations.unknownTypes.message', { + defaultMessage: + '{objectCount, plural, one {# object} other {# objects}} with unknown types {objectCount, plural, one {was} other {were}} found in Kibana system indices. ' + + 'Upgrading with unknown savedObject types is no longer supported. ' + + `To ensure that upgrades will succeed in the future, either re-enable plugins or delete these documents from the Kibana indices`, + values: { + objectCount: unknownDocs.length, + }, + }), + level: 'critical', + requireRestart: false, + deprecationType: undefined, // not config nor feature... + correctiveActions: { + manualSteps: [ + i18n.translate('core.savedObjects.deprecations.unknownTypes.manualSteps.1', { + defaultMessage: 'Enable disabled plugins then restart Kibana.', + }), + i18n.translate('core.savedObjects.deprecations.unknownTypes.manualSteps.2', { + defaultMessage: + 'If no plugins are disabled, or if enabling them does not fix the issue, delete the documents.', + }), + ], + api: { + path: '/internal/saved_objects/deprecations/_delete_unknown_types', + method: 'POST', + body: {}, + }, + }, + }); + } + return deprecations; +}; + +interface DeleteUnknownTypesOptions { + typeRegistry: ISavedObjectTypeRegistry; + esClient: IScopedClusterClient; + kibanaConfig: KibanaConfigType; + savedObjectsConfig: SavedObjectConfig; + kibanaVersion: string; +} + +export const deleteUnknownTypeObjects = async ({ + esClient, + typeRegistry, + kibanaConfig, + savedObjectsConfig, + kibanaVersion, +}: DeleteUnknownTypesOptions) => { + const knownTypes = getKnownTypes(typeRegistry); + const targetIndices = getTargetIndices({ + types: knownTypes, + typeRegistry, + kibanaConfig, + kibanaVersion, + savedObjectsConfig, + }); + const query = getUnknownTypesQuery(knownTypes); + + await esClient.asInternalUser.deleteByQuery({ + index: targetIndices, + wait_for_completion: false, + body: { + query, + }, + }); +}; diff --git a/src/core/server/saved_objects/migrations/core/elastic_index.ts b/src/core/server/saved_objects/migrations/core/elastic_index.ts index f473b3ed02526..5068c24df3414 100644 --- a/src/core/server/saved_objects/migrations/core/elastic_index.ts +++ b/src/core/server/saved_objects/migrations/core/elastic_index.ts @@ -45,6 +45,8 @@ export const REMOVED_TYPES: string[] = [ 'tsvb-validation-telemetry', // replaced by osquery-manager-usage-metric 'osquery-usage-metric', + // Was removed in 7.16 + 'timelion-sheet', ].sort(); // When migrating from the outdated index we use a read query which excludes diff --git a/src/core/server/saved_objects/migrationsv2/__snapshots__/migrations_state_action_machine.test.ts.snap b/src/core/server/saved_objects/migrationsv2/__snapshots__/migrations_state_action_machine.test.ts.snap new file mode 100644 index 0000000000000..c3512d8fd50bd --- /dev/null +++ b/src/core/server/saved_objects/migrationsv2/__snapshots__/migrations_state_action_machine.test.ts.snap @@ -0,0 +1,937 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`migrationsStateActionMachine logs state transitions, messages in state.logs and action responses when reaching DONE 1`] = ` +Object { + "debug": Array [ + Array [ + "[.my-so-index] INIT RESPONSE", + Object { + "_tag": "Right", + "right": "response", + }, + ], + Array [ + "[.my-so-index] INIT -> LEGACY_REINDEX. took: 0ms.", + Object { + "kibana": Object { + "migrations": Object { + "duration": 0, + "state": Object { + "batchSize": 1000, + "controlState": "LEGACY_REINDEX", + "currentAlias": ".my-so-index", + "excludeFromUpgradeFilterHooks": Object {}, + "indexPrefix": ".my-so-index", + "kibanaVersion": "7.11.0", + "knownTypes": Array [], + "legacyIndex": ".my-so-index", + "logs": Array [ + Object { + "level": "info", + "message": "Log from LEGACY_REINDEX control state", + }, + ], + "maxBatchSizeBytes": 100000000, + "outdatedDocuments": Array [], + "outdatedDocumentsQuery": Object { + "bool": Object { + "should": Array [], + }, + }, + "preMigrationScript": Object { + "_tag": "None", + }, + "retryAttempts": 5, + "retryCount": 0, + "retryDelay": 0, + "targetIndexMappings": Object { + "properties": Object {}, + }, + "tempIndex": ".my-so-index_7.11.0_reindex_temp", + "tempIndexMappings": Object { + "dynamic": false, + "properties": Object { + "migrationVersion": Object { + "dynamic": "true", + "type": "object", + }, + "type": Object { + "type": "keyword", + }, + }, + }, + "transformedDocBatches": Array [], + "unusedTypesQuery": Object { + "bool": Object { + "must_not": Array [ + Object { + "term": Object { + "type": "apm-services-telemetry", + }, + }, + Object { + "term": Object { + "type": "background-session", + }, + }, + Object { + "term": Object { + "type": "cases-sub-case", + }, + }, + Object { + "term": Object { + "type": "file-upload-telemetry", + }, + }, + Object { + "term": Object { + "type": "fleet-agent-events", + }, + }, + Object { + "term": Object { + "type": "ml-telemetry", + }, + }, + Object { + "term": Object { + "type": "osquery-usage-metric", + }, + }, + Object { + "term": Object { + "type": "server", + }, + }, + Object { + "term": Object { + "type": "timelion-sheet", + }, + }, + Object { + "term": Object { + "type": "tsvb-validation-telemetry", + }, + }, + Object { + "bool": Object { + "must": Array [ + Object { + "match": Object { + "type": "search-session", + }, + }, + Object { + "match": Object { + "search-session.persisted": false, + }, + }, + ], + }, + }, + ], + }, + }, + "versionAlias": ".my-so-index_7.11.0", + "versionIndex": ".my-so-index_7.11.0_001", + }, + }, + }, + }, + ], + Array [ + "[.my-so-index] LEGACY_REINDEX RESPONSE", + Object { + "_tag": "Right", + "right": "response", + }, + ], + Array [ + "[.my-so-index] LEGACY_REINDEX -> LEGACY_DELETE. took: 0ms.", + Object { + "kibana": Object { + "migrations": Object { + "duration": 0, + "state": Object { + "batchSize": 1000, + "controlState": "LEGACY_DELETE", + "currentAlias": ".my-so-index", + "excludeFromUpgradeFilterHooks": Object {}, + "indexPrefix": ".my-so-index", + "kibanaVersion": "7.11.0", + "knownTypes": Array [], + "legacyIndex": ".my-so-index", + "logs": Array [ + Object { + "level": "info", + "message": "Log from LEGACY_REINDEX control state", + }, + Object { + "level": "info", + "message": "Log from LEGACY_DELETE control state", + }, + ], + "maxBatchSizeBytes": 100000000, + "outdatedDocuments": Array [], + "outdatedDocumentsQuery": Object { + "bool": Object { + "should": Array [], + }, + }, + "preMigrationScript": Object { + "_tag": "None", + }, + "retryAttempts": 5, + "retryCount": 0, + "retryDelay": 0, + "targetIndexMappings": Object { + "properties": Object {}, + }, + "tempIndex": ".my-so-index_7.11.0_reindex_temp", + "tempIndexMappings": Object { + "dynamic": false, + "properties": Object { + "migrationVersion": Object { + "dynamic": "true", + "type": "object", + }, + "type": Object { + "type": "keyword", + }, + }, + }, + "transformedDocBatches": Array [], + "unusedTypesQuery": Object { + "bool": Object { + "must_not": Array [ + Object { + "term": Object { + "type": "apm-services-telemetry", + }, + }, + Object { + "term": Object { + "type": "background-session", + }, + }, + Object { + "term": Object { + "type": "cases-sub-case", + }, + }, + Object { + "term": Object { + "type": "file-upload-telemetry", + }, + }, + Object { + "term": Object { + "type": "fleet-agent-events", + }, + }, + Object { + "term": Object { + "type": "ml-telemetry", + }, + }, + Object { + "term": Object { + "type": "osquery-usage-metric", + }, + }, + Object { + "term": Object { + "type": "server", + }, + }, + Object { + "term": Object { + "type": "timelion-sheet", + }, + }, + Object { + "term": Object { + "type": "tsvb-validation-telemetry", + }, + }, + Object { + "bool": Object { + "must": Array [ + Object { + "match": Object { + "type": "search-session", + }, + }, + Object { + "match": Object { + "search-session.persisted": false, + }, + }, + ], + }, + }, + ], + }, + }, + "versionAlias": ".my-so-index_7.11.0", + "versionIndex": ".my-so-index_7.11.0_001", + }, + }, + }, + }, + ], + Array [ + "[.my-so-index] LEGACY_DELETE RESPONSE", + Object { + "_tag": "Right", + "right": "response", + }, + ], + Array [ + "[.my-so-index] LEGACY_DELETE -> LEGACY_DELETE. took: 0ms.", + Object { + "kibana": Object { + "migrations": Object { + "duration": 0, + "state": Object { + "batchSize": 1000, + "controlState": "LEGACY_DELETE", + "currentAlias": ".my-so-index", + "excludeFromUpgradeFilterHooks": Object {}, + "indexPrefix": ".my-so-index", + "kibanaVersion": "7.11.0", + "knownTypes": Array [], + "legacyIndex": ".my-so-index", + "logs": Array [ + Object { + "level": "info", + "message": "Log from LEGACY_REINDEX control state", + }, + Object { + "level": "info", + "message": "Log from LEGACY_DELETE control state", + }, + Object { + "level": "info", + "message": "Log from LEGACY_DELETE control state", + }, + ], + "maxBatchSizeBytes": 100000000, + "outdatedDocuments": Array [], + "outdatedDocumentsQuery": Object { + "bool": Object { + "should": Array [], + }, + }, + "preMigrationScript": Object { + "_tag": "None", + }, + "retryAttempts": 5, + "retryCount": 0, + "retryDelay": 0, + "targetIndexMappings": Object { + "properties": Object {}, + }, + "tempIndex": ".my-so-index_7.11.0_reindex_temp", + "tempIndexMappings": Object { + "dynamic": false, + "properties": Object { + "migrationVersion": Object { + "dynamic": "true", + "type": "object", + }, + "type": Object { + "type": "keyword", + }, + }, + }, + "transformedDocBatches": Array [], + "unusedTypesQuery": Object { + "bool": Object { + "must_not": Array [ + Object { + "term": Object { + "type": "apm-services-telemetry", + }, + }, + Object { + "term": Object { + "type": "background-session", + }, + }, + Object { + "term": Object { + "type": "cases-sub-case", + }, + }, + Object { + "term": Object { + "type": "file-upload-telemetry", + }, + }, + Object { + "term": Object { + "type": "fleet-agent-events", + }, + }, + Object { + "term": Object { + "type": "ml-telemetry", + }, + }, + Object { + "term": Object { + "type": "osquery-usage-metric", + }, + }, + Object { + "term": Object { + "type": "server", + }, + }, + Object { + "term": Object { + "type": "timelion-sheet", + }, + }, + Object { + "term": Object { + "type": "tsvb-validation-telemetry", + }, + }, + Object { + "bool": Object { + "must": Array [ + Object { + "match": Object { + "type": "search-session", + }, + }, + Object { + "match": Object { + "search-session.persisted": false, + }, + }, + ], + }, + }, + ], + }, + }, + "versionAlias": ".my-so-index_7.11.0", + "versionIndex": ".my-so-index_7.11.0_001", + }, + }, + }, + }, + ], + Array [ + "[.my-so-index] LEGACY_DELETE RESPONSE", + Object { + "_tag": "Right", + "right": "response", + }, + ], + Array [ + "[.my-so-index] LEGACY_DELETE -> DONE. took: 0ms.", + Object { + "kibana": Object { + "migrations": Object { + "duration": 0, + "state": Object { + "batchSize": 1000, + "controlState": "DONE", + "currentAlias": ".my-so-index", + "excludeFromUpgradeFilterHooks": Object {}, + "indexPrefix": ".my-so-index", + "kibanaVersion": "7.11.0", + "knownTypes": Array [], + "legacyIndex": ".my-so-index", + "logs": Array [ + Object { + "level": "info", + "message": "Log from LEGACY_REINDEX control state", + }, + Object { + "level": "info", + "message": "Log from LEGACY_DELETE control state", + }, + Object { + "level": "info", + "message": "Log from LEGACY_DELETE control state", + }, + Object { + "level": "info", + "message": "Log from DONE control state", + }, + ], + "maxBatchSizeBytes": 100000000, + "outdatedDocuments": Array [], + "outdatedDocumentsQuery": Object { + "bool": Object { + "should": Array [], + }, + }, + "preMigrationScript": Object { + "_tag": "None", + }, + "retryAttempts": 5, + "retryCount": 0, + "retryDelay": 0, + "targetIndexMappings": Object { + "properties": Object {}, + }, + "tempIndex": ".my-so-index_7.11.0_reindex_temp", + "tempIndexMappings": Object { + "dynamic": false, + "properties": Object { + "migrationVersion": Object { + "dynamic": "true", + "type": "object", + }, + "type": Object { + "type": "keyword", + }, + }, + }, + "transformedDocBatches": Array [], + "unusedTypesQuery": Object { + "bool": Object { + "must_not": Array [ + Object { + "term": Object { + "type": "apm-services-telemetry", + }, + }, + Object { + "term": Object { + "type": "background-session", + }, + }, + Object { + "term": Object { + "type": "cases-sub-case", + }, + }, + Object { + "term": Object { + "type": "file-upload-telemetry", + }, + }, + Object { + "term": Object { + "type": "fleet-agent-events", + }, + }, + Object { + "term": Object { + "type": "ml-telemetry", + }, + }, + Object { + "term": Object { + "type": "osquery-usage-metric", + }, + }, + Object { + "term": Object { + "type": "server", + }, + }, + Object { + "term": Object { + "type": "timelion-sheet", + }, + }, + Object { + "term": Object { + "type": "tsvb-validation-telemetry", + }, + }, + Object { + "bool": Object { + "must": Array [ + Object { + "match": Object { + "type": "search-session", + }, + }, + Object { + "match": Object { + "search-session.persisted": false, + }, + }, + ], + }, + }, + ], + }, + }, + "versionAlias": ".my-so-index_7.11.0", + "versionIndex": ".my-so-index_7.11.0_001", + }, + }, + }, + }, + ], + ], + "error": Array [], + "fatal": Array [], + "info": Array [ + Array [ + "[.my-so-index] Log from LEGACY_REINDEX control state", + ], + Array [ + "[.my-so-index] INIT -> LEGACY_REINDEX. took: 0ms.", + ], + Array [ + "[.my-so-index] Log from LEGACY_DELETE control state", + ], + Array [ + "[.my-so-index] LEGACY_REINDEX -> LEGACY_DELETE. took: 0ms.", + ], + Array [ + "[.my-so-index] Log from LEGACY_DELETE control state", + ], + Array [ + "[.my-so-index] LEGACY_DELETE -> LEGACY_DELETE. took: 0ms.", + ], + Array [ + "[.my-so-index] Log from DONE control state", + ], + Array [ + "[.my-so-index] LEGACY_DELETE -> DONE. took: 0ms.", + ], + ], + "log": Array [], + "trace": Array [], + "warn": Array [], +} +`; + +exports[`migrationsStateActionMachine logs state transitions, messages in state.logs and action responses when reaching FATAL 1`] = ` +Object { + "debug": Array [ + Array [ + "[.my-so-index] INIT RESPONSE", + Object { + "_tag": "Right", + "right": "response", + }, + ], + Array [ + "[.my-so-index] INIT -> LEGACY_DELETE. took: 0ms.", + Object { + "kibana": Object { + "migrations": Object { + "duration": 0, + "state": Object { + "batchSize": 1000, + "controlState": "LEGACY_DELETE", + "currentAlias": ".my-so-index", + "excludeFromUpgradeFilterHooks": Object {}, + "indexPrefix": ".my-so-index", + "kibanaVersion": "7.11.0", + "knownTypes": Array [], + "legacyIndex": ".my-so-index", + "logs": Array [ + Object { + "level": "info", + "message": "Log from LEGACY_DELETE control state", + }, + ], + "maxBatchSizeBytes": 100000000, + "outdatedDocuments": Array [ + Object { + "_id": "1234", + }, + ], + "outdatedDocumentsQuery": Object { + "bool": Object { + "should": Array [], + }, + }, + "preMigrationScript": Object { + "_tag": "None", + }, + "reason": "the fatal reason", + "retryAttempts": 5, + "retryCount": 0, + "retryDelay": 0, + "targetIndexMappings": Object { + "properties": Object {}, + }, + "tempIndex": ".my-so-index_7.11.0_reindex_temp", + "tempIndexMappings": Object { + "dynamic": false, + "properties": Object { + "migrationVersion": Object { + "dynamic": "true", + "type": "object", + }, + "type": Object { + "type": "keyword", + }, + }, + }, + "transformedDocBatches": Array [ + Array [ + Object { + "_id": "1234", + }, + ], + ], + "unusedTypesQuery": Object { + "bool": Object { + "must_not": Array [ + Object { + "term": Object { + "type": "apm-services-telemetry", + }, + }, + Object { + "term": Object { + "type": "background-session", + }, + }, + Object { + "term": Object { + "type": "cases-sub-case", + }, + }, + Object { + "term": Object { + "type": "file-upload-telemetry", + }, + }, + Object { + "term": Object { + "type": "fleet-agent-events", + }, + }, + Object { + "term": Object { + "type": "ml-telemetry", + }, + }, + Object { + "term": Object { + "type": "osquery-usage-metric", + }, + }, + Object { + "term": Object { + "type": "server", + }, + }, + Object { + "term": Object { + "type": "timelion-sheet", + }, + }, + Object { + "term": Object { + "type": "tsvb-validation-telemetry", + }, + }, + Object { + "bool": Object { + "must": Array [ + Object { + "match": Object { + "type": "search-session", + }, + }, + Object { + "match": Object { + "search-session.persisted": false, + }, + }, + ], + }, + }, + ], + }, + }, + "versionAlias": ".my-so-index_7.11.0", + "versionIndex": ".my-so-index_7.11.0_001", + }, + }, + }, + }, + ], + Array [ + "[.my-so-index] LEGACY_DELETE RESPONSE", + Object { + "_tag": "Right", + "right": "response", + }, + ], + Array [ + "[.my-so-index] LEGACY_DELETE -> FATAL. took: 0ms.", + Object { + "kibana": Object { + "migrations": Object { + "duration": 0, + "state": Object { + "batchSize": 1000, + "controlState": "FATAL", + "currentAlias": ".my-so-index", + "excludeFromUpgradeFilterHooks": Object {}, + "indexPrefix": ".my-so-index", + "kibanaVersion": "7.11.0", + "knownTypes": Array [], + "legacyIndex": ".my-so-index", + "logs": Array [ + Object { + "level": "info", + "message": "Log from LEGACY_DELETE control state", + }, + Object { + "level": "info", + "message": "Log from FATAL control state", + }, + ], + "maxBatchSizeBytes": 100000000, + "outdatedDocuments": Array [ + Object { + "_id": "1234", + }, + ], + "outdatedDocumentsQuery": Object { + "bool": Object { + "should": Array [], + }, + }, + "preMigrationScript": Object { + "_tag": "None", + }, + "reason": "the fatal reason", + "retryAttempts": 5, + "retryCount": 0, + "retryDelay": 0, + "targetIndexMappings": Object { + "properties": Object {}, + }, + "tempIndex": ".my-so-index_7.11.0_reindex_temp", + "tempIndexMappings": Object { + "dynamic": false, + "properties": Object { + "migrationVersion": Object { + "dynamic": "true", + "type": "object", + }, + "type": Object { + "type": "keyword", + }, + }, + }, + "transformedDocBatches": Array [ + Array [ + Object { + "_id": "1234", + }, + ], + ], + "unusedTypesQuery": Object { + "bool": Object { + "must_not": Array [ + Object { + "term": Object { + "type": "apm-services-telemetry", + }, + }, + Object { + "term": Object { + "type": "background-session", + }, + }, + Object { + "term": Object { + "type": "cases-sub-case", + }, + }, + Object { + "term": Object { + "type": "file-upload-telemetry", + }, + }, + Object { + "term": Object { + "type": "fleet-agent-events", + }, + }, + Object { + "term": Object { + "type": "ml-telemetry", + }, + }, + Object { + "term": Object { + "type": "osquery-usage-metric", + }, + }, + Object { + "term": Object { + "type": "server", + }, + }, + Object { + "term": Object { + "type": "timelion-sheet", + }, + }, + Object { + "term": Object { + "type": "tsvb-validation-telemetry", + }, + }, + Object { + "bool": Object { + "must": Array [ + Object { + "match": Object { + "type": "search-session", + }, + }, + Object { + "match": Object { + "search-session.persisted": false, + }, + }, + ], + }, + }, + ], + }, + }, + "versionAlias": ".my-so-index_7.11.0", + "versionIndex": ".my-so-index_7.11.0_001", + }, + }, + }, + }, + ], + ], + "error": Array [], + "fatal": Array [], + "info": Array [ + Array [ + "[.my-so-index] Log from LEGACY_DELETE control state", + ], + Array [ + "[.my-so-index] INIT -> LEGACY_DELETE. took: 0ms.", + ], + Array [ + "[.my-so-index] Log from FATAL control state", + ], + Array [ + "[.my-so-index] LEGACY_DELETE -> FATAL. took: 0ms.", + ], + ], + "log": Array [], + "trace": Array [], + "warn": Array [], +} +`; diff --git a/src/core/server/saved_objects/migrationsv2/integration_tests/batch_size_bytes.test.ts b/src/core/server/saved_objects/migrationsv2/integration_tests/batch_size_bytes.test.ts index e96aeb6a93b65..8e79e6342c0d5 100644 --- a/src/core/server/saved_objects/migrationsv2/integration_tests/batch_size_bytes.test.ts +++ b/src/core/server/saved_objects/migrationsv2/integration_tests/batch_size_bytes.test.ts @@ -67,7 +67,9 @@ describe('migration v2', () => { await root.setup(); await expect(root.start()).resolves.toBeTruthy(); - await new Promise((resolve) => setTimeout(resolve, 1000)); + // After plugins start, some saved objects are deleted/recreated, so we + // wait a bit for the count to settle. + await new Promise((resolve) => setTimeout(resolve, 5000)); const esClient: ElasticsearchClient = esServer.es.getClient(); const migratedIndexResponse = await esClient.count({ diff --git a/src/core/server/saved_objects/migrationsv2/integration_tests/cleanup.test.ts b/src/core/server/saved_objects/migrationsv2/integration_tests/cleanup.test.ts index bb408d14df6d7..d76bbc786cffc 100644 --- a/src/core/server/saved_objects/migrationsv2/integration_tests/cleanup.test.ts +++ b/src/core/server/saved_objects/migrationsv2/integration_tests/cleanup.test.ts @@ -44,6 +44,7 @@ function createRoot() { { name: 'root', appenders: ['file'], + level: 'debug', // DEBUG logs are required to retrieve the PIT _id from the action response logs }, ], }, diff --git a/src/core/server/saved_objects/migrationsv2/integration_tests/migration_from_v1.test.ts b/src/core/server/saved_objects/migrationsv2/integration_tests/migration_from_v1.test.ts index fc01e6a408497..d7a64e7368bf4 100644 --- a/src/core/server/saved_objects/migrationsv2/integration_tests/migration_from_v1.test.ts +++ b/src/core/server/saved_objects/migrationsv2/integration_tests/migration_from_v1.test.ts @@ -118,18 +118,23 @@ describe('migration v2', () => { .getTypeRegistry() .getAllTypes() .reduce((versionMap, type) => { - if (type.migrations) { - const migrationsMap = - typeof type.migrations === 'function' ? type.migrations() : type.migrations; - const highestVersion = Object.keys(migrationsMap).sort(Semver.compare).reverse()[0]; + const { name, migrations, convertToMultiNamespaceTypeVersion } = type; + if (migrations || convertToMultiNamespaceTypeVersion) { + const migrationsMap = typeof migrations === 'function' ? migrations() : migrations; + const migrationsKeys = migrationsMap ? Object.keys(migrationsMap) : []; + if (convertToMultiNamespaceTypeVersion) { + // Setting this option registers a conversion migration that is reflected in the object's `migrationVersions` field + migrationsKeys.push(convertToMultiNamespaceTypeVersion); + } + const highestVersion = migrationsKeys.sort(Semver.compare).reverse()[0]; return { ...versionMap, - [type.name]: highestVersion, + [name]: highestVersion, }; } else { return { ...versionMap, - [type.name]: undefined, + [name]: undefined, }; } }, {} as Record); diff --git a/src/core/server/saved_objects/migrationsv2/integration_tests/multiple_es_nodes.test.ts b/src/core/server/saved_objects/migrationsv2/integration_tests/multiple_es_nodes.test.ts index 2ad8da7df8fbe..755bb5f946e4f 100644 --- a/src/core/server/saved_objects/migrationsv2/integration_tests/multiple_es_nodes.test.ts +++ b/src/core/server/saved_objects/migrationsv2/integration_tests/multiple_es_nodes.test.ts @@ -7,9 +7,7 @@ */ import Path from 'path'; -import Fs from 'fs'; -import Util from 'util'; -import glob from 'glob'; +import del from 'del'; import { kibanaServerTestUser } from '@kbn/test'; import { kibanaPackageJson as pkg } from '@kbn/utils'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; @@ -18,15 +16,8 @@ import { Root } from '../../../root'; const LOG_FILE_PREFIX = 'migration_test_multiple_es_nodes'; -const asyncUnlink = Util.promisify(Fs.unlink); - async function removeLogFile() { - glob(Path.join(__dirname, `${LOG_FILE_PREFIX}_*.log`), (err, files) => { - files.forEach(async (file) => { - // ignore errors if it doesn't exist - await asyncUnlink(file).catch(() => void 0); - }); - }); + await del([Path.join(__dirname, `${LOG_FILE_PREFIX}_*.log`)], { force: true }); } function extractSortNumberFromId(id: string): number { diff --git a/src/core/server/saved_objects/migrationsv2/integration_tests/multiple_kibana_nodes.test.ts b/src/core/server/saved_objects/migrationsv2/integration_tests/multiple_kibana_nodes.test.ts index b4a58db1cf8ce..11c5b33c0fd3d 100644 --- a/src/core/server/saved_objects/migrationsv2/integration_tests/multiple_kibana_nodes.test.ts +++ b/src/core/server/saved_objects/migrationsv2/integration_tests/multiple_kibana_nodes.test.ts @@ -7,9 +7,7 @@ */ import Path from 'path'; -import Fs from 'fs'; -import Util from 'util'; -import glob from 'glob'; +import del from 'del'; import { esTestConfig, kibanaServerTestUser } from '@kbn/test'; import { kibanaPackageJson as pkg } from '@kbn/utils'; import * as kbnTestServer from '../../../../test_helpers/kbn_server'; @@ -19,15 +17,8 @@ import type { Root } from '../../../root'; const LOG_FILE_PREFIX = 'migration_test_multiple_kibana_nodes'; -const asyncUnlink = Util.promisify(Fs.unlink); - async function removeLogFiles() { - glob(Path.join(__dirname, `${LOG_FILE_PREFIX}_*.log`), (err, files) => { - files.forEach(async (file) => { - // ignore errors if it doesn't exist - await asyncUnlink(file).catch(() => void 0); - }); - }); + await del([Path.join(__dirname, `${LOG_FILE_PREFIX}_*.log`)], { force: true }); } function extractSortNumberFromId(id: string): number { diff --git a/src/core/server/saved_objects/migrationsv2/migrations_state_action_machine.test.ts b/src/core/server/saved_objects/migrationsv2/migrations_state_action_machine.test.ts index a312ac6be0c3d..21468d7552320 100644 --- a/src/core/server/saved_objects/migrationsv2/migrations_state_action_machine.test.ts +++ b/src/core/server/saved_objects/migrationsv2/migrations_state_action_machine.test.ts @@ -77,7 +77,7 @@ describe('migrationsStateActionMachine', () => { }; }; - it('logs state transitions, messages in state.logs and action responses', async () => { + it('logs state transitions, messages in state.logs and action responses when reaching DONE', async () => { await migrationStateActionMachine({ initialState, logger: mockLogger.get(), @@ -88,71 +88,23 @@ describe('migrationsStateActionMachine', () => { const logs = loggingSystemMock.collect(mockLogger); const doneLog = logs.info.splice(8, 1)[0][0]; expect(doneLog).toMatch(/\[.my-so-index\] Migration completed after \d+ms/); - expect(logs).toMatchInlineSnapshot(` - Object { - "debug": Array [ - Array [ - "[.my-so-index] INIT RESPONSE", - Object { - "_tag": "Right", - "right": "response", - }, - ], - Array [ - "[.my-so-index] LEGACY_REINDEX RESPONSE", - Object { - "_tag": "Right", - "right": "response", - }, - ], - Array [ - "[.my-so-index] LEGACY_DELETE RESPONSE", - Object { - "_tag": "Right", - "right": "response", - }, - ], - Array [ - "[.my-so-index] LEGACY_DELETE RESPONSE", - Object { - "_tag": "Right", - "right": "response", - }, - ], - ], - "error": Array [], - "fatal": Array [], - "info": Array [ - Array [ - "[.my-so-index] Log from LEGACY_REINDEX control state", - ], - Array [ - "[.my-so-index] INIT -> LEGACY_REINDEX. took: 0ms.", - ], - Array [ - "[.my-so-index] Log from LEGACY_DELETE control state", - ], - Array [ - "[.my-so-index] LEGACY_REINDEX -> LEGACY_DELETE. took: 0ms.", - ], - Array [ - "[.my-so-index] Log from LEGACY_DELETE control state", - ], - Array [ - "[.my-so-index] LEGACY_DELETE -> LEGACY_DELETE. took: 0ms.", - ], - Array [ - "[.my-so-index] Log from DONE control state", - ], - Array [ - "[.my-so-index] LEGACY_DELETE -> DONE. took: 0ms.", - ], - ], - "log": Array [], - "trace": Array [], - "warn": Array [], - } - `); + expect(logs).toMatchSnapshot(); + }); + + it('logs state transitions, messages in state.logs and action responses when reaching FATAL', async () => { + await migrationStateActionMachine({ + initialState: { + ...initialState, + reason: 'the fatal reason', + outdatedDocuments: [{ _id: '1234', password: 'sensitive password' }], + transformedDocBatches: [[{ _id: '1234', password: 'sensitive transformed password' }]], + } as State, + logger: mockLogger.get(), + model: transitionModel(['LEGACY_DELETE', 'FATAL']), + next, + client: esClient, + }).catch((err) => err); + expect(loggingSystemMock.collect(mockLogger)).toMatchSnapshot(); }); // see https://github.com/elastic/kibana/issues/98406 @@ -196,6 +148,7 @@ describe('migrationsStateActionMachine', () => { }) ).resolves.toEqual(expect.anything()); }); + it('resolves with migrated status if some sourceIndex in the DONE state', async () => { await expect( migrationStateActionMachine({ @@ -207,6 +160,7 @@ describe('migrationsStateActionMachine', () => { }) ).resolves.toEqual(expect.objectContaining({ status: 'migrated' })); }); + it('resolves with patched status if none sourceIndex in the DONE state', async () => { await expect( migrationStateActionMachine({ @@ -218,6 +172,7 @@ describe('migrationsStateActionMachine', () => { }) ).resolves.toEqual(expect.objectContaining({ status: 'patched' })); }); + it('rejects with error message when reaching the FATAL state', async () => { await expect( migrationStateActionMachine({ @@ -231,127 +186,8 @@ describe('migrationsStateActionMachine', () => { `[Error: Unable to complete saved object migrations for the [.my-so-index] index: the fatal reason]` ); }); - it('logs all state transitions and action responses when reaching the FATAL state', async () => { - await migrationStateActionMachine({ - initialState: { - ...initialState, - reason: 'the fatal reason', - outdatedDocuments: [{ _id: '1234', password: 'sensitive password' }], - transformedDocBatches: [[{ _id: '1234', password: 'sensitive transformed password' }]], - } as State, - logger: mockLogger.get(), - model: transitionModel(['LEGACY_DELETE', 'FATAL']), - next, - client: esClient, - }).catch((err) => err); - // Ignore the first 4 log entries that come from our model - const executionLogLogs = loggingSystemMock.collect(mockLogger).info.slice(4); - expect(executionLogLogs).toEqual([ - [ - '[.my-so-index] INIT RESPONSE', - { - _tag: 'Right', - right: 'response', - }, - ], - [ - '[.my-so-index] INIT -> LEGACY_DELETE', - { - kibana: { - migrationState: { - batchSize: 1000, - maxBatchSizeBytes: 1e8, - controlState: 'LEGACY_DELETE', - currentAlias: '.my-so-index', - excludeFromUpgradeFilterHooks: {}, - indexPrefix: '.my-so-index', - kibanaVersion: '7.11.0', - knownTypes: [], - legacyIndex: '.my-so-index', - logs: [ - { - level: 'info', - message: 'Log from LEGACY_DELETE control state', - }, - ], - outdatedDocuments: [{ _id: '1234' }], - outdatedDocumentsQuery: expect.any(Object), - preMigrationScript: { - _tag: 'None', - }, - reason: 'the fatal reason', - retryAttempts: 5, - retryCount: 0, - retryDelay: 0, - targetIndexMappings: { - properties: {}, - }, - tempIndex: '.my-so-index_7.11.0_reindex_temp', - tempIndexMappings: expect.any(Object), - transformedDocBatches: [[{ _id: '1234' }]], - unusedTypesQuery: expect.any(Object), - versionAlias: '.my-so-index_7.11.0', - versionIndex: '.my-so-index_7.11.0_001', - }, - }, - }, - ], - [ - '[.my-so-index] LEGACY_DELETE RESPONSE', - { - _tag: 'Right', - right: 'response', - }, - ], - [ - '[.my-so-index] LEGACY_DELETE -> FATAL', - { - kibana: { - migrationState: { - batchSize: 1000, - maxBatchSizeBytes: 1e8, - controlState: 'FATAL', - currentAlias: '.my-so-index', - excludeFromUpgradeFilterHooks: {}, - indexPrefix: '.my-so-index', - kibanaVersion: '7.11.0', - knownTypes: [], - legacyIndex: '.my-so-index', - logs: [ - { - level: 'info', - message: 'Log from LEGACY_DELETE control state', - }, - { - level: 'info', - message: 'Log from FATAL control state', - }, - ], - outdatedDocuments: [{ _id: '1234' }], - outdatedDocumentsQuery: expect.any(Object), - preMigrationScript: { - _tag: 'None', - }, - reason: 'the fatal reason', - retryAttempts: 5, - retryCount: 0, - retryDelay: 0, - targetIndexMappings: { - properties: {}, - }, - tempIndex: '.my-so-index_7.11.0_reindex_temp', - tempIndexMappings: expect.any(Object), - transformedDocBatches: [[{ _id: '1234' }]], - unusedTypesQuery: expect.any(Object), - versionAlias: '.my-so-index_7.11.0', - versionIndex: '.my-so-index_7.11.0_001', - }, - }, - }, - ], - ]); - }); - it('rejects and logs the error when an action throws with an ResponseError', async () => { + + it('rejects and logs the error when an action throws with a ResponseError', async () => { await expect( migrationStateActionMachine({ initialState: { ...initialState, reason: 'the fatal reason' } as State, @@ -384,9 +220,6 @@ describe('migrationsStateActionMachine', () => { Array [ "[.my-so-index] Unexpected Elasticsearch ResponseError: statusCode: 200, method: POST, url: /mock error: [snapshot_in_progress_exception]: Cannot delete indices that are being snapshotted,", ], - Array [ - "[.my-so-index] migration failed, dumping execution log:", - ], ], "fatal": Array [], "info": Array [], @@ -417,9 +250,6 @@ describe('migrationsStateActionMachine', () => { Array [ [Error: this action throws], ], - Array [ - "[.my-so-index] migration failed, dumping execution log:", - ], ], "fatal": Array [], "info": Array [], @@ -429,116 +259,6 @@ describe('migrationsStateActionMachine', () => { } `); }); - it('logs all state transitions and action responses when an action throws', async () => { - try { - await migrationStateActionMachine({ - initialState: { ...initialState, reason: 'the fatal reason' } as State, - logger: mockLogger.get(), - model: transitionModel(['LEGACY_REINDEX', 'LEGACY_DELETE', 'FATAL']), - next: (state) => { - if (state.controlState === 'LEGACY_DELETE') throw new Error('this action throws'); - return () => Promise.resolve('hello'); - }, - client: esClient, - }); - } catch (e) { - /** ignore */ - } - // Ignore the first 4 log entries that come from our model - const executionLogLogs = loggingSystemMock.collect(mockLogger).info.slice(4); - expect(executionLogLogs).toEqual([ - ['[.my-so-index] INIT RESPONSE', 'hello'], - [ - '[.my-so-index] INIT -> LEGACY_REINDEX', - { - kibana: { - migrationState: { - batchSize: 1000, - maxBatchSizeBytes: 1e8, - controlState: 'LEGACY_REINDEX', - currentAlias: '.my-so-index', - excludeFromUpgradeFilterHooks: {}, - indexPrefix: '.my-so-index', - kibanaVersion: '7.11.0', - knownTypes: [], - legacyIndex: '.my-so-index', - logs: [ - { - level: 'info', - message: 'Log from LEGACY_REINDEX control state', - }, - ], - outdatedDocuments: [], - outdatedDocumentsQuery: expect.any(Object), - preMigrationScript: { - _tag: 'None', - }, - reason: 'the fatal reason', - retryAttempts: 5, - retryCount: 0, - retryDelay: 0, - targetIndexMappings: { - properties: {}, - }, - tempIndex: '.my-so-index_7.11.0_reindex_temp', - tempIndexMappings: expect.any(Object), - transformedDocBatches: [], - unusedTypesQuery: expect.any(Object), - versionAlias: '.my-so-index_7.11.0', - versionIndex: '.my-so-index_7.11.0_001', - }, - }, - }, - ], - ['[.my-so-index] LEGACY_REINDEX RESPONSE', 'hello'], - [ - '[.my-so-index] LEGACY_REINDEX -> LEGACY_DELETE', - { - kibana: { - migrationState: { - batchSize: 1000, - maxBatchSizeBytes: 1e8, - controlState: 'LEGACY_DELETE', - currentAlias: '.my-so-index', - excludeFromUpgradeFilterHooks: {}, - indexPrefix: '.my-so-index', - kibanaVersion: '7.11.0', - knownTypes: [], - legacyIndex: '.my-so-index', - logs: [ - { - level: 'info', - message: 'Log from LEGACY_REINDEX control state', - }, - { - level: 'info', - message: 'Log from LEGACY_DELETE control state', - }, - ], - outdatedDocuments: [], - outdatedDocumentsQuery: expect.any(Object), - preMigrationScript: { - _tag: 'None', - }, - reason: 'the fatal reason', - retryAttempts: 5, - retryCount: 0, - retryDelay: 0, - targetIndexMappings: { - properties: {}, - }, - tempIndex: '.my-so-index_7.11.0_reindex_temp', - tempIndexMappings: expect.any(Object), - transformedDocBatches: [], - unusedTypesQuery: expect.any(Object), - versionAlias: '.my-so-index_7.11.0', - versionIndex: '.my-so-index_7.11.0_001', - }, - }, - }, - ], - ]); - }); describe('cleanup', () => { beforeEach(() => { cleanupMock.mockClear(); diff --git a/src/core/server/saved_objects/migrationsv2/migrations_state_action_machine.ts b/src/core/server/saved_objects/migrationsv2/migrations_state_action_machine.ts index 58c299b77fc60..d4ad724911277 100644 --- a/src/core/server/saved_objects/migrationsv2/migrations_state_action_machine.ts +++ b/src/core/server/saved_objects/migrationsv2/migrations_state_action_machine.ts @@ -16,41 +16,24 @@ import { cleanup } from './migrations_state_machine_cleanup'; import { ReindexSourceToTempIndex, ReindexSourceToTempIndexBulk, State } from './types'; import { SavedObjectsRawDoc } from '../serialization'; -interface StateLogMeta extends LogMeta { +interface StateTransitionLogMeta extends LogMeta { kibana: { - migrationState: State; + migrations: { + state: State; + duration: number; + }; }; } -/** @internal */ -export type ExecutionLog = Array< - | { - type: 'transition'; - prevControlState: State['controlState']; - controlState: State['controlState']; - state: State; - } - | { - type: 'response'; - controlState: State['controlState']; - res: unknown; - } - | { - type: 'cleanup'; - state: State; - message: string; - } ->; - const logStateTransition = ( logger: Logger, logMessagePrefix: string, - oldState: State, - newState: State, + prevState: State, + currState: State, tookMs: number ) => { - if (newState.logs.length > oldState.logs.length) { - newState.logs.slice(oldState.logs.length).forEach(({ message, level }) => { + if (currState.logs.length > prevState.logs.length) { + currState.logs.slice(prevState.logs.length).forEach(({ message, level }) => { switch (level) { case 'error': return logger.error(logMessagePrefix + message); @@ -65,7 +48,18 @@ const logStateTransition = ( } logger.info( - logMessagePrefix + `${oldState.controlState} -> ${newState.controlState}. took: ${tookMs}ms.` + logMessagePrefix + `${prevState.controlState} -> ${currState.controlState}. took: ${tookMs}ms.` + ); + logger.debug( + logMessagePrefix + `${prevState.controlState} -> ${currState.controlState}. took: ${tookMs}ms.`, + { + kibana: { + migrations: { + state: currState, + duration: tookMs, + }, + }, + } ); }; @@ -77,24 +71,6 @@ const logActionResponse = ( ) => { logger.debug(logMessagePrefix + `${state.controlState} RESPONSE`, res as LogMeta); }; -const dumpExecutionLog = (logger: Logger, logMessagePrefix: string, executionLog: ExecutionLog) => { - logger.error(logMessagePrefix + 'migration failed, dumping execution log:'); - executionLog.forEach((log) => { - if (log.type === 'transition') { - logger.info( - logMessagePrefix + `${log.prevControlState} -> ${log.controlState}`, - { - kibana: { - migrationState: log.state, - }, - } - ); - } - if (log.type === 'response') { - logger.info(logMessagePrefix + `${log.controlState} RESPONSE`, log.res as LogMeta); - } - }); -}; /** * A specialized migrations-specific state-action machine that: @@ -118,7 +94,6 @@ export async function migrationStateActionMachine({ model: Model; client: ElasticsearchClient; }) { - const executionLog: ExecutionLog = []; const startTime = Date.now(); // Since saved object index names usually start with a `.` and can be // configured by users to include several `.`'s we can't use a logger tag to @@ -132,11 +107,6 @@ export async function migrationStateActionMachine({ (state) => next(state), (state, res) => { lastState = state; - executionLog.push({ - type: 'response', - res, - controlState: state.controlState, - }); logActionResponse(logger, logMessagePrefix, state, res); const newState = model(state, res); // Redact the state to reduce the memory consumption and so that we @@ -158,12 +128,7 @@ export async function migrationStateActionMachine({ ).map((batches) => batches.map((doc) => ({ _id: doc._id }))) as [SavedObjectsRawDoc[]], }, }; - executionLog.push({ - type: 'transition', - state: redactedNewState, - controlState: newState.controlState, - prevControlState: state.controlState, - }); + const now = Date.now(); logStateTransition( logger, @@ -195,8 +160,11 @@ export async function migrationStateActionMachine({ }; } } else if (finalState.controlState === 'FATAL') { - await cleanup(client, executionLog, finalState); - dumpExecutionLog(logger, logMessagePrefix, executionLog); + try { + await cleanup(client, finalState); + } catch (e) { + logger.warn('Failed to cleanup after migrations:', e.message); + } return Promise.reject( new Error( `Unable to complete saved object migrations for the [${initialState.indexPrefix}] index: ` + @@ -207,7 +175,11 @@ export async function migrationStateActionMachine({ throw new Error('Invalid terminating control state'); } } catch (e) { - await cleanup(client, executionLog, lastState); + try { + await cleanup(client, lastState); + } catch (err) { + logger.warn('Failed to cleanup after migrations:', err.message); + } if (e instanceof EsErrors.ResponseError) { // Log the failed request. This is very similar to the // elasticsearch-service's debug logs, but we log everything in single @@ -219,15 +191,12 @@ export async function migrationStateActionMachine({ req.statusCode }, method: ${req.method}, url: ${req.url} error: ${getErrorMessage(e)},`; logger.error(logMessagePrefix + failedRequestMessage); - dumpExecutionLog(logger, logMessagePrefix, executionLog); throw new Error( `Unable to complete saved object migrations for the [${initialState.indexPrefix}] index. Please check the health of your Elasticsearch cluster and try again. ${failedRequestMessage}` ); } else { logger.error(e); - dumpExecutionLog(logger, logMessagePrefix, executionLog); - const newError = new Error( `Unable to complete saved object migrations for the [${initialState.indexPrefix}] index. ${e}` ); diff --git a/src/core/server/saved_objects/migrationsv2/migrations_state_machine_cleanup.ts b/src/core/server/saved_objects/migrationsv2/migrations_state_machine_cleanup.ts index e9cb33c0aa54a..9c0ef0d1a2cb6 100644 --- a/src/core/server/saved_objects/migrationsv2/migrations_state_machine_cleanup.ts +++ b/src/core/server/saved_objects/migrationsv2/migrations_state_machine_cleanup.ts @@ -9,23 +9,10 @@ import type { ElasticsearchClient } from '../../elasticsearch'; import * as Actions from './actions'; import type { State } from './types'; -import type { ExecutionLog } from './migrations_state_action_machine'; -export async function cleanup( - client: ElasticsearchClient, - executionLog: ExecutionLog, - state?: State -) { +export async function cleanup(client: ElasticsearchClient, state?: State) { if (!state) return; if ('sourceIndexPitId' in state) { - try { - await Actions.closePit({ client, pitId: state.sourceIndexPitId })(); - } catch (e) { - executionLog.push({ - type: 'cleanup', - state, - message: e.message, - }); - } + await Actions.closePit({ client, pitId: state.sourceIndexPitId })(); } } diff --git a/src/core/server/saved_objects/migrationsv2/test_helpers/retry.test.ts b/src/core/server/saved_objects/migrationsv2/test_helpers/retry.test.ts index 246f61c71ae4d..8294a61caae6e 100644 --- a/src/core/server/saved_objects/migrationsv2/test_helpers/retry.test.ts +++ b/src/core/server/saved_objects/migrationsv2/test_helpers/retry.test.ts @@ -52,6 +52,8 @@ describe('retry', () => { }, { retryAttempts: 3, retryDelayMs: 100 } ); - expect(Date.now() - now).toBeGreaterThanOrEqual(200); + // Would expect it to take 200ms but seems like timing inaccuracies + // sometimes causes the duration to be measured as 199ms + expect(Date.now() - now).toBeGreaterThanOrEqual(199); }); }); diff --git a/src/core/server/saved_objects/routes/bulk_create.ts b/src/core/server/saved_objects/routes/bulk_create.ts index 344a0d151cfb9..f8438a70d0418 100644 --- a/src/core/server/saved_objects/routes/bulk_create.ts +++ b/src/core/server/saved_objects/routes/bulk_create.ts @@ -8,11 +8,11 @@ import { schema } from '@kbn/config-schema'; import { IRouter } from '../../http'; -import { CoreUsageDataSetup } from '../../core_usage_data'; +import { InternalCoreUsageDataSetup } from '../../core_usage_data'; import { catchAndReturnBoomErrors } from './utils'; interface RouteDependencies { - coreUsageData: CoreUsageDataSetup; + coreUsageData: InternalCoreUsageDataSetup; } export const registerBulkCreateRoute = (router: IRouter, { coreUsageData }: RouteDependencies) => { diff --git a/src/core/server/saved_objects/routes/bulk_get.ts b/src/core/server/saved_objects/routes/bulk_get.ts index cf051d6cd25cc..cffa69b06f4e4 100644 --- a/src/core/server/saved_objects/routes/bulk_get.ts +++ b/src/core/server/saved_objects/routes/bulk_get.ts @@ -8,11 +8,11 @@ import { schema } from '@kbn/config-schema'; import { IRouter } from '../../http'; -import { CoreUsageDataSetup } from '../../core_usage_data'; +import { InternalCoreUsageDataSetup } from '../../core_usage_data'; import { catchAndReturnBoomErrors } from './utils'; interface RouteDependencies { - coreUsageData: CoreUsageDataSetup; + coreUsageData: InternalCoreUsageDataSetup; } export const registerBulkGetRoute = (router: IRouter, { coreUsageData }: RouteDependencies) => { diff --git a/src/core/server/saved_objects/routes/bulk_update.ts b/src/core/server/saved_objects/routes/bulk_update.ts index de47ab9c59611..277673971dabe 100644 --- a/src/core/server/saved_objects/routes/bulk_update.ts +++ b/src/core/server/saved_objects/routes/bulk_update.ts @@ -8,11 +8,11 @@ import { schema } from '@kbn/config-schema'; import { IRouter } from '../../http'; -import { CoreUsageDataSetup } from '../../core_usage_data'; +import { InternalCoreUsageDataSetup } from '../../core_usage_data'; import { catchAndReturnBoomErrors } from './utils'; interface RouteDependencies { - coreUsageData: CoreUsageDataSetup; + coreUsageData: InternalCoreUsageDataSetup; } export const registerBulkUpdateRoute = (router: IRouter, { coreUsageData }: RouteDependencies) => { diff --git a/src/core/server/saved_objects/routes/create.ts b/src/core/server/saved_objects/routes/create.ts index 2fa7acfb6cab6..0e321aa7031f2 100644 --- a/src/core/server/saved_objects/routes/create.ts +++ b/src/core/server/saved_objects/routes/create.ts @@ -8,11 +8,11 @@ import { schema } from '@kbn/config-schema'; import { IRouter } from '../../http'; -import { CoreUsageDataSetup } from '../../core_usage_data'; +import { InternalCoreUsageDataSetup } from '../../core_usage_data'; import { catchAndReturnBoomErrors } from './utils'; interface RouteDependencies { - coreUsageData: CoreUsageDataSetup; + coreUsageData: InternalCoreUsageDataSetup; } export const registerCreateRoute = (router: IRouter, { coreUsageData }: RouteDependencies) => { diff --git a/src/core/server/saved_objects/routes/delete.ts b/src/core/server/saved_objects/routes/delete.ts index fe08acf23fd23..e8404ba7fc8cf 100644 --- a/src/core/server/saved_objects/routes/delete.ts +++ b/src/core/server/saved_objects/routes/delete.ts @@ -8,11 +8,11 @@ import { schema } from '@kbn/config-schema'; import { IRouter } from '../../http'; -import { CoreUsageDataSetup } from '../../core_usage_data'; +import { InternalCoreUsageDataSetup } from '../../core_usage_data'; import { catchAndReturnBoomErrors } from './utils'; interface RouteDependencies { - coreUsageData: CoreUsageDataSetup; + coreUsageData: InternalCoreUsageDataSetup; } export const registerDeleteRoute = (router: IRouter, { coreUsageData }: RouteDependencies) => { diff --git a/src/core/server/saved_objects/routes/deprecations/delete_unknown_types.ts b/src/core/server/saved_objects/routes/deprecations/delete_unknown_types.ts new file mode 100644 index 0000000000000..a9e1a41f01d91 --- /dev/null +++ b/src/core/server/saved_objects/routes/deprecations/delete_unknown_types.ts @@ -0,0 +1,45 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { IRouter } from '../../../http'; +import { catchAndReturnBoomErrors } from '../utils'; +import { deleteUnknownTypeObjects } from '../../deprecations'; +import { SavedObjectConfig } from '../../saved_objects_config'; +import { KibanaConfigType } from '../../../kibana_config'; + +interface RouteDependencies { + config: SavedObjectConfig; + kibanaConfig: KibanaConfigType; + kibanaVersion: string; +} + +export const registerDeleteUnknownTypesRoute = ( + router: IRouter, + { config, kibanaConfig, kibanaVersion }: RouteDependencies +) => { + router.post( + { + path: '/deprecations/_delete_unknown_types', + validate: false, + }, + catchAndReturnBoomErrors(async (context, req, res) => { + await deleteUnknownTypeObjects({ + esClient: context.core.elasticsearch.client, + typeRegistry: context.core.savedObjects.typeRegistry, + savedObjectsConfig: config, + kibanaConfig, + kibanaVersion, + }); + return res.ok({ + body: { + success: true, + }, + }); + }) + ); +}; diff --git a/src/core/server/saved_objects/routes/deprecations/index.ts b/src/core/server/saved_objects/routes/deprecations/index.ts new file mode 100644 index 0000000000000..07e6b987d7c60 --- /dev/null +++ b/src/core/server/saved_objects/routes/deprecations/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 { registerDeleteUnknownTypesRoute } from './delete_unknown_types'; diff --git a/src/core/server/saved_objects/routes/export.ts b/src/core/server/saved_objects/routes/export.ts index e0293a4522fc1..e224f30a1bb02 100644 --- a/src/core/server/saved_objects/routes/export.ts +++ b/src/core/server/saved_objects/routes/export.ts @@ -11,7 +11,7 @@ import stringify from 'json-stable-stringify'; import { createPromiseFromStreams, createMapStream, createConcatStream } from '@kbn/utils'; import { IRouter, KibanaRequest } from '../../http'; -import { CoreUsageDataSetup } from '../../core_usage_data'; +import { InternalCoreUsageDataSetup } from '../../core_usage_data'; import { SavedObjectConfig } from '../saved_objects_config'; import { SavedObjectsExportByTypeOptions, @@ -22,7 +22,7 @@ import { validateTypes, validateObjects, catchAndReturnBoomErrors } from './util interface RouteDependencies { config: SavedObjectConfig; - coreUsageData: CoreUsageDataSetup; + coreUsageData: InternalCoreUsageDataSetup; } type EitherExportOptions = SavedObjectsExportByTypeOptions | SavedObjectsExportByObjectOptions; diff --git a/src/core/server/saved_objects/routes/find.ts b/src/core/server/saved_objects/routes/find.ts index d21039db30e5f..6e009f80bda7d 100644 --- a/src/core/server/saved_objects/routes/find.ts +++ b/src/core/server/saved_objects/routes/find.ts @@ -8,11 +8,11 @@ import { schema } from '@kbn/config-schema'; import { IRouter } from '../../http'; -import { CoreUsageDataSetup } from '../../core_usage_data'; +import { InternalCoreUsageDataSetup } from '../../core_usage_data'; import { catchAndReturnBoomErrors } from './utils'; interface RouteDependencies { - coreUsageData: CoreUsageDataSetup; + coreUsageData: InternalCoreUsageDataSetup; } export const registerFindRoute = (router: IRouter, { coreUsageData }: RouteDependencies) => { diff --git a/src/core/server/saved_objects/routes/get.ts b/src/core/server/saved_objects/routes/get.ts index f28822d95d814..ae0656599a1e2 100644 --- a/src/core/server/saved_objects/routes/get.ts +++ b/src/core/server/saved_objects/routes/get.ts @@ -8,11 +8,11 @@ import { schema } from '@kbn/config-schema'; import { IRouter } from '../../http'; -import { CoreUsageDataSetup } from '../../core_usage_data'; +import { InternalCoreUsageDataSetup } from '../../core_usage_data'; import { catchAndReturnBoomErrors } from './utils'; interface RouteDependencies { - coreUsageData: CoreUsageDataSetup; + coreUsageData: InternalCoreUsageDataSetup; } export const registerGetRoute = (router: IRouter, { coreUsageData }: RouteDependencies) => { diff --git a/src/core/server/saved_objects/routes/import.ts b/src/core/server/saved_objects/routes/import.ts index 6f75bcf9fd5bf..d373dd5e63bc6 100644 --- a/src/core/server/saved_objects/routes/import.ts +++ b/src/core/server/saved_objects/routes/import.ts @@ -10,14 +10,14 @@ import { Readable } from 'stream'; import { extname } from 'path'; import { schema } from '@kbn/config-schema'; import { IRouter } from '../../http'; -import { CoreUsageDataSetup } from '../../core_usage_data'; +import { InternalCoreUsageDataSetup } from '../../core_usage_data'; import { SavedObjectConfig } from '../saved_objects_config'; import { SavedObjectsImportError } from '../import'; import { catchAndReturnBoomErrors, createSavedObjectsStreamFromNdJson } from './utils'; interface RouteDependencies { config: SavedObjectConfig; - coreUsageData: CoreUsageDataSetup; + coreUsageData: InternalCoreUsageDataSetup; } interface FileStream extends Readable { diff --git a/src/core/server/saved_objects/routes/index.ts b/src/core/server/saved_objects/routes/index.ts index 930e02de7657a..461f837480789 100644 --- a/src/core/server/saved_objects/routes/index.ts +++ b/src/core/server/saved_objects/routes/index.ts @@ -7,7 +7,7 @@ */ import { InternalHttpServiceSetup } from '../../http'; -import { CoreUsageDataSetup } from '../../core_usage_data'; +import { InternalCoreUsageDataSetup } from '../../core_usage_data'; import { Logger } from '../../logging'; import { SavedObjectConfig } from '../saved_objects_config'; import { IKibanaMigrator } from '../migrations'; @@ -20,11 +20,14 @@ import { registerUpdateRoute } from './update'; import { registerBulkGetRoute } from './bulk_get'; import { registerBulkCreateRoute } from './bulk_create'; import { registerBulkUpdateRoute } from './bulk_update'; -import { registerLogLegacyImportRoute } from './log_legacy_import'; import { registerExportRoute } from './export'; import { registerImportRoute } from './import'; import { registerResolveImportErrorsRoute } from './resolve_import_errors'; import { registerMigrateRoute } from './migrate'; +import { registerLegacyImportRoute } from './legacy_import_export/import'; +import { registerLegacyExportRoute } from './legacy_import_export/export'; +import { registerDeleteUnknownTypesRoute } from './deprecations'; +import { KibanaConfigType } from '../../kibana_config'; export function registerRoutes({ http, @@ -32,12 +35,16 @@ export function registerRoutes({ logger, config, migratorPromise, + kibanaVersion, + kibanaConfig, }: { http: InternalHttpServiceSetup; - coreUsageData: CoreUsageDataSetup; + coreUsageData: InternalCoreUsageDataSetup; logger: Logger; config: SavedObjectConfig; migratorPromise: Promise; + kibanaVersion: string; + kibanaConfig: KibanaConfigType; }) { const router = http.createRouter('/api/saved_objects/'); @@ -50,12 +57,20 @@ export function registerRoutes({ registerBulkGetRoute(router, { coreUsageData }); registerBulkCreateRoute(router, { coreUsageData }); registerBulkUpdateRoute(router, { coreUsageData }); - registerLogLegacyImportRoute(router, logger); registerExportRoute(router, { config, coreUsageData }); registerImportRoute(router, { config, coreUsageData }); registerResolveImportErrorsRoute(router, { config, coreUsageData }); + const legacyRouter = http.createRouter(''); + registerLegacyImportRoute(legacyRouter, { + maxImportPayloadBytes: config.maxImportPayloadBytes, + coreUsageData, + logger, + }); + registerLegacyExportRoute(legacyRouter, { kibanaVersion, coreUsageData, logger }); + const internalRouter = http.createRouter('/internal/saved_objects/'); registerMigrateRoute(internalRouter, migratorPromise); + registerDeleteUnknownTypesRoute(internalRouter, { config, kibanaConfig, kibanaVersion }); } diff --git a/src/core/server/saved_objects/routes/integration_tests/delete_unknown_types.test.ts b/src/core/server/saved_objects/routes/integration_tests/delete_unknown_types.test.ts new file mode 100644 index 0000000000000..fef2b2d5870e0 --- /dev/null +++ b/src/core/server/saved_objects/routes/integration_tests/delete_unknown_types.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import supertest from 'supertest'; +import { UnwrapPromise } from '@kbn/utility-types'; +import { registerDeleteUnknownTypesRoute } from '../deprecations'; +import { elasticsearchServiceMock } from '../../../../../core/server/elasticsearch/elasticsearch_service.mock'; +import { typeRegistryMock } from '../../saved_objects_type_registry.mock'; +import { setupServer } from '../test_utils'; +import { KibanaConfigType } from '../../../kibana_config'; +import { SavedObjectConfig } from '../../saved_objects_config'; +import { SavedObjectsType } from 'kibana/server'; + +type SetupServerReturn = UnwrapPromise>; + +describe('POST /internal/saved_objects/deprecations/_delete_unknown_types', () => { + const kibanaVersion = '8.0.0'; + const kibanaConfig: KibanaConfigType = { + enabled: true, + index: '.kibana', + }; + const config: SavedObjectConfig = { + maxImportExportSize: 10000, + maxImportPayloadBytes: 24000000, + migration: { + enableV2: true, + } as SavedObjectConfig['migration'], + }; + + let server: SetupServerReturn['server']; + let httpSetup: SetupServerReturn['httpSetup']; + let handlerContext: SetupServerReturn['handlerContext']; + let typeRegistry: ReturnType; + let elasticsearchClient: ReturnType; + + beforeEach(async () => { + ({ server, httpSetup, handlerContext } = await setupServer()); + elasticsearchClient = elasticsearchServiceMock.createScopedClusterClient(); + typeRegistry = typeRegistryMock.create(); + + typeRegistry.getAllTypes.mockReturnValue([{ name: 'known-type' } as SavedObjectsType]); + typeRegistry.getIndex.mockImplementation((type) => `${type}-index`); + + handlerContext.savedObjects.typeRegistry = typeRegistry; + handlerContext.elasticsearch.client.asCurrentUser = elasticsearchClient.asCurrentUser; + handlerContext.elasticsearch.client.asInternalUser = elasticsearchClient.asInternalUser; + + const router = httpSetup.createRouter('/internal/saved_objects/'); + registerDeleteUnknownTypesRoute(router, { + kibanaVersion, + kibanaConfig, + config, + }); + + await server.start(); + }); + + afterEach(async () => { + await server.stop(); + }); + + it('formats successful response', async () => { + const result = await supertest(httpSetup.server.listener) + .post('/internal/saved_objects/deprecations/_delete_unknown_types') + .expect(200); + + expect(result.body).toEqual({ success: true }); + }); + + it('calls upon esClient.deleteByQuery', async () => { + await supertest(httpSetup.server.listener) + .post('/internal/saved_objects/deprecations/_delete_unknown_types') + .expect(200); + + expect(elasticsearchClient.asInternalUser.deleteByQuery).toHaveBeenCalledTimes(1); + expect(elasticsearchClient.asInternalUser.deleteByQuery).toHaveBeenCalledWith({ + index: ['known-type-index_8.0.0'], + wait_for_completion: false, + body: { + query: { + bool: { + must_not: expect.any(Array), + }, + }, + }, + }); + }); +}); diff --git a/src/core/server/saved_objects/routes/integration_tests/log_legacy_import.test.ts b/src/core/server/saved_objects/routes/integration_tests/log_legacy_import.test.ts deleted file mode 100644 index 38e94112f63e7..0000000000000 --- a/src/core/server/saved_objects/routes/integration_tests/log_legacy_import.test.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import supertest from 'supertest'; -import { UnwrapPromise } from '@kbn/utility-types'; -import { registerLogLegacyImportRoute } from '../log_legacy_import'; -import { loggingSystemMock } from '../../../logging/logging_system.mock'; -import { setupServer } from '../test_utils'; - -type SetupServerReturn = UnwrapPromise>; - -describe('POST /api/saved_objects/_log_legacy_import', () => { - let server: SetupServerReturn['server']; - let httpSetup: SetupServerReturn['httpSetup']; - let logger: ReturnType; - - beforeEach(async () => { - ({ server, httpSetup } = await setupServer()); - logger = loggingSystemMock.createLogger(); - - const router = httpSetup.createRouter('/api/saved_objects/'); - registerLogLegacyImportRoute(router, logger); - - await server.start(); - }); - - afterEach(async () => { - await server.stop(); - }); - - it('logs a warning when called', async () => { - const result = await supertest(httpSetup.server.listener) - .post('/api/saved_objects/_log_legacy_import') - .expect(200); - - expect(result.body).toEqual({ success: true }); - expect(loggingSystemMock.collect(logger).warn).toMatchInlineSnapshot(` - Array [ - Array [ - "Importing saved objects from a .json file has been deprecated", - ], - ] - `); - }); -}); diff --git a/src/core/server/saved_objects/routes/legacy_import_export/export.ts b/src/core/server/saved_objects/routes/legacy_import_export/export.ts new file mode 100644 index 0000000000000..c9a954db07e7a --- /dev/null +++ b/src/core/server/saved_objects/routes/legacy_import_export/export.ts @@ -0,0 +1,60 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import moment from 'moment'; +import { schema } from '@kbn/config-schema'; +import { InternalCoreUsageDataSetup } from 'src/core/server/core_usage_data'; +import { IRouter, Logger } from '../../..'; +import { exportDashboards } from './lib'; + +export const registerLegacyExportRoute = ( + router: IRouter, + { + kibanaVersion, + coreUsageData, + logger, + }: { kibanaVersion: string; coreUsageData: InternalCoreUsageDataSetup; logger: Logger } +) => { + router.get( + { + path: '/api/kibana/dashboards/export', + validate: { + query: schema.object({ + dashboard: schema.oneOf([schema.string(), schema.arrayOf(schema.string())]), + }), + }, + options: { + tags: ['api'], + }, + }, + async (ctx, req, res) => { + logger.warn( + "The export dashboard API '/api/kibana/dashboards/export' is deprecated. Use the saved objects export objects API '/api/saved_objects/_export' instead." + ); + + const ids = Array.isArray(req.query.dashboard) ? req.query.dashboard : [req.query.dashboard]; + const { client } = ctx.core.savedObjects; + + const usageStatsClient = coreUsageData.getClient(); + usageStatsClient.incrementLegacyDashboardsExport({ request: req }).catch(() => {}); + + const exported = await exportDashboards(ids, client, kibanaVersion); + const filename = `kibana-dashboards.${moment.utc().format('YYYY-MM-DD-HH-mm-ss')}.json`; + const body = JSON.stringify(exported, null, ' '); + + return res.ok({ + body, + headers: { + 'Content-Disposition': `attachment; filename="${filename}"`, + 'Content-Type': 'application/json', + 'Content-Length': `${Buffer.byteLength(body, 'utf8')}`, + }, + }); + } + ); +}; diff --git a/src/core/server/saved_objects/routes/legacy_import_export/import.ts b/src/core/server/saved_objects/routes/legacy_import_export/import.ts new file mode 100644 index 0000000000000..09027af810149 --- /dev/null +++ b/src/core/server/saved_objects/routes/legacy_import_export/import.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 { schema } from '@kbn/config-schema'; +import { IRouter, Logger, SavedObject } from '../../..'; +import { InternalCoreUsageDataSetup } from '../../../core_usage_data'; +import { importDashboards } from './lib'; + +export const registerLegacyImportRoute = ( + router: IRouter, + { + maxImportPayloadBytes, + coreUsageData, + logger, + }: { maxImportPayloadBytes: number; coreUsageData: InternalCoreUsageDataSetup; logger: Logger } +) => { + router.post( + { + path: '/api/kibana/dashboards/import', + validate: { + body: schema.object({ + objects: schema.arrayOf(schema.recordOf(schema.string(), schema.any())), + version: schema.maybe(schema.string()), + }), + query: schema.object({ + force: schema.boolean({ defaultValue: false }), + exclude: schema.oneOf([schema.string(), schema.arrayOf(schema.string())], { + defaultValue: [], + }), + }), + }, + options: { + tags: ['api'], + body: { + maxBytes: maxImportPayloadBytes, + }, + }, + }, + async (ctx, req, res) => { + logger.warn( + "The import dashboard API '/api/kibana/dashboards/import' is deprecated. Use the saved objects import objects API '/api/saved_objects/_import' instead." + ); + + const { client } = ctx.core.savedObjects; + const objects = req.body.objects as SavedObject[]; + const { force, exclude } = req.query; + + const usageStatsClient = coreUsageData.getClient(); + usageStatsClient.incrementLegacyDashboardsImport({ request: req }).catch(() => {}); + + const result = await importDashboards(client, objects, { + overwrite: force, + exclude: Array.isArray(exclude) ? exclude : [exclude], + }); + return res.ok({ + body: result, + }); + } + ); +}; diff --git a/src/core/server/saved_objects/routes/legacy_import_export/integration_tests/export.test.ts b/src/core/server/saved_objects/routes/legacy_import_export/integration_tests/export.test.ts new file mode 100644 index 0000000000000..f9f654023d5ff --- /dev/null +++ b/src/core/server/saved_objects/routes/legacy_import_export/integration_tests/export.test.ts @@ -0,0 +1,89 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may 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 exportObjects = [ + { + id: '1', + type: 'index-pattern', + attributes: {}, + references: [], + }, + { + id: '2', + type: 'search', + attributes: {}, + references: [ + { + name: 'ref_0', + type: 'index-pattern', + id: '1', + }, + ], + }, +]; + +jest.mock('../lib/export_dashboards', () => ({ + exportDashboards: jest.fn().mockResolvedValue({ version: 'mockversion', objects: exportObjects }), +})); + +import supertest from 'supertest'; +import type { UnwrapPromise } from '@kbn/utility-types'; +import { CoreUsageStatsClient } from '../../../../core_usage_data'; +import { coreUsageStatsClientMock } from '../../../../core_usage_data/core_usage_stats_client.mock'; +import { coreUsageDataServiceMock } from '../../../../core_usage_data/core_usage_data_service.mock'; +import { registerLegacyExportRoute } from '../export'; +import { setupServer } from '../../test_utils'; +import { loggerMock } from 'src/core/server/logging/logger.mock'; + +type SetupServerReturn = UnwrapPromise>; +let coreUsageStatsClient: jest.Mocked; + +describe('POST /api/dashboards/export', () => { + let server: SetupServerReturn['server']; + let httpSetup: SetupServerReturn['httpSetup']; + + beforeEach(async () => { + ({ server, httpSetup } = await setupServer()); + + const router = httpSetup.createRouter(''); + + coreUsageStatsClient = coreUsageStatsClientMock.create(); + coreUsageStatsClient.incrementLegacyDashboardsExport.mockRejectedValue(new Error('Oh no!')); // intentionally throw this error, which is swallowed, so we can assert that the operation does not fail + const coreUsageData = coreUsageDataServiceMock.createSetupContract(coreUsageStatsClient); + registerLegacyExportRoute(router, { + kibanaVersion: '7.14.0', + coreUsageData, + logger: loggerMock.create(), + }); + + await server.start(); + }); + + afterEach(async () => { + jest.clearAllMocks(); + await server.stop(); + }); + + it('calls exportDashboards and records usage stats', async () => { + const result = await supertest(httpSetup.server.listener).get( + '/api/kibana/dashboards/export?dashboard=942dcef0-b2cd-11e8-ad8e-85441f0c2e5c' + ); + + expect(result.status).toBe(200); + expect(result.header['content-type']).toEqual('application/json; charset=utf-8'); + expect(result.header['content-disposition']).toMatch( + /attachment; filename="kibana-dashboards.*\.json/ + ); + + expect(result.body.objects).toEqual(exportObjects); + expect(result.body.version).toEqual('mockversion'); + expect(coreUsageStatsClient.incrementLegacyDashboardsExport).toHaveBeenCalledWith({ + request: expect.anything(), + }); + }); +}); diff --git a/src/core/server/saved_objects/routes/legacy_import_export/integration_tests/import.test.ts b/src/core/server/saved_objects/routes/legacy_import_export/integration_tests/import.test.ts new file mode 100644 index 0000000000000..5ced77550c085 --- /dev/null +++ b/src/core/server/saved_objects/routes/legacy_import_export/integration_tests/import.test.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 and the Server Side Public License, v 1; you may 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 importObjects = [ + { + id: '1', + type: 'index-pattern', + attributes: {}, + references: [], + }, + { + id: '2', + type: 'search', + attributes: {}, + references: [ + { + name: 'ref_0', + type: 'index-pattern', + id: '1', + }, + ], + }, +]; + +jest.mock('../lib/import_dashboards', () => ({ + importDashboards: jest.fn().mockResolvedValue({ objects: importObjects }), +})); + +import supertest from 'supertest'; +import type { UnwrapPromise } from '@kbn/utility-types'; +import { CoreUsageStatsClient } from '../../../../core_usage_data'; +import { coreUsageStatsClientMock } from '../../../../core_usage_data/core_usage_stats_client.mock'; +import { coreUsageDataServiceMock } from '../../../../core_usage_data/core_usage_data_service.mock'; +import { registerLegacyImportRoute } from '../import'; +import { setupServer } from '../../test_utils'; +import { loggerMock } from 'src/core/server/logging/logger.mock'; + +type SetupServerReturn = UnwrapPromise>; +let coreUsageStatsClient: jest.Mocked; + +describe('POST /api/dashboards/import', () => { + let server: SetupServerReturn['server']; + let httpSetup: SetupServerReturn['httpSetup']; + + beforeEach(async () => { + ({ server, httpSetup } = await setupServer()); + + const router = httpSetup.createRouter(''); + + coreUsageStatsClient = coreUsageStatsClientMock.create(); + coreUsageStatsClient.incrementLegacyDashboardsImport.mockRejectedValue(new Error('Oh no!')); // intentionally throw this error, which is swallowed, so we can assert that the operation does not fail + const coreUsageData = coreUsageDataServiceMock.createSetupContract(coreUsageStatsClient); + registerLegacyImportRoute(router, { + maxImportPayloadBytes: 26214400, + coreUsageData, + logger: loggerMock.create(), + }); + + await server.start(); + }); + + afterEach(async () => { + jest.clearAllMocks(); + await server.stop(); + }); + + it('calls importDashboards and records usage stats', async () => { + const result = await supertest(httpSetup.server.listener) + .post('/api/kibana/dashboards/import') + .send({ version: '7.14.0', objects: importObjects }); + + expect(result.status).toBe(200); + + expect(result.body.objects).toEqual(importObjects); + expect(coreUsageStatsClient.incrementLegacyDashboardsImport).toHaveBeenCalledWith({ + request: expect.anything(), + }); + }); +}); diff --git a/src/plugins/legacy_export/server/lib/export/collect_references_deep.test.ts b/src/core/server/saved_objects/routes/legacy_import_export/lib/collect_references_deep.test.ts similarity index 98% rename from src/plugins/legacy_export/server/lib/export/collect_references_deep.test.ts rename to src/core/server/saved_objects/routes/legacy_import_export/lib/collect_references_deep.test.ts index c86ce9124eaaf..4f5da2a783cd7 100644 --- a/src/plugins/legacy_export/server/lib/export/collect_references_deep.test.ts +++ b/src/core/server/saved_objects/routes/legacy_import_export/lib/collect_references_deep.test.ts @@ -7,7 +7,7 @@ */ import { SavedObject, SavedObjectAttributes } from 'src/core/server'; -import { savedObjectsClientMock } from '../../../../../core/server/mocks'; +import { savedObjectsClientMock } from '../../../../mocks'; import { collectReferencesDeep } from './collect_references_deep'; const data: Array> = [ diff --git a/src/plugins/legacy_export/server/lib/export/collect_references_deep.ts b/src/core/server/saved_objects/routes/legacy_import_export/lib/collect_references_deep.ts similarity index 100% rename from src/plugins/legacy_export/server/lib/export/collect_references_deep.ts rename to src/core/server/saved_objects/routes/legacy_import_export/lib/collect_references_deep.ts diff --git a/src/plugins/legacy_export/server/lib/export/export_dashboards.ts b/src/core/server/saved_objects/routes/legacy_import_export/lib/export_dashboards.ts similarity index 100% rename from src/plugins/legacy_export/server/lib/export/export_dashboards.ts rename to src/core/server/saved_objects/routes/legacy_import_export/lib/export_dashboards.ts diff --git a/src/plugins/legacy_export/server/lib/import/import_dashboards.test.ts b/src/core/server/saved_objects/routes/legacy_import_export/lib/import_dashboards.test.ts similarity index 95% rename from src/plugins/legacy_export/server/lib/import/import_dashboards.test.ts rename to src/core/server/saved_objects/routes/legacy_import_export/lib/import_dashboards.test.ts index 64214e87336f7..3d23fb1b9022c 100644 --- a/src/plugins/legacy_export/server/lib/import/import_dashboards.test.ts +++ b/src/core/server/saved_objects/routes/legacy_import_export/lib/import_dashboards.test.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ -import { savedObjectsClientMock } from '../../../../../core/server/mocks'; -import { SavedObject } from '../../../../../core/server'; +import { savedObjectsClientMock } from '../../../../mocks'; +import { SavedObject } from '../../../..'; import { importDashboards } from './import_dashboards'; describe('importDashboards(req)', () => { diff --git a/src/plugins/legacy_export/server/lib/import/import_dashboards.ts b/src/core/server/saved_objects/routes/legacy_import_export/lib/import_dashboards.ts similarity index 100% rename from src/plugins/legacy_export/server/lib/import/import_dashboards.ts rename to src/core/server/saved_objects/routes/legacy_import_export/lib/import_dashboards.ts diff --git a/src/core/server/saved_objects/routes/legacy_import_export/lib/index.ts b/src/core/server/saved_objects/routes/legacy_import_export/lib/index.ts new file mode 100644 index 0000000000000..7c2fc5568256d --- /dev/null +++ b/src/core/server/saved_objects/routes/legacy_import_export/lib/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 { exportDashboards } from './export_dashboards'; +export { importDashboards } from './import_dashboards'; diff --git a/src/core/server/saved_objects/routes/log_legacy_import.ts b/src/core/server/saved_objects/routes/log_legacy_import.ts deleted file mode 100644 index 0c0b04b49b7b8..0000000000000 --- a/src/core/server/saved_objects/routes/log_legacy_import.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { IRouter } from '../../http'; -import { Logger } from '../../logging'; - -export const registerLogLegacyImportRoute = (router: IRouter, logger: Logger) => { - router.post( - { - path: '/_log_legacy_import', - validate: false, - }, - async (context, req, res) => { - logger.warn('Importing saved objects from a .json file has been deprecated'); - return res.ok({ body: { success: true } }); - } - ); -}; diff --git a/src/core/server/saved_objects/routes/resolve.ts b/src/core/server/saved_objects/routes/resolve.ts index ba409f7db7b67..78e85d17fe1fa 100644 --- a/src/core/server/saved_objects/routes/resolve.ts +++ b/src/core/server/saved_objects/routes/resolve.ts @@ -8,10 +8,10 @@ import { schema } from '@kbn/config-schema'; import { IRouter } from '../../http'; -import { CoreUsageDataSetup } from '../../core_usage_data'; +import { InternalCoreUsageDataSetup } from '../../core_usage_data'; interface RouteDependencies { - coreUsageData: CoreUsageDataSetup; + coreUsageData: InternalCoreUsageDataSetup; } export const registerResolveRoute = (router: IRouter, { coreUsageData }: RouteDependencies) => { diff --git a/src/core/server/saved_objects/routes/resolve_import_errors.ts b/src/core/server/saved_objects/routes/resolve_import_errors.ts index a05c7d30b91fd..f1fe2e9cfe431 100644 --- a/src/core/server/saved_objects/routes/resolve_import_errors.ts +++ b/src/core/server/saved_objects/routes/resolve_import_errors.ts @@ -11,13 +11,13 @@ import { Readable } from 'stream'; import { schema } from '@kbn/config-schema'; import { chain } from 'lodash'; import { IRouter } from '../../http'; -import { CoreUsageDataSetup } from '../../core_usage_data'; +import { InternalCoreUsageDataSetup } from '../../core_usage_data'; import { SavedObjectConfig } from '../saved_objects_config'; import { SavedObjectsImportError } from '../import'; import { catchAndReturnBoomErrors, createSavedObjectsStreamFromNdJson } from './utils'; interface RouteDependencies { config: SavedObjectConfig; - coreUsageData: CoreUsageDataSetup; + coreUsageData: InternalCoreUsageDataSetup; } interface FileStream extends Readable { diff --git a/src/core/server/saved_objects/routes/update.ts b/src/core/server/saved_objects/routes/update.ts index b6dd9dc8e9ace..f21fc183cdade 100644 --- a/src/core/server/saved_objects/routes/update.ts +++ b/src/core/server/saved_objects/routes/update.ts @@ -8,12 +8,12 @@ import { schema } from '@kbn/config-schema'; import { IRouter } from '../../http'; -import { CoreUsageDataSetup } from '../../core_usage_data'; +import { InternalCoreUsageDataSetup } from '../../core_usage_data'; import type { SavedObjectsUpdateOptions } from '../service/saved_objects_client'; import { catchAndReturnBoomErrors } from './utils'; interface RouteDependencies { - coreUsageData: CoreUsageDataSetup; + coreUsageData: InternalCoreUsageDataSetup; } export const registerUpdateRoute = (router: IRouter, { coreUsageData }: RouteDependencies) => { diff --git a/src/core/server/saved_objects/saved_objects_service.test.ts b/src/core/server/saved_objects/saved_objects_service.test.ts index 135996f49cea4..6477d1a3dfbeb 100644 --- a/src/core/server/saved_objects/saved_objects_service.test.ts +++ b/src/core/server/saved_objects/saved_objects_service.test.ts @@ -20,17 +20,26 @@ import { Env } from '../config'; import { configServiceMock } from '../mocks'; import { elasticsearchServiceMock } from '../elasticsearch/elasticsearch_service.mock'; import { coreUsageDataServiceMock } from '../core_usage_data/core_usage_data_service.mock'; +import { deprecationsServiceMock } from '../deprecations/deprecations_service.mock'; import { httpServiceMock } from '../http/http_service.mock'; import { httpServerMock } from '../http/http_server.mocks'; import { SavedObjectsClientFactoryProvider } from './service/lib'; import { NodesVersionCompatibility } from '../elasticsearch/version_check/ensure_es_version'; import { SavedObjectsRepository } from './service/lib/repository'; import { registerCoreObjectTypes } from './object_types'; +import { getSavedObjectsDeprecationsProvider } from './deprecations'; jest.mock('./service/lib/repository'); jest.mock('./object_types'); +jest.mock('./deprecations'); describe('SavedObjectsService', () => { + let deprecationsSetup: ReturnType; + + beforeEach(() => { + deprecationsSetup = deprecationsServiceMock.createInternalSetupContract(); + }); + const createCoreContext = ({ skipMigration = true, env, @@ -53,6 +62,7 @@ describe('SavedObjectsService', () => { return { http: httpServiceMock.createInternalSetupContract(), elasticsearch: elasticsearchMock, + deprecations: deprecationsSetup, coreUsageData: coreUsageDataServiceMock.createSetupContract(), }; }; @@ -79,6 +89,24 @@ describe('SavedObjectsService', () => { expect(mockedRegisterCoreObjectTypes).toHaveBeenCalledTimes(1); }); + it('register the deprecation provider', async () => { + const coreContext = createCoreContext(); + const soService = new SavedObjectsService(coreContext); + + const mockRegistry = deprecationsServiceMock.createSetupContract(); + deprecationsSetup.getRegistry.mockReturnValue(mockRegistry); + + const deprecations = Symbol('deprecations'); + const mockedGetSavedObjectsDeprecationsProvider = getSavedObjectsDeprecationsProvider as jest.Mock; + mockedGetSavedObjectsDeprecationsProvider.mockReturnValue(deprecations); + await soService.setup(createSetupDeps()); + + expect(deprecationsSetup.getRegistry).toHaveBeenCalledTimes(1); + expect(deprecationsSetup.getRegistry).toHaveBeenCalledWith('savedObjects'); + expect(mockRegistry.registerDeprecations).toHaveBeenCalledTimes(1); + expect(mockRegistry.registerDeprecations).toHaveBeenCalledWith(deprecations); + }); + describe('#setClientFactoryProvider', () => { it('registers the factory to the clientProvider', async () => { const coreContext = createCoreContext(); diff --git a/src/core/server/saved_objects/saved_objects_service.ts b/src/core/server/saved_objects/saved_objects_service.ts index b25e51da3a749..ee56744249c5b 100644 --- a/src/core/server/saved_objects/saved_objects_service.ts +++ b/src/core/server/saved_objects/saved_objects_service.ts @@ -16,12 +16,13 @@ import { } from './'; import { KibanaMigrator, IKibanaMigrator } from './migrations'; import { CoreContext } from '../core_context'; -import { CoreUsageDataSetup } from '../core_usage_data'; +import { InternalCoreUsageDataSetup } from '../core_usage_data'; import { ElasticsearchClient, InternalElasticsearchServiceSetup, InternalElasticsearchServiceStart, } from '../elasticsearch'; +import { InternalDeprecationsServiceSetup } from '../deprecations'; import { KibanaConfigType } from '../kibana_config'; import { SavedObjectsConfigType, @@ -44,6 +45,7 @@ import { registerRoutes } from './routes'; import { ServiceStatus } from '../status'; import { calculateStatus$ } from './status'; import { registerCoreObjectTypes } from './object_types'; +import { getSavedObjectsDeprecationsProvider } from './deprecations'; /** * Saved Objects is Kibana's data persistence mechanism allowing plugins to @@ -250,7 +252,8 @@ export interface SavedObjectsRepositoryFactory { export interface SavedObjectsSetupDeps { http: InternalHttpServiceSetup; elasticsearch: InternalElasticsearchServiceSetup; - coreUsageData: CoreUsageDataSetup; + coreUsageData: InternalCoreUsageDataSetup; + deprecations: InternalDeprecationsServiceSetup; } interface WrappedClientFactoryWrapper { @@ -286,7 +289,7 @@ export class SavedObjectsService this.logger.debug('Setting up SavedObjects service'); this.setupDeps = setupDeps; - const { http, elasticsearch, coreUsageData } = setupDeps; + const { http, elasticsearch, coreUsageData, deprecations } = setupDeps; const savedObjectsConfig = await this.coreContext.configService .atPath('savedObjects') @@ -298,6 +301,20 @@ export class SavedObjectsService .toPromise(); this.config = new SavedObjectConfig(savedObjectsConfig, savedObjectsMigrationConfig); + const kibanaConfig = await this.coreContext.configService + .atPath('kibana') + .pipe(first()) + .toPromise(); + + deprecations.getRegistry('savedObjects').registerDeprecations( + getSavedObjectsDeprecationsProvider({ + kibanaConfig, + savedObjectsConfig: this.config, + kibanaVersion: this.coreContext.env.packageInfo.version, + typeRegistry: this.typeRegistry, + }) + ); + coreUsageData.registerType(this.typeRegistry); registerRoutes({ @@ -306,6 +323,8 @@ export class SavedObjectsService logger: this.logger, config: this.config, migratorPromise: this.migrator$.pipe(first()).toPromise(), + kibanaConfig, + kibanaVersion: this.coreContext.env.packageInfo.version, }); registerCoreObjectTypes(this.typeRegistry); diff --git a/src/core/server/saved_objects/service/lib/get_index_for_type.test.ts b/src/core/server/saved_objects/service/lib/get_index_for_type.test.ts new file mode 100644 index 0000000000000..fa065b02b8050 --- /dev/null +++ b/src/core/server/saved_objects/service/lib/get_index_for_type.test.ts @@ -0,0 +1,80 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { getIndexForType } from './get_index_for_type'; +import { typeRegistryMock } from '../../saved_objects_type_registry.mock'; + +describe('getIndexForType', () => { + const kibanaVersion = '8.0.0'; + const defaultIndex = '.kibana'; + let typeRegistry: ReturnType; + + beforeEach(() => { + typeRegistry = typeRegistryMock.create(); + }); + + describe('when migV2 is enabled', () => { + const migV2Enabled = true; + + it('returns the correct index for a type specifying a custom index', () => { + typeRegistry.getIndex.mockImplementation((type) => `.${type}-index`); + expect( + getIndexForType({ + type: 'foo', + typeRegistry, + defaultIndex, + kibanaVersion, + migV2Enabled, + }) + ).toEqual('.foo-index_8.0.0'); + }); + + it('returns the correct index for a type not specifying a custom index', () => { + typeRegistry.getIndex.mockImplementation((type) => undefined); + expect( + getIndexForType({ + type: 'foo', + typeRegistry, + defaultIndex, + kibanaVersion, + migV2Enabled, + }) + ).toEqual('.kibana_8.0.0'); + }); + }); + + describe('when migV2 is disabled', () => { + const migV2Enabled = false; + + it('returns the correct index for a type specifying a custom index', () => { + typeRegistry.getIndex.mockImplementation((type) => `.${type}-index`); + expect( + getIndexForType({ + type: 'foo', + typeRegistry, + defaultIndex, + kibanaVersion, + migV2Enabled, + }) + ).toEqual('.foo-index'); + }); + + it('returns the correct index for a type not specifying a custom index', () => { + typeRegistry.getIndex.mockImplementation((type) => undefined); + expect( + getIndexForType({ + type: 'foo', + typeRegistry, + defaultIndex, + kibanaVersion, + migV2Enabled, + }) + ).toEqual('.kibana'); + }); + }); +}); diff --git a/src/core/server/saved_objects/service/lib/get_index_for_type.ts b/src/core/server/saved_objects/service/lib/get_index_for_type.ts new file mode 100644 index 0000000000000..cef477e6dd840 --- /dev/null +++ b/src/core/server/saved_objects/service/lib/get_index_for_type.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 { ISavedObjectTypeRegistry } from '../../saved_objects_type_registry'; + +interface GetIndexForTypeOptions { + type: string; + typeRegistry: ISavedObjectTypeRegistry; + migV2Enabled: boolean; + kibanaVersion: string; + defaultIndex: string; +} + +export const getIndexForType = ({ + type, + typeRegistry, + migV2Enabled, + defaultIndex, + kibanaVersion, +}: GetIndexForTypeOptions): string => { + // TODO migrationsV2: Remove once we remove migrations v1 + // This is a hacky, but it required the least amount of changes to + // existing code to support a migrations v2 index. Long term we would + // want to always use the type registry to resolve a type's index + // (including the default index). + if (migV2Enabled) { + return `${typeRegistry.getIndex(type) || defaultIndex}_${kibanaVersion}`; + } else { + return typeRegistry.getIndex(type) || defaultIndex; + } +}; diff --git a/src/core/server/saved_objects/service/lib/index.ts b/src/core/server/saved_objects/service/lib/index.ts index 661d04b8a0b2a..ec283f3d3741e 100644 --- a/src/core/server/saved_objects/service/lib/index.ts +++ b/src/core/server/saved_objects/service/lib/index.ts @@ -41,3 +41,5 @@ export type { SavedObjectsUpdateObjectsSpacesResponse, SavedObjectsUpdateObjectsSpacesResponseObject, } from './update_objects_spaces'; + +export { getIndexForType } from './get_index_for_type'; diff --git a/src/core/server/saved_objects/service/lib/repository.test.js b/src/core/server/saved_objects/service/lib/repository.test.js index 427c28ceb326c..0d7365c4b97c1 100644 --- a/src/core/server/saved_objects/service/lib/repository.test.js +++ b/src/core/server/saved_objects/service/lib/repository.test.js @@ -197,7 +197,16 @@ describe('SavedObjectsRepository', () => { { type, id, references, namespace: objectNamespace, originId }, namespace ) => { - const namespaceId = objectNamespace === 'default' ? undefined : objectNamespace ?? namespace; + let namespaces; + if (objectNamespace) { + namespaces = [objectNamespace]; + } else if (namespace) { + namespaces = Array.isArray(namespace) ? namespace : [namespace]; + } else { + namespaces = ['default']; + } + const namespaceId = namespaces[0] === 'default' ? undefined : namespaces[0]; + return { // NOTE: Elasticsearch returns more fields (_index, _type) but the SavedObjectsRepository method ignores these found: true, @@ -207,7 +216,7 @@ describe('SavedObjectsRepository', () => { ...mockVersionProps, _source: { ...(registry.isSingleNamespace(type) && { namespace: namespaceId }), - ...(registry.isMultiNamespace(type) && { namespaces: [namespaceId ?? 'default'] }), + ...(registry.isMultiNamespace(type) && { namespaces }), ...(originId && { originId }), type, [type]: { title: 'Testing' }, @@ -219,7 +228,9 @@ describe('SavedObjectsRepository', () => { }; const getMockMgetResponse = (objects, namespace) => ({ - docs: objects.map((obj) => (obj.found === false ? obj : getMockGetResponse(obj, namespace))), + docs: objects.map((obj) => + obj.found === false ? obj : getMockGetResponse(obj, obj.initialNamespaces ?? namespace) + ), }); expect.extend({ @@ -555,6 +566,25 @@ describe('SavedObjectsRepository', () => { await test(namespace); }); + it(`normalizes initialNamespaces from 'default' to undefined`, async () => { + const test = async (namespace) => { + const objects = [{ ...obj1, type: 'dashboard', initialNamespaces: ['default'] }]; + await bulkCreateSuccess(objects, { namespace, overwrite: true }); + const body = [ + { index: expect.objectContaining({ _id: `dashboard:${obj1.id}` }) }, + expect.not.objectContaining({ namespace: 'default' }), + ]; + expect(client.bulk).toHaveBeenCalledWith( + expect.objectContaining({ body }), + expect.anything() + ); + client.bulk.mockClear(); + client.mget.mockClear(); + }; + await test(undefined); + await test(namespace); + }); + it(`doesn't add namespaces to request body for any types that are not multi-namespace`, async () => { const test = async (namespace) => { const objects = [obj1, { ...obj2, type: NAMESPACE_AGNOSTIC_TYPE }]; @@ -778,6 +808,54 @@ describe('SavedObjectsRepository', () => { }); }); + it(`returns error when there is an unresolvable conflict with an existing multi-namespace saved object when using initialNamespaces (get)`, async () => { + const obj = { + ...obj3, + type: MULTI_NAMESPACE_TYPE, + initialNamespaces: ['foo-namespace', 'default'], + }; + const response1 = { + status: 200, + docs: [ + { + found: true, + _source: { + type: obj.type, + namespaces: ['bar-namespace'], + }, + }, + ], + }; + client.mget.mockResolvedValueOnce( + elasticsearchClientMock.createSuccessTransportRequestPromise(response1) + ); + const response2 = getMockBulkCreateResponse([obj1, obj2]); + client.bulk.mockResolvedValueOnce( + elasticsearchClientMock.createSuccessTransportRequestPromise(response2) + ); + + const options = { overwrite: true }; + const result = await savedObjectsRepository.bulkCreate([obj1, obj, obj2], options); + + expect(client.bulk).toHaveBeenCalled(); + expect(client.mget).toHaveBeenCalled(); + + const body1 = { docs: [expect.objectContaining({ _id: `${obj.type}:${obj.id}` })] }; + expect(client.mget).toHaveBeenCalledWith( + expect.objectContaining({ body: body1 }), + expect.anything() + ); + const body2 = [...expectObjArgs(obj1), ...expectObjArgs(obj2)]; + expect(client.bulk).toHaveBeenCalledWith( + expect.objectContaining({ body: body2 }), + expect.anything() + ); + const expectedError = expectErrorConflict(obj, { metadata: { isNotOverwritable: true } }); + expect(result).toEqual({ + saved_objects: [expectSuccess(obj1), expectedError, expectSuccess(obj2)], + }); + }); + it(`returns bulk error`, async () => { const expectedErrorResult = { type: obj3.type, id: obj3.id, error: 'Oh no, a bulk error!' }; await bulkCreateError(obj3, true, expectedErrorResult); @@ -2072,6 +2150,24 @@ describe('SavedObjectsRepository', () => { ); }); + it(`normalizes initialNamespaces from 'default' to undefined`, async () => { + await savedObjectsRepository.create('dashboard', attributes, { + id, + namespace, + initialNamespaces: ['default'], + }); + + expect(client.create).toHaveBeenCalledTimes(1); + expect(client.create).toHaveBeenNthCalledWith( + 1, + expect.objectContaining({ + id: `dashboard:${id}`, + body: expect.not.objectContaining({ namespace: 'default' }), + }), + expect.anything() + ); + }); + it(`doesn't prepend namespace to the id or add namespace or namespaces fields when using namespace-agnostic type`, async () => { await createSuccess(NAMESPACE_AGNOSTIC_TYPE, attributes, { id, namespace }); expect(client.create).toHaveBeenCalledWith( @@ -2160,6 +2256,22 @@ describe('SavedObjectsRepository', () => { expect(client.get).toHaveBeenCalled(); }); + it(`throws when there is an unresolvable conflict with an existing multi-namespace saved object when using initialNamespaces (get)`, async () => { + const response = getMockGetResponse({ type: MULTI_NAMESPACE_ISOLATED_TYPE, id }, namespace); + client.get.mockResolvedValueOnce( + elasticsearchClientMock.createSuccessTransportRequestPromise(response) + ); + await expect( + savedObjectsRepository.create(MULTI_NAMESPACE_TYPE, attributes, { + id, + overwrite: true, + initialNamespaces: ['bar-ns', 'dolly-ns'], + namespace, + }) + ).rejects.toThrowError(createConflictError(MULTI_NAMESPACE_TYPE, id)); + expect(client.get).toHaveBeenCalled(); + }); + it.todo(`throws when automatic index creation fails`); it.todo(`throws when an unexpected failure occurs`); diff --git a/src/core/server/saved_objects/service/lib/repository.ts b/src/core/server/saved_objects/service/lib/repository.ts index 7ce3a55d057eb..c425f8c40fed1 100644 --- a/src/core/server/saved_objects/service/lib/repository.ts +++ b/src/core/server/saved_objects/service/lib/repository.ts @@ -92,6 +92,7 @@ import { SavedObjectsUpdateObjectsSpacesObject, SavedObjectsUpdateObjectsSpacesOptions, } from './update_objects_spaces'; +import { getIndexForType } from './get_index_for_type'; // BEWARE: The SavedObjectClient depends on the implementation details of the SavedObjectsRepository // so any breaking changes to this repository are considered breaking changes to the SavedObjectsClient. @@ -301,13 +302,19 @@ export class SavedObjectsRepository { let savedObjectNamespaces: string[] | undefined; if (this._registry.isSingleNamespace(type)) { - savedObjectNamespace = initialNamespaces ? initialNamespaces[0] : namespace; + savedObjectNamespace = initialNamespaces + ? normalizeNamespace(initialNamespaces[0]) + : namespace; } else if (this._registry.isMultiNamespace(type)) { if (id && overwrite) { // we will overwrite a multi-namespace saved object if it exists; if that happens, ensure we preserve its included namespaces // note: this check throws an error if the object is found but does not exist in this namespace - const existingNamespaces = await this.preflightGetNamespaces(type, id, namespace); - savedObjectNamespaces = initialNamespaces || existingNamespaces; + savedObjectNamespaces = await this.preflightGetNamespaces( + type, + id, + namespace, + initialNamespaces + ); } else { savedObjectNamespaces = initialNamespaces || getSavedObjectNamespaces(namespace); } @@ -453,8 +460,14 @@ export class SavedObjectsRepository { const indexFound = bulkGetResponse?.statusCode !== 404; const actualResult = indexFound ? bulkGetResponse?.body.docs[esRequestIndex] : undefined; const docFound = indexFound && actualResult?.found === true; - // @ts-expect-error MultiGetHit._source is optional - if (docFound && !this.rawDocExistsInNamespace(actualResult!, namespace)) { + if ( + docFound && + !this.rawDocExistsInNamespaces( + // @ts-expect-error MultiGetHit._source is optional + actualResult!, + initialNamespaces ?? [SavedObjectsUtils.namespaceIdToString(namespace)] + ) + ) { const { id, type } = object; return { tag: 'Left' as 'Left', @@ -476,7 +489,9 @@ export class SavedObjectsRepository { versionProperties = getExpectedVersionProperties(version, actualResult); } else { if (this._registry.isSingleNamespace(object.type)) { - savedObjectNamespace = initialNamespaces ? initialNamespaces[0] : namespace; + savedObjectNamespace = initialNamespaces + ? normalizeNamespace(initialNamespaces[0]) + : namespace; } else if (this._registry.isMultiNamespace(object.type)) { savedObjectNamespaces = initialNamespaces || getSavedObjectNamespaces(namespace); } @@ -2085,16 +2100,13 @@ export class SavedObjectsRepository { * @param type - the type */ private getIndexForType(type: string) { - // TODO migrationsV2: Remove once we remove migrations v1 - // This is a hacky, but it required the least amount of changes to - // existing code to support a migrations v2 index. Long term we would - // want to always use the type registry to resolve a type's index - // (including the default index). - if (this._migrator.soMigrationsConfig.enableV2) { - return `${this._registry.getIndex(type) || this._index}_${this._migrator.kibanaVersion}`; - } else { - return this._registry.getIndex(type) || this._index; - } + return getIndexForType({ + type, + defaultIndex: this._index, + typeRegistry: this._registry, + kibanaVersion: this._migrator.kibanaVersion, + migV2Enabled: this._migrator.soMigrationsConfig.enableV2, + }); } /** @@ -2136,12 +2148,18 @@ export class SavedObjectsRepository { * @param type The type of the saved object. * @param id The ID of the saved object. * @param namespace The target namespace. + * @param initialNamespaces The target namespace(s) we intend to create the object in, if specified. * @returns Array of namespaces that this saved object currently includes, or (if the object does not exist yet) the namespaces that a * newly-created object will include. Value may be undefined if an existing saved object has no namespaces attribute; this should not * happen in normal operations, but it is possible if the Elasticsearch document is manually modified. * @throws Will throw an error if the saved object exists and it does not include the target namespace. */ - private async preflightGetNamespaces(type: string, id: string, namespace?: string) { + private async preflightGetNamespaces( + type: string, + id: string, + namespace: string | undefined, + initialNamespaces?: string[] + ) { if (!this._registry.isMultiNamespace(type)) { throw new Error(`Cannot make preflight get request for non-multi-namespace type '${type}'.`); } @@ -2156,17 +2174,19 @@ export class SavedObjectsRepository { } ); + const namespaces = initialNamespaces ?? [SavedObjectsUtils.namespaceIdToString(namespace)]; + const indexFound = statusCode !== 404; if (indexFound && isFoundGetResponse(body)) { - if (!this.rawDocExistsInNamespace(body, namespace)) { + if (!this.rawDocExistsInNamespaces(body, namespaces)) { throw SavedObjectsErrorHelpers.createConflictError(type, id); } - return getSavedObjectNamespaces(namespace, body); + return initialNamespaces ?? getSavedObjectNamespaces(namespace, body); } else if (isNotFoundFromUnsupportedServer({ statusCode, headers })) { // checking if the 404 is from Elasticsearch throw SavedObjectsErrorHelpers.createGenericNotFoundEsUnavailableError(type, id); } - return getSavedObjectNamespaces(namespace); + return initialNamespaces ?? getSavedObjectNamespaces(namespace); } /** diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md index aa421fe393059..ea2b9dde949b2 100644 --- a/src/core/server/server.api.md +++ b/src/core/server/server.api.md @@ -359,6 +359,16 @@ export interface CoreEnvironmentUsageData { // @internal (undocumented) export type CoreId = symbol; +// @internal +export interface CoreIncrementCounterParams { + counterName: string; + counterType?: string; + incrementBy?: number; +} + +// @internal +export type CoreIncrementUsageCounter = (params: CoreIncrementCounterParams) => void; + // @public export interface CorePreboot { // (undocumented) @@ -395,6 +405,8 @@ export interface CoreSetup void; +} + // @internal export interface CoreUsageDataStart { // (undocumented) @@ -468,6 +491,34 @@ export interface CoreUsageDataStart { // @internal export interface CoreUsageStats { + // (undocumented) + 'apiCalls.legacyDashboardExport.namespace.custom.kibanaRequest.no'?: number; + // (undocumented) + 'apiCalls.legacyDashboardExport.namespace.custom.kibanaRequest.yes'?: number; + // (undocumented) + 'apiCalls.legacyDashboardExport.namespace.custom.total'?: number; + // (undocumented) + 'apiCalls.legacyDashboardExport.namespace.default.kibanaRequest.no'?: number; + // (undocumented) + 'apiCalls.legacyDashboardExport.namespace.default.kibanaRequest.yes'?: number; + // (undocumented) + 'apiCalls.legacyDashboardExport.namespace.default.total'?: number; + // (undocumented) + 'apiCalls.legacyDashboardExport.total'?: number; + // (undocumented) + 'apiCalls.legacyDashboardImport.namespace.custom.kibanaRequest.no'?: number; + // (undocumented) + 'apiCalls.legacyDashboardImport.namespace.custom.kibanaRequest.yes'?: number; + // (undocumented) + 'apiCalls.legacyDashboardImport.namespace.custom.total'?: number; + // (undocumented) + 'apiCalls.legacyDashboardImport.namespace.default.kibanaRequest.no'?: number; + // (undocumented) + 'apiCalls.legacyDashboardImport.namespace.default.kibanaRequest.yes'?: number; + // (undocumented) + 'apiCalls.legacyDashboardImport.namespace.default.total'?: number; + // (undocumented) + 'apiCalls.legacyDashboardImport.total'?: number; // (undocumented) 'apiCalls.savedObjectsBulkCreate.namespace.custom.kibanaRequest.no'?: number; // (undocumented) @@ -887,6 +938,16 @@ export interface ErrorHttpResponseOptions { headers?: ResponseHeaders; } +// Warning: (ae-missing-release-tag) "EventLoopDelaysMonitor" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export class EventLoopDelaysMonitor { + constructor(); + collect(): IntervalHistogram; + reset(): void; + stop(): void; +} + // @public (undocumented) export interface ExecutionContextSetup { withContext(context: KibanaExecutionContext | undefined, fn: (...args: any[]) => R): R; @@ -1120,6 +1181,31 @@ export interface IKibanaSocket { }): Promise; } +// @public +export interface IntervalHistogram { + // (undocumented) + exceeds: number; + // (undocumented) + fromTimestamp: string; + // (undocumented) + lastUpdatedAt: string; + // (undocumented) + max: number; + // (undocumented) + mean: number; + // (undocumented) + min: number; + // (undocumented) + percentiles: { + 50: number; + 75: number; + 95: number; + 99: number; + }; + // (undocumented) + stddev: number; +} + // @public (undocumented) export interface IRenderOptions { includeUserSettings?: boolean; @@ -1405,7 +1491,9 @@ export interface OpsMetrics { collected_at: Date; concurrent_connections: OpsServerMetrics['concurrent_connections']; os: OpsOsMetrics; + // @deprecated process: OpsProcessMetrics; + processes: OpsProcessMetrics[]; requests: OpsServerMetrics['requests']; response_times: OpsServerMetrics['response_times']; } @@ -1446,6 +1534,7 @@ export interface OpsOsMetrics { // @public export interface OpsProcessMetrics { event_loop_delay: number; + event_loop_delay_histogram: IntervalHistogram; memory: { heap: { total_in_bytes: number; diff --git a/src/core/server/server.ts b/src/core/server/server.ts index 27c35031db46f..cd133def69a67 100644 --- a/src/core/server/server.ts +++ b/src/core/server/server.ts @@ -206,6 +206,10 @@ export class Server { executionContext: executionContextSetup, }); + const deprecationsSetup = this.deprecations.setup({ + http: httpSetup, + }); + // setup i18n prior to any other service, to have translations ready const i18nServiceSetup = await this.i18n.setup({ http: httpSetup, pluginPaths }); @@ -214,6 +218,7 @@ export class Server { const elasticsearchServiceSetup = await this.elasticsearch.setup({ http: httpSetup, executionContext: executionContextSetup, + deprecations: deprecationsSetup, }); const metricsSetup = await this.metrics.setup({ http: httpSetup }); @@ -228,6 +233,7 @@ export class Server { const savedObjectsSetup = await this.savedObjects.setup({ http: httpSetup, elasticsearch: elasticsearchServiceSetup, + deprecations: deprecationsSetup, coreUsageData: coreUsageDataSetup, }); @@ -243,6 +249,7 @@ export class Server { environment: environmentSetup, http: httpSetup, metrics: metricsSetup, + coreUsageData: coreUsageDataSetup, }); const renderingSetup = await this.rendering.setup({ @@ -258,10 +265,6 @@ export class Server { const loggingSetup = this.logging.setup(); - const deprecationsSetup = this.deprecations.setup({ - http: httpSetup, - }); - const coreSetup: InternalCoreSetup = { capabilities: capabilitiesSetup, context: contextServiceSetup, @@ -278,6 +281,7 @@ export class Server { logging: loggingSetup, metrics: metricsSetup, deprecations: deprecationsSetup, + coreUsageData: coreUsageDataSetup, }; const pluginsSetup = await this.plugins.setup(coreSetup); @@ -300,6 +304,7 @@ export class Server { const executionContextStart = this.executionContext.start(); const elasticsearchStart = await this.elasticsearch.start(); + const deprecationsStart = this.deprecations.start(); const soStartSpan = startTransaction?.startSpan('saved_objects.migration', 'migration'); const savedObjectsStart = await this.savedObjects.start({ elasticsearch: elasticsearchStart, @@ -317,7 +322,7 @@ export class Server { savedObjects: savedObjectsStart, exposedConfigsToUsage: this.plugins.getExposedPluginConfigsToUsage(), }); - const deprecationsStart = this.deprecations.start(); + this.status.start(); this.coreStart = { diff --git a/src/core/server/status/routes/integration_tests/status.test.ts b/src/core/server/status/routes/integration_tests/status.test.ts index 645ce0b241612..082be62f8dc09 100644 --- a/src/core/server/status/routes/integration_tests/status.test.ts +++ b/src/core/server/status/routes/integration_tests/status.test.ts @@ -29,6 +29,7 @@ describe('GET /api/status', () => { let server: HttpService; let httpSetup: InternalHttpServiceSetup; let metrics: jest.Mocked; + let incrementUsageCounter: jest.Mock; const setupServer = async ({ allowAnonymous = true }: { allowAnonymous?: boolean } = {}) => { const coreContext = createCoreContext({ coreId }); @@ -50,6 +51,8 @@ describe('GET /api/status', () => { d: { level: ServiceStatusLevels.critical, summary: 'd is critical' }, }); + incrementUsageCounter = jest.fn(); + const router = httpSetup.createRouter(''); registerStatusRoute({ router, @@ -71,6 +74,7 @@ describe('GET /api/status', () => { core$: status.core$, plugins$: pluginsStatus$, }, + incrementUsageCounter, }); // Register dummy auth provider for testing auth @@ -137,69 +141,75 @@ describe('GET /api/status', () => { }); describe('legacy status format', () => { - it('returns legacy status format when no query params provided', async () => { - await setupServer(); - const result = await supertest(httpSetup.server.listener).get('/api/status').expect(200); - expect(result.body.status).toEqual({ - overall: { + const legacyFormat = { + overall: { + icon: 'success', + nickname: 'Looking good', + since: expect.any(String), + state: 'green', + title: 'Green', + uiColor: 'secondary', + }, + statuses: [ + { + icon: 'success', + id: 'core:elasticsearch@9.9.9', + message: 'Service is working', + since: expect.any(String), + state: 'green', + uiColor: 'secondary', + }, + { icon: 'success', - nickname: 'Looking good', + id: 'core:savedObjects@9.9.9', + message: 'Service is working', since: expect.any(String), state: 'green', - title: 'Green', uiColor: 'secondary', }, - statuses: [ - { - icon: 'success', - id: 'core:elasticsearch@9.9.9', - message: 'Service is working', - since: expect.any(String), - state: 'green', - uiColor: 'secondary', - }, - { - icon: 'success', - id: 'core:savedObjects@9.9.9', - message: 'Service is working', - since: expect.any(String), - state: 'green', - uiColor: 'secondary', - }, - { - icon: 'success', - id: 'plugin:a@9.9.9', - message: 'a is available', - since: expect.any(String), - state: 'green', - uiColor: 'secondary', - }, - { - icon: 'warning', - id: 'plugin:b@9.9.9', - message: 'b is degraded', - since: expect.any(String), - state: 'yellow', - uiColor: 'warning', - }, - { - icon: 'danger', - id: 'plugin:c@9.9.9', - message: 'c is unavailable', - since: expect.any(String), - state: 'red', - uiColor: 'danger', - }, - { - icon: 'danger', - id: 'plugin:d@9.9.9', - message: 'd is critical', - since: expect.any(String), - state: 'red', - uiColor: 'danger', - }, - ], - }); + { + icon: 'success', + id: 'plugin:a@9.9.9', + message: 'a is available', + since: expect.any(String), + state: 'green', + uiColor: 'secondary', + }, + { + icon: 'warning', + id: 'plugin:b@9.9.9', + message: 'b is degraded', + since: expect.any(String), + state: 'yellow', + uiColor: 'warning', + }, + { + icon: 'danger', + id: 'plugin:c@9.9.9', + message: 'c is unavailable', + since: expect.any(String), + state: 'red', + uiColor: 'danger', + }, + { + icon: 'danger', + id: 'plugin:d@9.9.9', + message: 'd is critical', + since: expect.any(String), + state: 'red', + uiColor: 'danger', + }, + ], + }; + + it('returns legacy status format when v7format=true is provided', async () => { + await setupServer(); + const result = await supertest(httpSetup.server.listener) + .get('/api/status?v7format=true') + .expect(200); + expect(result.body.status).toEqual(legacyFormat); + expect(incrementUsageCounter).toHaveBeenCalledTimes(1); + expect(incrementUsageCounter).toHaveBeenCalledWith({ counterName: 'status_v7format' }); }); it('returns legacy status format when v8format=false is provided', async () => { @@ -207,109 +217,105 @@ describe('GET /api/status', () => { const result = await supertest(httpSetup.server.listener) .get('/api/status?v8format=false') .expect(200); - expect(result.body.status).toEqual({ - overall: { - icon: 'success', - nickname: 'Looking good', - since: expect.any(String), - state: 'green', - title: 'Green', - uiColor: 'secondary', - }, - statuses: [ - { - icon: 'success', - id: 'core:elasticsearch@9.9.9', - message: 'Service is working', - since: expect.any(String), - state: 'green', - uiColor: 'secondary', - }, - { - icon: 'success', - id: 'core:savedObjects@9.9.9', - message: 'Service is working', - since: expect.any(String), - state: 'green', - uiColor: 'secondary', - }, - { - icon: 'success', - id: 'plugin:a@9.9.9', - message: 'a is available', - since: expect.any(String), - state: 'green', - uiColor: 'secondary', - }, - { - icon: 'warning', - id: 'plugin:b@9.9.9', - message: 'b is degraded', - since: expect.any(String), - state: 'yellow', - uiColor: 'warning', - }, - { - icon: 'danger', - id: 'plugin:c@9.9.9', - message: 'c is unavailable', - since: expect.any(String), - state: 'red', - uiColor: 'danger', - }, - { - icon: 'danger', - id: 'plugin:d@9.9.9', - message: 'd is critical', - since: expect.any(String), - state: 'red', - uiColor: 'danger', - }, - ], - }); + expect(result.body.status).toEqual(legacyFormat); + expect(incrementUsageCounter).toHaveBeenCalledTimes(1); + expect(incrementUsageCounter).toHaveBeenCalledWith({ counterName: 'status_v7format' }); }); }); describe('v8format', () => { - it('returns new status format when v8format=true is provided', async () => { - await setupServer(); - const result = await supertest(httpSetup.server.listener) - .get('/api/status?v8format=true') - .expect(200); - expect(result.body.status).toEqual({ - core: { - elasticsearch: { - level: 'available', - summary: 'Service is working', - }, - savedObjects: { - level: 'available', - summary: 'Service is working', - }, + const newFormat = { + core: { + elasticsearch: { + level: 'available', + summary: 'Service is working', }, - overall: { + savedObjects: { level: 'available', summary: 'Service is working', }, - plugins: { - a: { - level: 'available', - summary: 'a is available', - }, - b: { - level: 'degraded', - summary: 'b is degraded', - }, - c: { - level: 'unavailable', - summary: 'c is unavailable', - }, - d: { - level: 'critical', - summary: 'd is critical', - }, + }, + overall: { + level: 'available', + summary: 'Service is working', + }, + plugins: { + a: { + level: 'available', + summary: 'a is available', + }, + b: { + level: 'degraded', + summary: 'b is degraded', + }, + c: { + level: 'unavailable', + summary: 'c is unavailable', }, - }); + d: { + level: 'critical', + summary: 'd is critical', + }, + }, + }; + + it('returns new status format when no query params are provided', async () => { + await setupServer(); + const result = await supertest(httpSetup.server.listener).get('/api/status').expect(200); + expect(result.body.status).toEqual(newFormat); + expect(incrementUsageCounter).not.toHaveBeenCalled(); + }); + + it('returns new status format when v8format=true is provided', async () => { + await setupServer(); + const result = await supertest(httpSetup.server.listener) + .get('/api/status?v8format=true') + .expect(200); + expect(result.body.status).toEqual(newFormat); + expect(incrementUsageCounter).not.toHaveBeenCalled(); + }); + + it('returns new status format when v7format=false is provided', async () => { + await setupServer(); + const result = await supertest(httpSetup.server.listener) + .get('/api/status?v7format=false') + .expect(200); + expect(result.body.status).toEqual(newFormat); + expect(incrementUsageCounter).not.toHaveBeenCalled(); + }); + }); + + describe('invalid query parameters', () => { + it('v8format=true and v7format=true', async () => { + await setupServer(); + await supertest(httpSetup.server.listener) + .get('/api/status?v8format=true&v7format=true') + .expect(400); + expect(incrementUsageCounter).not.toHaveBeenCalled(); + }); + + it('v8format=true and v7format=false', async () => { + await setupServer(); + await supertest(httpSetup.server.listener) + .get('/api/status?v8format=true&v7format=false') + .expect(400); + expect(incrementUsageCounter).not.toHaveBeenCalled(); + }); + + it('v8format=false and v7format=false', async () => { + await setupServer(); + await supertest(httpSetup.server.listener) + .get('/api/status?v8format=false&v7format=false') + .expect(400); + expect(incrementUsageCounter).not.toHaveBeenCalled(); + }); + + it('v8format=false and v7format=true', async () => { + await setupServer(); + await supertest(httpSetup.server.listener) + .get('/api/status?v8format=false&v7format=true') + .expect(400); + expect(incrementUsageCounter).not.toHaveBeenCalled(); }); }); }); diff --git a/src/core/server/status/routes/status.ts b/src/core/server/status/routes/status.ts index 43a596bd1e0ec..cef5ee05ea2e5 100644 --- a/src/core/server/status/routes/status.ts +++ b/src/core/server/status/routes/status.ts @@ -12,6 +12,7 @@ import { schema } from '@kbn/config-schema'; import { IRouter } from '../../http'; import { MetricsServiceSetup } from '../../metrics'; +import type { CoreIncrementUsageCounter } from '../../core_usage_data/types'; import { ServiceStatus, CoreStatus, ServiceStatusLevels } from '../types'; import { PluginName } from '../../plugins'; import { calculateLegacyStatus, LegacyStatusInfo } from '../legacy_status'; @@ -34,6 +35,7 @@ interface Deps { core$: Observable; plugins$: Observable>; }; + incrementUsageCounter: CoreIncrementUsageCounter; } interface StatusInfo { @@ -47,7 +49,13 @@ interface StatusHttpBody extends Omit { status: StatusInfo | LegacyStatusInfo; } -export const registerStatusRoute = ({ router, config, metrics, status }: Deps) => { +export const registerStatusRoute = ({ + router, + config, + metrics, + status, + incrementUsageCounter, +}: Deps) => { // Since the status.plugins$ observable is not subscribed to elsewhere, we need to subscribe it here to eagerly load // the plugins status when Kibana starts up so this endpoint responds quickly on first boot. const combinedStatus$ = new ReplaySubject< @@ -63,9 +71,19 @@ export const registerStatusRoute = ({ router, config, metrics, status }: Deps) = tags: ['api'], // ensures that unauthenticated calls receive a 401 rather than a 302 redirect to login page }, validate: { - query: schema.object({ - v8format: schema.boolean({ defaultValue: false }), - }), + query: schema.object( + { + v7format: schema.maybe(schema.boolean()), + v8format: schema.maybe(schema.boolean()), + }, + { + validate: ({ v7format, v8format }) => { + if (typeof v7format === 'boolean' && typeof v8format === 'boolean') { + return `provide only one format option: v7format or v8format`; + } + }, + } + ), }, }, async (context, req, res) => { @@ -73,14 +91,17 @@ export const registerStatusRoute = ({ router, config, metrics, status }: Deps) = const versionWithoutSnapshot = version.replace(SNAPSHOT_POSTFIX, ''); const [overall, core, plugins] = await combinedStatus$.pipe(first()).toPromise(); + const { v8format = true, v7format = false } = req.query ?? {}; + let statusInfo: StatusInfo | LegacyStatusInfo; - if (req.query?.v8format) { + if (!v7format && v8format) { statusInfo = { overall, core, plugins, }; } else { + incrementUsageCounter({ counterName: 'status_v7format' }); statusInfo = calculateLegacyStatus({ overall, core, @@ -106,6 +127,7 @@ export const registerStatusRoute = ({ router, config, metrics, status }: Deps) = collection_interval_in_millis: metrics.collectionInterval, os: lastMetrics.os, process: lastMetrics.process, + processes: lastMetrics.processes, response_times: lastMetrics.response_times, concurrent_connections: lastMetrics.concurrent_connections, requests: { diff --git a/src/core/server/status/status_service.test.ts b/src/core/server/status/status_service.test.ts index 4ead81a6638dd..9148f69e079aa 100644 --- a/src/core/server/status/status_service.test.ts +++ b/src/core/server/status/status_service.test.ts @@ -18,6 +18,7 @@ import { httpServiceMock } from '../http/http_service.mock'; import { mockRouter, RouterMock } from '../http/router/router.mock'; import { metricsServiceMock } from '../metrics/metrics_service.mock'; import { configServiceMock } from '../config/mocks'; +import { coreUsageDataServiceMock } from '../core_usage_data/core_usage_data_service.mock'; expect.addSnapshotSerializer(ServiceStatusLevelSnapshotSerializer); @@ -51,6 +52,7 @@ describe('StatusService', () => { environment: environmentServiceMock.createSetupContract(), http: httpServiceMock.createInternalSetupContract(), metrics: metricsServiceMock.createInternalSetupContract(), + coreUsageData: coreUsageDataServiceMock.createSetupContract(), ...overrides, }; }; diff --git a/src/core/server/status/status_service.ts b/src/core/server/status/status_service.ts index 8e9db30bbebd3..107074bdb98b1 100644 --- a/src/core/server/status/status_service.ts +++ b/src/core/server/status/status_service.ts @@ -20,6 +20,7 @@ import { PluginName } from '../plugins'; import { InternalMetricsServiceSetup } from '../metrics'; import { registerStatusRoute } from './routes'; import { InternalEnvironmentServiceSetup } from '../environment'; +import type { InternalCoreUsageDataSetup } from '../core_usage_data'; import { config, StatusConfigType } from './status_config'; import { ServiceStatus, CoreStatus, InternalStatusServiceSetup } from './types'; @@ -38,6 +39,7 @@ interface SetupDeps { http: InternalHttpServiceSetup; metrics: InternalMetricsServiceSetup; savedObjects: Pick; + coreUsageData: Pick; } export class StatusService implements CoreService { @@ -61,6 +63,7 @@ export class StatusService implements CoreService { metrics, savedObjects, environment, + coreUsageData, }: SetupDeps) { const statusConfig = await this.config$.pipe(take(1)).toPromise(); const core$ = this.setupCoreStatus({ elasticsearch, savedObjects }); @@ -101,6 +104,7 @@ export class StatusService implements CoreService { plugins$: this.pluginsStatus.getAll$(), core$, }, + incrementUsageCounter: coreUsageData.incrementUsageCounter, }; const router = http.createRouter(''); diff --git a/src/dev/bazel/jsts_transpiler.bzl b/src/dev/bazel/jsts_transpiler.bzl index 03033bbfa83f8..5116c73adb3c7 100644 --- a/src/dev/bazel/jsts_transpiler.bzl +++ b/src/dev/bazel/jsts_transpiler.bzl @@ -2,28 +2,42 @@ load("@npm//@babel/cli:index.bzl", _babel = "babel") -def jsts_transpiler(name, srcs, build_pkg_name, root_input_dir = "src", config_file = ".babelrc", additional_args = ["--quiet"], **kwargs): +def jsts_transpiler(name, srcs, build_pkg_name, web = False, root_input_dir = "src", additional_args = ["--quiet"], **kwargs): """A macro around the autogenerated babel rule. Args: name: target name srcs: list of sources + build_pkg_name: package name into the build folder + web: setup the correct presets to consume the outputs in the browser, defaults to "False" and optimizes for node root_input_dir: defines the root input dir to transpile files from, defaults to "src" - config_file: transpiler config file, it defaults to a package local .babelrc additional_args: Any additional extra arguments, defaults to --quiet **kwargs: the rest """ + + inline_presets = [ + "--presets", + ] + + if web: + inline_presets += [ + "@kbn/babel-preset/webpack_preset", + ] + else: + inline_presets += [ + "@kbn/babel-preset/node_preset", + ] + args = [ "./%s/%s" % (build_pkg_name, root_input_dir), - "--config-file", - "./%s/%s" % (build_pkg_name, config_file), "--out-dir", "$(@D)", + "--no-babelrc", "--extensions", ".ts,.tsx,.js", - ] + additional_args + ] + inline_presets + additional_args - data = [config_file] + srcs + [ + data = srcs + [ "//packages/kbn-babel-preset", ] diff --git a/src/dev/build/args.test.ts b/src/dev/build/args.test.ts index d3ff822f9a3a3..64d89a650e62e 100644 --- a/src/dev/build/args.test.ts +++ b/src/dev/build/args.test.ts @@ -29,6 +29,7 @@ it('build default and oss dist for current platform, without packages, by defaul "createArchives": true, "createDebPackage": false, "createDockerCentOS": false, + "createDockerCloud": false, "createDockerContexts": true, "createDockerUBI": false, "createExamplePlugins": false, @@ -55,6 +56,7 @@ it('builds packages if --all-platforms is passed', () => { "createArchives": true, "createDebPackage": true, "createDockerCentOS": true, + "createDockerCloud": false, "createDockerContexts": true, "createDockerUBI": true, "createExamplePlugins": false, @@ -81,6 +83,7 @@ it('limits packages if --rpm passed with --all-platforms', () => { "createArchives": true, "createDebPackage": false, "createDockerCentOS": false, + "createDockerCloud": false, "createDockerContexts": true, "createDockerUBI": false, "createExamplePlugins": false, @@ -107,6 +110,7 @@ it('limits packages if --deb passed with --all-platforms', () => { "createArchives": true, "createDebPackage": true, "createDockerCentOS": false, + "createDockerCloud": false, "createDockerContexts": true, "createDockerUBI": false, "createExamplePlugins": false, @@ -134,6 +138,7 @@ it('limits packages if --docker passed with --all-platforms', () => { "createArchives": true, "createDebPackage": false, "createDockerCentOS": true, + "createDockerCloud": false, "createDockerContexts": true, "createDockerUBI": true, "createExamplePlugins": false, @@ -168,6 +173,7 @@ it('limits packages if --docker passed with --skip-docker-ubi and --all-platform "createArchives": true, "createDebPackage": false, "createDockerCentOS": true, + "createDockerCloud": false, "createDockerContexts": true, "createDockerUBI": false, "createExamplePlugins": false, @@ -195,6 +201,7 @@ it('limits packages if --all-platforms passed with --skip-docker-centos', () => "createArchives": true, "createDebPackage": true, "createDockerCentOS": false, + "createDockerCloud": false, "createDockerContexts": true, "createDockerUBI": true, "createExamplePlugins": false, diff --git a/src/dev/build/args.ts b/src/dev/build/args.ts index 9ee375e33d38f..1124d90be89c6 100644 --- a/src/dev/build/args.ts +++ b/src/dev/build/args.ts @@ -26,6 +26,7 @@ export function readCliArgs(argv: string[]) { 'skip-docker-contexts', 'skip-docker-ubi', 'skip-docker-centos', + 'docker-cloud', 'release', 'skip-node-download', 'verbose', @@ -103,6 +104,7 @@ export function readCliArgs(argv: string[]) { createDebPackage: isOsPackageDesired('deb'), createDockerCentOS: isOsPackageDesired('docker-images') && !Boolean(flags['skip-docker-centos']), + createDockerCloud: isOsPackageDesired('docker-images') && Boolean(flags['docker-cloud']), createDockerUBI: isOsPackageDesired('docker-images') && !Boolean(flags['skip-docker-ubi']), createDockerContexts: !Boolean(flags['skip-docker-contexts']), targetAllPlatforms: Boolean(flags['all-platforms']), diff --git a/src/dev/build/build_distributables.ts b/src/dev/build/build_distributables.ts index 1042cdc484c12..39a62c1fd35dc 100644 --- a/src/dev/build/build_distributables.ts +++ b/src/dev/build/build_distributables.ts @@ -22,6 +22,7 @@ export interface BuildOptions { createDebPackage: boolean; createDockerUBI: boolean; createDockerCentOS: boolean; + createDockerCloud: boolean; createDockerContexts: boolean; versionQualifier: string | undefined; targetAllPlatforms: boolean; @@ -127,6 +128,11 @@ export async function buildDistributables(log: ToolingLog, options: BuildOptions await run(Tasks.CreateDockerCentOS); } + if (options.createDockerCloud) { + // control w/ --docker-images and --docker-cloud + await run(Tasks.CreateDockerCloud); + } + if (options.createDockerContexts) { // control w/ --skip-docker-contexts await run(Tasks.CreateDockerContexts); diff --git a/src/dev/build/tasks/bin/scripts/kibana-verification-code b/src/dev/build/tasks/bin/scripts/kibana-verification-code new file mode 100755 index 0000000000000..e8214affc23d7 --- /dev/null +++ b/src/dev/build/tasks/bin/scripts/kibana-verification-code @@ -0,0 +1,29 @@ +#!/bin/sh +SCRIPT=$0 + +# SCRIPT may be an arbitrarily deep series of symlinks. Loop until we have the concrete path. +while [ -h "$SCRIPT" ] ; do + ls=$(ls -ld "$SCRIPT") + # Drop everything prior to -> + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=$(dirname "$SCRIPT")/"$link" + fi +done + +DIR="$(dirname "${SCRIPT}")/.." +CONFIG_DIR=${KBN_PATH_CONF:-"$DIR/config"} +NODE="${DIR}/node/bin/node" +test -x "$NODE" +if [ ! -x "$NODE" ]; then + echo "unable to find usable node.js executable." + exit 1 +fi + +if [ -f "${CONFIG_DIR}/node.options" ]; then + KBN_NODE_OPTS="$(grep -v ^# < ${CONFIG_DIR}/node.options | xargs)" +fi + +NODE_OPTIONS="$KBN_NODE_OPTS $NODE_OPTIONS" "${NODE}" "${DIR}/src/cli_verification_code/dist" "$@" diff --git a/src/dev/build/tasks/bin/scripts/kibana-verification-code.bat b/src/dev/build/tasks/bin/scripts/kibana-verification-code.bat new file mode 100755 index 0000000000000..9202244e951e4 --- /dev/null +++ b/src/dev/build/tasks/bin/scripts/kibana-verification-code.bat @@ -0,0 +1,35 @@ +@echo off + +SETLOCAL ENABLEDELAYEDEXPANSION + +set SCRIPT_DIR=%~dp0 +for %%I in ("%SCRIPT_DIR%..") do set DIR=%%~dpfI + +set NODE=%DIR%\node\node.exe + +If Not Exist "%NODE%" ( + Echo unable to find usable node.js executable. + Exit /B 1 +) + +set CONFIG_DIR=%KBN_PATH_CONF% +If ["%KBN_PATH_CONF%"] == [] ( + set "CONFIG_DIR=%DIR%\config" +) + +IF EXIST "%CONFIG_DIR%\node.options" ( + for /F "usebackq eol=# tokens=*" %%i in ("%CONFIG_DIR%\node.options") do ( + If [!NODE_OPTIONS!] == [] ( + set "NODE_OPTIONS=%%i" + ) Else ( + set "NODE_OPTIONS=!NODE_OPTIONS! %%i" + ) + ) +) + +TITLE Kibana Verification Code +"%NODE%" "%DIR%\src\cli_verification_code\dist" %* + +:finally + +ENDLOCAL diff --git a/src/dev/build/tasks/create_empty_dirs_and_files_task.ts b/src/dev/build/tasks/create_empty_dirs_and_files_task.ts index 06b402c580151..26ed25e801475 100644 --- a/src/dev/build/tasks/create_empty_dirs_and_files_task.ts +++ b/src/dev/build/tasks/create_empty_dirs_and_files_task.ts @@ -12,9 +12,6 @@ export const CreateEmptyDirsAndFiles: Task = { description: 'Creating some empty directories and files to prevent file-permission issues', async run(config, log, build) { - await Promise.all([ - mkdirp(build.resolvePath('plugins')), - mkdirp(build.resolvePath('data/optimize')), - ]); + await Promise.all([mkdirp(build.resolvePath('plugins')), mkdirp(build.resolvePath('data'))]); }, }; diff --git a/src/dev/build/tasks/os_packages/create_os_package_kibana_yml.ts b/src/dev/build/tasks/os_packages/create_os_package_kibana_yml.ts index e7137ada02182..be21bc4930591 100644 --- a/src/dev/build/tasks/os_packages/create_os_package_kibana_yml.ts +++ b/src/dev/build/tasks/os_packages/create_os_package_kibana_yml.ts @@ -8,6 +8,7 @@ import { readFileSync, writeFileSync } from 'fs'; import { resolve } from 'path'; +import { dump } from 'js-yaml'; import { Build, Config, mkdirp } from '../../lib'; export async function createOSPackageKibanaYML(config: Config, build: Build) { @@ -21,7 +22,25 @@ export async function createOSPackageKibanaYML(config: Config, build: Build) { [ [/#pid.file:.*/g, 'pid.file: /run/kibana/kibana.pid'], - [/#logging.dest:.*/g, 'logging.dest: /var/log/kibana/kibana.log'], + [ + /#logging.dest:.*/g, + dump({ + logging: { + appenders: { + file: { + type: 'file', + fileName: '/var/log/kibana/kibana.log', + layout: { + type: 'json', + }, + }, + }, + root: { + appenders: ['default', 'file'], + }, + }, + }), + ], ].forEach((options) => { const [regex, setting] = options; const diff = kibanaYML; diff --git a/src/dev/build/tasks/os_packages/create_os_package_tasks.ts b/src/dev/build/tasks/os_packages/create_os_package_tasks.ts index 67a9e86ee2073..ab9a7ce65cbc6 100644 --- a/src/dev/build/tasks/os_packages/create_os_package_tasks.ts +++ b/src/dev/build/tasks/os_packages/create_os_package_tasks.ts @@ -91,6 +91,25 @@ export const CreateDockerUBI: Task = { }, }; +export const CreateDockerCloud: Task = { + description: 'Creating Docker Cloud image', + + async run(config, log, build) { + await runDockerGenerator(config, log, build, { + architecture: 'x64', + context: false, + cloud: true, + image: true, + }); + await runDockerGenerator(config, log, build, { + architecture: 'aarch64', + context: false, + cloud: true, + image: true, + }); + }, +}; + export const CreateDockerContexts: Task = { description: 'Creating Docker build contexts', @@ -111,5 +130,10 @@ export const CreateDockerContexts: Task = { context: true, image: false, }); + await runDockerGenerator(config, log, build, { + cloud: true, + context: true, + image: false, + }); }, }; diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker index 0af087f1427d7..cee43fd85c90f 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker @@ -73,10 +73,11 @@ kibana_vars=( enterpriseSearch.host externalUrl.policy i18n.locale + interactiveSetup.enabled + interactiveSetup.connectionCheck.interval interpreter.enableInVisualize kibana.autocompleteTerminateAfter kibana.autocompleteTimeout - kibana.defaultAppId kibana.index logging.appenders logging.appenders.console @@ -199,7 +200,6 @@ kibana_vars=( tilemap.options.minZoom tilemap.options.subdomains tilemap.url - timelion.enabled url_drilldown.enabled vega.enableExternalUrls vis_type_vega.enableExternalUrls @@ -383,6 +383,7 @@ kibana_vars=( xpack.security.session.lifespan xpack.security.sessionTimeout xpack.securitySolution.alertMergeStrategy + xpack.securitySolution.alertIgnoreFields xpack.securitySolution.endpointResultListDefaultFirstPageIndex xpack.securitySolution.endpointResultListDefaultPageSize xpack.securitySolution.maxRuleImportExportSize diff --git a/src/dev/build/tasks/os_packages/docker_generator/run.ts b/src/dev/build/tasks/os_packages/docker_generator/run.ts index cac02cae20c42..c5a4ff64d2188 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/run.ts +++ b/src/dev/build/tasks/os_packages/docker_generator/run.ts @@ -7,7 +7,7 @@ */ import { access, link, unlink, chmod } from 'fs'; -import { resolve } from 'path'; +import { resolve, basename } from 'path'; import { promisify } from 'util'; import { ToolingLog, kibanaPackageJson } from '@kbn/dev-utils'; @@ -32,6 +32,7 @@ export async function runDockerGenerator( image: boolean; ubi?: boolean; ironbank?: boolean; + cloud?: boolean; dockerBuildDate?: string; } ) { @@ -42,6 +43,7 @@ export async function runDockerGenerator( let imageFlavor = ''; if (flags.ubi) imageFlavor += `-${ubiVersionTag}`; if (flags.ironbank) imageFlavor += '-ironbank'; + if (flags.cloud) imageFlavor += '-cloud'; // General docker var config const license = 'Elastic License'; @@ -50,7 +52,10 @@ export async function runDockerGenerator( const artifactArchitecture = flags.architecture === 'aarch64' ? 'aarch64' : 'x86_64'; const artifactPrefix = `kibana-${version}-linux`; const artifactTarball = `${artifactPrefix}-${artifactArchitecture}.tar.gz`; + const metricbeatTarball = `metricbeat-${version}-linux-${artifactArchitecture}.tar.gz`; + const filebeatTarball = `filebeat-${version}-linux-${artifactArchitecture}.tar.gz`; const artifactsDir = config.resolveFromTarget('.'); + const beatsDir = config.resolveFromRepo('.beats'); const dockerBuildDate = flags.dockerBuildDate || new Date().toISOString(); // That would produce oss, default and default-ubi7 const dockerBuildDir = config.resolveFromRepo('build', 'kibana-docker', `default${imageFlavor}`); @@ -58,6 +63,13 @@ export async function runDockerGenerator( const dockerTargetFilename = config.resolveFromTarget( `kibana${imageFlavor}-${version}-docker-image${imageArchitecture}.tar.gz` ); + const dependencies = [ + resolve(artifactsDir, artifactTarball), + ...(flags.cloud + ? [resolve(beatsDir, metricbeatTarball), resolve(beatsDir, filebeatTarball)] + : []), + ]; + const scope: TemplateContext = { artifactPrefix, artifactTarball, @@ -72,6 +84,9 @@ export async function runDockerGenerator( baseOSImage, dockerBuildDate, ubi: flags.ubi, + cloud: flags.cloud, + metricbeatTarball, + filebeatTarball, ironbank: flags.ironbank, architecture: flags.architecture, revision: config.getBuildSha(), @@ -87,26 +102,8 @@ export async function runDockerGenerator( return; } - // Verify if we have the needed kibana target in order - // to build the kibana docker image. - // Also create the docker build target folder - // and delete the current linked target into the - // kibana docker build folder if we have one. - try { - await accessAsync(resolve(artifactsDir, artifactTarball)); - await mkdirp(dockerBuildDir); - await unlinkAsync(resolve(dockerBuildDir, artifactTarball)); - } catch (e) { - if (e && e.code === 'ENOENT' && e.syscall === 'access') { - throw new Error( - `Kibana linux target (${artifactTarball}) is needed in order to build ${''}the docker image. None was found at ${artifactsDir}` - ); - } - } - - // Create the kibana linux target inside the - // Kibana docker build - await linkAsync(resolve(artifactsDir, artifactTarball), resolve(dockerBuildDir, artifactTarball)); + // Create the docker build target folder + await mkdirp(dockerBuildDir); // Write all the needed docker config files // into kibana-docker folder @@ -137,6 +134,21 @@ export async function runDockerGenerator( // Only build images on native targets if (flags.image) { + // Link dependencies + for (const src of dependencies) { + const file = basename(src); + const dest = resolve(dockerBuildDir, file); + try { + await accessAsync(src); + await unlinkAsync(dest); + } catch (e) { + if (e && e.code === 'ENOENT' && e.syscall === 'access') { + throw new Error(`${src} is needed in order to build the docker image.`); + } + } + await linkAsync(src, dest); + } + await exec(log, `./build_docker.sh`, [], { cwd: dockerBuildDir, level: 'info', diff --git a/src/dev/build/tasks/os_packages/docker_generator/template_context.ts b/src/dev/build/tasks/os_packages/docker_generator/template_context.ts index 9c9949c9f57ea..075a3a8808e73 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/template_context.ts +++ b/src/dev/build/tasks/os_packages/docker_generator/template_context.ts @@ -21,6 +21,9 @@ export interface TemplateContext { dockerBuildDate: string; usePublicArtifact?: boolean; ubi?: boolean; + cloud?: boolean; + metricbeatTarball?: string; + filebeatTarball?: string; ironbank?: boolean; revision: string; architecture?: string; diff --git a/src/dev/build/tasks/os_packages/docker_generator/templates/base/Dockerfile b/src/dev/build/tasks/os_packages/docker_generator/templates/base/Dockerfile index eb4708b6ac555..078741a0d0f6c 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/templates/base/Dockerfile +++ b/src/dev/build/tasks/os_packages/docker_generator/templates/base/Dockerfile @@ -24,18 +24,27 @@ RUN cd /opt && \ {{/usePublicArtifact}} {{^usePublicArtifact}} -COPY {{artifactTarball}} /opt/kibana.tar.gz +COPY {{artifactTarball}} /tmp/kibana.tar.gz {{/usePublicArtifact}} RUN mkdir /usr/share/kibana WORKDIR /usr/share/kibana -RUN tar --strip-components=1 -zxf /opt/kibana.tar.gz +RUN tar --strip-components=1 -zxf /tmp/kibana.tar.gz # Ensure that group permissions are the same as user permissions. # This will help when relying on GID-0 to run Kibana, rather than UID-1000. # OpenShift does this, for example. # REF: https://docs.openshift.org/latest/creating_images/guidelines.html RUN chmod -R g=u /usr/share/kibana +{{#cloud}} +COPY {{filebeatTarball}} /tmp/filebeat.tar.gz +COPY {{metricbeatTarball}} /tmp/metricbeat.tar.gz + +RUN mkdir -p /opt/filebeat /opt/metricbeat && \ + tar xf /tmp/filebeat.tar.gz -C /opt/filebeat --strip-components=1 && \ + tar xf /tmp/metricbeat.tar.gz -C /opt/metricbeat --strip-components=1 +{{/cloud}} + ################################################################################ # Build stage 1 (the actual Kibana image): # @@ -86,9 +95,13 @@ RUN fc-cache -v # Bring in Kibana from the initial stage. COPY --from=builder --chown=1000:0 /usr/share/kibana /usr/share/kibana +{{#cloud}} +COPY --from=builder --chown=0:0 /opt /opt +{{/cloud}} WORKDIR /usr/share/kibana RUN ln -s /usr/share/kibana /opt/kibana +{{! Please notify @elastic/kibana-security if you want to remove or change this environment variable. }} ENV ELASTIC_CONTAINER true ENV PATH=/usr/share/kibana/bin:$PATH @@ -145,8 +158,19 @@ RUN mkdir /licenses && \ cp LICENSE.txt /licenses/LICENSE {{/ubi}} -USER kibana - ENTRYPOINT ["/bin/tini", "--"] +{{#cloud}} +CMD ["/app/kibana.sh"] +# Generate a stub command that will be overwritten at runtime +RUN mkdir /app && \ + echo -e '#!/bin/sh\nexec /usr/local/bin/kibana-docker' > /app/kibana.sh && \ + chmod 0555 /app/kibana.sh +{{/cloud}} + +{{^cloud}} CMD ["/usr/local/bin/kibana-docker"] +{{/cloud}} + + +USER kibana diff --git a/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/Dockerfile b/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/Dockerfile index c1335f6c7a396..79b089c097344 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/Dockerfile +++ b/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/Dockerfile @@ -51,6 +51,7 @@ COPY --from=prep_files --chown=1000:0 /usr/share/kibana /usr/share/kibana WORKDIR /usr/share/kibana RUN ln -s /usr/share/kibana /opt/kibana +{{! Please notify @elastic/kibana-security if you want to remove or change this environment variable. }} ENV ELASTIC_CONTAINER true ENV PATH=/usr/share/kibana/bin:$PATH diff --git a/src/dev/build/tasks/os_packages/docker_generator/templates/kibana_yml.template.ts b/src/dev/build/tasks/os_packages/docker_generator/templates/kibana_yml.template.ts index e22d8ecdd4fd8..340a035adea4c 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/templates/kibana_yml.template.ts +++ b/src/dev/build/tasks/os_packages/docker_generator/templates/kibana_yml.template.ts @@ -10,6 +10,8 @@ import dedent from 'dedent'; import { TemplateContext } from '../template_context'; +// IMPORTANT: Please notify @elastic/kibana-security if you're changing any of the Docker specific +// configuration defaults. We rely on these defaults in the interactive setup mode. function generator({ imageFlavor }: TemplateContext) { return dedent(` # diff --git a/src/dev/build/tasks/package_json/find_used_dependencies.ts b/src/dev/build/tasks/package_json/find_used_dependencies.ts index 8cb8b3c986de7..8072287996368 100644 --- a/src/dev/build/tasks/package_json/find_used_dependencies.ts +++ b/src/dev/build/tasks/package_json/find_used_dependencies.ts @@ -42,7 +42,7 @@ export async function findUsedDependencies(listedPkgDependencies: any, baseDir: // Another way would be to include an index file and import all the functions // using named imports const dynamicRequiredEntries = await globby([ - normalize(Path.resolve(baseDir, 'src/plugins/vis_type_timelion/server/**/*.js')), + normalize(Path.resolve(baseDir, 'src/plugins/vis_types/timelion/server/**/*.js')), ]); // Compose all the needed entries diff --git a/src/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index ee355d6a9811b..addedbb97f55a 100644 --- a/src/dev/license_checker/config.ts +++ b/src/dev/license_checker/config.ts @@ -75,7 +75,7 @@ export const LICENSE_OVERRIDES = { '@mapbox/jsonlint-lines-primitives@2.0.2': ['MIT'], // license in readme https://github.com/tmcw/jsonlint 'node-sql-parser@3.6.1': ['(GPL-2.0 OR MIT)'], // GPL-2.0* https://github.com/taozhi8833998/node-sql-parser '@elastic/ems-client@7.15.0': ['Elastic License 2.0'], - '@elastic/eui@37.3.1': ['SSPL-1.0 OR Elastic License 2.0'], + '@elastic/eui@37.6.0': ['SSPL-1.0 OR Elastic License 2.0'], // TODO can be removed if the https://github.com/jindw/xmldom/issues/239 is released 'xmldom@0.1.27': ['MIT'], diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index 9027e3df1e5c2..be07c9c68784e 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -60,7 +60,6 @@ export const IGNORE_FILE_GLOBS = [ // TODO fix file names in APM to remove these 'x-pack/plugins/apm/public/**/*', 'x-pack/plugins/apm/scripts/**/*', - 'x-pack/plugins/apm/e2e/**/*', 'x-pack/plugins/maps/server/fonts/**/*', @@ -69,7 +68,7 @@ export const IGNORE_FILE_GLOBS = [ '**/BUILD.bazel', // Buildkite - '.buildkite/hooks/*', + '.buildkite/*', ]; /** diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index 965a716098f33..9395c5fdf8834 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -23,6 +23,7 @@ export const storybookAliases = { expression_repeat_image: 'src/plugins/expression_repeat_image/.storybook', 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', infra: 'x-pack/plugins/infra/.storybook', security_solution: 'x-pack/plugins/security_solution/.storybook', ui_actions_enhanced: 'x-pack/plugins/ui_actions_enhanced/.storybook', diff --git a/src/dev/typescript/projects.ts b/src/dev/typescript/projects.ts index e3d8185e73e55..a9e1e0da8e97f 100644 --- a/src/dev/typescript/projects.ts +++ b/src/dev/typescript/projects.ts @@ -59,10 +59,6 @@ export const PROJECTS = [ createProject('x-pack/plugins/osquery/cypress/tsconfig.json', { name: 'osquery/cypress', }), - createProject('x-pack/plugins/apm/e2e/tsconfig.json', { - name: 'apm/cypress', - disableTypeCheck: true, - }), createProject('x-pack/plugins/apm/ftr_e2e/tsconfig.json', { name: 'apm/ftr_e2e', disableTypeCheck: true, diff --git a/src/plugins/advanced_settings/jest.config.js b/src/plugins/advanced_settings/jest.config.js index 61909cd432df4..7900d7f39b6c6 100644 --- a/src/plugins/advanced_settings/jest.config.js +++ b/src/plugins/advanced_settings/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/advanced_settings'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/advanced_settings', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/advanced_settings/{public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/apm_oss/server/index.ts b/src/plugins/apm_oss/server/index.ts index 7b16c42f4c9b9..bf6baf1876074 100644 --- a/src/plugins/apm_oss/server/index.ts +++ b/src/plugins/apm_oss/server/index.ts @@ -10,7 +10,10 @@ import { schema, TypeOf } from '@kbn/config-schema'; import { ConfigDeprecationProvider, PluginInitializerContext } from '../../../core/server'; import { APMOSSPlugin } from './plugin'; -const deprecations: ConfigDeprecationProvider = ({ unused }) => [unused('fleetMode')]; +const deprecations: ConfigDeprecationProvider = ({ unused }) => [ + unused('fleetMode'), + unused('indexPattern'), +]; export const config = { schema: schema.object({ diff --git a/src/plugins/bfetch/jest.config.js b/src/plugins/bfetch/jest.config.js index 544328ed4baf3..d01c81c8f1d82 100644 --- a/src/plugins/bfetch/jest.config.js +++ b/src/plugins/bfetch/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/bfetch'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/bfetch', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/bfetch/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/bfetch/server/plugin.ts b/src/plugins/bfetch/server/plugin.ts index 7fd46e2f6cc44..ee6ec77e63d9c 100644 --- a/src/plugins/bfetch/server/plugin.ts +++ b/src/plugins/bfetch/server/plugin.ts @@ -19,7 +19,7 @@ import type { StartServicesAccessor, } from 'src/core/server'; import { schema } from '@kbn/config-schema'; -import { Subject } from 'rxjs'; +import { map$ } from '@kbn/std'; import { StreamingResponseHandler, BatchRequestData, @@ -208,23 +208,15 @@ export class BfetchServerPlugin >(path, (request) => { const handlerInstance = handler(request); return { - getResponseStream: ({ batch }) => { - const subject = new Subject>(); - let cnt = batch.length; - batch.forEach(async (batchItem, id) => { + getResponseStream: ({ batch }) => + map$(batch, async (batchItem, id) => { try { const result = await handlerInstance.onBatchItem(batchItem); - subject.next({ id, result }); - } catch (err) { - const error = normalizeError(err); - subject.next({ id, error }); - } finally { - cnt--; - if (!cnt) subject.complete(); + return { id, result }; + } catch (error) { + return { id, error: normalizeError(error) }; } - }); - return subject; - }, + }), }; }); }; diff --git a/src/plugins/chart_expressions/expression_tagcloud/.storybook/main.js b/src/plugins/chart_expressions/expression_tagcloud/.storybook/main.js new file mode 100644 index 0000000000000..cb483d5394285 --- /dev/null +++ b/src/plugins/chart_expressions/expression_tagcloud/.storybook/main.js @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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'; +import webpackMerge from 'webpack-merge'; +import { resolve } from 'path'; + +const mockConfig = { + resolve: { + alias: { + '../format_service': resolve(__dirname, '../public/__mocks__/format_service.ts'), + }, + }, +}; + +module.exports = { + ...defaultConfig, + webpackFinal: (config) => webpackMerge(config, mockConfig), +}; diff --git a/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/__snapshots__/tagcloud_function.test.ts.snap b/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/__snapshots__/tagcloud_function.test.ts.snap index 56b24f0ae004f..da116bc50f370 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/__snapshots__/tagcloud_function.test.ts.snap +++ b/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/__snapshots__/tagcloud_function.test.ts.snap @@ -4,23 +4,35 @@ exports[`interpreter/functions#tagcloud logs correct datatable to inspector 1`] Object { "columns": Array [ Object { - "id": "col-0-1", + "id": "Count", "meta": Object { "dimensionName": "Tag size", }, "name": "Count", }, + Object { + "id": "country", + "meta": Object { + "dimensionName": "Tags", + }, + "name": "country", + }, ], "rows": Array [ Object { - "col-0-1": 0, + "Count": 0, + "country": "US", + }, + Object { + "Count": 10, + "country": "UK", }, ], "type": "datatable", } `; -exports[`interpreter/functions#tagcloud returns an object with the correct structure 1`] = ` +exports[`interpreter/functions#tagcloud returns an object with the correct structure for number accessors 1`] = ` Object { "as": "tagcloud", "type": "render", @@ -29,13 +41,22 @@ Object { "visData": Object { "columns": Array [ Object { - "id": "col-0-1", + "id": "Count", "name": "Count", }, + Object { + "id": "country", + "name": "country", + }, ], "rows": Array [ Object { - "col-0-1": 0, + "Count": 0, + "country": "US", + }, + Object { + "Count": 10, + "country": "UK", }, ], "type": "datatable", @@ -43,16 +64,81 @@ Object { "visParams": Object { "bucket": Object { "accessor": 1, + }, + "maxFontSize": 72, + "metric": Object { + "accessor": 0, + }, + "minFontSize": 18, + "orientation": "single", + "palette": Object { + "name": "default", + "type": "palette", + }, + "scale": "linear", + "showLabel": true, + }, + "visType": "tagcloud", + }, +} +`; + +exports[`interpreter/functions#tagcloud returns an object with the correct structure for string accessors 1`] = ` +Object { + "as": "tagcloud", + "type": "render", + "value": Object { + "syncColors": false, + "visData": Object { + "columns": Array [ + Object { + "id": "Count", + "name": "Count", + }, + Object { + "id": "country", + "name": "country", + }, + ], + "rows": Array [ + Object { + "Count": 0, + "country": "US", + }, + Object { + "Count": 10, + "country": "UK", + }, + ], + "type": "datatable", + }, + "visParams": Object { + "bucket": Object { + "accessor": Object { + "id": "country", + "meta": Object { + "type": "string", + }, + "name": "country", + }, "format": Object { - "id": "number", + "params": Object {}, }, + "type": "vis_dimension", }, "maxFontSize": 72, "metric": Object { - "accessor": 0, + "accessor": Object { + "id": "Count", + "meta": Object { + "type": "number", + }, + "name": "Count", + }, "format": Object { - "id": "number", + "params": Object {}, }, + "type": "vis_dimension", }, "minFontSize": 18, "orientation": "single", diff --git a/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/tagcloud_function.test.ts b/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/tagcloud_function.test.ts index 2c6e021b5107a..8abdc36704b45 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/tagcloud_function.test.ts +++ b/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/tagcloud_function.test.ts @@ -9,14 +9,23 @@ import { tagcloudFunction } from './tagcloud_function'; import { functionWrapper } from '../../../../expressions/common/expression_functions/specs/tests/utils'; +import { ExpressionValueVisDimension } from '../../../../visualizations/public'; import { Datatable } from '../../../../expressions/common/expression_types/specs'; describe('interpreter/functions#tagcloud', () => { const fn = functionWrapper(tagcloudFunction()); + const column1 = 'Count'; + const column2 = 'country'; const context = { type: 'datatable', - rows: [{ 'col-0-1': 0 }], - columns: [{ id: 'col-0-1', name: 'Count' }], + columns: [ + { id: column1, name: column1 }, + { id: column2, name: column2 }, + ], + rows: [ + { [column1]: 0, [column2]: 'US' }, + { [column1]: 10, [column2]: 'UK' }, + ], }; const visConfig = { scale: 'linear', @@ -24,12 +33,52 @@ describe('interpreter/functions#tagcloud', () => { minFontSize: 18, maxFontSize: 72, showLabel: true, - metric: { accessor: 0, format: { id: 'number' } }, - bucket: { accessor: 1, format: { id: 'number' } }, }; - it('returns an object with the correct structure', () => { - const actual = fn(context, visConfig, undefined); + const numberAccessors = { + metric: { accessor: 0 }, + bucket: { accessor: 1 }, + }; + + const stringAccessors: { + metric: ExpressionValueVisDimension; + bucket: ExpressionValueVisDimension; + } = { + metric: { + type: 'vis_dimension', + accessor: { + id: column1, + name: column1, + meta: { + type: 'number', + }, + }, + format: { + params: {}, + }, + }, + bucket: { + type: 'vis_dimension', + accessor: { + id: column2, + name: column2, + meta: { + type: 'string', + }, + }, + format: { + params: {}, + }, + }, + }; + + it('returns an object with the correct structure for number accessors', () => { + const actual = fn(context, { ...visConfig, ...numberAccessors }, undefined); + expect(actual).toMatchSnapshot(); + }); + + it('returns an object with the correct structure for string accessors', () => { + const actual = fn(context, { ...visConfig, ...stringAccessors }, undefined); expect(actual).toMatchSnapshot(); }); @@ -44,7 +93,7 @@ describe('interpreter/functions#tagcloud', () => { }, }, }; - await fn(context, visConfig, handlers as any); + await fn(context, { ...visConfig, ...numberAccessors }, handlers as any); expect(loggedTable!).toMatchSnapshot(); }); diff --git a/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/tagcloud_function.ts b/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/tagcloud_function.ts index c3553c4660ce9..2ce50e94aeda3 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/tagcloud_function.ts +++ b/src/plugins/chart_expressions/expression_tagcloud/common/expression_functions/tagcloud_function.ts @@ -8,7 +8,7 @@ import { i18n } from '@kbn/i18n'; import { prepareLogTable, Dimension } from '../../../../visualizations/common/prepare_log_table'; -import { TagCloudVisParams } from '../types'; +import { TagCloudRendererParams } from '../types'; import { ExpressionTagcloudFunction } from '../types'; import { EXPRESSION_NAME } from '../constants'; @@ -125,7 +125,7 @@ export const tagcloudFunction: ExpressionTagcloudFunction = () => { }, }, fn(input, args, handlers) { - const visParams = { + const visParams: TagCloudRendererParams = { scale: args.scale, orientation: args.orientation, minFontSize: args.minFontSize, @@ -139,7 +139,7 @@ export const tagcloudFunction: ExpressionTagcloudFunction = () => { type: 'palette', name: args.palette, }, - } as TagCloudVisParams; + }; if (handlers?.inspectorAdapters?.tables) { const argsTable: Dimension[] = [[[args.metric], dimension.tagSize]]; diff --git a/src/plugins/chart_expressions/expression_tagcloud/common/types/expression_functions.ts b/src/plugins/chart_expressions/expression_tagcloud/common/types/expression_functions.ts index b1aba30380b59..1ee0434e1603e 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/common/types/expression_functions.ts +++ b/src/plugins/chart_expressions/expression_tagcloud/common/types/expression_functions.ts @@ -10,19 +10,10 @@ import { Datatable, ExpressionFunctionDefinition, ExpressionValueRender, - SerializedFieldFormat, } from '../../../../expressions'; import { ExpressionValueVisDimension } from '../../../../visualizations/common'; import { EXPRESSION_NAME } from '../constants'; -interface Dimension { - accessor: number; - format: { - id?: string; - params?: SerializedFieldFormat; - }; -} - interface TagCloudCommonParams { scale: 'linear' | 'log' | 'square root'; orientation: 'single' | 'right angled' | 'multiple'; @@ -36,16 +27,16 @@ export interface TagCloudVisConfig extends TagCloudCommonParams { bucket?: ExpressionValueVisDimension; } -export interface TagCloudVisParams extends TagCloudCommonParams { +export interface TagCloudRendererParams extends TagCloudCommonParams { palette: PaletteOutput; - metric: Dimension; - bucket?: Dimension; + metric: ExpressionValueVisDimension; + bucket?: ExpressionValueVisDimension; } export interface TagcloudRendererConfig { visType: typeof EXPRESSION_NAME; visData: Datatable; - visParams: TagCloudVisParams; + visParams: TagCloudRendererParams; syncColors: boolean; } diff --git a/src/plugins/chart_expressions/expression_tagcloud/jest.config.js b/src/plugins/chart_expressions/expression_tagcloud/jest.config.js index c88c150d6f649..412a133b0d292 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/jest.config.js +++ b/src/plugins/chart_expressions/expression_tagcloud/jest.config.js @@ -10,4 +10,10 @@ module.exports = { preset: '@kbn/test', rootDir: '../../../../', roots: ['/src/plugins/chart_expressions/expression_tagcloud'], + coverageDirectory: + '/target/kibana-coverage/jest/src/plugins/chart_expressions/expression_tagcloud', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/chart_expressions/expression_tagcloud/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/chart_expressions/expression_tagcloud/public/__mocks__/format_service.ts b/src/plugins/chart_expressions/expression_tagcloud/public/__mocks__/format_service.ts new file mode 100644 index 0000000000000..77f6d8eb0bf37 --- /dev/null +++ b/src/plugins/chart_expressions/expression_tagcloud/public/__mocks__/format_service.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export const getFormatService = () => ({ + deserialize: (target: any) => ({ + convert: (text: string, format: string) => text, + }), +}); diff --git a/src/plugins/chart_expressions/expression_tagcloud/public/__mocks__/palettes.ts b/src/plugins/chart_expressions/expression_tagcloud/public/__mocks__/palettes.ts new file mode 100644 index 0000000000000..7ca00b58f5624 --- /dev/null +++ b/src/plugins/chart_expressions/expression_tagcloud/public/__mocks__/palettes.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 { PaletteDefinition, SeriesLayer } from '../../../../charts/public'; +import { random } from 'lodash'; + +export const getPaletteRegistry = () => { + const colors = [ + '#54B399', + '#6092C0', + '#D36086', + '#9170B8', + '#CA8EAE', + '#D6BF57', + '#B9A888', + '#DA8B45', + '#AA6556', + '#E7664C', + ]; + const mockPalette: PaletteDefinition = { + id: 'default', + title: 'My Palette', + getCategoricalColor: (_: SeriesLayer[]) => colors[random(0, colors.length - 1)], + getCategoricalColors: (num: number) => colors, + toExpression: () => ({ + type: 'expression', + chain: [ + { + type: 'function', + function: 'system_palette', + arguments: { + name: ['default'], + }, + }, + ], + }), + }; + + return { + get: (name: string) => mockPalette, + getAll: () => [mockPalette], + }; +}; + +export const palettes = { + getPalettes: async () => getPaletteRegistry(), +}; diff --git a/src/plugins/chart_expressions/expression_tagcloud/public/__stories__/tagcloud_renderer.stories.tsx b/src/plugins/chart_expressions/expression_tagcloud/public/__stories__/tagcloud_renderer.stories.tsx new file mode 100644 index 0000000000000..1e0dc2600d1a1 --- /dev/null +++ b/src/plugins/chart_expressions/expression_tagcloud/public/__stories__/tagcloud_renderer.stories.tsx @@ -0,0 +1,125 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { storiesOf } from '@storybook/react'; +import { tagcloudRenderer } from '../expression_renderers'; +import { Render } from '../../../../presentation_util/public/__stories__'; +import { TagcloudRendererConfig } from '../../common/types'; +import { palettes } from '../__mocks__/palettes'; + +const config: TagcloudRendererConfig = { + visType: 'tagcloud', + visData: { + type: 'datatable', + rows: [ + { country: 'US', Count: 14 }, + { country: 'JP', Count: 13 }, + { country: 'UK', Count: 13 }, + { country: 'CN', Count: 8 }, + { country: 'TZ', Count: 14 }, + { country: 'NL', Count: 11 }, + { country: 'AZ', Count: 14 }, + { country: 'BR', Count: 11 }, + { country: 'DE', Count: 16 }, + { country: 'SA', Count: 11 }, + { country: 'RU', Count: 9 }, + { country: 'IN', Count: 9 }, + { country: 'PH', Count: 7 }, + ], + columns: [ + { id: 'country', name: 'country', meta: { type: 'string' } }, + { id: 'Count', name: 'Count', meta: { type: 'number' } }, + ], + }, + visParams: { + scale: 'linear', + orientation: 'single', + minFontSize: 18, + maxFontSize: 72, + showLabel: true, + metric: { + type: 'vis_dimension', + accessor: { id: 'Count', name: 'Count', meta: { type: 'number' } }, + format: { id: 'string', params: {} }, + }, + bucket: { + type: 'vis_dimension', + accessor: { id: 'country', name: 'country', meta: { type: 'string' } }, + format: { id: 'string', params: {} }, + }, + palette: { type: 'palette', name: 'default' }, + }, + syncColors: false, +}; + +const containerSize = { + width: '700px', + height: '700px', +}; + +storiesOf('renderers/tag_cloud_vis', module) + .add('Default', () => { + return ( + tagcloudRenderer({ palettes })} config={config} {...containerSize} /> + ); + }) + .add('With log scale', () => { + return ( + tagcloudRenderer({ palettes })} + config={{ ...config, visParams: { ...config.visParams, scale: 'log' } }} + {...containerSize} + /> + ); + }) + .add('With square root scale', () => { + return ( + tagcloudRenderer({ palettes })} + config={{ ...config, visParams: { ...config.visParams, scale: 'square root' } }} + {...containerSize} + /> + ); + }) + .add('With right angled orientation', () => { + return ( + tagcloudRenderer({ palettes })} + config={{ ...config, visParams: { ...config.visParams, orientation: 'right angled' } }} + {...containerSize} + /> + ); + }) + .add('With multiple orientations', () => { + return ( + tagcloudRenderer({ palettes })} + config={{ ...config, visParams: { ...config.visParams, orientation: 'multiple' } }} + {...containerSize} + /> + ); + }) + .add('With hidden label', () => { + return ( + tagcloudRenderer({ palettes })} + config={{ ...config, visParams: { ...config.visParams, showLabel: false } }} + {...containerSize} + /> + ); + }) + .add('With empty results', () => { + return ( + tagcloudRenderer({ palettes })} + config={{ ...config, visData: { ...config.visData, rows: [] } }} + {...containerSize} + /> + ); + }); diff --git a/src/plugins/chart_expressions/expression_tagcloud/public/components/tag_cloud.scss b/src/plugins/chart_expressions/expression_tagcloud/public/components/tag_cloud.scss index 51b5e9dedd844..8a017150fe195 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/public/components/tag_cloud.scss +++ b/src/plugins/chart_expressions/expression_tagcloud/public/components/tag_cloud.scss @@ -9,6 +9,8 @@ flex: 1 1 0; display: flex; flex-direction: column; + // it is used for rendering at `Canvas`. + height: 100%; } .tgcChart__wrapper text { diff --git a/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.test.tsx b/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.test.tsx index 542a9c1cd9bf7..f65630e422cce 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.test.tsx +++ b/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.test.tsx @@ -6,15 +6,15 @@ * Side Public License, v 1. */ import React from 'react'; -import { Wordcloud, Settings } from '@elastic/charts'; +import { Wordcloud, Settings, WordcloudSpec } from '@elastic/charts'; import { chartPluginMock } from '../../../../charts/public/mocks'; import type { Datatable } from '../../../../expressions/public'; import { mount } from 'enzyme'; import { findTestSubject } from '@elastic/eui/lib/test'; import TagCloudChart, { TagCloudChartProps } from './tagcloud_component'; -import { TagCloudVisParams } from '../../common/types'; +import { TagCloudRendererParams } from '../../common/types'; -jest.mock('../services', () => ({ +jest.mock('../format_service', () => ({ getFormatService: jest.fn(() => { return { deserialize: jest.fn(), @@ -23,29 +23,34 @@ jest.mock('../services', () => ({ })); const palettesRegistry = chartPluginMock.createPaletteRegistry(); -const visData = ({ +const geoDestId = 'geo.dest'; +const countId = 'Count'; +const visData: Datatable = { + type: 'datatable', columns: [ { - id: 'col-0', - name: 'geo.dest: Descending', + id: geoDestId, + name: `${geoDestId}: Descending`, + meta: { type: 'string' }, }, { - id: 'col-1', + id: countId, name: 'Count', + meta: { type: 'number' }, }, ], rows: [ - { 'col-0': 'CN', 'col-1': 26 }, - { 'col-0': 'IN', 'col-1': 17 }, - { 'col-0': 'US', 'col-1': 6 }, - { 'col-0': 'DE', 'col-1': 4 }, - { 'col-0': 'BR', 'col-1': 3 }, + { [geoDestId]: 'CN', [countId]: 26 }, + { [geoDestId]: 'IN', [countId]: 17 }, + { [geoDestId]: 'US', [countId]: 6 }, + { [geoDestId]: 'DE', [countId]: 4 }, + { [geoDestId]: 'BR', [countId]: 3 }, ], -} as unknown) as Datatable; +}; -const visParams = { - bucket: { accessor: 0, format: {} }, - metric: { accessor: 1, format: {} }, +const visParams: TagCloudRendererParams = { + bucket: { type: 'vis_dimension', accessor: 0, format: { params: {} } }, + metric: { type: 'vis_dimension', accessor: 1, format: { params: {} } }, scale: 'linear', orientation: 'single', palette: { @@ -55,13 +60,42 @@ const visParams = { minFontSize: 12, maxFontSize: 70, showLabel: true, -} as TagCloudVisParams; +}; + +const formattedData: WordcloudSpec['data'] = [ + { + color: 'black', + text: 'CN', + weight: 1, + }, + { + color: 'black', + text: 'IN', + weight: 0.6086956521739131, + }, + { + color: 'black', + text: 'US', + weight: 0.13043478260869565, + }, + { + color: 'black', + text: 'DE', + weight: 0.043478260869565216, + }, + { + color: 'black', + text: 'BR', + weight: 0, + }, +]; describe('TagCloudChart', function () { - let wrapperProps: TagCloudChartProps; + let wrapperPropsWithIndexes: TagCloudChartProps; + let wrapperPropsWithColumnNames: TagCloudChartProps; beforeAll(() => { - wrapperProps = { + wrapperPropsWithIndexes = { visData, visParams, palettesRegistry, @@ -70,68 +104,77 @@ describe('TagCloudChart', function () { syncColors: false, visType: 'tagcloud', }; + + wrapperPropsWithColumnNames = { + visData, + visParams: { + ...visParams, + bucket: { + type: 'vis_dimension', + accessor: { + id: geoDestId, + name: geoDestId, + meta: { type: 'string' }, + }, + format: { id: 'string', params: {} }, + }, + metric: { + type: 'vis_dimension', + accessor: { + id: countId, + name: countId, + meta: { type: 'number' }, + }, + format: { id: 'number', params: {} }, + }, + }, + palettesRegistry, + fireEvent: jest.fn(), + renderComplete: jest.fn(), + syncColors: false, + visType: 'tagcloud', + }; }); - it('renders the Wordcloud component', async () => { - const component = mount(); + it('renders the Wordcloud component with', async () => { + const component = mount(); expect(component.find(Wordcloud).length).toBe(1); }); it('renders the label correctly', async () => { - const component = mount(); + const component = mount(); const label = findTestSubject(component, 'tagCloudLabel'); expect(label.text()).toEqual('geo.dest: Descending - Count'); }); it('not renders the label if showLabel setting is off', async () => { const newVisParams = { ...visParams, showLabel: false }; - const newProps = { ...wrapperProps, visParams: newVisParams }; + const newProps = { ...wrapperPropsWithIndexes, visParams: newVisParams }; const component = mount(); const label = findTestSubject(component, 'tagCloudLabel'); expect(label.length).toBe(0); }); - it('receives the data on the correct format', () => { - const component = mount(); - expect(component.find(Wordcloud).prop('data')).toStrictEqual([ - { - color: 'black', - text: 'CN', - weight: 1, - }, - { - color: 'black', - text: 'IN', - weight: 0.6086956521739131, - }, - { - color: 'black', - text: 'US', - weight: 0.13043478260869565, - }, - { - color: 'black', - text: 'DE', - weight: 0.043478260869565216, - }, - { - color: 'black', - text: 'BR', - weight: 0, - }, - ]); + it('receives the data in the correct format for bucket and metric accessors of type number', () => { + const component = mount(); + expect(component.find(Wordcloud).prop('data')).toStrictEqual(formattedData); + }); + + it('receives the data in the correct format for bucket and metric accessors of type DatatableColumn', () => { + const component = mount(); + expect(component.find(Wordcloud).prop('data')).toStrictEqual(formattedData); }); it('sets the angles correctly', async () => { - const newVisParams = { ...visParams, orientation: 'right angled' } as TagCloudVisParams; - const newProps = { ...wrapperProps, visParams: newVisParams }; + const newVisParams: TagCloudRendererParams = { ...visParams, orientation: 'right angled' }; + const newProps = { ...wrapperPropsWithIndexes, visParams: newVisParams }; const component = mount(); expect(component.find(Wordcloud).prop('endAngle')).toBe(90); expect(component.find(Wordcloud).prop('angleCount')).toBe(2); }); it('calls filter callback', () => { - const component = mount(); + const component = mount(); component.find(Settings).prop('onElementClick')!([ [ { @@ -145,6 +188,6 @@ describe('TagCloudChart', function () { }, ], ]); - expect(wrapperProps.fireEvent).toHaveBeenCalled(); + expect(wrapperPropsWithIndexes.fireEvent).toHaveBeenCalled(); }); }); diff --git a/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.tsx b/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.tsx index 163a2e8ce38ac..b7d38c71f5867 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.tsx +++ b/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.tsx @@ -12,8 +12,13 @@ import { throttle } from 'lodash'; import { EuiIconTip, EuiResizeObserver } from '@elastic/eui'; import { Chart, Settings, Wordcloud, RenderChangeListener } from '@elastic/charts'; import type { PaletteRegistry } from '../../../../charts/public'; -import type { IInterpreterRenderHandlers } from '../../../../expressions/public'; -import { getFormatService } from '../services'; +import { + Datatable, + DatatableColumn, + IInterpreterRenderHandlers, +} from '../../../../expressions/public'; +import { getFormatService } from '../format_service'; +import { ExpressionValueVisDimension } from '../../../../visualizations/public'; import { TagcloudRendererConfig } from '../../common/types'; import './tag_cloud.scss'; @@ -68,6 +73,17 @@ const ORIENTATIONS = { }, }; +const getColumn = ( + accessor: ExpressionValueVisDimension['accessor'], + columns: Datatable['columns'] +): DatatableColumn => { + if (typeof accessor === 'number') { + return columns[accessor]; + } + + return columns.filter(({ id }) => id === accessor.id)[0]; +}; + export const TagCloudChart = ({ visData, visParams, @@ -81,18 +97,18 @@ export const TagCloudChart = ({ const bucketFormatter = bucket ? getFormatService().deserialize(bucket.format) : null; const tagCloudData = useMemo(() => { - const tagColumn = bucket ? visData.columns[bucket.accessor].id : -1; - const metricColumn = visData.columns[metric.accessor]?.id; + const tagColumn = bucket ? getColumn(bucket.accessor, visData.columns).id : null; + const metricColumn = getColumn(metric.accessor, visData.columns).id; const metrics = visData.rows.map((row) => row[metricColumn]); - const values = bucket ? visData.rows.map((row) => row[tagColumn]) : []; + const values = bucket && tagColumn !== null ? visData.rows.map((row) => row[tagColumn]) : []; const maxValue = Math.max(...metrics); const minValue = Math.min(...metrics); return visData.rows.map((row) => { - const tag = row[tagColumn] === undefined ? 'all' : row[tagColumn]; + const tag = tagColumn === null ? 'all' : row[tagColumn]; return { - text: (bucketFormatter ? bucketFormatter.convert(tag, 'text') : tag) as string, + text: bucketFormatter ? bucketFormatter.convert(tag, 'text') : tag, weight: tag === 'all' || visData.rows.length <= 1 ? 1 @@ -112,7 +128,9 @@ export const TagCloudChart = ({ ]); const label = bucket - ? `${visData.columns[bucket.accessor].name} - ${visData.columns[metric.accessor].name}` + ? `${getColumn(bucket.accessor, visData.columns).name} - ${ + getColumn(metric.accessor, visData.columns).name + }` : ''; const onRenderChange = useCallback( @@ -133,17 +151,17 @@ export const TagCloudChart = ({ ); const handleWordClick = useCallback( - (d) => { + (elements) => { if (!bucket) { return; } - const termsBucket = visData.columns[bucket.accessor]; - const clickedValue = d[0][0].text; + const termsBucketId = getColumn(bucket.accessor, visData.columns).id; + const clickedValue = elements[0][0].text; const rowIndex = visData.rows.findIndex((row) => { const formattedValue = bucketFormatter - ? bucketFormatter.convert(row[termsBucket.id], 'text') - : row[termsBucket.id]; + ? bucketFormatter.convert(row[termsBucketId], 'text') + : row[termsBucketId]; return formattedValue === clickedValue; }); diff --git a/src/plugins/chart_expressions/expression_tagcloud/public/expression_renderers/tagcloud_renderer.tsx b/src/plugins/chart_expressions/expression_tagcloud/public/expression_renderers/tagcloud_renderer.tsx index 58e177dac6775..294371b3a5703 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/public/expression_renderers/tagcloud_renderer.tsx +++ b/src/plugins/chart_expressions/expression_tagcloud/public/expression_renderers/tagcloud_renderer.tsx @@ -5,15 +5,16 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ + import React, { lazy } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import { I18nProvider } from '@kbn/i18n/react'; +import { ClassNames } from '@emotion/react'; import { i18n } from '@kbn/i18n'; -import { ExpressionRenderDefinition } from '../../../../expressions/common'; import { VisualizationContainer } from '../../../../visualizations/public'; -import { withSuspense } from '../../../../presentation_util/public'; -import { TagcloudRendererConfig } from '../../common/types'; +import { ExpressionRenderDefinition } from '../../../../expressions/common/expression_renderers'; import { ExpressioTagcloudRendererDependencies } from '../plugin'; +import { TagcloudRendererConfig } from '../../common/types'; import { EXPRESSION_NAME } from '../../common'; export const strings = { @@ -27,8 +28,11 @@ export const strings = { }), }; -const LazyTagcloudComponent = lazy(() => import('../components/tagcloud_component')); -const TagcloudComponent = withSuspense(LazyTagcloudComponent); +const tagCloudVisClass = { + height: '100%', +}; + +const TagCloudChart = lazy(() => import('../components/tagcloud_component')); export const tagcloudRenderer: ( deps: ExpressioTagcloudRendererDependencies @@ -43,17 +47,29 @@ export const tagcloudRenderer: ( }); const palettesRegistry = await palettes.getPalettes(); + const showNoResult = config.visData.rows.length === 0; + render( - - - + + {({ css, cx }) => ( + + + + )} + , domNode ); diff --git a/src/plugins/chart_expressions/expression_tagcloud/public/services.ts b/src/plugins/chart_expressions/expression_tagcloud/public/format_service.ts similarity index 100% rename from src/plugins/chart_expressions/expression_tagcloud/public/services.ts rename to src/plugins/chart_expressions/expression_tagcloud/public/format_service.ts diff --git a/src/plugins/chart_expressions/expression_tagcloud/public/plugin.ts b/src/plugins/chart_expressions/expression_tagcloud/public/plugin.ts index 7cbc9ac7c6706..9ffb910bde213 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/public/plugin.ts +++ b/src/plugins/chart_expressions/expression_tagcloud/public/plugin.ts @@ -12,7 +12,7 @@ import { ChartsPluginSetup } from '../../../charts/public'; import { tagcloudRenderer } from './expression_renderers'; import { tagcloudFunction } from '../common/expression_functions'; import { FieldFormatsStart } from '../../../field_formats/public'; -import { setFormatService } from './services'; +import { setFormatService } from './format_service'; interface SetupDeps { expressions: ExpressionsSetup; diff --git a/src/plugins/charts/jest.config.js b/src/plugins/charts/jest.config.js index b6516c520ecf6..a4469b78b3306 100644 --- a/src/plugins/charts/jest.config.js +++ b/src/plugins/charts/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/charts'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/charts', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/charts/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/charts/public/services/palettes/helpers.ts b/src/plugins/charts/public/services/palettes/helpers.ts index d4b1e98f94cc8..bd1f8350ba9f3 100644 --- a/src/plugins/charts/public/services/palettes/helpers.ts +++ b/src/plugins/charts/public/services/palettes/helpers.ts @@ -70,7 +70,10 @@ export function workoutColorForValue( const comparisonFn = (v: number, threshold: number) => v - threshold; // if steps are defined consider the specific rangeMax/Min as data boundaries - const maxRange = stops.length ? rangeMax : dataRangeArguments[1]; + // as of max reduce its value by 1/colors.length for correct continuity checks + const maxRange = stops.length + ? rangeMax + : dataRangeArguments[1] - (dataRangeArguments[1] - dataRangeArguments[0]) / colors.length; const minRange = stops.length ? rangeMin : dataRangeArguments[0]; // in case of shorter rangers, extends the steps on the sides to cover the whole set diff --git a/src/plugins/console/README.md b/src/plugins/console/README.md index e158e82c3702f..3bb58d37d1684 100644 --- a/src/plugins/console/README.md +++ b/src/plugins/console/README.md @@ -8,7 +8,7 @@ Console provides the user with tools for storing and executing requests against ### `load_from` query parameter -The `load_from` query parameter enables opening Console with prepopulated reuqests in two ways: from the elastic.co docs and from within other parts of Kibana. +The `load_from` query parameter enables opening Console with prepopulated requests in two ways: from the elastic.co docs and from within other parts of Kibana. Plugins can open requests in Kibana by assigning this parameter a `data:text/plain` [lz-string](https://pieroxy.net/blog/pages/lz-string/index.html) encoded value. For example, navigating to `/dev_tools#/console?load_from=data:text/plain,OIUQKgBA+gzgpgQwE4GMAWAoA3gIgI4CucSAnjgFy4C2CALulAgDZMVYC+nQA` will prepopulate Console with the following request: @@ -16,3 +16,221 @@ Plugins can open requests in Kibana by assigning this parameter a `data:text/pla GET _search {"query":{"match_all":{}}} ``` + +## Architecture +Console uses Ace editor that is wrapped with [`CoreEditor`](https://github.com/elastic/kibana/blob/master/src/plugins/console/public/types/core_editor.ts), so that if needed it can easily be replaced with another editor, for example Monaco. +The autocomplete logic is located in [`autocomplete`](https://github.com/elastic/kibana/blob/master/src/plugins/console/public/lib/autocomplete) folder. Autocomplete rules are computed by classes in `components` sub-folder. + +## Autocomplete definitions +Kibana users benefit greatly from autocomplete suggestions since not all Elasticsearch APIs can be provided with a corresponding UI. Autocomplete suggestions improve usability of Console for any Elasticsearch API endpoint. +Autocomplete definitions are all created in the form of javascript objects loaded from `json` and `js` files. + +### Creating definitions +The [`generated`](https://github.com/elastic/kibana/blob/master/src/plugins/console/server/lib/spec_definitions/json/generated) folder contains definitions created automatically from Elasticsearch REST API specifications. See this [README](https://github.com/elastic/kibana/blob/master/packages/kbn-spec-to-console/README.md) file for more information on the `spec-to-console` script. + +Manually created override files in the [`overrides`](https://github.com/elastic/kibana/blob/master/src/plugins/console/server/lib/spec_definitions/json/overrides) folder contain fixes for generated files and additions for request body parameters. + +### Top level keys +Use following top level keys in the definitions objects. + +#### `documentation` +Url to Elasticsearch REST API documentation for the endpoint (If the url contains `master` or `current` strings in the path, Console automatically replaces them with the `docLinkVersion` to always redirect the user to the correct version of the documentation). + +#### `methods` +Allowed http methods (`GET`, `POST` etc) + +#### `patterns` +Array of API endpoints that contain variables like `{indices}` or `{fields}`. For example, `{indices}/_rollup/{rollup_index}`. See the [Variables](#variables) section below for more info. + +#### `url_params` +Query url parameters and their values. See the [Query url parameters](#query-url-parameters) section below for more info. An example: +```json +{ + "url_params": { + "format": "", + "local": "__flag__", + "h": [], + "expand_wildcards": [ + "open", + "closed", + "hidden", + "none", + "all" + ] + } +} +``` + +#### `priority` +Value for selecting one autocomplete definition, if several configurations are loaded from the files. The highest number takes precedence. + +#### `data_autocomplete_rules` +Request body parameters and their values. Only used in `overrides` files because REST API specs don't contain any information about body request parameters. +Refer to Elasticsearch REST API documentation when configuring this object. See the [Request body parameters](#request-body-parameters) section below for more info. An example: +```json +{ + "data_autocomplete_rules": { + "text": [], + "field": "{field}", + "analyzer": "", + "explain": { "__one_of": [false, true] } + } +} +``` + +### Query url parameters +Query url parameters are configured in form of an object, for example: +```json +{ + "url_params": { + "local": "__flag__", + "scroll": "", + "expand_wildcards": [ + "open", + "closed", + "hidden", + "none", + "all" + ] + } +} +``` +This object specifies 3 query parameters: `local` (boolean value), `scroll` (no default value) and `expand_wildcards` (with a list of accepted values). + +When the user types in the url path into Console and at least 2 characters after `?`, all matching url parameters are displayed as autocomplete suggestions. In this example, after typing +``` +GET /_some_endpoint?ca +``` +"local" and "expand_wildcards" are displayed as suggestions. +When the user types at least 2 characters after `=`, all matching values for this parameter are displayed as autocomplete suggestions. In this example, after typing +``` +GET /_some_endpoint?expand_wildcards=hi +``` +"hidden" is displayed for autocompletion. + +Variables such as `{indices}` or `{fields}` are accepted both as an url parameter and its value in the configuration object. See the [Variables](#variables) section below for more information. + +### Request body parameters +Request body parameters are configured in form of an object, for example: +```json +{ + "data_autocomplete_rules": { + "index_patterns": [], + "mappings": { "__scope_link": "put_mapping" }, + "version": 0, + "aliases": { + "__template": { + "NAME": {} + } + } + } +} +``` +Object's keys are parameters that will be displayed as autocomplete suggestions when the user starts typing request body. In this example, after typing +``` +PUT /_some_endpoint +{ + " +``` +"index_patterns", "mappings", "version" and "aliases" are displayed as autocomplete suggestions. +Object's values provide default or accepted values of request body parameters. For example, if "version" is selected from the suggestions list, value `0` is automatically filled, resulting in the following request: +``` +PUT /_some_endpoint +{ + "version": 0 +} +``` +Object's values can contain objects for nested configuration because the engine can work recursively while searching for autocomplete suggestions. + +Following values can be used in the configuration object: +#### One value from the list (`__one_of: [..., ...]`) +Use this configuration for a parameter with a list of allowed values, for example types of snapshot repository: +``` +"type": {"__one_of": ["fs", "url", "s3", "hdfs", "azure"]} +``` +The first value in the list will be automatically filled as parameter value. For example, when "type" is selected from the suggestions list, the request body is autofilled as following: +``` +PUT /_some_endpoint +{ + "type": "fs" +} +``` +But if the value `fs` is deleted, all suggestions will be displayed: "fs", "url", "s3", "hdfs" and "azure". +Use `__one_of: [true, false]` for boolean values. + +#### Array of values (`[..., ... ]` or `__any_of: [..., ...]`) +Use this configuration for parameters which accept an array of values, for example actions parameter: +``` +"actions": { "__any_of": [ "add", "remove"]} +``` +When "actions" is selected from the suggestions list, it will be autocompleted with an empty array: +``` +POST /_some_endpoint +{ + "actions": [] +} +``` +All values in the array are displayed as suggestions for parameter values inside the array. + + +#### Default object structure (`__template: {...}`) +Use this configuration to insert an object with default values into the request body when the corresponding key is typed in. +For example, in this configuration +```json +{ + "terms": { + "__template": { + "field": "", + "size": 10 + }, + "field": "{field}", + "size": 10, + "shard_size": 10, + "min_doc_count": 10 + } +} +``` +the `terms` parameter has several properties, but only `field` and `size` are autocompleted in the request body when "terms" is selected from the suggestions list. +``` +POST /_some_endpoint +{ + terms: { + field: '', + size: 10, + } +} +``` +The rest of the properties are displayed as autocomplete suggestions, when the `terms` object is being edited. + +#### Scope link (`__scope_link`) +Use this type to copy a configuration object specified in a different endpoint definition. For example, the `put_settings` endpoint definition contains a configuration object that can be reused for `settings` parameter in a different endpoint: +```json +{ + "data_autocomplete_rules": { + "settings": { + "__scope_link": "put_settings" + } + } +} +``` +#### Global scope (`GLOBAL`) +Use `GLOBAL` keyword with `__scope_link` to refer to a reusable set of definitions created in the [`globals`](https://github.com/elastic/kibana/blob/master/src/plugins/console/server/lib/spec_definitions/js/globals.ts) file. +For example: +```json +{ + "data_autocomplete_rules": { + "query": { + "__scope_link": "GLOBAL.query" + } + } +} +``` +#### Conditional definition (`__condition: { lines_regex: ... }`) +To provide a different set of autocomplete suggestions based on the value configured in the request. For example, when creating a snapshot repository of different types (`fs`, `url` etc) different properties are displayed in the suggestions list based on the type. See [snapshot.create_repository.json](https://github.com/elastic/kibana/blob/master/src/plugins/console/server/lib/spec_definitions/json/overrides/snapshot.create_repository.json) for an example. + + +### Variables +Some autocomplete definitions need to be configured with dynamic values that can't be hard coded into a json or js file, for example a list of indices in the cluster. +A list of variables is defined in the `parametrizedComponentFactories` function in [`kb.js`](https://github.com/elastic/kibana/blob/master/src/plugins/console/public/lib/kb/kb.js) file. The values of these variables are assigned dynamically for every cluster. +Use these variables with curly braces, for example `{indices}`, `{types}`, `{id}`, `{username}`, `{template}`, `{nodes}` etc. + diff --git a/src/plugins/console/jest.config.js b/src/plugins/console/jest.config.js index 0fc1bcbcfb201..08dbc96e0136c 100644 --- a/src/plugins/console/jest.config.js +++ b/src/plugins/console/jest.config.js @@ -11,4 +11,7 @@ module.exports = { rootDir: '../../..', roots: ['/src/plugins/console'], testRunner: 'jasmine2', + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/console', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/console/{common,public,server}/**/*.{js,ts,tsx}'], }; diff --git a/src/plugins/dashboard/jest.config.js b/src/plugins/dashboard/jest.config.js index 0b9ac0428c3af..d99cfe57fcd37 100644 --- a/src/plugins/dashboard/jest.config.js +++ b/src/plugins/dashboard/jest.config.js @@ -11,4 +11,7 @@ module.exports = { rootDir: '../../..', roots: ['/src/plugins/dashboard'], testRunner: 'jasmine2', + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/dashboard', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/dashboard/{common,public,server}/**/*.{ts,tsx}'], }; 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 c01cd43b1f1e3..1b24062ccd9b5 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 @@ -35,7 +35,7 @@ import { syncDashboardFilterState, loadSavedDashboardState, buildDashboardContainer, - loadDashboardUrlState, + syncDashboardUrlState, diffDashboardState, areTimeRangesEqual, } from '../lib'; @@ -127,6 +127,7 @@ export const useDashboardAppState = ({ savedDashboards, kbnUrlStateStorage, initializerContext, + savedObjectsTagging, isEmbeddedExternally, dashboardCapabilities, dispatchDashboardStateChange, @@ -151,15 +152,20 @@ export const useDashboardAppState = ({ * Combine initial state from the saved object, session storage, and URL, then dispatch it to Redux. */ const dashboardSessionStorageState = dashboardSessionStorage.getState(savedDashboardId) || {}; - const dashboardURLState = loadDashboardUrlState(dashboardBuildContext); + const forwardedAppState = loadDashboardHistoryLocationState( scopedHistory()?.location?.state as undefined | DashboardAppLocatorParams ); + const { initialDashboardStateFromUrl, stopWatchingAppStateInUrl } = syncDashboardUrlState({ + ...dashboardBuildContext, + savedDashboard, + }); + const initialDashboardState = { ...savedDashboardState, ...dashboardSessionStorageState, - ...dashboardURLState, + ...initialDashboardStateFromUrl, ...forwardedAppState, // if there is an incoming embeddable, dashboard always needs to be in edit mode to receive it. @@ -291,6 +297,7 @@ export const useDashboardAppState = ({ onDestroy = () => { stopSyncingContainerInput(); + stopWatchingAppStateInUrl(); stopSyncingDashboardFilterState(); lastSavedSubscription.unsubscribe(); indexPatternsSubscription.unsubscribe(); diff --git a/src/plugins/dashboard/public/application/lib/index.ts b/src/plugins/dashboard/public/application/lib/index.ts index 9aba481c3fb86..845cfcb096c51 100644 --- a/src/plugins/dashboard/public/application/lib/index.ts +++ b/src/plugins/dashboard/public/application/lib/index.ts @@ -12,7 +12,7 @@ export { saveDashboard } from './save_dashboard'; export { migrateAppState } from './migrate_app_state'; export { addHelpMenuToAppChrome } from './help_menu_util'; export { getTagsFromSavedDashboard } from './dashboard_tagging'; -export { loadDashboardUrlState } from './load_dashboard_url_state'; +export { syncDashboardUrlState } from './sync_dashboard_url_state'; export { DashboardSessionStorage } from './dashboard_session_storage'; export { loadSavedDashboardState } from './load_saved_dashboard_state'; export { attemptLoadDashboardByTitle } from './load_dashboard_by_title'; diff --git a/src/plugins/dashboard/public/application/lib/load_dashboard_url_state.ts b/src/plugins/dashboard/public/application/lib/load_dashboard_url_state.ts deleted file mode 100644 index f76382c1fbbdd..0000000000000 --- a/src/plugins/dashboard/public/application/lib/load_dashboard_url_state.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import _ from 'lodash'; - -import { migrateAppState } from '.'; -import { replaceUrlHashQuery } from '../../../../kibana_utils/public'; -import { DASHBOARD_STATE_STORAGE_KEY } from '../../dashboard_constants'; -import type { - DashboardBuildContext, - DashboardPanelMap, - DashboardState, - RawDashboardState, -} from '../../types'; -import { migrateLegacyQuery } from './migrate_legacy_query'; -import { convertSavedPanelsToPanelMap } from './convert_saved_panels_to_panel_map'; - -/** - * Loads any dashboard state from the URL, and removes the state from the URL. - */ -export const loadDashboardUrlState = ({ - kibanaVersion, - usageCollection, - kbnUrlStateStorage, -}: DashboardBuildContext): Partial => { - const rawAppStateInUrl = kbnUrlStateStorage.get(DASHBOARD_STATE_STORAGE_KEY); - if (!rawAppStateInUrl) return {}; - - let panelsMap: DashboardPanelMap = {}; - if (rawAppStateInUrl.panels && rawAppStateInUrl.panels.length > 0) { - const rawState = migrateAppState(rawAppStateInUrl, kibanaVersion, usageCollection); - panelsMap = convertSavedPanelsToPanelMap(rawState.panels); - } - - const migratedQuery = rawAppStateInUrl.query - ? migrateLegacyQuery(rawAppStateInUrl.query) - : undefined; - - // remove state from URL - kbnUrlStateStorage.kbnUrlControls.updateAsync((nextUrl) => { - if (nextUrl.includes(DASHBOARD_STATE_STORAGE_KEY)) { - return replaceUrlHashQuery(nextUrl, (query) => { - delete query[DASHBOARD_STATE_STORAGE_KEY]; - return query; - }); - } - return nextUrl; - }, true); - - return { - ..._.omit(rawAppStateInUrl, ['panels', 'query']), - ...(migratedQuery ? { query: migratedQuery } : {}), - ...(rawAppStateInUrl.panels ? { panels: panelsMap } : {}), - }; -}; diff --git a/src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts b/src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts index 2cfd7da6145ee..ea4ecf8dc7a3d 100644 --- a/src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts +++ b/src/plugins/dashboard/public/application/lib/sync_dashboard_filter_state.ts @@ -48,34 +48,13 @@ export const syncDashboardFilterState = ({ const { filterManager, queryString, timefilter } = queryService; const { timefilter: timefilterService } = timefilter; - // apply initial filters to the query service and to the saved dashboard - filterManager.setAppFilters(_.cloneDeep(initialDashboardState.filters)); - savedDashboard.searchSource.setField('filter', initialDashboardState.filters); - - // apply initial query to the query service and to the saved dashboard - queryString.setQuery(initialDashboardState.query); - savedDashboard.searchSource.setField('query', initialDashboardState.query); - - /** - * If a global time range is not set explicitly and the time range was saved with the dashboard, apply - * initial time range and refresh interval to the query service. - */ - if (initialDashboardState.timeRestore) { - const initialGlobalQueryState = kbnUrlStateStorage.get('_g'); - if (!initialGlobalQueryState?.time) { - if (savedDashboard.timeFrom && savedDashboard.timeTo) { - timefilterService.setTime({ - from: savedDashboard.timeFrom, - to: savedDashboard.timeTo, - }); - } - } - if (!initialGlobalQueryState?.refreshInterval) { - if (savedDashboard.refreshInterval) { - timefilterService.setRefreshInterval(savedDashboard.refreshInterval); - } - } - } + // apply initial dashboard filter state. + applyDashboardFilterState({ + currentDashboardState: initialDashboardState, + kbnUrlStateStorage, + savedDashboard, + queryService, + }); // this callback will be used any time new filters and query need to be applied. const applyFilters = (query: Query, filters: Filter[]) => { @@ -155,3 +134,49 @@ export const syncDashboardFilterState = ({ return { applyFilters, stopSyncingDashboardFilterState }; }; + +interface ApplyDashboardFilterStateProps { + kbnUrlStateStorage: DashboardBuildContext['kbnUrlStateStorage']; + queryService: DashboardBuildContext['query']; + currentDashboardState: DashboardState; + savedDashboard: DashboardSavedObject; +} + +export const applyDashboardFilterState = ({ + currentDashboardState, + kbnUrlStateStorage, + savedDashboard, + queryService, +}: ApplyDashboardFilterStateProps) => { + const { filterManager, queryString, timefilter } = queryService; + const { timefilter: timefilterService } = timefilter; + + // apply filters to the query service and to the saved dashboard + filterManager.setAppFilters(_.cloneDeep(currentDashboardState.filters)); + savedDashboard.searchSource.setField('filter', currentDashboardState.filters); + + // apply query to the query service and to the saved dashboard + queryString.setQuery(currentDashboardState.query); + savedDashboard.searchSource.setField('query', currentDashboardState.query); + + /** + * If a global time range is not set explicitly and the time range was saved with the dashboard, apply + * time range and refresh interval to the query service. + */ + if (currentDashboardState.timeRestore) { + const globalQueryState = kbnUrlStateStorage.get('_g'); + if (!globalQueryState?.time) { + if (savedDashboard.timeFrom && savedDashboard.timeTo) { + timefilterService.setTime({ + from: savedDashboard.timeFrom, + to: savedDashboard.timeTo, + }); + } + } + if (!globalQueryState?.refreshInterval) { + if (savedDashboard.refreshInterval) { + timefilterService.setRefreshInterval(savedDashboard.refreshInterval); + } + } + } +}; diff --git a/src/plugins/dashboard/public/application/lib/sync_dashboard_url_state.ts b/src/plugins/dashboard/public/application/lib/sync_dashboard_url_state.ts new file mode 100644 index 0000000000000..00b8f8217e25f --- /dev/null +++ b/src/plugins/dashboard/public/application/lib/sync_dashboard_url_state.ts @@ -0,0 +1,107 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import _ from 'lodash'; + +import { migrateAppState } from '.'; +import { DashboardSavedObject } from '../..'; +import { setDashboardState } from '../state'; +import { migrateLegacyQuery } from './migrate_legacy_query'; +import { replaceUrlHashQuery } from '../../../../kibana_utils/public'; +import { applyDashboardFilterState } from './sync_dashboard_filter_state'; +import { DASHBOARD_STATE_STORAGE_KEY } from '../../dashboard_constants'; +import type { + DashboardBuildContext, + DashboardPanelMap, + DashboardState, + RawDashboardState, +} from '../../types'; +import { convertSavedPanelsToPanelMap } from './convert_saved_panels_to_panel_map'; + +type SyncDashboardUrlStateProps = DashboardBuildContext & { savedDashboard: DashboardSavedObject }; + +export const syncDashboardUrlState = ({ + dispatchDashboardStateChange, + getLatestDashboardState, + query: queryService, + kbnUrlStateStorage, + usageCollection, + savedDashboard, + kibanaVersion, +}: SyncDashboardUrlStateProps) => { + // load initial state before subscribing to avoid state removal triggering update. + const loadDashboardStateProps = { kbnUrlStateStorage, usageCollection, kibanaVersion }; + const initialDashboardStateFromUrl = loadDashboardUrlState(loadDashboardStateProps); + + const appStateSubscription = kbnUrlStateStorage + .change$(DASHBOARD_STATE_STORAGE_KEY) + .subscribe(() => { + const stateFromUrl = loadDashboardUrlState(loadDashboardStateProps); + + const updatedDashboardState = { ...getLatestDashboardState(), ...stateFromUrl }; + applyDashboardFilterState({ + currentDashboardState: updatedDashboardState, + kbnUrlStateStorage, + queryService, + savedDashboard, + }); + + if (Object.keys(stateFromUrl).length === 0) return; + dispatchDashboardStateChange(setDashboardState(updatedDashboardState)); + }); + + const stopWatchingAppStateInUrl = () => { + appStateSubscription.unsubscribe(); + }; + return { initialDashboardStateFromUrl, stopWatchingAppStateInUrl }; +}; + +interface LoadDashboardUrlStateProps { + kibanaVersion: DashboardBuildContext['kibanaVersion']; + usageCollection: DashboardBuildContext['usageCollection']; + kbnUrlStateStorage: DashboardBuildContext['kbnUrlStateStorage']; +} + +/** + * Loads any dashboard state from the URL, and removes the state from the URL. + */ +const loadDashboardUrlState = ({ + kibanaVersion, + usageCollection, + kbnUrlStateStorage, +}: LoadDashboardUrlStateProps): Partial => { + const rawAppStateInUrl = kbnUrlStateStorage.get(DASHBOARD_STATE_STORAGE_KEY); + if (!rawAppStateInUrl) return {}; + + let panelsMap: DashboardPanelMap = {}; + if (rawAppStateInUrl.panels && rawAppStateInUrl.panels.length > 0) { + const rawState = migrateAppState(rawAppStateInUrl, kibanaVersion, usageCollection); + panelsMap = convertSavedPanelsToPanelMap(rawState.panels); + } + + const migratedQuery = rawAppStateInUrl.query + ? migrateLegacyQuery(rawAppStateInUrl.query) + : undefined; + + // remove state from URL + kbnUrlStateStorage.kbnUrlControls.updateAsync((nextUrl) => { + if (nextUrl.includes(DASHBOARD_STATE_STORAGE_KEY)) { + return replaceUrlHashQuery(nextUrl, (query) => { + delete query[DASHBOARD_STATE_STORAGE_KEY]; + return query; + }); + } + return nextUrl; + }, true); + + return { + ..._.omit(rawAppStateInUrl, ['panels', 'query']), + ...(migratedQuery ? { query: migratedQuery } : {}), + ...(rawAppStateInUrl.panels ? { panels: panelsMap } : {}), + }; +}; diff --git a/src/plugins/data/common/index_patterns/constants.ts b/src/plugins/data/common/data_views/constants.ts similarity index 100% rename from src/plugins/data/common/index_patterns/constants.ts rename to src/plugins/data/common/data_views/constants.ts diff --git a/src/plugins/data/common/index_patterns/index_patterns/__snapshots__/index_pattern.test.ts.snap b/src/plugins/data/common/data_views/data_views/__snapshots__/index_pattern.test.ts.snap similarity index 100% rename from src/plugins/data/common/index_patterns/index_patterns/__snapshots__/index_pattern.test.ts.snap rename to src/plugins/data/common/data_views/data_views/__snapshots__/index_pattern.test.ts.snap diff --git a/src/plugins/data/common/index_patterns/index_patterns/__snapshots__/index_patterns.test.ts.snap b/src/plugins/data/common/data_views/data_views/__snapshots__/index_patterns.test.ts.snap similarity index 100% rename from src/plugins/data/common/index_patterns/index_patterns/__snapshots__/index_patterns.test.ts.snap rename to src/plugins/data/common/data_views/data_views/__snapshots__/index_patterns.test.ts.snap diff --git a/src/plugins/data/common/index_patterns/index_patterns/_pattern_cache.ts b/src/plugins/data/common/data_views/data_views/_pattern_cache.ts similarity index 96% rename from src/plugins/data/common/index_patterns/index_patterns/_pattern_cache.ts rename to src/plugins/data/common/data_views/data_views/_pattern_cache.ts index a647f306ca7f0..f304d0e93d79c 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/_pattern_cache.ts +++ b/src/plugins/data/common/data_views/data_views/_pattern_cache.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { DataView } from './index_pattern'; +import { DataView } from './data_view'; export interface DataViewCache { get: (id: string) => Promise | undefined; diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts b/src/plugins/data/common/data_views/data_views/data_view.ts similarity index 100% rename from src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts rename to src/plugins/data/common/data_views/data_views/data_view.ts diff --git a/src/plugins/data/common/data_views/data_views/data_views.ts b/src/plugins/data/common/data_views/data_views/data_views.ts new file mode 100644 index 0000000000000..b996adea16536 --- /dev/null +++ b/src/plugins/data/common/data_views/data_views/data_views.ts @@ -0,0 +1,709 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +/* eslint-disable max-classes-per-file */ + +import { i18n } from '@kbn/i18n'; +import { PublicMethodsOf } from '@kbn/utility-types'; +import { castEsToKbnFieldTypeName } from '@kbn/field-types'; +import { DATA_VIEW_SAVED_OBJECT_TYPE, SavedObjectsClientCommon } from '../..'; + +import { createDataViewCache } from '.'; +import type { RuntimeField } from '../types'; +import { DataView } from './data_view'; +import { createEnsureDefaultDataView, EnsureDefaultDataView } from './ensure_default_data_view'; +import { + OnNotification, + OnError, + UiSettingsCommon, + IDataViewsApiClient, + GetFieldsOptions, + DataViewSpec, + DataViewAttributes, + FieldAttrs, + FieldSpec, + DataViewFieldMap, + TypeMeta, +} from '../types'; +import { FieldFormatsStartCommon, FORMATS_UI_SETTINGS } from '../../../../field_formats/common/'; +import { UI_SETTINGS, SavedObject } from '../../../common'; +import { SavedObjectNotFound } from '../../../../kibana_utils/common'; +import { DataViewMissingIndices } from '../lib'; +import { findByTitle } from '../utils'; +import { DuplicateDataViewError } from '../errors'; + +const MAX_ATTEMPTS_TO_RESOLVE_CONFLICTS = 3; + +export type IndexPatternSavedObjectAttrs = Pick; + +export type IndexPatternListSavedObjectAttrs = Pick< + DataViewAttributes, + 'title' | 'type' | 'typeMeta' +>; + +export interface DataViewListItem { + id: string; + title: string; + type?: string; + typeMeta?: TypeMeta; +} + +/** + * @deprecated Use DataViewListItem. All index pattern interfaces were renamed. + */ + +export type IndexPatternListItem = DataViewListItem; + +interface IndexPatternsServiceDeps { + uiSettings: UiSettingsCommon; + savedObjectsClient: SavedObjectsClientCommon; + apiClient: IDataViewsApiClient; + fieldFormats: FieldFormatsStartCommon; + onNotification: OnNotification; + onError: OnError; + onRedirectNoIndexPattern?: () => void; +} + +export class DataViewsService { + private config: UiSettingsCommon; + private savedObjectsClient: SavedObjectsClientCommon; + private savedObjectsCache?: Array> | null; + private apiClient: IDataViewsApiClient; + private fieldFormats: FieldFormatsStartCommon; + private onNotification: OnNotification; + private onError: OnError; + private indexPatternCache: ReturnType; + + ensureDefaultIndexPattern: EnsureDefaultDataView; + + constructor({ + uiSettings, + savedObjectsClient, + apiClient, + fieldFormats, + onNotification, + onError, + onRedirectNoIndexPattern = () => {}, + }: IndexPatternsServiceDeps) { + this.apiClient = apiClient; + this.config = uiSettings; + this.savedObjectsClient = savedObjectsClient; + this.fieldFormats = fieldFormats; + this.onNotification = onNotification; + this.onError = onError; + this.ensureDefaultIndexPattern = createEnsureDefaultDataView( + uiSettings, + onRedirectNoIndexPattern + ); + + this.indexPatternCache = createDataViewCache(); + } + + /** + * Refresh cache of index pattern ids and titles + */ + private async refreshSavedObjectsCache() { + const so = await this.savedObjectsClient.find({ + type: DATA_VIEW_SAVED_OBJECT_TYPE, + fields: ['title', 'type', 'typeMeta'], + perPage: 10000, + }); + this.savedObjectsCache = so; + } + + /** + * Get list of index pattern ids + * @param refresh Force refresh of index pattern list + */ + getIds = async (refresh: boolean = false) => { + if (!this.savedObjectsCache || refresh) { + await this.refreshSavedObjectsCache(); + } + if (!this.savedObjectsCache) { + return []; + } + return this.savedObjectsCache.map((obj) => obj?.id); + }; + + /** + * Get list of index pattern titles + * @param refresh Force refresh of index pattern list + */ + getTitles = async (refresh: boolean = false): Promise => { + if (!this.savedObjectsCache || refresh) { + await this.refreshSavedObjectsCache(); + } + if (!this.savedObjectsCache) { + return []; + } + return this.savedObjectsCache.map((obj) => obj?.attributes?.title); + }; + + /** + * Find and load index patterns by title + * @param search + * @param size + * @returns IndexPattern[] + */ + find = async (search: string, size: number = 10): Promise => { + const savedObjects = await this.savedObjectsClient.find({ + type: DATA_VIEW_SAVED_OBJECT_TYPE, + fields: ['title'], + search, + searchFields: ['title'], + perPage: size, + }); + const getIndexPatternPromises = savedObjects.map(async (savedObject) => { + return await this.get(savedObject.id); + }); + return await Promise.all(getIndexPatternPromises); + }; + + /** + * Get list of index pattern ids with titles + * @param refresh Force refresh of index pattern list + */ + getIdsWithTitle = async (refresh: boolean = false): Promise => { + if (!this.savedObjectsCache || refresh) { + await this.refreshSavedObjectsCache(); + } + if (!this.savedObjectsCache) { + return []; + } + return this.savedObjectsCache.map((obj) => ({ + id: obj?.id, + title: obj?.attributes?.title, + type: obj?.attributes?.type, + typeMeta: obj?.attributes?.typeMeta && JSON.parse(obj?.attributes?.typeMeta), + })); + }; + + /** + * Clear index pattern list cache + * @param id optionally clear a single id + */ + clearCache = (id?: string) => { + this.savedObjectsCache = null; + if (id) { + this.indexPatternCache.clear(id); + } else { + this.indexPatternCache.clearAll(); + } + }; + + getCache = async () => { + if (!this.savedObjectsCache) { + await this.refreshSavedObjectsCache(); + } + return this.savedObjectsCache; + }; + + /** + * Get default index pattern + */ + getDefault = async () => { + const defaultIndexPatternId = await this.getDefaultId(); + if (defaultIndexPatternId) { + return await this.get(defaultIndexPatternId); + } + + return null; + }; + + /** + * Get default index pattern id + */ + getDefaultId = async (): Promise => { + const defaultIndexPatternId = await this.config.get('defaultIndex'); + return defaultIndexPatternId ?? null; + }; + + /** + * Optionally set default index pattern, unless force = true + * @param id + * @param force + */ + setDefault = async (id: string | null, force = false) => { + if (force || !this.config.get('defaultIndex')) { + await this.config.set('defaultIndex', id); + } + }; + + /** + * Checks if current user has a user created index pattern ignoring fleet's server default index patterns + */ + async hasUserDataView(): Promise { + return this.apiClient.hasUserIndexPattern(); + } + + /** + * Get field list by providing { pattern } + * @param options + * @returns FieldSpec[] + */ + getFieldsForWildcard = async (options: GetFieldsOptions) => { + const metaFields = await this.config.get(UI_SETTINGS.META_FIELDS); + return this.apiClient.getFieldsForWildcard({ + pattern: options.pattern, + metaFields, + type: options.type, + rollupIndex: options.rollupIndex, + allowNoIndex: options.allowNoIndex, + }); + }; + + /** + * Get field list by providing an index patttern (or spec) + * @param options + * @returns FieldSpec[] + */ + getFieldsForIndexPattern = async ( + indexPattern: DataView | DataViewSpec, + options?: GetFieldsOptions + ) => + this.getFieldsForWildcard({ + type: indexPattern.type, + rollupIndex: indexPattern?.typeMeta?.params?.rollup_index, + ...options, + pattern: indexPattern.title as string, + }); + + /** + * Refresh field list for a given index pattern + * @param indexPattern + */ + refreshFields = async (indexPattern: DataView) => { + try { + const fields = (await this.getFieldsForIndexPattern(indexPattern)) as FieldSpec[]; + fields.forEach((field) => (field.isMapped = true)); + const scripted = indexPattern.getScriptedFields().map((field) => field.spec); + const fieldAttrs = indexPattern.getFieldAttrs(); + const fieldsWithSavedAttrs = Object.values( + this.fieldArrayToMap([...fields, ...scripted], fieldAttrs) + ); + indexPattern.fields.replaceAll(fieldsWithSavedAttrs); + } catch (err) { + if (err instanceof DataViewMissingIndices) { + this.onNotification({ title: (err as any).message, color: 'danger', iconType: 'alert' }); + } + + this.onError(err, { + title: i18n.translate('data.indexPatterns.fetchFieldErrorTitle', { + defaultMessage: 'Error fetching fields for index pattern {title} (ID: {id})', + values: { id: indexPattern.id, title: indexPattern.title }, + }), + }); + } + }; + + /** + * Refreshes a field list from a spec before an index pattern instance is created + * @param fields + * @param id + * @param title + * @param options + * @returns Record + */ + private refreshFieldSpecMap = async ( + fields: DataViewFieldMap, + id: string, + title: string, + options: GetFieldsOptions, + fieldAttrs: FieldAttrs = {} + ) => { + const fieldsAsArr = Object.values(fields); + const scriptedFields = fieldsAsArr.filter((field) => field.scripted); + try { + let updatedFieldList: FieldSpec[]; + const newFields = (await this.getFieldsForWildcard(options)) as FieldSpec[]; + newFields.forEach((field) => (field.isMapped = true)); + + // If allowNoIndex, only update field list if field caps finds fields. To support + // beats creating index pattern and dashboard before docs + if (!options.allowNoIndex || (newFields && newFields.length > 5)) { + updatedFieldList = [...newFields, ...scriptedFields]; + } else { + updatedFieldList = fieldsAsArr; + } + + return this.fieldArrayToMap(updatedFieldList, fieldAttrs); + } catch (err) { + if (err instanceof DataViewMissingIndices) { + this.onNotification({ title: (err as any).message, color: 'danger', iconType: 'alert' }); + return {}; + } + + this.onError(err, { + title: i18n.translate('data.indexPatterns.fetchFieldErrorTitle', { + defaultMessage: 'Error fetching fields for index pattern {title} (ID: {id})', + values: { id, title }, + }), + }); + throw err; + } + }; + + /** + * Converts field array to map + * @param fields: FieldSpec[] + * @param fieldAttrs: FieldAttrs + * @returns Record + */ + fieldArrayToMap = (fields: FieldSpec[], fieldAttrs?: FieldAttrs) => + fields.reduce((collector, field) => { + collector[field.name] = { + ...field, + customLabel: fieldAttrs?.[field.name]?.customLabel, + count: fieldAttrs?.[field.name]?.count, + }; + return collector; + }, {}); + + /** + * Converts index pattern saved object to index pattern spec + * @param savedObject + * @returns IndexPatternSpec + */ + + savedObjectToSpec = (savedObject: SavedObject): DataViewSpec => { + const { + id, + version, + attributes: { + title, + timeFieldName, + intervalName, + fields, + sourceFilters, + fieldFormatMap, + runtimeFieldMap, + typeMeta, + type, + fieldAttrs, + allowNoIndex, + }, + } = savedObject; + + const parsedSourceFilters = sourceFilters ? JSON.parse(sourceFilters) : undefined; + const parsedTypeMeta = typeMeta ? JSON.parse(typeMeta) : undefined; + const parsedFieldFormatMap = fieldFormatMap ? JSON.parse(fieldFormatMap) : {}; + const parsedFields: FieldSpec[] = fields ? JSON.parse(fields) : []; + const parsedFieldAttrs: FieldAttrs = fieldAttrs ? JSON.parse(fieldAttrs) : {}; + const parsedRuntimeFieldMap: Record = runtimeFieldMap + ? JSON.parse(runtimeFieldMap) + : {}; + + return { + id, + version, + title, + intervalName, + timeFieldName, + sourceFilters: parsedSourceFilters, + fields: this.fieldArrayToMap(parsedFields, parsedFieldAttrs), + typeMeta: parsedTypeMeta, + type, + fieldFormats: parsedFieldFormatMap, + fieldAttrs: parsedFieldAttrs, + allowNoIndex, + runtimeFieldMap: parsedRuntimeFieldMap, + }; + }; + + private getSavedObjectAndInit = async (id: string): Promise => { + let savedObject: SavedObject; + try { + savedObject = await this.savedObjectsClient.get( + DATA_VIEW_SAVED_OBJECT_TYPE, + id + ); + } catch (e) { + throw new SavedObjectNotFound( + DATA_VIEW_SAVED_OBJECT_TYPE, + id, + 'management/kibana/indexPatterns' + ); + } + + if (!savedObject.version) { + throw new SavedObjectNotFound( + DATA_VIEW_SAVED_OBJECT_TYPE, + id, + 'management/kibana/indexPatterns' + ); + } + + return this.initFromSavedObject(savedObject); + }; + + private initFromSavedObject = async ( + savedObject: SavedObject + ): Promise => { + const spec = this.savedObjectToSpec(savedObject); + const { title, type, typeMeta, runtimeFieldMap } = spec; + spec.fieldAttrs = savedObject.attributes.fieldAttrs + ? JSON.parse(savedObject.attributes.fieldAttrs) + : {}; + + try { + spec.fields = await this.refreshFieldSpecMap( + spec.fields || {}, + savedObject.id, + spec.title as string, + { + pattern: title as string, + metaFields: await this.config.get(UI_SETTINGS.META_FIELDS), + type, + rollupIndex: typeMeta?.params?.rollup_index, + allowNoIndex: spec.allowNoIndex, + }, + spec.fieldAttrs + ); + + // CREATE RUNTIME FIELDS + for (const [key, value] of Object.entries(runtimeFieldMap || {})) { + // do not create runtime field if mapped field exists + if (!spec.fields[key]) { + spec.fields[key] = { + name: key, + type: castEsToKbnFieldTypeName(value.type), + runtimeField: value, + aggregatable: true, + searchable: true, + readFromDocValues: false, + customLabel: spec.fieldAttrs?.[key]?.customLabel, + count: spec.fieldAttrs?.[key]?.count, + }; + } + } + } catch (err) { + if (err instanceof DataViewMissingIndices) { + this.onNotification({ + title: (err as any).message, + color: 'danger', + iconType: 'alert', + }); + } else { + this.onError(err, { + title: i18n.translate('data.indexPatterns.fetchFieldErrorTitle', { + defaultMessage: 'Error fetching fields for index pattern {title} (ID: {id})', + values: { id: savedObject.id, title }, + }), + }); + } + } + + spec.fieldFormats = savedObject.attributes.fieldFormatMap + ? JSON.parse(savedObject.attributes.fieldFormatMap) + : {}; + + const indexPattern = await this.create(spec, true); + indexPattern.resetOriginalSavedObjectBody(); + return indexPattern; + }; + + /** + * Get an index pattern by id. Cache optimized + * @param id + */ + + get = async (id: string): Promise => { + const indexPatternPromise = + this.indexPatternCache.get(id) || + this.indexPatternCache.set(id, this.getSavedObjectAndInit(id)); + + // don't cache failed requests + indexPatternPromise.catch(() => { + this.indexPatternCache.clear(id); + }); + + return indexPatternPromise; + }; + + /** + * Create a new index pattern instance + * @param spec + * @param skipFetchFields + * @returns IndexPattern + */ + async create(spec: DataViewSpec, skipFetchFields = false): Promise { + const shortDotsEnable = await this.config.get(FORMATS_UI_SETTINGS.SHORT_DOTS_ENABLE); + const metaFields = await this.config.get(UI_SETTINGS.META_FIELDS); + + const indexPattern = new DataView({ + spec, + fieldFormats: this.fieldFormats, + shortDotsEnable, + metaFields, + }); + + if (!skipFetchFields) { + await this.refreshFields(indexPattern); + } + + return indexPattern; + } + + /** + * Create a new index pattern and save it right away + * @param spec + * @param override Overwrite if existing index pattern exists. + * @param skipFetchFields Whether to skip field refresh step. + */ + + async createAndSave(spec: DataViewSpec, override = false, skipFetchFields = false) { + const indexPattern = await this.create(spec, skipFetchFields); + const createdIndexPattern = await this.createSavedObject(indexPattern, override); + await this.setDefault(createdIndexPattern.id!); + return createdIndexPattern!; + } + + /** + * Save a new index pattern + * @param indexPattern + * @param override Overwrite if existing index pattern exists + */ + + async createSavedObject(indexPattern: DataView, override = false) { + const dupe = await findByTitle(this.savedObjectsClient, indexPattern.title); + if (dupe) { + if (override) { + await this.delete(dupe.id); + } else { + throw new DuplicateDataViewError(`Duplicate index pattern: ${indexPattern.title}`); + } + } + + const body = indexPattern.getAsSavedObjectBody(); + const response: SavedObject = (await this.savedObjectsClient.create( + DATA_VIEW_SAVED_OBJECT_TYPE, + body, + { + id: indexPattern.id, + } + )) as SavedObject; + + const createdIndexPattern = await this.initFromSavedObject(response); + this.indexPatternCache.set(createdIndexPattern.id!, Promise.resolve(createdIndexPattern)); + if (this.savedObjectsCache) { + this.savedObjectsCache.push(response as SavedObject); + } + return createdIndexPattern; + } + + /** + * Save existing index pattern. Will attempt to merge differences if there are conflicts + * @param indexPattern + * @param saveAttempts + */ + + async updateSavedObject( + indexPattern: DataView, + saveAttempts: number = 0, + ignoreErrors: boolean = false + ): Promise { + if (!indexPattern.id) return; + + // get the list of attributes + const body = indexPattern.getAsSavedObjectBody(); + const originalBody = indexPattern.getOriginalSavedObjectBody(); + + // get changed keys + const originalChangedKeys: string[] = []; + Object.entries(body).forEach(([key, value]) => { + if (value !== (originalBody as any)[key]) { + originalChangedKeys.push(key); + } + }); + + return this.savedObjectsClient + .update(DATA_VIEW_SAVED_OBJECT_TYPE, indexPattern.id, body, { + version: indexPattern.version, + }) + .then((resp) => { + indexPattern.id = resp.id; + indexPattern.version = resp.version; + }) + .catch(async (err) => { + if (err?.res?.status === 409 && saveAttempts++ < MAX_ATTEMPTS_TO_RESOLVE_CONFLICTS) { + const samePattern = await this.get(indexPattern.id as string); + // What keys changed from now and what the server returned + const updatedBody = samePattern.getAsSavedObjectBody(); + + // Build a list of changed keys from the server response + // and ensure we ignore the key if the server response + // is the same as the original response (since that is expected + // if we made a change in that key) + + const serverChangedKeys: string[] = []; + Object.entries(updatedBody).forEach(([key, value]) => { + if (value !== (body as any)[key] && value !== (originalBody as any)[key]) { + serverChangedKeys.push(key); + } + }); + + let unresolvedCollision = false; + for (const originalKey of originalChangedKeys) { + for (const serverKey of serverChangedKeys) { + if (originalKey === serverKey) { + unresolvedCollision = true; + break; + } + } + } + + if (unresolvedCollision) { + if (ignoreErrors) { + return; + } + const title = i18n.translate('data.indexPatterns.unableWriteLabel', { + defaultMessage: + 'Unable to write index pattern! Refresh the page to get the most up to date changes for this index pattern.', + }); + + this.onNotification({ title, color: 'danger' }); + throw err; + } + + // Set the updated response on this object + serverChangedKeys.forEach((key) => { + (indexPattern as any)[key] = (samePattern as any)[key]; + }); + indexPattern.version = samePattern.version; + + // Clear cache + this.indexPatternCache.clear(indexPattern.id!); + + // Try the save again + return this.updateSavedObject(indexPattern, saveAttempts, ignoreErrors); + } + throw err; + }); + } + + /** + * Deletes an index pattern from .kibana index + * @param indexPatternId: Id of kibana Index Pattern to delete + */ + async delete(indexPatternId: string) { + this.indexPatternCache.clear(indexPatternId); + return this.savedObjectsClient.delete(DATA_VIEW_SAVED_OBJECT_TYPE, indexPatternId); + } +} + +/** + * @deprecated Use DataViewsService. All index pattern interfaces were renamed. + */ +export class IndexPatternsService extends DataViewsService {} + +export type DataViewsContract = PublicMethodsOf; + +/** + * @deprecated Use DataViewsContract. All index pattern interfaces were renamed. + */ +export type IndexPatternsContract = DataViewsContract; diff --git a/src/plugins/data/common/data_views/data_views/ensure_default_data_view.ts b/src/plugins/data/common/data_views/data_views/ensure_default_data_view.ts new file mode 100644 index 0000000000000..2975ddbd107c4 --- /dev/null +++ b/src/plugins/data/common/data_views/data_views/ensure_default_data_view.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 { includes } from 'lodash'; +import { DataViewsContract } from './data_views'; +import { UiSettingsCommon } from '../types'; + +export type EnsureDefaultDataView = () => Promise | undefined; + +export const createEnsureDefaultDataView = ( + uiSettings: UiSettingsCommon, + onRedirectNoDefaultView: () => Promise | void +) => { + /** + * Checks whether a default data view is set and exists and defines + * one otherwise. + */ + return async function ensureDefaultDataView(this: DataViewsContract) { + const patterns = await this.getIds(); + let defaultId = await uiSettings.get('defaultIndex'); + let defined = !!defaultId; + const exists = includes(patterns, defaultId); + + if (defined && !exists) { + await uiSettings.remove('defaultIndex'); + defaultId = defined = false; + } + + if (defined) { + return; + } + + // If there is any user index pattern created, set the first as default + // if there is 0 patterns, then don't even call `hasUserDataView()` + if (patterns.length >= 1 && (await this.hasUserDataView().catch(() => true))) { + defaultId = patterns[0]; + await uiSettings.set('defaultIndex', defaultId); + } else { + return onRedirectNoDefaultView(); + } + }; +}; diff --git a/src/plugins/data/common/index_patterns/index_patterns/flatten_hit.test.ts b/src/plugins/data/common/data_views/data_views/flatten_hit.test.ts similarity index 91% rename from src/plugins/data/common/index_patterns/index_patterns/flatten_hit.test.ts rename to src/plugins/data/common/data_views/data_views/flatten_hit.test.ts index c9bb7d974997a..f8e1309a38ffe 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/flatten_hit.test.ts +++ b/src/plugins/data/common/data_views/data_views/flatten_hit.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { IndexPattern } from './index_pattern'; +import { IndexPattern } from './data_view'; import { fieldFormatsMock } from '../../../../field_formats/common/mocks'; import { flattenHitWrapper } from './flatten_hit'; @@ -57,9 +57,10 @@ describe('flattenHit', () => { fields: { date: ['1'], zzz: ['z'], + _abc: ['a'], }, }); - const expectedOrder = ['date', 'name', 'zzz', '_id', '_routing', '_score', '_type']; + const expectedOrder = ['_abc', 'date', 'name', 'zzz', '_id', '_routing', '_score', '_type']; expect(Object.keys(response)).toEqual(expectedOrder); expect(Object.entries(response).map(([key]) => key)).toEqual(expectedOrder); }); diff --git a/src/plugins/data/common/index_patterns/index_patterns/flatten_hit.ts b/src/plugins/data/common/data_views/data_views/flatten_hit.ts similarity index 97% rename from src/plugins/data/common/index_patterns/index_patterns/flatten_hit.ts rename to src/plugins/data/common/data_views/data_views/flatten_hit.ts index bcdcca3a4daac..58a5dff66acc8 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/flatten_hit.ts +++ b/src/plugins/data/common/data_views/data_views/flatten_hit.ts @@ -7,7 +7,7 @@ */ import _ from 'lodash'; -import { DataView } from './index_pattern'; +import { DataView } from './data_view'; // Takes a hit, merges it with any stored/scripted fields, and with the metaFields // returns a flattened version @@ -66,7 +66,6 @@ function decorateFlattenedWrapper(hit: Record, metaFields: Record { + const indexPattern = new IndexPattern({ + spec, + metaFields: opts?.metaFields ?? ['_id', '_type', '_source'], + shortDotsEnable: opts?.shortDotsEnable, + fieldFormats: deps?.fieldFormats ?? fieldFormatsMock, + }); + return indexPattern; +}; diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.test.ts b/src/plugins/data/common/data_views/data_views/index_pattern.test.ts similarity index 98% rename from src/plugins/data/common/index_patterns/index_patterns/index_pattern.test.ts rename to src/plugins/data/common/data_views/data_views/index_pattern.test.ts index f6be2bd9a8685..a12d4897fe11b 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.test.ts +++ b/src/plugins/data/common/data_views/data_views/index_pattern.test.ts @@ -8,7 +8,7 @@ import { map, last } from 'lodash'; -import { IndexPattern } from './index_pattern'; +import { IndexPattern } from './data_view'; import { DuplicateField } from '../../../../kibana_utils/common'; @@ -289,17 +289,17 @@ describe('IndexPattern', () => { describe('toSpec', () => { test('should match snapshot', () => { - const formatter = { + const formatter = ({ toJSON: () => ({ id: 'number', params: { pattern: '$0,0.[00]' } }), - } as FieldFormat; + } as unknown) as FieldFormat; indexPattern.getFormatterForField = () => formatter; expect(indexPattern.toSpec()).toMatchSnapshot(); }); test('can restore from spec', async () => { - const formatter = { + const formatter = ({ toJSON: () => ({ id: 'number', params: { pattern: '$0,0.[00]' } }), - } as FieldFormat; + } as unknown) as FieldFormat; indexPattern.getFormatterForField = () => formatter; const spec = indexPattern.toSpec(); const restoredPattern = new IndexPattern({ diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.test.ts b/src/plugins/data/common/data_views/data_views/index_patterns.test.ts similarity index 100% rename from src/plugins/data/common/index_patterns/index_patterns/index_patterns.test.ts rename to src/plugins/data/common/data_views/data_views/index_patterns.test.ts diff --git a/src/plugins/data/common/index_patterns/errors/data_view_saved_object_conflict.ts b/src/plugins/data/common/data_views/errors/data_view_saved_object_conflict.ts similarity index 100% rename from src/plugins/data/common/index_patterns/errors/data_view_saved_object_conflict.ts rename to src/plugins/data/common/data_views/errors/data_view_saved_object_conflict.ts diff --git a/src/plugins/data/common/index_patterns/errors/duplicate_index_pattern.ts b/src/plugins/data/common/data_views/errors/duplicate_index_pattern.ts similarity index 100% rename from src/plugins/data/common/index_patterns/errors/duplicate_index_pattern.ts rename to src/plugins/data/common/data_views/errors/duplicate_index_pattern.ts diff --git a/src/plugins/data/common/index_patterns/errors/index.ts b/src/plugins/data/common/data_views/errors/index.ts similarity index 100% rename from src/plugins/data/common/index_patterns/errors/index.ts rename to src/plugins/data/common/data_views/errors/index.ts diff --git a/src/plugins/data/common/index_patterns/expressions/index.ts b/src/plugins/data/common/data_views/expressions/index.ts similarity index 100% rename from src/plugins/data/common/index_patterns/expressions/index.ts rename to src/plugins/data/common/data_views/expressions/index.ts diff --git a/src/plugins/data/common/data_views/expressions/load_index_pattern.ts b/src/plugins/data/common/data_views/expressions/load_index_pattern.ts new file mode 100644 index 0000000000000..dd47a9fc0dfb4 --- /dev/null +++ b/src/plugins/data/common/data_views/expressions/load_index_pattern.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 { i18n } from '@kbn/i18n'; +import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; +import { DataViewsContract } from '../data_views'; +import { DataViewSpec } from '..'; +import { SavedObjectReference } from '../../../../../core/types'; + +const name = 'indexPatternLoad'; +const type = 'index_pattern'; + +export interface IndexPatternExpressionType { + type: typeof type; + value: DataViewSpec; +} + +type Input = null; +type Output = Promise; + +interface Arguments { + id: string; +} + +/** @internal */ +export interface IndexPatternLoadStartDependencies { + indexPatterns: DataViewsContract; +} + +export type IndexPatternLoadExpressionFunctionDefinition = ExpressionFunctionDefinition< + typeof name, + Input, + Arguments, + Output +>; + +export const getIndexPatternLoadMeta = (): Omit< + IndexPatternLoadExpressionFunctionDefinition, + 'fn' +> => ({ + name, + type, + inputTypes: ['null'], + help: i18n.translate('data.functions.indexPatternLoad.help', { + defaultMessage: 'Loads an index pattern', + }), + args: { + id: { + types: ['string'], + required: true, + help: i18n.translate('data.functions.indexPatternLoad.id.help', { + defaultMessage: 'index pattern id to load', + }), + }, + }, + extract(state) { + const refName = 'indexPatternLoad.id'; + const references: SavedObjectReference[] = [ + { + name: refName, + type: 'search', + id: state.id[0] as string, + }, + ]; + return { + state: { + ...state, + id: [refName], + }, + references, + }; + }, + + inject(state, references) { + const reference = references.find((ref) => ref.name === 'indexPatternLoad.id'); + if (reference) { + state.id[0] = reference.id; + } + return state; + }, +}); diff --git a/src/plugins/data/common/index_patterns/field.stub.ts b/src/plugins/data/common/data_views/field.stub.ts similarity index 100% rename from src/plugins/data/common/index_patterns/field.stub.ts rename to src/plugins/data/common/data_views/field.stub.ts diff --git a/src/plugins/data/common/index_patterns/fields/__snapshots__/index_pattern_field.test.ts.snap b/src/plugins/data/common/data_views/fields/__snapshots__/index_pattern_field.test.ts.snap similarity index 100% rename from src/plugins/data/common/index_patterns/fields/__snapshots__/index_pattern_field.test.ts.snap rename to src/plugins/data/common/data_views/fields/__snapshots__/index_pattern_field.test.ts.snap diff --git a/src/plugins/data/common/index_patterns/fields/field_list.ts b/src/plugins/data/common/data_views/fields/field_list.ts similarity index 98% rename from src/plugins/data/common/index_patterns/fields/field_list.ts rename to src/plugins/data/common/data_views/fields/field_list.ts index 78cc390c8c13f..8dd407e16e4c0 100644 --- a/src/plugins/data/common/index_patterns/fields/field_list.ts +++ b/src/plugins/data/common/data_views/fields/field_list.ts @@ -10,7 +10,7 @@ import { findIndex } from 'lodash'; import { IFieldType } from './types'; import { DataViewField } from './index_pattern_field'; import { FieldSpec, DataViewFieldMap } from '../types'; -import { DataView } from '../index_patterns'; +import { DataView } from '../data_views'; type FieldMap = Map; diff --git a/src/plugins/data/common/index_patterns/fields/fields.mocks.ts b/src/plugins/data/common/data_views/fields/fields.mocks.ts similarity index 100% rename from src/plugins/data/common/index_patterns/fields/fields.mocks.ts rename to src/plugins/data/common/data_views/fields/fields.mocks.ts diff --git a/src/plugins/data/common/index_patterns/fields/index.ts b/src/plugins/data/common/data_views/fields/index.ts similarity index 100% rename from src/plugins/data/common/index_patterns/fields/index.ts rename to src/plugins/data/common/data_views/fields/index.ts diff --git a/src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts b/src/plugins/data/common/data_views/fields/index_pattern_field.test.ts similarity index 98% rename from src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts rename to src/plugins/data/common/data_views/fields/index_pattern_field.test.ts index f95de90955b65..18d331b4e1351 100644 --- a/src/plugins/data/common/index_patterns/fields/index_pattern_field.test.ts +++ b/src/plugins/data/common/data_views/fields/index_pattern_field.test.ts @@ -7,7 +7,7 @@ */ import { IndexPatternField } from './index_pattern_field'; -import { IndexPattern } from '../index_patterns'; +import { IndexPattern } from '..'; import { KBN_FIELD_TYPES } from '../../../common'; import { FieldSpec, RuntimeField } from '../types'; import { FieldFormat } from '../../../../field_formats/common'; @@ -153,14 +153,14 @@ describe('Field', function () { it('spec snapshot', () => { const field = new IndexPatternField(fieldValues); const getFormatterForField = () => - ({ + (({ toJSON: () => ({ id: 'number', params: { pattern: '$0,0.[00]', }, }), - } as FieldFormat); + } as unknown) as FieldFormat); expect(field.toSpec({ getFormatterForField })).toMatchSnapshot(); }); }); diff --git a/src/plugins/data/common/index_patterns/fields/index_pattern_field.ts b/src/plugins/data/common/data_views/fields/index_pattern_field.ts similarity index 100% rename from src/plugins/data/common/index_patterns/fields/index_pattern_field.ts rename to src/plugins/data/common/data_views/fields/index_pattern_field.ts diff --git a/src/plugins/data/common/index_patterns/fields/types.ts b/src/plugins/data/common/data_views/fields/types.ts similarity index 100% rename from src/plugins/data/common/index_patterns/fields/types.ts rename to src/plugins/data/common/data_views/fields/types.ts diff --git a/src/plugins/data/common/index_patterns/fields/utils.ts b/src/plugins/data/common/data_views/fields/utils.ts similarity index 100% rename from src/plugins/data/common/index_patterns/fields/utils.ts rename to src/plugins/data/common/data_views/fields/utils.ts diff --git a/src/plugins/data/common/data_views/index.ts b/src/plugins/data/common/data_views/index.ts new file mode 100644 index 0000000000000..fd1df0336815a --- /dev/null +++ b/src/plugins/data/common/data_views/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 * from './constants'; +export * from './fields'; +export * from './types'; +export { + IndexPatternsService, + IndexPatternsContract, + DataViewsService, + DataViewsContract, +} from './data_views'; +// todo was trying to export this as type but wasn't working +export { IndexPattern, IndexPatternListItem, DataView, DataViewListItem } from './data_views'; +export * from './errors'; +export * from './expressions'; diff --git a/src/plugins/data/common/data_views/index_pattern.stub.ts b/src/plugins/data/common/data_views/index_pattern.stub.ts new file mode 100644 index 0000000000000..16624087f83b3 --- /dev/null +++ b/src/plugins/data/common/data_views/index_pattern.stub.ts @@ -0,0 +1,55 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { stubFieldSpecMap, stubLogstashFieldSpecMap } from './field.stub'; +import { createStubIndexPattern } from './data_views/index_pattern.stub'; +export { createStubIndexPattern } from './data_views/index_pattern.stub'; +import { SavedObject } from '../../../../core/types'; +import { IndexPatternAttributes } from '../types'; + +export const stubIndexPattern = createStubIndexPattern({ + spec: { + id: 'logstash-*', + fields: stubFieldSpecMap, + title: 'logstash-*', + timeFieldName: '@timestamp', + }, +}); + +export const stubIndexPatternWithoutTimeField = createStubIndexPattern({ + spec: { + id: 'logstash-*', + fields: stubFieldSpecMap, + title: 'logstash-*', + }, +}); + +export const stubLogstashIndexPattern = createStubIndexPattern({ + spec: { + id: 'logstash-*', + title: 'logstash-*', + timeFieldName: 'time', + fields: stubLogstashFieldSpecMap, + }, +}); + +export function stubbedSavedObjectIndexPattern( + id: string | null = null +): SavedObject { + return { + id: id ?? '', + type: 'index-pattern', + attributes: { + timeFieldName: 'time', + fields: JSON.stringify(stubLogstashFieldSpecMap), + title: 'title', + }, + version: '2', + references: [], + }; +} diff --git a/src/plugins/data/common/data_views/lib/errors.ts b/src/plugins/data/common/data_views/lib/errors.ts new file mode 100644 index 0000000000000..83cc7ea56d020 --- /dev/null +++ b/src/plugins/data/common/data_views/lib/errors.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. + */ + +/* eslint-disable */ + +import { KbnError } from '../../../../kibana_utils/common/'; + +/** + * Tried to call a method that relies on SearchSource having an indexPattern assigned + */ +export class DataViewMissingIndices extends KbnError { + constructor(message: string) { + const defaultMessage = "IndexPattern's configured pattern does not match any indices"; + + super( + message && message.length ? `No matching indices found: ${message}` : defaultMessage + ); + } +} + +/** + * @deprecated Use DataViewMissingIndices. All index pattern interfaces were renamed. + */ + +export class IndexPatternMissingIndices extends DataViewMissingIndices {} diff --git a/src/plugins/data/common/index_patterns/lib/get_title.ts b/src/plugins/data/common/data_views/lib/get_title.ts similarity index 100% rename from src/plugins/data/common/index_patterns/lib/get_title.ts rename to src/plugins/data/common/data_views/lib/get_title.ts diff --git a/src/plugins/data/common/index_patterns/lib/index.ts b/src/plugins/data/common/data_views/lib/index.ts similarity index 100% rename from src/plugins/data/common/index_patterns/lib/index.ts rename to src/plugins/data/common/data_views/lib/index.ts diff --git a/src/plugins/data/common/index_patterns/lib/is_default.ts b/src/plugins/data/common/data_views/lib/is_default.ts similarity index 100% rename from src/plugins/data/common/index_patterns/lib/is_default.ts rename to src/plugins/data/common/data_views/lib/is_default.ts diff --git a/src/plugins/data/common/index_patterns/lib/types.ts b/src/plugins/data/common/data_views/lib/types.ts similarity index 100% rename from src/plugins/data/common/index_patterns/lib/types.ts rename to src/plugins/data/common/data_views/lib/types.ts diff --git a/src/plugins/data/common/index_patterns/lib/validate_index_pattern.test.ts b/src/plugins/data/common/data_views/lib/validate_index_pattern.test.ts similarity index 100% rename from src/plugins/data/common/index_patterns/lib/validate_index_pattern.test.ts rename to src/plugins/data/common/data_views/lib/validate_index_pattern.test.ts diff --git a/src/plugins/data/common/index_patterns/lib/validate_index_pattern.ts b/src/plugins/data/common/data_views/lib/validate_index_pattern.ts similarity index 100% rename from src/plugins/data/common/index_patterns/lib/validate_index_pattern.ts rename to src/plugins/data/common/data_views/lib/validate_index_pattern.ts diff --git a/src/plugins/data/common/data_views/mocks.ts b/src/plugins/data/common/data_views/mocks.ts new file mode 100644 index 0000000000000..6e82118f7b8b8 --- /dev/null +++ b/src/plugins/data/common/data_views/mocks.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export * from './fields/fields.mocks'; +export * from './data_views/index_pattern.stub'; diff --git a/src/plugins/data/common/index_patterns/types.ts b/src/plugins/data/common/data_views/types.ts similarity index 100% rename from src/plugins/data/common/index_patterns/types.ts rename to src/plugins/data/common/data_views/types.ts diff --git a/src/plugins/data/common/index_patterns/utils.test.ts b/src/plugins/data/common/data_views/utils.test.ts similarity index 100% rename from src/plugins/data/common/index_patterns/utils.test.ts rename to src/plugins/data/common/data_views/utils.test.ts diff --git a/src/plugins/data/common/data_views/utils.ts b/src/plugins/data/common/data_views/utils.ts new file mode 100644 index 0000000000000..2d36ab6c72225 --- /dev/null +++ b/src/plugins/data/common/data_views/utils.ts @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { IndexPatternSavedObjectAttrs } from './data_views'; +import type { SavedObjectsClientCommon } from '../types'; + +import { DATA_VIEW_SAVED_OBJECT_TYPE } from '../constants'; + +/** + * Returns an object matching a given title + * + * @param client {SavedObjectsClientCommon} + * @param title {string} + * @returns {Promise} + */ +export async function findByTitle(client: SavedObjectsClientCommon, title: string) { + if (title) { + const savedObjects = await client.find({ + type: DATA_VIEW_SAVED_OBJECT_TYPE, + perPage: 10, + search: `"${title}"`, + searchFields: ['title'], + fields: ['title'], + }); + + return savedObjects.find((obj) => obj.attributes.title.toLowerCase() === title.toLowerCase()); + } +} diff --git a/src/plugins/data/common/index.ts b/src/plugins/data/common/index.ts index 44285a4824211..8a9a93f96b68b 100644 --- a/src/plugins/data/common/index.ts +++ b/src/plugins/data/common/index.ts @@ -11,7 +11,7 @@ export * from './constants'; export * from './es_query'; -export * from './index_patterns'; +export * from './data_views'; export * from './kbn_field_types'; export * from './query'; export * from './search'; @@ -25,4 +25,4 @@ export * from './exports'; * @removeBy 8.1 */ -export { IndexPatternAttributes, DataViewAttributes } from './types'; +export { IndexPatternAttributes } from './types'; diff --git a/src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts b/src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts deleted file mode 100644 index 8fe9e40e0ac6c..0000000000000 --- a/src/plugins/data/common/index_patterns/expressions/load_index_pattern.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; -import { DataViewsContract } from '../index_patterns'; -import { DataViewSpec } from '..'; -import { SavedObjectReference } from '../../../../../core/types'; - -const name = 'indexPatternLoad'; -const type = 'index_pattern'; - -export interface IndexPatternExpressionType { - type: typeof type; - value: DataViewSpec; -} - -type Input = null; -type Output = Promise; - -interface Arguments { - id: string; -} - -/** @internal */ -export interface IndexPatternLoadStartDependencies { - indexPatterns: DataViewsContract; -} - -export type IndexPatternLoadExpressionFunctionDefinition = ExpressionFunctionDefinition< - typeof name, - Input, - Arguments, - Output ->; - -export const getIndexPatternLoadMeta = (): Omit< - IndexPatternLoadExpressionFunctionDefinition, - 'fn' -> => ({ - name, - type, - inputTypes: ['null'], - help: i18n.translate('data.functions.indexPatternLoad.help', { - defaultMessage: 'Loads an index pattern', - }), - args: { - id: { - types: ['string'], - required: true, - help: i18n.translate('data.functions.indexPatternLoad.id.help', { - defaultMessage: 'index pattern id to load', - }), - }, - }, - extract(state) { - const refName = 'indexPatternLoad.id'; - const references: SavedObjectReference[] = [ - { - name: refName, - type: 'search', - id: state.id[0] as string, - }, - ]; - return { - state: { - ...state, - id: [refName], - }, - references, - }; - }, - - inject(state, references) { - const reference = references.find((ref) => ref.name === 'indexPatternLoad.id'); - if (reference) { - state.id[0] = reference.id; - } - return state; - }, -}); diff --git a/src/plugins/data/common/index_patterns/index.ts b/src/plugins/data/common/index_patterns/index.ts deleted file mode 100644 index 99639676bdabf..0000000000000 --- a/src/plugins/data/common/index_patterns/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may 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 './constants'; -export * from './fields'; -export * from './types'; -export { - IndexPatternsService, - IndexPatternsContract, - DataViewsService, - DataViewsContract, -} from './index_patterns'; -export type { - IndexPattern, - IndexPatternListItem, - DataView, - DataViewListItem, -} from './index_patterns'; -export * from './errors'; -export * from './expressions'; diff --git a/src/plugins/data/common/index_patterns/index_pattern.stub.ts b/src/plugins/data/common/index_patterns/index_pattern.stub.ts deleted file mode 100644 index 13cda8ccfb845..0000000000000 --- a/src/plugins/data/common/index_patterns/index_pattern.stub.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { stubFieldSpecMap, stubLogstashFieldSpecMap } from './field.stub'; -import { createStubIndexPattern } from './index_patterns/index_pattern.stub'; -export { createStubIndexPattern } from './index_patterns/index_pattern.stub'; -import { SavedObject } from '../../../../core/types'; -import { IndexPatternAttributes } from '../types'; - -export const stubIndexPattern = createStubIndexPattern({ - spec: { - id: 'logstash-*', - fields: stubFieldSpecMap, - title: 'logstash-*', - timeFieldName: '@timestamp', - }, -}); - -export const stubIndexPatternWithoutTimeField = createStubIndexPattern({ - spec: { - id: 'logstash-*', - fields: stubFieldSpecMap, - title: 'logstash-*', - }, -}); - -export const stubLogstashIndexPattern = createStubIndexPattern({ - spec: { - id: 'logstash-*', - title: 'logstash-*', - timeFieldName: 'time', - fields: stubLogstashFieldSpecMap, - }, -}); - -export function stubbedSavedObjectIndexPattern( - id: string | null = null -): SavedObject { - return { - id: id ?? '', - type: 'index-pattern', - attributes: { - timeFieldName: 'time', - fields: JSON.stringify(stubLogstashFieldSpecMap), - title: 'title', - }, - version: '2', - references: [], - }; -} diff --git a/src/plugins/data/common/index_patterns/index_patterns/ensure_default_index_pattern.ts b/src/plugins/data/common/index_patterns/index_patterns/ensure_default_index_pattern.ts deleted file mode 100644 index da20053bf1fe7..0000000000000 --- a/src/plugins/data/common/index_patterns/index_patterns/ensure_default_index_pattern.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { includes } from 'lodash'; -import { DataViewsContract } from './index_patterns'; -import { UiSettingsCommon } from '../types'; - -export type EnsureDefaultDataView = () => Promise | undefined; - -export const createEnsureDefaultDataView = ( - uiSettings: UiSettingsCommon, - onRedirectNoIndexPattern: () => Promise | void -) => { - /** - * Checks whether a default index pattern is set and exists and defines - * one otherwise. - */ - return async function ensureDefaultDataView(this: DataViewsContract) { - const patterns = await this.getIds(); - let defaultId = await uiSettings.get('defaultIndex'); - let defined = !!defaultId; - const exists = includes(patterns, defaultId); - - if (defined && !exists) { - await uiSettings.remove('defaultIndex'); - defaultId = defined = false; - } - - if (defined) { - return; - } - - // If there is any user index pattern created, set the first as default - // if there is 0 patterns, then don't even call `hasUserIndexPattern()` - if (patterns.length >= 1 && (await this.hasUserIndexPattern().catch(() => true))) { - defaultId = patterns[0]; - await uiSettings.set('defaultIndex', defaultId); - } else { - return onRedirectNoIndexPattern(); - } - }; -}; diff --git a/src/plugins/data/common/index_patterns/index_patterns/index.ts b/src/plugins/data/common/index_patterns/index_patterns/index.ts deleted file mode 100644 index b8b47cf099509..0000000000000 --- a/src/plugins/data/common/index_patterns/index_patterns/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 and the Server Side Public License, v 1; you may 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 './_pattern_cache'; -export * from './flatten_hit'; -export * from './format_hit'; -export * from './index_pattern'; -export * from './index_patterns'; diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.stub.ts b/src/plugins/data/common/index_patterns/index_patterns/index_pattern.stub.ts deleted file mode 100644 index 0799afbb85937..0000000000000 --- a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.stub.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { IndexPattern } from './index_pattern'; -import { IndexPatternSpec } from '../types'; -import { FieldFormatsStartCommon } from '../../../../field_formats/common'; -import { fieldFormatsMock } from '../../../../field_formats/common/mocks'; - -/** - * Create a custom stub index pattern. Use it in your unit tests where an {@link IndexPattern} expected. - * @param spec - Serialized index pattern object - * @param opts - Specify index pattern options - * @param deps - Optionally provide dependencies, you can provide a custom field formats implementation, by default a dummy mock is used - * - * @returns - an {@link IndexPattern} instance - * - * - * @example - * - * You can provide a custom implementation or assert calls using jest.spyOn: - * - * ```ts - * const indexPattern = createStubIndexPattern({spec: {title: 'logs-*'}}); - * const spy = jest.spyOn(indexPattern, 'getFormatterForField'); - * - * // use `spy` as a regular jest mock - * - * ``` - */ -export const createStubIndexPattern = ({ - spec, - opts, - deps, -}: { - spec: IndexPatternSpec; - opts?: { - shortDotsEnable?: boolean; - metaFields?: string[]; - }; - deps?: { - fieldFormats?: FieldFormatsStartCommon; - }; -}): IndexPattern => { - const indexPattern = new IndexPattern({ - spec, - metaFields: opts?.metaFields ?? ['_id', '_type', '_source'], - shortDotsEnable: opts?.shortDotsEnable, - fieldFormats: deps?.fieldFormats ?? fieldFormatsMock, - }); - return indexPattern; -}; diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts deleted file mode 100644 index c8e3f94ca6a86..0000000000000 --- a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts +++ /dev/null @@ -1,709 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -/* eslint-disable max-classes-per-file */ - -import { i18n } from '@kbn/i18n'; -import { PublicMethodsOf } from '@kbn/utility-types'; -import { castEsToKbnFieldTypeName } from '@kbn/field-types'; -import { DATA_VIEW_SAVED_OBJECT_TYPE, SavedObjectsClientCommon } from '../..'; - -import { createDataViewCache } from '.'; -import type { RuntimeField } from '../types'; -import { DataView } from './index_pattern'; -import { createEnsureDefaultDataView, EnsureDefaultDataView } from './ensure_default_index_pattern'; -import { - OnNotification, - OnError, - UiSettingsCommon, - IDataViewsApiClient, - GetFieldsOptions, - DataViewSpec, - DataViewAttributes, - FieldAttrs, - FieldSpec, - DataViewFieldMap, - TypeMeta, -} from '../types'; -import { FieldFormatsStartCommon, FORMATS_UI_SETTINGS } from '../../../../field_formats/common/'; -import { UI_SETTINGS, SavedObject } from '../../../common'; -import { SavedObjectNotFound } from '../../../../kibana_utils/common'; -import { DataViewMissingIndices } from '../lib'; -import { findByTitle } from '../utils'; -import { DuplicateDataViewError } from '../errors'; - -const MAX_ATTEMPTS_TO_RESOLVE_CONFLICTS = 3; - -export type IndexPatternSavedObjectAttrs = Pick; - -export type IndexPatternListSavedObjectAttrs = Pick< - DataViewAttributes, - 'title' | 'type' | 'typeMeta' ->; - -export interface DataViewListItem { - id: string; - title: string; - type?: string; - typeMeta?: TypeMeta; -} - -/** - * @deprecated Use DataViewListItem. All index pattern interfaces were renamed. - */ - -export type IndexPatternListItem = DataViewListItem; - -interface IndexPatternsServiceDeps { - uiSettings: UiSettingsCommon; - savedObjectsClient: SavedObjectsClientCommon; - apiClient: IDataViewsApiClient; - fieldFormats: FieldFormatsStartCommon; - onNotification: OnNotification; - onError: OnError; - onRedirectNoIndexPattern?: () => void; -} - -export class DataViewsService { - private config: UiSettingsCommon; - private savedObjectsClient: SavedObjectsClientCommon; - private savedObjectsCache?: Array> | null; - private apiClient: IDataViewsApiClient; - private fieldFormats: FieldFormatsStartCommon; - private onNotification: OnNotification; - private onError: OnError; - private indexPatternCache: ReturnType; - - ensureDefaultIndexPattern: EnsureDefaultDataView; - - constructor({ - uiSettings, - savedObjectsClient, - apiClient, - fieldFormats, - onNotification, - onError, - onRedirectNoIndexPattern = () => {}, - }: IndexPatternsServiceDeps) { - this.apiClient = apiClient; - this.config = uiSettings; - this.savedObjectsClient = savedObjectsClient; - this.fieldFormats = fieldFormats; - this.onNotification = onNotification; - this.onError = onError; - this.ensureDefaultIndexPattern = createEnsureDefaultDataView( - uiSettings, - onRedirectNoIndexPattern - ); - - this.indexPatternCache = createDataViewCache(); - } - - /** - * Refresh cache of index pattern ids and titles - */ - private async refreshSavedObjectsCache() { - const so = await this.savedObjectsClient.find({ - type: DATA_VIEW_SAVED_OBJECT_TYPE, - fields: ['title', 'type', 'typeMeta'], - perPage: 10000, - }); - this.savedObjectsCache = so; - } - - /** - * Get list of index pattern ids - * @param refresh Force refresh of index pattern list - */ - getIds = async (refresh: boolean = false) => { - if (!this.savedObjectsCache || refresh) { - await this.refreshSavedObjectsCache(); - } - if (!this.savedObjectsCache) { - return []; - } - return this.savedObjectsCache.map((obj) => obj?.id); - }; - - /** - * Get list of index pattern titles - * @param refresh Force refresh of index pattern list - */ - getTitles = async (refresh: boolean = false): Promise => { - if (!this.savedObjectsCache || refresh) { - await this.refreshSavedObjectsCache(); - } - if (!this.savedObjectsCache) { - return []; - } - return this.savedObjectsCache.map((obj) => obj?.attributes?.title); - }; - - /** - * Find and load index patterns by title - * @param search - * @param size - * @returns IndexPattern[] - */ - find = async (search: string, size: number = 10): Promise => { - const savedObjects = await this.savedObjectsClient.find({ - type: DATA_VIEW_SAVED_OBJECT_TYPE, - fields: ['title'], - search, - searchFields: ['title'], - perPage: size, - }); - const getIndexPatternPromises = savedObjects.map(async (savedObject) => { - return await this.get(savedObject.id); - }); - return await Promise.all(getIndexPatternPromises); - }; - - /** - * Get list of index pattern ids with titles - * @param refresh Force refresh of index pattern list - */ - getIdsWithTitle = async (refresh: boolean = false): Promise => { - if (!this.savedObjectsCache || refresh) { - await this.refreshSavedObjectsCache(); - } - if (!this.savedObjectsCache) { - return []; - } - return this.savedObjectsCache.map((obj) => ({ - id: obj?.id, - title: obj?.attributes?.title, - type: obj?.attributes?.type, - typeMeta: obj?.attributes?.typeMeta && JSON.parse(obj?.attributes?.typeMeta), - })); - }; - - /** - * Clear index pattern list cache - * @param id optionally clear a single id - */ - clearCache = (id?: string) => { - this.savedObjectsCache = null; - if (id) { - this.indexPatternCache.clear(id); - } else { - this.indexPatternCache.clearAll(); - } - }; - - getCache = async () => { - if (!this.savedObjectsCache) { - await this.refreshSavedObjectsCache(); - } - return this.savedObjectsCache; - }; - - /** - * Get default index pattern - */ - getDefault = async () => { - const defaultIndexPatternId = await this.getDefaultId(); - if (defaultIndexPatternId) { - return await this.get(defaultIndexPatternId); - } - - return null; - }; - - /** - * Get default index pattern id - */ - getDefaultId = async (): Promise => { - const defaultIndexPatternId = await this.config.get('defaultIndex'); - return defaultIndexPatternId ?? null; - }; - - /** - * Optionally set default index pattern, unless force = true - * @param id - * @param force - */ - setDefault = async (id: string | null, force = false) => { - if (force || !this.config.get('defaultIndex')) { - await this.config.set('defaultIndex', id); - } - }; - - /** - * Checks if current user has a user created index pattern ignoring fleet's server default index patterns - */ - async hasUserIndexPattern(): Promise { - return this.apiClient.hasUserIndexPattern(); - } - - /** - * Get field list by providing { pattern } - * @param options - * @returns FieldSpec[] - */ - getFieldsForWildcard = async (options: GetFieldsOptions) => { - const metaFields = await this.config.get(UI_SETTINGS.META_FIELDS); - return this.apiClient.getFieldsForWildcard({ - pattern: options.pattern, - metaFields, - type: options.type, - rollupIndex: options.rollupIndex, - allowNoIndex: options.allowNoIndex, - }); - }; - - /** - * Get field list by providing an index patttern (or spec) - * @param options - * @returns FieldSpec[] - */ - getFieldsForIndexPattern = async ( - indexPattern: DataView | DataViewSpec, - options?: GetFieldsOptions - ) => - this.getFieldsForWildcard({ - type: indexPattern.type, - rollupIndex: indexPattern?.typeMeta?.params?.rollup_index, - ...options, - pattern: indexPattern.title as string, - }); - - /** - * Refresh field list for a given index pattern - * @param indexPattern - */ - refreshFields = async (indexPattern: DataView) => { - try { - const fields = (await this.getFieldsForIndexPattern(indexPattern)) as FieldSpec[]; - fields.forEach((field) => (field.isMapped = true)); - const scripted = indexPattern.getScriptedFields().map((field) => field.spec); - const fieldAttrs = indexPattern.getFieldAttrs(); - const fieldsWithSavedAttrs = Object.values( - this.fieldArrayToMap([...fields, ...scripted], fieldAttrs) - ); - indexPattern.fields.replaceAll(fieldsWithSavedAttrs); - } catch (err) { - if (err instanceof DataViewMissingIndices) { - this.onNotification({ title: (err as any).message, color: 'danger', iconType: 'alert' }); - } - - this.onError(err, { - title: i18n.translate('data.indexPatterns.fetchFieldErrorTitle', { - defaultMessage: 'Error fetching fields for index pattern {title} (ID: {id})', - values: { id: indexPattern.id, title: indexPattern.title }, - }), - }); - } - }; - - /** - * Refreshes a field list from a spec before an index pattern instance is created - * @param fields - * @param id - * @param title - * @param options - * @returns Record - */ - private refreshFieldSpecMap = async ( - fields: DataViewFieldMap, - id: string, - title: string, - options: GetFieldsOptions, - fieldAttrs: FieldAttrs = {} - ) => { - const fieldsAsArr = Object.values(fields); - const scriptedFields = fieldsAsArr.filter((field) => field.scripted); - try { - let updatedFieldList: FieldSpec[]; - const newFields = (await this.getFieldsForWildcard(options)) as FieldSpec[]; - newFields.forEach((field) => (field.isMapped = true)); - - // If allowNoIndex, only update field list if field caps finds fields. To support - // beats creating index pattern and dashboard before docs - if (!options.allowNoIndex || (newFields && newFields.length > 5)) { - updatedFieldList = [...newFields, ...scriptedFields]; - } else { - updatedFieldList = fieldsAsArr; - } - - return this.fieldArrayToMap(updatedFieldList, fieldAttrs); - } catch (err) { - if (err instanceof DataViewMissingIndices) { - this.onNotification({ title: (err as any).message, color: 'danger', iconType: 'alert' }); - return {}; - } - - this.onError(err, { - title: i18n.translate('data.indexPatterns.fetchFieldErrorTitle', { - defaultMessage: 'Error fetching fields for index pattern {title} (ID: {id})', - values: { id, title }, - }), - }); - throw err; - } - }; - - /** - * Converts field array to map - * @param fields: FieldSpec[] - * @param fieldAttrs: FieldAttrs - * @returns Record - */ - fieldArrayToMap = (fields: FieldSpec[], fieldAttrs?: FieldAttrs) => - fields.reduce((collector, field) => { - collector[field.name] = { - ...field, - customLabel: fieldAttrs?.[field.name]?.customLabel, - count: fieldAttrs?.[field.name]?.count, - }; - return collector; - }, {}); - - /** - * Converts index pattern saved object to index pattern spec - * @param savedObject - * @returns IndexPatternSpec - */ - - savedObjectToSpec = (savedObject: SavedObject): DataViewSpec => { - const { - id, - version, - attributes: { - title, - timeFieldName, - intervalName, - fields, - sourceFilters, - fieldFormatMap, - runtimeFieldMap, - typeMeta, - type, - fieldAttrs, - allowNoIndex, - }, - } = savedObject; - - const parsedSourceFilters = sourceFilters ? JSON.parse(sourceFilters) : undefined; - const parsedTypeMeta = typeMeta ? JSON.parse(typeMeta) : undefined; - const parsedFieldFormatMap = fieldFormatMap ? JSON.parse(fieldFormatMap) : {}; - const parsedFields: FieldSpec[] = fields ? JSON.parse(fields) : []; - const parsedFieldAttrs: FieldAttrs = fieldAttrs ? JSON.parse(fieldAttrs) : {}; - const parsedRuntimeFieldMap: Record = runtimeFieldMap - ? JSON.parse(runtimeFieldMap) - : {}; - - return { - id, - version, - title, - intervalName, - timeFieldName, - sourceFilters: parsedSourceFilters, - fields: this.fieldArrayToMap(parsedFields, parsedFieldAttrs), - typeMeta: parsedTypeMeta, - type, - fieldFormats: parsedFieldFormatMap, - fieldAttrs: parsedFieldAttrs, - allowNoIndex, - runtimeFieldMap: parsedRuntimeFieldMap, - }; - }; - - private getSavedObjectAndInit = async (id: string): Promise => { - let savedObject: SavedObject; - try { - savedObject = await this.savedObjectsClient.get( - DATA_VIEW_SAVED_OBJECT_TYPE, - id - ); - } catch (e) { - throw new SavedObjectNotFound( - DATA_VIEW_SAVED_OBJECT_TYPE, - id, - 'management/kibana/indexPatterns' - ); - } - - if (!savedObject.version) { - throw new SavedObjectNotFound( - DATA_VIEW_SAVED_OBJECT_TYPE, - id, - 'management/kibana/indexPatterns' - ); - } - - return this.initFromSavedObject(savedObject); - }; - - private initFromSavedObject = async ( - savedObject: SavedObject - ): Promise => { - const spec = this.savedObjectToSpec(savedObject); - const { title, type, typeMeta, runtimeFieldMap } = spec; - spec.fieldAttrs = savedObject.attributes.fieldAttrs - ? JSON.parse(savedObject.attributes.fieldAttrs) - : {}; - - try { - spec.fields = await this.refreshFieldSpecMap( - spec.fields || {}, - savedObject.id, - spec.title as string, - { - pattern: title as string, - metaFields: await this.config.get(UI_SETTINGS.META_FIELDS), - type, - rollupIndex: typeMeta?.params?.rollup_index, - allowNoIndex: spec.allowNoIndex, - }, - spec.fieldAttrs - ); - - // CREATE RUNTIME FIELDS - for (const [key, value] of Object.entries(runtimeFieldMap || {})) { - // do not create runtime field if mapped field exists - if (!spec.fields[key]) { - spec.fields[key] = { - name: key, - type: castEsToKbnFieldTypeName(value.type), - runtimeField: value, - aggregatable: true, - searchable: true, - readFromDocValues: false, - customLabel: spec.fieldAttrs?.[key]?.customLabel, - count: spec.fieldAttrs?.[key]?.count, - }; - } - } - } catch (err) { - if (err instanceof DataViewMissingIndices) { - this.onNotification({ - title: (err as any).message, - color: 'danger', - iconType: 'alert', - }); - } else { - this.onError(err, { - title: i18n.translate('data.indexPatterns.fetchFieldErrorTitle', { - defaultMessage: 'Error fetching fields for index pattern {title} (ID: {id})', - values: { id: savedObject.id, title }, - }), - }); - } - } - - spec.fieldFormats = savedObject.attributes.fieldFormatMap - ? JSON.parse(savedObject.attributes.fieldFormatMap) - : {}; - - const indexPattern = await this.create(spec, true); - indexPattern.resetOriginalSavedObjectBody(); - return indexPattern; - }; - - /** - * Get an index pattern by id. Cache optimized - * @param id - */ - - get = async (id: string): Promise => { - const indexPatternPromise = - this.indexPatternCache.get(id) || - this.indexPatternCache.set(id, this.getSavedObjectAndInit(id)); - - // don't cache failed requests - indexPatternPromise.catch(() => { - this.indexPatternCache.clear(id); - }); - - return indexPatternPromise; - }; - - /** - * Create a new index pattern instance - * @param spec - * @param skipFetchFields - * @returns IndexPattern - */ - async create(spec: DataViewSpec, skipFetchFields = false): Promise { - const shortDotsEnable = await this.config.get(FORMATS_UI_SETTINGS.SHORT_DOTS_ENABLE); - const metaFields = await this.config.get(UI_SETTINGS.META_FIELDS); - - const indexPattern = new DataView({ - spec, - fieldFormats: this.fieldFormats, - shortDotsEnable, - metaFields, - }); - - if (!skipFetchFields) { - await this.refreshFields(indexPattern); - } - - return indexPattern; - } - - /** - * Create a new index pattern and save it right away - * @param spec - * @param override Overwrite if existing index pattern exists. - * @param skipFetchFields Whether to skip field refresh step. - */ - - async createAndSave(spec: DataViewSpec, override = false, skipFetchFields = false) { - const indexPattern = await this.create(spec, skipFetchFields); - const createdIndexPattern = await this.createSavedObject(indexPattern, override); - await this.setDefault(createdIndexPattern.id!); - return createdIndexPattern!; - } - - /** - * Save a new index pattern - * @param indexPattern - * @param override Overwrite if existing index pattern exists - */ - - async createSavedObject(indexPattern: DataView, override = false) { - const dupe = await findByTitle(this.savedObjectsClient, indexPattern.title); - if (dupe) { - if (override) { - await this.delete(dupe.id); - } else { - throw new DuplicateDataViewError(`Duplicate index pattern: ${indexPattern.title}`); - } - } - - const body = indexPattern.getAsSavedObjectBody(); - const response: SavedObject = (await this.savedObjectsClient.create( - DATA_VIEW_SAVED_OBJECT_TYPE, - body, - { - id: indexPattern.id, - } - )) as SavedObject; - - const createdIndexPattern = await this.initFromSavedObject(response); - this.indexPatternCache.set(createdIndexPattern.id!, Promise.resolve(createdIndexPattern)); - if (this.savedObjectsCache) { - this.savedObjectsCache.push(response as SavedObject); - } - return createdIndexPattern; - } - - /** - * Save existing index pattern. Will attempt to merge differences if there are conflicts - * @param indexPattern - * @param saveAttempts - */ - - async updateSavedObject( - indexPattern: DataView, - saveAttempts: number = 0, - ignoreErrors: boolean = false - ): Promise { - if (!indexPattern.id) return; - - // get the list of attributes - const body = indexPattern.getAsSavedObjectBody(); - const originalBody = indexPattern.getOriginalSavedObjectBody(); - - // get changed keys - const originalChangedKeys: string[] = []; - Object.entries(body).forEach(([key, value]) => { - if (value !== (originalBody as any)[key]) { - originalChangedKeys.push(key); - } - }); - - return this.savedObjectsClient - .update(DATA_VIEW_SAVED_OBJECT_TYPE, indexPattern.id, body, { - version: indexPattern.version, - }) - .then((resp) => { - indexPattern.id = resp.id; - indexPattern.version = resp.version; - }) - .catch(async (err) => { - if (err?.res?.status === 409 && saveAttempts++ < MAX_ATTEMPTS_TO_RESOLVE_CONFLICTS) { - const samePattern = await this.get(indexPattern.id as string); - // What keys changed from now and what the server returned - const updatedBody = samePattern.getAsSavedObjectBody(); - - // Build a list of changed keys from the server response - // and ensure we ignore the key if the server response - // is the same as the original response (since that is expected - // if we made a change in that key) - - const serverChangedKeys: string[] = []; - Object.entries(updatedBody).forEach(([key, value]) => { - if (value !== (body as any)[key] && value !== (originalBody as any)[key]) { - serverChangedKeys.push(key); - } - }); - - let unresolvedCollision = false; - for (const originalKey of originalChangedKeys) { - for (const serverKey of serverChangedKeys) { - if (originalKey === serverKey) { - unresolvedCollision = true; - break; - } - } - } - - if (unresolvedCollision) { - if (ignoreErrors) { - return; - } - const title = i18n.translate('data.indexPatterns.unableWriteLabel', { - defaultMessage: - 'Unable to write index pattern! Refresh the page to get the most up to date changes for this index pattern.', - }); - - this.onNotification({ title, color: 'danger' }); - throw err; - } - - // Set the updated response on this object - serverChangedKeys.forEach((key) => { - (indexPattern as any)[key] = (samePattern as any)[key]; - }); - indexPattern.version = samePattern.version; - - // Clear cache - this.indexPatternCache.clear(indexPattern.id!); - - // Try the save again - return this.updateSavedObject(indexPattern, saveAttempts, ignoreErrors); - } - throw err; - }); - } - - /** - * Deletes an index pattern from .kibana index - * @param indexPatternId: Id of kibana Index Pattern to delete - */ - async delete(indexPatternId: string) { - this.indexPatternCache.clear(indexPatternId); - return this.savedObjectsClient.delete(DATA_VIEW_SAVED_OBJECT_TYPE, indexPatternId); - } -} - -/** - * @deprecated Use DataViewsService. All index pattern interfaces were renamed. - */ -export class IndexPatternsService extends DataViewsService {} - -export type DataViewsContract = PublicMethodsOf; - -/** - * @deprecated Use DataViewsContract. All index pattern interfaces were renamed. - */ -export type IndexPatternsContract = DataViewsContract; diff --git a/src/plugins/data/common/index_patterns/lib/errors.ts b/src/plugins/data/common/index_patterns/lib/errors.ts deleted file mode 100644 index 20f422c5124e6..0000000000000 --- a/src/plugins/data/common/index_patterns/lib/errors.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 and the Server Side Public License, v 1; you may 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 */ - -import { KbnError } from '../../../../kibana_utils/common/'; - -/** - * Tried to call a method that relies on SearchSource having an indexPattern assigned - */ -export class DataViewMissingIndices extends KbnError { - constructor(message: string) { - const defaultMessage = "IndexPattern's configured pattern does not match any indices"; - - super( - message && message.length ? `No matching indices found: ${message}` : defaultMessage - ); - } -} diff --git a/src/plugins/data/common/index_patterns/mocks.ts b/src/plugins/data/common/index_patterns/mocks.ts deleted file mode 100644 index b8b3b67c56df3..0000000000000 --- a/src/plugins/data/common/index_patterns/mocks.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 and the Server Side Public License, v 1; you may 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 './fields/fields.mocks'; -export * from './index_patterns/index_pattern.stub'; diff --git a/src/plugins/data/common/index_patterns/utils.ts b/src/plugins/data/common/index_patterns/utils.ts deleted file mode 100644 index 48a0776dc43a8..0000000000000 --- a/src/plugins/data/common/index_patterns/utils.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 and the Server Side Public License, v 1; you may not 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 { IndexPatternSavedObjectAttrs } from './index_patterns'; -import type { SavedObjectsClientCommon } from '../types'; - -import { DATA_VIEW_SAVED_OBJECT_TYPE } from '../constants'; - -/** - * Returns an object matching a given title - * - * @param client {SavedObjectsClientCommon} - * @param title {string} - * @returns {Promise} - */ -export async function findByTitle(client: SavedObjectsClientCommon, title: string) { - if (title) { - const savedObjects = await client.find({ - type: DATA_VIEW_SAVED_OBJECT_TYPE, - perPage: 10, - search: `"${title}"`, - searchFields: ['title'], - fields: ['title'], - }); - - return savedObjects.find((obj) => obj.attributes.title.toLowerCase() === title.toLowerCase()); - } -} diff --git a/src/plugins/data/common/mocks.ts b/src/plugins/data/common/mocks.ts new file mode 100644 index 0000000000000..66ad3b695d24c --- /dev/null +++ b/src/plugins/data/common/mocks.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export * from './data_views/fields/fields.mocks'; diff --git a/src/plugins/data/common/query/timefilter/get_time.test.ts b/src/plugins/data/common/query/timefilter/get_time.test.ts index 5389eb71a10bb..70f6f418cc739 100644 --- a/src/plugins/data/common/query/timefilter/get_time.test.ts +++ b/src/plugins/data/common/query/timefilter/get_time.test.ts @@ -7,9 +7,10 @@ */ import { RangeFilter } from '@kbn/es-query'; +import type { IIndexPattern } from '../..'; import moment from 'moment'; import sinon from 'sinon'; -import { getTime, getAbsoluteTimeRange } from './get_time'; +import { getTime, getRelativeTime, getAbsoluteTimeRange } from './get_time'; describe('get_time', () => { describe('getTime', () => { @@ -17,7 +18,7 @@ describe('get_time', () => { const clock = sinon.useFakeTimers(moment.utc([2000, 1, 1, 0, 0, 0, 0]).valueOf()); const filter = getTime( - { + ({ id: 'test', title: 'test', timeFieldName: 'date', @@ -31,7 +32,7 @@ describe('get_time', () => { filterable: true, }, ], - } as any, + } as unknown) as IIndexPattern, { from: 'now-60y', to: 'now' } ) as RangeFilter; expect(filter.range.date).toEqual({ @@ -46,7 +47,7 @@ describe('get_time', () => { const clock = sinon.useFakeTimers(moment.utc([2000, 1, 1, 0, 0, 0, 0]).valueOf()); const filter = getTime( - { + ({ id: 'test', title: 'test', timeFieldName: 'date', @@ -68,7 +69,7 @@ describe('get_time', () => { filterable: true, }, ], - } as any, + } as unknown) as IIndexPattern, { from: 'now-60y', to: 'now' }, { fieldName: 'myCustomDate' } ) as RangeFilter; @@ -80,6 +81,83 @@ describe('get_time', () => { clock.restore(); }); }); + describe('getRelativeTime', () => { + test('do not coerce relative time to absolute time when given flag', () => { + const filter = getRelativeTime( + ({ + id: 'test', + title: 'test', + timeFieldName: 'date', + fields: [ + { + name: 'date', + type: 'date', + esTypes: ['date'], + aggregatable: true, + searchable: true, + filterable: true, + }, + { + name: 'myCustomDate', + type: 'date', + esTypes: ['date'], + aggregatable: true, + searchable: true, + filterable: true, + }, + ], + } as unknown) as IIndexPattern, + { from: 'now-60y', to: 'now' }, + { fieldName: 'myCustomDate' } + ) as RangeFilter; + + expect(filter.range.myCustomDate).toEqual({ + gte: 'now-60y', + lte: 'now', + format: 'strict_date_optional_time', + }); + }); + test('do not coerce relative time to absolute time when given flag - with mixed from and to times', () => { + const clock = sinon.useFakeTimers(moment.utc().valueOf()); + const filter = getRelativeTime( + ({ + id: 'test', + title: 'test', + timeFieldName: 'date', + fields: [ + { + name: 'date', + type: 'date', + esTypes: ['date'], + aggregatable: true, + searchable: true, + filterable: true, + }, + { + name: 'myCustomDate', + type: 'date', + esTypes: ['date'], + aggregatable: true, + searchable: true, + filterable: true, + }, + ], + } as unknown) as IIndexPattern, + { + from: '2020-09-01T08:30:00.000Z', + to: 'now', + }, + { fieldName: 'myCustomDate' } + ) as RangeFilter; + + expect(filter.range.myCustomDate).toEqual({ + gte: '2020-09-01T08:30:00.000Z', + lte: 'now', + format: 'strict_date_optional_time', + }); + clock.restore(); + }); + }); describe('getAbsoluteTimeRange', () => { test('should forward absolute timerange as is', () => { const from = '2000-01-01T00:00:00.000Z'; diff --git a/src/plugins/data/common/query/timefilter/get_time.ts b/src/plugins/data/common/query/timefilter/get_time.ts index 4c20e49f53315..fd21b2251ea3a 100644 --- a/src/plugins/data/common/query/timefilter/get_time.ts +++ b/src/plugins/data/common/query/timefilter/get_time.ts @@ -7,20 +7,30 @@ */ import dateMath from '@elastic/datemath'; +import { omitBy } from 'lodash'; import { buildRangeFilter } from '@kbn/es-query'; -import type { IIndexPattern, TimeRange, TimeRangeBounds } from '../..'; +import type { Moment } from 'moment'; +import type { IIndexPattern, TimeRange, TimeRangeBounds, RangeFilterParams } from '../..'; interface CalculateBoundsOptions { forceNow?: Date; } +const calculateLowerBound = (from: string, forceNow?: Date): undefined | Moment => + dateMath.parse(from, { forceNow }); + +const calculateUpperBound = (to: string, forceNow?: Date): undefined | Moment => + dateMath.parse(to, { roundUp: true, forceNow }); + +const isRelativeTime = (value: string): boolean => value.includes('now'); + export function calculateBounds( timeRange: TimeRange, options: CalculateBoundsOptions = {} ): TimeRangeBounds { return { - min: dateMath.parse(timeRange.from, { forceNow: options.forceNow }), - max: dateMath.parse(timeRange.to, { roundUp: true, forceNow: options.forceNow }), + min: calculateLowerBound(timeRange.from, options.forceNow), + max: calculateUpperBound(timeRange.to, options.forceNow), }; } @@ -44,7 +54,22 @@ export function getTime( indexPattern, timeRange, options?.fieldName || indexPattern?.timeFieldName, - options?.forceNow + options?.forceNow, + true + ); +} + +export function getRelativeTime( + indexPattern: IIndexPattern | undefined, + timeRange: TimeRange, + options?: { forceNow?: Date; fieldName?: string } +) { + return createTimeRangeFilter( + indexPattern, + timeRange, + options?.fieldName || indexPattern?.timeFieldName, + options?.forceNow, + false ); } @@ -52,7 +77,8 @@ function createTimeRangeFilter( indexPattern: IIndexPattern | undefined, timeRange: TimeRange, fieldName?: string, - forceNow?: Date + forceNow?: Date, + coerceRelativeTimeToAbsoluteTime: boolean = true ) { if (!indexPattern) { return; @@ -64,17 +90,28 @@ function createTimeRangeFilter( return; } - const bounds = calculateBounds(timeRange, { forceNow }); - if (!bounds) { - return; + let rangeFilterParams: RangeFilterParams = { + format: 'strict_date_optional_time', + }; + + if (coerceRelativeTimeToAbsoluteTime) { + const bounds = calculateBounds(timeRange, { forceNow }); + if (!bounds) { + return; + } + rangeFilterParams.gte = bounds.min?.toISOString(); + rangeFilterParams.lte = bounds.max?.toISOString(); + } else { + rangeFilterParams.gte = isRelativeTime(timeRange.from) + ? timeRange.from + : calculateLowerBound(timeRange.from, forceNow)?.toISOString(); + + rangeFilterParams.lte = isRelativeTime(timeRange.to) + ? timeRange.to + : calculateUpperBound(timeRange.to, forceNow)?.toISOString(); } - return buildRangeFilter( - field, - { - ...(bounds.min && { gte: bounds.min.toISOString() }), - ...(bounds.max && { lte: bounds.max.toISOString() }), - format: 'strict_date_optional_time', - }, - indexPattern - ); + + rangeFilterParams = omitBy(rangeFilterParams, (v) => v == null); + + return buildRangeFilter(field, rangeFilterParams, indexPattern); } diff --git a/src/plugins/data/common/search/aggs/agg_config.test.ts b/src/plugins/data/common/search/aggs/agg_config.test.ts index d15cccebd08fc..2cb875eb9c047 100644 --- a/src/plugins/data/common/search/aggs/agg_config.test.ts +++ b/src/plugins/data/common/search/aggs/agg_config.test.ts @@ -15,7 +15,7 @@ import { AggType } from './agg_type'; import { AggTypesRegistryStart } from './agg_types_registry'; import { mockAggTypesRegistry } from './test_helpers'; import { MetricAggType } from './metrics/metric_agg_type'; -import { IndexPattern, IndexPatternField, IIndexPatternFieldList } from '../../index_patterns'; +import { IndexPattern, IndexPatternField, IIndexPatternFieldList } from '../..'; describe('AggConfig', () => { let indexPattern: IndexPattern; diff --git a/src/plugins/data/common/search/aggs/agg_configs.test.ts b/src/plugins/data/common/search/aggs/agg_configs.test.ts index 978ec79147a13..59b306c2df0b1 100644 --- a/src/plugins/data/common/search/aggs/agg_configs.test.ts +++ b/src/plugins/data/common/search/aggs/agg_configs.test.ts @@ -11,7 +11,7 @@ import { AggConfig } from './agg_config'; import { AggConfigs } from './agg_configs'; import { AggTypesRegistryStart } from './agg_types_registry'; import { mockAggTypesRegistry } from './test_helpers'; -import { IndexPattern } from '../../index_patterns/'; +import { IndexPattern } from '../..'; import { stubIndexPattern } from '../../stubs'; import { IEsSearchResponse } from '..'; diff --git a/src/plugins/data/common/search/aggs/agg_configs.ts b/src/plugins/data/common/search/aggs/agg_configs.ts index c80becd271bba..08a7022ee8942 100644 --- a/src/plugins/data/common/search/aggs/agg_configs.ts +++ b/src/plugins/data/common/search/aggs/agg_configs.ts @@ -23,7 +23,7 @@ import { AggConfig, AggConfigSerialized, IAggConfig } from './agg_config'; import { IAggType } from './agg_type'; import { AggTypesRegistryStart } from './agg_types_registry'; import { AggGroupNames } from './agg_groups'; -import { IndexPattern } from '../../index_patterns/index_patterns/index_pattern'; +import { IndexPattern } from '../..'; import { TimeRange, getTime, calculateBounds } from '../../../common'; import { IBucketAggConfig } from './buckets'; import { insertTimeShiftSplit, mergeTimeShifts } from './utils/time_splits'; diff --git a/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts b/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts index 523bbe1f01018..9d61178405b52 100644 --- a/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts +++ b/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts @@ -16,8 +16,8 @@ import { AggConfigs, CreateAggConfigParams } from '../agg_configs'; import { BUCKET_TYPES } from './bucket_agg_types'; import { IBucketAggConfig } from './bucket_agg_type'; import { mockAggTypesRegistry } from '../test_helpers'; -import type { IndexPatternField } from '../../../index_patterns'; -import { IndexPattern } from '../../../index_patterns/index_patterns/index_pattern'; +import type { IndexPatternField } from '../../..'; +import { IndexPattern } from '../../..'; const indexPattern = { id: '1234', diff --git a/src/plugins/data/common/search/aggs/buckets/date_histogram.ts b/src/plugins/data/common/search/aggs/buckets/date_histogram.ts index befffe915b6ab..f2bd6ea734e04 100644 --- a/src/plugins/data/common/search/aggs/buckets/date_histogram.ts +++ b/src/plugins/data/common/search/aggs/buckets/date_histogram.ts @@ -11,7 +11,7 @@ import moment from 'moment-timezone'; import { i18n } from '@kbn/i18n'; import { KBN_FIELD_TYPES, TimeRange, TimeRangeBounds, UI_SETTINGS } from '../../../../common'; -import { IFieldType } from '../../../index_patterns'; +import { IFieldType } from '../../..'; import { ExtendedBounds, extendedBoundsToAst, timerangeToAst } from '../../expressions'; import { intervalOptions, autoInterval, isAutoInterval } from './_interval_options'; diff --git a/src/plugins/data/common/search/aggs/buckets/terms.test.ts b/src/plugins/data/common/search/aggs/buckets/terms.test.ts index 09dfbb28a4e53..6345e29b6fbe4 100644 --- a/src/plugins/data/common/search/aggs/buckets/terms.test.ts +++ b/src/plugins/data/common/search/aggs/buckets/terms.test.ts @@ -10,8 +10,8 @@ import { AggConfigs } from '../agg_configs'; import { METRIC_TYPES } from '../metrics'; import { mockAggTypesRegistry } from '../test_helpers'; import { BUCKET_TYPES } from './bucket_agg_types'; -import type { IndexPatternField } from '../../../index_patterns'; -import { IndexPattern } from '../../../index_patterns/index_patterns/index_pattern'; +import type { IndexPatternField } from '../../..'; +import { IndexPattern } from '../../..'; describe('Terms Agg', () => { describe('order agg editor UI', () => { diff --git a/src/plugins/data/common/search/aggs/param_types/field.ts b/src/plugins/data/common/search/aggs/param_types/field.ts index 62dac9831211a..e1c872ac16701 100644 --- a/src/plugins/data/common/search/aggs/param_types/field.ts +++ b/src/plugins/data/common/search/aggs/param_types/field.ts @@ -15,7 +15,7 @@ import { import { BaseParamType } from './base'; import { propFilter } from '../utils'; import { KBN_FIELD_TYPES } from '../../../kbn_field_types/types'; -import { isNestedField, IndexPatternField } from '../../../index_patterns/fields'; +import { isNestedField, IndexPatternField } from '../../../data_views/fields'; const filterByType = propFilter('type'); diff --git a/src/plugins/data/common/search/aggs/types.ts b/src/plugins/data/common/search/aggs/types.ts index 7d5b7d4eeff9e..7a87a83b7b00b 100644 --- a/src/plugins/data/common/search/aggs/types.ts +++ b/src/plugins/data/common/search/aggs/types.ts @@ -8,7 +8,7 @@ import { Assign } from '@kbn/utility-types'; import { DatatableColumn } from 'src/plugins/expressions'; -import { IndexPattern } from '../../index_patterns/index_patterns/index_pattern'; +import { IndexPattern } from '../..'; import { aggAvg, aggBucketAvg, diff --git a/src/plugins/data/common/search/aggs/utils/datatable_column_meta.ts b/src/plugins/data/common/search/aggs/utils/datatable_column_meta.ts index c5e09e6622850..0e3ff69fac1d1 100644 --- a/src/plugins/data/common/search/aggs/utils/datatable_column_meta.ts +++ b/src/plugins/data/common/search/aggs/utils/datatable_column_meta.ts @@ -7,7 +7,7 @@ */ import { DatatableColumn } from 'src/plugins/expressions/common'; -import { IndexPattern } from '../../../index_patterns'; +import { IndexPattern } from '../../..'; import { AggConfigs, CreateAggConfigParams } from '../agg_configs'; import { AggTypesRegistryStart } from '../agg_types_registry'; import { IAggType } from '../agg_type'; diff --git a/src/plugins/data/common/search/aggs/utils/infer_time_zone.test.ts b/src/plugins/data/common/search/aggs/utils/infer_time_zone.test.ts index 0c94769f0538e..91f69f3bfb148 100644 --- a/src/plugins/data/common/search/aggs/utils/infer_time_zone.test.ts +++ b/src/plugins/data/common/search/aggs/utils/infer_time_zone.test.ts @@ -18,7 +18,7 @@ jest.mock('moment', () => { return moment; }); -import { IndexPattern, IndexPatternField } from '../../../index_patterns'; +import { IndexPattern, IndexPatternField } from '../../..'; import { AggParamsDateHistogram } from '../buckets'; import { inferTimeZone } from './infer_time_zone'; diff --git a/src/plugins/data/common/search/aggs/utils/infer_time_zone.ts b/src/plugins/data/common/search/aggs/utils/infer_time_zone.ts index b031fb890b77c..21c022d8e293c 100644 --- a/src/plugins/data/common/search/aggs/utils/infer_time_zone.ts +++ b/src/plugins/data/common/search/aggs/utils/infer_time_zone.ts @@ -7,7 +7,7 @@ */ import moment from 'moment'; -import { IndexPattern } from '../../../index_patterns'; +import { IndexPattern } from '../../..'; import { AggParamsDateHistogram } from '../buckets'; export function inferTimeZone( diff --git a/src/plugins/data/common/search/expressions/esaggs/esaggs_fn.ts b/src/plugins/data/common/search/expressions/esaggs/esaggs_fn.ts index 496225ad9f00b..a9078d6042db8 100644 --- a/src/plugins/data/common/search/expressions/esaggs/esaggs_fn.ts +++ b/src/plugins/data/common/search/expressions/esaggs/esaggs_fn.ts @@ -12,8 +12,8 @@ import { Observable } from 'rxjs'; import type { Datatable, ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; import { buildExpressionFunction } from '../../../../../../plugins/expressions/common'; -import { IndexPatternExpressionType } from '../../../index_patterns/expressions'; -import { IndexPatternsContract } from '../../../index_patterns/index_patterns'; +import { IndexPatternExpressionType } from '../../../data_views/expressions'; +import { IndexPatternsContract } from '../../..'; import { AggsStart, AggExpressionType, aggCountFnName } from '../../aggs'; import { ISearchStartSearchSource } from '../../search_source'; diff --git a/src/plugins/data/common/search/expressions/esaggs/request_handler.test.ts b/src/plugins/data/common/search/expressions/esaggs/request_handler.test.ts index dae3661f00c27..56f6c9da6d84a 100644 --- a/src/plugins/data/common/search/expressions/esaggs/request_handler.test.ts +++ b/src/plugins/data/common/search/expressions/esaggs/request_handler.test.ts @@ -9,7 +9,7 @@ import { from } from 'rxjs'; import type { MockedKeys } from '@kbn/utility-types/jest'; import type { Filter } from '../../../es_query'; -import type { IndexPattern } from '../../../index_patterns'; +import type { IndexPattern } from '../../..'; import type { IAggConfigs } from '../../aggs'; import type { ISearchSource } from '../../search_source'; import { searchSourceCommonMock, searchSourceInstanceMock } from '../../search_source/mocks'; diff --git a/src/plugins/data/common/search/expressions/esdsl.ts b/src/plugins/data/common/search/expressions/esdsl.ts index a5834001143e4..c5b116073c06b 100644 --- a/src/plugins/data/common/search/expressions/esdsl.ts +++ b/src/plugins/data/common/search/expressions/esdsl.ts @@ -14,7 +14,7 @@ import { EsRawResponse } from './es_raw_response'; import { RequestStatistics, RequestAdapter } from '../../../../inspector/common'; import { ISearchGeneric, KibanaContext } from '..'; import { getEsQueryConfig } from '../../es_query'; -import { UiSettingsCommon } from '../../index_patterns'; +import { UiSettingsCommon } from '../..'; const name = 'esdsl'; diff --git a/src/plugins/data/common/search/expressions/exists_filter.ts b/src/plugins/data/common/search/expressions/exists_filter.ts index 75d83ca7f2592..3edb659966466 100644 --- a/src/plugins/data/common/search/expressions/exists_filter.ts +++ b/src/plugins/data/common/search/expressions/exists_filter.ts @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; import { buildFilter, FILTERS } from '@kbn/es-query'; import { KibanaField, KibanaFilter } from './kibana_context_type'; -import { IndexPattern } from '../../index_patterns/index_patterns'; +import { IndexPattern } from '../..'; interface Arguments { field: KibanaField; diff --git a/src/plugins/data/common/search/expressions/kibana_context.ts b/src/plugins/data/common/search/expressions/kibana_context.ts index fb766b497c39c..47ca24b5be42b 100644 --- a/src/plugins/data/common/search/expressions/kibana_context.ts +++ b/src/plugins/data/common/search/expressions/kibana_context.ts @@ -17,7 +17,7 @@ import { ExecutionContextSearch, KibanaContext, KibanaFilter } from './kibana_co import { KibanaQueryOutput } from './kibana_context_type'; import { KibanaTimerangeOutput } from './timerange'; import { SavedObjectReference } from '../../../../../core/types'; -import { SavedObjectsClientCommon } from '../../index_patterns'; +import { SavedObjectsClientCommon } from '../..'; /** @internal */ export interface KibanaContextStartDependencies { diff --git a/src/plugins/data/common/search/expressions/kibana_context_type.ts b/src/plugins/data/common/search/expressions/kibana_context_type.ts index ae38faf6b2448..9cc69c769f695 100644 --- a/src/plugins/data/common/search/expressions/kibana_context_type.ts +++ b/src/plugins/data/common/search/expressions/kibana_context_type.ts @@ -8,7 +8,7 @@ import { ExpressionValueBoxed } from 'src/plugins/expressions/common'; import { Filter } from '../../es_query'; import { Query, TimeRange } from '../../query'; -import { IndexPatternField } from '../../index_patterns/fields'; +import { IndexPatternField } from '../..'; // eslint-disable-next-line @typescript-eslint/consistent-type-definitions export type ExecutionContextSearch = { diff --git a/src/plugins/data/common/search/expressions/phrase_filter.ts b/src/plugins/data/common/search/expressions/phrase_filter.ts index 837d4be4d52ea..6714edef55000 100644 --- a/src/plugins/data/common/search/expressions/phrase_filter.ts +++ b/src/plugins/data/common/search/expressions/phrase_filter.ts @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; import { buildFilter, FILTERS } from '@kbn/es-query'; import { KibanaField, KibanaFilter } from './kibana_context_type'; -import { IndexPattern } from '../../index_patterns/index_patterns'; +import { IndexPattern } from '../..'; interface Arguments { field: KibanaField; diff --git a/src/plugins/data/common/search/expressions/range_filter.ts b/src/plugins/data/common/search/expressions/range_filter.ts index ed65475a9d285..bac50f2000271 100644 --- a/src/plugins/data/common/search/expressions/range_filter.ts +++ b/src/plugins/data/common/search/expressions/range_filter.ts @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; import { buildFilter, FILTERS } from '@kbn/es-query'; import { KibanaField, KibanaFilter } from './kibana_context_type'; -import { IndexPattern } from '../../index_patterns/index_patterns'; +import { IndexPattern } from '../..'; import { KibanaRange } from './range'; interface Arguments { diff --git a/src/plugins/data/common/search/search_source/create_search_source.test.ts b/src/plugins/data/common/search/search_source/create_search_source.test.ts index c084b029a5bd2..9ac9dc93a807e 100644 --- a/src/plugins/data/common/search/search_source/create_search_source.test.ts +++ b/src/plugins/data/common/search/search_source/create_search_source.test.ts @@ -8,8 +8,8 @@ import { createSearchSource as createSearchSourceFactory } from './create_search_source'; import { SearchSourceDependencies } from './search_source'; -import { IIndexPattern } from '../../index_patterns'; -import { IndexPatternsContract } from '../../index_patterns/index_patterns'; +import { IIndexPattern } from '../..'; +import { IndexPatternsContract } from '../..'; import { Filter } from '../../es_query'; describe('createSearchSource', () => { diff --git a/src/plugins/data/common/search/search_source/create_search_source.ts b/src/plugins/data/common/search/search_source/create_search_source.ts index 3f7a290d812cf..80547ca2e71f2 100644 --- a/src/plugins/data/common/search/search_source/create_search_source.ts +++ b/src/plugins/data/common/search/search_source/create_search_source.ts @@ -8,7 +8,7 @@ import { migrateLegacyQuery } from './migrate_legacy_query'; import { SearchSource, SearchSourceDependencies } from './search_source'; -import { IndexPatternsContract } from '../../index_patterns/index_patterns'; +import { IndexPatternsContract } from '../..'; import { SearchSourceFields } from './types'; /** diff --git a/src/plugins/data/common/search/search_source/normalize_sort_request.test.ts b/src/plugins/data/common/search/search_source/normalize_sort_request.test.ts index 9155f1a55d432..689740326ab9d 100644 --- a/src/plugins/data/common/search/search_source/normalize_sort_request.test.ts +++ b/src/plugins/data/common/search/search_source/normalize_sort_request.test.ts @@ -8,7 +8,7 @@ import { normalizeSortRequest } from './normalize_sort_request'; import { SortDirection } from './types'; -import { IIndexPattern } from '../../index_patterns'; +import { IIndexPattern } from '../..'; describe('SearchSource#normalizeSortRequest', function () { const scriptedField = { diff --git a/src/plugins/data/common/search/search_source/normalize_sort_request.ts b/src/plugins/data/common/search/search_source/normalize_sort_request.ts index 928daa7ad963c..3d8f9482d16d9 100644 --- a/src/plugins/data/common/search/search_source/normalize_sort_request.ts +++ b/src/plugins/data/common/search/search_source/normalize_sort_request.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { IIndexPattern } from '../../index_patterns'; +import { IIndexPattern } from '../..'; import { EsQuerySortValue, SortOptions } from './types'; export function normalizeSortRequest( diff --git a/src/plugins/data/common/search/search_source/search_source.test.ts b/src/plugins/data/common/search/search_source/search_source.test.ts index aad588275bd6c..9a76985bca6e7 100644 --- a/src/plugins/data/common/search/search_source/search_source.test.ts +++ b/src/plugins/data/common/search/search_source/search_source.test.ts @@ -7,7 +7,7 @@ */ import { of } from 'rxjs'; -import { IndexPattern } from '../../index_patterns'; +import { IndexPattern } from '../..'; import { SearchSource, SearchSourceDependencies, SortDirection } from './'; import { AggConfigs, AggTypesRegistryStart } from '../../'; import { mockAggTypesRegistry } from '../aggs/test_helpers'; diff --git a/src/plugins/data/common/search/search_source/search_source.ts b/src/plugins/data/common/search/search_source/search_source.ts index 56a74994c71ca..7b4537043c31c 100644 --- a/src/plugins/data/common/search/search_source/search_source.ts +++ b/src/plugins/data/common/search/search_source/search_source.ts @@ -75,7 +75,7 @@ import { estypes } from '@elastic/elasticsearch'; import { buildEsQuery, Filter } from '@kbn/es-query'; import { normalizeSortRequest } from './normalize_sort_request'; import { fieldWildcardFilter } from '../../../../kibana_utils/common'; -import { IIndexPattern, IndexPattern, IndexPatternField } from '../../index_patterns'; +import { IIndexPattern, IndexPattern, IndexPatternField } from '../..'; import { AggConfigs, EsQuerySortValue, @@ -828,7 +828,7 @@ export class SearchSource { body.query = buildEsQuery(index, query, filters, esQueryConfigs); if (highlightAll && body.query) { - body.highlight = getHighlightRequest(body.query, getConfig(UI_SETTINGS.DOC_HIGHLIGHT)); + body.highlight = getHighlightRequest(getConfig(UI_SETTINGS.DOC_HIGHLIGHT)); delete searchRequest.highlightAll; } diff --git a/src/plugins/data/common/search/search_source/search_source_service.test.ts b/src/plugins/data/common/search/search_source/search_source_service.test.ts index 23bb809092bde..69ffef3f9ccd6 100644 --- a/src/plugins/data/common/search/search_source/search_source_service.test.ts +++ b/src/plugins/data/common/search/search_source/search_source_service.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { IndexPatternsContract } from '../../index_patterns/index_patterns'; +import { IndexPatternsContract } from '../..'; import { SearchSourceService, SearchSourceDependencies } from './'; describe('SearchSource service', () => { diff --git a/src/plugins/data/common/search/search_source/search_source_service.ts b/src/plugins/data/common/search/search_source/search_source_service.ts index 1db63247a1722..886420365f548 100644 --- a/src/plugins/data/common/search/search_source/search_source_service.ts +++ b/src/plugins/data/common/search/search_source/search_source_service.ts @@ -7,7 +7,7 @@ */ import { createSearchSource, SearchSource, SearchSourceDependencies } from './'; -import { IndexPatternsContract } from '../../index_patterns/index_patterns'; +import { IndexPatternsContract } from '../..'; export class SearchSourceService { public setup() {} diff --git a/src/plugins/data/common/search/search_source/types.ts b/src/plugins/data/common/search/search_source/types.ts index f9dbd83295b14..a19316c1c8418 100644 --- a/src/plugins/data/common/search/search_source/types.ts +++ b/src/plugins/data/common/search/search_source/types.ts @@ -9,7 +9,7 @@ import type { estypes } from '@elastic/elasticsearch'; import { IAggConfigs } from 'src/plugins/data/public'; import { Query } from '../..'; import { Filter } from '../../es_query'; -import { IndexPattern } from '../../index_patterns'; +import { IndexPattern } from '../..'; import { SearchSource } from './search_source'; /** diff --git a/src/plugins/data/common/search/tabify/tabify.test.ts b/src/plugins/data/common/search/tabify/tabify.test.ts index 478f1ab131346..329d1597268dc 100644 --- a/src/plugins/data/common/search/tabify/tabify.test.ts +++ b/src/plugins/data/common/search/tabify/tabify.test.ts @@ -7,7 +7,7 @@ */ import { tabifyAggResponse } from './tabify'; -import { IndexPattern } from '../../index_patterns/index_patterns/index_pattern'; +import { IndexPattern } from '../..'; import { AggConfigs, IAggConfig, IAggConfigs } from '../aggs'; import { mockAggTypesRegistry } from '../aggs/test_helpers'; import { metricOnly, threeTermBuckets } from './fixtures/fake_hierarchical_data'; diff --git a/src/plugins/data/common/search/tabify/tabify_docs.test.ts b/src/plugins/data/common/search/tabify/tabify_docs.test.ts index 113086795b3e2..1a3f7195b722e 100644 --- a/src/plugins/data/common/search/tabify/tabify_docs.test.ts +++ b/src/plugins/data/common/search/tabify/tabify_docs.test.ts @@ -7,7 +7,7 @@ */ import { tabifyDocs } from './tabify_docs'; -import { IndexPattern } from '../../index_patterns/index_patterns'; +import { IndexPattern } from '../..'; import type { estypes } from '@elastic/elasticsearch'; describe('tabifyDocs', () => { diff --git a/src/plugins/data/common/search/tabify/tabify_docs.ts b/src/plugins/data/common/search/tabify/tabify_docs.ts index cfc1d21129df1..8e628e7741df5 100644 --- a/src/plugins/data/common/search/tabify/tabify_docs.ts +++ b/src/plugins/data/common/search/tabify/tabify_docs.ts @@ -8,7 +8,7 @@ import type { estypes } from '@elastic/elasticsearch'; import { isPlainObject } from 'lodash'; -import { IndexPattern } from '../../index_patterns/index_patterns'; +import { IndexPattern } from '../..'; import { Datatable, DatatableColumn, DatatableColumnType } from '../../../../expressions/common'; export interface TabifyDocsOptions { diff --git a/src/plugins/data/common/stubs.ts b/src/plugins/data/common/stubs.ts index 48310d8653a16..36bd3357e7098 100644 --- a/src/plugins/data/common/stubs.ts +++ b/src/plugins/data/common/stubs.ts @@ -6,6 +6,6 @@ * Side Public License, v 1. */ -export * from './index_patterns/field.stub'; -export * from './index_patterns/index_pattern.stub'; +export * from './data_views/field.stub'; +export * from './data_views/index_pattern.stub'; export * from './es_query/stubs'; diff --git a/src/plugins/data/common/types.ts b/src/plugins/data/common/types.ts index 7f6ae4a346bd0..c574d4854cfd6 100644 --- a/src/plugins/data/common/types.ts +++ b/src/plugins/data/common/types.ts @@ -8,7 +8,7 @@ export * from './query/types'; export * from './kbn_field_types/types'; -export * from './index_patterns/types'; +export * from './data_views/types'; /** * If a service is being shared on both the client and the server, and diff --git a/src/plugins/data/jest.config.js b/src/plugins/data/jest.config.js index eba30c6cfd674..f8ab0e348376e 100644 --- a/src/plugins/data/jest.config.js +++ b/src/plugins/data/jest.config.js @@ -11,4 +11,7 @@ module.exports = { rootDir: '../../..', roots: ['/src/plugins/data'], testRunner: 'jasmine2', + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/data', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/data/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts b/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts index ebd90c7e92d75..0cb229c9b41bc 100644 --- a/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts +++ b/src/plugins/data/public/autocomplete/providers/query_suggestion_provider.ts @@ -7,7 +7,7 @@ */ import { ValueSuggestionsMethod } from '../../../common'; -import { IFieldType, IIndexPattern } from '../../../common/index_patterns'; +import { IFieldType, IIndexPattern } from '../../../common'; export enum QuerySuggestionTypes { Field = 'field', diff --git a/src/plugins/data/public/data_views/data_views/index.ts b/src/plugins/data/public/data_views/data_views/index.ts new file mode 100644 index 0000000000000..4b31933442893 --- /dev/null +++ b/src/plugins/data/public/data_views/data_views/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 * from '../../../common/data_views/data_views'; +export * from './redirect_no_index_pattern'; +export * from './index_patterns_api_client'; diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_pattern.stub.ts b/src/plugins/data/public/data_views/data_views/index_pattern.stub.ts similarity index 100% rename from src/plugins/data/public/index_patterns/index_patterns/index_pattern.stub.ts rename to src/plugins/data/public/data_views/data_views/index_pattern.stub.ts diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.test.mock.ts b/src/plugins/data/public/data_views/data_views/index_patterns_api_client.test.mock.ts similarity index 100% rename from src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.test.mock.ts rename to src/plugins/data/public/data_views/data_views/index_patterns_api_client.test.mock.ts diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.test.ts b/src/plugins/data/public/data_views/data_views/index_patterns_api_client.test.ts similarity index 100% rename from src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.test.ts rename to src/plugins/data/public/data_views/data_views/index_patterns_api_client.test.ts diff --git a/src/plugins/data/public/data_views/data_views/index_patterns_api_client.ts b/src/plugins/data/public/data_views/data_views/index_patterns_api_client.ts new file mode 100644 index 0000000000000..295cd99e7e017 --- /dev/null +++ b/src/plugins/data/public/data_views/data_views/index_patterns_api_client.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { HttpSetup } from 'src/core/public'; +import { DataViewMissingIndices } from '../../../common/data_views/lib'; +import { + GetFieldsOptions, + IIndexPatternsApiClient, + GetFieldsOptionsTimePattern, +} from '../../../common/data_views/types'; + +const API_BASE_URL: string = `/api/index_patterns/`; + +export class IndexPatternsApiClient implements IIndexPatternsApiClient { + private http: HttpSetup; + + constructor(http: HttpSetup) { + this.http = http; + } + + private _request(url: string, query?: any) { + return this.http + .fetch(url, { + query, + }) + .catch((resp: any) => { + if (resp.body.statusCode === 404 && resp.body.attributes?.code === 'no_matching_indices') { + throw new DataViewMissingIndices(resp.body.message); + } + + throw new Error(resp.body.message || resp.body.error || `${resp.body.statusCode} Response`); + }); + } + + private _getUrl(path: string[]) { + return API_BASE_URL + path.filter(Boolean).map(encodeURIComponent).join('/'); + } + + getFieldsForTimePattern(options: GetFieldsOptionsTimePattern) { + const { pattern, lookBack, metaFields } = options; + + const url = this._getUrl(['_fields_for_time_pattern']); + + return this._request(url, { + pattern, + look_back: lookBack, + meta_fields: metaFields, + }).then((resp: any) => resp.fields); + } + + getFieldsForWildcard({ pattern, metaFields, type, rollupIndex, allowNoIndex }: GetFieldsOptions) { + return this._request(this._getUrl(['_fields_for_wildcard']), { + pattern, + meta_fields: metaFields, + type, + rollup_index: rollupIndex, + allow_no_index: allowNoIndex, + }).then((resp: any) => resp.fields || []); + } + + async hasUserIndexPattern(): Promise { + const response = await this._request(this._getUrl(['has_user_index_pattern'])); + return response.result; + } +} diff --git a/src/plugins/data/public/index_patterns/index_patterns/redirect_no_index_pattern.tsx b/src/plugins/data/public/data_views/data_views/redirect_no_index_pattern.tsx similarity index 100% rename from src/plugins/data/public/index_patterns/index_patterns/redirect_no_index_pattern.tsx rename to src/plugins/data/public/data_views/data_views/redirect_no_index_pattern.tsx diff --git a/src/plugins/data/public/index_patterns/expressions/index.ts b/src/plugins/data/public/data_views/expressions/index.ts similarity index 100% rename from src/plugins/data/public/index_patterns/expressions/index.ts rename to src/plugins/data/public/data_views/expressions/index.ts diff --git a/src/plugins/data/public/data_views/expressions/load_index_pattern.test.ts b/src/plugins/data/public/data_views/expressions/load_index_pattern.test.ts new file mode 100644 index 0000000000000..befa78c398984 --- /dev/null +++ b/src/plugins/data/public/data_views/expressions/load_index_pattern.test.ts @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { IndexPatternLoadStartDependencies } from '../../../common/data_views/expressions'; +import { getFunctionDefinition } from './load_index_pattern'; + +describe('indexPattern expression function', () => { + let getStartDependencies: () => Promise; + + beforeEach(() => { + getStartDependencies = jest.fn().mockResolvedValue({ + indexPatterns: { + get: (id: string) => ({ + toSpec: () => ({ + title: 'value', + }), + }), + }, + }); + }); + + test('returns serialized index pattern', async () => { + const indexPatternDefinition = getFunctionDefinition({ getStartDependencies }); + const result = await indexPatternDefinition().fn(null, { id: '1' }, {} as any); + expect(result.type).toEqual('index_pattern'); + expect(result.value.title).toEqual('value'); + }); +}); diff --git a/src/plugins/data/public/data_views/expressions/load_index_pattern.ts b/src/plugins/data/public/data_views/expressions/load_index_pattern.ts new file mode 100644 index 0000000000000..979861c7da38e --- /dev/null +++ b/src/plugins/data/public/data_views/expressions/load_index_pattern.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 { StartServicesAccessor } from 'src/core/public'; +import { + getIndexPatternLoadMeta, + IndexPatternLoadExpressionFunctionDefinition, + IndexPatternLoadStartDependencies, +} from '../../../common/data_views/expressions'; +import { DataPublicPluginStart, DataStartDependencies } from '../../types'; + +/** + * Returns the expression function definition. Any stateful dependencies are accessed + * at runtime via the `getStartDependencies` param, which provides the specific services + * needed for this function to run. + * + * This function is an implementation detail of this module, and is exported separately + * only for testing purposes. + * + * @param getStartDependencies - async function that resolves with IndexPatternLoadStartDependencies + * + * @internal + */ +export function getFunctionDefinition({ + getStartDependencies, +}: { + getStartDependencies: () => Promise; +}) { + return (): IndexPatternLoadExpressionFunctionDefinition => ({ + ...getIndexPatternLoadMeta(), + async fn(input, args) { + const { indexPatterns } = await getStartDependencies(); + + const indexPattern = await indexPatterns.get(args.id); + + return { type: 'index_pattern', value: indexPattern.toSpec() }; + }, + }); +} + +/** + * This is some glue code that takes in `core.getStartServices`, extracts the dependencies + * needed for this function, and wraps them behind a `getStartDependencies` function that + * is then called at runtime. + * + * We do this so that we can be explicit about exactly which dependencies the function + * requires, without cluttering up the top-level `plugin.ts` with this logic. It also + * makes testing the expression function a bit easier since `getStartDependencies` is + * the only thing you should need to mock. + * + * @param getStartServices - core's StartServicesAccessor for this plugin + * + * @internal + */ +export function getIndexPatternLoad({ + getStartServices, +}: { + getStartServices: StartServicesAccessor; +}) { + return getFunctionDefinition({ + getStartDependencies: async () => { + const [, , { indexPatterns }] = await getStartServices(); + return { indexPatterns }; + }, + }); +} diff --git a/src/plugins/data/public/data_views/index.ts b/src/plugins/data/public/data_views/index.ts new file mode 100644 index 0000000000000..02e36d893fa6f --- /dev/null +++ b/src/plugins/data/public/data_views/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 { + ILLEGAL_CHARACTERS_KEY, + CONTAINS_SPACES_KEY, + ILLEGAL_CHARACTERS_VISIBLE, + ILLEGAL_CHARACTERS, + validateDataView, + isDefault, +} from '../../common/data_views/lib'; +export { flattenHitWrapper, formatHitProvider, onRedirectNoIndexPattern } from './data_views'; + +export { IndexPatternField, IIndexPatternFieldList, TypeMeta } from '../../common/data_views'; + +export { + IndexPatternsService, + IndexPatternsContract, + IndexPattern, + IndexPatternsApiClient, + DataViewsService, + DataViewsContract, + DataView, +} from './data_views'; +export { UiSettingsPublicToCommon } from './ui_settings_wrapper'; +export { SavedObjectsClientPublicToCommon } from './saved_objects_client_wrapper'; diff --git a/src/plugins/data/public/data_views/saved_objects_client_wrapper.ts b/src/plugins/data/public/data_views/saved_objects_client_wrapper.ts new file mode 100644 index 0000000000000..1db4e3b1ccd24 --- /dev/null +++ b/src/plugins/data/public/data_views/saved_objects_client_wrapper.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { omit } from 'lodash'; +import { SavedObjectsClient, SimpleSavedObject } from 'src/core/public'; +import { + SavedObjectsClientCommon, + SavedObjectsClientCommonFindArgs, + SavedObject, + DataViewSavedObjectConflictError, +} from '../../common/data_views'; + +type SOClient = Pick; + +const simpleSavedObjectToSavedObject = (simpleSavedObject: SimpleSavedObject): SavedObject => + ({ + version: simpleSavedObject._version, + ...omit(simpleSavedObject, '_version'), + } as any); + +export class SavedObjectsClientPublicToCommon implements SavedObjectsClientCommon { + private savedObjectClient: SOClient; + constructor(savedObjectClient: SOClient) { + this.savedObjectClient = savedObjectClient; + } + async find(options: SavedObjectsClientCommonFindArgs) { + const response = (await this.savedObjectClient.find(options)).savedObjects; + return response.map>(simpleSavedObjectToSavedObject); + } + + async get(type: string, id: string) { + const response = await this.savedObjectClient.resolve(type, id); + if (response.outcome === 'conflict') { + throw new DataViewSavedObjectConflictError(id); + } + return simpleSavedObjectToSavedObject(response.saved_object); + } + async update( + type: string, + id: string, + attributes: Record, + options: Record + ) { + const response = await this.savedObjectClient.update(type, id, attributes, options); + return simpleSavedObjectToSavedObject(response); + } + async create(type: string, attributes: Record, options: Record) { + const response = await this.savedObjectClient.create(type, attributes, options); + return simpleSavedObjectToSavedObject(response); + } + delete(type: string, id: string) { + return this.savedObjectClient.delete(type, id); + } +} diff --git a/src/plugins/data/public/data_views/ui_settings_wrapper.ts b/src/plugins/data/public/data_views/ui_settings_wrapper.ts new file mode 100644 index 0000000000000..e0998ed72b2e6 --- /dev/null +++ b/src/plugins/data/public/data_views/ui_settings_wrapper.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { IUiSettingsClient } from 'src/core/public'; +import { UiSettingsCommon } from '../../common'; + +export class UiSettingsPublicToCommon implements UiSettingsCommon { + private uiSettings: IUiSettingsClient; + constructor(uiSettings: IUiSettingsClient) { + this.uiSettings = uiSettings; + } + get(key: string) { + return Promise.resolve(this.uiSettings.get(key)); + } + + getAll() { + return Promise.resolve(this.uiSettings.getAll()); + } + + set(key: string, value: any) { + this.uiSettings.set(key, value); + return Promise.resolve(); + } + + remove(key: string) { + this.uiSettings.remove(key); + return Promise.resolve(); + } +} diff --git a/src/plugins/data/public/index.ts b/src/plugins/data/public/index.ts index 595a88b412e9f..6480a0a340340 100644 --- a/src/plugins/data/public/index.ts +++ b/src/plugins/data/public/index.ts @@ -48,9 +48,9 @@ import { isDefault, validateDataView, flattenHitWrapper, -} from './index_patterns'; +} from './data_views'; -export type { IndexPatternsService } from './index_patterns'; +export type { IndexPatternsService } from './data_views'; // Index patterns namespace: export const indexPatterns = { @@ -71,7 +71,7 @@ export { IndexPattern, IndexPatternField, TypeMeta, -} from './index_patterns'; +} from './data_views'; export { IIndexPattern, @@ -91,7 +91,7 @@ export { IndexPatternListItem, } from '../common'; -export { DuplicateDataViewError } from '../common/index_patterns/errors'; +export { DuplicateDataViewError } from '../common/data_views/errors'; /* * Autocomplete query suggestions: diff --git a/src/plugins/data/public/index_patterns/expressions/load_index_pattern.test.ts b/src/plugins/data/public/index_patterns/expressions/load_index_pattern.test.ts deleted file mode 100644 index 399fe6669544b..0000000000000 --- a/src/plugins/data/public/index_patterns/expressions/load_index_pattern.test.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { IndexPatternLoadStartDependencies } from '../../../common/index_patterns/expressions'; -import { getFunctionDefinition } from './load_index_pattern'; - -describe('indexPattern expression function', () => { - let getStartDependencies: () => Promise; - - beforeEach(() => { - getStartDependencies = jest.fn().mockResolvedValue({ - indexPatterns: { - get: (id: string) => ({ - toSpec: () => ({ - title: 'value', - }), - }), - }, - }); - }); - - test('returns serialized index pattern', async () => { - const indexPatternDefinition = getFunctionDefinition({ getStartDependencies }); - const result = await indexPatternDefinition().fn(null, { id: '1' }, {} as any); - expect(result.type).toEqual('index_pattern'); - expect(result.value.title).toEqual('value'); - }); -}); diff --git a/src/plugins/data/public/index_patterns/expressions/load_index_pattern.ts b/src/plugins/data/public/index_patterns/expressions/load_index_pattern.ts deleted file mode 100644 index d92c1dc9828e1..0000000000000 --- a/src/plugins/data/public/index_patterns/expressions/load_index_pattern.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 { StartServicesAccessor } from 'src/core/public'; -import { - getIndexPatternLoadMeta, - IndexPatternLoadExpressionFunctionDefinition, - IndexPatternLoadStartDependencies, -} from '../../../common/index_patterns/expressions'; -import { DataPublicPluginStart, DataStartDependencies } from '../../types'; - -/** - * Returns the expression function definition. Any stateful dependencies are accessed - * at runtime via the `getStartDependencies` param, which provides the specific services - * needed for this function to run. - * - * This function is an implementation detail of this module, and is exported separately - * only for testing purposes. - * - * @param getStartDependencies - async function that resolves with IndexPatternLoadStartDependencies - * - * @internal - */ -export function getFunctionDefinition({ - getStartDependencies, -}: { - getStartDependencies: () => Promise; -}) { - return (): IndexPatternLoadExpressionFunctionDefinition => ({ - ...getIndexPatternLoadMeta(), - async fn(input, args) { - const { indexPatterns } = await getStartDependencies(); - - const indexPattern = await indexPatterns.get(args.id); - - return { type: 'index_pattern', value: indexPattern.toSpec() }; - }, - }); -} - -/** - * This is some glue code that takes in `core.getStartServices`, extracts the dependencies - * needed for this function, and wraps them behind a `getStartDependencies` function that - * is then called at runtime. - * - * We do this so that we can be explicit about exactly which dependencies the function - * requires, without cluttering up the top-level `plugin.ts` with this logic. It also - * makes testing the expression function a bit easier since `getStartDependencies` is - * the only thing you should need to mock. - * - * @param getStartServices - core's StartServicesAccessor for this plugin - * - * @internal - */ -export function getIndexPatternLoad({ - getStartServices, -}: { - getStartServices: StartServicesAccessor; -}) { - return getFunctionDefinition({ - getStartDependencies: async () => { - const [, , { indexPatterns }] = await getStartServices(); - return { indexPatterns }; - }, - }); -} diff --git a/src/plugins/data/public/index_patterns/index.ts b/src/plugins/data/public/index_patterns/index.ts deleted file mode 100644 index d1a2b0f28f1d2..0000000000000 --- a/src/plugins/data/public/index_patterns/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 and the Server Side Public License, v 1; you may 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 { - ILLEGAL_CHARACTERS_KEY, - CONTAINS_SPACES_KEY, - ILLEGAL_CHARACTERS_VISIBLE, - ILLEGAL_CHARACTERS, - validateDataView, - isDefault, -} from '../../common/index_patterns/lib'; -export { flattenHitWrapper, formatHitProvider, onRedirectNoIndexPattern } from './index_patterns'; - -export { IndexPatternField, IIndexPatternFieldList, TypeMeta } from '../../common/index_patterns'; - -export { - IndexPatternsService, - IndexPatternsContract, - IndexPattern, - IndexPatternsApiClient, - DataViewsService, - DataViewsContract, - DataView, -} from './index_patterns'; -export { UiSettingsPublicToCommon } from './ui_settings_wrapper'; -export { SavedObjectsClientPublicToCommon } from './saved_objects_client_wrapper'; diff --git a/src/plugins/data/public/index_patterns/index_patterns/index.ts b/src/plugins/data/public/index_patterns/index_patterns/index.ts deleted file mode 100644 index ec5b488acf343..0000000000000 --- a/src/plugins/data/public/index_patterns/index_patterns/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 and the Server Side Public License, v 1; you may 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 '../../../common/index_patterns/index_patterns'; -export * from './redirect_no_index_pattern'; -export * from './index_patterns_api_client'; diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts b/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts deleted file mode 100644 index b3471f0630390..0000000000000 --- a/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { HttpSetup } from 'src/core/public'; -import { DataViewMissingIndices } from '../../../common/index_patterns/lib'; -import { - GetFieldsOptions, - IIndexPatternsApiClient, - GetFieldsOptionsTimePattern, -} from '../../../common/index_patterns/types'; - -const API_BASE_URL: string = `/api/index_patterns/`; - -export class IndexPatternsApiClient implements IIndexPatternsApiClient { - private http: HttpSetup; - - constructor(http: HttpSetup) { - this.http = http; - } - - private _request(url: string, query?: any) { - return this.http - .fetch(url, { - query, - }) - .catch((resp: any) => { - if (resp.body.statusCode === 404 && resp.body.attributes?.code === 'no_matching_indices') { - throw new DataViewMissingIndices(resp.body.message); - } - - throw new Error(resp.body.message || resp.body.error || `${resp.body.statusCode} Response`); - }); - } - - private _getUrl(path: string[]) { - return API_BASE_URL + path.filter(Boolean).map(encodeURIComponent).join('/'); - } - - getFieldsForTimePattern(options: GetFieldsOptionsTimePattern) { - const { pattern, lookBack, metaFields } = options; - - const url = this._getUrl(['_fields_for_time_pattern']); - - return this._request(url, { - pattern, - look_back: lookBack, - meta_fields: metaFields, - }).then((resp: any) => resp.fields); - } - - getFieldsForWildcard({ pattern, metaFields, type, rollupIndex, allowNoIndex }: GetFieldsOptions) { - return this._request(this._getUrl(['_fields_for_wildcard']), { - pattern, - meta_fields: metaFields, - type, - rollup_index: rollupIndex, - allow_no_index: allowNoIndex, - }).then((resp: any) => resp.fields || []); - } - - async hasUserIndexPattern(): Promise { - const response = await this._request(this._getUrl(['has_user_index_pattern'])); - return response.result; - } -} diff --git a/src/plugins/data/public/index_patterns/saved_objects_client_wrapper.ts b/src/plugins/data/public/index_patterns/saved_objects_client_wrapper.ts deleted file mode 100644 index 421acb49a95d1..0000000000000 --- a/src/plugins/data/public/index_patterns/saved_objects_client_wrapper.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { omit } from 'lodash'; -import { SavedObjectsClient, SimpleSavedObject } from 'src/core/public'; -import { - SavedObjectsClientCommon, - SavedObjectsClientCommonFindArgs, - SavedObject, - DataViewSavedObjectConflictError, -} from '../../common/index_patterns'; - -type SOClient = Pick; - -const simpleSavedObjectToSavedObject = (simpleSavedObject: SimpleSavedObject): SavedObject => - ({ - version: simpleSavedObject._version, - ...omit(simpleSavedObject, '_version'), - } as any); - -export class SavedObjectsClientPublicToCommon implements SavedObjectsClientCommon { - private savedObjectClient: SOClient; - constructor(savedObjectClient: SOClient) { - this.savedObjectClient = savedObjectClient; - } - async find(options: SavedObjectsClientCommonFindArgs) { - const response = (await this.savedObjectClient.find(options)).savedObjects; - return response.map>(simpleSavedObjectToSavedObject); - } - - async get(type: string, id: string) { - const response = await this.savedObjectClient.resolve(type, id); - if (response.outcome === 'conflict') { - throw new DataViewSavedObjectConflictError(id); - } - return simpleSavedObjectToSavedObject(response.saved_object); - } - async update( - type: string, - id: string, - attributes: Record, - options: Record - ) { - const response = await this.savedObjectClient.update(type, id, attributes, options); - return simpleSavedObjectToSavedObject(response); - } - async create(type: string, attributes: Record, options: Record) { - const response = await this.savedObjectClient.create(type, attributes, options); - return simpleSavedObjectToSavedObject(response); - } - delete(type: string, id: string) { - return this.savedObjectClient.delete(type, id); - } -} diff --git a/src/plugins/data/public/index_patterns/ui_settings_wrapper.ts b/src/plugins/data/public/index_patterns/ui_settings_wrapper.ts deleted file mode 100644 index e9209e0aa6091..0000000000000 --- a/src/plugins/data/public/index_patterns/ui_settings_wrapper.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { IUiSettingsClient } from 'src/core/public'; -import { UiSettingsCommon } from '../../common/index_patterns'; - -export class UiSettingsPublicToCommon implements UiSettingsCommon { - private uiSettings: IUiSettingsClient; - constructor(uiSettings: IUiSettingsClient) { - this.uiSettings = uiSettings; - } - get(key: string) { - return Promise.resolve(this.uiSettings.get(key)); - } - - getAll() { - return Promise.resolve(this.uiSettings.getAll()); - } - - set(key: string, value: any) { - this.uiSettings.set(key, value); - return Promise.resolve(); - } - - remove(key: string) { - this.uiSettings.remove(key); - return Promise.resolve(); - } -} diff --git a/src/plugins/data/public/plugin.ts b/src/plugins/data/public/plugin.ts index a12bb50815982..2216c5e9c0e06 100644 --- a/src/plugins/data/public/plugin.ts +++ b/src/plugins/data/public/plugin.ts @@ -26,7 +26,7 @@ import { onRedirectNoIndexPattern, IndexPatternsApiClient, UiSettingsPublicToCommon, -} from './index_patterns'; +} from './data_views'; import { setIndexPatterns, setNotifications, @@ -44,8 +44,8 @@ import { createSelectRangeAction, } from './actions'; import { APPLY_FILTER_TRIGGER, applyFilterTrigger } from './triggers'; -import { SavedObjectsClientPublicToCommon } from './index_patterns'; -import { getIndexPatternLoad } from './index_patterns/expressions'; +import { SavedObjectsClientPublicToCommon } from './data_views'; +import { getIndexPatternLoad } from './data_views/expressions'; import { UsageCollectionSetup } from '../../usage_collection/public'; import { getTableViewDescription } from './utils/table_inspector_view'; import { NowProvider, NowProviderInternalContract } from './now_provider'; diff --git a/src/plugins/data/public/query/saved_query/saved_query_service.test.ts b/src/plugins/data/public/query/saved_query/saved_query_service.test.ts index a74f81b6a046d..673a86df98881 100644 --- a/src/plugins/data/public/query/saved_query/saved_query_service.test.ts +++ b/src/plugins/data/public/query/saved_query/saved_query_service.test.ts @@ -54,7 +54,7 @@ const mockSavedObjectsClient = { create: jest.fn(), error: jest.fn(), find: jest.fn(), - get: jest.fn(), + resolve: jest.fn(), delete: jest.fn(), }; @@ -74,7 +74,7 @@ describe('saved query service', () => { afterEach(() => { mockSavedObjectsClient.create.mockReset(); mockSavedObjectsClient.find.mockReset(); - mockSavedObjectsClient.get.mockReset(); + mockSavedObjectsClient.resolve.mockReset(); mockSavedObjectsClient.delete.mockReset(); }); @@ -267,29 +267,44 @@ describe('saved query service', () => { describe('getSavedQuery', function () { it('should retrieve a saved query by id', async () => { - mockSavedObjectsClient.get.mockReturnValue({ id: 'foo', attributes: savedQueryAttributes }); + mockSavedObjectsClient.resolve.mockReturnValue({ + saved_object: { + id: 'foo', + attributes: savedQueryAttributes, + }, + outcome: 'exactMatch', + }); const response = await getSavedQuery('foo'); expect(response).toEqual({ id: 'foo', attributes: savedQueryAttributes }); }); it('should only return saved queries', async () => { - mockSavedObjectsClient.get.mockReturnValue({ id: 'foo', attributes: savedQueryAttributes }); + mockSavedObjectsClient.resolve.mockReturnValue({ + saved_object: { + id: 'foo', + attributes: savedQueryAttributes, + }, + outcome: 'exactMatch', + }); await getSavedQuery('foo'); - expect(mockSavedObjectsClient.get).toHaveBeenCalledWith('query', 'foo'); + expect(mockSavedObjectsClient.resolve).toHaveBeenCalledWith('query', 'foo'); }); it('should parse a json query', async () => { - mockSavedObjectsClient.get.mockReturnValue({ - id: 'food', - attributes: { - title: 'food', - description: 'bar', - query: { - language: 'kuery', - query: '{"x": "y"}', + mockSavedObjectsClient.resolve.mockReturnValue({ + saved_object: { + id: 'food', + attributes: { + title: 'food', + description: 'bar', + query: { + language: 'kuery', + query: '{"x": "y"}', + }, }, }, + outcome: 'exactMatch', }); const response = await getSavedQuery('food'); @@ -297,16 +312,19 @@ describe('saved query service', () => { }); it('should handle null string', async () => { - mockSavedObjectsClient.get.mockReturnValue({ - id: 'food', - attributes: { - title: 'food', - description: 'bar', - query: { - language: 'kuery', - query: 'null', + mockSavedObjectsClient.resolve.mockReturnValue({ + saved_object: { + id: 'food', + attributes: { + title: 'food', + description: 'bar', + query: { + language: 'kuery', + query: 'null', + }, }, }, + outcome: 'exactMatch', }); const response = await getSavedQuery('food'); @@ -314,16 +332,19 @@ describe('saved query service', () => { }); it('should handle null quoted string', async () => { - mockSavedObjectsClient.get.mockReturnValue({ - id: 'food', - attributes: { - title: 'food', - description: 'bar', - query: { - language: 'kuery', - query: '"null"', + mockSavedObjectsClient.resolve.mockReturnValue({ + saved_object: { + id: 'food', + attributes: { + title: 'food', + description: 'bar', + query: { + language: 'kuery', + query: '"null"', + }, }, }, + outcome: 'exactMatch', }); const response = await getSavedQuery('food'); @@ -331,21 +352,39 @@ describe('saved query service', () => { }); it('should not lose quotes', async () => { - mockSavedObjectsClient.get.mockReturnValue({ - id: 'food', - attributes: { - title: 'food', - description: 'bar', - query: { - language: 'kuery', - query: '"Bob"', + mockSavedObjectsClient.resolve.mockReturnValue({ + saved_object: { + id: 'food', + attributes: { + title: 'food', + description: 'bar', + query: { + language: 'kuery', + query: '"Bob"', + }, }, }, + outcome: 'exactMatch', }); const response = await getSavedQuery('food'); expect(response.attributes.query.query).toEqual('"Bob"'); }); + + it('should throw if conflict', async () => { + mockSavedObjectsClient.resolve.mockReturnValue({ + saved_object: { + id: 'foo', + attributes: savedQueryAttributes, + }, + outcome: 'conflict', + }); + + const result = getSavedQuery('food'); + expect(result).rejects.toMatchInlineSnapshot( + `[Error: Multiple saved queries found with ID: food (legacy URL alias conflict)]` + ); + }); }); describe('deleteSavedQuery', function () { diff --git a/src/plugins/data/public/query/saved_query/saved_query_service.ts b/src/plugins/data/public/query/saved_query/saved_query_service.ts index 0f3da8f80a5ec..21a34e0f136a2 100644 --- a/src/plugins/data/public/query/saved_query/saved_query_service.ts +++ b/src/plugins/data/public/query/saved_query/saved_query_service.ts @@ -105,8 +105,13 @@ export const createSavedQueryService = ( }; const getSavedQuery = async (id: string): Promise => { - const savedObject = await savedObjectsClient.get('query', id); - if (savedObject.error) { + const { + saved_object: savedObject, + outcome, + } = await savedObjectsClient.resolve('query', id); + if (outcome === 'conflict') { + throw new Error(`Multiple saved queries found with ID: ${id} (legacy URL alias conflict)`); + } else if (savedObject.error) { throw new Error(savedObject.error.message); } return parseSavedQueryObject(savedObject); diff --git a/src/plugins/data/public/query/timefilter/timefilter.ts b/src/plugins/data/public/query/timefilter/timefilter.ts index 9894010601d2b..3b537562586a7 100644 --- a/src/plugins/data/public/query/timefilter/timefilter.ts +++ b/src/plugins/data/public/query/timefilter/timefilter.ts @@ -17,6 +17,7 @@ import { calculateBounds, getAbsoluteTimeRange, getTime, + getRelativeTime, IIndexPattern, RefreshInterval, TimeRange, @@ -27,7 +28,6 @@ import { createAutoRefreshLoop, AutoRefreshDoneFn } from './lib/auto_refresh_loo export { AutoRefreshDoneFn }; // TODO: remove! - export class Timefilter { // Fired when isTimeRangeSelectorEnabled \ isAutoRefreshSelectorEnabled are toggled private enabledUpdated$ = new BehaviorSubject(false); @@ -178,12 +178,34 @@ export class Timefilter { } }; + /** + * Create a time filter that coerces all time values to absolute time. + * + * This is useful for creating a filter that ensures all ES queries will fetch the exact same data + * and leverages ES query cache for performance improvement. + * + * One use case is keeping different elements embedded in the same UI in sync. + */ public createFilter = (indexPattern: IIndexPattern, timeRange?: TimeRange) => { return getTime(indexPattern, timeRange ? timeRange : this._time, { forceNow: this.nowProvider.get(), }); }; + /** + * Create a time filter that converts only absolute time to ISO strings, it leaves relative time + * values unchanged (e.g. "now-1"). + * + * This is useful for sending datemath values to ES endpoints to generate reports over time. + * + * @note Consumers of this function need to ensure that the ES endpoint supports datemath. + */ + public createRelativeFilter = (indexPattern: IIndexPattern, timeRange?: TimeRange) => { + return getRelativeTime(indexPattern, timeRange ? timeRange : this._time, { + forceNow: this.nowProvider.get(), + }); + }; + public getBounds(): TimeRangeBounds { return this.calculateBounds(this._time); } diff --git a/src/plugins/data/public/query/timefilter/timefilter_service.mock.ts b/src/plugins/data/public/query/timefilter/timefilter_service.mock.ts index f1f02a010e98c..2b6a65e6c9bd7 100644 --- a/src/plugins/data/public/query/timefilter/timefilter_service.mock.ts +++ b/src/plugins/data/public/query/timefilter/timefilter_service.mock.ts @@ -34,6 +34,7 @@ const createSetupContractMock = () => { getBounds: jest.fn(), calculateBounds: jest.fn(), createFilter: jest.fn(), + createRelativeFilter: jest.fn(), getRefreshIntervalDefaults: jest.fn(), getTimeDefaults: jest.fn(), getAbsoluteTime: jest.fn(), diff --git a/src/plugins/data/public/search/aggs/aggs_service.ts b/src/plugins/data/public/search/aggs/aggs_service.ts index 3f91ced6de950..4907c3bcbad26 100644 --- a/src/plugins/data/public/search/aggs/aggs_service.ts +++ b/src/plugins/data/public/search/aggs/aggs_service.ts @@ -20,7 +20,7 @@ import { AggTypesDependencies, } from '../../../common/search/aggs'; import { AggsSetup, AggsStart } from './types'; -import { IndexPatternsContract } from '../../index_patterns'; +import { IndexPatternsContract } from '../..'; import { NowProviderInternalContract } from '../../now_provider'; /** diff --git a/src/plugins/data/public/search/expressions/esaggs.test.ts b/src/plugins/data/public/search/expressions/esaggs.test.ts index e43069697f6eb..fa9e2755e529c 100644 --- a/src/plugins/data/public/search/expressions/esaggs.test.ts +++ b/src/plugins/data/public/search/expressions/esaggs.test.ts @@ -10,7 +10,7 @@ import { omit } from 'lodash'; import { of as mockOf } from 'rxjs'; import type { MockedKeys } from '@kbn/utility-types/jest'; import type { ExecutionContext } from 'src/plugins/expressions/public'; -import type { IndexPatternsContract } from '../../../common/index_patterns/index_patterns'; +import type { IndexPatternsContract } from '../../../common'; import type { ISearchStartSearchSource, KibanaContext, diff --git a/src/plugins/data/public/search/expressions/esdsl.ts b/src/plugins/data/public/search/expressions/esdsl.ts index 1dda44ee8993e..c03226542ef7a 100644 --- a/src/plugins/data/public/search/expressions/esdsl.ts +++ b/src/plugins/data/public/search/expressions/esdsl.ts @@ -9,7 +9,7 @@ import { StartServicesAccessor } from 'src/core/public'; import { DataPublicPluginStart, DataStartDependencies } from '../../types'; import { getEsdslFn } from '../../../common/search/expressions/esdsl'; -import { UiSettingsCommon } from '../../../common/index_patterns'; +import { UiSettingsCommon } from '../../../common'; /** * This is some glue code that takes in `core.getStartServices`, extracts the dependencies diff --git a/src/plugins/data/public/search/expressions/kibana_context.ts b/src/plugins/data/public/search/expressions/kibana_context.ts index e7ce8edf3080a..cb6e5369eb34a 100644 --- a/src/plugins/data/public/search/expressions/kibana_context.ts +++ b/src/plugins/data/public/search/expressions/kibana_context.ts @@ -9,7 +9,7 @@ import { StartServicesAccessor } from 'src/core/public'; import { getKibanaContextFn } from '../../../common/search/expressions'; import { DataPublicPluginStart, DataStartDependencies } from '../../types'; -import { SavedObjectsClientCommon } from '../../../common/index_patterns'; +import { SavedObjectsClientCommon } from '../../../common'; /** * This is some glue code that takes in `core.getStartServices`, extracts the dependencies diff --git a/src/plugins/data/public/search/search_service.ts b/src/plugins/data/public/search/search_service.ts index 3baf41875ed98..7cba1ec17c322 100644 --- a/src/plugins/data/public/search/search_service.ts +++ b/src/plugins/data/public/search/search_service.ts @@ -44,7 +44,7 @@ import { esRawResponse, } from '../../common/search'; import { AggsService, AggsStartDependencies } from './aggs'; -import { IndexPatternsContract } from '../index_patterns/index_patterns'; +import { IndexPatternsContract } from '..'; import { ISearchInterceptor, SearchInterceptor } from './search_interceptor'; import { SearchUsageCollector, createUsageCollector } from './collectors'; import { UsageCollectionSetup } from '../../../usage_collection/public'; diff --git a/src/plugins/data/public/search/types.ts b/src/plugins/data/public/search/types.ts index 8190c52b5c0c5..764933d15e065 100644 --- a/src/plugins/data/public/search/types.ts +++ b/src/plugins/data/public/search/types.ts @@ -10,7 +10,7 @@ import { PackageInfo } from 'kibana/server'; import { SearchUsageCollector } from './collectors'; import { AggsSetup, AggsSetupDependencies, AggsStartDependencies, AggsStart } from './aggs'; import { ISearchGeneric, ISearchStartSearchSource } from '../../common/search'; -import { IndexPatternsContract } from '../../common/index_patterns/index_patterns'; +import { IndexPatternsContract } from '../../common'; import { UsageCollectionSetup } from '../../../usage_collection/public'; import { ISessionsClient, ISessionService } from './session'; diff --git a/src/plugins/data/public/services.ts b/src/plugins/data/public/services.ts index b6306831a2692..bcc23e13a1ec6 100644 --- a/src/plugins/data/public/services.ts +++ b/src/plugins/data/public/services.ts @@ -8,7 +8,7 @@ import { NotificationsStart, CoreStart } from 'src/core/public'; import { createGetterSetter } from '../../kibana_utils/public'; -import { IndexPatternsContract } from './index_patterns'; +import { IndexPatternsContract } from './data_views'; import { DataPublicPluginStart } from './types'; export const [getNotifications, setNotifications] = createGetterSetter( diff --git a/src/plugins/data/public/stubs.ts b/src/plugins/data/public/stubs.ts index 2a09a37999712..8e790a2991b05 100644 --- a/src/plugins/data/public/stubs.ts +++ b/src/plugins/data/public/stubs.ts @@ -7,4 +7,4 @@ */ export * from '../common/stubs'; -export { createStubIndexPattern } from './index_patterns/index_patterns/index_pattern.stub'; +export { createStubIndexPattern } from './data_views/data_views/index_pattern.stub'; diff --git a/src/plugins/data/public/types.ts b/src/plugins/data/public/types.ts index b31a4ab933ae2..7ed13c2096515 100644 --- a/src/plugins/data/public/types.ts +++ b/src/plugins/data/public/types.ts @@ -17,7 +17,7 @@ import { AutocompleteSetup, AutocompleteStart } from './autocomplete'; import { createFiltersFromRangeSelectAction, createFiltersFromValueClickAction } from './actions'; import { ISearchSetup, ISearchStart } from './search'; import { QuerySetup, QueryStart } from './query'; -import { DataViewsContract } from './index_patterns'; +import { DataViewsContract } from './data_views'; import { IndexPatternSelectProps, StatefulSearchBarProps } from './ui'; import { UsageCollectionSetup, UsageCollectionStart } from '../../usage_collection/public'; import { Setup as InspectorSetup } from '../../inspector/public'; diff --git a/src/plugins/data/server/autocomplete/terms_agg.test.ts b/src/plugins/data/server/autocomplete/terms_agg.test.ts index 820ec445a22ca..96a75fd3b2fd8 100644 --- a/src/plugins/data/server/autocomplete/terms_agg.test.ts +++ b/src/plugins/data/server/autocomplete/terms_agg.test.ts @@ -34,7 +34,7 @@ const mockResponse = { }, } as ApiResponse>; -jest.mock('../index_patterns'); +jest.mock('../data_views'); describe('terms agg suggestions', () => { beforeEach(() => { diff --git a/src/plugins/data/server/autocomplete/terms_agg.ts b/src/plugins/data/server/autocomplete/terms_agg.ts index b902bae49898f..9b1f5d92889bc 100644 --- a/src/plugins/data/server/autocomplete/terms_agg.ts +++ b/src/plugins/data/server/autocomplete/terms_agg.ts @@ -11,7 +11,7 @@ import { ElasticsearchClient, SavedObjectsClientContract } from 'kibana/server'; import { estypes } from '@elastic/elasticsearch'; import { ConfigSchema } from '../../config'; import { IFieldType } from '../../common'; -import { findIndexPatternById, getFieldByName } from '../index_patterns'; +import { findIndexPatternById, getFieldByName } from '../data_views'; import { shimAbortSignal } from '../search'; export async function termsAggSuggestions( diff --git a/src/plugins/data/server/autocomplete/terms_enum.test.ts b/src/plugins/data/server/autocomplete/terms_enum.test.ts index 4e1eecc71db7c..0e00e2dfe6b4f 100644 --- a/src/plugins/data/server/autocomplete/terms_enum.test.ts +++ b/src/plugins/data/server/autocomplete/terms_enum.test.ts @@ -23,7 +23,7 @@ const mockResponse = { body: { terms: ['whoa', 'amazing'] }, }; -jest.mock('../index_patterns'); +jest.mock('../data_views'); describe('_terms_enum suggestions', () => { beforeEach(() => { diff --git a/src/plugins/data/server/autocomplete/terms_enum.ts b/src/plugins/data/server/autocomplete/terms_enum.ts index 4bfd1545c6fe5..3d7f369233720 100644 --- a/src/plugins/data/server/autocomplete/terms_enum.ts +++ b/src/plugins/data/server/autocomplete/terms_enum.ts @@ -9,7 +9,7 @@ import { ElasticsearchClient, SavedObjectsClientContract } from 'kibana/server'; import { estypes } from '@elastic/elasticsearch'; import { IFieldType } from '../../common'; -import { findIndexPatternById, getFieldByName } from '../index_patterns'; +import { findIndexPatternById, getFieldByName } from '../data_views'; import { shimAbortSignal } from '../search'; import { ConfigSchema } from '../../config'; diff --git a/src/plugins/data/server/index_patterns/capabilities_provider.ts b/src/plugins/data/server/data_views/capabilities_provider.ts similarity index 100% rename from src/plugins/data/server/index_patterns/capabilities_provider.ts rename to src/plugins/data/server/data_views/capabilities_provider.ts diff --git a/src/plugins/data/server/index_patterns/deprecations/index.ts b/src/plugins/data/server/data_views/deprecations/index.ts similarity index 100% rename from src/plugins/data/server/index_patterns/deprecations/index.ts rename to src/plugins/data/server/data_views/deprecations/index.ts diff --git a/src/plugins/data/server/index_patterns/deprecations/scripted_fields.test.ts b/src/plugins/data/server/data_views/deprecations/scripted_fields.test.ts similarity index 100% rename from src/plugins/data/server/index_patterns/deprecations/scripted_fields.test.ts rename to src/plugins/data/server/data_views/deprecations/scripted_fields.test.ts diff --git a/src/plugins/data/server/index_patterns/deprecations/scripted_fields.ts b/src/plugins/data/server/data_views/deprecations/scripted_fields.ts similarity index 100% rename from src/plugins/data/server/index_patterns/deprecations/scripted_fields.ts rename to src/plugins/data/server/data_views/deprecations/scripted_fields.ts diff --git a/src/plugins/data/server/index_patterns/error.ts b/src/plugins/data/server/data_views/error.ts similarity index 100% rename from src/plugins/data/server/index_patterns/error.ts rename to src/plugins/data/server/data_views/error.ts diff --git a/src/plugins/data/server/index_patterns/expressions/index.ts b/src/plugins/data/server/data_views/expressions/index.ts similarity index 100% rename from src/plugins/data/server/index_patterns/expressions/index.ts rename to src/plugins/data/server/data_views/expressions/index.ts diff --git a/src/plugins/data/server/data_views/expressions/load_index_pattern.test.ts b/src/plugins/data/server/data_views/expressions/load_index_pattern.test.ts new file mode 100644 index 0000000000000..370d7dcfd7eba --- /dev/null +++ b/src/plugins/data/server/data_views/expressions/load_index_pattern.test.ts @@ -0,0 +1,44 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { IndexPatternLoadStartDependencies } from '../../../common/data_views/expressions'; +import { getFunctionDefinition } from './load_index_pattern'; + +describe('indexPattern expression function', () => { + let getStartDependencies: () => Promise; + + beforeEach(() => { + getStartDependencies = jest.fn().mockResolvedValue({ + indexPatterns: { + get: (id: string) => ({ + toSpec: () => ({ + title: 'value', + }), + }), + }, + }); + }); + + test('returns serialized index pattern', async () => { + const indexPatternDefinition = getFunctionDefinition({ getStartDependencies }); + const result = await indexPatternDefinition().fn(null, { id: '1' }, { + getKibanaRequest: () => ({}), + } as any); + expect(result.type).toEqual('index_pattern'); + expect(result.value.title).toEqual('value'); + }); + + test('throws if getKibanaRequest is not available', async () => { + const indexPatternDefinition = getFunctionDefinition({ getStartDependencies }); + expect(async () => { + await indexPatternDefinition().fn(null, { id: '1' }, {} as any); + }).rejects.toThrowErrorMatchingInlineSnapshot( + `"A KibanaRequest is required to execute this search on the server. Please provide a request object to the expression execution params."` + ); + }); +}); diff --git a/src/plugins/data/server/data_views/expressions/load_index_pattern.ts b/src/plugins/data/server/data_views/expressions/load_index_pattern.ts new file mode 100644 index 0000000000000..4585101f2812c --- /dev/null +++ b/src/plugins/data/server/data_views/expressions/load_index_pattern.ts @@ -0,0 +1,89 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 { KibanaRequest, StartServicesAccessor } from 'src/core/server'; + +import { + getIndexPatternLoadMeta, + IndexPatternLoadExpressionFunctionDefinition, + IndexPatternLoadStartDependencies, +} from '../../../common/data_views/expressions'; +import { DataPluginStartDependencies, DataPluginStart } from '../../plugin'; + +/** + * Returns the expression function definition. Any stateful dependencies are accessed + * at runtime via the `getStartDependencies` param, which provides the specific services + * needed for this function to run. + * + * This function is an implementation detail of this module, and is exported separately + * only for testing purposes. + * + * @param getStartDependencies - async function that resolves with IndexPatternLoadStartDependencies + * + * @internal + */ +export function getFunctionDefinition({ + getStartDependencies, +}: { + getStartDependencies: (req: KibanaRequest) => Promise; +}) { + return (): IndexPatternLoadExpressionFunctionDefinition => ({ + ...getIndexPatternLoadMeta(), + async fn(input, args, { getKibanaRequest }) { + const kibanaRequest = getKibanaRequest ? getKibanaRequest() : null; + if (!kibanaRequest) { + throw new Error( + i18n.translate('data.indexPatterns.indexPatternLoad.error.kibanaRequest', { + defaultMessage: + 'A KibanaRequest is required to execute this search on the server. ' + + 'Please provide a request object to the expression execution params.', + }) + ); + } + + const { indexPatterns } = await getStartDependencies(kibanaRequest); + + const indexPattern = await indexPatterns.get(args.id); + + return { type: 'index_pattern', value: indexPattern.toSpec() }; + }, + }); +} + +/** + * This is some glue code that takes in `core.getStartServices`, extracts the dependencies + * needed for this function, and wraps them behind a `getStartDependencies` function that + * is then called at runtime. + * + * We do this so that we can be explicit about exactly which dependencies the function + * requires, without cluttering up the top-level `plugin.ts` with this logic. It also + * makes testing the expression function a bit easier since `getStartDependencies` is + * the only thing you should need to mock. + * + * @param getStartServices - core's StartServicesAccessor for this plugin + * + * @internal + */ +export function getIndexPatternLoad({ + getStartServices, +}: { + getStartServices: StartServicesAccessor; +}) { + return getFunctionDefinition({ + getStartDependencies: async (request: KibanaRequest) => { + const [{ elasticsearch, savedObjects }, , { indexPatterns }] = await getStartServices(); + return { + indexPatterns: await indexPatterns.indexPatternsServiceFactory( + savedObjects.getScopedClient(request), + elasticsearch.client.asScoped(request).asCurrentUser + ), + }; + }, + }); +} diff --git a/src/plugins/data/server/index_patterns/fetcher/index.ts b/src/plugins/data/server/data_views/fetcher/index.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/index.ts rename to src/plugins/data/server/data_views/fetcher/index.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/index_patterns_fetcher.test.ts b/src/plugins/data/server/data_views/fetcher/index_patterns_fetcher.test.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/index_patterns_fetcher.test.ts rename to src/plugins/data/server/data_views/fetcher/index_patterns_fetcher.test.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/index_patterns_fetcher.ts b/src/plugins/data/server/data_views/fetcher/index_patterns_fetcher.ts similarity index 99% rename from src/plugins/data/server/index_patterns/fetcher/index_patterns_fetcher.ts rename to src/plugins/data/server/data_views/fetcher/index_patterns_fetcher.ts index 3acdde33f599e..7dae85c920ebf 100644 --- a/src/plugins/data/server/index_patterns/fetcher/index_patterns_fetcher.ts +++ b/src/plugins/data/server/data_views/fetcher/index_patterns_fetcher.ts @@ -25,6 +25,7 @@ export interface FieldDescriptor { type: string; esTypes: string[]; subType?: FieldSubType; + metadata_field?: boolean; } interface FieldSubType { diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/errors.ts b/src/plugins/data/server/data_views/fetcher/lib/errors.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/errors.ts rename to src/plugins/data/server/data_views/fetcher/lib/errors.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/es_api.test.js b/src/plugins/data/server/data_views/fetcher/lib/es_api.test.js similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/es_api.test.js rename to src/plugins/data/server/data_views/fetcher/lib/es_api.test.js diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/es_api.ts b/src/plugins/data/server/data_views/fetcher/lib/es_api.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/es_api.ts rename to src/plugins/data/server/data_views/fetcher/lib/es_api.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/__fixtures__/es_field_caps_response.json b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/__fixtures__/es_field_caps_response.json similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/__fixtures__/es_field_caps_response.json rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/__fixtures__/es_field_caps_response.json diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_capabilities.test.js b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_capabilities.test.js similarity index 94% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_capabilities.test.js rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_capabilities.test.js index c965351562a09..a04295fd11d01 100644 --- a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_capabilities.test.js +++ b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_capabilities.test.js @@ -69,6 +69,17 @@ describe('index_patterns/field_capabilities/field_capabilities', () => { }); describe('response order', () => { + it('supports fields that start with an underscore', async () => { + const fields = ['_field_a', '_field_b']; + + stubDeps({ + fieldsFromFieldCaps: fields.map((name) => ({ name })), + }); + + const fieldNames = (await getFieldCapabilities()).map((field) => field.name); + expect(fieldNames).toEqual(fields); + }); + it('always returns fields in alphabetical order', async () => { const letters = 'ambcdfjopngihkel'.split(''); const sortedLetters = sortBy(letters); diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_capabilities.ts b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_capabilities.ts similarity index 80% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_capabilities.ts rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_capabilities.ts index 56f666c424ed4..a587bbbc39cae 100644 --- a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_capabilities.ts +++ b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_capabilities.ts @@ -34,20 +34,21 @@ export async function getFieldCapabilities( const fieldsFromFieldCapsByName = keyBy(readFieldCapsResponse(esFieldCaps.body), 'name'); const allFieldsUnsorted = Object.keys(fieldsFromFieldCapsByName) - .filter((name) => !name.startsWith('_')) + // not all meta fields are provided, so remove and manually add + .filter((name) => !fieldsFromFieldCapsByName[name].metadata_field) .concat(metaFields) - .reduce<{ names: string[]; hash: Record }>( + .reduce<{ names: string[]; map: Map }>( (agg, value) => { - // This is intentionally using a "hash" and a "push" to be highly optimized with very large indexes - if (agg.hash[value] != null) { + // This is intentionally using a Map to be highly optimized with very large indexes AND be safe for user provided data + if (agg.map.get(value) != null) { return agg; } else { - agg.hash[value] = value; + agg.map.set(value, value); agg.names.push(value); return agg; } }, - { names: [], hash: {} } + { names: [], map: new Map() } ) .names.map((name) => defaults({}, fieldsFromFieldCapsByName[name], { @@ -56,6 +57,7 @@ export async function getFieldCapabilities( searchable: false, aggregatable: false, readFromDocValues: false, + metadata_field: metaFields.includes(name), }) ) .map(mergeOverrides); diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.test.js b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_caps_response.test.js similarity index 99% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.test.js rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_caps_response.test.js index 5ac356f9e461e..c12eff1b5a377 100644 --- a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.test.js +++ b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_caps_response.test.js @@ -48,6 +48,7 @@ describe('index_patterns/field_capabilities/field_caps_response', () => { 'searchable', 'aggregatable', 'readFromDocValues', + 'metadata_field', ]); }); } diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.ts b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_caps_response.ts similarity index 97% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.ts rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_caps_response.ts index 6db9254b81528..3f83fd71b74e4 100644 --- a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/field_caps_response.ts +++ b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/field_caps_response.ts @@ -116,6 +116,8 @@ export function readFieldCapsResponse( }), {} ), + // @ts-expect-error + metadata_field: capsByType[types[0]].metadata_field, }; // This is intentionally using a "hash" and a "push" to be highly optimized with very large indexes agg.array.push(field); @@ -131,6 +133,8 @@ export function readFieldCapsResponse( searchable: isSearchable, aggregatable: isAggregatable, readFromDocValues: shouldReadFieldFromDocValues(isAggregatable, esType), + // @ts-expect-error + metadata_field: capsByType[types[0]].metadata_field, }; // This is intentionally using a "hash" and a "push" to be highly optimized with very large indexes agg.array.push(field); diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/index.ts b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/index.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/index.ts rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/index.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/overrides.ts b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/overrides.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/overrides.ts rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/overrides.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/should_read_field_from_doc_values.test.ts b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/should_read_field_from_doc_values.test.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/should_read_field_from_doc_values.test.ts rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/should_read_field_from_doc_values.test.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/should_read_field_from_doc_values.ts b/src/plugins/data/server/data_views/fetcher/lib/field_capabilities/should_read_field_from_doc_values.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/field_capabilities/should_read_field_from_doc_values.ts rename to src/plugins/data/server/data_views/fetcher/lib/field_capabilities/should_read_field_from_doc_values.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/index.ts b/src/plugins/data/server/data_views/fetcher/lib/index.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/index.ts rename to src/plugins/data/server/data_views/fetcher/lib/index.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/jobs_compatibility.test.js b/src/plugins/data/server/data_views/fetcher/lib/jobs_compatibility.test.js similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/jobs_compatibility.test.js rename to src/plugins/data/server/data_views/fetcher/lib/jobs_compatibility.test.js diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/jobs_compatibility.ts b/src/plugins/data/server/data_views/fetcher/lib/jobs_compatibility.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/jobs_compatibility.ts rename to src/plugins/data/server/data_views/fetcher/lib/jobs_compatibility.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/map_capabilities.ts b/src/plugins/data/server/data_views/fetcher/lib/map_capabilities.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/map_capabilities.ts rename to src/plugins/data/server/data_views/fetcher/lib/map_capabilities.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/merge_capabilities_with_fields.ts b/src/plugins/data/server/data_views/fetcher/lib/merge_capabilities_with_fields.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/merge_capabilities_with_fields.ts rename to src/plugins/data/server/data_views/fetcher/lib/merge_capabilities_with_fields.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/resolve_time_pattern.test.js b/src/plugins/data/server/data_views/fetcher/lib/resolve_time_pattern.test.js similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/resolve_time_pattern.test.js rename to src/plugins/data/server/data_views/fetcher/lib/resolve_time_pattern.test.js diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/resolve_time_pattern.ts b/src/plugins/data/server/data_views/fetcher/lib/resolve_time_pattern.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/resolve_time_pattern.ts rename to src/plugins/data/server/data_views/fetcher/lib/resolve_time_pattern.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/time_pattern_to_wildcard.test.ts b/src/plugins/data/server/data_views/fetcher/lib/time_pattern_to_wildcard.test.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/time_pattern_to_wildcard.test.ts rename to src/plugins/data/server/data_views/fetcher/lib/time_pattern_to_wildcard.test.ts diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/time_pattern_to_wildcard.ts b/src/plugins/data/server/data_views/fetcher/lib/time_pattern_to_wildcard.ts similarity index 100% rename from src/plugins/data/server/index_patterns/fetcher/lib/time_pattern_to_wildcard.ts rename to src/plugins/data/server/data_views/fetcher/lib/time_pattern_to_wildcard.ts diff --git a/src/plugins/data/server/index_patterns/has_user_index_pattern.test.ts b/src/plugins/data/server/data_views/has_user_index_pattern.test.ts similarity index 100% rename from src/plugins/data/server/index_patterns/has_user_index_pattern.test.ts rename to src/plugins/data/server/data_views/has_user_index_pattern.test.ts diff --git a/src/plugins/data/server/data_views/has_user_index_pattern.ts b/src/plugins/data/server/data_views/has_user_index_pattern.ts new file mode 100644 index 0000000000000..97abd0892b836 --- /dev/null +++ b/src/plugins/data/server/data_views/has_user_index_pattern.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 { ElasticsearchClient, SavedObjectsClientContract } from '../../../../core/server'; +import { IndexPatternSavedObjectAttrs } from '../../common/data_views/data_views'; +import { FLEET_ASSETS_TO_IGNORE } from '../../common/data_views/constants'; + +interface Deps { + esClient: ElasticsearchClient; + soClient: SavedObjectsClientContract; +} + +export const hasUserIndexPattern = async ({ esClient, soClient }: Deps): Promise => { + const indexPatterns = await soClient.find({ + type: 'index-pattern', + fields: ['title'], + search: `*`, + searchFields: ['title'], + perPage: 100, + }); + + if (indexPatterns.total === 0) { + return false; + } + + // If there are any index patterns that are not the default metrics-* and logs-* ones created by Fleet, + // assume there are user created index patterns + if ( + indexPatterns.saved_objects.some( + (ip) => + ip.attributes.title !== FLEET_ASSETS_TO_IGNORE.METRICS_INDEX_PATTERN && + ip.attributes.title !== FLEET_ASSETS_TO_IGNORE.LOGS_INDEX_PATTERN + ) + ) { + return true; + } + + const resolveResponse = await esClient.indices.resolveIndex({ + name: `${FLEET_ASSETS_TO_IGNORE.LOGS_INDEX_PATTERN},${FLEET_ASSETS_TO_IGNORE.METRICS_INDEX_PATTERN}`, + }); + + const hasAnyNonDefaultFleetIndices = resolveResponse.body.indices.some( + (ds) => ds.name !== FLEET_ASSETS_TO_IGNORE.METRICS_ENDPOINT_INDEX_TO_IGNORE + ); + + if (hasAnyNonDefaultFleetIndices) return true; + + const hasAnyNonDefaultFleetDataStreams = resolveResponse.body.data_streams.some( + (ds) => + ds.name !== FLEET_ASSETS_TO_IGNORE.METRICS_DATA_STREAM_TO_IGNORE && + ds.name !== FLEET_ASSETS_TO_IGNORE.LOGS_DATA_STREAM_TO_IGNORE + ); + + if (hasAnyNonDefaultFleetDataStreams) return true; + + return false; +}; diff --git a/src/plugins/data/server/index_patterns/index.ts b/src/plugins/data/server/data_views/index.ts similarity index 100% rename from src/plugins/data/server/index_patterns/index.ts rename to src/plugins/data/server/data_views/index.ts diff --git a/src/plugins/data/server/data_views/index_patterns_api_client.ts b/src/plugins/data/server/data_views/index_patterns_api_client.ts new file mode 100644 index 0000000000000..4f71bf218dd4d --- /dev/null +++ b/src/plugins/data/server/data_views/index_patterns_api_client.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 { ElasticsearchClient, SavedObjectsClientContract } from 'kibana/server'; +import { + GetFieldsOptions, + IIndexPatternsApiClient, + GetFieldsOptionsTimePattern, +} from '../../common/data_views/types'; +import { DataViewMissingIndices } from '../../common/data_views/lib'; +import { IndexPatternsFetcher } from './fetcher'; +import { hasUserIndexPattern } from './has_user_index_pattern'; + +export class IndexPatternsApiServer implements IIndexPatternsApiClient { + esClient: ElasticsearchClient; + constructor( + elasticsearchClient: ElasticsearchClient, + private readonly savedObjectsClient: SavedObjectsClientContract + ) { + this.esClient = elasticsearchClient; + } + async getFieldsForWildcard({ + pattern, + metaFields, + type, + rollupIndex, + allowNoIndex, + }: GetFieldsOptions) { + const indexPatterns = new IndexPatternsFetcher(this.esClient, allowNoIndex); + return await indexPatterns + .getFieldsForWildcard({ + pattern, + metaFields, + type, + rollupIndex, + }) + .catch((err) => { + if ( + err.output.payload.statusCode === 404 && + err.output.payload.code === 'no_matching_indices' + ) { + throw new DataViewMissingIndices(pattern); + } else { + throw err; + } + }); + } + async getFieldsForTimePattern(options: GetFieldsOptionsTimePattern) { + const indexPatterns = new IndexPatternsFetcher(this.esClient); + return await indexPatterns.getFieldsForTimePattern(options); + } + + async hasUserIndexPattern() { + return hasUserIndexPattern({ + esClient: this.esClient, + soClient: this.savedObjectsClient, + }); + } +} diff --git a/src/plugins/data/server/index_patterns/index_patterns_service.ts b/src/plugins/data/server/data_views/index_patterns_service.ts similarity index 100% rename from src/plugins/data/server/index_patterns/index_patterns_service.ts rename to src/plugins/data/server/data_views/index_patterns_service.ts diff --git a/src/plugins/data/server/index_patterns/mocks.ts b/src/plugins/data/server/data_views/mocks.ts similarity index 100% rename from src/plugins/data/server/index_patterns/mocks.ts rename to src/plugins/data/server/data_views/mocks.ts diff --git a/src/plugins/data/server/index_patterns/register_index_pattern_usage_collection.test.ts b/src/plugins/data/server/data_views/register_index_pattern_usage_collection.test.ts similarity index 100% rename from src/plugins/data/server/index_patterns/register_index_pattern_usage_collection.test.ts rename to src/plugins/data/server/data_views/register_index_pattern_usage_collection.test.ts diff --git a/src/plugins/data/server/index_patterns/register_index_pattern_usage_collection.ts b/src/plugins/data/server/data_views/register_index_pattern_usage_collection.ts similarity index 100% rename from src/plugins/data/server/index_patterns/register_index_pattern_usage_collection.ts rename to src/plugins/data/server/data_views/register_index_pattern_usage_collection.ts diff --git a/src/plugins/data/server/index_patterns/routes.ts b/src/plugins/data/server/data_views/routes.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes.ts rename to src/plugins/data/server/data_views/routes.ts diff --git a/src/plugins/data/server/index_patterns/routes/create_index_pattern.ts b/src/plugins/data/server/data_views/routes/create_index_pattern.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/create_index_pattern.ts rename to src/plugins/data/server/data_views/routes/create_index_pattern.ts diff --git a/src/plugins/data/server/index_patterns/routes/default_index_pattern.ts b/src/plugins/data/server/data_views/routes/default_index_pattern.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/default_index_pattern.ts rename to src/plugins/data/server/data_views/routes/default_index_pattern.ts diff --git a/src/plugins/data/server/index_patterns/routes/delete_index_pattern.ts b/src/plugins/data/server/data_views/routes/delete_index_pattern.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/delete_index_pattern.ts rename to src/plugins/data/server/data_views/routes/delete_index_pattern.ts diff --git a/src/plugins/data/server/index_patterns/routes/fields/update_fields.ts b/src/plugins/data/server/data_views/routes/fields/update_fields.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/fields/update_fields.ts rename to src/plugins/data/server/data_views/routes/fields/update_fields.ts diff --git a/src/plugins/data/server/index_patterns/routes/get_index_pattern.ts b/src/plugins/data/server/data_views/routes/get_index_pattern.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/get_index_pattern.ts rename to src/plugins/data/server/data_views/routes/get_index_pattern.ts diff --git a/src/plugins/data/server/data_views/routes/has_user_index_pattern.ts b/src/plugins/data/server/data_views/routes/has_user_index_pattern.ts new file mode 100644 index 0000000000000..7d67e96f39f6e --- /dev/null +++ b/src/plugins/data/server/data_views/routes/has_user_index_pattern.ts @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { handleErrors } from './util/handle_errors'; +import { IRouter, StartServicesAccessor } from '../../../../../core/server'; +import type { DataPluginStart, DataPluginStartDependencies } from '../../plugin'; + +export const registerHasUserIndexPatternRoute = ( + router: IRouter, + getStartServices: StartServicesAccessor +) => { + router.get( + { + path: '/api/index_patterns/has_user_index_pattern', + validate: {}, + }, + router.handleLegacyErrors( + handleErrors(async (ctx, req, res) => { + const savedObjectsClient = ctx.core.savedObjects.client; + const elasticsearchClient = ctx.core.elasticsearch.client.asCurrentUser; + const [, , { indexPatterns }] = await getStartServices(); + const indexPatternsService = await indexPatterns.indexPatternsServiceFactory( + savedObjectsClient, + elasticsearchClient + ); + + return res.ok({ + body: { + result: await indexPatternsService.hasUserDataView(), + }, + }); + }) + ) + ); +}; diff --git a/src/plugins/data/server/index_patterns/routes/runtime_fields/create_runtime_field.ts b/src/plugins/data/server/data_views/routes/runtime_fields/create_runtime_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/runtime_fields/create_runtime_field.ts rename to src/plugins/data/server/data_views/routes/runtime_fields/create_runtime_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/runtime_fields/delete_runtime_field.ts b/src/plugins/data/server/data_views/routes/runtime_fields/delete_runtime_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/runtime_fields/delete_runtime_field.ts rename to src/plugins/data/server/data_views/routes/runtime_fields/delete_runtime_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/runtime_fields/get_runtime_field.ts b/src/plugins/data/server/data_views/routes/runtime_fields/get_runtime_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/runtime_fields/get_runtime_field.ts rename to src/plugins/data/server/data_views/routes/runtime_fields/get_runtime_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/runtime_fields/put_runtime_field.ts b/src/plugins/data/server/data_views/routes/runtime_fields/put_runtime_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/runtime_fields/put_runtime_field.ts rename to src/plugins/data/server/data_views/routes/runtime_fields/put_runtime_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/runtime_fields/update_runtime_field.ts b/src/plugins/data/server/data_views/routes/runtime_fields/update_runtime_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/runtime_fields/update_runtime_field.ts rename to src/plugins/data/server/data_views/routes/runtime_fields/update_runtime_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/scripted_fields/create_scripted_field.ts b/src/plugins/data/server/data_views/routes/scripted_fields/create_scripted_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/scripted_fields/create_scripted_field.ts rename to src/plugins/data/server/data_views/routes/scripted_fields/create_scripted_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/scripted_fields/delete_scripted_field.ts b/src/plugins/data/server/data_views/routes/scripted_fields/delete_scripted_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/scripted_fields/delete_scripted_field.ts rename to src/plugins/data/server/data_views/routes/scripted_fields/delete_scripted_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/scripted_fields/get_scripted_field.ts b/src/plugins/data/server/data_views/routes/scripted_fields/get_scripted_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/scripted_fields/get_scripted_field.ts rename to src/plugins/data/server/data_views/routes/scripted_fields/get_scripted_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/scripted_fields/put_scripted_field.ts b/src/plugins/data/server/data_views/routes/scripted_fields/put_scripted_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/scripted_fields/put_scripted_field.ts rename to src/plugins/data/server/data_views/routes/scripted_fields/put_scripted_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/scripted_fields/update_scripted_field.ts b/src/plugins/data/server/data_views/routes/scripted_fields/update_scripted_field.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/scripted_fields/update_scripted_field.ts rename to src/plugins/data/server/data_views/routes/scripted_fields/update_scripted_field.ts diff --git a/src/plugins/data/server/index_patterns/routes/update_index_pattern.ts b/src/plugins/data/server/data_views/routes/update_index_pattern.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/update_index_pattern.ts rename to src/plugins/data/server/data_views/routes/update_index_pattern.ts diff --git a/src/plugins/data/server/index_patterns/routes/util/handle_errors.ts b/src/plugins/data/server/data_views/routes/util/handle_errors.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/util/handle_errors.ts rename to src/plugins/data/server/data_views/routes/util/handle_errors.ts diff --git a/src/plugins/data/server/index_patterns/routes/util/schemas.ts b/src/plugins/data/server/data_views/routes/util/schemas.ts similarity index 100% rename from src/plugins/data/server/index_patterns/routes/util/schemas.ts rename to src/plugins/data/server/data_views/routes/util/schemas.ts diff --git a/src/plugins/data/server/data_views/saved_objects_client_wrapper.ts b/src/plugins/data/server/data_views/saved_objects_client_wrapper.ts new file mode 100644 index 0000000000000..b37648a3f038e --- /dev/null +++ b/src/plugins/data/server/data_views/saved_objects_client_wrapper.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 { SavedObjectsClientContract, SavedObject } from 'src/core/server'; +import { + SavedObjectsClientCommon, + SavedObjectsClientCommonFindArgs, + DataViewSavedObjectConflictError, +} from '../../common/data_views'; + +export class SavedObjectsClientServerToCommon implements SavedObjectsClientCommon { + private savedObjectClient: SavedObjectsClientContract; + constructor(savedObjectClient: SavedObjectsClientContract) { + this.savedObjectClient = savedObjectClient; + } + async find(options: SavedObjectsClientCommonFindArgs) { + const result = await this.savedObjectClient.find(options); + return result.saved_objects; + } + + async get(type: string, id: string) { + const response = await this.savedObjectClient.resolve(type, id); + if (response.outcome === 'conflict') { + throw new DataViewSavedObjectConflictError(id); + } + return response.saved_object; + } + async update( + type: string, + id: string, + attributes: Record, + options: Record + ) { + return (await this.savedObjectClient.update(type, id, attributes, options)) as SavedObject; + } + async create(type: string, attributes: Record, options: Record) { + return await this.savedObjectClient.create(type, attributes, options); + } + delete(type: string, id: string) { + return this.savedObjectClient.delete(type, id); + } +} diff --git a/src/plugins/data/server/data_views/ui_settings_wrapper.ts b/src/plugins/data/server/data_views/ui_settings_wrapper.ts new file mode 100644 index 0000000000000..3b00aab7d6bdd --- /dev/null +++ b/src/plugins/data/server/data_views/ui_settings_wrapper.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 { IUiSettingsClient } from 'src/core/server'; +import { UiSettingsCommon } from '../../common'; + +export class UiSettingsServerToCommon implements UiSettingsCommon { + private uiSettings: IUiSettingsClient; + constructor(uiSettings: IUiSettingsClient) { + this.uiSettings = uiSettings; + } + get(key: string) { + return this.uiSettings.get(key); + } + + getAll() { + return this.uiSettings.getAll(); + } + + set(key: string, value: any) { + return this.uiSettings.set(key, value); + } + + remove(key: string) { + return this.uiSettings.remove(key); + } +} diff --git a/src/plugins/data/server/index_patterns/utils.ts b/src/plugins/data/server/data_views/utils.ts similarity index 100% rename from src/plugins/data/server/index_patterns/utils.ts rename to src/plugins/data/server/data_views/utils.ts diff --git a/src/plugins/data/server/index.ts b/src/plugins/data/server/index.ts index 1f33b5ed44d9b..a17c66c694b2d 100644 --- a/src/plugins/data/server/index.ts +++ b/src/plugins/data/server/index.ts @@ -41,7 +41,8 @@ export { shouldReadFieldFromDocValues, // used only in logstash_fields fixture FieldDescriptor, getCapabilitiesForRollupIndices, -} from './index_patterns'; + IndexPatternsServiceStart, +} from './data_views'; export { IndexPatternField, diff --git a/src/plugins/data/server/index_patterns/expressions/load_index_pattern.test.ts b/src/plugins/data/server/index_patterns/expressions/load_index_pattern.test.ts deleted file mode 100644 index 998640bda8848..0000000000000 --- a/src/plugins/data/server/index_patterns/expressions/load_index_pattern.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { IndexPatternLoadStartDependencies } from '../../../common/index_patterns/expressions'; -import { getFunctionDefinition } from './load_index_pattern'; - -describe('indexPattern expression function', () => { - let getStartDependencies: () => Promise; - - beforeEach(() => { - getStartDependencies = jest.fn().mockResolvedValue({ - indexPatterns: { - get: (id: string) => ({ - toSpec: () => ({ - title: 'value', - }), - }), - }, - }); - }); - - test('returns serialized index pattern', async () => { - const indexPatternDefinition = getFunctionDefinition({ getStartDependencies }); - const result = await indexPatternDefinition().fn(null, { id: '1' }, { - getKibanaRequest: () => ({}), - } as any); - expect(result.type).toEqual('index_pattern'); - expect(result.value.title).toEqual('value'); - }); - - test('throws if getKibanaRequest is not available', async () => { - const indexPatternDefinition = getFunctionDefinition({ getStartDependencies }); - expect(async () => { - await indexPatternDefinition().fn(null, { id: '1' }, {} as any); - }).rejects.toThrowErrorMatchingInlineSnapshot( - `"A KibanaRequest is required to execute this search on the server. Please provide a request object to the expression execution params."` - ); - }); -}); diff --git a/src/plugins/data/server/index_patterns/expressions/load_index_pattern.ts b/src/plugins/data/server/index_patterns/expressions/load_index_pattern.ts deleted file mode 100644 index 9112686c568da..0000000000000 --- a/src/plugins/data/server/index_patterns/expressions/load_index_pattern.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 and the Server Side Public License, v 1; you may not 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 { KibanaRequest, StartServicesAccessor } from 'src/core/server'; - -import { - getIndexPatternLoadMeta, - IndexPatternLoadExpressionFunctionDefinition, - IndexPatternLoadStartDependencies, -} from '../../../common/index_patterns/expressions'; -import { DataPluginStartDependencies, DataPluginStart } from '../../plugin'; - -/** - * Returns the expression function definition. Any stateful dependencies are accessed - * at runtime via the `getStartDependencies` param, which provides the specific services - * needed for this function to run. - * - * This function is an implementation detail of this module, and is exported separately - * only for testing purposes. - * - * @param getStartDependencies - async function that resolves with IndexPatternLoadStartDependencies - * - * @internal - */ -export function getFunctionDefinition({ - getStartDependencies, -}: { - getStartDependencies: (req: KibanaRequest) => Promise; -}) { - return (): IndexPatternLoadExpressionFunctionDefinition => ({ - ...getIndexPatternLoadMeta(), - async fn(input, args, { getKibanaRequest }) { - const kibanaRequest = getKibanaRequest ? getKibanaRequest() : null; - if (!kibanaRequest) { - throw new Error( - i18n.translate('data.indexPatterns.indexPatternLoad.error.kibanaRequest', { - defaultMessage: - 'A KibanaRequest is required to execute this search on the server. ' + - 'Please provide a request object to the expression execution params.', - }) - ); - } - - const { indexPatterns } = await getStartDependencies(kibanaRequest); - - const indexPattern = await indexPatterns.get(args.id); - - return { type: 'index_pattern', value: indexPattern.toSpec() }; - }, - }); -} - -/** - * This is some glue code that takes in `core.getStartServices`, extracts the dependencies - * needed for this function, and wraps them behind a `getStartDependencies` function that - * is then called at runtime. - * - * We do this so that we can be explicit about exactly which dependencies the function - * requires, without cluttering up the top-level `plugin.ts` with this logic. It also - * makes testing the expression function a bit easier since `getStartDependencies` is - * the only thing you should need to mock. - * - * @param getStartServices - core's StartServicesAccessor for this plugin - * - * @internal - */ -export function getIndexPatternLoad({ - getStartServices, -}: { - getStartServices: StartServicesAccessor; -}) { - return getFunctionDefinition({ - getStartDependencies: async (request: KibanaRequest) => { - const [{ elasticsearch, savedObjects }, , { indexPatterns }] = await getStartServices(); - return { - indexPatterns: await indexPatterns.indexPatternsServiceFactory( - savedObjects.getScopedClient(request), - elasticsearch.client.asScoped(request).asCurrentUser - ), - }; - }, - }); -} diff --git a/src/plugins/data/server/index_patterns/has_user_index_pattern.ts b/src/plugins/data/server/index_patterns/has_user_index_pattern.ts deleted file mode 100644 index b65983a7fd5d4..0000000000000 --- a/src/plugins/data/server/index_patterns/has_user_index_pattern.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { ElasticsearchClient, SavedObjectsClientContract } from '../../../../core/server'; -import { IndexPatternSavedObjectAttrs } from '../../common/index_patterns/index_patterns'; -import { FLEET_ASSETS_TO_IGNORE } from '../../common/index_patterns/constants'; - -interface Deps { - esClient: ElasticsearchClient; - soClient: SavedObjectsClientContract; -} - -export const hasUserIndexPattern = async ({ esClient, soClient }: Deps): Promise => { - const indexPatterns = await soClient.find({ - type: 'index-pattern', - fields: ['title'], - search: `*`, - searchFields: ['title'], - perPage: 100, - }); - - if (indexPatterns.total === 0) { - return false; - } - - // If there are any index patterns that are not the default metrics-* and logs-* ones created by Fleet, - // assume there are user created index patterns - if ( - indexPatterns.saved_objects.some( - (ip) => - ip.attributes.title !== FLEET_ASSETS_TO_IGNORE.METRICS_INDEX_PATTERN && - ip.attributes.title !== FLEET_ASSETS_TO_IGNORE.LOGS_INDEX_PATTERN - ) - ) { - return true; - } - - const resolveResponse = await esClient.indices.resolveIndex({ - name: `${FLEET_ASSETS_TO_IGNORE.LOGS_INDEX_PATTERN},${FLEET_ASSETS_TO_IGNORE.METRICS_INDEX_PATTERN}`, - }); - - const hasAnyNonDefaultFleetIndices = resolveResponse.body.indices.some( - (ds) => ds.name !== FLEET_ASSETS_TO_IGNORE.METRICS_ENDPOINT_INDEX_TO_IGNORE - ); - - if (hasAnyNonDefaultFleetIndices) return true; - - const hasAnyNonDefaultFleetDataStreams = resolveResponse.body.data_streams.some( - (ds) => - ds.name !== FLEET_ASSETS_TO_IGNORE.METRICS_DATA_STREAM_TO_IGNORE && - ds.name !== FLEET_ASSETS_TO_IGNORE.LOGS_DATA_STREAM_TO_IGNORE - ); - - if (hasAnyNonDefaultFleetDataStreams) return true; - - return false; -}; diff --git a/src/plugins/data/server/index_patterns/index_patterns_api_client.ts b/src/plugins/data/server/index_patterns/index_patterns_api_client.ts deleted file mode 100644 index eeb146aee46a3..0000000000000 --- a/src/plugins/data/server/index_patterns/index_patterns_api_client.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { ElasticsearchClient, SavedObjectsClientContract } from 'kibana/server'; -import { - GetFieldsOptions, - IIndexPatternsApiClient, - GetFieldsOptionsTimePattern, -} from '../../common/index_patterns/types'; -import { DataViewMissingIndices } from '../../common/index_patterns/lib'; -import { IndexPatternsFetcher } from './fetcher'; -import { hasUserIndexPattern } from './has_user_index_pattern'; - -export class IndexPatternsApiServer implements IIndexPatternsApiClient { - esClient: ElasticsearchClient; - constructor( - elasticsearchClient: ElasticsearchClient, - private readonly savedObjectsClient: SavedObjectsClientContract - ) { - this.esClient = elasticsearchClient; - } - async getFieldsForWildcard({ - pattern, - metaFields, - type, - rollupIndex, - allowNoIndex, - }: GetFieldsOptions) { - const indexPatterns = new IndexPatternsFetcher(this.esClient, allowNoIndex); - return await indexPatterns - .getFieldsForWildcard({ - pattern, - metaFields, - type, - rollupIndex, - }) - .catch((err) => { - if ( - err.output.payload.statusCode === 404 && - err.output.payload.code === 'no_matching_indices' - ) { - throw new DataViewMissingIndices(pattern); - } else { - throw err; - } - }); - } - async getFieldsForTimePattern(options: GetFieldsOptionsTimePattern) { - const indexPatterns = new IndexPatternsFetcher(this.esClient); - return await indexPatterns.getFieldsForTimePattern(options); - } - - async hasUserIndexPattern() { - return hasUserIndexPattern({ - esClient: this.esClient, - soClient: this.savedObjectsClient, - }); - } -} diff --git a/src/plugins/data/server/index_patterns/routes/has_user_index_pattern.ts b/src/plugins/data/server/index_patterns/routes/has_user_index_pattern.ts deleted file mode 100644 index 6447f50f88f26..0000000000000 --- a/src/plugins/data/server/index_patterns/routes/has_user_index_pattern.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { handleErrors } from './util/handle_errors'; -import { IRouter, StartServicesAccessor } from '../../../../../core/server'; -import type { DataPluginStart, DataPluginStartDependencies } from '../../plugin'; - -export const registerHasUserIndexPatternRoute = ( - router: IRouter, - getStartServices: StartServicesAccessor -) => { - router.get( - { - path: '/api/index_patterns/has_user_index_pattern', - validate: {}, - }, - router.handleLegacyErrors( - handleErrors(async (ctx, req, res) => { - const savedObjectsClient = ctx.core.savedObjects.client; - const elasticsearchClient = ctx.core.elasticsearch.client.asCurrentUser; - const [, , { indexPatterns }] = await getStartServices(); - const indexPatternsService = await indexPatterns.indexPatternsServiceFactory( - savedObjectsClient, - elasticsearchClient - ); - - return res.ok({ - body: { - result: await indexPatternsService.hasUserIndexPattern(), - }, - }); - }) - ) - ); -}; diff --git a/src/plugins/data/server/index_patterns/saved_objects_client_wrapper.ts b/src/plugins/data/server/index_patterns/saved_objects_client_wrapper.ts deleted file mode 100644 index 7291292a1edb1..0000000000000 --- a/src/plugins/data/server/index_patterns/saved_objects_client_wrapper.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { SavedObjectsClientContract, SavedObject } from 'src/core/server'; -import { - SavedObjectsClientCommon, - SavedObjectsClientCommonFindArgs, - DataViewSavedObjectConflictError, -} from '../../common/index_patterns'; - -export class SavedObjectsClientServerToCommon implements SavedObjectsClientCommon { - private savedObjectClient: SavedObjectsClientContract; - constructor(savedObjectClient: SavedObjectsClientContract) { - this.savedObjectClient = savedObjectClient; - } - async find(options: SavedObjectsClientCommonFindArgs) { - const result = await this.savedObjectClient.find(options); - return result.saved_objects; - } - - async get(type: string, id: string) { - const response = await this.savedObjectClient.resolve(type, id); - if (response.outcome === 'conflict') { - throw new DataViewSavedObjectConflictError(id); - } - return response.saved_object; - } - async update( - type: string, - id: string, - attributes: Record, - options: Record - ) { - return (await this.savedObjectClient.update(type, id, attributes, options)) as SavedObject; - } - async create(type: string, attributes: Record, options: Record) { - return await this.savedObjectClient.create(type, attributes, options); - } - delete(type: string, id: string) { - return this.savedObjectClient.delete(type, id); - } -} diff --git a/src/plugins/data/server/index_patterns/ui_settings_wrapper.ts b/src/plugins/data/server/index_patterns/ui_settings_wrapper.ts deleted file mode 100644 index bb7332dc45476..0000000000000 --- a/src/plugins/data/server/index_patterns/ui_settings_wrapper.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { IUiSettingsClient } from 'src/core/server'; -import { UiSettingsCommon } from '../../common/index_patterns'; - -export class UiSettingsServerToCommon implements UiSettingsCommon { - private uiSettings: IUiSettingsClient; - constructor(uiSettings: IUiSettingsClient) { - this.uiSettings = uiSettings; - } - get(key: string) { - return this.uiSettings.get(key); - } - - getAll() { - return this.uiSettings.getAll(); - } - - set(key: string, value: any) { - return this.uiSettings.set(key, value); - } - - remove(key: string) { - return this.uiSettings.remove(key); - } -} diff --git a/src/plugins/data/server/mocks.ts b/src/plugins/data/server/mocks.ts index af104dea72af7..852dffcfa3d51 100644 --- a/src/plugins/data/server/mocks.ts +++ b/src/plugins/data/server/mocks.ts @@ -15,7 +15,7 @@ import { createFieldFormatsSetupMock, createFieldFormatsStartMock, } from '../../field_formats/server/mocks'; -import { createIndexPatternsStartMock } from './index_patterns/mocks'; +import { createIndexPatternsStartMock } from './data_views/mocks'; import { DataRequestHandlerContext } from './search'; function createSetupContract() { diff --git a/src/plugins/data/server/plugin.ts b/src/plugins/data/server/plugin.ts index e04095ed26a46..c1741cc31fc05 100644 --- a/src/plugins/data/server/plugin.ts +++ b/src/plugins/data/server/plugin.ts @@ -10,7 +10,7 @@ import { CoreSetup, CoreStart, Logger, Plugin, PluginInitializerContext } from ' import { ExpressionsServerSetup } from 'src/plugins/expressions/server'; import { BfetchServerSetup } from 'src/plugins/bfetch/server'; import { ConfigSchema } from '../config'; -import { IndexPatternsServiceProvider, IndexPatternsServiceStart } from './index_patterns'; +import { IndexPatternsServiceProvider, IndexPatternsServiceStart } from './data_views'; import { ISearchSetup, ISearchStart, SearchEnhancements } from './search'; import { SearchService } from './search/search_service'; import { QueryService } from './query/query_service'; diff --git a/src/plugins/data/server/saved_objects/query.ts b/src/plugins/data/server/saved_objects/query.ts index 2e8b80cf3f080..bc6225255b5e6 100644 --- a/src/plugins/data/server/saved_objects/query.ts +++ b/src/plugins/data/server/saved_objects/query.ts @@ -11,7 +11,8 @@ import { SavedObjectsType } from 'kibana/server'; export const querySavedObjectType: SavedObjectsType = { name: 'query', hidden: false, - namespaceType: 'single', + namespaceType: 'multiple-isolated', + convertToMultiNamespaceTypeVersion: '8.0.0', management: { icon: 'search', defaultSearchField: 'title', diff --git a/src/plugins/data/server/search/aggs/aggs_service.test.ts b/src/plugins/data/server/search/aggs/aggs_service.test.ts index fdff2a4a8118c..d03ee17bdaeb9 100644 --- a/src/plugins/data/server/search/aggs/aggs_service.test.ts +++ b/src/plugins/data/server/search/aggs/aggs_service.test.ts @@ -12,7 +12,7 @@ import { coreMock } from '../../../../../core/server/mocks'; import { expressionsPluginMock } from '../../../../../plugins/expressions/server/mocks'; import { BucketAggType, getAggTypes, MetricAggType } from '../../../common'; import { createFieldFormatsStartMock } from '../../../../field_formats/server/mocks'; -import { createIndexPatternsStartMock } from '../../index_patterns/mocks'; +import { createIndexPatternsStartMock } from '../../data_views/mocks'; import { AggsService, AggsSetupDependencies, AggsStartDependencies } from './aggs_service'; diff --git a/src/plugins/data/server/search/aggs/aggs_service.ts b/src/plugins/data/server/search/aggs/aggs_service.ts index 197d8fd7caa99..ed18ef7e4f350 100644 --- a/src/plugins/data/server/search/aggs/aggs_service.ts +++ b/src/plugins/data/server/search/aggs/aggs_service.ts @@ -23,7 +23,7 @@ import { TimeRange, } from '../../../common'; import { FieldFormatsStart } from '../../../../field_formats/server'; -import { IndexPatternsServiceStart } from '../../index_patterns'; +import { IndexPatternsServiceStart } from '../../data_views'; import { AggsSetup, AggsStart } from './types'; /** @internal */ diff --git a/src/plugins/data/server/search/expressions/esaggs.test.ts b/src/plugins/data/server/search/expressions/esaggs.test.ts index 37c5f90f00f4d..5833846cf96e3 100644 --- a/src/plugins/data/server/search/expressions/esaggs.test.ts +++ b/src/plugins/data/server/search/expressions/esaggs.test.ts @@ -11,7 +11,7 @@ import { of as mockOf } from 'rxjs'; import type { MockedKeys } from '@kbn/utility-types/jest'; import { KibanaRequest } from 'src/core/server'; import type { ExecutionContext } from 'src/plugins/expressions/server'; -import type { IndexPatternsContract } from '../../../common/index_patterns/index_patterns'; +import type { IndexPatternsContract } from '../../../common'; import type { AggsCommonStart, ISearchStartSearchSource, diff --git a/src/plugins/data/server/search/expressions/kibana_context.ts b/src/plugins/data/server/search/expressions/kibana_context.ts index c8fdbf4764b0e..191a0fdb7ae88 100644 --- a/src/plugins/data/server/search/expressions/kibana_context.ts +++ b/src/plugins/data/server/search/expressions/kibana_context.ts @@ -9,7 +9,7 @@ import { StartServicesAccessor } from 'src/core/server'; import { getKibanaContextFn } from '../../../common/search/expressions'; import { DataPluginStart, DataPluginStartDependencies } from '../../plugin'; -import { SavedObjectsClientCommon } from '../../../common/index_patterns'; +import { SavedObjectsClientCommon } from '../../../common'; /** * This is some glue code that takes in `core.getStartServices`, extracts the dependencies diff --git a/src/plugins/data/server/search/search_service.test.ts b/src/plugins/data/server/search/search_service.test.ts index e6db3c76ef9ba..e3738fd3a9304 100644 --- a/src/plugins/data/server/search/search_service.test.ts +++ b/src/plugins/data/server/search/search_service.test.ts @@ -12,7 +12,7 @@ import { coreMock } from '../../../../core/server/mocks'; import { DataPluginStart, DataPluginStartDependencies } from '../plugin'; import { createFieldFormatsStartMock } from '../../../field_formats/server/mocks'; -import { createIndexPatternsStartMock } from '../index_patterns/mocks'; +import { createIndexPatternsStartMock } from '../data_views/mocks'; import { SearchService, SearchServiceSetupDependencies } from './search_service'; import { bfetchPluginMock } from '../../../bfetch/server/mocks'; diff --git a/src/plugins/data/server/search/search_service.ts b/src/plugins/data/server/search/search_service.ts index 4961f6dc3e959..26ecd7ebed500 100644 --- a/src/plugins/data/server/search/search_service.ts +++ b/src/plugins/data/server/search/search_service.ts @@ -35,7 +35,7 @@ import type { import { AggsService } from './aggs'; import { FieldFormatsStart } from '../../../field_formats/server'; -import { IndexPatternsServiceStart } from '../index_patterns'; +import { IndexPatternsServiceStart } from '../data_views'; import { registerSearchRoute } from './routes'; import { ES_SEARCH_STRATEGY, esSearchStrategyProvider } from './strategies/es_search'; import { DataPluginStart, DataPluginStartDependencies } from '../plugin'; diff --git a/src/plugins/discover/jest.config.js b/src/plugins/discover/jest.config.js index 4c0f09b2cc242..00f5d8016e3c4 100644 --- a/src/plugins/discover/jest.config.js +++ b/src/plugins/discover/jest.config.js @@ -11,4 +11,7 @@ module.exports = { rootDir: '../../..', roots: ['/src/plugins/discover'], testRunner: 'jasmine2', + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/discover', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/discover/{common,public,server}/**/*.{js,ts,tsx}'], }; diff --git a/src/plugins/discover/public/__mocks__/index_pattern.ts b/src/plugins/discover/public/__mocks__/index_pattern.ts index 67aac96889424..9e7049187f639 100644 --- a/src/plugins/discover/public/__mocks__/index_pattern.ts +++ b/src/plugins/discover/public/__mocks__/index_pattern.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { IIndexPatternFieldList } from '../../../data/common/index_patterns/fields'; +import { IIndexPatternFieldList } from '../../../data/common'; import { IndexPattern } from '../../../data/common'; import { indexPatterns } from '../../../data/public'; diff --git a/src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts b/src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts index 0262bb942b8a5..f52ab8fd1c296 100644 --- a/src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts +++ b/src/plugins/discover/public/__mocks__/index_pattern_with_timefield.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { IIndexPatternFieldList } from '../../../data/common/index_patterns/fields'; +import { IIndexPatternFieldList } from '../../../data/common'; import { IndexPattern } from '../../../data/common'; import { indexPatterns } from '../../../data/public'; diff --git a/src/plugins/discover/public/application/application.ts b/src/plugins/discover/public/application/application.ts deleted file mode 100644 index c0294ca043895..0000000000000 --- a/src/plugins/discover/public/application/application.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { renderApp as renderReactApp } from './index'; - -/** - * Here's where Discover is mounted and rendered - */ -export async function renderApp(moduleName: string, element: HTMLElement) { - const app = mountDiscoverApp(moduleName, element); - return () => { - app(); - }; -} - -function buildDiscoverElement(mountpoint: HTMLElement) { - // due to legacy angular tags, we need some manual DOM intervention here - const appWrapper = document.createElement('div'); - const discoverApp = document.createElement('discover-app'); - const discover = document.createElement('discover'); - appWrapper.appendChild(discoverApp); - discoverApp.append(discover); - mountpoint.appendChild(appWrapper); - return discover; -} - -function mountDiscoverApp(moduleName: string, element: HTMLElement) { - const mountpoint = document.createElement('div'); - const discoverElement = buildDiscoverElement(mountpoint); - // @ts-expect-error - const app = renderReactApp({ element: discoverElement }); - element.appendChild(mountpoint); - return app; -} diff --git a/src/plugins/discover/public/application/apps/context/components/action_bar/action_bar.tsx b/src/plugins/discover/public/application/apps/context/components/action_bar/action_bar.tsx index 634e6d2c90a91..d9d56964358f8 100644 --- a/src/plugins/discover/public/application/apps/context/components/action_bar/action_bar.tsx +++ b/src/plugins/discover/public/application/apps/context/components/action_bar/action_bar.tsx @@ -9,7 +9,7 @@ import './_action_bar.scss'; import React, { useState, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n/react'; import { EuiButtonEmpty, EuiFieldNumber, @@ -84,84 +84,78 @@ export function ActionBar({ } }, [docCount, newDocCount]); return ( - -
- {isSuccessor && } - {isSuccessor && showWarning && ( - - )} - {isSuccessor && showWarning && } - - - { - const value = newDocCount + defaultStepSize; - if (isValid(value)) { - setNewDocCount(value); - onChangeCount(type, value); - } + + {isSuccessor && } + {isSuccessor && showWarning && } + {isSuccessor && showWarning && } + + + { + const value = newDocCount + defaultStepSize; + if (isValid(value)) { + setNewDocCount(value); + onChangeCount(type, value); + } + }} + flush="right" + > + + + + + + { + setNewDocCount(ev.target.valueAsNumber); }} - flush="right" - > - - - - - - { + if (newDocCount !== docCount && isValid(newDocCount)) { + onChangeCount(type, newDocCount); } - compressed - className="cxtSizePicker" - data-test-subj={`${type}CountPicker`} - disabled={isDisabled} - min={MIN_CONTEXT_SIZE} - max={MAX_CONTEXT_SIZE} - onChange={(ev) => { - setNewDocCount(ev.target.valueAsNumber); - }} - onBlur={() => { - if (newDocCount !== docCount && isValid(newDocCount)) { - onChangeCount(type, newDocCount); - } - }} - type="number" - value={newDocCount >= 0 ? newDocCount : ''} + }} + type="number" + value={newDocCount >= 0 ? newDocCount : ''} + /> + + + + + {isSuccessor ? ( + + ) : ( + - - - - - {isSuccessor ? ( - - ) : ( - - )} - - - - {!isSuccessor && showWarning && ( - - )} - {!isSuccessor && } - -
+ )} + + + + {!isSuccessor && showWarning && } + {!isSuccessor && } + ); } diff --git a/src/plugins/discover/public/application/apps/context/components/context_error_message/context_error_message.tsx b/src/plugins/discover/public/application/apps/context/components/context_error_message/context_error_message.tsx index fac948d0f7040..fc05deeae7e51 100644 --- a/src/plugins/discover/public/application/apps/context/components/context_error_message/context_error_message.tsx +++ b/src/plugins/discover/public/application/apps/context/components/context_error_message/context_error_message.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiCallOut, EuiText } from '@elastic/eui'; -import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n/react'; import { FailureReason, LoadingStatus, @@ -27,27 +27,25 @@ export function ContextErrorMessage({ status }: ContextErrorMessageProps) { return null; } return ( - - + } + color="danger" + iconType="alert" + data-test-subj="contextErrorMessageTitle" + > + + {status.reason === FailureReason.UNKNOWN && ( - } - color="danger" - iconType="alert" - data-test-subj="contextErrorMessageTitle" - > - - {status.reason === FailureReason.UNKNOWN && ( - - )} - - - + )} + + ); } diff --git a/src/plugins/discover/public/application/apps/context/context_app.tsx b/src/plugins/discover/public/application/apps/context/context_app.tsx index 6198ced1550bb..070391edae71c 100644 --- a/src/plugins/discover/public/application/apps/context/context_app.tsx +++ b/src/plugins/discover/public/application/apps/context/context_app.tsx @@ -9,7 +9,7 @@ import React, { Fragment, memo, useEffect, useRef, useMemo, useCallback } from 'react'; import './context_app.scss'; import classNames from 'classnames'; -import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n/react'; import { EuiText, EuiPageContent, EuiPage, EuiSpacer } from '@elastic/eui'; import { cloneDeep } from 'lodash'; import { esFilters, SortDirection } from '../../../../../data/public'; @@ -138,7 +138,7 @@ export const ContextApp = ({ indexPattern, indexPatternId, anchorId }: ContextAp }; return ( - + {fetchedState.anchorStatus.value === LoadingStatus.FAILED ? ( ) : ( @@ -182,6 +182,6 @@ export const ContextApp = ({ indexPattern, indexPatternId, anchorId }: ContextAp )} - + ); }; diff --git a/src/plugins/discover/public/application/apps/context/services/context.predecessors.test.ts b/src/plugins/discover/public/application/apps/context/services/context.predecessors.test.ts index a503715f4b5e2..6fad858488c4e 100644 --- a/src/plugins/discover/public/application/apps/context/services/context.predecessors.test.ts +++ b/src/plugins/discover/public/application/apps/context/services/context.predecessors.test.ts @@ -8,9 +8,10 @@ import moment from 'moment'; import { get, last } from 'lodash'; +import { SortDirection } from 'src/plugins/data/common'; import { createIndexPatternsStub, createContextSearchSourceStub } from './_stubs'; import { fetchContextProvider, SurrDocType } from './context'; -import { setServices, SortDirection } from '../../../../kibana_services'; +import { setServices } from '../../../../kibana_services'; import { Query } from '../../../../../../data/public'; import { DiscoverServices } from '../../../../build_services'; import { EsHitRecord, EsHitRecordList } from '../../../types'; diff --git a/src/plugins/discover/public/application/apps/context/services/context.successors.test.ts b/src/plugins/discover/public/application/apps/context/services/context.successors.test.ts index fcd1bad487c4e..6c44f0aa3f7b5 100644 --- a/src/plugins/discover/public/application/apps/context/services/context.successors.test.ts +++ b/src/plugins/discover/public/application/apps/context/services/context.successors.test.ts @@ -8,9 +8,9 @@ import moment from 'moment'; import { get, last } from 'lodash'; - +import { SortDirection } from 'src/plugins/data/common'; import { createIndexPatternsStub, createContextSearchSourceStub } from './_stubs'; -import { setServices, SortDirection } from '../../../../kibana_services'; +import { setServices } from '../../../../kibana_services'; import { Query } from '../../../../../../data/public'; import { fetchContextProvider, SurrDocType } from './context'; import { DiscoverServices } from '../../../../build_services'; diff --git a/src/plugins/discover/public/application/apps/context/services/utils/get_es_query_sort.ts b/src/plugins/discover/public/application/apps/context/services/utils/get_es_query_sort.ts index 2144d2f1cd7fd..955ae983d2caa 100644 --- a/src/plugins/discover/public/application/apps/context/services/utils/get_es_query_sort.ts +++ b/src/plugins/discover/public/application/apps/context/services/utils/get_es_query_sort.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { EsQuerySortValue, SortDirection } from '../../../../../kibana_services'; +import type { EsQuerySortValue, SortDirection } from 'src/plugins/data/common'; /** * Returns `EsQuerySort` which is used to sort records in the ES query diff --git a/src/plugins/discover/public/application/apps/context/services/utils/sorting.ts b/src/plugins/discover/public/application/apps/context/services/utils/sorting.ts index c6f389ddca46a..c8ce787707cab 100644 --- a/src/plugins/discover/public/application/apps/context/services/utils/sorting.ts +++ b/src/plugins/discover/public/application/apps/context/services/utils/sorting.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { IndexPattern } from '../../../../../kibana_services'; +import type { IndexPattern } from 'src/plugins/data/common'; export enum SortDirection { asc = 'asc', diff --git a/src/plugins/discover/public/application/apps/doc/components/doc.tsx b/src/plugins/discover/public/application/apps/doc/components/doc.tsx index b184a1cfd238c..f33ffe561e490 100644 --- a/src/plugins/discover/public/application/apps/doc/components/doc.tsx +++ b/src/plugins/discover/public/application/apps/doc/components/doc.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n/react'; import { EuiCallOut, EuiLink, EuiLoadingSpinner, EuiPageContent, EuiPage } from '@elastic/eui'; import { IndexPatternsContract } from 'src/plugins/data/public'; import { getServices } from '../../../../kibana_services'; @@ -43,82 +43,80 @@ export function Doc(props: DocProps) { const [reqState, hit, indexPattern] = useEsDocSearch(props); const indexExistsLink = getServices().docLinks.links.apis.indexExists; return ( - - - - {reqState === ElasticRequestState.NotFoundIndexPattern && ( - - } - /> - )} - {reqState === ElasticRequestState.NotFound && ( - - } - > + + + {reqState === ElasticRequestState.NotFoundIndexPattern && ( + + } + /> + )} + {reqState === ElasticRequestState.NotFound && ( + - - )} + } + > + + + )} - {reqState === ElasticRequestState.Error && ( - - } - > + {reqState === ElasticRequestState.Error && ( + {' '} - - - - - )} + id="discover.doc.failedToExecuteQueryDescription" + defaultMessage="Cannot run search" + /> + } + > + {' '} + + + + + )} - {reqState === ElasticRequestState.Loading && ( - - {' '} - - - )} + {reqState === ElasticRequestState.Loading && ( + + {' '} + + + )} - {reqState === ElasticRequestState.Found && hit !== null && indexPattern && ( -
- -
- )} -
-
-
+ {reqState === ElasticRequestState.Found && hit !== null && indexPattern && ( +
+ +
+ )} + + ); } diff --git a/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.test.tsx b/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.test.tsx index dc3c9ebbc75ca..732dee6106b36 100644 --- a/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.test.tsx @@ -96,7 +96,7 @@ function getProps(timefield?: string) { }) as DataCharts$; return { - resetQuery: jest.fn(), + resetSavedSearch: jest.fn(), savedSearch: savedSearchMock, savedSearchDataChart$: charts$, savedSearchDataTotalHits$: totalHits$, diff --git a/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.tsx b/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.tsx index 7d761aa93b808..2a4e4a06b6120 100644 --- a/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.tsx +++ b/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.tsx @@ -21,7 +21,7 @@ import { DiscoverServices } from '../../../../../build_services'; const TimechartHeaderMemoized = memo(TimechartHeader); const DiscoverHistogramMemoized = memo(DiscoverHistogram); export function DiscoverChart({ - resetQuery, + resetSavedSearch, savedSearch, savedSearchDataChart$, savedSearchDataTotalHits$, @@ -30,7 +30,7 @@ export function DiscoverChart({ stateContainer, timefield, }: { - resetQuery: () => void; + resetSavedSearch: () => void; savedSearch: SavedSearch; savedSearchDataChart$: DataCharts$; savedSearchDataTotalHits$: DataTotalHits$; @@ -88,7 +88,7 @@ export function DiscoverChart({ {!state.hideChart && ( diff --git a/src/plugins/discover/public/application/apps/main/components/chart/histogram.tsx b/src/plugins/discover/public/application/apps/main/components/chart/histogram.tsx index df63c4c94ae86..bfb4cd1380766 100644 --- a/src/plugins/discover/public/application/apps/main/components/chart/histogram.tsx +++ b/src/plugins/discover/public/application/apps/main/components/chart/histogram.tsx @@ -159,6 +159,7 @@ export function DiscoverHistogram({ tooltip={tooltipProps} theme={chartTheme} baseTheme={chartBaseTheme} + allowBrushingLastHistogramBucket={true} /> @@ -65,11 +65,11 @@ exports[`Doc table cell component renders a cell with filter buttons if it is fi className="kbnDocTableCell__filterButton" content="Filter out value" delay="regular" + display="inlineBlock" position="bottom" > diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_embeddable.tsx b/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_embeddable.tsx index 04902af692b74..c01f661eb116a 100644 --- a/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_embeddable.tsx +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_embeddable.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import React, { memo, useCallback, useMemo } from 'react'; +import React, { memo, useCallback, useEffect, useMemo, useRef } from 'react'; import './index.scss'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; @@ -24,30 +24,61 @@ export interface DocTableEmbeddableProps extends DocTableProps { const DocTableWrapperMemoized = memo(DocTableWrapper); export const DocTableEmbeddable = (props: DocTableEmbeddableProps) => { - const pager = usePager({ totalItems: props.rows.length }); + const tableWrapperRef = useRef(null); + const { + currentPage, + pageSize, + totalPages, + startIndex, + hasNextPage, + changePage, + changePageSize, + } = usePager({ + totalItems: props.rows.length, + }); + const showPagination = totalPages !== 0; - const pageOfItems = useMemo( - () => props.rows.slice(pager.startIndex, pager.pageSize + pager.startIndex), - [pager.pageSize, pager.startIndex, props.rows] - ); + const scrollTop = useCallback(() => { + if (tableWrapperRef.current) { + tableWrapperRef.current.scrollTo(0, 0); + } + }, []); + + const pageOfItems = useMemo(() => props.rows.slice(startIndex, pageSize + startIndex), [ + pageSize, + startIndex, + props.rows, + ]); - const shouldShowLimitedResultsWarning = () => - !pager.hasNextPage && props.rows.length < props.totalHitCount; + const onPageChange = useCallback( + (page: number) => { + scrollTop(); + changePage(page); + }, + [changePage, scrollTop] + ); - const scrollTop = () => { - const scrollDiv = document.querySelector('.kbnDocTableWrapper') as HTMLElement; - scrollDiv.scrollTo(0, 0); - }; + const onPageSizeChange = useCallback( + (size: number) => { + scrollTop(); + changePageSize(size); + }, + [changePageSize, scrollTop] + ); - const onPageChange = (page: number) => { - scrollTop(); - pager.onPageChange(page); - }; + /** + * Go to the first page if the current is no longer available + */ + useEffect(() => { + if (totalPages < currentPage + 1) { + onPageChange(0); + } + }, [currentPage, totalPages, onPageChange]); - const onPageSizeChange = (size: number) => { - scrollTop(); - pager.onPageSizeChange(size); - }; + const shouldShowLimitedResultsWarning = useMemo( + () => !hasNextPage && props.rows.length < props.totalHitCount, + [hasNextPage, props.rows.length, props.totalHitCount] + ); const sampleSize = useMemo(() => { return getServices().uiSettings.get(SAMPLE_SIZE_SETTING, 500); @@ -77,7 +108,7 @@ export const DocTableEmbeddable = (props: DocTableEmbeddableProps) => { responsive={false} wrap={true} > - {shouldShowLimitedResultsWarning() && ( + {shouldShowLimitedResultsWarning && ( { - + - - - + {showPagination && ( + + + + )} ); }; diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_infinite.tsx b/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_infinite.tsx index 778c6c1abe274..dddfefa906962 100644 --- a/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_infinite.tsx +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_infinite.tsx @@ -6,41 +6,101 @@ * Side Public License, v 1. */ -import React, { Fragment, memo, useCallback, useEffect, useState } from 'react'; +import React, { Fragment, memo, useCallback, useEffect, useRef, useState } from 'react'; import './index.scss'; import { FormattedMessage } from '@kbn/i18n/react'; import { debounce } from 'lodash'; import { EuiButtonEmpty } from '@elastic/eui'; import { DocTableProps, DocTableRenderProps, DocTableWrapper } from './doc_table_wrapper'; import { SkipBottomButton } from '../skip_bottom_button'; +import { shouldLoadNextDocPatch } from './lib/should_load_next_doc_patch'; const FOOTER_PADDING = { padding: 0 }; -const DocTableInfiniteContent = (props: DocTableRenderProps) => { - const [limit, setLimit] = useState(props.minimumVisibleRows); +const DocTableWrapperMemoized = memo(DocTableWrapper); - // Reset infinite scroll limit - useEffect(() => { - setLimit(props.minimumVisibleRows); - }, [props.rows, props.minimumVisibleRows]); +interface DocTableInfiniteContentProps extends DocTableRenderProps { + limit: number; + onSetMaxLimit: () => void; + onBackToTop: () => void; +} + +const DocTableInfiniteContent = ({ + rows, + columnLength, + sampleSize, + limit, + onSkipBottomButtonClick, + renderHeader, + renderRows, + onSetMaxLimit, + onBackToTop, +}: DocTableInfiniteContentProps) => { + const onSkipBottomButton = useCallback(() => { + onSetMaxLimit(); + onSkipBottomButtonClick(); + }, [onSetMaxLimit, onSkipBottomButtonClick]); + + return ( + + + + {renderHeader()} + {renderRows(rows.slice(0, limit))} + + + + + +
+ {rows.length === sampleSize ? ( +
+ + + + +
+ ) : ( + + ​ + + )} +
+
+ ); +}; + +export const DocTableInfinite = (props: DocTableProps) => { + const tableWrapperRef = useRef(null); + const [limit, setLimit] = useState(50); /** * depending on which version of Discover is displayed, different elements are scrolling * and have therefore to be considered for calculation of infinite scrolling */ useEffect(() => { - const scrollDiv = document.querySelector('.kbnDocTableWrapper') as HTMLElement; + // After mounting table wrapper should be initialized + const scrollDiv = tableWrapperRef.current as HTMLDivElement; const scrollMobileElem = document.documentElement; const scheduleCheck = debounce(() => { const isMobileView = document.getElementsByClassName('dscSidebar__mobile').length > 0; - const usedScrollDiv = isMobileView ? scrollMobileElem : scrollDiv; - const scrollusedHeight = usedScrollDiv.scrollHeight; - const scrollTop = Math.abs(usedScrollDiv.scrollTop); - const clientHeight = usedScrollDiv.clientHeight; - - if (scrollTop + clientHeight === scrollusedHeight) { + const usedScrollDiv = isMobileView ? scrollMobileElem : scrollDiv; + if (shouldLoadNextDocPatch(usedScrollDiv)) { setLimit((prevLimit) => prevLimit + 50); } }, 50); @@ -62,63 +122,26 @@ const DocTableInfiniteContent = (props: DocTableRenderProps) => { focusElem.focus(); // Only the desktop one needs to target a specific container - if (!isMobileView) { - const scrollDiv = document.querySelector('.kbnDocTableWrapper') as HTMLElement; - scrollDiv.scrollTo(0, 0); + if (!isMobileView && tableWrapperRef.current) { + tableWrapperRef.current.scrollTo(0, 0); } else if (window) { window.scrollTo(0, 0); } }, []); - return ( - - - - {props.renderHeader()} - {props.renderRows(props.rows.slice(0, limit))} - - - - - -
- {props.rows.length === props.sampleSize ? ( -
- - - - -
- ) : ( - - ​ - - )} -
-
+ const setMaxLimit = useCallback(() => setLimit(props.rows.length), [props.rows.length]); + + const renderDocTable = useCallback( + (tableProps: DocTableRenderProps) => ( + + ), + [limit, onBackToTop, setMaxLimit] ); -}; -const DocTableWrapperMemoized = memo(DocTableWrapper); -const DocTableInfiniteContentMemoized = memo(DocTableInfiniteContent); - -const renderDocTable = (tableProps: DocTableRenderProps) => ( - -); - -export const DocTableInfinite = (props: DocTableProps) => { - return ; + return ; }; diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx b/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx index 086750ed4d359..2fac1c828796d 100644 --- a/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx @@ -6,8 +6,9 @@ * Side Public License, v 1. */ -import React, { useCallback, useMemo, useState } from 'react'; +import React, { forwardRef, useCallback, useMemo } from 'react'; import { EuiIcon, EuiSpacer, EuiText } from '@elastic/eui'; +import type { IndexPattern, IndexPatternField } from 'src/plugins/data/common'; import { FormattedMessage } from '@kbn/i18n/react'; import { TableHeader } from './components/table_header/table_header'; import { FORMATS_UI_SETTINGS } from '../../../../../../../field_formats/common'; @@ -17,7 +18,7 @@ import { SHOW_MULTIFIELDS, SORT_DEFAULT_ORDER_SETTING, } from '../../../../../../common'; -import { getServices, IndexPattern, IndexPatternField } from '../../../../../kibana_services'; +import { getServices } from '../../../../../kibana_services'; import { SortOrder } from './components/table_header/helpers'; import { DocTableRow, TableRow } from './components/table_row'; import { DocViewFilterFn } from '../../../../doc_views/doc_views_types'; @@ -85,7 +86,6 @@ export interface DocTableProps { export interface DocTableRenderProps { columnLength: number; rows: DocTableRow[]; - minimumVisibleRows: number; sampleSize: number; renderRows: (row: DocTableRow[]) => JSX.Element[]; renderHeader: () => JSX.Element; @@ -99,163 +99,166 @@ export interface DocTableWrapperProps extends DocTableProps { render: (params: DocTableRenderProps) => JSX.Element; } -export const DocTableWrapper = ({ - render, - columns, - rows, - indexPattern, - onSort, - onAddColumn, - onMoveColumn, - onRemoveColumn, - sort, - onFilter, - useNewFieldsApi, - searchDescription, - sharedItemTitle, - dataTestSubj, - isLoading, -}: DocTableWrapperProps) => { - const [minimumVisibleRows, setMinimumVisibleRows] = useState(50); - const [ - defaultSortOrder, - hideTimeColumn, - isShortDots, - sampleSize, - showMultiFields, - filterManager, - addBasePath, - ] = useMemo(() => { - const services = getServices(); - return [ - services.uiSettings.get(SORT_DEFAULT_ORDER_SETTING, 'desc'), - services.uiSettings.get(DOC_HIDE_TIME_COLUMN_SETTING, false), - services.uiSettings.get(FORMATS_UI_SETTINGS.SHORT_DOTS_ENABLE), - services.uiSettings.get(SAMPLE_SIZE_SETTING, 500), - services.uiSettings.get(SHOW_MULTIFIELDS, false), - services.filterManager, - services.addBasePath, - ]; - }, []); +const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); - const onSkipBottomButtonClick = useCallback(async () => { - // delay scrolling to after the rows have been rendered - const bottomMarker = document.getElementById('discoverBottomMarker'); - const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); - // show all the rows - setMinimumVisibleRows(rows.length); - - while (rows.length !== document.getElementsByClassName('kbnDocTable__row').length) { - await wait(50); - } - bottomMarker!.focus(); - await wait(50); - bottomMarker!.blur(); - }, [setMinimumVisibleRows, rows]); - - const fieldsToShow = useMemo( - () => - getFieldsToShow( - indexPattern.fields.map((field: IndexPatternField) => field.name), - indexPattern, - showMultiFields - ), - [indexPattern, showMultiFields] - ); - - const renderHeader = useCallback( - () => ( - - ), - [ +export const DocTableWrapper = forwardRef( + ( + { + render, columns, - defaultSortOrder, - hideTimeColumn, + rows, indexPattern, - isShortDots, + onSort, + onAddColumn, onMoveColumn, onRemoveColumn, - onSort, sort, - ] - ); - - const renderRows = useCallback( - (rowsToRender: DocTableRow[]) => { - return rowsToRender.map((current) => ( - - )); - }, - [ - columns, onFilter, - indexPattern, useNewFieldsApi, + searchDescription, + sharedItemTitle, + dataTestSubj, + isLoading, + }: DocTableWrapperProps, + ref + ) => { + const [ + defaultSortOrder, hideTimeColumn, - onAddColumn, - onRemoveColumn, + isShortDots, + sampleSize, + showMultiFields, filterManager, addBasePath, - fieldsToShow, - ] - ); + ] = useMemo(() => { + const services = getServices(); + return [ + services.uiSettings.get(SORT_DEFAULT_ORDER_SETTING, 'desc'), + services.uiSettings.get(DOC_HIDE_TIME_COLUMN_SETTING, false), + services.uiSettings.get(FORMATS_UI_SETTINGS.SHORT_DOTS_ENABLE), + services.uiSettings.get(SAMPLE_SIZE_SETTING, 500), + services.uiSettings.get(SHOW_MULTIFIELDS, false), + services.filterManager, + services.addBasePath, + ]; + }, []); + + const onSkipBottomButtonClick = useCallback(async () => { + // delay scrolling to after the rows have been rendered + const bottomMarker = document.getElementById('discoverBottomMarker'); + + while (rows.length !== document.getElementsByClassName('kbnDocTable__row').length) { + await wait(50); + } + bottomMarker!.focus(); + await wait(50); + bottomMarker!.blur(); + }, [rows]); + + const fieldsToShow = useMemo( + () => + getFieldsToShow( + indexPattern.fields.map((field: IndexPatternField) => field.name), + indexPattern, + showMultiFields + ), + [indexPattern, showMultiFields] + ); + + const renderHeader = useCallback( + () => ( + + ), + [ + columns, + defaultSortOrder, + hideTimeColumn, + indexPattern, + isShortDots, + onMoveColumn, + onRemoveColumn, + onSort, + sort, + ] + ); + + const renderRows = useCallback( + (rowsToRender: DocTableRow[]) => { + return rowsToRender.map((current) => ( + + )); + }, + [ + columns, + onFilter, + indexPattern, + useNewFieldsApi, + hideTimeColumn, + onAddColumn, + onRemoveColumn, + filterManager, + addBasePath, + fieldsToShow, + ] + ); - return ( -
- {rows.length !== 0 && - render({ - columnLength: columns.length, - rows, - minimumVisibleRows, - sampleSize, - onSkipBottomButtonClick, - renderHeader, - renderRows, - })} - {!rows.length && ( -
- - - - - -
- )} -
- ); -}; + return ( +
} + > + {rows.length !== 0 && + render({ + columnLength: columns.length, + rows, + sampleSize, + onSkipBottomButtonClick, + renderHeader, + renderRows, + })} + {!rows.length && ( +
+ + + + + +
+ )} +
+ ); + } +); diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_default_sort.ts b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_default_sort.ts index e01ff0b00e2b0..2705140988148 100644 --- a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_default_sort.ts +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_default_sort.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { IndexPattern } from '../../../../../../kibana_services'; +import type { IndexPattern } from 'src/plugins/data/common'; import { isSortable } from './get_sort'; import { SortOrder } from '../components/table_header/helpers'; diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts index 2c687a59ea291..1e597f85666fc 100644 --- a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import _ from 'lodash'; +import { isPlainObject } from 'lodash'; import { IndexPattern } from '../../../../../../../../data/public'; export type SortPairObj = Record; @@ -30,7 +30,7 @@ function createSortObject( ) { const [field, direction] = sortPair as SortPairArr; return { [field]: direction }; - } else if (_.isPlainObject(sortPair) && isSortable(Object.keys(sortPair)[0], indexPattern)) { + } else if (isPlainObject(sortPair) && isSortable(Object.keys(sortPair)[0], indexPattern)) { return sortPair as SortPairObj; } } diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort_for_search_source.ts b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort_for_search_source.ts index 2bc8a71301df9..de862fdcd29f2 100644 --- a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort_for_search_source.ts +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/get_sort_for_search_source.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { EsQuerySortValue, IndexPattern } from '../../../../../../kibana_services'; +import type { EsQuerySortValue, IndexPattern } from 'src/plugins/data/common'; import { SortOrder } from '../components/table_header/helpers'; import { getSort } from './get_sort'; diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.scss b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.scss new file mode 100644 index 0000000000000..ede39feed30b6 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.scss @@ -0,0 +1,7 @@ +// Special handling for images coming from the image field formatter +// See discover_grid.scss for more explanation on those values +.rowFormatter__value img { + vertical-align: middle; + max-height: lineHeightFromBaseline(2) !important; + max-width: ($euiSizeXXL * 12.5) !important; +} diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.test.ts b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.test.ts index 5874be19b0b74..c15c02264759c 100644 --- a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.test.ts +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.test.ts @@ -8,7 +8,7 @@ import ReactDOM from 'react-dom/server'; import { formatRow, formatTopLevelObject } from './row_formatter'; -import { IndexPattern } from '../../../../../../../../data/common/index_patterns/index_patterns'; +import { IndexPattern } from '../../../../../../../../data/common'; import { fieldFormatsMock } from '../../../../../../../../field_formats/common/mocks'; import { setServices } from '../../../../../../kibana_services'; import { DiscoverServices } from '../../../../../../build_services'; diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.tsx b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.tsx index b85544bd84cde..14cf1839107e7 100644 --- a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.tsx +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/row_formatter.tsx @@ -7,8 +7,11 @@ */ import React, { Fragment } from 'react'; +import type { IndexPattern } from 'src/plugins/data/common'; import { MAX_DOC_FIELDS_DISPLAYED } from '../../../../../../../common'; -import { getServices, IndexPattern } from '../../../../../../kibana_services'; +import { getServices } from '../../../../../../kibana_services'; + +import './row_formatter.scss'; interface Props { defPairs: Array<[string, unknown]>; @@ -20,6 +23,7 @@ const TemplateComponent = ({ defPairs }: Props) => {
{pair[0]}:
{' '} @@ -72,7 +76,7 @@ export const formatTopLevelObject = ( const displayKey = fields.getByName ? fields.getByName(key)?.displayName : undefined; const formatter = field ? indexPattern.getFormatterForField(field) - : { convert: (v: string, ...rest: unknown[]) => String(v) }; + : { convert: (v: unknown, ...rest: unknown[]) => String(v) }; if (!values.map) return; const formatted = values .map((val: unknown) => diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/should_load_next_doc_patch.test.ts b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/should_load_next_doc_patch.test.ts new file mode 100644 index 0000000000000..ea6dd4f9b3e31 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/should_load_next_doc_patch.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { shouldLoadNextDocPatch } from './should_load_next_doc_patch'; + +describe('shouldLoadNextDocPatch', () => { + test('next patch should not be loaded', () => { + const scrollingDomEl = { + scrollHeight: 500, + scrollTop: 100, + clientHeight: 100, + } as HTMLElement; + + expect(shouldLoadNextDocPatch(scrollingDomEl)).toBeFalsy(); + }); + + test('next patch should be loaded', () => { + const scrollingDomEl = { + scrollHeight: 500, + scrollTop: 350, + clientHeight: 100, + } as HTMLElement; + + expect(shouldLoadNextDocPatch(scrollingDomEl)).toBeTruthy(); + }); + + test("next patch should be loaded even there's a decimal scroll height", () => { + const scrollingDomEl = { + scrollHeight: 500, + scrollTop: 350.34234234, + clientHeight: 100, + } as HTMLElement; + + expect(shouldLoadNextDocPatch(scrollingDomEl)).toBeTruthy(); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/should_load_next_doc_patch.ts b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/should_load_next_doc_patch.ts new file mode 100644 index 0000000000000..5834b6808fac1 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/should_load_next_doc_patch.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. + */ + +// use a buffer to start rendering more documents before the user completely scrolles down +const verticalScrollBuffer = 100; + +/** + * Helper function to determine if the next patch of 50 documents should be loaded + */ +export function shouldLoadNextDocPatch(domEl: HTMLElement) { + // the height of the scrolling div, including content not visible on the screen due to overflow. + const scrollHeight = domEl.scrollHeight; + // the number of pixels that the div is is scrolled vertically + const scrollTop = domEl.scrollTop; + // the inner height of the scrolling div, excluding content that's visible on the screen + const clientHeight = domEl.clientHeight; + + const consumedHeight = scrollTop + clientHeight; + const remainingHeight = scrollHeight - consumedHeight; + return remainingHeight < verticalScrollBuffer; +} diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/use_pager.test.tsx b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/use_pager.test.tsx new file mode 100644 index 0000000000000..e94600b5d1725 --- /dev/null +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/use_pager.test.tsx @@ -0,0 +1,75 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { act, renderHook } from '@testing-library/react-hooks'; +import { usePager } from './use_pager'; + +describe('usePager', () => { + const defaultProps = { + totalItems: 745, + }; + + test('should initialize the first page', () => { + const { result } = renderHook(() => { + return usePager(defaultProps); + }); + + expect(result.current.currentPage).toEqual(0); + expect(result.current.pageSize).toEqual(50); + expect(result.current.totalPages).toEqual(15); + expect(result.current.startIndex).toEqual(0); + expect(result.current.hasNextPage).toEqual(true); + }); + + test('should change the page', () => { + const { result } = renderHook(() => { + return usePager(defaultProps); + }); + + act(() => { + result.current.changePage(5); + }); + + expect(result.current.currentPage).toEqual(5); + expect(result.current.pageSize).toEqual(50); + expect(result.current.totalPages).toEqual(15); + expect(result.current.startIndex).toEqual(250); + expect(result.current.hasNextPage).toEqual(true); + }); + + test('should go to the last page', () => { + const { result } = renderHook(() => { + return usePager(defaultProps); + }); + + act(() => { + result.current.changePage(15); + }); + + expect(result.current.currentPage).toEqual(15); + expect(result.current.pageSize).toEqual(50); + expect(result.current.totalPages).toEqual(15); + expect(result.current.startIndex).toEqual(750); + expect(result.current.hasNextPage).toEqual(false); + }); + + test('should change page size and stay on the current page', () => { + const { result } = renderHook(() => usePager(defaultProps)); + + act(() => { + result.current.changePage(5); + result.current.changePageSize(100); + }); + + expect(result.current.currentPage).toEqual(5); + expect(result.current.pageSize).toEqual(100); + expect(result.current.totalPages).toEqual(8); + expect(result.current.startIndex).toEqual(500); + expect(result.current.hasNextPage).toEqual(true); + }); +}); diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/use_pager.ts b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/use_pager.ts index 5522e3c150213..d21941b8360eb 100644 --- a/src/plugins/discover/public/application/apps/main/components/doc_table/lib/use_pager.ts +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/lib/use_pager.ts @@ -6,73 +6,38 @@ * Side Public License, v 1. */ -import { useCallback, useEffect, useState } from 'react'; +import { useCallback, useMemo, useState } from 'react'; interface MetaParams { - currentPage: number; - totalItems: number; totalPages: number; startIndex: number; hasNextPage: boolean; - pageSize: number; -} - -interface ProvidedMeta { - updatedPageSize?: number; - updatedCurrentPage?: number; } const INITIAL_PAGE_SIZE = 50; export const usePager = ({ totalItems }: { totalItems: number }) => { - const [meta, setMeta] = useState({ - currentPage: 0, - totalItems, - startIndex: 0, - totalPages: Math.ceil(totalItems / INITIAL_PAGE_SIZE), - hasNextPage: true, - pageSize: INITIAL_PAGE_SIZE, - }); - - const getNewMeta = useCallback( - (newMeta: ProvidedMeta) => { - const actualCurrentPage = newMeta.updatedCurrentPage ?? meta.currentPage; - const actualPageSize = newMeta.updatedPageSize ?? meta.pageSize; - - const newTotalPages = Math.ceil(totalItems / actualPageSize); - const newStartIndex = actualPageSize * actualCurrentPage; - - return { - currentPage: actualCurrentPage, - totalPages: newTotalPages, - startIndex: newStartIndex, - totalItems, - hasNextPage: meta.currentPage + 1 < meta.totalPages, - pageSize: actualPageSize, - }; - }, - [meta.currentPage, meta.pageSize, meta.totalPages, totalItems] - ); + const [pageSize, setPageSize] = useState(INITIAL_PAGE_SIZE); + const [currentPage, setCurrentPage] = useState(0); - const onPageChange = useCallback( - (pageIndex: number) => setMeta(getNewMeta({ updatedCurrentPage: pageIndex })), - [getNewMeta] - ); + const meta: MetaParams = useMemo(() => { + const totalPages = Math.ceil(totalItems / pageSize); + return { + totalPages, + startIndex: pageSize * currentPage, + hasNextPage: currentPage + 1 < totalPages, + }; + }, [currentPage, pageSize, totalItems]); - const onPageSizeChange = useCallback( - (newPageSize: number) => - setMeta(getNewMeta({ updatedPageSize: newPageSize, updatedCurrentPage: 0 })), - [getNewMeta] - ); + const changePage = useCallback((pageIndex: number) => setCurrentPage(pageIndex), []); - /** - * Update meta on totalItems change - */ - useEffect(() => setMeta(getNewMeta({})), [getNewMeta, totalItems]); + const changePageSize = useCallback((newPageSize: number) => setPageSize(newPageSize), []); return { ...meta, - onPageChange, - onPageSizeChange, + currentPage, + pageSize, + changePage, + changePageSize, }; }; diff --git a/src/plugins/discover/public/application/apps/main/components/layout/discover_layout.test.tsx b/src/plugins/discover/public/application/apps/main/components/layout/discover_layout.test.tsx index 7343760f32d13..79dfc9b77f90b 100644 --- a/src/plugins/discover/public/application/apps/main/components/layout/discover_layout.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/layout/discover_layout.test.tsx @@ -135,7 +135,7 @@ function getProps(indexPattern: IndexPattern): DiscoverLayoutProps { navigateTo: jest.fn(), onChangeIndexPattern: jest.fn(), onUpdateQuery: jest.fn(), - resetQuery: jest.fn(), + resetSavedSearch: jest.fn(), savedSearch: savedSearchMock, savedSearchData$, savedSearchRefetch$: new Subject(), diff --git a/src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx b/src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx index 6d241468bdf74..7e3d7ff10b3a6 100644 --- a/src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx +++ b/src/plugins/discover/public/application/apps/main/components/layout/discover_layout.tsx @@ -20,7 +20,6 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { METRIC_TYPE } from '@kbn/analytics'; -import { I18nProvider } from '@kbn/i18n/react'; import classNames from 'classnames'; import { DiscoverNoResults } from '../no_results'; import { LoadingSpinner } from '../loading_spinner/loading_spinner'; @@ -57,7 +56,7 @@ export function DiscoverLayout({ onChangeIndexPattern, onUpdateQuery, savedSearchRefetch$, - resetQuery, + resetSavedSearch, savedSearchData$, savedSearch, searchSource, @@ -152,130 +151,129 @@ export function DiscoverLayout({ const contentCentered = resultState === 'uninitialized' || resultState === 'none'; return ( - - - - -

- {savedSearch.title} -

- + + + +

+ {savedSearch.title} +

+ + + + + - +
+ + setIsSidebarClosed(!isSidebarClosed)} + data-test-subj="collapseSideBarButton" + aria-controls="discover-sidebar" + aria-expanded={isSidebarClosed ? 'false' : 'true'} + aria-label={i18n.translate('discover.toggleSidebarAriaLabel', { + defaultMessage: 'Toggle sidebar', + })} + /> +
- - -
- - setIsSidebarClosed(!isSidebarClosed)} - data-test-subj="collapseSideBarButton" - aria-controls="discover-sidebar" - aria-expanded={isSidebarClosed ? 'false' : 'true'} - aria-label={i18n.translate('discover.toggleSidebarAriaLabel', { - defaultMessage: 'Toggle sidebar', - })} - /> -
-
-
- - - {resultState === 'none' && ( - !f.meta.disabled).length > 0 - } - onDisableFilters={onDisableFilters} - /> - )} - {resultState === 'uninitialized' && ( - savedSearchRefetch$.next()} /> - )} - {resultState === 'loading' && } - {resultState === 'ready' && ( - - - - - - - + + + {resultState === 'none' && ( + !f.meta.disabled).length > 0 + } + onDisableFilters={onDisableFilters} + /> + )} + {resultState === 'uninitialized' && ( + savedSearchRefetch$.next()} /> + )} + {resultState === 'loading' && } + {resultState === 'ready' && ( + + + - - )} - - - -
-
-
+ + + + + + )} + + + + + ); } diff --git a/src/plugins/discover/public/application/apps/main/components/layout/types.ts b/src/plugins/discover/public/application/apps/main/components/layout/types.ts index 03d4471db94b6..e4a780cadceae 100644 --- a/src/plugins/discover/public/application/apps/main/components/layout/types.ts +++ b/src/plugins/discover/public/application/apps/main/components/layout/types.ts @@ -27,7 +27,7 @@ export interface DiscoverLayoutProps { navigateTo: (url: string) => void; onChangeIndexPattern: (id: string) => void; onUpdateQuery: (payload: { dateRange: TimeRange; query?: Query }, isUpdate?: boolean) => void; - resetQuery: () => void; + resetSavedSearch: () => void; savedSearch: SavedSearch; savedSearchData$: SavedSearchData; savedSearchRefetch$: DataRefetch$; diff --git a/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_search.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_search.tsx index 12b19300ce266..4ab19a6ab05ef 100644 --- a/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_search.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_field_search.tsx @@ -230,8 +230,8 @@ export function DiscoverFieldSearch({ onChange, value, types }: Props) { return ( 1, component offers a "change" link @@ -55,23 +54,21 @@ export function DiscoverIndexPattern({ } return ( - - { - const indexPattern = options.find((pattern) => pattern.id === id); - if (indexPattern) { - onChangeIndexPattern(id); - setSelected(indexPattern); - } - }} - /> - + { + const indexPattern = options.find((pattern) => pattern.id === id); + if (indexPattern) { + onChangeIndexPattern(id); + setSelected(indexPattern); + } + }} + /> ); } diff --git a/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.tsx index 125172f47b7c4..644c673f0eff0 100644 --- a/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_index_pattern_management.tsx @@ -10,7 +10,7 @@ import React, { useState } from 'react'; import { EuiButtonIcon, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { DiscoverServices } from '../../../../../build_services'; -import { IndexPattern } from '../../../../../../../data/common/index_patterns/index_patterns'; +import { IndexPattern } from '../../../../../../../data/common'; export interface DiscoverIndexPatternManagementProps { /** diff --git a/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.test.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.test.tsx index a9781595d698e..988a434f913aa 100644 --- a/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.test.tsx @@ -18,7 +18,7 @@ import { DiscoverSidebarProps } from './discover_sidebar'; import { IndexPatternAttributes } from '../../../../../../../data/common'; import { SavedObject } from '../../../../../../../../core/types'; import { getDefaultFieldFilter } from './lib/field_filter'; -import { DiscoverSidebar } from './discover_sidebar'; +import { DiscoverSidebarComponent as DiscoverSidebar } from './discover_sidebar'; import { ElasticSearchHit } from '../../../../doc_views/doc_views_types'; import { discoverServiceMock as mockDiscoverServices } from '../../../../../__mocks__/services'; import { stubLogstashIndexPattern } from '../../../../../../../data/common/stubs'; diff --git a/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx index b42bb4fe09bf1..189620282f2f6 100644 --- a/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar.tsx @@ -8,7 +8,7 @@ import './discover_sidebar.scss'; import { throttle } from 'lodash'; -import React, { useCallback, useEffect, useState, useMemo, useRef } from 'react'; +import React, { useCallback, useEffect, useState, useMemo, useRef, memo } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiAccordion, @@ -69,14 +69,14 @@ export interface DiscoverSidebarProps extends Omit; + fieldCounts?: Record; /** * hits fetched from ES, displayed in the doc table */ - documents: ElasticSearchHit[]; + documents?: ElasticSearchHit[]; } -export function DiscoverSidebar({ +export function DiscoverSidebarComponent({ alwaysShowActionButtons = false, columns, fieldCounts, @@ -109,8 +109,10 @@ export function DiscoverSidebar({ const availableFieldsContainer = useRef(null); useEffect(() => { - const newFields = getIndexPatternFieldList(selectedIndexPattern, fieldCounts); - setFields(newFields); + if (documents) { + const newFields = getIndexPatternFieldList(selectedIndexPattern, fieldCounts); + setFields(newFields); + } }, [selectedIndexPattern, fieldCounts, documents]); const scrollDimensions = useResizeObserver(scrollContainer); @@ -265,7 +267,7 @@ export function DiscoverSidebar({ const filterChanged = useMemo(() => isEqual(fieldFilter, getDefaultFieldFilter()), [fieldFilter]); - if (!selectedIndexPattern || !fields) { + if (!selectedIndexPattern) { return null; } @@ -344,7 +346,7 @@ export function DiscoverSidebar({
{ - if (el && !el.dataset.dynamicScroll) { + if (documents && el && !el.dataset.dynamicScroll) { el.dataset.dynamicScroll = 'true'; setScrollContainer(el); } @@ -352,7 +354,7 @@ export function DiscoverSidebar({ onScroll={throttle(lazyScroll, 100)} className="eui-yScroll" > - {fields.length > 0 && ( + {Array.isArray(fields) && fields.length > 0 && (
{selectedFields && selectedFields.length > 0 && @@ -500,3 +502,5 @@ export function DiscoverSidebar({ ); } + +export const DiscoverSidebar = memo(DiscoverSidebarComponent); diff --git a/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx index 7533a54ade405..90a3d33ddbe67 100644 --- a/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/discover_sidebar_responsive.tsx @@ -114,6 +114,7 @@ export interface DiscoverSidebarResponsiveProps { * Mobile: Index pattern selector is visible and a button to trigger a flyout with all elements */ export function DiscoverSidebarResponsive(props: DiscoverSidebarResponsiveProps) { + const { selectedIndexPattern, onEditRuntimeField, useNewFieldsApi, onChangeIndexPattern } = props; const [fieldFilter, setFieldFilter] = useState(getDefaultFieldFilter()); const [isFlyoutVisible, setIsFlyoutVisible] = useState(false); /** @@ -125,7 +126,7 @@ export function DiscoverSidebarResponsive(props: DiscoverSidebarResponsiveProps) fieldCounts.current = calcFieldCounts( {}, props.documents$.getValue().result, - props.selectedIndexPattern + selectedIndexPattern ); } @@ -137,20 +138,20 @@ export function DiscoverSidebarResponsive(props: DiscoverSidebarResponsiveProps) fieldCounts.current = calcFieldCounts( next.result.length && fieldCounts.current ? fieldCounts.current : {}, next.result, - props.selectedIndexPattern! + selectedIndexPattern! ); } setDocumentState({ ...documentState, ...next }); } }); return () => subscription.unsubscribe(); - }, [props.documents$, props.selectedIndexPattern, documentState, setDocumentState]); + }, [props.documents$, selectedIndexPattern, documentState, setDocumentState]); useEffect(() => { // when index pattern changes fieldCounts needs to be cleaned up to prevent displaying // fields of the previous index pattern fieldCounts.current = {}; - }, [props.selectedIndexPattern]); + }, [selectedIndexPattern]); const closeFieldEditor = useRef<() => void | undefined>(); @@ -174,34 +175,44 @@ export function DiscoverSidebarResponsive(props: DiscoverSidebarResponsiveProps) setIsFlyoutVisible(false); }, []); - if (!props.selectedIndexPattern) { - return null; - } - const { indexPatternFieldEditor } = props.services; - const indexPatternFieldEditPermission = indexPatternFieldEditor?.userPermissions.editIndexPattern(); - const canEditIndexPatternField = !!indexPatternFieldEditPermission && props.useNewFieldsApi; - const editField = (fieldName?: string) => { - if (!canEditIndexPatternField || !props.selectedIndexPattern) { - return; - } - const ref = indexPatternFieldEditor.openEditor({ - ctx: { - indexPattern: props.selectedIndexPattern, - }, - fieldName, - onSave: async () => { - props.onEditRuntimeField(); - }, - }); - if (setFieldEditorRef) { - setFieldEditorRef(ref); - } - if (closeFlyout) { - closeFlyout(); - } - }; + const editField = useCallback( + (fieldName?: string) => { + const indexPatternFieldEditPermission = indexPatternFieldEditor?.userPermissions.editIndexPattern(); + const canEditIndexPatternField = !!indexPatternFieldEditPermission && useNewFieldsApi; + if (!canEditIndexPatternField || !selectedIndexPattern) { + return; + } + const ref = indexPatternFieldEditor.openEditor({ + ctx: { + indexPattern: selectedIndexPattern, + }, + fieldName, + onSave: async () => { + onEditRuntimeField(); + }, + }); + if (setFieldEditorRef) { + setFieldEditorRef(ref); + } + if (closeFlyout) { + closeFlyout(); + } + }, + [ + closeFlyout, + indexPatternFieldEditor, + selectedIndexPattern, + setFieldEditorRef, + onEditRuntimeField, + useNewFieldsApi, + ] + ); + + if (!selectedIndexPattern) { + return null; + } return ( <> @@ -209,7 +220,7 @@ export function DiscoverSidebarResponsive(props: DiscoverSidebarResponsiveProps) o.attributes.title)} /> @@ -296,7 +307,7 @@ export function DiscoverSidebarResponsive(props: DiscoverSidebarResponsiveProps)
indexPattern.flattenHit(hit)); + hits = each(cloneDeep(realHits), (hit) => indexPattern.flattenHit(hit)); }); it('Should return an array of values for _source fields', function () { @@ -131,11 +131,11 @@ describe('fieldCalculator', function () { ); expect(extensions).toBeInstanceOf(Array); expect( - _.filter(extensions, function (v) { + filter(extensions, function (v) { return v === 'html'; }).length ).toBe(8); - expect(_.uniq(_.clone(extensions)).sort()).toEqual(['gif', 'html', 'php', 'png']); + expect(uniq(clone(extensions)).sort()).toEqual(['gif', 'html', 'php', 'png']); }); it('Should return an array of values for core meta fields', function () { @@ -146,11 +146,11 @@ describe('fieldCalculator', function () { ); expect(types).toBeInstanceOf(Array); expect( - _.filter(types, function (v) { + filter(types, function (v) { return v === 'apache'; }).length ).toBe(18); - expect(_.uniq(_.clone(types)).sort()).toEqual(['apache', 'nginx']); + expect(uniq(clone(types)).sort()).toEqual(['apache', 'nginx']); }); }); @@ -158,7 +158,7 @@ describe('fieldCalculator', function () { let params: { hits: any; field: any; count: number; indexPattern: IndexPattern }; beforeEach(function () { params = { - hits: _.cloneDeep(realHits), + hits: cloneDeep(realHits), field: indexPattern.fields.getByName('extension'), count: 3, indexPattern, @@ -170,7 +170,7 @@ describe('fieldCalculator', function () { expect(extensions).toBeInstanceOf(Object); expect(extensions.buckets).toBeInstanceOf(Array); expect(extensions.buckets.length).toBe(3); - expect(_.map(extensions.buckets, 'value')).toEqual(['html', 'php', 'gif']); + expect(map(extensions.buckets, 'value')).toEqual(['html', 'php', 'gif']); expect(extensions.error).toBe(undefined); }); diff --git a/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts index ab991f2cfb656..cf7d9945a35e6 100644 --- a/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/get_details.ts @@ -13,11 +13,11 @@ import { ElasticSearchHit } from '../../../../../doc_views/doc_views_types'; export function getDetails( field: IndexPatternField, - hits: ElasticSearchHit[], + hits: ElasticSearchHit[] | undefined, columns: string[], indexPattern?: IndexPattern ) { - if (!indexPattern) { + if (!indexPattern || !hits) { return {}; } const details = { diff --git a/src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts index cd9f6b3cac4a5..4842f652eb730 100644 --- a/src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.test.ts @@ -8,7 +8,7 @@ import { groupFields } from './group_fields'; import { getDefaultFieldFilter } from './field_filter'; -import { IndexPatternField } from '../../../../../../../../data/common/index_patterns/fields'; +import { IndexPatternField } from '../../../../../../../../data/common'; const fields = [ { diff --git a/src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx index 2007d32fe84be..0a7b1aeacc47a 100644 --- a/src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx +++ b/src/plugins/discover/public/application/apps/main/components/sidebar/lib/group_fields.tsx @@ -22,7 +22,7 @@ export function groupFields( fields: IndexPatternField[] | null, columns: string[], popularLimit: number, - fieldCounts: Record, + fieldCounts: Record | undefined, fieldFilterState: FieldFilterState, useNewFieldsApi: boolean ): GroupedFields { diff --git a/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.test.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.test.tsx index 687532cd94f08..4b572f6e348b8 100644 --- a/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.test.tsx @@ -33,6 +33,7 @@ function getProps(savePermissions = true): DiscoverTopNavProps { updateQuery: jest.fn(), onOpenInspector: jest.fn(), searchSource: {} as ISearchSource, + resetSavedSearch: () => {}, }; } diff --git a/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.tsx index 9afda73401084..5e3e2dfd96954 100644 --- a/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/discover_topnav.tsx @@ -5,7 +5,8 @@ * 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 React, { useCallback, useMemo } from 'react'; +import { useHistory } from 'react-router-dom'; import { DiscoverLayoutProps } from '../layout/types'; import { getTopNavLinks } from './get_top_nav_links'; import { Query, TimeRange } from '../../../../../../../data/common/query'; @@ -21,6 +22,7 @@ export type DiscoverTopNavProps = Pick< savedQuery?: string; updateQuery: (payload: { dateRange: TimeRange; query?: Query }, isUpdate?: boolean) => void; stateContainer: GetStateReturn; + resetSavedSearch: () => void; }; export const DiscoverTopNav = ({ @@ -34,9 +36,23 @@ export const DiscoverTopNav = ({ navigateTo, savedSearch, services, + resetSavedSearch, }: DiscoverTopNavProps) => { + const history = useHistory(); const showDatePicker = useMemo(() => indexPattern.isTimeBased(), [indexPattern]); const { TopNavMenu } = services.navigation.ui; + + const onOpenSavedSearch = useCallback( + (newSavedSearchId: string) => { + if (savedSearch.id && savedSearch.id === newSavedSearchId) { + resetSavedSearch(); + } else { + history.push(`/view/${encodeURIComponent(newSavedSearchId)}`); + } + }, + [history, resetSavedSearch, savedSearch.id] + ); + const topNavMenu = useMemo( () => getTopNavLinks({ @@ -47,8 +63,18 @@ export const DiscoverTopNav = ({ state: stateContainer, onOpenInspector, searchSource, + onOpenSavedSearch, }), - [indexPattern, navigateTo, onOpenInspector, searchSource, stateContainer, savedSearch, services] + [ + indexPattern, + navigateTo, + savedSearch, + services, + stateContainer, + onOpenInspector, + searchSource, + onOpenSavedSearch, + ] ); const updateSavedQueryId = (newSavedQueryId: string | undefined) => { diff --git a/src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.test.ts b/src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.test.ts index 6a6fb8a44a5cf..fd918429b57da 100644 --- a/src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.test.ts +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.test.ts @@ -35,6 +35,7 @@ test('getTopNavLinks result', () => { services, state, searchSource: {} as ISearchSource, + onOpenSavedSearch: () => {}, }); expect(topNavLinks).toMatchInlineSnapshot(` Array [ diff --git a/src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.ts b/src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.ts index f19b30cda5f8a..58a7242974ba2 100644 --- a/src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.ts +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/get_top_nav_links.ts @@ -8,6 +8,7 @@ import { i18n } from '@kbn/i18n'; import moment from 'moment'; +import type { IndexPattern, ISearchSource } from 'src/plugins/data/common'; import { showOpenSearchPanel } from './show_open_search_panel'; import { getSharingData, showPublicUrlSwitch } from '../../utils/get_sharing_data'; import { unhashUrl } from '../../../../../../../kibana_utils/public'; @@ -15,7 +16,6 @@ import { DiscoverServices } from '../../../../../build_services'; import { SavedSearch } from '../../../../../saved_searches'; import { onSaveSearch } from './on_save_search'; import { GetStateReturn } from '../../services/discover_state'; -import { IndexPattern, ISearchSource } from '../../../../../kibana_services'; import { openOptionsPopover } from './open_options_popover'; /** @@ -29,6 +29,7 @@ export const getTopNavLinks = ({ state, onOpenInspector, searchSource, + onOpenSavedSearch, }: { indexPattern: IndexPattern; navigateTo: (url: string) => void; @@ -37,6 +38,7 @@ export const getTopNavLinks = ({ state: GetStateReturn; onOpenInspector: () => void; searchSource: ISearchSource; + onOpenSavedSearch: (id: string) => void; }) => { const options = { id: 'options', @@ -89,7 +91,7 @@ export const getTopNavLinks = ({ testId: 'discoverOpenButton', run: () => showOpenSearchPanel({ - makeUrl: (searchId) => `#/view/${encodeURIComponent(searchId)}`, + onOpenSavedSearch, I18nContext: services.core.i18n.Context, }), }; @@ -112,6 +114,7 @@ export const getTopNavLinks = ({ state.appStateContainer.getState(), services.uiSettings ); + services.share.toggleShareContextMenu({ anchorElement, allowEmbed: false, diff --git a/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx index c3d1df096c32f..c68b1ab7b844c 100644 --- a/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/on_save_search.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { SavedObjectSaveModal, showSaveModal } from '../../../../../../../saved_objects/public'; import { SavedSearch } from '../../../../../saved_searches'; -import { IndexPattern } from '../../../../../../../data/common/index_patterns/index_patterns'; +import { IndexPattern } from '../../../../../../../data/common'; import { DiscoverServices } from '../../../../../build_services'; import { GetStateReturn } from '../../services/discover_state'; import { setBreadcrumbsTitle } from '../../../../helpers/breadcrumbs'; diff --git a/src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.test.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.test.tsx index 5080d1d61c88a..dc5d3e81744db 100644 --- a/src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.test.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.test.tsx @@ -29,7 +29,9 @@ import { OpenSearchPanel } from './open_search_panel'; describe('OpenSearchPanel', () => { test('render', () => { - const component = shallow(); + const component = shallow( + + ); expect(component).toMatchSnapshot(); }); @@ -40,7 +42,9 @@ describe('OpenSearchPanel', () => { delete: false, }, }); - const component = shallow(); + const component = shallow( + + ); expect(component.find('[data-test-subj="manageSearches"]').exists()).toBe(false); }); }); diff --git a/src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.tsx index 31026a1e0ab59..1b34e6ffa0b9a 100644 --- a/src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/open_search_panel.tsx @@ -27,7 +27,7 @@ const SEARCH_OBJECT_TYPE = 'search'; interface OpenSearchPanelProps { onClose: () => void; - makeUrl: (id: string) => string; + onOpenSavedSearch: (id: string) => void; } export function OpenSearchPanel(props: OpenSearchPanelProps) { @@ -70,7 +70,7 @@ export function OpenSearchPanel(props: OpenSearchPanelProps) { }, ]} onChoose={(id) => { - window.location.assign(props.makeUrl(id)); + props.onOpenSavedSearch(id); props.onClose(); }} uiSettings={uiSettings} diff --git a/src/plugins/discover/public/application/apps/main/components/top_nav/show_open_search_panel.tsx b/src/plugins/discover/public/application/apps/main/components/top_nav/show_open_search_panel.tsx index bb306396c4ca5..1a9bfd7e30c57 100644 --- a/src/plugins/discover/public/application/apps/main/components/top_nav/show_open_search_panel.tsx +++ b/src/plugins/discover/public/application/apps/main/components/top_nav/show_open_search_panel.tsx @@ -14,11 +14,11 @@ import { OpenSearchPanel } from './open_search_panel'; let isOpen = false; export function showOpenSearchPanel({ - makeUrl, I18nContext, + onOpenSavedSearch, }: { - makeUrl: (path: string) => string; I18nContext: I18nStart['Context']; + onOpenSavedSearch: (id: string) => void; }) { if (isOpen) { return; @@ -35,7 +35,7 @@ export function showOpenSearchPanel({ document.body.appendChild(container); const element = ( - + ); ReactDOM.render(element, container); diff --git a/src/plugins/discover/public/application/apps/main/components/uninitialized/uninitialized.tsx b/src/plugins/discover/public/application/apps/main/components/uninitialized/uninitialized.tsx index c6be5e6028bdd..c9e0c43900ba1 100644 --- a/src/plugins/discover/public/application/apps/main/components/uninitialized/uninitialized.tsx +++ b/src/plugins/discover/public/application/apps/main/components/uninitialized/uninitialized.tsx @@ -7,8 +7,7 @@ */ import React from 'react'; -import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; - +import { FormattedMessage } from '@kbn/i18n/react'; import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; interface Props { @@ -17,31 +16,29 @@ interface Props { export const DiscoverUninitialized = ({ onRefresh }: Props) => { return ( - - - - - } - body={ -

- -

- } - actions={ - - - - } - /> -
+ + + + } + body={ +

+ +

+ } + actions={ + + + + } + /> ); }; diff --git a/src/plugins/discover/public/application/apps/main/discover_main_app.tsx b/src/plugins/discover/public/application/apps/main/discover_main_app.tsx index 456f4ebfab62f..7ee9ab44f9a75 100644 --- a/src/plugins/discover/public/application/apps/main/discover_main_app.tsx +++ b/src/plugins/discover/public/application/apps/main/discover_main_app.tsx @@ -92,7 +92,7 @@ export function DiscoverMainApp(props: DiscoverMainProps) { addHelpMenuToAppChrome(chrome, docLinks); }, [stateContainer, chrome, docLinks]); - const resetQuery = useCallback(() => { + const resetCurrentSavedSearch = useCallback(() => { resetSavedSearch(savedSearch.id); }, [resetSavedSearch, savedSearch]); @@ -103,7 +103,7 @@ export function DiscoverMainApp(props: DiscoverMainProps) { inspectorAdapters={inspectorAdapters} onChangeIndexPattern={onChangeIndexPattern} onUpdateQuery={onUpdateQuery} - resetQuery={resetQuery} + resetSavedSearch={resetCurrentSavedSearch} navigateTo={navigateTo} savedSearch={savedSearch} savedSearchData$={data$} diff --git a/src/plugins/discover/public/application/apps/main/services/use_discover_state.ts b/src/plugins/discover/public/application/apps/main/services/use_discover_state.ts index afe010379cff3..e11a9937111a1 100644 --- a/src/plugins/discover/public/application/apps/main/services/use_discover_state.ts +++ b/src/plugins/discover/public/application/apps/main/services/use_discover_state.ts @@ -148,7 +148,8 @@ export function useDiscoverState({ const resetSavedSearch = useCallback( async (id?: string) => { const newSavedSearch = await services.getSavedSearchById(id); - newSavedSearch.searchSource.setField('index', indexPattern); + const newIndexPattern = newSavedSearch.searchSource.getField('index') || indexPattern; + newSavedSearch.searchSource.setField('index', newIndexPattern); const newAppState = getStateDefaults({ config, data, @@ -157,7 +158,7 @@ export function useDiscoverState({ await stateContainer.replaceUrlAppState(newAppState); setState(newAppState); }, - [services, indexPattern, config, data, stateContainer] + [indexPattern, services, config, data, stateContainer] ); /** diff --git a/src/plugins/discover/public/application/apps/main/utils/calc_field_counts.ts b/src/plugins/discover/public/application/apps/main/utils/calc_field_counts.ts index 57178776a97d4..1ce7023539be4 100644 --- a/src/plugins/discover/public/application/apps/main/utils/calc_field_counts.ts +++ b/src/plugins/discover/public/application/apps/main/utils/calc_field_counts.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { IndexPattern } from '../../../../kibana_services'; +import type { IndexPattern } from 'src/plugins/data/common'; import { ElasticSearchHit } from '../../../doc_views/doc_views_types'; /** diff --git a/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.test.ts b/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.test.ts index 17f1802a47327..554aca6ddb8f1 100644 --- a/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.test.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.test.ts @@ -27,6 +27,7 @@ describe('getStateDefaults', () => { "default_column", ], "filters": undefined, + "hideChart": undefined, "index": "index-pattern-with-timefield-id", "interval": "auto", "query": undefined, @@ -54,6 +55,7 @@ describe('getStateDefaults', () => { "default_column", ], "filters": undefined, + "hideChart": undefined, "index": "the-index-pattern-id", "interval": "auto", "query": undefined, diff --git a/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.ts b/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.ts index fc835d4d3dd16..4061d9a61f0a3 100644 --- a/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_state_defaults.ts @@ -46,6 +46,7 @@ export function getStateDefaults({ index: indexPattern!.id, interval: 'auto', filters: cloneDeep(searchSource.getOwnField('filter')), + hideChart: undefined, } as AppState; if (savedSearch.grid) { defaultState.grid = savedSearch.grid; diff --git a/src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.test.ts b/src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.test.ts index 9f9071ed403ce..83107d6c57ab8 100644 --- a/src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.test.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.test.ts @@ -7,7 +7,7 @@ */ import { getSwitchIndexPatternAppState } from './get_switch_index_pattern_app_state'; -import { IndexPattern } from '../../../../../../data/common/index_patterns'; +import { IndexPattern } from '../../../../../../data/common'; /** * Helper function returning an index pattern diff --git a/src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts b/src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts index 00f194662e410..ff082587172a0 100644 --- a/src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts +++ b/src/plugins/discover/public/application/apps/main/utils/get_switch_index_pattern_app_state.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { IndexPattern } from '../../../../kibana_services'; +import type { IndexPattern } from 'src/plugins/data/common'; import { getSortArray, SortPairArr } from '../components/doc_table/lib/get_sort'; /** diff --git a/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts b/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts index a5149ea2b3dd7..226db12114de8 100644 --- a/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts +++ b/src/plugins/discover/public/application/apps/main/utils/resolve_index_pattern.ts @@ -7,10 +7,8 @@ */ import { i18n } from '@kbn/i18n'; -import { IUiSettingsClient, SavedObject, ToastsStart } from 'kibana/public'; -import { IndexPattern } from '../../../../kibana_services'; -import { IndexPatternsContract, SearchSource } from '../../../../../../data/common'; - +import type { IndexPattern, IndexPatternsContract, SearchSource } from 'src/plugins/data/common'; +import type { IUiSettingsClient, SavedObject, ToastsStart } from 'kibana/public'; export type IndexPatternSavedObject = SavedObject & { title: string }; interface IndexPatternData { diff --git a/src/plugins/discover/public/application/apps/main/utils/update_search_source.ts b/src/plugins/discover/public/application/apps/main/utils/update_search_source.ts index b4a1dab41a096..74e63c399743f 100644 --- a/src/plugins/discover/public/application/apps/main/utils/update_search_source.ts +++ b/src/plugins/discover/public/application/apps/main/utils/update_search_source.ts @@ -54,7 +54,10 @@ export function updateSearchSource( // this is not the default index pattern, it determines that it's not of type rollup if (indexPatternsUtils.isDefault(indexPattern)) { - searchSource.setField('filter', data.query.timefilter.timefilter.createFilter(indexPattern)); + searchSource.setField( + 'filter', + data.query.timefilter.timefilter.createRelativeFilter(indexPattern) + ); } if (useNewFieldsApi) { diff --git a/src/plugins/discover/public/application/apps/not_found/not_found_route.tsx b/src/plugins/discover/public/application/apps/not_found/not_found_route.tsx index ff515f27201a4..cd16a820cc8f7 100644 --- a/src/plugins/discover/public/application/apps/not_found/not_found_route.tsx +++ b/src/plugins/discover/public/application/apps/not_found/not_found_route.tsx @@ -28,10 +28,7 @@ export function NotFoundRoute(props: NotFoundRouteProps) { useEffect(() => { const path = window.location.hash.substr(1); getUrlTracker().restorePreviousUrl(); - const { navigated } = urlForwarding.navigateToLegacyKibanaUrl(path); - if (!navigated) { - urlForwarding.navigateToDefaultApp(); - } + urlForwarding.navigateToLegacyKibanaUrl(path); const bannerMessage = i18n.translate('discover.noMatchRoute.bannerTitleText', { defaultMessage: 'Page not found', diff --git a/src/plugins/discover/public/application/components/discover_grid/constants.ts b/src/plugins/discover/public/application/components/discover_grid/constants.ts index 34e6ca20740ad..1126c6cbbf279 100644 --- a/src/plugins/discover/public/application/components/discover_grid/constants.ts +++ b/src/plugins/discover/public/application/components/discover_grid/constants.ts @@ -17,6 +17,7 @@ export const gridStyle = { export const pageSizeArr = [25, 50, 100, 250]; export const defaultPageSize = 100; +export const defaultTimeColumnWidth = 190; export const toolbarVisibility = { showColumnSelector: { allowHide: false, diff --git a/src/plugins/discover/public/application/components/discover_grid/discover_grid.scss b/src/plugins/discover/public/application/components/discover_grid/discover_grid.scss index 48b99458377ad..0204433a5ba1c 100644 --- a/src/plugins/discover/public/application/components/discover_grid/discover_grid.scss +++ b/src/plugins/discover/public/application/components/discover_grid/discover_grid.scss @@ -86,6 +86,21 @@ .dscDiscoverGrid__descriptionListDescription { word-break: normal !important; + + // Special handling for images coming from the image field formatter + img { + // Align the images vertically centered with the text + vertical-align: middle; + // Set the maximum height to the line-height. The used function is the same + // function used to calculate the line-height for the EuiDescriptionList Description. + // !important is required to overwrite the max-height on the element from the field formatter + max-height: lineHeightFromBaseline(2) !important; + // An arbitrary amount of width we don't want to go over, to not have very wide images. + // For most width-height-ratios that will never be hit, because we'd usually limit + // it by the way smaller height. But images with very large width and very small height + // might be limited by that. + max-width: ($euiSizeXXL * 12.5) !important; + } } @include euiBreakpoint('xs', 's', 'm') { diff --git a/src/plugins/discover/public/application/components/discover_grid/discover_grid.tsx b/src/plugins/discover/public/application/components/discover_grid/discover_grid.tsx index e33d25c8693a6..ca0692a8c9039 100644 --- a/src/plugins/discover/public/application/components/discover_grid/discover_grid.tsx +++ b/src/plugins/discover/public/application/components/discover_grid/discover_grid.tsx @@ -21,7 +21,7 @@ import { EuiLoadingSpinner, EuiIcon, } from '@elastic/eui'; -import { IndexPattern } from '../../../kibana_services'; +import type { IndexPattern } from 'src/plugins/data/common'; import { DocViewFilterFn, ElasticSearchHit } from '../../doc_views/doc_views_types'; import { getSchemaDetectors } from './discover_grid_schema'; import { DiscoverGridFlyout } from './discover_grid_flyout'; @@ -36,7 +36,6 @@ import { import { defaultPageSize, gridStyle, pageSizeArr, toolbarVisibility } from './constants'; import { DiscoverServices } from '../../../build_services'; import { getDisplayedColumns } from '../../helpers/columns'; -import { KibanaContextProvider } from '../../../../../kibana_react/public'; import { MAX_DOC_FIELDS_DISPLAYED, SHOW_MULTIFIELDS } from '../../../../common'; import { DiscoverGridDocumentToolbarBtn, getDocId } from './discover_grid_document_selection'; import { SortPairArr } from '../../apps/main/components/doc_table/lib/get_sort'; @@ -385,41 +384,39 @@ export const DiscoverGrid = ({ data-document-number={displayedRows.length} className={className} > - - { - if (onResize) { - onResize(col); - } - }} - pagination={paginationObj} - renderCellValue={renderCellValue} - rowCount={rowCount} - schemaDetectors={schemaDetectors} - sorting={sorting as EuiDataGridSorting} - toolbarVisibility={ - defaultColumns - ? { - ...toolbarVisibility, - showColumnSelector: false, - showSortSelector: isSortEnabled, - additionalControls, - } - : { - ...toolbarVisibility, - showSortSelector: isSortEnabled, - additionalControls, - } + { + if (onResize) { + onResize(col); } - /> - + }} + pagination={paginationObj} + renderCellValue={renderCellValue} + rowCount={rowCount} + schemaDetectors={schemaDetectors} + sorting={sorting as EuiDataGridSorting} + toolbarVisibility={ + defaultColumns + ? { + ...toolbarVisibility, + showColumnSelector: false, + showSortSelector: isSortEnabled, + additionalControls, + } + : { + ...toolbarVisibility, + showSortSelector: isSortEnabled, + additionalControls, + } + } + /> {showDisclaimer && (

diff --git a/src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx b/src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx index ab80cd3e7b461..b1823eb3d668c 100644 --- a/src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx +++ b/src/plugins/discover/public/application/components/discover_grid/discover_grid_cell_actions.tsx @@ -9,7 +9,7 @@ import React, { useContext } from 'react'; import { EuiDataGridColumnCellActionProps } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { IndexPatternField } from '../../../../../data/common/index_patterns/fields'; +import { IndexPatternField } from '../../../../../data/common'; import { DiscoverGridContext } from './discover_grid_context'; export const FilterInBtn = ({ diff --git a/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.test.tsx b/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.test.tsx index 3cbac90aa39cb..46e30dd23525b 100644 --- a/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.test.tsx +++ b/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.test.tsx @@ -119,7 +119,7 @@ describe('Discover grid columns ', function () { ], "display": "Time (timestamp)", "id": "timestamp", - "initialWidth": 180, + "initialWidth": 190, "isSortable": true, "schema": "datetime", }, diff --git a/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx b/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx index 3a27772662b56..2f4c0b5167df8 100644 --- a/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx +++ b/src/plugins/discover/public/application/components/discover_grid/discover_grid_columns.tsx @@ -11,10 +11,11 @@ import { i18n } from '@kbn/i18n'; import { EuiDataGridColumn, EuiScreenReaderOnly } from '@elastic/eui'; import { ExpandButton } from './discover_grid_expand_button'; import { DiscoverGridSettings } from './types'; -import { IndexPattern } from '../../../../../data/common/index_patterns/index_patterns'; +import type { IndexPattern } from '../../../../../data/common'; import { buildCellActions } from './discover_grid_cell_actions'; import { getSchemaByKbnType } from './discover_grid_schema'; import { SelectButton } from './discover_grid_document_selection'; +import { defaultTimeColumnWidth } from './constants'; export function getLeadControlColumns() { return [ @@ -88,7 +89,7 @@ export function buildEuiGridColumn( if (column.id === indexPattern.timeFieldName) { column.display = `${timeString} (${indexPattern.timeFieldName})`; - column.initialWidth = 180; + column.initialWidth = defaultTimeColumnWidth; } if (columnWidth > 0) { column.initialWidth = Number(columnWidth); diff --git a/src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx b/src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx index e57d3fb8362ae..0103ad3d98870 100644 --- a/src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx +++ b/src/plugins/discover/public/application/components/discover_grid/discover_grid_context.tsx @@ -7,8 +7,8 @@ */ import React from 'react'; +import type { IndexPattern } from 'src/plugins/data/common'; import { DocViewFilterFn, ElasticSearchHit } from '../../doc_views/doc_views_types'; -import { IndexPattern } from '../../../kibana_services'; export interface GridContext { expanded: ElasticSearchHit | undefined; diff --git a/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx b/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx index 2a97c5d0be819..e4b67c49689ab 100644 --- a/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx +++ b/src/plugins/discover/public/application/components/discover_grid/discover_grid_flyout.tsx @@ -8,6 +8,7 @@ import React, { useMemo, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; +import type { IndexPattern } from 'src/plugins/data/common'; import { EuiFlexGroup, EuiFlexItem, @@ -24,7 +25,6 @@ import { keys, } from '@elastic/eui'; import { DocViewer } from '../doc_viewer/doc_viewer'; -import { IndexPattern } from '../../../kibana_services'; import { DocViewFilterFn, ElasticSearchHit } from '../../doc_views/doc_views_types'; import { DiscoverServices } from '../../../build_services'; import { getContextUrl } from '../../helpers/get_context_url'; @@ -107,6 +107,7 @@ export function DiscoverGridFlyout({ size="m" data-test-subj="docTableDetailsFlyout" onKeyDown={onKeyDown} + ownFocus={false} > )} {activePage !== -1 && ( - + String(v) }; + : { convert: (v: unknown, ...rest: unknown[]) => String(v) }; const formatted = (values as unknown[]) .map((val: unknown) => formatter.convert(val, 'html', { @@ -110,6 +110,9 @@ export const getRenderCellValueFn = ( }); return ( + // If you change the styling of this list (specifically something that will change the line-height) + // make sure to adjust the img overwrites attached to dscDiscoverGrid__descriptionListDescription + // in discover_grid.scss {[...highlightPairs, ...sourcePairs].slice(0, maxDocFieldsDisplayed).map(([key, value]) => ( diff --git a/src/plugins/discover/public/application/components/doc_viewer/doc_viewer_tab.tsx b/src/plugins/discover/public/application/components/doc_viewer/doc_viewer_tab.tsx index 52d9b8316bb09..e2af88b91b3ff 100644 --- a/src/plugins/discover/public/application/components/doc_viewer/doc_viewer_tab.tsx +++ b/src/plugins/discover/public/application/components/doc_viewer/doc_viewer_tab.tsx @@ -8,7 +8,6 @@ import React from 'react'; import { isEqual } from 'lodash'; -import { I18nProvider } from '@kbn/i18n/react'; import { DocViewRenderTab } from './doc_viewer_render_tab'; import { DocViewerError } from './doc_viewer_render_error'; import { DocViewRenderFn, DocViewRenderProps } from '../../doc_views/doc_views_types'; @@ -68,11 +67,9 @@ export class DocViewerTab extends React.Component { // doc view is provided by a react component if (Component) { return ( - - - - - + + + ); } diff --git a/src/plugins/discover/public/application/components/source_viewer/__snapshots__/source_viewer.test.tsx.snap b/src/plugins/discover/public/application/components/source_viewer/__snapshots__/source_viewer.test.tsx.snap index dfded530c6983..3d4a9923fa8c8 100644 --- a/src/plugins/discover/public/application/components/source_viewer/__snapshots__/source_viewer.test.tsx.snap +++ b/src/plugins/discover/public/application/components/source_viewer/__snapshots__/source_viewer.test.tsx.snap @@ -472,12 +472,12 @@ exports[`Source Viewer component renders json code editor 1`] = ` > diff --git a/src/plugins/discover/public/application/components/source_viewer/source_viewer.test.tsx b/src/plugins/discover/public/application/components/source_viewer/source_viewer.test.tsx index 625ac93a335ac..d9e9199e6586a 100644 --- a/src/plugins/discover/public/application/components/source_viewer/source_viewer.test.tsx +++ b/src/plugins/discover/public/application/components/source_viewer/source_viewer.test.tsx @@ -7,6 +7,7 @@ */ import React from 'react'; +import type { IndexPattern } from 'src/plugins/data/common'; import { mountWithIntl } from '@kbn/test/jest'; import { SourceViewer } from './source_viewer'; import * as hooks from '../../services/use_es_doc_search'; @@ -18,7 +19,7 @@ jest.mock('../../../kibana_services', () => ({ getServices: jest.fn(), })); -import { getServices, IndexPattern } from '../../../kibana_services'; +import { getServices } from '../../../kibana_services'; const mockIndexPattern = { getComputedFields: () => [], diff --git a/src/plugins/discover/public/application/components/source_viewer/source_viewer.tsx b/src/plugins/discover/public/application/components/source_viewer/source_viewer.tsx index 1ec595c9d17f2..9e37ae8f8bf93 100644 --- a/src/plugins/discover/public/application/components/source_viewer/source_viewer.tsx +++ b/src/plugins/discover/public/application/components/source_viewer/source_viewer.tsx @@ -127,3 +127,7 @@ export const SourceViewer = ({ /> ); }; + +// Required for usage in React.lazy +// eslint-disable-next-line import/no-default-export +export default SourceViewer; diff --git a/src/plugins/discover/public/application/components/table/table.test.tsx b/src/plugins/discover/public/application/components/table/table.test.tsx index da6820ba4a70a..589c97b400eb4 100644 --- a/src/plugins/discover/public/application/components/table/table.test.tsx +++ b/src/plugins/discover/public/application/components/table/table.test.tsx @@ -7,9 +7,8 @@ */ import React from 'react'; -import { mount } from 'enzyme'; +import { mountWithIntl } from '@kbn/test/jest'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { I18nProvider } from '@kbn/i18n/react'; import { DocViewerTable, DocViewerTableProps } from './table'; import { indexPatterns, IndexPattern } from '../../../../../data/public'; import { ElasticSearchHit } from '../../doc_views/doc_views_types'; @@ -77,11 +76,7 @@ indexPattern.fields.getByName = (name: string) => { indexPattern.flattenHit = indexPatterns.flattenHitWrapper(indexPattern, indexPattern.metaFields); const mountComponent = (props: DocViewerTableProps) => { - return mount( - - - - ); + return mountWithIntl(); }; describe('DocViewTable at Discover', () => { diff --git a/src/plugins/discover/public/application/components/table/table.tsx b/src/plugins/discover/public/application/components/table/table.tsx index 456103c776566..e89b27e8069f1 100644 --- a/src/plugins/discover/public/application/components/table/table.tsx +++ b/src/plugins/discover/public/application/components/table/table.tsx @@ -145,3 +145,7 @@ export const DocViewerTable = ({ /> ); }; + +// Required for usage in React.lazy +// eslint-disable-next-line import/no-default-export +export default DocViewerTable; diff --git a/src/plugins/discover/public/application/discover_router.tsx b/src/plugins/discover/public/application/discover_router.tsx index 7c7921935a7fa..320ce3e5f644a 100644 --- a/src/plugins/discover/public/application/discover_router.tsx +++ b/src/plugins/discover/public/application/discover_router.tsx @@ -23,8 +23,8 @@ export const discoverRouter = (services: DiscoverServices, history: History) => history, }; return ( - - + + } /> - - + + ); }; diff --git a/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts b/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts index 66e8889bcb062..4dbe14017dc6e 100644 --- a/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts +++ b/src/plugins/discover/public/application/helpers/use_data_grid_columns.ts @@ -7,9 +7,9 @@ */ import { useMemo } from 'react'; +import type { IndexPattern, IndexPatternsContract } from 'src/plugins/data/common'; import { Capabilities, IUiSettingsClient } from 'kibana/public'; -import { IndexPattern, IndexPatternsContract } from '../../kibana_services'; import { AppState as DiscoverState, GetStateReturn as DiscoverGetStateReturn, diff --git a/src/plugins/discover/public/application/index.tsx b/src/plugins/discover/public/application/index.tsx index 4ac50eecd518a..f6c7d60ed7db8 100644 --- a/src/plugins/discover/public/application/index.tsx +++ b/src/plugins/discover/public/application/index.tsx @@ -5,14 +5,12 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import ReactDOM from 'react-dom'; - -import { AppMountParameters } from 'kibana/public'; import { i18n } from '@kbn/i18n'; import { getServices } from '../kibana_services'; import { discoverRouter } from './discover_router'; +import { toMountPoint } from '../../../kibana_react/public'; -export const renderApp = ({ element }: AppMountParameters) => { +export const renderApp = (element: HTMLElement) => { const services = getServices(); const { history: getHistory, capabilities, chrome, data } = services; @@ -28,11 +26,10 @@ export const renderApp = ({ element }: AppMountParameters) => { iconType: 'glasses', }); } - const app = discoverRouter(services, history); - ReactDOM.render(app, element); + const unmount = toMountPoint(discoverRouter(services, history))(element); return () => { + unmount(); data.search.session.clear(); - ReactDOM.unmountComponentAtNode(element); }; }; diff --git a/src/plugins/discover/public/kibana_services.ts b/src/plugins/discover/public/kibana_services.ts index 1e92c0e4c2f1d..72925a1578c30 100644 --- a/src/plugins/discover/public/kibana_services.ts +++ b/src/plugins/discover/public/kibana_services.ts @@ -6,13 +6,12 @@ * Side Public License, v 1. */ -import _ from 'lodash'; +import { once } from 'lodash'; import { createHashHistory } from 'history'; -import { ScopedHistory, AppMountParameters } from 'kibana/public'; -import { UiActionsStart } from 'src/plugins/ui_actions/public'; +import type { ScopedHistory, AppMountParameters } from 'kibana/public'; +import type { UiActionsStart } from 'src/plugins/ui_actions/public'; import { DiscoverServices } from './build_services'; import { createGetterSetter } from '../../kibana_utils/public'; -import { search } from '../../data/public'; import { DocViewsRegistry } from './application/doc_views/doc_views_registry'; let services: DiscoverServices | null = null; @@ -48,7 +47,7 @@ export const [getDocViewsRegistry, setDocViewsRegistry] = createGetterSetter { +export const getHistory = once(() => { const history = createHashHistory(); history.listen(() => { // keep at least one listener so that `history.location` always in sync @@ -72,18 +71,3 @@ export const syncHistoryLocations = () => { export const [getScopedHistory, setScopedHistory] = createGetterSetter( 'scopedHistory' ); - -export const { tabifyAggResponse } = search; -export { unhashUrl, redirectWhenMissing } from '../../kibana_utils/public'; -export { formatMsg, formatStack, subscribeWithScope } from '../../kibana_legacy/public'; - -// EXPORT types -export { - IndexPatternsContract, - IndexPattern, - indexPatterns, - IndexPatternField, - ISearchSource, - EsQuerySortValue, - SortDirection, -} from '../../data/public'; diff --git a/src/plugins/discover/public/plugin.tsx b/src/plugins/discover/public/plugin.tsx index c43c759c5d344..4624fa79ca14b 100644 --- a/src/plugins/discover/public/plugin.tsx +++ b/src/plugins/discover/public/plugin.tsx @@ -27,6 +27,7 @@ import { KibanaLegacySetup, KibanaLegacyStart } from 'src/plugins/kibana_legacy/ import { UrlForwardingSetup, UrlForwardingStart } from 'src/plugins/url_forwarding/public'; import { HomePublicPluginSetup } from 'src/plugins/home/public'; import { Start as InspectorPublicPluginStart } from 'src/plugins/inspector/public'; +import { EuiLoadingContent } from '@elastic/eui'; import { DataPublicPluginStart, DataPublicPluginSetup, esFilters } from '../../data/public'; import { SavedObjectLoader, SavedObjectsStart } from '../../saved_objects/public'; import { createKbnUrlTracker } from '../../kibana_utils/public'; @@ -34,7 +35,6 @@ import { DEFAULT_APP_CATEGORIES } from '../../../core/public'; import { UrlGeneratorState } from '../../share/public'; import { DocViewInput, DocViewInputFn } from './application/doc_views/doc_views_types'; import { DocViewsRegistry } from './application/doc_views/doc_views_registry'; -import { DocViewerTable } from './application/components/table/table'; import { setDocViewsRegistry, setUrlTracker, @@ -59,7 +59,7 @@ import { SearchEmbeddableFactory } from './application/embeddable'; import { UsageCollectionSetup } from '../../usage_collection/public'; import { replaceUrlHashQuery } from '../../kibana_utils/public/'; import { IndexPatternFieldEditorStart } from '../../../plugins/index_pattern_field_editor/public'; -import { SourceViewer } from './application/components/source_viewer/source_viewer'; +import { DeferredSpinner } from './shared'; declare module '../../share/public' { export interface UrlGeneratorStateMapping { @@ -67,6 +67,12 @@ declare module '../../share/public' { } } +const DocViewerTable = React.lazy(() => import('./application/components/table/table')); + +const SourceViewer = React.lazy( + () => import('./application/components/source_viewer/source_viewer') +); + /** * @public */ @@ -232,7 +238,17 @@ export class DiscoverPlugin defaultMessage: 'Table', }), order: 10, - component: DocViewerTable, + component: (props) => ( + + + + } + > + + + ), }); this.docViewsRegistry.addDocView({ title: i18n.translate('discover.docViews.json.jsonTitle', { @@ -240,12 +256,20 @@ export class DiscoverPlugin }), order: 20, component: ({ hit, indexPattern }) => ( - + + + + } + > + + ), }); @@ -320,10 +344,9 @@ export class DiscoverPlugin // make sure the index pattern list is up to date await depsStart.data.indexPatterns.clearCache(); - const { renderApp } = await import('./application/application'); - const unmount = await renderApp('discover', params.element); + const { renderApp } = await import('./application'); + const unmount = renderApp(params.element); return () => { - params.element.classList.remove('dscAppWrapper'); unlistenParentHistory(); unmount(); appUnMounted(); diff --git a/src/plugins/discover/public/shared/components.tsx b/src/plugins/discover/public/shared/components.tsx new file mode 100644 index 0000000000000..11f77281f9eb0 --- /dev/null +++ b/src/plugins/discover/public/shared/components.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 and the Server Side Public License, v 1; you may not 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, { useEffect, useRef, useState } from 'react'; + +/** + * A component that shows it children with a 300ms delay. This is good for wrapping + * loading spinners for tasks that might potentially be very fast (e.g. loading async chunks). + * That way we don't show a quick flash of the spinner before the actual content and will only + * show the spinner once loading takes a bit longer (more than 300ms). + */ +export const DeferredSpinner: React.FC = ({ children }) => { + const timeoutRef = useRef(); + const [showContent, setShowContent] = useState(false); + useEffect(() => { + timeoutRef.current = window.setTimeout(() => { + setShowContent(true); + }, 300); + return () => { + if (timeoutRef.current) { + clearTimeout(timeoutRef.current); + } + }; + }, []); + + return showContent ? {children} : null; +}; diff --git a/src/plugins/discover/public/shared/index.ts b/src/plugins/discover/public/shared/index.ts index c82ac074db111..7471e1293baa0 100644 --- a/src/plugins/discover/public/shared/index.ts +++ b/src/plugins/discover/public/shared/index.ts @@ -12,3 +12,5 @@ export async function loadSharingDataHelpers() { return await import('../application/apps/main/utils/get_sharing_data'); } + +export { DeferredSpinner } from './components'; diff --git a/src/plugins/embeddable/common/types.ts b/src/plugins/embeddable/common/types.ts index 22d8672e59a37..430b59bc62242 100644 --- a/src/plugins/embeddable/common/types.ts +++ b/src/plugins/embeddable/common/types.ts @@ -12,6 +12,7 @@ import { PersistableStateService } from '../../kibana_utils/common'; export enum ViewMode { EDIT = 'edit', + PREVIEW = 'preview', VIEW = 'view', } diff --git a/src/plugins/embeddable/jest.config.js b/src/plugins/embeddable/jest.config.js index 6ac4e4486fcfd..37080a605e3d5 100644 --- a/src/plugins/embeddable/jest.config.js +++ b/src/plugins/embeddable/jest.config.js @@ -11,4 +11,7 @@ module.exports = { rootDir: '../../..', roots: ['/src/plugins/embeddable'], testRunner: 'jasmine2', + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/embeddable', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/embeddable/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/embeddable/kibana.json b/src/plugins/embeddable/kibana.json index 25e95061ed2ac..1f4b6ff7b7f37 100644 --- a/src/plugins/embeddable/kibana.json +++ b/src/plugins/embeddable/kibana.json @@ -7,6 +7,7 @@ "name": "App Services", "githubTeam": "kibana-app-services" }, + "description": "Adds embeddables service to Kibana", "requiredPlugins": ["inspector", "uiActions"], "extraPublicDirs": ["public/lib/test_samples", "common"], "requiredBundles": ["savedObjects", "kibanaReact", "kibanaUtils"] diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx index 59888b00fc576..919058bcbbc32 100644 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx +++ b/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx @@ -31,8 +31,8 @@ interface HelloWorldContainerInput extends ContainerInput { } interface HelloWorldContainerOptions { - getEmbeddableFactory: EmbeddableStart['getEmbeddableFactory']; - panelComponent: EmbeddableStart['EmbeddablePanel']; + getEmbeddableFactory?: EmbeddableStart['getEmbeddableFactory']; + panelComponent?: EmbeddableStart['EmbeddablePanel']; } export class HelloWorldContainer extends Container { @@ -42,7 +42,7 @@ export class HelloWorldContainer extends Container, private readonly options: HelloWorldContainerOptions ) { - super(input, { embeddableLoaded: {} }, options.getEmbeddableFactory); + super(input, { embeddableLoaded: {} }, options.getEmbeddableFactory || (() => undefined)); } public getInheritedInput(id: string) { @@ -56,10 +56,14 @@ export class HelloWorldContainer extends Container - + {this.options.panelComponent ? ( + + ) : ( +

Panel component not provided.
+ )} , node ); diff --git a/src/plugins/es_ui_shared/jest.config.js b/src/plugins/es_ui_shared/jest.config.js index cf525397bd75c..c311f5d9df2ed 100644 --- a/src/plugins/es_ui_shared/jest.config.js +++ b/src/plugins/es_ui_shared/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/es_ui_shared'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/es_ui_shared', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/es_ui_shared/{__packages_do_not_import__,common,public,server,static}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/expression_error/jest.config.js b/src/plugins/expression_error/jest.config.js index 64f3e9292ff07..27774f4003f9e 100644 --- a/src/plugins/expression_error/jest.config.js +++ b/src/plugins/expression_error/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/expression_error'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/expression_error', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/expression_error/{common,public}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/expression_image/jest.config.js b/src/plugins/expression_image/jest.config.js index 3d5bc9f184c6a..ccefa3c20699e 100644 --- a/src/plugins/expression_image/jest.config.js +++ b/src/plugins/expression_image/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/expression_image'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/expression_image', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/expression_image/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/expression_metric/jest.config.js b/src/plugins/expression_metric/jest.config.js index 517409460895e..23546fc334816 100644 --- a/src/plugins/expression_metric/jest.config.js +++ b/src/plugins/expression_metric/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/expression_metric'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/expression_metric', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/expression_metric/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/expression_repeat_image/jest.config.js b/src/plugins/expression_repeat_image/jest.config.js index cf1039263840b..b30d782ef6e0e 100644 --- a/src/plugins/expression_repeat_image/jest.config.js +++ b/src/plugins/expression_repeat_image/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/expression_repeat_image'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/expression_repeat_image', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/expression_repeat_image/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/expression_reveal_image/jest.config.js b/src/plugins/expression_reveal_image/jest.config.js index aac5fad293846..c1d7fead721f5 100644 --- a/src/plugins/expression_reveal_image/jest.config.js +++ b/src/plugins/expression_reveal_image/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/expression_reveal_image'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/expression_reveal_image', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/expression_reveal_image/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/expression_shape/jest.config.js b/src/plugins/expression_shape/jest.config.js index a390c0154bbd0..bb2603cb012eb 100644 --- a/src/plugins/expression_shape/jest.config.js +++ b/src/plugins/expression_shape/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/expression_shape'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/expression_shape', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/expression_shape/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/expressions/common/executor/executor.test.ts b/src/plugins/expressions/common/executor/executor.test.ts index 0a1e793ffbe22..75758dad783a0 100644 --- a/src/plugins/expressions/common/executor/executor.test.ts +++ b/src/plugins/expressions/common/executor/executor.test.ts @@ -197,6 +197,11 @@ describe('Executor', () => { types: ['string'], help: 'other arg', }, + nullable: { + types: ['string', 'null'], + help: 'nullable arg', + default: null, + }, }, extract: (state: ExpressionAstFunction['arguments']) => { const references: SavedObjectReference[] = [ @@ -254,6 +259,14 @@ describe('Executor', () => { expect(formatExpression(executor.inject(state, references))).toBe(expression); }); + + test('allows expression function argument to be null', () => { + const expression = `ref nullable=null id="my-id" other={ref id="nested-id" other="other" | foo bar="baz"}`; + const { state, references } = executor.extract(parseExpression(expression)); + + expect(state.chain[0].arguments.nullable[0]).toBeNull(); + expect(formatExpression(executor.inject(state, references))).toBe(expression); + }); }); describe('.getAllMigrations', () => { diff --git a/src/plugins/expressions/common/executor/executor.ts b/src/plugins/expressions/common/executor/executor.ts index 2767c8bc6ecbe..eb0e344b6dd60 100644 --- a/src/plugins/expressions/common/executor/executor.ts +++ b/src/plugins/expressions/common/executor/executor.ts @@ -204,7 +204,7 @@ export class Executor = Record { return asts.map((arg) => { - if (typeof arg === 'object') { + if (arg && typeof arg === 'object') { return this.walkAst(arg, action); } return arg; diff --git a/src/plugins/expressions/common/expression_renderers/types.ts b/src/plugins/expressions/common/expression_renderers/types.ts index 239cff6143ae7..8547c1a1bec92 100644 --- a/src/plugins/expressions/common/expression_renderers/types.ts +++ b/src/plugins/expressions/common/expression_renderers/types.ts @@ -53,12 +53,11 @@ export type AnyExpressionRenderDefinition = ExpressionRenderDefinition; * This value can be set from a consumer embedding an expression renderer and is accessible * from within the active render function as part of the handlers. * The following modes are supported: - * * display (default): The chart is rendered in a container with the main purpose of viewing the chart (e.g. in a container like dashboard or canvas) + * * view (default): The chart is rendered in a container with the main purpose of viewing the chart (e.g. in a container like dashboard or canvas) * * preview: The chart is rendered in very restricted space (below 100px width and height) and should only show a rough outline * * edit: The chart is rendered within an editor and configuration elements within the chart should be displayed - * * noInteractivity: The chart is rendered in a non-interactive environment and should not provide any affordances for interaction like brushing */ -export type RenderMode = 'noInteractivity' | 'edit' | 'preview' | 'display'; +export type RenderMode = 'edit' | 'preview' | 'view'; export interface IInterpreterRenderHandlers { /** @@ -71,6 +70,12 @@ export interface IInterpreterRenderHandlers { event: (event: any) => void; hasCompatibleActions?: (event: any) => Promise; getRenderMode: () => RenderMode; + + /** + * The chart is rendered in a non-interactive environment and should not provide any affordances for interaction like brushing. + */ + isInteractive: () => boolean; + isSyncColorsEnabled: () => boolean; /** * This uiState interface is actually `PersistedState` from the visualizations plugin, diff --git a/src/plugins/expressions/jest.config.js b/src/plugins/expressions/jest.config.js index 721312f7d886c..24f27aadedd7b 100644 --- a/src/plugins/expressions/jest.config.js +++ b/src/plugins/expressions/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/expressions'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/expressions', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/expressions/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/expressions/kibana.json b/src/plugins/expressions/kibana.json index 46e6ef8b4ea75..82b16d4f00369 100644 --- a/src/plugins/expressions/kibana.json +++ b/src/plugins/expressions/kibana.json @@ -7,6 +7,7 @@ "name": "App Services", "githubTeam": "kibana-app-services" }, + "description": "Adds expression runtime to Kibana", "extraPublicDirs": ["common", "common/fonts"], "requiredBundles": ["kibanaUtils", "inspector"] } diff --git a/src/plugins/expressions/public/loader.ts b/src/plugins/expressions/public/loader.ts index d0f60eb294060..3ab7473d8d735 100644 --- a/src/plugins/expressions/public/loader.ts +++ b/src/plugins/expressions/public/loader.ts @@ -53,6 +53,7 @@ export class ExpressionLoader { ); this.renderHandler = new ExpressionRenderHandler(element, { + interactive: params?.interactive, onRenderError: params && params.onRenderError, renderMode: params?.renderMode, syncColors: params?.syncColors, diff --git a/src/plugins/expressions/public/react_expression_renderer.tsx b/src/plugins/expressions/public/react_expression_renderer.tsx index 719af1b39f89e..2640be16eae46 100644 --- a/src/plugins/expressions/public/react_expression_renderer.tsx +++ b/src/plugins/expressions/public/react_expression_renderer.tsx @@ -171,6 +171,7 @@ export const ReactExpressionRenderer = ({ }, [ hasCustomRenderErrorHandler, onEvent, + expressionLoaderOptions.interactive, expressionLoaderOptions.renderMode, expressionLoaderOptions.syncColors, ]); diff --git a/src/plugins/expressions/public/render.ts b/src/plugins/expressions/public/render.ts index e7a00867c1005..e9a65d1e8f12e 100644 --- a/src/plugins/expressions/public/render.ts +++ b/src/plugins/expressions/public/render.ts @@ -21,6 +21,7 @@ export interface ExpressionRenderHandlerParams { onRenderError?: RenderErrorHandlerFnType; renderMode?: RenderMode; syncColors?: boolean; + interactive?: boolean; hasCompatibleActions?: (event: ExpressionRendererEvent) => Promise; } @@ -54,6 +55,7 @@ export class ExpressionRenderHandler { onRenderError, renderMode, syncColors, + interactive, hasCompatibleActions = async () => false, }: ExpressionRenderHandlerParams = {} ) { @@ -90,11 +92,14 @@ export class ExpressionRenderHandler { this.eventsSubject.next(data); }, getRenderMode: () => { - return renderMode || 'display'; + return renderMode || 'view'; }, isSyncColorsEnabled: () => { return syncColors || false; }, + isInteractive: () => { + return interactive ?? true; + }, hasCompatibleActions, }; } diff --git a/src/plugins/expressions/public/types/index.ts b/src/plugins/expressions/public/types/index.ts index 5a2198bb4f2e5..172f322f8892a 100644 --- a/src/plugins/expressions/public/types/index.ts +++ b/src/plugins/expressions/public/types/index.ts @@ -44,6 +44,7 @@ export interface IExpressionLoaderParams { customRenderers?: []; uiState?: unknown; inspectorAdapters?: Adapters; + interactive?: boolean; onRenderError?: RenderErrorHandlerFnType; searchSessionId?: string; renderMode?: RenderMode; diff --git a/src/plugins/field_formats/common/content_types/html_content_type.ts b/src/plugins/field_formats/common/content_types/html_content_type.ts index 71ac293b7717b..3b7a48a9329a6 100644 --- a/src/plugins/field_formats/common/content_types/html_content_type.ts +++ b/src/plugins/field_formats/common/content_types/html_content_type.ts @@ -43,7 +43,7 @@ export const setup = ( return convert.call(format, value, options); } - const subValues = value.map((v: any) => recurse(v, options)); + const subValues = value.map((v: unknown) => recurse(v, options)); const useMultiLine = subValues.some((sub: string) => sub.indexOf('\n') > -1); return subValues.join(',' + (useMultiLine ? '\n' : ' ')); diff --git a/src/plugins/field_formats/common/converters/boolean.test.ts b/src/plugins/field_formats/common/converters/boolean.test.ts index a44c760940b40..4bc045f568998 100644 --- a/src/plugins/field_formats/common/converters/boolean.test.ts +++ b/src/plugins/field_formats/common/converters/boolean.test.ts @@ -9,7 +9,7 @@ import { BoolFormat } from './boolean'; describe('Boolean Format', () => { - let boolean: Record; + let boolean: BoolFormat; beforeEach(() => { boolean = new BoolFormat({}, jest.fn()); diff --git a/src/plugins/field_formats/common/converters/boolean.ts b/src/plugins/field_formats/common/converters/boolean.ts index 7019b6423b89e..81fd419c9861e 100644 --- a/src/plugins/field_formats/common/converters/boolean.ts +++ b/src/plugins/field_formats/common/converters/boolean.ts @@ -20,7 +20,7 @@ export class BoolFormat extends FieldFormat { }); static fieldType = [KBN_FIELD_TYPES.BOOLEAN, KBN_FIELD_TYPES.NUMBER, KBN_FIELD_TYPES.STRING]; - textConvert: TextContextTypeConvert = (value) => { + textConvert: TextContextTypeConvert = (value: string | number | boolean) => { if (typeof value === 'string') { value = value.trim().toLowerCase(); } diff --git a/src/plugins/field_formats/common/converters/bytes.test.ts b/src/plugins/field_formats/common/converters/bytes.test.ts index a820b2c1f2b32..895129a74da3c 100644 --- a/src/plugins/field_formats/common/converters/bytes.test.ts +++ b/src/plugins/field_formats/common/converters/bytes.test.ts @@ -8,13 +8,14 @@ import { BytesFormat } from './bytes'; import { FORMATS_UI_SETTINGS } from '../constants/ui_settings'; +import { FieldFormatsGetConfigFn } from '../types'; describe('BytesFormat', () => { - const config: Record = {}; + const config: { [key: string]: string } = { + [FORMATS_UI_SETTINGS.FORMAT_BYTES_DEFAULT_PATTERN]: '0,0.[000]b', + }; - config[FORMATS_UI_SETTINGS.FORMAT_BYTES_DEFAULT_PATTERN] = '0,0.[000]b'; - - const getConfig = (key: string) => config[key]; + const getConfig: FieldFormatsGetConfigFn = (key: string) => config[key]; test('default pattern', () => { const formatter = new BytesFormat({}, getConfig); diff --git a/src/plugins/field_formats/common/converters/color.tsx b/src/plugins/field_formats/common/converters/color.tsx index 417c2481e626b..3e5ff97830479 100644 --- a/src/plugins/field_formats/common/converters/color.tsx +++ b/src/plugins/field_formats/common/converters/color.tsx @@ -31,11 +31,11 @@ export class ColorFormat extends FieldFormat { }; } - findColorRuleForVal(val: any) { + findColorRuleForVal(val: string | number) { switch (this.param('fieldType')) { case 'string': return findLast(this.param('colors'), (colorParam: typeof DEFAULT_CONVERTER_COLOR) => { - return new RegExp(colorParam.regex).test(val); + return new RegExp(colorParam.regex).test(val as string); }); case 'number': @@ -50,7 +50,7 @@ export class ColorFormat extends FieldFormat { } } - htmlConvert: HtmlContextTypeConvert = (val) => { + htmlConvert: HtmlContextTypeConvert = (val: string | number) => { const color = this.findColorRuleForVal(val) as typeof DEFAULT_CONVERTER_COLOR; const displayVal = escape(asPrettyString(val)); diff --git a/src/plugins/field_formats/common/converters/date_nanos_shared.test.ts b/src/plugins/field_formats/common/converters/date_nanos_shared.test.ts index 6f0b28cc83f55..4b9e82547bbb8 100644 --- a/src/plugins/field_formats/common/converters/date_nanos_shared.test.ts +++ b/src/plugins/field_formats/common/converters/date_nanos_shared.test.ts @@ -8,17 +8,23 @@ import moment from 'moment-timezone'; import { DateNanosFormat, analysePatternForFract, formatWithNanos } from './date_nanos_shared'; +import { FieldFormatsGetConfigFn } from '../types'; describe('Date Nanos Format', () => { let convert: Function; - let mockConfig: Record; + let mockConfig: { + dateNanosFormat: string; + 'dateFormat:tz': string; + [other: string]: string; + }; beforeEach(() => { - mockConfig = {}; - mockConfig.dateNanosFormat = 'MMMM Do YYYY, HH:mm:ss.SSSSSSSSS'; - mockConfig['dateFormat:tz'] = 'Browser'; + mockConfig = { + dateNanosFormat: 'MMMM Do YYYY, HH:mm:ss.SSSSSSSSS', + 'dateFormat:tz': 'Browser', + }; - const getConfig = (key: string) => mockConfig[key]; + const getConfig: FieldFormatsGetConfigFn = (key: string) => mockConfig[key]; const date = new DateNanosFormat({}, getConfig); convert = date.convert.bind(date); diff --git a/src/plugins/field_formats/common/converters/date_nanos_shared.ts b/src/plugins/field_formats/common/converters/date_nanos_shared.ts index 1d226c936a977..daffc289a7c7b 100644 --- a/src/plugins/field_formats/common/converters/date_nanos_shared.ts +++ b/src/plugins/field_formats/common/converters/date_nanos_shared.ts @@ -13,20 +13,27 @@ import moment, { Moment } from 'moment'; import { FieldFormat, FIELD_FORMAT_IDS } from '../'; import { TextContextTypeConvert } from '../types'; +interface FractPatternObject { + length: number; + patternNanos: string; + pattern: string; + patternEscaped: string; +} + /** * Analyse the given moment.js format pattern for the fractional sec part (S,SS,SSS...) * returning length, match, pattern and an escaped pattern, that excludes the fractional * part when formatting with moment.js -> e.g. [SSS] */ -export function analysePatternForFract(pattern: string) { - const fracSecMatch = pattern.match('S+') as any; // extract fractional seconds sub-pattern +export function analysePatternForFract(pattern: string): FractPatternObject { + const fracSecMatch = pattern.match('S+'); // extract fractional seconds sub-pattern const fracSecMatchStr = fracSecMatch ? fracSecMatch[0] : ''; return { length: fracSecMatchStr.length, patternNanos: fracSecMatchStr, pattern, - patternEscaped: fracSecMatchStr ? pattern.replace(fracSecMatch, `[${fracSecMatch}]`) : '', + patternEscaped: fracSecMatchStr ? pattern.replace(fracSecMatchStr, `[${fracSecMatchStr}]`) : '', }; } @@ -38,7 +45,7 @@ export function analysePatternForFract(pattern: string) { export function formatWithNanos( dateMomentObj: Moment, valRaw: string, - fracPatternObj: Record + fracPatternObj: FractPatternObject ) { if (fracPatternObj.length <= 3) { // S,SS,SSS is formatted correctly by moment.js @@ -77,7 +84,7 @@ export class DateNanosFormat extends FieldFormat { }; } - textConvert: TextContextTypeConvert = (val) => { + textConvert: TextContextTypeConvert = (val: string | number) => { // don't give away our ref to converter so // we can hot-swap when config changes const pattern = this.param('pattern'); @@ -91,7 +98,7 @@ export class DateNanosFormat extends FieldFormat { this.timeZone = timezone; this.memoizedPattern = pattern; - this.memoizedConverter = memoize(function converter(value: any) { + this.memoizedConverter = memoize(function converter(value: string | number) { if (value === null || value === undefined) { return '-'; } @@ -102,7 +109,7 @@ export class DateNanosFormat extends FieldFormat { // fallback for max/min aggregation, where unixtime in ms is returned as a number // aggregations in Elasticsearch generally just return ms return date.format(fallbackPattern); - } else if (date.isValid()) { + } else if (date.isValid() && typeof value === 'string') { return formatWithNanos(date, value, fractPattern); } else { return value; diff --git a/src/plugins/field_formats/common/converters/duration.test.ts b/src/plugins/field_formats/common/converters/duration.test.ts index 9ea9919e757de..58e3fb4f3a967 100644 --- a/src/plugins/field_formats/common/converters/duration.test.ts +++ b/src/plugins/field_formats/common/converters/duration.test.ts @@ -315,9 +315,9 @@ describe('Duration Format', () => { showSuffix: boolean | undefined; useShortSuffix?: boolean; includeSpaceWithSuffix?: boolean; - fixtures: any[]; + fixtures: Array<{ input: number; output: string }>; }) { - fixtures.forEach((fixture: Record) => { + fixtures.forEach((fixture: { input: number; output: string }) => { const input = fixture.input; const output = fixture.output; diff --git a/src/plugins/field_formats/common/converters/duration.ts b/src/plugins/field_formats/common/converters/duration.ts index a92a6756b335c..c913ee03d9d36 100644 --- a/src/plugins/field_formats/common/converters/duration.ts +++ b/src/plugins/field_formats/common/converters/duration.ts @@ -235,7 +235,7 @@ export class DurationFormat extends FieldFormat { }; } - textConvert: TextContextTypeConvert = (val) => { + textConvert: TextContextTypeConvert = (val: number) => { const inputFormat = this.param('inputFormat'); const outputFormat = this.param('outputFormat') as keyof Duration; const outputPrecision = this.param('outputPrecision'); diff --git a/src/plugins/field_formats/common/converters/histogram.ts b/src/plugins/field_formats/common/converters/histogram.ts index 52ddf1bd4ed22..2f6928b2abd8e 100644 --- a/src/plugins/field_formats/common/converters/histogram.ts +++ b/src/plugins/field_formats/common/converters/histogram.ts @@ -34,7 +34,7 @@ export class HistogramFormat extends FieldFormat { }; } - textConvert: TextContextTypeConvert = (val) => { + textConvert: TextContextTypeConvert = (val: number) => { if (typeof val === 'number') { const subFormatId = this.param('id'); const SubFormat = diff --git a/src/plugins/field_formats/common/converters/ip.test.ts b/src/plugins/field_formats/common/converters/ip.test.ts index b4c39d1c31d66..0c07c72d22375 100644 --- a/src/plugins/field_formats/common/converters/ip.test.ts +++ b/src/plugins/field_formats/common/converters/ip.test.ts @@ -9,7 +9,7 @@ import { IpFormat } from './ip'; describe('IP Address Format', () => { - let ip: Record; + let ip: IpFormat; beforeEach(() => { ip = new IpFormat({}, jest.fn()); diff --git a/src/plugins/field_formats/common/converters/ip.ts b/src/plugins/field_formats/common/converters/ip.ts index ad49d679a3526..34fac5e1de2af 100644 --- a/src/plugins/field_formats/common/converters/ip.ts +++ b/src/plugins/field_formats/common/converters/ip.ts @@ -19,9 +19,9 @@ export class IpFormat extends FieldFormat { }); static fieldType = KBN_FIELD_TYPES.IP; - textConvert: TextContextTypeConvert = (val) => { + textConvert: TextContextTypeConvert = (val: number) => { if (val === undefined || val === null) return '-'; - if (!isFinite(val)) return val; + if (!isFinite(val)) return String(val); // shazzam! // eslint-disable-next-line no-bitwise diff --git a/src/plugins/field_formats/common/converters/number.test.ts b/src/plugins/field_formats/common/converters/number.test.ts index da849fae1e6ab..379eca73baffc 100644 --- a/src/plugins/field_formats/common/converters/number.test.ts +++ b/src/plugins/field_formats/common/converters/number.test.ts @@ -10,9 +10,9 @@ import { NumberFormat } from './number'; import { FORMATS_UI_SETTINGS } from '../constants/ui_settings'; describe('NumberFormat', () => { - const config: Record = {}; - - config[FORMATS_UI_SETTINGS.FORMAT_NUMBER_DEFAULT_PATTERN] = '0,0.[000]'; + const config: { [key: string]: string } = { + [FORMATS_UI_SETTINGS.FORMAT_NUMBER_DEFAULT_PATTERN]: '0,0.[000]', + }; const getConfig = (key: string) => config[key]; diff --git a/src/plugins/field_formats/common/converters/numeral.ts b/src/plugins/field_formats/common/converters/numeral.ts index 7f11b6377836d..05c512ba8856f 100644 --- a/src/plugins/field_formats/common/converters/numeral.ts +++ b/src/plugins/field_formats/common/converters/numeral.ts @@ -17,7 +17,7 @@ import { FORMATS_UI_SETTINGS } from '../constants/ui_settings'; const numeralInst = numeral(); -numeralLanguages.forEach((numeralLanguage: Record) => { +numeralLanguages.forEach((numeralLanguage: Record) => { numeral.language(numeralLanguage.id, numeralLanguage.lang); }); @@ -31,7 +31,7 @@ export abstract class NumeralFormat extends FieldFormat { pattern: this.getConfig!(`format:${this.id}:defaultPattern`), }); - protected getConvertedValue(val: any): string { + protected getConvertedValue(val: number | string): string { if (val === -Infinity) return '-∞'; if (val === +Infinity) return '+∞'; if (typeof val !== 'number') { diff --git a/src/plugins/field_formats/common/converters/percent.test.ts b/src/plugins/field_formats/common/converters/percent.test.ts index d01acf571f9d9..50ea3b9f4fd61 100644 --- a/src/plugins/field_formats/common/converters/percent.test.ts +++ b/src/plugins/field_formats/common/converters/percent.test.ts @@ -10,9 +10,9 @@ import { PercentFormat } from './percent'; import { FORMATS_UI_SETTINGS } from '../constants/ui_settings'; describe('PercentFormat', () => { - const config: Record = {}; - - config[FORMATS_UI_SETTINGS.FORMAT_PERCENT_DEFAULT_PATTERN] = '0,0.[000]%'; + const config: { [key: string]: string } = { + [FORMATS_UI_SETTINGS.FORMAT_PERCENT_DEFAULT_PATTERN]: '0,0.[000]%', + }; const getConfig = (key: string) => config[key]; diff --git a/src/plugins/field_formats/common/converters/percent.ts b/src/plugins/field_formats/common/converters/percent.ts index 497fb088cd416..f2210993dea31 100644 --- a/src/plugins/field_formats/common/converters/percent.ts +++ b/src/plugins/field_formats/common/converters/percent.ts @@ -27,7 +27,7 @@ export class PercentFormat extends NumeralFormat { fractional: true, }); - textConvert: TextContextTypeConvert = (val) => { + textConvert: TextContextTypeConvert = (val: string | number) => { const formatted = super.getConvertedValue(val); if (this.param('fractional')) { diff --git a/src/plugins/field_formats/common/converters/relative_date.ts b/src/plugins/field_formats/common/converters/relative_date.ts index cdc54479b150b..0d66c372e089f 100644 --- a/src/plugins/field_formats/common/converters/relative_date.ts +++ b/src/plugins/field_formats/common/converters/relative_date.ts @@ -20,7 +20,7 @@ export class RelativeDateFormat extends FieldFormat { }); static fieldType = KBN_FIELD_TYPES.DATE; - textConvert: TextContextTypeConvert = (val) => { + textConvert: TextContextTypeConvert = (val: string | number) => { if (val === null || val === undefined) { return '-'; } @@ -29,7 +29,7 @@ export class RelativeDateFormat extends FieldFormat { if (date.isValid()) { return date.fromNow(); } else { - return val; + return String(val); } }; } diff --git a/src/plugins/field_formats/common/converters/source.tsx b/src/plugins/field_formats/common/converters/source.tsx index 9fa7738cabee2..1caffb5bfb9a8 100644 --- a/src/plugins/field_formats/common/converters/source.tsx +++ b/src/plugins/field_formats/common/converters/source.tsx @@ -41,9 +41,9 @@ export class SourceFormat extends FieldFormat { static title = '_source'; static fieldType = KBN_FIELD_TYPES._SOURCE; - textConvert: TextContextTypeConvert = (value) => JSON.stringify(value); + textConvert: TextContextTypeConvert = (value: string) => JSON.stringify(value); - htmlConvert: HtmlContextTypeConvert = (value, options = {}) => { + htmlConvert: HtmlContextTypeConvert = (value: string, options = {}) => { const { field, hit, indexPattern } = options; if (!field) { @@ -52,18 +52,18 @@ export class SourceFormat extends FieldFormat { return escape(converter(value)); } - const highlights = (hit && hit.highlight) || {}; + const highlights: Record = (hit && hit.highlight) || {}; // TODO: remove index pattern dependency - const formatted = indexPattern.formatHit(hit); - const highlightPairs: any[] = []; - const sourcePairs: any[] = []; + const formatted = hit ? indexPattern!.formatHit(hit) : {}; + const highlightPairs: Array<[string, string]> = []; + const sourcePairs: Array<[string, string]> = []; const isShortDots = this.getConfig!(FORMATS_UI_SETTINGS.SHORT_DOTS_ENABLE); keys(formatted).forEach((key) => { const pairs = highlights[key] ? highlightPairs : sourcePairs; const newField = isShortDots ? shortenDottedString(key) : key; - const val = formatted[key]; - pairs.push([newField, val]); + const val = formatted![key]; + pairs.push([newField as string, val]); }, []); return ReactDOM.renderToStaticMarkup( diff --git a/src/plugins/field_formats/common/converters/static_lookup.ts b/src/plugins/field_formats/common/converters/static_lookup.ts index 455f4794887f9..d52196d910b80 100644 --- a/src/plugins/field_formats/common/converters/static_lookup.ts +++ b/src/plugins/field_formats/common/converters/static_lookup.ts @@ -11,13 +11,15 @@ import { KBN_FIELD_TYPES } from '@kbn/field-types'; import { FieldFormat } from '../field_format'; import { TextContextTypeConvert, FIELD_FORMAT_IDS } from '../types'; -function convertLookupEntriesToMap(lookupEntries: any[]) { +function convertLookupEntriesToMap( + lookupEntries: Array<{ key: string; value: unknown }> +): Record { return lookupEntries.reduce( - (lookupMap: Record, lookupEntry: Record) => { + (lookupMap: Record, lookupEntry: { key: string; value: unknown }) => { lookupMap[lookupEntry.key] = lookupEntry.value; return lookupMap; }, - {} + {} as Record ); } @@ -41,7 +43,7 @@ export class StaticLookupFormat extends FieldFormat { }; } - textConvert: TextContextTypeConvert = (val) => { + textConvert: TextContextTypeConvert = (val: string) => { const lookupEntries = this.param('lookupEntries'); const unknownKeyValue = this.param('unknownKeyValue'); diff --git a/src/plugins/field_formats/common/converters/string.ts b/src/plugins/field_formats/common/converters/string.ts index a3d571897ef61..e3700e1b52429 100644 --- a/src/plugins/field_formats/common/converters/string.ts +++ b/src/plugins/field_formats/common/converters/string.ts @@ -109,7 +109,7 @@ export class StringFormat extends FieldFormat { }); } - textConvert: TextContextTypeConvert = (val) => { + textConvert: TextContextTypeConvert = (val: string | number) => { if (val === '') { return emptyLabel; } @@ -119,13 +119,13 @@ export class StringFormat extends FieldFormat { case 'upper': return String(val).toUpperCase(); case 'title': - return this.toTitleCase(val); + return this.toTitleCase(String(val)); case 'short': - return shortenDottedString(val); + return asPrettyString(shortenDottedString(val)); case 'base64': - return this.base64Decode(val); + return this.base64Decode(String(val)); case 'urlparam': - return decodeURIComponent(val); + return decodeURIComponent(String(val)); default: return asPrettyString(val); } @@ -136,8 +136,8 @@ export class StringFormat extends FieldFormat { return `${emptyLabel}`; } - return hit?.highlight?.[field?.name] - ? getHighlightHtml(escape(val), hit.highlight[field.name]) + return hit?.highlight?.[field?.name!] + ? getHighlightHtml(escape(val), hit.highlight[field!.name]) : escape(this.textConvert(val)); }; } diff --git a/src/plugins/field_formats/common/converters/truncate.ts b/src/plugins/field_formats/common/converters/truncate.ts index 2ac4b515325eb..bea55f5120f04 100644 --- a/src/plugins/field_formats/common/converters/truncate.ts +++ b/src/plugins/field_formats/common/converters/truncate.ts @@ -22,7 +22,7 @@ export class TruncateFormat extends FieldFormat { }); static fieldType = KBN_FIELD_TYPES.STRING; - textConvert: TextContextTypeConvert = (val) => { + textConvert: TextContextTypeConvert = (val: string) => { const length = this.param('fieldLength'); if (length > 0) { return truncate(val, { diff --git a/src/plugins/field_formats/common/converters/url.ts b/src/plugins/field_formats/common/converters/url.ts index 930c94f9ce0fa..f788db29823f7 100644 --- a/src/plugins/field_formats/common/converters/url.ts +++ b/src/plugins/field_formats/common/converters/url.ts @@ -14,8 +14,9 @@ import { FieldFormat } from '../field_format'; import { TextContextTypeConvert, HtmlContextTypeConvert, - IFieldFormatMetaParams, + FieldFormatMetaParams, FIELD_FORMAT_IDS, + FieldFormatParams, } from '../types'; const templateMatchRE = /{{([\s\S]+?)}}/g; @@ -61,7 +62,7 @@ export class UrlFormat extends FieldFormat { ]; static urlTypes = URL_TYPES; - constructor(params: IFieldFormatMetaParams) { + constructor(params: FieldFormatParams & FieldFormatMetaParams) { super(params); this.compileTemplate = memoize(this.compileTemplate); } @@ -101,7 +102,7 @@ export class UrlFormat extends FieldFormat { // trim all the odd bits, the variable names const parts = template.split(templateMatchRE).map((part, i) => (i % 2 ? part.trim() : part)); - return function (locals: Record): string { + return function (locals: Record): string { // replace all the odd bits with their local var let output = ''; let i = -1; @@ -129,9 +130,9 @@ export class UrlFormat extends FieldFormat { return `${imageLabel}`; } - textConvert: TextContextTypeConvert = (value) => this.formatLabel(value); + textConvert: TextContextTypeConvert = (value: string) => this.formatLabel(value); - htmlConvert: HtmlContextTypeConvert = (rawValue, options = {}) => { + htmlConvert: HtmlContextTypeConvert = (rawValue: string, options = {}) => { const { field, hit } = options; const { parsedUrl } = this._params; const { basePath, pathname, origin } = parsedUrl || {}; @@ -187,8 +188,8 @@ export class UrlFormat extends FieldFormat { let linkLabel; - if (hit && hit.highlight && hit.highlight[field.name]) { - linkLabel = getHighlightHtml(label, hit.highlight[field.name]); + if (hit && hit.highlight && hit.highlight[field?.name!]) { + linkLabel = getHighlightHtml(label, hit.highlight[field!.name]); } else { linkLabel = label; } diff --git a/src/plugins/field_formats/common/field_format.test.ts b/src/plugins/field_formats/common/field_format.test.ts index b69040c7c42db..4624c5ebe5e55 100644 --- a/src/plugins/field_formats/common/field_format.test.ts +++ b/src/plugins/field_formats/common/field_format.test.ts @@ -9,11 +9,12 @@ import { constant, trimEnd, trimStart, get } from 'lodash'; import { FieldFormat } from './field_format'; import { asPrettyString } from './utils'; +import { FieldFormatParams } from './types'; const getTestFormat = ( - _params?: Record, + _params?: FieldFormatParams, textConvert = (val: string) => asPrettyString(val), - htmlConvert?: any + htmlConvert?: (val: string) => string ) => new (class TestFormat extends FieldFormat { static id = 'test-format'; diff --git a/src/plugins/field_formats/common/field_format.ts b/src/plugins/field_formats/common/field_format.ts index 97b8acd7c019d..05b376ddf3272 100644 --- a/src/plugins/field_formats/common/field_format.ts +++ b/src/plugins/field_formats/common/field_format.ts @@ -16,7 +16,8 @@ import { FieldFormatConvertFunction, HtmlContextTypeOptions, TextContextTypeOptions, - IFieldFormatMetaParams, + FieldFormatMetaParams, + FieldFormatParams, } from './types'; import { htmlContentTypeSetup, textContentTypeSetup, TEXT_CONTEXT_TYPE } from './content_types'; import { HtmlContextTypeConvert, TextContextTypeConvert } from './types'; @@ -83,13 +84,16 @@ export abstract class FieldFormat { * @property {Function} - ref to child class * @private */ - public type: any = this.constructor; + public type = this.constructor as typeof FieldFormat; public allowsNumericalAggregations?: boolean; - protected readonly _params: any; + protected readonly _params: FieldFormatParams & FieldFormatMetaParams; protected getConfig: FieldFormatsGetConfigFn | undefined; - constructor(_params: IFieldFormatMetaParams = {}, getConfig?: FieldFormatsGetConfigFn) { + constructor( + _params: FieldFormatParams & FieldFormatMetaParams = {}, + getConfig?: FieldFormatsGetConfigFn + ) { this._params = _params; if (getConfig) { @@ -99,7 +103,7 @@ export abstract class FieldFormat { /** * Convert a raw value to a formatted string - * @param {any} value + * @param {unknown} value * @param {string} [contentType=text] - optional content type, the only two contentTypes * currently supported are "html" and "text", which helps * formatters adjust to different contexts @@ -108,7 +112,7 @@ export abstract class FieldFormat { * @public */ convert( - value: any, + value: unknown, contentType: FieldFormatsContentType = DEFAULT_CONTEXT_TYPE, options?: HtmlContextTypeOptions | TextContextTypeOptions ): string { @@ -118,7 +122,8 @@ export abstract class FieldFormat { return converter.call(this, value, options); } - return value; + // TODO: should be "return `${value}`;", but might be a breaking change + return value as string; } /** @@ -142,7 +147,7 @@ export abstract class FieldFormat { * @return {object} - parameter defaults * @public */ - getParamDefaults(): Record { + getParamDefaults(): FieldFormatParams { return {}; } @@ -150,7 +155,7 @@ export abstract class FieldFormat { * Get the value of a param. This value may be a default value. * * @param {string} name - the param name to fetch - * @return {any} + * @return {any} TODO: https://github.com/elastic/kibana/issues/108158 * @public */ param(name: string): any { @@ -170,7 +175,7 @@ export abstract class FieldFormat { * @return {object} * @public */ - params(): Record { + params(): FieldFormatParams & FieldFormatMetaParams { return cloneDeep(defaults({}, this._params, this.getParamDefaults())); } @@ -182,12 +187,12 @@ export abstract class FieldFormat { * @public */ toJSON() { - const id = get(this.type, 'id'); + const id = this.type.id; const defaultsParams = this.getParamDefaults() || {}; const params = transform( this._params, - (uniqParams: any, val, param: string) => { + (uniqParams: FieldFormatParams & FieldFormatMetaParams, val: unknown, param: string) => { if (param === 'parsedUrl') return; if (param && val !== get(defaultsParams, param)) { uniqParams[param] = val; @@ -198,7 +203,7 @@ export abstract class FieldFormat { return { id, - params: size(params) ? (params as any) : undefined, + params: size(params) ? params : undefined, }; } @@ -213,7 +218,7 @@ export abstract class FieldFormat { }; } - static isInstanceOfFieldFormat(fieldFormat: any): fieldFormat is FieldFormat { - return Boolean(fieldFormat && fieldFormat.convert); + static isInstanceOfFieldFormat(fieldFormat: unknown): fieldFormat is FieldFormat { + return Boolean(fieldFormat && typeof fieldFormat === 'object' && 'convert' in fieldFormat); } } diff --git a/src/plugins/field_formats/common/field_formats_registry.test.ts b/src/plugins/field_formats/common/field_formats_registry.test.ts index e94efc88be20f..ce5cb2eec8f07 100644 --- a/src/plugins/field_formats/common/field_formats_registry.test.ts +++ b/src/plugins/field_formats/common/field_formats_registry.test.ts @@ -8,14 +8,12 @@ import { FieldFormatsRegistry } from './field_formats_registry'; import { BoolFormat, PercentFormat, StringFormat } from './converters'; -import { FieldFormatsGetConfigFn, FieldFormatInstanceType } from './types'; +import { FieldFormatConfig, FieldFormatsGetConfigFn } from './types'; import { KBN_FIELD_TYPES } from '@kbn/field-types'; -const getValueOfPrivateField = (instance: any, field: string) => instance[field]; - describe('FieldFormatsRegistry', () => { let fieldFormatsRegistry: FieldFormatsRegistry; - let defaultMap = {}; + let defaultMap: Record = ({} = {}); const getConfig = (() => defaultMap) as FieldFormatsGetConfigFn; beforeEach(() => { @@ -35,9 +33,6 @@ describe('FieldFormatsRegistry', () => { test('should allows to create an instance of "FieldFormatsRegistry"', () => { expect(fieldFormatsRegistry).toBeDefined(); - - expect(getValueOfPrivateField(fieldFormatsRegistry, 'fieldFormats')).toBeDefined(); - expect(getValueOfPrivateField(fieldFormatsRegistry, 'defaultMap')).toEqual({}); }); describe('init', () => { @@ -48,11 +43,13 @@ describe('FieldFormatsRegistry', () => { test('should populate the "defaultMap" object', () => { defaultMap = { - number: { id: 'number', params: {} }, + [KBN_FIELD_TYPES.NUMBER]: { id: KBN_FIELD_TYPES.NUMBER, params: {} }, }; fieldFormatsRegistry.init(getConfig, {}, []); - expect(getValueOfPrivateField(fieldFormatsRegistry, 'defaultMap')).toEqual(defaultMap); + expect(fieldFormatsRegistry.getDefaultConfig(KBN_FIELD_TYPES.NUMBER)).toEqual( + defaultMap[KBN_FIELD_TYPES.NUMBER] + ); }); }); @@ -65,16 +62,9 @@ describe('FieldFormatsRegistry', () => { test('should register field formats', () => { fieldFormatsRegistry.register([StringFormat, BoolFormat]); - const registeredFieldFormatters: Map< - string, - FieldFormatInstanceType - > = getValueOfPrivateField(fieldFormatsRegistry, 'fieldFormats'); - - expect(registeredFieldFormatters.size).toBe(2); - - expect(registeredFieldFormatters.get(BoolFormat.id)).toBe(BoolFormat); - expect(registeredFieldFormatters.get(StringFormat.id)).toBe(StringFormat); - expect(registeredFieldFormatters.get(PercentFormat.id)).toBeUndefined(); + expect(fieldFormatsRegistry.has(StringFormat.id)).toBe(true); + expect(fieldFormatsRegistry.has(BoolFormat.id)).toBe(true); + expect(fieldFormatsRegistry.has(PercentFormat.id)).toBe(false); }); test('should throw if registering a formatter with existing id ', () => { @@ -130,8 +120,8 @@ describe('FieldFormatsRegistry', () => { const stringFormat = new DecoratedStingFormat({ foo: 'foo', }); - const params = getValueOfPrivateField(stringFormat, '_params'); + const params = stringFormat.params(); expect(params).toHaveProperty('foo'); expect(params).toHaveProperty('parsedUrl'); expect(params.parsedUrl).toHaveProperty('origin'); @@ -168,7 +158,7 @@ describe('FieldFormatsRegistry', () => { expect(DecoratedStringFormat).toBeDefined(); const stingFormat = new DecoratedStringFormat({ foo: 'foo' }); - const params = getValueOfPrivateField(stingFormat, '_params'); + const params = stingFormat.params(); expect(params).toHaveProperty('foo'); expect(params).toHaveProperty('parsedUrl'); diff --git a/src/plugins/field_formats/common/field_formats_registry.ts b/src/plugins/field_formats/common/field_formats_registry.ts index 675ec897c2b70..3d856e4686126 100644 --- a/src/plugins/field_formats/common/field_formats_registry.ts +++ b/src/plugins/field_formats/common/field_formats_registry.ts @@ -7,7 +7,7 @@ */ // eslint-disable-next-line max-classes-per-file -import { forOwn, isFunction, memoize, identity } from 'lodash'; +import { memoize, identity } from 'lodash'; import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '@kbn/field-types'; import { @@ -16,9 +16,10 @@ import { FIELD_FORMAT_IDS, FieldFormatInstanceType, FieldFormatId, - IFieldFormatMetaParams, + FieldFormatMetaParams, SerializedFieldFormat, FormatFactory, + FieldFormatParams, } from './types'; import { baseFormatters } from './constants/base_formatters'; import { FieldFormat } from './field_format'; @@ -28,7 +29,7 @@ import { FieldFormatNotFoundError } from './errors'; export class FieldFormatsRegistry { protected fieldFormats: Map = new Map(); protected defaultMap: Record = {}; - protected metaParamsOptions: Record = {}; + protected metaParamsOptions: FieldFormatMetaParams = {}; protected getConfig?: FieldFormatsGetConfigFn; public deserialize: FormatFactory = (mapping?: SerializedFieldFormat) => { @@ -50,10 +51,13 @@ export class FieldFormatsRegistry { init( getConfig: FieldFormatsGetConfigFn, - metaParamsOptions: Record = {}, + metaParamsOptions: FieldFormatMetaParams = {}, defaultFieldConverters: FieldFormatInstanceType[] = baseFormatters ) { - const defaultTypeMap = getConfig(FORMATS_UI_SETTINGS.FORMAT_DEFAULT_TYPE_MAP); + const defaultTypeMap = getConfig(FORMATS_UI_SETTINGS.FORMAT_DEFAULT_TYPE_MAP) as Record< + string, + FieldFormatConfig + >; this.register(defaultFieldConverters); this.parseDefaultTypeMap(defaultTypeMap); this.getConfig = getConfig; @@ -89,10 +93,10 @@ export class FieldFormatsRegistry { const fieldFormat = this.fieldFormats.get(formatId); if (fieldFormat) { - const decoratedFieldFormat: any = this.fieldFormatMetaParamsDecorator(fieldFormat); + const decoratedFieldFormat = this.fieldFormatMetaParamsDecorator(fieldFormat); if (decoratedFieldFormat) { - return decoratedFieldFormat as FieldFormatInstanceType; + return decoratedFieldFormat; } } @@ -159,8 +163,12 @@ export class FieldFormatsRegistry { * @param {FieldFormatId} formatId * @return {FieldFormat} */ - getInstance = memoize( - (formatId: FieldFormatId, params: Record = {}): FieldFormat => { + getInstance = (formatId: FieldFormatId, params: FieldFormatParams = {}): FieldFormat => { + return this.getInstanceMemoized(formatId, params); + }; + + private getInstanceMemoized = memoize( + (formatId: FieldFormatId, params: FieldFormatParams = {}): FieldFormat => { const ConcreteFieldFormat = this.getType(formatId); if (!ConcreteFieldFormat) { @@ -169,7 +177,7 @@ export class FieldFormatsRegistry { return new ConcreteFieldFormat(params, this.getConfig); }, - (formatId: FieldFormatId, params: Record) => + (formatId: FieldFormatId, params: FieldFormatParams) => JSON.stringify({ formatId, ...params, @@ -186,7 +194,7 @@ export class FieldFormatsRegistry { getDefaultInstancePlain = ( fieldType: KBN_FIELD_TYPES, esTypes?: ES_FIELD_TYPES[], - params: Record = {} + params: FieldFormatParams = {} ): FieldFormat => { const conf = this.getDefaultConfig(fieldType, esTypes); const instanceParams = { @@ -239,19 +247,26 @@ export class FieldFormatsRegistry { * * @param {KBN_FIELD_TYPES} fieldType * @param {ES_FIELD_TYPES[]} esTypes + * @param {FieldFormatParams} params * @return {FieldFormat} */ - getDefaultInstance = memoize(this.getDefaultInstancePlain, this.getDefaultInstanceCacheResolver); + getDefaultInstance = ( + fieldType: KBN_FIELD_TYPES, + esTypes?: ES_FIELD_TYPES[], + params: FieldFormatParams = {} + ): FieldFormat => { + return this.getDefaultInstanceMemoized(fieldType, esTypes, params); + }; + + private getDefaultInstanceMemoized = memoize( + this.getDefaultInstancePlain, + this.getDefaultInstanceCacheResolver + ); - parseDefaultTypeMap(value: any) { + parseDefaultTypeMap(value: Record) { this.defaultMap = value; - forOwn(this, (fn) => { - if (isFunction(fn) && (fn as any).cache) { - // clear all memoize caches - // @ts-ignore - fn.cache = new memoize.Cache(); - } - }); + this.getInstanceMemoized.cache.clear?.(); + this.getDefaultInstanceMemoized.cache.clear?.(); } register(fieldFormats: FieldFormatInstanceType[]) { @@ -282,14 +297,14 @@ export class FieldFormatsRegistry { private fieldFormatMetaParamsDecorator = ( fieldFormat: FieldFormatInstanceType ): FieldFormatInstanceType | undefined => { - const getMetaParams = (customParams: Record) => this.buildMetaParams(customParams); + const getMetaParams = (customParams: FieldFormatParams) => this.buildMetaParams(customParams); if (fieldFormat) { return class DecoratedFieldFormat extends fieldFormat { static id = fieldFormat.id; static fieldType = fieldFormat.fieldType; - constructor(params: Record = {}, getConfig?: FieldFormatsGetConfigFn) { + constructor(params: FieldFormatParams = {}, getConfig?: FieldFormatsGetConfigFn) { super(getMetaParams(params), getConfig); } }; @@ -301,10 +316,12 @@ export class FieldFormatsRegistry { /** * Build Meta Params * - * @param {Record} custom params - * @return {Record} + * @param {FieldFormatParams} custom params + * @return {FieldFormatParams & FieldFormatMetaParams} */ - private buildMetaParams = (customParams: T): T => ({ + private buildMetaParams = ( + customParams: FieldFormatParams + ): FieldFormatParams & FieldFormatMetaParams => ({ ...this.metaParamsOptions, ...customParams, }); diff --git a/src/plugins/field_formats/common/index.ts b/src/plugins/field_formats/common/index.ts index 2e0aa82a67b30..aeb5e0af220db 100644 --- a/src/plugins/field_formats/common/index.ts +++ b/src/plugins/field_formats/common/index.ts @@ -46,8 +46,15 @@ export { FieldFormatId, SerializedFieldFormat, FormatFactory, - // Used in field format plugin only FieldFormatInstanceType, IFieldFormat, FieldFormatsStartCommon, + FieldFormatParams, + FieldFormatMetaParams, + FieldFormatConvert, + FieldFormatConvertFunction, + HtmlContextTypeConvert, + HtmlContextTypeOptions, + TextContextTypeConvert, + TextContextTypeOptions, } from './types'; diff --git a/src/plugins/field_formats/common/mocks.ts b/src/plugins/field_formats/common/mocks.ts index fa56afb2c277c..9d2038e18611a 100644 --- a/src/plugins/field_formats/common/mocks.ts +++ b/src/plugins/field_formats/common/mocks.ts @@ -15,12 +15,12 @@ export const fieldFormatsMock: IFieldFormatsRegistry = { getDefaultInstance: jest.fn().mockImplementation(() => ({ convert: jest.fn().mockImplementation((t: string) => t), getConverterFor: jest.fn().mockImplementation(() => (t: string) => t), - })) as any, + })), getDefaultInstanceCacheResolver: jest.fn(), getDefaultInstancePlain: jest.fn(), getDefaultType: jest.fn(), getDefaultTypeName: jest.fn(), - getInstance: jest.fn() as any, + getInstance: jest.fn(), getType: jest.fn(), getTypeNameByEsTypes: jest.fn(), init: jest.fn(), diff --git a/src/plugins/field_formats/common/types.ts b/src/plugins/field_formats/common/types.ts index c6048e1367a09..00f9f5d707e89 100644 --- a/src/plugins/field_formats/common/types.ts +++ b/src/plugins/field_formats/common/types.ts @@ -12,26 +12,44 @@ import { FieldFormatsRegistry } from './field_formats_registry'; /** @public **/ export type FieldFormatsContentType = 'html' | 'text'; -/** @internal **/ +/** + * Html converter options + */ export interface HtmlContextTypeOptions { - field?: any; - indexPattern?: any; - hit?: Record; + field?: { name: string }; + // TODO: get rid of indexPattern dep completely + indexPattern?: { + formatHit: (hit: { highlight: Record }) => Record; + }; + hit?: { highlight: Record }; } -/** @internal **/ +/** + * To html converter function + * @public + */ export type HtmlContextTypeConvert = (value: any, options?: HtmlContextTypeOptions) => string; -/** @internal **/ -export type TextContextTypeOptions = Record; +/** + * Plain text converter options + * @remark + * no options for now + */ +export type TextContextTypeOptions = object; -/** @internal **/ +/** + * To plain text converter function + * @public + */ export type TextContextTypeConvert = (value: any, options?: TextContextTypeOptions) => string; -/** @internal **/ +/** + * Converter function + * @public + */ export type FieldFormatConvertFunction = HtmlContextTypeConvert | TextContextTypeConvert; -/** @internal **/ +/** @public **/ export interface FieldFormatConvert { text: TextContextTypeConvert; html: HtmlContextTypeConvert; @@ -61,7 +79,7 @@ export enum FIELD_FORMAT_IDS { /** @public */ export interface FieldFormatConfig { id: FieldFormatId; - params: Record; + params: FieldFormatParams; es?: boolean; } @@ -74,10 +92,10 @@ export interface FieldFormatConfig { * This matches the signature of the public `core.uiSettings.get`, and * should only be used in scenarios where async access to uiSettings is * not possible. - * + * @public */ -export type FieldFormatsGetConfigFn = (key: string, defaultOverride?: T) => T; +export type FieldFormatsGetConfigFn = (key: string, defaultOverride?: T) => T; export type IFieldFormat = FieldFormat; @@ -86,9 +104,12 @@ export type IFieldFormat = FieldFormat; */ export type FieldFormatId = FIELD_FORMAT_IDS | string; -/** @internal **/ +/** + * Alternative to typeof {@link FieldFormat} but with specified ids + * @public + */ export type FieldFormatInstanceType = (new ( - params?: any, + params?: FieldFormatParams, getConfig?: FieldFormatsGetConfigFn ) => FieldFormat) & { // Static properties: @@ -98,8 +119,23 @@ export type FieldFormatInstanceType = (new ( fieldType: string | string[]; }; -export interface IFieldFormatMetaParams { - [key: string]: any; +/** + * Params provided when creating a formatter. + * Params are vary per formatter + * + * TODO: support strict typing for params depending on format type + * https://github.com/elastic/kibana/issues/108158 + */ +export interface FieldFormatParams { + [param: string]: any; +} + +/** + * Params provided by the registry to every field formatter + * + * @public + */ +export interface FieldFormatMetaParams { parsedUrl?: { origin: string; pathname?: string; @@ -116,7 +152,7 @@ export type FieldFormatsStartCommon = Omit> { +export interface SerializedFieldFormat { id?: string; params?: TParams; } diff --git a/src/plugins/field_formats/common/utils/as_pretty_string.ts b/src/plugins/field_formats/common/utils/as_pretty_string.ts index 52cdbe61d6b41..95424f00b2c44 100644 --- a/src/plugins/field_formats/common/utils/as_pretty_string.ts +++ b/src/plugins/field_formats/common/utils/as_pretty_string.ts @@ -9,7 +9,7 @@ /** * Convert a value to a presentable string */ -export function asPrettyString(val: any): string { +export function asPrettyString(val: unknown): string { if (val === null || val === undefined) return ' - '; switch (typeof val) { case 'string': diff --git a/src/plugins/field_formats/common/utils/highlight/highlight_html.ts b/src/plugins/field_formats/common/utils/highlight/highlight_html.ts index 250e238307363..8803a346b7a9e 100644 --- a/src/plugins/field_formats/common/utils/highlight/highlight_html.ts +++ b/src/plugins/field_formats/common/utils/highlight/highlight_html.ts @@ -10,7 +10,10 @@ import _ from 'lodash'; import { highlightTags } from './highlight_tags'; import { htmlTags } from './html_tags'; -export function getHighlightHtml(fieldValue: any, highlights: any) { +export function getHighlightHtml( + fieldValue: string | object, + highlights: string[] | undefined | null +) { let highlightHtml = typeof fieldValue === 'object' ? JSON.stringify(fieldValue) : fieldValue; _.each(highlights, function (highlight) { diff --git a/src/plugins/field_formats/common/utils/highlight/highlight_request.test.ts b/src/plugins/field_formats/common/utils/highlight/highlight_request.test.ts index a2a754b9e31f6..a8c20467f1300 100644 --- a/src/plugins/field_formats/common/utils/highlight/highlight_request.test.ts +++ b/src/plugins/field_formats/common/utils/highlight/highlight_request.test.ts @@ -9,19 +9,12 @@ import { getHighlightRequest } from './highlight_request'; describe('getHighlightRequest', () => { - const queryStringQuery = { query_string: { query: 'foo' } }; - test('should be a function', () => { expect(getHighlightRequest).toBeInstanceOf(Function); }); - test('should not modify the original query', () => { - getHighlightRequest(queryStringQuery, true); - expect(queryStringQuery.query_string).not.toHaveProperty('highlight'); - }); - test('should return undefined if highlighting is turned off', () => { - const request = getHighlightRequest(queryStringQuery, false); + const request = getHighlightRequest(false); expect(request).toBe(undefined); }); }); diff --git a/src/plugins/field_formats/common/utils/highlight/highlight_request.ts b/src/plugins/field_formats/common/utils/highlight/highlight_request.ts index fb87c29d4cc2c..369d68aabdf39 100644 --- a/src/plugins/field_formats/common/utils/highlight/highlight_request.ts +++ b/src/plugins/field_formats/common/utils/highlight/highlight_request.ts @@ -10,7 +10,7 @@ import { highlightTags } from './highlight_tags'; const FRAGMENT_SIZE = Math.pow(2, 31) - 1; // Max allowed value for fragment_size (limit of a java int) -export function getHighlightRequest(query: any, shouldHighlight: boolean) { +export function getHighlightRequest(shouldHighlight: boolean) { if (!shouldHighlight) return; return { diff --git a/src/plugins/field_formats/common/utils/shorten_dotted_string.ts b/src/plugins/field_formats/common/utils/shorten_dotted_string.ts index 53f7471913dc3..31c0f609ac5a3 100644 --- a/src/plugins/field_formats/common/utils/shorten_dotted_string.ts +++ b/src/plugins/field_formats/common/utils/shorten_dotted_string.ts @@ -12,8 +12,8 @@ const DOT_PREFIX_RE = /(.).+?\./g; * Convert a dot.notated.string into a short * version (d.n.string) * - * @return {any} + * @return {unknown} */ -export function shortenDottedString(input: any) { +export function shortenDottedString(input: unknown) { return typeof input !== 'string' ? input : input.replace(DOT_PREFIX_RE, '$1.'); } diff --git a/src/plugins/field_formats/jest.config.js b/src/plugins/field_formats/jest.config.js index ea20fcfec6d09..6fc68ab97526e 100644 --- a/src/plugins/field_formats/jest.config.js +++ b/src/plugins/field_formats/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/field_formats'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/field_formats', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/field_formats/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/field_formats/public/lib/converters/date.test.ts b/src/plugins/field_formats/public/lib/converters/date.test.ts index f4279fe5f9a7c..a9152b201b1a4 100644 --- a/src/plugins/field_formats/public/lib/converters/date.test.ts +++ b/src/plugins/field_formats/public/lib/converters/date.test.ts @@ -8,17 +8,23 @@ import moment from 'moment-timezone'; import { DateFormat } from './date'; +import { FieldFormatsGetConfigFn } from '../../../common'; describe('Date Format', () => { let convert: Function; - let mockConfig: Record; + let mockConfig: { + dateFormat: string; + 'dateFormat:tz': string; + [other: string]: string; + }; beforeEach(() => { - mockConfig = {}; - mockConfig.dateFormat = 'MMMM Do YYYY, HH:mm:ss.SSS'; - mockConfig['dateFormat:tz'] = 'Browser'; + mockConfig = { + dateFormat: 'MMMM Do YYYY, HH:mm:ss.SSS', + 'dateFormat:tz': 'Browser', + }; - const getConfig = (key: string) => mockConfig[key]; + const getConfig: FieldFormatsGetConfigFn = (key: string) => mockConfig[key]; const date = new DateFormat({}, getConfig); diff --git a/src/plugins/field_formats/public/lib/converters/date.ts b/src/plugins/field_formats/public/lib/converters/date.ts index acc051afd6b1d..1b0d9354fc04a 100644 --- a/src/plugins/field_formats/public/lib/converters/date.ts +++ b/src/plugins/field_formats/public/lib/converters/date.ts @@ -31,7 +31,7 @@ export class DateFormat extends FieldFormat { }; } - textConvert: TextContextTypeConvert = (val) => { + textConvert: TextContextTypeConvert = (val: string | number) => { // don't give away our ref to converter so // we can hot-swap when config changes const pattern = this.param('pattern'); @@ -43,7 +43,7 @@ export class DateFormat extends FieldFormat { this.timeZone = timezone; this.memoizedPattern = pattern; - this.memoizedConverter = memoize(function converter(value: any) { + this.memoizedConverter = memoize(function converter(value: string | number) { if (value === null || value === undefined) { return '-'; } diff --git a/src/plugins/field_formats/server/lib/converters/date_nanos_server.test.ts b/src/plugins/field_formats/server/lib/converters/date_nanos_server.test.ts index 86f0b2a7dc875..762ee172e921b 100644 --- a/src/plugins/field_formats/server/lib/converters/date_nanos_server.test.ts +++ b/src/plugins/field_formats/server/lib/converters/date_nanos_server.test.ts @@ -11,15 +11,20 @@ import { FieldFormatsGetConfigFn } from '../../../common'; describe('Date Nanos Format: Server side edition', () => { let convert: Function; - let mockConfig: Record; + let mockConfig: { + dateNanosFormat: string; + 'dateFormat:tz': string; + [other: string]: string; + }; let getConfig: FieldFormatsGetConfigFn; const dateTime = '2019-05-05T14:04:56.201900001Z'; beforeEach(() => { - mockConfig = {}; - mockConfig.dateNanosFormat = 'MMMM Do YYYY, HH:mm:ss.SSSSSSSSS'; - mockConfig['dateFormat:tz'] = 'Browser'; + mockConfig = { + dateNanosFormat: 'MMMM Do YYYY, HH:mm:ss.SSSSSSSSS', + 'dateFormat:tz': 'Browser', + }; getConfig = (key: string) => mockConfig[key]; }); diff --git a/src/plugins/field_formats/server/lib/converters/date_nanos_server.ts b/src/plugins/field_formats/server/lib/converters/date_nanos_server.ts index d47475f6274fa..b273ee6008cf3 100644 --- a/src/plugins/field_formats/server/lib/converters/date_nanos_server.ts +++ b/src/plugins/field_formats/server/lib/converters/date_nanos_server.ts @@ -16,7 +16,7 @@ import { import { TextContextTypeConvert } from '../../../common/types'; class DateNanosFormatServer extends DateNanosFormat { - textConvert: TextContextTypeConvert = (val) => { + textConvert: TextContextTypeConvert = (val: string | number) => { // don't give away our ref to converter so // we can hot-swap when config changes const pattern = this.param('pattern'); @@ -30,7 +30,7 @@ class DateNanosFormatServer extends DateNanosFormat { this.timeZone = timezone; this.memoizedPattern = pattern; - this.memoizedConverter = memoize((value: any) => { + this.memoizedConverter = memoize((value: string | number) => { if (value === null || value === undefined) { return '-'; } @@ -44,16 +44,16 @@ class DateNanosFormatServer extends DateNanosFormat { if (this.timeZone === 'Browser') { // Assume a warning has been logged that this can be unpredictable. It // would be too verbose to log anything here. - date = moment.utc(val); + date = moment.utc(value); } else { - date = moment.utc(val).tz(this.timeZone); + date = moment.utc(value).tz(this.timeZone); } if (typeof value !== 'string' && date.isValid()) { // fallback for max/min aggregation, where unixtime in ms is returned as a number // aggregations in Elasticsearch generally just return ms return date.format(fallbackPattern); - } else if (date.isValid()) { + } else if (date.isValid() && typeof value === 'string') { return formatWithNanos(date, value, fractPattern); } else { return value; diff --git a/src/plugins/field_formats/server/lib/converters/date_server.ts b/src/plugins/field_formats/server/lib/converters/date_server.ts index bf2151db0072c..56be3dcf3d360 100644 --- a/src/plugins/field_formats/server/lib/converters/date_server.ts +++ b/src/plugins/field_formats/server/lib/converters/date_server.ts @@ -11,7 +11,11 @@ import { memoize, noop } from 'lodash'; import moment from 'moment-timezone'; import { KBN_FIELD_TYPES } from '@kbn/field-types'; import { FieldFormat, FIELD_FORMAT_IDS, FieldFormatsGetConfigFn } from '../../../common'; -import { IFieldFormatMetaParams, TextContextTypeConvert } from '../../../common/types'; +import { + FieldFormatMetaParams, + FieldFormatParams, + TextContextTypeConvert, +} from '../../../common/types'; export class DateFormat extends FieldFormat { static id = FIELD_FORMAT_IDS.DATE; @@ -24,10 +28,13 @@ export class DateFormat extends FieldFormat { private memoizedPattern: string = ''; private timeZone: string = ''; - constructor(params: IFieldFormatMetaParams, getConfig?: FieldFormatsGetConfigFn) { + constructor( + params?: FieldFormatParams & FieldFormatMetaParams, + getConfig?: FieldFormatsGetConfigFn + ) { super(params, getConfig); - this.memoizedConverter = memoize((val: any) => { + this.memoizedConverter = memoize((val: string | number) => { if (val == null) { return '-'; } @@ -61,7 +68,7 @@ export class DateFormat extends FieldFormat { }; } - textConvert: TextContextTypeConvert = (val) => { + textConvert: TextContextTypeConvert = (val: string | number) => { // don't give away our ref to converter so we can hot-swap when config changes const pattern = this.param('pattern'); const timezone = this.param('timezone'); diff --git a/src/plugins/field_formats/server/plugin.test.ts b/src/plugins/field_formats/server/plugin.test.ts index 266d724ce5e22..da598c69d027c 100644 --- a/src/plugins/field_formats/server/plugin.test.ts +++ b/src/plugins/field_formats/server/plugin.test.ts @@ -7,17 +7,20 @@ */ import { DateFormat } from './lib/converters/date_server'; -import { coreMock } from '../../../core/server/mocks'; +import { coreMock, httpServerMock } from '../../../core/server/mocks'; import { FieldFormatsPlugin } from './plugin'; describe('FieldFormats registry server plugin', () => { test('DateFormat is server version', async () => { const plugin = new FieldFormatsPlugin(coreMock.createPluginInitializerContext()); const pluginStart = await plugin.start(coreMock.createStart()); - const uiSettings = coreMock.createStart().uiSettings.asScopedToClient({} as any); + const soClient = coreMock + .createStart() + .savedObjects.getScopedClient(httpServerMock.createKibanaRequest()); + const uiSettings = coreMock.createStart().uiSettings.asScopedToClient(soClient); const fieldFormatsRegistry = await pluginStart.fieldFormatServiceFactory(uiSettings); - const DateFormatFromRegsitry = fieldFormatsRegistry.getTypeWithoutMetaParams('date'); + const DateFormatFromRegistry = fieldFormatsRegistry.getTypeWithoutMetaParams('date'); - expect(DateFormatFromRegsitry).toEqual(DateFormat); + expect(DateFormatFromRegistry).toEqual(DateFormat); }); }); diff --git a/src/plugins/field_formats/server/ui_settings.ts b/src/plugins/field_formats/server/ui_settings.ts index f24ddc60e1f97..9597cad5516d7 100644 --- a/src/plugins/field_formats/server/ui_settings.ts +++ b/src/plugins/field_formats/server/ui_settings.ts @@ -17,7 +17,7 @@ import { FORMATS_UI_SETTINGS } from '../common'; // default fallback in case the locale is not found. const numeralLanguageIds = [ 'en', - ...numeralLanguages.map((numeralLanguage: any) => { + ...numeralLanguages.map((numeralLanguage: { id: string }) => { return numeralLanguage.id; }), ]; @@ -201,7 +201,10 @@ export function getUiSettings(): Record> { type: 'select', options: numeralLanguageIds, optionLabels: Object.fromEntries( - numeralLanguages.map((language: Record) => [language.id, language.name]) + numeralLanguages.map((language: { id: string; name: string }) => [ + language.id, + language.name, + ]) ), description: i18n.translate('fieldFormats.advancedSettings.format.formattingLocaleText', { defaultMessage: `{numeralLanguageLink} locale`, diff --git a/src/plugins/home/common/instruction_variant.ts b/src/plugins/home/common/instruction_variant.ts index f27b2c97bdc1e..66c841cdc8b56 100644 --- a/src/plugins/home/common/instruction_variant.ts +++ b/src/plugins/home/common/instruction_variant.ts @@ -48,7 +48,7 @@ const DISPLAY_MAP = { [INSTRUCTION_VARIANT.LINUX]: 'Linux', [INSTRUCTION_VARIANT.PHP]: 'PHP', [INSTRUCTION_VARIANT.FLEET]: i18n.translate('home.tutorial.instruction_variant.fleet', { - defaultMessage: 'Elastic APM (beta) in Fleet', + defaultMessage: 'Elastic APM in Fleet', }), }; diff --git a/src/plugins/home/jest.config.js b/src/plugins/home/jest.config.js index 5107cc001d32f..c7450ebbf3104 100644 --- a/src/plugins/home/jest.config.js +++ b/src/plugins/home/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/home'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/home', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/home/{common,public,server}/**/*.{js,ts,tsx}'], }; diff --git a/src/plugins/home/public/application/components/__snapshots__/recently_accessed.test.js.snap b/src/plugins/home/public/application/components/__snapshots__/recently_accessed.test.js.snap index c9fd411ab6070..09ca9c0c16f8a 100644 --- a/src/plugins/home/public/application/components/__snapshots__/recently_accessed.test.js.snap +++ b/src/plugins/home/public/application/components/__snapshots__/recently_accessed.test.js.snap @@ -45,6 +45,7 @@ exports[`render 1`] = ` anchorClassName="homRecentlyAccessed__anchor" content="label0" delay="regular" + display="inlineBlock" position="bottom" > { - useMount(() => { - const { urlForwarding } = getServices(); - urlForwarding.navigateToDefaultApp(); - }); - return null; -}; export function HomeApp({ directories, solutions }) { const { @@ -75,10 +66,10 @@ export function HomeApp({ directories, solutions }) { localStorage={localStorage} urlBasePath={getBasePath()} telemetry={telemetry} - hasUserIndexPattern={() => indexPatternService.hasUserIndexPattern()} + hasUserIndexPattern={() => indexPatternService.hasUserDataView()} /> - + diff --git a/src/plugins/home/public/plugin.ts b/src/plugins/home/public/plugin.ts index 7dd1d8728ad7f..f6a1566b267ac 100644 --- a/src/plugins/home/public/plugin.ts +++ b/src/plugins/home/public/plugin.ts @@ -14,7 +14,6 @@ import { PluginInitializerContext, } from 'kibana/public'; import { i18n } from '@kbn/i18n'; -import { first } from 'rxjs/operators'; import { EnvironmentService, @@ -137,27 +136,9 @@ export class HomePublicPlugin }; } - public start( - { application: { capabilities, currentAppId$ }, http }: CoreStart, - { urlForwarding }: HomePluginStartDependencies - ) { + public start({ application: { capabilities } }: CoreStart) { this.featuresCatalogueRegistry.start({ capabilities }); - // If the home app is the initial location when loading Kibana... - if ( - window.location.pathname === http.basePath.prepend(HOME_APP_BASE_PATH) && - window.location.hash === '' - ) { - // ...wait for the app to mount initially and then... - currentAppId$.pipe(first()).subscribe((appId) => { - if (appId === 'home') { - // ...navigate to default app set by `kibana.defaultAppId`. - // This doesn't do anything as along as the default settings are kept. - urlForwarding.navigateToDefaultApp({ overwriteHash: false }); - } - }); - } - return { featureCatalogue: this.featuresCatalogueRegistry }; } } diff --git a/src/plugins/home/server/services/new_instance_status.ts b/src/plugins/home/server/services/new_instance_status.ts index 00223589a8d41..b72ada27ecbad 100644 --- a/src/plugins/home/server/services/new_instance_status.ts +++ b/src/plugins/home/server/services/new_instance_status.ts @@ -7,7 +7,7 @@ */ import type { IScopedClusterClient, SavedObjectsClientContract } from '../../../../core/server'; -import type { IndexPatternSavedObjectAttrs } from '../../../data/common/index_patterns/index_patterns'; +import type { IndexPatternSavedObjectAttrs } from '../../../data/common/data_views/data_views'; const LOGS_INDEX_PATTERN = 'logs-*'; const METRICS_INDEX_PATTERN = 'metrics-*'; diff --git a/src/plugins/home/server/services/sample_data/data_sets/logs/logs.json.gz b/src/plugins/home/server/services/sample_data/data_sets/logs/logs.json.gz index 0b0ecf3a2a409..241b5cecb71c9 100644 Binary files a/src/plugins/home/server/services/sample_data/data_sets/logs/logs.json.gz and b/src/plugins/home/server/services/sample_data/data_sets/logs/logs.json.gz differ diff --git a/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts b/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts index b8b8adba307db..f7e8c824030bd 100644 --- a/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts +++ b/src/plugins/home/server/services/sample_data/data_sets/logs/saved_objects.ts @@ -43,7 +43,7 @@ export const getSavedObjects = (): SavedObject[] => [ }, attributes: { title: i18n.translate('home.sampleData.logsSpec.heatmapTitle', { - defaultMessage: '[Logs] Unique Visitor Heatmap', + defaultMessage: '[Logs] Unique Destination Heatmap', }), description: '', kibanaSavedObjectMeta: { @@ -52,7 +52,7 @@ export const getSavedObjects = (): SavedObject[] => [ uiStateJSON: '{}', version: 1, visState: - '{"title":"[Logs] Unique Visitor 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.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 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"}}', + '{"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"}}', }, references: [], }, @@ -116,10 +116,10 @@ export const getSavedObjects = (): SavedObject[] => [ migrationVersion: {}, attributes: { title: i18n.translate('home.sampleData.logsSpec.sourceAndDestinationSankeyChartTitle', { - defaultMessage: '[Logs] Source and Destination Sankey Chart', + defaultMessage: '[Logs] Machine OS and Destination Sankey Chart', }), visState: - '{"title":"[Logs] Source 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: \\"geo.src\\"}\\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":[]}', + '{"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":[]}', uiStateJSON: '{}', description: '', version: 1, diff --git a/src/plugins/index_pattern_editor/jest.config.js b/src/plugins/index_pattern_editor/jest.config.js index 0a018a42d06e6..bdf5fd8a0e9e2 100644 --- a/src/plugins/index_pattern_editor/jest.config.js +++ b/src/plugins/index_pattern_editor/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/index_pattern_editor'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/index_pattern_editor', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/index_pattern_editor/public/**/*.{ts,tsx}'], }; diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_prompts.tsx b/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_prompts.tsx index 246466680c86e..591d3975acae7 100644 --- a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_prompts.tsx +++ b/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_prompts.tsx @@ -56,7 +56,7 @@ export const EmptyPrompts: FC = ({ allSources, onCancel, children, loadSo const hasDataIndices = allSources.some(isUserDataIndex); const hasUserIndexPattern = useAsync(() => - indexPatternService.hasUserIndexPattern().catch(() => true) + indexPatternService.hasUserDataView().catch(() => true) ); useEffect(() => { diff --git a/src/plugins/index_pattern_field_editor/jest.config.js b/src/plugins/index_pattern_field_editor/jest.config.js index fc358c37116c9..e1f8f57038e26 100644 --- a/src/plugins/index_pattern_field_editor/jest.config.js +++ b/src/plugins/index_pattern_field_editor/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/index_pattern_field_editor'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/index_pattern_field_editor', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/index_pattern_field_editor/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/duration/duration.tsx b/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/duration/duration.tsx index 24582e853d38f..78dcc0f058075 100644 --- a/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/duration/duration.tsx +++ b/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/duration/duration.tsx @@ -105,7 +105,7 @@ export class DurationFormatEditor extends DefaultFormatEditor< { + options={(format.type as typeof DurationFormat).inputFormats.map((fmt: InputFormat) => { return { value: fmt.kind, text: fmt.text, @@ -129,12 +129,14 @@ export class DurationFormatEditor extends DefaultFormatEditor< { - return { - value: fmt.method, - text: fmt.text, - }; - })} + options={(format.type as typeof DurationFormat).outputFormats.map( + (fmt: OutputFormat) => { + return { + value: fmt.method, + text: fmt.text, + }; + } + )} onChange={(e) => { this.onChange({ outputFormat: e.target.value }); }} diff --git a/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/string/string.tsx b/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/string/string.tsx index c5d53a0ce9c95..586700042a2ee 100644 --- a/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/string/string.tsx +++ b/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/string/string.tsx @@ -15,16 +15,12 @@ import { DefaultFormatEditor, defaultState } from '../default/default'; import { FormatEditorSamples } from '../../samples'; import { formatId } from './constants'; +import { StringFormat } from '../../../../../../field_formats/common'; interface StringFormatEditorFormatParams { transform: string; } -interface TransformOptions { - kind: string; - text: string; -} - export class StringFormatEditor extends DefaultFormatEditor { static formatId = formatId; state = { @@ -40,7 +36,7 @@ export class StringFormatEditor extends DefaultFormatEditor { + options={((format.type as typeof StringFormat).transformOptions || []).map((option) => { return { - value: option.kind, + value: option.kind as string, text: option.text, }; })} diff --git a/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/url/url.tsx b/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/url/url.tsx index b5627a16732d8..4690e2ca453a1 100644 --- a/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/url/url.tsx +++ b/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/url/url.tsx @@ -25,6 +25,7 @@ import { formatId } from './constants'; import { context as contextType } from '../../../../../../kibana_react/public'; import { FormatEditorProps } from '../types'; +import { UrlFormat } from '../../../../../../field_formats/common'; interface OnChangeParam { type: string; @@ -144,7 +145,7 @@ export class UrlFormatEditor extends DefaultFormatEditor< }; render() { - const { format, formatParams } = this.props; + const { formatParams, format } = this.props; const { error, samples, sampleConverterType } = this.state; return ( @@ -157,7 +158,7 @@ export class UrlFormatEditor extends DefaultFormatEditor< { + options={(format.type as typeof UrlFormat).urlTypes.map((type: UrlType) => { return { value: type.kind, text: type.text, diff --git a/src/plugins/index_pattern_management/jest.config.js b/src/plugins/index_pattern_management/jest.config.js index 8383d3bb6110d..6249d44e6b31f 100644 --- a/src/plugins/index_pattern_management/jest.config.js +++ b/src/plugins/index_pattern_management/jest.config.js @@ -11,4 +11,9 @@ module.exports = { rootDir: '../../..', roots: ['/src/plugins/index_pattern_management'], testRunner: 'jasmine2', + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/index_pattern_management', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/index_pattern_management/{public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx index e6aa87172ca0b..75da4dce74368 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { ScriptedFieldsTable } from '../scripted_fields_table'; -import { IIndexPattern, IndexPattern } from '../../../../../../plugins/data/common/index_patterns'; +import { IIndexPattern, IndexPattern } from '../../../../../../plugins/data/common'; jest.mock('@elastic/eui', () => ({ EuiTitle: 'eui-title', diff --git a/src/plugins/index_pattern_management/public/components/index_pattern_table/index_pattern_table.tsx b/src/plugins/index_pattern_management/public/components/index_pattern_table/index_pattern_table.tsx index c8617808b10ec..f82d30aff8086 100644 --- a/src/plugins/index_pattern_management/public/components/index_pattern_table/index_pattern_table.tsx +++ b/src/plugins/index_pattern_management/public/components/index_pattern_table/index_pattern_table.tsx @@ -83,7 +83,7 @@ export const IndexPatternTable = ({ setIsLoadingIndexPatterns(false); if ( gettedIndexPatterns.length === 0 || - !(await data.dataViews.hasUserIndexPattern().catch(() => false)) + !(await data.dataViews.hasUserDataView().catch(() => false)) ) { setShowCreateDialog(true); } diff --git a/src/plugins/input_control_vis/jest.config.js b/src/plugins/input_control_vis/jest.config.js index 060ab9ff1a126..207a0b5265417 100644 --- a/src/plugins/input_control_vis/jest.config.js +++ b/src/plugins/input_control_vis/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/input_control_vis'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/input_control_vis', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/input_control_vis/public/**/*.{ts,tsx}'], }; diff --git a/src/plugins/input_control_vis/public/components/vis/__snapshots__/form_row.test.tsx.snap b/src/plugins/input_control_vis/public/components/vis/__snapshots__/form_row.test.tsx.snap index ba183cc40b126..8a4f9b930f4a7 100644 --- a/src/plugins/input_control_vis/public/components/vis/__snapshots__/form_row.test.tsx.snap +++ b/src/plugins/input_control_vis/public/components/vis/__snapshots__/form_row.test.tsx.snap @@ -14,6 +14,7 @@ exports[`renders control with warning 1`] = `
diff --git a/src/plugins/inspector/jest.config.js b/src/plugins/inspector/jest.config.js index 67e90f449fa76..3583a69a94bd9 100644 --- a/src/plugins/inspector/jest.config.js +++ b/src/plugins/inspector/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/inspector'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/inspector', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/inspector/{common,public}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/interactive_setup/common/constants.ts b/src/plugins/interactive_setup/common/constants.ts new file mode 100644 index 0000000000000..00a3efc316cd9 --- /dev/null +++ b/src/plugins/interactive_setup/common/constants.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 const VERIFICATION_CODE_LENGTH = 6; diff --git a/src/plugins/interactive_setup/common/index.ts b/src/plugins/interactive_setup/common/index.ts index ab8c00cfa5a8e..3833873eb2a18 100644 --- a/src/plugins/interactive_setup/common/index.ts +++ b/src/plugins/interactive_setup/common/index.ts @@ -8,3 +8,4 @@ export type { InteractiveSetupViewState, EnrollmentToken, Certificate, PingResult } from './types'; export { ElasticsearchConnectionStatus } from './elasticsearch_connection_status'; +export { VERIFICATION_CODE_LENGTH } from './constants'; diff --git a/src/plugins/interactive_setup/jest.config.js b/src/plugins/interactive_setup/jest.config.js index e9f1f479d66aa..e187f7b31e2fc 100644 --- a/src/plugins/interactive_setup/jest.config.js +++ b/src/plugins/interactive_setup/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/interactive_setup'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/interactive_setup', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/interactive_setup/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/interactive_setup/public/app.tsx b/src/plugins/interactive_setup/public/app.tsx index 0c206cb4fa215..da1318d84cf03 100644 --- a/src/plugins/interactive_setup/public/app.tsx +++ b/src/plugins/interactive_setup/public/app.tsx @@ -20,7 +20,11 @@ import { ClusterConfigurationForm } from './cluster_configuration_form'; import { EnrollmentTokenForm } from './enrollment_token_form'; import { ProgressIndicator } from './progress_indicator'; -export const App: FunctionComponent = () => { +export interface AppProps { + onSuccess?(): void; +} + +export const App: FunctionComponent = ({ onSuccess }) => { const [page, setPage] = useState<'token' | 'manual' | 'success'>('token'); const [cluster, setCluster] = useState< Omit @@ -71,9 +75,7 @@ export const App: FunctionComponent = () => { /> )}
- {page === 'success' && ( - window.location.replace(window.location.href)} /> - )} + {page === 'success' && }
diff --git a/src/plugins/interactive_setup/public/cluster_address_form.tsx b/src/plugins/interactive_setup/public/cluster_address_form.tsx index ba7b1d46182a1..6f97680066373 100644 --- a/src/plugins/interactive_setup/public/cluster_address_form.tsx +++ b/src/plugins/interactive_setup/public/cluster_address_form.tsx @@ -51,7 +51,7 @@ export const ClusterAddressForm: FunctionComponent = ({ const [form, eventHandlers] = useForm({ defaultValues, validate: async (values) => { - const errors: ValidationErrors = {}; + const errors: ValidationErrors = {}; if (!values.host) { errors.host = i18n.translate('interactiveSetup.clusterAddressForm.hostRequiredError', { diff --git a/src/plugins/interactive_setup/public/cluster_configuration_form.tsx b/src/plugins/interactive_setup/public/cluster_configuration_form.tsx index cd3541fe0318f..dfb5148ddb288 100644 --- a/src/plugins/interactive_setup/public/cluster_configuration_form.tsx +++ b/src/plugins/interactive_setup/public/cluster_configuration_form.tsx @@ -26,6 +26,7 @@ import { } from '@elastic/eui'; import type { FunctionComponent } from 'react'; import React from 'react'; +import useUpdateEffect from 'react-use/lib/useUpdateEffect'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; @@ -37,6 +38,8 @@ import type { ValidationErrors } from './use_form'; import { useForm } from './use_form'; import { useHtmlId } from './use_html_id'; import { useHttp } from './use_http'; +import { useVerification } from './use_verification'; +import { useVisibility } from './use_visibility'; export interface ClusterConfigurationFormValues { username: string; @@ -66,10 +69,10 @@ export const ClusterConfigurationForm: FunctionComponent { const http = useHttp(); - + const { status, getCode } = useVerification(); const [form, eventHandlers] = useForm({ defaultValues, - validate: async (values) => { + validate: (values) => { const errors: ValidationErrors = {}; if (authRequired) { @@ -93,7 +96,7 @@ export const ClusterConfigurationForm: FunctionComponent(); const trustCaCertId = useHtmlId('clusterConfigurationForm', 'trustCaCert'); + useUpdateEffect(() => { + if (status === 'verified' && isVisible) { + form.submit(); + } + }, [status]); + return ( - {form.submitError && ( + {status !== 'unverified' && !form.isSubmitting && !form.isValidating && form.submitError && ( <> )} - - {authRequired ? ( <> )} - {certificateChain && certificateChain.length > 0 && ( <> { const intermediateCa = certificateChain[Math.min(1, certificateChain.length - 1)]; - form.setValue('caCert', form.values.caCert ? '' : intermediateCa.raw); form.setTouched('caCert'); + form.setValue('caCert', form.values.caCert ? '' : intermediateCa.raw); }} > @@ -252,7 +259,6 @@ export const ClusterConfigurationForm: FunctionComponent )} - @@ -264,6 +270,7 @@ export const ClusterConfigurationForm: FunctionComponent = onSuccess, }) => { const http = useHttp(); + const { status, getCode } = useVerification(); const [form, eventHandlers] = useForm({ defaultValues, validate: (values) => { @@ -77,17 +80,25 @@ export const EnrollmentTokenForm: FunctionComponent = hosts: decoded.adr, apiKey: decoded.key, caFingerprint: decoded.fgr, + code: getCode(), }), }); onSuccess?.(); }, }); + const [isVisible, buttonRef] = useVisibility(); + + useUpdateEffect(() => { + if (status === 'verified' && isVisible) { + form.submit(); + } + }, [status]); const enrollmentToken = decodeEnrollmentToken(form.values.token); return ( - {form.submitError && ( + {status !== 'unverified' && !form.isSubmitting && !form.isValidating && form.submitError && ( <> = = ( defaultMessage="Connect to" /> - - - - {token.adr[0]} - - - - - - + + {token.adr[0]} + diff --git a/src/plugins/interactive_setup/public/plugin.tsx b/src/plugins/interactive_setup/public/plugin.tsx index 00fd38d3e78a4..9d58479081234 100644 --- a/src/plugins/interactive_setup/public/plugin.tsx +++ b/src/plugins/interactive_setup/public/plugin.tsx @@ -15,6 +15,7 @@ import type { CoreSetup, CoreStart, HttpSetup, Plugin } from 'src/core/public'; import { App } from './app'; import { HttpProvider } from './use_http'; +import { VerificationProvider } from './use_verification'; export class InteractiveSetupPlugin implements Plugin { public setup(core: CoreSetup) { @@ -24,9 +25,16 @@ export class InteractiveSetupPlugin implements Plugin { appRoute: '/', chromeless: true, mount: (params) => { + const url = new URL(window.location.href); + const defaultCode = url.searchParams.get('code') || undefined; + const onSuccess = () => { + url.searchParams.delete('code'); + window.location.replace(url.href); + }; + ReactDOM.render( - - + + , params.element ); @@ -40,10 +48,13 @@ export class InteractiveSetupPlugin implements Plugin { export interface ProvidersProps { http: HttpSetup; + defaultCode?: string; } -export const Providers: FunctionComponent = ({ http, children }) => ( +export const Providers: FunctionComponent = ({ defaultCode, http, children }) => ( - {children} + + {children} + ); diff --git a/src/plugins/interactive_setup/public/single_chars_field.tsx b/src/plugins/interactive_setup/public/single_chars_field.tsx new file mode 100644 index 0000000000000..18ecd38e6483a --- /dev/null +++ b/src/plugins/interactive_setup/public/single_chars_field.tsx @@ -0,0 +1,142 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { EuiFieldText, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import type { FunctionComponent, ReactNode } from 'react'; +import React, { useEffect, useRef } from 'react'; +import useList from 'react-use/lib/useList'; +import useUpdateEffect from 'react-use/lib/useUpdateEffect'; + +import { i18n } from '@kbn/i18n'; +import { euiThemeVars } from '@kbn/ui-shared-deps/theme'; + +export interface SingleCharsFieldProps { + defaultValue: string; + length: number; + separator?: number; + pattern?: RegExp; + onChange(value: string): void; + isInvalid?: boolean; + autoFocus?: boolean; +} + +export const SingleCharsField: FunctionComponent = ({ + defaultValue, + length, + separator, + pattern = /^[0-9]$/, + onChange, + isInvalid, + autoFocus = false, +}) => { + // Strip any invalid characters from input or clipboard and restrict length. + const sanitize = (str: string) => { + return str + .split('') + .filter((char) => char.match(pattern)) + .join('') + .substr(0, length); + }; + + const inputRefs = useRef>([]); + const [chars, { set, updateAt }] = useList(sanitize(defaultValue).split('')); + + const focusField = (i: number) => { + const input = inputRefs.current[i]; + if (input) { + input.focus(); + } + }; + + // Trigger `onChange` callback when characters change + useUpdateEffect(() => { + onChange(chars.join('')); + }, [chars]); + + // Focus first field on initial render + useEffect(() => { + if (autoFocus) { + focusField(0); + } + }, [autoFocus]); + + const children: ReactNode[] = []; + for (let i = 0; i < length; i++) { + if (separator && i !== 0 && i % separator === 0) { + children.push( + + ); + } + + children.push( + + { + inputRefs.current[i] = el; + }} + value={chars[i] ?? ''} + onChange={(event) => { + // Ensure event doesn't bubble up since we manage our own `onChange` event + event.stopPropagation(); + }} + onInput={(event) => { + // Ignore input if invalid character was entered (unless empty) + if (event.currentTarget.value !== '' && sanitize(event.currentTarget.value) === '') { + return event.preventDefault(); + } + updateAt(i, event.currentTarget.value); + // Do not focus the next field if value is empty (e.g. when hitting backspace) + if (event.currentTarget.value) { + focusField(i + 1); + } + }} + onKeyDown={(event) => { + if (event.key === 'Backspace') { + // Clear previous field if current field is already empty + if (event.currentTarget.value === '') { + updateAt(i - 1, event.currentTarget.value); + focusField(i - 1); + } + } else if (event.key === 'ArrowLeft') { + focusField(i - 1); + } else if (event.key === 'ArrowRight') { + focusField(i + 1); + } + }} + onPaste={(event) => { + const text = sanitize(event.clipboardData.getData('text')); + set(text.split('')); + focusField(Math.min(text.length, length - 1)); + event.preventDefault(); + }} + onFocus={(event) => { + const input = event.currentTarget; + setTimeout(() => input.select(), 0); + }} + maxLength={1} + isInvalid={isInvalid} + style={{ textAlign: 'center' }} + aria-label={i18n.translate('interactiveSetup.singleCharsField.digitLabel', { + defaultMessage: 'Digit {index}', + values: { index: i + 1 }, + })} + /> + + ); + } + + return ( + + {children} + + ); +}; diff --git a/src/plugins/interactive_setup/public/use_form.ts b/src/plugins/interactive_setup/public/use_form.ts index 8ed1d89ea087e..abd00edee6750 100644 --- a/src/plugins/interactive_setup/public/use_form.ts +++ b/src/plugins/interactive_setup/public/use_form.ts @@ -9,7 +9,7 @@ import { set } from '@elastic/safer-lodash-set'; import { cloneDeep, cloneDeepWith, get } from 'lodash'; import type { ChangeEventHandler, FocusEventHandler, ReactEventHandler } from 'react'; -import { useRef } from 'react'; +import { useState } from 'react'; import useAsyncFn from 'react-use/lib/useAsyncFn'; export type FormReturnTuple = [FormState, FormProps]; @@ -81,12 +81,11 @@ export type ValidationErrors = DeepMap; export type TouchedFields = DeepMap; export interface FormState { - setValue(name: string, value: any, revalidate?: boolean): Promise; + setValue(name: string, value: any): Promise; setError(name: string, message: string): void; - setTouched(name: string, touched?: boolean, revalidate?: boolean): Promise; - reset(values: Values): void; + setTouched(name: string): Promise; + reset(values?: Values): void; submit(): Promise; - validate(): Promise>; values: Values; errors: ValidationErrors; touched: TouchedFields; @@ -123,63 +122,75 @@ export function useFormState({ validate, defaultValues, }: FormOptions): FormState { - const valuesRef = useRef(defaultValues); - const errorsRef = useRef>({}); - const touchedRef = useRef>({}); - const submitCountRef = useRef(0); - - const [validationState, validateForm] = useAsyncFn(async (formValues: Values) => { + const [values, setValues] = useState(defaultValues); + const [errors, setErrors] = useState>({}); + const [touched, setTouched] = useState>({}); + const [submitCount, setSubmitCount] = useState(0); + + async function validateFormFn(formValues: Values): Promise; + async function validateFormFn(formValues: undefined): Promise; + async function validateFormFn(formValues: Values | undefined) { + // Allows resetting `useAsyncFn` state + if (!formValues) { + return Promise.resolve(undefined); + } const nextErrors = await validate(formValues); - errorsRef.current = nextErrors; + setErrors(nextErrors); if (Object.keys(nextErrors).length === 0) { - submitCountRef.current = 0; + setSubmitCount(0); } return nextErrors; - }, []); + } - const [submitState, submitForm] = useAsyncFn(async (formValues: Values) => { + async function submitFormFn(formValues: Values): Promise; + async function submitFormFn(formValues: undefined): Promise; + async function submitFormFn(formValues: Values | undefined) { + // Allows resetting `useAsyncFn` state + if (!formValues) { + return Promise.resolve(undefined); + } const nextErrors = await validateForm(formValues); - touchedRef.current = mapDeep(formValues, true); - submitCountRef.current += 1; + setTouched(mapDeep(formValues, true)); + setSubmitCount(submitCount + 1); if (Object.keys(nextErrors).length === 0) { return onSubmit(formValues); } - }, []); + } + + const [validationState, validateForm] = useAsyncFn(validateFormFn, [validate]); + const [submitState, submitForm] = useAsyncFn(submitFormFn, [validateForm, onSubmit]); return { - setValue: async (name, value, revalidate = true) => { - const nextValues = setDeep(valuesRef.current, name, value); - valuesRef.current = nextValues; - if (revalidate) { - await validateForm(nextValues); - } + setValue: async (name, value) => { + const nextValues = setDeep(values, name, value); + setValues(nextValues); + await validateForm(nextValues); }, - setTouched: async (name, touched = true, revalidate = true) => { - touchedRef.current = setDeep(touchedRef.current, name, touched); - if (revalidate) { - await validateForm(valuesRef.current); - } + setTouched: async (name, value = true) => { + setTouched(setDeep(touched, name, value)); + await validateForm(values); }, setError: (name, message) => { - errorsRef.current = setDeep(errorsRef.current, name, message); - touchedRef.current = setDeep(touchedRef.current, name, true); + setErrors(setDeep(errors, name, message)); + setTouched(setDeep(touched, name, true)); }, - reset: (nextValues) => { - valuesRef.current = nextValues; - errorsRef.current = {}; - touchedRef.current = {}; - submitCountRef.current = 0; + reset: (nextValues = defaultValues) => { + setValues(nextValues); + setErrors({}); + setTouched({}); + setSubmitCount(0); + validateForm(undefined); // Resets `validationState` + submitForm(undefined); // Resets `submitState` }, - submit: () => submitForm(valuesRef.current), - validate: () => validateForm(valuesRef.current), - values: valuesRef.current, - errors: errorsRef.current, - touched: touchedRef.current, + submit: () => submitForm(values), + values, + errors, + touched, isValidating: validationState.loading, isSubmitting: submitState.loading, submitError: submitState.error, - isInvalid: Object.keys(errorsRef.current).length > 0, - isSubmitted: submitCountRef.current > 0, + isInvalid: Object.keys(errors).length > 0, + isSubmitted: submitCount > 0, }; } diff --git a/src/plugins/interactive_setup/public/use_verification.tsx b/src/plugins/interactive_setup/public/use_verification.tsx new file mode 100644 index 0000000000000..62483ba9cb62e --- /dev/null +++ b/src/plugins/interactive_setup/public/use_verification.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { EuiModal, EuiModalHeader } from '@elastic/eui'; +import constate from 'constate'; +import type { FunctionComponent } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; + +import { useHttp } from './use_http'; +import { VerificationCodeForm } from './verification_code_form'; + +export interface VerificationProps { + defaultCode?: string; +} + +const [OuterVerificationProvider, useVerification] = constate( + ({ defaultCode }: VerificationProps) => { + const codeRef = useRef(defaultCode); + const [status, setStatus] = useState<'unknown' | 'unverified' | 'verified'>('unknown'); + + return { + status, + setStatus, + getCode() { + return codeRef.current; + }, + setCode(code: string | undefined) { + codeRef.current = code; + }, + }; + } +); + +const InnerVerificationProvider: FunctionComponent = ({ children }) => { + const http = useHttp(); + const { status, setStatus, setCode } = useVerification(); + + useEffect(() => { + return http.intercept({ + responseError: (error) => { + if (error.response?.status === 403) { + setStatus('unverified'); + setCode(undefined); + } + }, + }); + }, [http]); // eslint-disable-line react-hooks/exhaustive-deps + + return ( + <> + {status === 'unverified' && ( + setStatus('unknown')}> + + { + setStatus('verified'); + setCode(values.code); + }} + /> + + + )} + {children} + + ); +}; + +export const VerificationProvider: FunctionComponent = ({ + defaultCode, + children, +}) => { + return ( + + {children} + + ); +}; + +export { useVerification }; diff --git a/src/plugins/interactive_setup/public/use_visibility.ts b/src/plugins/interactive_setup/public/use_visibility.ts new file mode 100644 index 0000000000000..f21b5669a36aa --- /dev/null +++ b/src/plugins/interactive_setup/public/use_visibility.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 type { RefObject } from 'react'; +import { useRef } from 'react'; + +export type VisibilityReturnTuple = [boolean, RefObject]; + +export function useVisibility(): VisibilityReturnTuple { + const elementRef = useRef(null); + + // When an element is hidden using `display: none` or `hidden` attribute it has no offset parent. + return [!!elementRef.current?.offsetParent, elementRef]; +} diff --git a/src/plugins/interactive_setup/public/verification_code_form.test.tsx b/src/plugins/interactive_setup/public/verification_code_form.test.tsx new file mode 100644 index 0000000000000..2b7f1a86fcfad --- /dev/null +++ b/src/plugins/interactive_setup/public/verification_code_form.test.tsx @@ -0,0 +1,83 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { fireEvent, render, waitFor } from '@testing-library/react'; +import React from 'react'; + +import { coreMock } from 'src/core/public/mocks'; + +import { Providers } from './plugin'; +import { VerificationCodeForm } from './verification_code_form'; + +jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => ({ + htmlIdGenerator: () => () => `id-${Math.random()}`, +})); + +describe('VerificationCodeForm', () => { + jest.setTimeout(20_000); + + it('calls enrollment API when submitting form', async () => { + const coreStart = coreMock.createStart(); + coreStart.http.post.mockResolvedValue({}); + + const onSuccess = jest.fn(); + + const { findByRole, findByLabelText } = render( + + + + ); + fireEvent.input(await findByLabelText('Digit 1'), { + target: { value: '1' }, + }); + fireEvent.input(await findByLabelText('Digit 2'), { + target: { value: '2' }, + }); + fireEvent.input(await findByLabelText('Digit 3'), { + target: { value: '3' }, + }); + fireEvent.input(await findByLabelText('Digit 4'), { + target: { value: '4' }, + }); + fireEvent.input(await findByLabelText('Digit 5'), { + target: { value: '5' }, + }); + fireEvent.input(await findByLabelText('Digit 6'), { + target: { value: '6' }, + }); + fireEvent.click(await findByRole('button', { name: 'Verify', hidden: true })); + + await waitFor(() => { + expect(coreStart.http.post).toHaveBeenLastCalledWith('/internal/interactive_setup/verify', { + body: JSON.stringify({ code: '123456' }), + }); + expect(onSuccess).toHaveBeenCalled(); + }); + }); + + it('validates form', async () => { + const coreStart = coreMock.createStart(); + const onSuccess = jest.fn(); + + const { findAllByText, findByRole, findByLabelText } = render( + + + + ); + + fireEvent.click(await findByRole('button', { name: 'Verify', hidden: true })); + + await findAllByText(/Enter a verification code/i); + + fireEvent.input(await findByLabelText('Digit 1'), { + target: { value: '1' }, + }); + + await findAllByText(/Enter all six digits/i); + }); +}); diff --git a/src/plugins/interactive_setup/public/verification_code_form.tsx b/src/plugins/interactive_setup/public/verification_code_form.tsx new file mode 100644 index 0000000000000..8bea8229baec3 --- /dev/null +++ b/src/plugins/interactive_setup/public/verification_code_form.tsx @@ -0,0 +1,157 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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, + EuiCallOut, + EuiCode, + EuiEmptyPrompt, + EuiForm, + EuiFormRow, + EuiSpacer, + EuiText, +} from '@elastic/eui'; +import type { FunctionComponent } from 'react'; +import React from 'react'; + +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; +import type { IHttpFetchError } from 'kibana/public'; + +import { VERIFICATION_CODE_LENGTH } from '../common'; +import { SingleCharsField } from './single_chars_field'; +import type { ValidationErrors } from './use_form'; +import { useForm } from './use_form'; +import { useHttp } from './use_http'; + +export interface VerificationCodeFormValues { + code: string; +} + +export interface VerificationCodeFormProps { + defaultValues?: VerificationCodeFormValues; + onSuccess?(values: VerificationCodeFormValues): void; +} + +export const VerificationCodeForm: FunctionComponent = ({ + defaultValues = { + code: '', + }, + onSuccess, +}) => { + const http = useHttp(); + const [form, eventHandlers] = useForm({ + defaultValues, + validate: async (values) => { + const errors: ValidationErrors = {}; + + if (!values.code) { + errors.code = i18n.translate('interactiveSetup.verificationCodeForm.codeRequiredError', { + defaultMessage: 'Enter a verification code.', + }); + } else if (values.code.length !== VERIFICATION_CODE_LENGTH) { + errors.code = i18n.translate('interactiveSetup.verificationCodeForm.codeMinLengthError', { + defaultMessage: 'Enter all six digits.', + }); + } + + return errors; + }, + onSubmit: async (values) => { + try { + await http.post('/internal/interactive_setup/verify', { + body: JSON.stringify({ + code: values.code, + }), + }); + } catch (error) { + if ((error as IHttpFetchError).response?.status === 403) { + form.setError('code', (error as IHttpFetchError).body?.message); + return; + } else { + throw error; + } + } + onSuccess?.(values); + }, + }); + + return ( + + + + + } + body={ + <> + {form.submitError && ( + <> + + {(form.submitError as IHttpFetchError).body?.message} + + + + )} + +

+ ./bin/kibana-verification-code, + }} + /> +

+
+ + + + form.setValue('code', value)} + isInvalid={form.touched.code && !!form.errors.code} + autoFocus + /> + + + } + actions={ + + + + } + /> +
+ ); +}; diff --git a/src/plugins/interactive_setup/server/kibana_config_writer.test.ts b/src/plugins/interactive_setup/server/kibana_config_writer.test.ts index 7dc119b87f20a..4b68451930a3d 100644 --- a/src/plugins/interactive_setup/server/kibana_config_writer.test.ts +++ b/src/plugins/interactive_setup/server/kibana_config_writer.test.ts @@ -16,7 +16,7 @@ import { KibanaConfigWriter } from './kibana_config_writer'; describe('KibanaConfigWriter', () => { let mockFsAccess: jest.Mock; let mockWriteFile: jest.Mock; - let mockAppendFile: jest.Mock; + let mockReadFile: jest.Mock; let kibanaConfigWriter: KibanaConfigWriter; beforeEach(() => { jest.spyOn(Date, 'now').mockReturnValue(1234); @@ -24,7 +24,9 @@ describe('KibanaConfigWriter', () => { const fsMocks = jest.requireMock('fs/promises'); mockFsAccess = fsMocks.access; mockWriteFile = fsMocks.writeFile; - mockAppendFile = fsMocks.appendFile; + mockReadFile = fsMocks.readFile; + + mockReadFile.mockResolvedValue(''); kibanaConfigWriter = new KibanaConfigWriter( '/some/path/kibana.yml', @@ -69,39 +71,42 @@ describe('KibanaConfigWriter', () => { }); describe('#writeConfig()', () => { - it('throws if cannot write CA file', async () => { - mockWriteFile.mockRejectedValue(new Error('Oh no!')); - - await expect( - kibanaConfigWriter.writeConfig({ - caCert: 'ca-content', - host: '', - serviceAccountToken: { name: '', value: '' }, - }) - ).rejects.toMatchInlineSnapshot(`[Error: Oh no!]`); - - expect(mockWriteFile).toHaveBeenCalledTimes(1); - expect(mockWriteFile).toHaveBeenCalledWith('/some/path/ca_1234.crt', 'ca-content'); - expect(mockAppendFile).not.toHaveBeenCalled(); - }); - - it('throws if cannot append config to yaml file', async () => { - mockAppendFile.mockRejectedValue(new Error('Oh no!')); - - await expect( - kibanaConfigWriter.writeConfig({ - caCert: 'ca-content', - host: 'some-host', - serviceAccountToken: { name: 'some-token', value: 'some-value' }, - }) - ).rejects.toMatchInlineSnapshot(`[Error: Oh no!]`); - - expect(mockWriteFile).toHaveBeenCalledTimes(1); - expect(mockWriteFile).toHaveBeenCalledWith('/some/path/ca_1234.crt', 'ca-content'); - expect(mockAppendFile).toHaveBeenCalledTimes(1); - expect(mockAppendFile).toHaveBeenCalledWith( - '/some/path/kibana.yml', - ` + describe('without existing config', () => { + beforeEach(() => { + mockReadFile.mockResolvedValue(''); + }); + + it('throws if cannot write CA file', async () => { + mockWriteFile.mockRejectedValue(new Error('Oh no!')); + + await expect( + kibanaConfigWriter.writeConfig({ + caCert: 'ca-content', + host: '', + serviceAccountToken: { name: '', value: '' }, + }) + ).rejects.toMatchInlineSnapshot(`[Error: Oh no!]`); + + expect(mockWriteFile).toHaveBeenCalledTimes(1); + expect(mockWriteFile).toHaveBeenCalledWith('/some/path/ca_1234.crt', 'ca-content'); + }); + + it('throws if cannot write config to yaml file', async () => { + mockWriteFile.mockResolvedValueOnce(undefined).mockRejectedValueOnce(new Error('Oh no!')); + + await expect( + kibanaConfigWriter.writeConfig({ + caCert: 'ca-content', + host: 'some-host', + serviceAccountToken: { name: 'some-token', value: 'some-value' }, + }) + ).rejects.toMatchInlineSnapshot(`[Error: Oh no!]`); + + expect(mockWriteFile).toHaveBeenCalledTimes(2); + expect(mockWriteFile).toHaveBeenCalledWith('/some/path/ca_1234.crt', 'ca-content'); + expect(mockWriteFile).toHaveBeenCalledWith( + '/some/path/kibana.yml', + ` # This section was automatically generated during setup. elasticsearch.hosts: [some-host] @@ -109,24 +114,55 @@ elasticsearch.serviceAccountToken: some-value elasticsearch.ssl.certificateAuthorities: [/some/path/ca_1234.crt] ` - ); - }); - - it('can successfully write CA certificate and elasticsearch config with service token', async () => { - await expect( - kibanaConfigWriter.writeConfig({ - caCert: 'ca-content', - host: 'some-host', - serviceAccountToken: { name: 'some-token', value: 'some-value' }, - }) - ).resolves.toBeUndefined(); - - expect(mockWriteFile).toHaveBeenCalledTimes(1); - expect(mockWriteFile).toHaveBeenCalledWith('/some/path/ca_1234.crt', 'ca-content'); - expect(mockAppendFile).toHaveBeenCalledTimes(1); - expect(mockAppendFile).toHaveBeenCalledWith( - '/some/path/kibana.yml', - ` + ); + }); + + it('throws if cannot read existing config', async () => { + mockReadFile.mockRejectedValue(new Error('Oh no!')); + + await expect( + kibanaConfigWriter.writeConfig({ + caCert: 'ca-content', + host: 'some-host', + serviceAccountToken: { name: 'some-token', value: 'some-value' }, + }) + ).rejects.toMatchInlineSnapshot(`[Error: Oh no!]`); + + expect(mockWriteFile).not.toHaveBeenCalled(); + }); + + it('throws if cannot parse existing config', async () => { + mockReadFile.mockResolvedValue('foo: bar\nfoo: baz'); + + await expect( + kibanaConfigWriter.writeConfig({ + caCert: 'ca-content', + host: 'some-host', + serviceAccountToken: { name: 'some-token', value: 'some-value' }, + }) + ).rejects.toMatchInlineSnapshot(` + [YAMLException: duplicated mapping key at line 2, column 1: + foo: baz + ^] + `); + + expect(mockWriteFile).not.toHaveBeenCalled(); + }); + + it('can successfully write CA certificate and elasticsearch config with service token', async () => { + await expect( + kibanaConfigWriter.writeConfig({ + caCert: 'ca-content', + host: 'some-host', + serviceAccountToken: { name: 'some-token', value: 'some-value' }, + }) + ).resolves.toBeUndefined(); + + expect(mockWriteFile).toHaveBeenCalledTimes(2); + expect(mockWriteFile).toHaveBeenCalledWith('/some/path/ca_1234.crt', 'ca-content'); + expect(mockWriteFile).toHaveBeenCalledWith( + '/some/path/kibana.yml', + ` # This section was automatically generated during setup. elasticsearch.hosts: [some-host] @@ -134,25 +170,24 @@ elasticsearch.serviceAccountToken: some-value elasticsearch.ssl.certificateAuthorities: [/some/path/ca_1234.crt] ` - ); - }); - - it('can successfully write CA certificate and elasticsearch config with credentials', async () => { - await expect( - kibanaConfigWriter.writeConfig({ - caCert: 'ca-content', - host: 'some-host', - username: 'username', - password: 'password', - }) - ).resolves.toBeUndefined(); - - expect(mockWriteFile).toHaveBeenCalledTimes(1); - expect(mockWriteFile).toHaveBeenCalledWith('/some/path/ca_1234.crt', 'ca-content'); - expect(mockAppendFile).toHaveBeenCalledTimes(1); - expect(mockAppendFile).toHaveBeenCalledWith( - '/some/path/kibana.yml', - ` + ); + }); + + it('can successfully write CA certificate and elasticsearch config with credentials', async () => { + await expect( + kibanaConfigWriter.writeConfig({ + caCert: 'ca-content', + host: 'some-host', + username: 'username', + password: 'password', + }) + ).resolves.toBeUndefined(); + + expect(mockWriteFile).toHaveBeenCalledTimes(2); + expect(mockWriteFile).toHaveBeenCalledWith('/some/path/ca_1234.crt', 'ca-content'); + expect(mockWriteFile).toHaveBeenCalledWith( + '/some/path/kibana.yml', + ` # This section was automatically generated during setup. elasticsearch.hosts: [some-host] @@ -161,23 +196,22 @@ elasticsearch.username: username elasticsearch.ssl.certificateAuthorities: [/some/path/ca_1234.crt] ` - ); - }); - - it('can successfully write elasticsearch config without CA certificate', async () => { - await expect( - kibanaConfigWriter.writeConfig({ - host: 'some-host', - username: 'username', - password: 'password', - }) - ).resolves.toBeUndefined(); - - expect(mockWriteFile).not.toHaveBeenCalled(); - expect(mockAppendFile).toHaveBeenCalledTimes(1); - expect(mockAppendFile).toHaveBeenCalledWith( - '/some/path/kibana.yml', - ` + ); + }); + + it('can successfully write elasticsearch config without CA certificate', async () => { + await expect( + kibanaConfigWriter.writeConfig({ + host: 'some-host', + username: 'username', + password: 'password', + }) + ).resolves.toBeUndefined(); + + expect(mockWriteFile).toHaveBeenCalledTimes(1); + expect(mockWriteFile).toHaveBeenCalledWith( + '/some/path/kibana.yml', + ` # This section was automatically generated during setup. elasticsearch.hosts: [some-host] @@ -185,7 +219,106 @@ elasticsearch.password: password elasticsearch.username: username ` - ); + ); + }); + }); + + describe('with existing config (no conflicts)', () => { + beforeEach(() => { + mockReadFile.mockResolvedValue( + '# Default Kibana configuration for docker target\nserver.host: "0.0.0.0"\nserver.shutdownTimeout: "5s"' + ); + }); + + it('can successfully write CA certificate and elasticsearch config', async () => { + await expect( + kibanaConfigWriter.writeConfig({ + caCert: 'ca-content', + host: 'some-host', + serviceAccountToken: { name: 'some-token', value: 'some-value' }, + }) + ).resolves.toBeUndefined(); + + expect(mockReadFile).toHaveBeenCalledTimes(1); + expect(mockReadFile).toHaveBeenCalledWith('/some/path/kibana.yml', 'utf-8'); + + expect(mockWriteFile).toHaveBeenCalledTimes(2); + expect(mockWriteFile.mock.calls).toMatchInlineSnapshot(` + Array [ + Array [ + "/some/path/ca_1234.crt", + "ca-content", + ], + Array [ + "/some/path/kibana.yml", + "# Default Kibana configuration for docker target + server.host: \\"0.0.0.0\\" + server.shutdownTimeout: \\"5s\\" + + # This section was automatically generated during setup. + elasticsearch.hosts: [some-host] + elasticsearch.serviceAccountToken: some-value + elasticsearch.ssl.certificateAuthorities: [/some/path/ca_1234.crt] + + ", + ], + ] + `); + }); + }); + + describe('with existing config (with conflicts)', () => { + beforeEach(() => { + jest.spyOn(Date.prototype, 'toISOString').mockReturnValue('some date'); + mockReadFile.mockResolvedValue( + '# Default Kibana configuration for docker target\nserver.host: "0.0.0.0"\nserver.shutdownTimeout: "5s"\nelasticsearch.hosts: [ "http://elasticsearch:9200" ]\n\nmonitoring.ui.container.elasticsearch.enabled: true' + ); + }); + + it('can successfully write CA certificate and elasticsearch config', async () => { + await expect( + kibanaConfigWriter.writeConfig({ + caCert: 'ca-content', + host: 'some-host', + serviceAccountToken: { name: 'some-token', value: 'some-value' }, + }) + ).resolves.toBeUndefined(); + + expect(mockReadFile).toHaveBeenCalledTimes(1); + expect(mockReadFile).toHaveBeenCalledWith('/some/path/kibana.yml', 'utf-8'); + + expect(mockWriteFile).toHaveBeenCalledTimes(2); + expect(mockWriteFile.mock.calls).toMatchInlineSnapshot(` + Array [ + Array [ + "/some/path/ca_1234.crt", + "ca-content", + ], + Array [ + "/some/path/kibana.yml", + "### >>>>>>> BACKUP START: Kibana interactive setup (some date) + + # Default Kibana configuration for docker target + #server.host: \\"0.0.0.0\\" + #server.shutdownTimeout: \\"5s\\" + #elasticsearch.hosts: [ \\"http://elasticsearch:9200\\" ] + + #monitoring.ui.container.elasticsearch.enabled: true + ### >>>>>>> BACKUP END: Kibana interactive setup (some date) + + # This section was automatically generated during setup. + server.host: 0.0.0.0 + server.shutdownTimeout: 5s + elasticsearch.hosts: [some-host] + monitoring.ui.container.elasticsearch.enabled: true + elasticsearch.serviceAccountToken: some-value + elasticsearch.ssl.certificateAuthorities: [/some/path/ca_1234.crt] + + ", + ], + ] + `); + }); }); }); }); diff --git a/src/plugins/interactive_setup/server/kibana_config_writer.ts b/src/plugins/interactive_setup/server/kibana_config_writer.ts index a59aa7640caa6..ff67e887fab49 100644 --- a/src/plugins/interactive_setup/server/kibana_config_writer.ts +++ b/src/plugins/interactive_setup/server/kibana_config_writer.ts @@ -11,6 +11,7 @@ import fs from 'fs/promises'; import yaml from 'js-yaml'; import path from 'path'; +import { getFlattenedObject } from '@kbn/std'; import type { Logger } from 'src/core/server'; import { getDetailedErrorMessage } from './errors'; @@ -61,6 +62,45 @@ export class KibanaConfigWriter { */ public async writeConfig(params: WriteConfigParameters) { const caPath = path.join(path.dirname(this.configPath), `ca_${Date.now()}.crt`); + const config: Record = { 'elasticsearch.hosts': [params.host] }; + if ('serviceAccountToken' in params) { + config['elasticsearch.serviceAccountToken'] = params.serviceAccountToken.value; + } else if ('username' in params) { + config['elasticsearch.password'] = params.password; + config['elasticsearch.username'] = params.username; + } + if (params.caCert) { + config['elasticsearch.ssl.certificateAuthorities'] = [caPath]; + } + + // Load and parse existing configuration file to check if it already has values for the config + // entries we want to write. + const existingConfig = await this.loadAndParseKibanaConfig(); + const conflictingKeys = Object.keys(config).filter( + (configKey) => configKey in existingConfig.parsed + ); + + // If existing config has conflicting entries, back it up first. + let configToWrite; + if (conflictingKeys.length > 0) { + this.logger.warn( + `Kibana configuration file has the following conflicting keys that will be overridden: [${conflictingKeys.join( + ', ' + )}].` + ); + + const existingCommentedConfig = KibanaConfigWriter.commentOutKibanaConfig(existingConfig.raw); + configToWrite = `${existingCommentedConfig}\n\n# This section was automatically generated during setup.\n${yaml.safeDump( + { ...existingConfig.parsed, ...config }, + { flowLevel: 1 } + )}\n`; + } else { + configToWrite = `${ + existingConfig.raw + }\n\n# This section was automatically generated during setup.\n${yaml.safeDump(config, { + flowLevel: 1, + })}\n`; + } if (params.caCert) { this.logger.debug(`Writing CA certificate to ${caPath}.`); @@ -75,25 +115,9 @@ export class KibanaConfigWriter { } } - const config: Record = { 'elasticsearch.hosts': [params.host] }; - if ('serviceAccountToken' in params) { - config['elasticsearch.serviceAccountToken'] = params.serviceAccountToken.value; - } else if ('username' in params) { - config['elasticsearch.password'] = params.password; - config['elasticsearch.username'] = params.username; - } - if (params.caCert) { - config['elasticsearch.ssl.certificateAuthorities'] = [caPath]; - } - this.logger.debug(`Writing Elasticsearch configuration to ${this.configPath}.`); try { - await fs.appendFile( - this.configPath, - `\n\n# This section was automatically generated during setup.\n${yaml.safeDump(config, { - flowLevel: 1, - })}\n` - ); + await fs.writeFile(this.configPath, configToWrite); this.logger.debug(`Successfully wrote Elasticsearch configuration to ${this.configPath}.`); } catch (err) { this.logger.error( @@ -101,7 +125,55 @@ export class KibanaConfigWriter { this.configPath }: ${getDetailedErrorMessage(err)}.` ); + + throw err; + } + } + + /** + * Loads and parses existing Kibana configuration file. + */ + private async loadAndParseKibanaConfig() { + let rawConfig: string; + try { + rawConfig = await fs.readFile(this.configPath, 'utf-8'); + } catch (err) { + this.logger.error(`Failed to read configuration file: ${getDetailedErrorMessage(err)}.`); throw err; } + + let parsedConfig: Record; + try { + parsedConfig = getFlattenedObject(yaml.safeLoad(rawConfig) ?? {}); + } catch (err) { + this.logger.error(`Failed to parse configuration file: ${getDetailedErrorMessage(err)}.`); + throw err; + } + + return { raw: rawConfig, parsed: parsedConfig }; + } + + /** + * Comments out all non-commented entries in the Kibana configuration file. + * @param rawConfig Content of the Kibana configuration file. + */ + private static commentOutKibanaConfig(rawConfig: string) { + const backupTimestamp = new Date().toISOString(); + const commentedRawConfigLines = [ + `### >>>>>>> BACKUP START: Kibana interactive setup (${backupTimestamp})\n`, + ]; + for (const rawConfigLine of rawConfig.split('\n')) { + const trimmedLine = rawConfigLine.trim(); + commentedRawConfigLines.push( + trimmedLine.length === 0 || trimmedLine.startsWith('#') + ? rawConfigLine + : `#${rawConfigLine}` + ); + } + + return [ + ...commentedRawConfigLines, + `### >>>>>>> BACKUP END: Kibana interactive setup (${backupTimestamp})`, + ].join('\n'); } } diff --git a/src/plugins/interactive_setup/server/plugin.ts b/src/plugins/interactive_setup/server/plugin.ts index 91a151e17b697..2c3b517e78c5f 100644 --- a/src/plugins/interactive_setup/server/plugin.ts +++ b/src/plugins/interactive_setup/server/plugin.ts @@ -17,10 +17,19 @@ import type { ConfigSchema, ConfigType } from './config'; import { ElasticsearchService } from './elasticsearch_service'; import { KibanaConfigWriter } from './kibana_config_writer'; import { defineRoutes } from './routes'; +import { VerificationService } from './verification_service'; + +// List of the Elasticsearch hosts Kibana uses by default. +const DEFAULT_ELASTICSEARCH_HOSTS = [ + 'http://localhost:9200', + // It's a default host we use in the official Kibana Docker image (see `kibana_yml.template.ts`). + ...(process.env.ELASTIC_CONTAINER ? ['http://elasticsearch:9200'] : []), +]; export class InteractiveSetupPlugin implements PrebootPlugin { readonly #logger: Logger; readonly #elasticsearch: ElasticsearchService; + readonly #verification: VerificationService; #elasticsearchConnectionStatusSubscription?: Subscription; @@ -38,6 +47,9 @@ export class InteractiveSetupPlugin implements PrebootPlugin { this.#elasticsearch = new ElasticsearchService( this.initializerContext.logger.get('elasticsearch') ); + this.#verification = new VerificationService( + this.initializerContext.logger.get('verification') + ); } public setup(core: CorePreboot) { @@ -53,7 +65,7 @@ export class InteractiveSetupPlugin implements PrebootPlugin { const shouldActiveSetupMode = !core.elasticsearch.config.credentialsSpecified && core.elasticsearch.config.hosts.length === 1 && - core.elasticsearch.config.hosts[0] === 'http://localhost:9200'; + DEFAULT_ELASTICSEARCH_HOSTS.includes(core.elasticsearch.config.hosts[0]); if (!shouldActiveSetupMode) { this.#logger.debug( 'Interactive setup mode will not be activated since Elasticsearch connection is already configured.' @@ -61,6 +73,14 @@ export class InteractiveSetupPlugin implements PrebootPlugin { return; } + const verificationCode = this.#verification.setup(); + if (!verificationCode) { + this.#logger.error( + 'Interactive setup mode could not be activated. Ensure Kibana has permission to write to its config folder.' + ); + return; + } + let completeSetup: (result: { shouldReloadConfig: boolean }) => void; core.preboot.holdSetupUntilResolved( 'Validating Elasticsearch connection configuration…', @@ -81,6 +101,7 @@ export class InteractiveSetupPlugin implements PrebootPlugin { elasticsearch: core.elasticsearch, connectionCheckInterval: this.#getConfig().connectionCheck.interval, }); + this.#elasticsearchConnectionStatusSubscription = elasticsearch.connectionStatus$.subscribe( (status) => { if (status === ElasticsearchConnectionStatus.Configured) { @@ -92,13 +113,17 @@ export class InteractiveSetupPlugin implements PrebootPlugin { this.#logger.debug( 'Starting interactive setup mode since Kibana cannot to connect to Elasticsearch at http://localhost:9200.' ); - const serverInfo = core.http.getServerInfo(); - const url = `${serverInfo.protocol}://${serverInfo.hostname}:${serverInfo.port}`; - this.#logger.info(` + const pathname = core.http.basePath.prepend('/'); + const { protocol, hostname, port } = core.http.getServerInfo(); + const url = `${protocol}://${hostname}:${port}${pathname}?code=${verificationCode.code}`; + + // eslint-disable-next-line no-console + console.log(` ${chalk.whiteBright.bold(`${chalk.cyanBright('i')} Kibana has not been configured.`)} Go to ${chalk.cyanBright.underline(url)} to get started. + `); } } @@ -118,6 +143,7 @@ Go to ${chalk.cyanBright.underline(url)} to get started. preboot: { ...core.preboot, completeSetup }, kibanaConfigWriter: new KibanaConfigWriter(configPath, this.#logger.get('kibana-config')), elasticsearch, + verificationCode, getConfig: this.#getConfig.bind(this), }); }); @@ -137,5 +163,6 @@ Go to ${chalk.cyanBright.underline(url)} to get started. } this.#elasticsearch.stop(); + this.#verification.stop(); } } diff --git a/src/plugins/interactive_setup/server/routes/configure.test.ts b/src/plugins/interactive_setup/server/routes/configure.test.ts index d6b7404fce516..ac4507331db4b 100644 --- a/src/plugins/interactive_setup/server/routes/configure.test.ts +++ b/src/plugins/interactive_setup/server/routes/configure.test.ts @@ -57,7 +57,11 @@ describe('Configure routes', () => { expect(() => bodySchema.validate({ host: 'localhost:9200' }) ).toThrowErrorMatchingInlineSnapshot(`"[host]: expected URI with scheme [http|https]."`); - expect(() => bodySchema.validate({ host: 'http://localhost:9200' })).not.toThrowError(); + expect(bodySchema.validate({ host: 'http://localhost:9200' })).toMatchInlineSnapshot(` + Object { + "host": "http://localhost:9200", + } + `); expect(() => bodySchema.validate({ host: 'http://localhost:9200', username: 'elastic' }) ).toThrowErrorMatchingInlineSnapshot( @@ -71,21 +75,57 @@ describe('Configure routes', () => { expect(() => bodySchema.validate({ host: 'http://localhost:9200', password: 'password' }) ).toThrowErrorMatchingInlineSnapshot(`"[password]: a value wasn't expected to be present"`); - expect(() => + expect( bodySchema.validate({ host: 'http://localhost:9200', username: 'kibana_system', password: '', }) - ).not.toThrowError(); + ).toMatchInlineSnapshot(` + Object { + "host": "http://localhost:9200", + "password": "", + "username": "kibana_system", + } + `); expect(() => bodySchema.validate({ host: 'https://localhost:9200' }) ).toThrowErrorMatchingInlineSnapshot( `"[caCert]: expected value of type [string] but got [undefined]"` ); - expect(() => - bodySchema.validate({ host: 'https://localhost:9200', caCert: 'der' }) - ).not.toThrowError(); + expect(bodySchema.validate({ host: 'https://localhost:9200', caCert: 'der' })) + .toMatchInlineSnapshot(` + Object { + "caCert": "der", + "host": "https://localhost:9200", + } + `); + expect(bodySchema.validate({ host: 'https://localhost:9200', caCert: 'der', code: '123456' })) + .toMatchInlineSnapshot(` + Object { + "caCert": "der", + "code": "123456", + "host": "https://localhost:9200", + } + `); + }); + + it('fails if verification code is invalid.', async () => { + mockRouteParams.verificationCode.verify.mockReturnValue(false); + + const mockRequest = httpServerMock.createKibanaRequest({ + body: { host: 'host1' }, + }); + + await expect(routeHandler(mockContext, mockRequest, kibanaResponseFactory)).resolves.toEqual( + expect.objectContaining({ + status: 403, + }) + ); + + expect(mockRouteParams.elasticsearch.authenticate).not.toHaveBeenCalled(); + expect(mockRouteParams.kibanaConfigWriter.writeConfig).not.toHaveBeenCalled(); + expect(mockRouteParams.preboot.completeSetup).not.toHaveBeenCalled(); }); it('fails if setup is not on hold.', async () => { diff --git a/src/plugins/interactive_setup/server/routes/configure.ts b/src/plugins/interactive_setup/server/routes/configure.ts index a34af0296ea04..75499d048cf93 100644 --- a/src/plugins/interactive_setup/server/routes/configure.ts +++ b/src/plugins/interactive_setup/server/routes/configure.ts @@ -21,15 +21,13 @@ export function defineConfigureRoute({ logger, kibanaConfigWriter, elasticsearch, + verificationCode, preboot, }: RouteDefinitionParams) { router.post( { path: '/internal/interactive_setup/configure', validate: { - query: schema.object({ - code: schema.maybe(schema.string()), - }), body: schema.object({ host: schema.uri({ scheme: ['http', 'https'] }), username: schema.maybe( @@ -56,11 +54,16 @@ export function defineConfigureRoute({ schema.string(), schema.never() ), + code: schema.maybe(schema.string()), }), }, options: { authRequired: false }, }, async (context, request, response) => { + if (!verificationCode.verify(request.body.code)) { + return response.forbidden(); + } + if (!preboot.isSetupOnHold()) { logger.error(`Invalid request to [path=${request.url.pathname}] outside of preboot stage`); return response.badRequest({ body: 'Cannot process request outside of preboot stage.' }); diff --git a/src/plugins/interactive_setup/server/routes/enroll.test.ts b/src/plugins/interactive_setup/server/routes/enroll.test.ts index e42248704134a..859c3fb70ce83 100644 --- a/src/plugins/interactive_setup/server/routes/enroll.test.ts +++ b/src/plugins/interactive_setup/server/routes/enroll.test.ts @@ -95,18 +95,55 @@ describe('Enroll routes', () => { ); expect( - bodySchema.validate( - bodySchema.validate({ - apiKey: 'some-key', - hosts: ['https://localhost:9200'], - caFingerprint: 'a'.repeat(64), - }) - ) - ).toEqual({ - apiKey: 'some-key', - hosts: ['https://localhost:9200'], - caFingerprint: 'a'.repeat(64), + bodySchema.validate({ + apiKey: 'some-key', + hosts: ['https://localhost:9200'], + caFingerprint: 'a'.repeat(64), + }) + ).toMatchInlineSnapshot(` + Object { + "apiKey": "some-key", + "caFingerprint": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "hosts": Array [ + "https://localhost:9200", + ], + } + `); + expect( + bodySchema.validate({ + apiKey: 'some-key', + hosts: ['https://localhost:9200'], + caFingerprint: 'a'.repeat(64), + code: '123456', + }) + ).toMatchInlineSnapshot(` + Object { + "apiKey": "some-key", + "caFingerprint": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "code": "123456", + "hosts": Array [ + "https://localhost:9200", + ], + } + `); + }); + + it('fails if verification code is invalid.', async () => { + mockRouteParams.verificationCode.verify.mockReturnValue(false); + + const mockRequest = httpServerMock.createKibanaRequest({ + body: { apiKey: 'some-key', hosts: ['host1', 'host2'], caFingerprint: 'deadbeef' }, }); + + await expect(routeHandler(mockContext, mockRequest, kibanaResponseFactory)).resolves.toEqual( + expect.objectContaining({ + status: 403, + }) + ); + + expect(mockRouteParams.elasticsearch.enroll).not.toHaveBeenCalled(); + expect(mockRouteParams.kibanaConfigWriter.writeConfig).not.toHaveBeenCalled(); + expect(mockRouteParams.preboot.completeSetup).not.toHaveBeenCalled(); }); it('fails if setup is not on hold.', async () => { diff --git a/src/plugins/interactive_setup/server/routes/enroll.ts b/src/plugins/interactive_setup/server/routes/enroll.ts index 41291246802e6..769d763a7d45d 100644 --- a/src/plugins/interactive_setup/server/routes/enroll.ts +++ b/src/plugins/interactive_setup/server/routes/enroll.ts @@ -23,6 +23,7 @@ export function defineEnrollRoutes({ logger, kibanaConfigWriter, elasticsearch, + verificationCode, preboot, }: RouteDefinitionParams) { router.post( @@ -35,11 +36,16 @@ export function defineEnrollRoutes({ }), apiKey: schema.string({ minLength: 1 }), caFingerprint: schema.string({ maxLength: 64, minLength: 64 }), + code: schema.maybe(schema.string()), }), }, options: { authRequired: false }, }, async (context, request, response) => { + if (!verificationCode.verify(request.body.code)) { + return response.forbidden(); + } + if (!preboot.isSetupOnHold()) { logger.error(`Invalid request to [path=${request.url.pathname}] outside of preboot stage`); return response.badRequest({ body: 'Cannot process request outside of preboot stage.' }); diff --git a/src/plugins/interactive_setup/server/routes/index.mock.ts b/src/plugins/interactive_setup/server/routes/index.mock.ts index 249d1277269e7..15ec86031b6f2 100644 --- a/src/plugins/interactive_setup/server/routes/index.mock.ts +++ b/src/plugins/interactive_setup/server/routes/index.mock.ts @@ -11,6 +11,7 @@ import { coreMock, httpServiceMock, loggingSystemMock } from 'src/core/server/mo import { ConfigSchema } from '../config'; import { elasticsearchServiceMock } from '../elasticsearch_service.mock'; import { kibanaConfigWriterMock } from '../kibana_config_writer.mock'; +import { verificationCodeMock } from '../verification_code.mock'; export const routeDefinitionParamsMock = { create: (config: Record = {}) => ({ @@ -21,6 +22,7 @@ export const routeDefinitionParamsMock = { preboot: { ...coreMock.createPreboot().preboot, completeSetup: jest.fn() }, getConfig: jest.fn().mockReturnValue(ConfigSchema.validate(config)), elasticsearch: elasticsearchServiceMock.createSetup(), + verificationCode: verificationCodeMock.create(), kibanaConfigWriter: kibanaConfigWriterMock.create(), }), }; diff --git a/src/plugins/interactive_setup/server/routes/index.ts b/src/plugins/interactive_setup/server/routes/index.ts index 75c383176e7e9..fb9e06c4c2a18 100644 --- a/src/plugins/interactive_setup/server/routes/index.ts +++ b/src/plugins/interactive_setup/server/routes/index.ts @@ -6,15 +6,17 @@ * Side Public License, v 1. */ -import type { PublicMethodsOf } from '@kbn/utility-types'; +import type { PublicContract, PublicMethodsOf } from '@kbn/utility-types'; import type { IBasePath, IRouter, Logger, PrebootServicePreboot } from 'src/core/server'; import type { ConfigType } from '../config'; import type { ElasticsearchServiceSetup } from '../elasticsearch_service'; import type { KibanaConfigWriter } from '../kibana_config_writer'; +import type { VerificationCode } from '../verification_code'; import { defineConfigureRoute } from './configure'; import { defineEnrollRoutes } from './enroll'; import { definePingRoute } from './ping'; +import { defineVerifyRoute } from './verify'; /** * Describes parameters used to define HTTP routes. @@ -28,11 +30,13 @@ export interface RouteDefinitionParams { }; readonly kibanaConfigWriter: PublicMethodsOf; readonly elasticsearch: ElasticsearchServiceSetup; + readonly verificationCode: PublicContract; readonly getConfig: () => ConfigType; } export function defineRoutes(params: RouteDefinitionParams) { - defineEnrollRoutes(params); defineConfigureRoute(params); + defineEnrollRoutes(params); definePingRoute(params); + defineVerifyRoute(params); } diff --git a/src/plugins/interactive_setup/server/routes/verify.test.ts b/src/plugins/interactive_setup/server/routes/verify.test.ts new file mode 100644 index 0000000000000..ff8a7753320c2 --- /dev/null +++ b/src/plugins/interactive_setup/server/routes/verify.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 and the Server Side Public License, v 1; you may not 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 { ObjectType } from '@kbn/config-schema'; +import type { IRouter, RequestHandler, RequestHandlerContext, RouteConfig } from 'src/core/server'; +import { kibanaResponseFactory } from 'src/core/server'; +import { httpServerMock } from 'src/core/server/mocks'; + +import { routeDefinitionParamsMock } from './index.mock'; +import { defineVerifyRoute } from './verify'; + +describe('Configure routes', () => { + let router: jest.Mocked; + let mockRouteParams: ReturnType; + let mockContext: RequestHandlerContext; + beforeEach(() => { + mockRouteParams = routeDefinitionParamsMock.create(); + router = mockRouteParams.router; + + mockContext = ({} as unknown) as RequestHandlerContext; + + defineVerifyRoute(mockRouteParams); + }); + + describe('#verify', () => { + let routeHandler: RequestHandler; + let routeConfig: RouteConfig; + + beforeEach(() => { + const [verifyRouteConfig, verifyRouteHandler] = router.post.mock.calls.find( + ([{ path }]) => path === '/internal/interactive_setup/verify' + )!; + + routeConfig = verifyRouteConfig; + routeHandler = verifyRouteHandler; + }); + + it('correctly defines route.', () => { + expect(routeConfig.options).toEqual({ authRequired: false }); + + const bodySchema = (routeConfig.validate as any).body as ObjectType; + expect(() => bodySchema.validate({})).toThrowErrorMatchingInlineSnapshot( + `"[code]: expected value of type [string] but got [undefined]"` + ); + expect(bodySchema.validate({ code: '123456' })).toMatchInlineSnapshot(` + Object { + "code": "123456", + } + `); + }); + + it('fails if verification code is invalid.', async () => { + mockRouteParams.verificationCode.verify.mockReturnValue(false); + + const mockRequest = httpServerMock.createKibanaRequest({ + body: { code: '123456' }, + }); + + await expect(routeHandler(mockContext, mockRequest, kibanaResponseFactory)).resolves.toEqual( + expect.objectContaining({ + status: 403, + }) + ); + }); + + it('succeeds if verification code is valid.', async () => { + mockRouteParams.verificationCode.verify.mockReturnValue(true); + + const mockRequest = httpServerMock.createKibanaRequest({ + body: { code: '123456' }, + }); + + await expect(routeHandler(mockContext, mockRequest, kibanaResponseFactory)).resolves.toEqual( + expect.objectContaining({ + status: 204, + }) + ); + }); + }); +}); diff --git a/src/plugins/interactive_setup/server/routes/verify.ts b/src/plugins/interactive_setup/server/routes/verify.ts new file mode 100644 index 0000000000000..ebdbb58ed9530 --- /dev/null +++ b/src/plugins/interactive_setup/server/routes/verify.ts @@ -0,0 +1,41 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema } from '@kbn/config-schema'; + +import type { RouteDefinitionParams } from '.'; + +export function defineVerifyRoute({ router, verificationCode }: RouteDefinitionParams) { + router.post( + { + path: '/internal/interactive_setup/verify', + validate: { + body: schema.object({ + code: schema.string(), + }), + }, + options: { authRequired: false }, + }, + async (context, request, response) => { + if (!verificationCode.verify(request.body.code)) { + return response.forbidden({ + body: { + message: verificationCode.remainingAttempts + ? 'Invalid verification code.' + : 'Maximum number of attempts exceeded. Restart Kibana to generate a new code and retry.', + attributes: { + remainingAttempts: verificationCode.remainingAttempts, + }, + }, + }); + } + + return response.noContent(); + } + ); +} diff --git a/src/plugins/interactive_setup/server/verification_code.mock.ts b/src/plugins/interactive_setup/server/verification_code.mock.ts new file mode 100644 index 0000000000000..d4e9fc2028590 --- /dev/null +++ b/src/plugins/interactive_setup/server/verification_code.mock.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 type { PublicContract } from '@kbn/utility-types'; + +import type { VerificationCode } from './verification_code'; + +export const verificationCodeMock = { + create: (): jest.Mocked> => ({ + code: '123456', + remainingAttempts: 5, + verify: jest.fn().mockReturnValue(true), + }), +}; diff --git a/src/plugins/interactive_setup/server/verification_code.test.ts b/src/plugins/interactive_setup/server/verification_code.test.ts new file mode 100644 index 0000000000000..7387f285a2f62 --- /dev/null +++ b/src/plugins/interactive_setup/server/verification_code.test.ts @@ -0,0 +1,71 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { loggingSystemMock } from 'src/core/server/mocks'; + +import { VERIFICATION_CODE_LENGTH } from '../common'; +import { VerificationCode } from './verification_code'; + +const loggerMock = loggingSystemMock.createLogger(); + +describe('VerificationCode', () => { + it('should generate a 6 digit code', () => { + for (let i = 0; i < 10; i++) { + const { code } = new VerificationCode(loggerMock); + expect(code).toHaveLength(VERIFICATION_CODE_LENGTH); + expect(code).toEqual(expect.stringMatching(/^[0-9]+$/)); + } + }); + + it('should verify code correctly', () => { + const verificationCode = new VerificationCode(loggerMock); + + expect(verificationCode.verify(undefined)).toBe(false); + expect(verificationCode.verify('')).toBe(false); + expect(verificationCode.verify('invalid')).toBe(false); + expect(verificationCode.verify(verificationCode.code)).toBe(true); + }); + + it('should track number of failed attempts', () => { + const verificationCode = new VerificationCode(loggerMock); + + verificationCode.verify('invalid'); + verificationCode.verify('invalid'); + verificationCode.verify('invalid'); + expect(verificationCode['failedAttempts']).toBe(3); // eslint-disable-line dot-notation + }); + + it('should reset number of failed attempts if valid code is entered', () => { + const verificationCode = new VerificationCode(loggerMock); + + verificationCode.verify('invalid'); + verificationCode.verify('invalid'); + verificationCode.verify('invalid'); + expect(verificationCode.verify(verificationCode.code)).toBe(true); + expect(verificationCode['failedAttempts']).toBe(0); // eslint-disable-line dot-notation + }); + + it('should permanently fail once maximum number of failed attempts has been reached', () => { + const verificationCode = new VerificationCode(loggerMock); + + // eslint-disable-next-line dot-notation + for (let i = 0; i < verificationCode['maxFailedAttempts']; i++) { + verificationCode.verify('invalid'); + } + expect(verificationCode.verify(verificationCode.code)).toBe(false); + }); + + it('should ignore empty calls in number of failed attempts', () => { + const verificationCode = new VerificationCode(loggerMock); + + verificationCode.verify(undefined); + verificationCode.verify(undefined); + verificationCode.verify(undefined); + expect(verificationCode['failedAttempts']).toBe(0); // eslint-disable-line dot-notation + }); +}); diff --git a/src/plugins/interactive_setup/server/verification_code.ts b/src/plugins/interactive_setup/server/verification_code.ts new file mode 100644 index 0000000000000..849ece5f4e0b0 --- /dev/null +++ b/src/plugins/interactive_setup/server/verification_code.ts @@ -0,0 +1,87 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import chalk from 'chalk'; +import crypto from 'crypto'; + +import type { Logger } from 'src/core/server'; + +import { VERIFICATION_CODE_LENGTH } from '../common'; + +export class VerificationCode { + public readonly code = VerificationCode.generate(VERIFICATION_CODE_LENGTH); + private failedAttempts = 0; + private readonly maxFailedAttempts = 5; + + constructor(private readonly logger: Logger) {} + + public get remainingAttempts() { + return this.maxFailedAttempts - this.failedAttempts; + } + + public verify(code: string | undefined) { + if (this.failedAttempts >= this.maxFailedAttempts) { + this.logger.error( + 'Maximum number of attempts exceeded. Restart Kibana to generate a new code and retry.' + ); + return false; + } + + const highlightedCode = chalk.black.bgCyanBright( + ` ${this.code.substr(0, 3)} ${this.code.substr(3)} ` + ); + + if (code === undefined) { + // eslint-disable-next-line no-console + console.log(` + +Your verification code is: ${highlightedCode} + +`); + return false; + } + + if (code !== this.code) { + this.failedAttempts++; + this.logger.error( + `Invalid verification code '${code}' provided. ${this.remainingAttempts} attempts left.` + ); + // eslint-disable-next-line no-console + console.log(` + +Your verification code is: ${highlightedCode} + +`); + return false; + } + + this.logger.debug(`Code '${code}' verified successfully`); + + this.failedAttempts = 0; + return true; + } + + /** + * Returns a cryptographically secure and random 6-digit code. + * + * Implementation notes: `secureRandomNumber` returns a random number like `0.05505769583xxxx`. To + * turn that into a 6 digit code we multiply it by `10^6` and result is `055057`. + */ + private static generate(length: number) { + return Math.floor(secureRandomNumber() * Math.pow(10, length)) + .toString() + .padStart(length, '0'); + } +} + +/** + * Cryptographically secure equivalent of `Math.random()`. + */ +function secureRandomNumber() { + return crypto.randomBytes(4).readUInt32LE() / 0x100000000; +} diff --git a/src/plugins/interactive_setup/server/verification_service.test.ts b/src/plugins/interactive_setup/server/verification_service.test.ts new file mode 100644 index 0000000000000..1721362d1c635 --- /dev/null +++ b/src/plugins/interactive_setup/server/verification_service.test.ts @@ -0,0 +1,55 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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'; + +import { loggingSystemMock } from 'src/core/server/mocks'; + +import { VerificationCode } from './verification_code'; +import { VerificationService } from './verification_service'; + +jest.mock('fs'); +jest.mock('@kbn/utils', () => ({ + getDataPath: jest.fn().mockReturnValue('/data/'), +})); + +const loggerMock = loggingSystemMock.createLogger(); + +describe('VerificationService', () => { + describe('setup()', () => { + it('should generate verification code', () => { + const service = new VerificationService(loggerMock); + const setup = service.setup(); + expect(setup).toBeInstanceOf(VerificationCode); + }); + + it('should write verification code to disk', () => { + const service = new VerificationService(loggerMock); + const setup = service.setup()!; + expect(fs.writeFileSync).toHaveBeenCalledWith('/data/verification_code', setup.code); + }); + + it('should not return verification code if cannot write to disk', () => { + const service = new VerificationService(loggerMock); + (fs.writeFileSync as jest.Mock).mockImplementationOnce(() => { + throw new Error('Write error'); + }); + const setup = service.setup(); + expect(fs.writeFileSync).toHaveBeenCalledWith('/data/verification_code', expect.anything()); + expect(setup).toBeUndefined(); + }); + }); + + describe('stop()', () => { + it('should remove verification code from disk', () => { + const service = new VerificationService(loggerMock); + service.stop(); + expect(fs.unlinkSync).toHaveBeenCalledWith('/data/verification_code'); + }); + }); +}); diff --git a/src/plugins/interactive_setup/server/verification_service.ts b/src/plugins/interactive_setup/server/verification_service.ts new file mode 100644 index 0000000000000..b158b23bd3b6d --- /dev/null +++ b/src/plugins/interactive_setup/server/verification_service.ts @@ -0,0 +1,49 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import fs from 'fs'; +import path from 'path'; + +import { getDataPath } from '@kbn/utils'; +import type { Logger } from 'src/core/server'; + +import { getDetailedErrorMessage } from './errors'; +import { VerificationCode } from './verification_code'; + +export class VerificationService { + private fileName: string; + + constructor(private readonly logger: Logger) { + this.fileName = path.join(getDataPath(), 'verification_code'); + } + + public setup() { + const verificationCode = new VerificationCode(this.logger); + + try { + fs.writeFileSync(this.fileName, verificationCode.code); + this.logger.debug(`Successfully wrote verification code to ${this.fileName}`); + return verificationCode; + } catch (error) { + this.logger.error( + `Failed to write verification code to ${this.fileName}: ${getDetailedErrorMessage(error)}.` + ); + } + } + + public stop() { + try { + fs.unlinkSync(this.fileName); + this.logger.debug(`Successfully removed ${this.fileName}`); + } catch (error) { + if ((error as NodeJS.ErrnoException).code !== 'ENOENT') { + this.logger.error(`Failed to remove ${this.fileName}: ${getDetailedErrorMessage(error)}.`); + } + } + } +} diff --git a/src/plugins/kibana_legacy/config.ts b/src/plugins/kibana_legacy/config.ts deleted file mode 100644 index 91083a554bce1..0000000000000 --- a/src/plugins/kibana_legacy/config.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { schema, TypeOf } from '@kbn/config-schema'; - -export const configSchema = schema.object({ - defaultAppId: schema.string({ defaultValue: 'home' }), -}); - -export type ConfigSchema = TypeOf; diff --git a/src/plugins/kibana_legacy/jest.config.js b/src/plugins/kibana_legacy/jest.config.js index c9b571b13f13f..a2bdf5649f900 100644 --- a/src/plugins/kibana_legacy/jest.config.js +++ b/src/plugins/kibana_legacy/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/kibana_legacy'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/kibana_legacy', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/kibana_legacy/public/**/*.{js,ts,tsx}'], }; diff --git a/src/plugins/kibana_legacy/kibana.json b/src/plugins/kibana_legacy/kibana.json index b1d7b10f9527a..afca886ad9376 100644 --- a/src/plugins/kibana_legacy/kibana.json +++ b/src/plugins/kibana_legacy/kibana.json @@ -1,7 +1,7 @@ { "id": "kibanaLegacy", "version": "kibana", - "server": true, + "server": false, "ui": true, "owner": { "name": "Vis Editors", diff --git a/src/plugins/kibana_legacy/public/index.ts b/src/plugins/kibana_legacy/public/index.ts index fa04b192cd177..13271532881cb 100644 --- a/src/plugins/kibana_legacy/public/index.ts +++ b/src/plugins/kibana_legacy/public/index.ts @@ -9,11 +9,9 @@ // TODO: https://github.com/elastic/kibana/issues/110891 /* eslint-disable @kbn/eslint/no_export_all */ -import { PluginInitializerContext } from 'kibana/public'; import { KibanaLegacyPlugin } from './plugin'; -export const plugin = (initializerContext: PluginInitializerContext) => - new KibanaLegacyPlugin(initializerContext); +export const plugin = () => new KibanaLegacyPlugin(); export * from './plugin'; diff --git a/src/plugins/kibana_legacy/public/mocks.ts b/src/plugins/kibana_legacy/public/mocks.ts index 9f79daf0f3505..510e59c7ff190 100644 --- a/src/plugins/kibana_legacy/public/mocks.ts +++ b/src/plugins/kibana_legacy/public/mocks.ts @@ -14,9 +14,6 @@ export type Start = jest.Mocked>; const createSetupContract = (): Setup => ({}); const createStartContract = (): Start => ({ - config: { - defaultAppId: 'home', - }, loadFontAwesome: jest.fn(), loadAngularBootstrap: jest.fn(), }); diff --git a/src/plugins/kibana_legacy/public/plugin.ts b/src/plugins/kibana_legacy/public/plugin.ts index af22ceadaa9e1..e5244c110ad20 100644 --- a/src/plugins/kibana_legacy/public/plugin.ts +++ b/src/plugins/kibana_legacy/public/plugin.ts @@ -6,18 +6,15 @@ * Side Public License, v 1. */ -import { PluginInitializerContext, CoreStart, CoreSetup } from 'kibana/public'; -import { ConfigSchema } from '../config'; +import { CoreStart, CoreSetup } from 'kibana/public'; import { injectHeaderStyle } from './utils/inject_header_style'; export class KibanaLegacyPlugin { - constructor(private readonly initializerContext: PluginInitializerContext) {} - public setup(core: CoreSetup<{}, KibanaLegacyStart>) { return {}; } - public start({ application, http: { basePath }, uiSettings }: CoreStart) { + public start({ uiSettings }: CoreStart) { injectHeaderStyle(uiSettings); return { /** @@ -35,11 +32,6 @@ export class KibanaLegacyPlugin { const { initAngularBootstrap } = await import('./angular_bootstrap'); initAngularBootstrap(); }, - /** - * @deprecated - * Just exported for wiring up with dashboard mode, should not be used. - */ - config: this.initializerContext.config.get(), }; } } diff --git a/src/plugins/kibana_legacy/server/index.ts b/src/plugins/kibana_legacy/server/index.ts deleted file mode 100644 index 90c9c2888c9da..0000000000000 --- a/src/plugins/kibana_legacy/server/index.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 and the Server Side Public License, v 1; you may not 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, PluginConfigDescriptor } from 'kibana/server'; -import { get } from 'lodash'; - -import { configSchema, ConfigSchema } from '../config'; - -export const config: PluginConfigDescriptor = { - exposeToBrowser: { - defaultAppId: true, - }, - schema: configSchema, - deprecations: ({ renameFromRoot }) => [ - // TODO: Remove deprecation once defaultAppId is deleted - renameFromRoot('kibana.defaultAppId', 'kibana_legacy.defaultAppId', { silent: true }), - (completeConfig, rootPath, addDeprecation) => { - if ( - get(completeConfig, 'kibana.defaultAppId') === undefined && - get(completeConfig, 'kibana_legacy.defaultAppId') === undefined - ) { - return; - } - addDeprecation({ - message: `kibana.defaultAppId is deprecated and will be removed in 8.0. Please use the \`defaultRoute\` advanced setting instead`, - correctiveActions: { - manualSteps: [ - 'Go to Stack Management > Advanced Settings', - 'Update the "defaultRoute" setting under the General section', - 'Remove "kibana.defaultAppId" from the kibana.yml config file', - ], - }, - }); - }, - ], -}; - -class Plugin { - public setup(core: CoreSetup) {} - - public start(core: CoreStart) {} -} - -export const plugin = () => new Plugin(); diff --git a/src/plugins/kibana_overview/jest.config.js b/src/plugins/kibana_overview/jest.config.js index 4862a4967a3ca..00cf46dfe2f80 100644 --- a/src/plugins/kibana_overview/jest.config.js +++ b/src/plugins/kibana_overview/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/kibana_overview'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/kibana_overview', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/kibana_overview/{common,public}/**/*.{js,ts,tsx}'], }; diff --git a/src/plugins/kibana_overview/public/components/overview/overview.tsx b/src/plugins/kibana_overview/public/components/overview/overview.tsx index b49be0670b582..07769e2f3c474 100644 --- a/src/plugins/kibana_overview/public/components/overview/overview.tsx +++ b/src/plugins/kibana_overview/public/components/overview/overview.tsx @@ -100,7 +100,7 @@ export const Overview: FC = ({ newsFetchResult, solutions, features }) => useEffect(() => { const fetchIsNewKibanaInstance = async () => { - const hasUserIndexPattern = await indexPatternService.hasUserIndexPattern().catch(() => true); + const hasUserIndexPattern = await indexPatternService.hasUserDataView().catch(() => true); setNewKibanaInstance(!hasUserIndexPattern); }; diff --git a/src/plugins/kibana_react/jest.config.js b/src/plugins/kibana_react/jest.config.js index 159f7b01795dc..35bf9df51d615 100644 --- a/src/plugins/kibana_react/jest.config.js +++ b/src/plugins/kibana_react/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/kibana_react'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/kibana_react', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/kibana_react/{common,public}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/kibana_react/public/code_editor/__snapshots__/code_editor.test.tsx.snap b/src/plugins/kibana_react/public/code_editor/__snapshots__/code_editor.test.tsx.snap index 7b2729d2e1b68..d85f96382e803 100644 --- a/src/plugins/kibana_react/public/code_editor/__snapshots__/code_editor.test.tsx.snap +++ b/src/plugins/kibana_react/public/code_editor/__snapshots__/code_editor.test.tsx.snap @@ -164,7 +164,6 @@ exports[` is rendered 1`] = ` > diff --git a/src/plugins/kibana_usage_collection/README.md b/src/plugins/kibana_usage_collection/README.md index 1cb14cdef647e..4ea014457fd07 100644 --- a/src/plugins/kibana_usage_collection/README.md +++ b/src/plugins/kibana_usage_collection/README.md @@ -9,7 +9,7 @@ This plugin registers the Platform Usage Collectors in Kibana. | **Config Usage** | Reports the non-default values set via `kibana.yml` config file or CLI options. It `[redacts]` any potential PII-sensitive values. | [Link](./server/collectors/config_usage/README.md) | | **User-changed UI Settings** | Reports all the UI Settings that have been overwritten by the user. It `[redacts]` any potential PII-sensitive values. | [Link](./server/collectors/management/README.md) | | **CSP configuration** | Reports the key values regarding the CSP configuration. | - | -| **Kibana** | It reports the number of Saved Objects per type. It is limited to `dashboard`, `visualization`, `search`, `index-pattern`, `graph-workspace` and `timelion-sheet`.
It exists for legacy purposes, and may still be used by Monitoring via Metricbeat. | - | +| **Kibana** | It reports the number of Saved Objects per type. It is limited to `dashboard`, `visualization`, `search`, `index-pattern`, `graph-workspace`.
It exists for legacy purposes, and may still be used by Monitoring via Metricbeat. | - | | **Saved Objects Counts** | Number of Saved Objects per type. | - | | **Localization data** | Localization settings: setup locale and installed translation files. | - | | **Ops stats** | Operation metrics from the system. | - | diff --git a/src/plugins/kibana_usage_collection/jest.config.js b/src/plugins/kibana_usage_collection/jest.config.js index f199984a6ad6d..a52c3eb8cc06c 100644 --- a/src/plugins/kibana_usage_collection/jest.config.js +++ b/src/plugins/kibana_usage_collection/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/kibana_usage_collection'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/kibana_usage_collection', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/kibana_usage_collection/{common,server}/**/*.{ts,tsx}', + ], }; 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 d29d6d6a86e85..5f268a6fdfee7 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 @@ -124,7 +124,6 @@ export const applicationUsageSchema = { kibana: commonSchema, // It's a forward app so we'll likely never report it management: commonSchema, short_url_redirect: commonSchema, // It's a forward app so we'll likely never report it - timelion: commonSchema, visualize: commonSchema, error: commonSchema, status: commonSchema, diff --git a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/aws.test.ts b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/aws.test.ts index 0bba64823a3e2..68583502d3c9a 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/aws.test.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/aws.test.ts @@ -6,120 +6,120 @@ * Side Public License, v 1. */ -import fs from 'fs'; -import type { Request, RequestOptions } from './cloud_service'; +/* eslint-disable dot-notation */ +jest.mock('node-fetch'); +jest.mock('fs/promises'); import { AWSCloudService, AWSResponse } from './aws'; -type Callback = (err: unknown, res: unknown) => void; - -const AWS = new AWSCloudService(); +// eslint-disable-next-line @typescript-eslint/no-var-requires +const fetchMock = require('node-fetch') as jest.Mock; +// eslint-disable-next-line @typescript-eslint/no-var-requires +const { readFile } = require('fs/promises') as { readFile: jest.Mock }; describe('AWS', () => { - const expectedFilenames = ['/sys/hypervisor/uuid', '/sys/devices/virtual/dmi/id/product_uuid']; - const expectedEncoding = 'utf8'; - // mixed case to ensure we check for ec2 after lowercasing - const ec2Uuid = 'eC2abcdef-ghijk\n'; - const ec2FileSystem = { - readFile: (filename: string, encoding: string, callback: Callback) => { - expect(expectedFilenames).toContain(filename); - expect(encoding).toEqual(expectedEncoding); - - callback(null, ec2Uuid); - }, - } as typeof fs; + const mockIsWindows = jest.fn(); + const awsService = new AWSCloudService(); + awsService['_isWindows'] = mockIsWindows.mockReturnValue(false); + readFile.mockResolvedValue('eC2abcdef-ghijk\n'); + beforeEach(() => jest.clearAllMocks()); it('is named "aws"', () => { - expect(AWS.getName()).toEqual('aws'); + expect(awsService.getName()).toEqual('aws'); }); describe('_checkIfService', () => { it('handles expected response', async () => { const id = 'abcdef'; - const request = ((req: RequestOptions, callback: Callback) => { - expect(req.method).toEqual('GET'); - expect(req.uri).toEqual( - 'http://169.254.169.254/2016-09-02/dynamic/instance-identity/document' - ); - expect(req.json).toEqual(true); - - const body = `{"instanceId": "${id}","availabilityZone":"us-fake-2c", "imageId" : "ami-6df1e514"}`; - - callback(null, { statusCode: 200, body }); - }) as Request; - // ensure it does not use the fs to trump the body - const awsCheckedFileSystem = new AWSCloudService({ - _fs: ec2FileSystem, - _isWindows: false, + + fetchMock.mockResolvedValue({ + json: () => + `{"instanceId": "${id}","availabilityZone":"us-fake-2c", "imageId" : "ami-6df1e514"}`, + status: 200, + ok: true, }); - const response = await awsCheckedFileSystem._checkIfService(request); + const response = await awsService['_checkIfService'](); + expect(readFile).toBeCalledTimes(0); + expect(fetchMock).toBeCalledTimes(1); + expect(fetchMock).toBeCalledWith( + 'http://169.254.169.254/2016-09-02/dynamic/instance-identity/document', + { + method: 'GET', + } + ); expect(response.isConfirmed()).toEqual(true); - expect(response.toJSON()).toEqual({ - name: AWS.getName(), - id, - region: undefined, - vm_type: undefined, - zone: 'us-fake-2c', - metadata: { - imageId: 'ami-6df1e514', - }, - }); + expect(response.toJSON()).toMatchInlineSnapshot(` + Object { + "id": "abcdef", + "metadata": Object { + "imageId": "ami-6df1e514", + }, + "name": "aws", + "region": undefined, + "vm_type": undefined, + "zone": "us-fake-2c", + } + `); }); it('handles request without a usable body by downgrading to UUID detection', async () => { - const request = ((_req: RequestOptions, callback: Callback) => - callback(null, { statusCode: 404 })) as Request; - const awsCheckedFileSystem = new AWSCloudService({ - _fs: ec2FileSystem, - _isWindows: false, + fetchMock.mockResolvedValue({ + json: () => null, + status: 200, + ok: true, }); - const response = await awsCheckedFileSystem._checkIfService(request); + const response = await awsService['_checkIfService'](); expect(response.isConfirmed()).toBe(true); - expect(response.toJSON()).toEqual({ - name: AWS.getName(), - id: ec2Uuid.trim().toLowerCase(), - region: undefined, - vm_type: undefined, - zone: undefined, - metadata: undefined, - }); + expect(response.toJSON()).toMatchInlineSnapshot(` + Object { + "id": "ec2abcdef-ghijk", + "metadata": undefined, + "name": "aws", + "region": undefined, + "vm_type": undefined, + "zone": undefined, + } + `); }); it('handles request failure by downgrading to UUID detection', async () => { - const failedRequest = ((_req: RequestOptions, callback: Callback) => - callback(new Error('expected: request failed'), null)) as Request; - const awsCheckedFileSystem = new AWSCloudService({ - _fs: ec2FileSystem, - _isWindows: false, + fetchMock.mockResolvedValue({ + status: 404, + ok: false, }); - const response = await awsCheckedFileSystem._checkIfService(failedRequest); + const response = await awsService['_checkIfService'](); expect(response.isConfirmed()).toBe(true); - expect(response.toJSON()).toEqual({ - name: AWS.getName(), - id: ec2Uuid.trim().toLowerCase(), - region: undefined, - vm_type: undefined, - zone: undefined, - metadata: undefined, - }); + expect(response.toJSON()).toMatchInlineSnapshot(` + Object { + "id": "ec2abcdef-ghijk", + "metadata": undefined, + "name": "aws", + "region": undefined, + "vm_type": undefined, + "zone": undefined, + } + `); }); it('handles not running on AWS', async () => { - const failedRequest = ((_req: RequestOptions, callback: Callback) => - callback(null, null)) as Request; - const awsIgnoredFileSystem = new AWSCloudService({ - _fs: ec2FileSystem, - _isWindows: true, + fetchMock.mockResolvedValue({ + json: () => null, + status: 404, + ok: false, }); - const response = await awsIgnoredFileSystem._checkIfService(failedRequest); + mockIsWindows.mockReturnValue(true); + + const response = await awsService['_checkIfService'](); + expect(mockIsWindows).toBeCalledTimes(1); + expect(readFile).toBeCalledTimes(0); - expect(response.getName()).toEqual(AWS.getName()); + expect(response.getName()).toEqual('aws'); expect(response.isConfirmed()).toBe(false); }); }); @@ -144,10 +144,10 @@ describe('AWS', () => { marketplaceProductCodes: null, }; - const response = AWSCloudService.parseBody(AWS.getName(), body)!; + const response = awsService.parseBody(body)!; expect(response).not.toBeNull(); - expect(response.getName()).toEqual(AWS.getName()); + expect(response.getName()).toEqual('aws'); expect(response.isConfirmed()).toEqual(true); expect(response.toJSON()).toEqual({ name: 'aws', @@ -169,141 +169,84 @@ describe('AWS', () => { it('ignores unexpected response body', () => { // @ts-expect-error - expect(AWSCloudService.parseBody(AWS.getName(), undefined)).toBe(null); + expect(awsService.parseBody(undefined)).toBe(null); // @ts-expect-error - expect(AWSCloudService.parseBody(AWS.getName(), null)).toBe(null); + expect(awsService.parseBody(null)).toBe(null); // @ts-expect-error - expect(AWSCloudService.parseBody(AWS.getName(), {})).toBe(null); + expect(awsService.parseBody({})).toBe(null); // @ts-expect-error - expect(AWSCloudService.parseBody(AWS.getName(), { privateIp: 'a.b.c.d' })).toBe(null); + expect(awsService.parseBody({ privateIp: 'a.b.c.d' })).toBe(null); }); }); - describe('_tryToDetectUuid', () => { + describe('tryToDetectUuid', () => { describe('checks the file system for UUID if not Windows', () => { - it('checks /sys/hypervisor/uuid', async () => { - const awsCheckedFileSystem = new AWSCloudService({ - _fs: { - readFile: (filename: string, encoding: string, callback: Callback) => { - expect(expectedFilenames).toContain(filename); - expect(encoding).toEqual(expectedEncoding); - - callback(null, ec2Uuid); - }, - } as typeof fs, - _isWindows: false, - }); + beforeAll(() => mockIsWindows.mockReturnValue(false)); - const response = await awsCheckedFileSystem._tryToDetectUuid(); + it('checks /sys/hypervisor/uuid and /sys/devices/virtual/dmi/id/product_uuid', async () => { + const response = await awsService['tryToDetectUuid'](); - expect(response.isConfirmed()).toEqual(true); - expect(response.toJSON()).toEqual({ - name: AWS.getName(), - id: ec2Uuid.trim().toLowerCase(), - region: undefined, - zone: undefined, - vm_type: undefined, - metadata: undefined, - }); - }); + readFile.mockImplementation(async (filename: string, encoding: string) => { + expect(['/sys/hypervisor/uuid', '/sys/devices/virtual/dmi/id/product_uuid']).toContain( + filename + ); + expect(encoding).toEqual('utf8'); - it('checks /sys/devices/virtual/dmi/id/product_uuid', async () => { - const awsCheckedFileSystem = new AWSCloudService({ - _fs: { - readFile: (filename: string, encoding: string, callback: Callback) => { - expect(expectedFilenames).toContain(filename); - expect(encoding).toEqual(expectedEncoding); - - callback(null, ec2Uuid); - }, - } as typeof fs, - _isWindows: false, + return 'eC2abcdef-ghijk\n'; }); - const response = await awsCheckedFileSystem._tryToDetectUuid(); - + expect(readFile).toBeCalledTimes(2); expect(response.isConfirmed()).toEqual(true); - expect(response.toJSON()).toEqual({ - name: AWS.getName(), - id: ec2Uuid.trim().toLowerCase(), - region: undefined, - zone: undefined, - vm_type: undefined, - metadata: undefined, - }); + expect(response.toJSON()).toMatchInlineSnapshot(` + Object { + "id": "ec2abcdef-ghijk", + "metadata": undefined, + "name": "aws", + "region": undefined, + "vm_type": undefined, + "zone": undefined, + } + `); }); it('returns confirmed if only one file exists', async () => { - let callCount = 0; - const awsCheckedFileSystem = new AWSCloudService({ - _fs: { - readFile: (filename: string, encoding: string, callback: Callback) => { - if (callCount === 0) { - callCount++; - throw new Error('oops'); - } - callback(null, ec2Uuid); - }, - } as typeof fs, - _isWindows: false, - }); + readFile.mockRejectedValueOnce(new Error('oops')); + readFile.mockResolvedValueOnce('ec2Uuid'); - const response = await awsCheckedFileSystem._tryToDetectUuid(); + const response = await awsService['tryToDetectUuid'](); + expect(readFile).toBeCalledTimes(2); expect(response.isConfirmed()).toEqual(true); - expect(response.toJSON()).toEqual({ - name: AWS.getName(), - id: ec2Uuid.trim().toLowerCase(), - region: undefined, - zone: undefined, - vm_type: undefined, - metadata: undefined, - }); + expect(response.toJSON()).toMatchInlineSnapshot(` + Object { + "id": "ec2uuid", + "metadata": undefined, + "name": "aws", + "region": undefined, + "vm_type": undefined, + "zone": undefined, + } + `); }); it('returns unconfirmed if all files return errors', async () => { - const awsFailedFileSystem = new AWSCloudService({ - _fs: ({ - readFile: () => { - throw new Error('oops'); - }, - } as unknown) as typeof fs, - _isWindows: false, - }); - - const response = await awsFailedFileSystem._tryToDetectUuid(); + readFile.mockRejectedValue(new Error('oops')); + const response = await awsService['tryToDetectUuid'](); expect(response.isConfirmed()).toEqual(false); }); - }); - it('ignores UUID if it does not start with ec2', async () => { - const notEC2FileSystem = { - readFile: (filename: string, encoding: string, callback: Callback) => { - expect(expectedFilenames).toContain(filename); - expect(encoding).toEqual(expectedEncoding); + it('ignores UUID if it does not start with ec2', async () => { + readFile.mockResolvedValue('notEC2'); - callback(null, 'notEC2'); - }, - } as typeof fs; - - const awsCheckedFileSystem = new AWSCloudService({ - _fs: notEC2FileSystem, - _isWindows: false, + const response = await awsService['tryToDetectUuid'](); + expect(response.isConfirmed()).toEqual(false); }); - - const response = await awsCheckedFileSystem._tryToDetectUuid(); - - expect(response.isConfirmed()).toEqual(false); }); it('does NOT check the file system for UUID on Windows', async () => { - const awsUncheckedFileSystem = new AWSCloudService({ - _fs: ec2FileSystem, - _isWindows: true, - }); - - const response = await awsUncheckedFileSystem._tryToDetectUuid(); + mockIsWindows.mockReturnValue(true); + const response = await awsService['tryToDetectUuid'](); expect(response.isConfirmed()).toEqual(false); }); diff --git a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/aws.ts b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/aws.ts index 69e5698489b30..785313e752c5e 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/aws.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/aws.ts @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -import fs from 'fs'; -import { get, isString, omit } from 'lodash'; -import { promisify } from 'util'; -import { CloudService, CloudServiceOptions, Request, RequestOptions } from './cloud_service'; +import { readFile } from 'fs/promises'; +import { get, omit } from 'lodash'; +import fetch from 'node-fetch'; +import { CloudService } from './cloud_service'; import { CloudServiceResponse } from './cloud_response'; // We explicitly call out the version, 2016-09-02, rather than 'latest' to avoid unexpected changes @@ -40,9 +40,9 @@ export interface AWSResponse { * @internal */ export class AWSCloudService extends CloudService { - private readonly _isWindows: boolean; - private readonly _fs: typeof fs; - + constructor() { + super('aws'); + } /** * Parse the AWS response, if possible. * @@ -64,7 +64,8 @@ export class AWSCloudService extends CloudService { * "version" : "2010-08-31", * } */ - static parseBody(name: string, body: AWSResponse): CloudServiceResponse | null { + parseBody = (body: AWSResponse): CloudServiceResponse | null => { + const name = this.getName(); const id: string | undefined = get(body, 'instanceId'); const vmType: string | undefined = get(body, 'instanceType'); const region: string | undefined = get(body, 'region'); @@ -88,64 +89,60 @@ export class AWSCloudService extends CloudService { } return null; - } + }; - constructor(options: CloudServiceOptions = {}) { - super('aws', options); + private _isWindows = (): boolean => { + return process.platform.startsWith('win'); + }; - // Allow the file system handler to be swapped out for tests - const { _fs = fs, _isWindows = process.platform.startsWith('win') } = options; - - this._fs = _fs; - this._isWindows = _isWindows; - } + protected _checkIfService = async () => { + try { + const response = await fetch(SERVICE_ENDPOINT, { + method: 'GET', + }); - async _checkIfService(request: Request) { - const req: RequestOptions = { - method: 'GET', - uri: SERVICE_ENDPOINT, - json: true, - }; + if (!response.ok || response.status === 404) { + throw new Error('AWS request failed'); + } - return promisify(request)(req) - .then((response) => - this._parseResponse(response.body, (body) => - AWSCloudService.parseBody(this.getName(), body) - ) - ) - .catch(() => this._tryToDetectUuid()); - } + const jsonBody: AWSResponse = await response.json(); + return this._parseResponse(jsonBody, this.parseBody); + } catch (_) { + return this.tryToDetectUuid(); + } + }; /** * Attempt to load the UUID by checking `/sys/hypervisor/uuid`. * * This is a fallback option if the metadata service is unavailable for some reason. */ - _tryToDetectUuid() { + private tryToDetectUuid = async () => { + const isWindows = this._isWindows(); // Windows does not have an easy way to check - if (!this._isWindows) { + if (!isWindows) { const pathsToCheck = ['/sys/hypervisor/uuid', '/sys/devices/virtual/dmi/id/product_uuid']; - const promises = pathsToCheck.map((path) => promisify(this._fs.readFile)(path, 'utf8')); - - return Promise.allSettled(promises).then((responses) => { - for (const response of responses) { - let uuid; - if (response.status === 'fulfilled' && isString(response.value)) { - // Some AWS APIs return it lowercase (like the file did in testing), while others return it uppercase - uuid = response.value.trim().toLowerCase(); - - // There is a small chance of a false positive here in the unlikely event that a uuid which doesn't - // belong to ec2 happens to be generated with `ec2` as the first three characters. - if (uuid.startsWith('ec2')) { - return new CloudServiceResponse(this._name, true, { id: uuid }); - } + const responses = await Promise.allSettled( + pathsToCheck.map((path) => readFile(path, 'utf8')) + ); + + for (const response of responses) { + let uuid; + if (response.status === 'fulfilled' && typeof response.value === 'string') { + // Some AWS APIs return it lowercase (like the file did in testing), while others return it uppercase + uuid = response.value.trim().toLowerCase(); + + // There is a small chance of a false positive here in the unlikely event that a uuid which doesn't + // belong to ec2 happens to be generated with `ec2` as the first three characters. + if (uuid.startsWith('ec2')) { + return new CloudServiceResponse(this._name, true, { id: uuid }); } } + } - return this._createUnconfirmedResponse(); - }); + return this._createUnconfirmedResponse(); } - return Promise.resolve(this._createUnconfirmedResponse()); - } + return this._createUnconfirmedResponse(); + }; } diff --git a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/azure.test.ts b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/azure.test.ts index 17205562fa335..5bdbbbda55de6 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/azure.test.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/azure.test.ts @@ -6,36 +6,47 @@ * Side Public License, v 1. */ -import type { Request, RequestOptions } from './cloud_service'; +/* eslint-disable dot-notation */ +jest.mock('node-fetch'); import { AzureCloudService } from './azure'; -type Callback = (err: unknown, res: unknown) => void; +// eslint-disable-next-line @typescript-eslint/no-var-requires +const fetchMock = require('node-fetch') as jest.Mock; -const AZURE = new AzureCloudService(); - -describe('Azure', () => { +describe('AzureCloudService', () => { + const azureCloudService = new AzureCloudService(); it('is named "azure"', () => { - expect(AZURE.getName()).toEqual('azure'); + expect(azureCloudService.getName()).toEqual('azure'); }); describe('_checkIfService', () => { + beforeEach(() => { + jest.resetAllMocks(); + }); + it('handles expected response', async () => { const id = 'abcdef'; - const request = ((req: RequestOptions, callback: Callback) => { - expect(req.method).toEqual('GET'); - expect(req.uri).toEqual('http://169.254.169.254/metadata/instance?api-version=2017-04-02'); - expect(req.headers?.Metadata).toEqual('true'); - expect(req.json).toEqual(true); + fetchMock.mockResolvedValue({ + json: () => + `{"compute":{"vmId": "${id}","location":"fakeus","availabilityZone":"fakeus-2"}}`, + status: 200, + ok: true, + }); - const body = `{"compute":{"vmId": "${id}","location":"fakeus","availabilityZone":"fakeus-2"}}`; + const response = await azureCloudService['_checkIfService'](); - callback(null, { statusCode: 200, body }); - }) as Request; - const response = await AZURE._checkIfService(request); + expect(fetchMock).toBeCalledTimes(1); + expect(fetchMock).toBeCalledWith( + 'http://169.254.169.254/metadata/instance?api-version=2017-04-02', + { + method: 'GET', + headers: { Metadata: 'true' }, + } + ); expect(response.isConfirmed()).toEqual(true); expect(response.toJSON()).toEqual({ - name: AZURE.getName(), + name: azureCloudService.getName(), id, region: 'fakeus', vm_type: undefined, @@ -49,34 +60,30 @@ describe('Azure', () => { // NOTE: the CloudService method, checkIfService, catches the errors that follow it('handles not running on Azure with error by rethrowing it', async () => { const someError = new Error('expected: request failed'); - const failedRequest = ((_req: RequestOptions, callback: Callback) => - callback(someError, null)) as Request; + fetchMock.mockRejectedValue(someError); - expect(async () => { - await AZURE._checkIfService(failedRequest); - }).rejects.toThrowError(someError.message); + await expect(() => azureCloudService['_checkIfService']()).rejects.toThrowError( + someError.message + ); }); it('handles not running on Azure with 404 response by throwing error', async () => { - const failedRequest = ((_req: RequestOptions, callback: Callback) => - callback(null, { statusCode: 404 })) as Request; + fetchMock.mockResolvedValue({ status: 404 }); - expect(async () => { - await AZURE._checkIfService(failedRequest); - }).rejects.toThrowErrorMatchingInlineSnapshot(`"Azure request failed"`); + await expect(() => + azureCloudService['_checkIfService']() + ).rejects.toThrowErrorMatchingInlineSnapshot(`"Azure request failed"`); }); it('handles not running on Azure with unexpected response by throwing error', async () => { - const failedRequest = ((_req: RequestOptions, callback: Callback) => - callback(null, null)) as Request; - - expect(async () => { - await AZURE._checkIfService(failedRequest); - }).rejects.toThrowErrorMatchingInlineSnapshot(`"Azure request failed"`); + fetchMock.mockResolvedValue({ ok: false }); + await expect(() => + azureCloudService['_checkIfService']() + ).rejects.toThrowErrorMatchingInlineSnapshot(`"Azure request failed"`); }); }); - describe('_parseBody', () => { + describe('parseBody', () => { // it's expected that most users use the resource manager UI (which has been out for years) it('parses object in expected format', () => { const body = { @@ -119,10 +126,10 @@ describe('Azure', () => { }, }; - const response = AzureCloudService.parseBody(AZURE.getName(), body)!; + const response = azureCloudService['parseBody'](body)!; expect(response).not.toBeNull(); - expect(response.getName()).toEqual(AZURE.getName()); + expect(response.getName()).toEqual(azureCloudService.getName()); expect(response.isConfirmed()).toEqual(true); expect(response.toJSON()).toEqual({ name: 'azure', @@ -172,10 +179,10 @@ describe('Azure', () => { }, }; - const response = AzureCloudService.parseBody(AZURE.getName(), body)!; + const response = azureCloudService['parseBody'](body)!; expect(response).not.toBeNull(); - expect(response.getName()).toEqual(AZURE.getName()); + expect(response.getName()).toEqual(azureCloudService.getName()); expect(response.isConfirmed()).toEqual(true); expect(response.toJSON()).toEqual({ name: 'azure', @@ -191,13 +198,13 @@ describe('Azure', () => { it('ignores unexpected response body', () => { // @ts-expect-error - expect(AzureCloudService.parseBody(AZURE.getName(), undefined)).toBe(null); + expect(azureCloudService['parseBody'](undefined)).toBe(null); // @ts-expect-error - expect(AzureCloudService.parseBody(AZURE.getName(), null)).toBe(null); + expect(azureCloudService['parseBody'](null)).toBe(null); // @ts-expect-error - expect(AzureCloudService.parseBody(AZURE.getName(), {})).toBe(null); + expect(azureCloudService['parseBody']({})).toBe(null); // @ts-expect-error - expect(AzureCloudService.parseBody(AZURE.getName(), { privateIp: 'a.b.c.d' })).toBe(null); + expect(azureCloudService['parseBody']({ privateIp: 'a.b.c.d' })).toBe(null); }); }); }); diff --git a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/azure.ts b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/azure.ts index b846636f0ce6c..06a135960bd60 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/azure.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/azure.ts @@ -7,8 +7,8 @@ */ import { get, omit } from 'lodash'; -import { promisify } from 'util'; -import { CloudService, Request } from './cloud_service'; +import fetch from 'node-fetch'; +import { CloudService } from './cloud_service'; import { CloudServiceResponse } from './cloud_response'; // 2017-04-02 is the first GA release of this API @@ -25,6 +25,9 @@ interface AzureResponse { * @internal */ export class AzureCloudService extends CloudService { + constructor() { + super('azure'); + } /** * Parse the Azure response, if possible. * @@ -51,7 +54,8 @@ export class AzureCloudService extends CloudService { * } * } */ - static parseBody(name: string, body: AzureResponse): CloudServiceResponse | null { + private parseBody = (body: AzureResponse): CloudServiceResponse | null => { + const name = this.getName(); const compute: Record | undefined = get(body, 'compute'); const id = get, string>(compute, 'vmId'); const vmType = get, string>(compute, 'vmSize'); @@ -72,32 +76,22 @@ export class AzureCloudService extends CloudService { } return null; - } - - constructor(options = {}) { - super('azure', options); - } + }; - async _checkIfService(request: Request) { - const req = { + protected _checkIfService = async () => { + const response = await fetch(SERVICE_ENDPOINT, { method: 'GET', - uri: SERVICE_ENDPOINT, headers: { // Azure requires this header Metadata: 'true', }, - json: true, - }; - - const response = await promisify(request)(req); + }); - // Note: there is no fallback option for Azure - if (!response || response.statusCode === 404) { + if (!response.ok || response.status === 404) { throw new Error('Azure request failed'); } - return this._parseResponse(response.body, (body) => - AzureCloudService.parseBody(this.getName(), body) - ); - } + const jsonBody: AzureResponse = await response.json(); + return this._parseResponse(jsonBody, this.parseBody); + }; } diff --git a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_detector.ts b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_detector.ts index 3d093c81f8896..9930110979b87 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_detector.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_detector.ts @@ -37,9 +37,9 @@ export class CloudDetector { /** * Get any cloud details that we have detected. */ - getCloudDetails() { + public getCloudDetails = () => { return this.cloudDetails; - } + }; /** * Asynchronously detect the cloud service. @@ -48,9 +48,9 @@ export class CloudDetector { * caller to trigger the lookup and then simply use it whenever we * determine it. */ - async detectCloudService() { + public detectCloudService = async () => { this.cloudDetails = await this.getCloudService(); - } + }; /** * Check every cloud service until the first one reports success from detection. diff --git a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_service.test.ts b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_service.test.ts index 0a7d5899486ab..22bef6753e9cf 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_service.test.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_service.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { CloudService, Response } from './cloud_service'; +import { CloudService } from './cloud_service'; import { CloudServiceResponse } from './cloud_response'; describe('CloudService', () => { @@ -30,9 +30,9 @@ describe('CloudService', () => { describe('_checkIfService', () => { it('throws an exception unless overridden', async () => { - expect(async () => { - await service._checkIfService(undefined); - }).rejects.toThrowErrorMatchingInlineSnapshot(`"not implemented"`); + await expect(() => + service._checkIfService(undefined) + ).rejects.toThrowErrorMatchingInlineSnapshot(`"not implemented"`); }); }); @@ -88,52 +88,59 @@ describe('CloudService', () => { describe('_parseResponse', () => { const body = { some: { body: {} } }; - it('throws error upon failure to parse body as object', async () => { - expect(async () => { - await service._parseResponse(); - }).rejects.toMatchInlineSnapshot(`undefined`); - expect(async () => { - await service._parseResponse(null); - }).rejects.toMatchInlineSnapshot(`undefined`); - expect(async () => { - await service._parseResponse({}); - }).rejects.toMatchInlineSnapshot(`undefined`); - expect(async () => { - await service._parseResponse(123); - }).rejects.toMatchInlineSnapshot(`undefined`); - expect(async () => { - await service._parseResponse('raw string'); - }).rejects.toMatchInlineSnapshot(`[Error: 'raw string' is not a JSON object]`); - expect(async () => { - await service._parseResponse('{{}'); - }).rejects.toMatchInlineSnapshot(`[Error: '{{}' is not a JSON object]`); + it('throws error upon failure to parse body as object', () => { + expect(() => service._parseResponse()).toThrowErrorMatchingInlineSnapshot( + `"Unable to handle body"` + ); + expect(() => service._parseResponse(null)).toThrowErrorMatchingInlineSnapshot( + `"Unable to handle body"` + ); + expect(() => service._parseResponse({})).toThrowErrorMatchingInlineSnapshot( + `"Unable to handle body"` + ); + expect(() => service._parseResponse(123)).toThrowErrorMatchingInlineSnapshot( + `"Unable to handle body"` + ); + expect(() => service._parseResponse('raw string')).toThrowErrorMatchingInlineSnapshot( + `"'raw string' is not a JSON object"` + ); + expect(() => service._parseResponse('{{}')).toThrowErrorMatchingInlineSnapshot( + `"'{{}' is not a JSON object"` + ); }); - it('expects unusable bodies', async () => { - const parseBody = (parsedBody: Response['body']) => { - expect(parsedBody).toEqual(body); - - return null; - }; - - expect(async () => { - await service._parseResponse(JSON.stringify(body), parseBody); - }).rejects.toMatchInlineSnapshot(`undefined`); - expect(async () => { - await service._parseResponse(body, parseBody); - }).rejects.toMatchInlineSnapshot(`undefined`); + it('expects unusable bodies', () => { + const parseBody = jest.fn().mockReturnValue(null); + + expect(() => + service._parseResponse(JSON.stringify(body), parseBody) + ).toThrowErrorMatchingInlineSnapshot(`"Unable to handle body"`); + expect(parseBody).toBeCalledTimes(1); + expect(parseBody).toBeCalledWith(body); + parseBody.mockClear(); + + expect(() => service._parseResponse(body, parseBody)).toThrowErrorMatchingInlineSnapshot( + `"Unable to handle body"` + ); + expect(parseBody).toBeCalledTimes(1); + expect(parseBody).toBeCalledWith(body); }); it('uses parsed object to create response', async () => { const serviceResponse = new CloudServiceResponse('a123', true, { id: 'xyz' }); - const parseBody = (parsedBody: Response['body']) => { - expect(parsedBody).toEqual(body); - - return serviceResponse; - }; + const parseBody = jest.fn().mockReturnValue(serviceResponse); const response = await service._parseResponse(body, parseBody); + expect(parseBody).toBeCalledWith(body); + expect(response).toBe(serviceResponse); + }); + + it('parses object before passing it to parseBody to create response', async () => { + const serviceResponse = new CloudServiceResponse('a123', true, { id: 'xyz' }); + const parseBody = jest.fn().mockReturnValue(serviceResponse); + const response = await service._parseResponse(JSON.stringify(body), parseBody); + expect(parseBody).toBeCalledWith(body); expect(response).toBe(serviceResponse); }); }); diff --git a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_service.ts b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_service.ts index 768a46a457d7d..bea51437d25c4 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_service.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/cloud_service.ts @@ -6,81 +6,56 @@ * Side Public License, v 1. */ -import fs from 'fs'; -import { isObject, isString, isPlainObject } from 'lodash'; -import defaultRequest from 'request'; -import type { OptionsWithUri, Response as DefaultResponse } from 'request'; +import { isObject, isPlainObject } from 'lodash'; import { CloudServiceResponse } from './cloud_response'; -/** @internal */ -export type Request = typeof defaultRequest; - -/** @internal */ -export type RequestOptions = OptionsWithUri; - -/** @internal */ -export type Response = DefaultResponse; - -/** @internal */ -export interface CloudServiceOptions { - _request?: Request; - _fs?: typeof fs; - _isWindows?: boolean; -} - /** * CloudService provides a mechanism for cloud services to be checked for * metadata that may help to determine the best defaults and priorities. */ export abstract class CloudService { - private readonly _request: Request; protected readonly _name: string; - constructor(name: string, options: CloudServiceOptions = {}) { + constructor(name: string) { this._name = name.toLowerCase(); - - // Allow the HTTP handler to be swapped out for tests - const { _request = defaultRequest } = options; - - this._request = _request; } /** * Get the search-friendly name of the Cloud Service. */ - getName() { + public getName = () => { return this._name; - } + }; /** * Using whatever mechanism is required by the current Cloud Service, * determine if Kibana is running in it and return relevant metadata. */ - async checkIfService() { + public checkIfService = async () => { try { - return await this._checkIfService(this._request); + return await this._checkIfService(); } catch (e) { return this._createUnconfirmedResponse(); } - } + }; - _checkIfService(request: Request): Promise { + protected _checkIfService = async (): Promise => { // should always be overridden by a subclass return Promise.reject(new Error('not implemented')); - } + }; /** * Create a new CloudServiceResponse that denotes that this cloud service * is not being used by the current machine / VM. */ - _createUnconfirmedResponse() { + protected _createUnconfirmedResponse = () => { return CloudServiceResponse.unconfirmed(this._name); - } + }; /** * Strictly parse JSON. */ - _stringToJson(value: string) { + protected _stringToJson = (value: string) => { // note: this will throw an error if this is not a string value = value.trim(); @@ -94,7 +69,7 @@ export abstract class CloudService { } catch (e) { throw new Error(`'${value}' is not a JSON object`); } - } + }; /** * Convert the response to a JSON object and attempt to parse it using the @@ -103,28 +78,21 @@ export abstract class CloudService { * If the response cannot be parsed as a JSON object, or if it fails to be * useful, then parseBody should return null. */ - _parseResponse( - body: Response['body'], - parseBody?: (body: Response['body']) => CloudServiceResponse | null - ): Promise { + protected _parseResponse = ( + body: string | Body, + parseBodyFn: (body: Body) => CloudServiceResponse | null + ): CloudServiceResponse => { // parse it if necessary - if (isString(body)) { - try { - body = this._stringToJson(body); - } catch (err) { - return Promise.reject(err); - } - } - - if (isObject(body) && parseBody) { - const response = parseBody(body); + const jsonBody: Body = typeof body === 'string' ? this._stringToJson(body) : body; + if (isObject(jsonBody) && typeof parseBodyFn !== 'undefined') { + const response = parseBodyFn(jsonBody); if (response) { - return Promise.resolve(response); + return response; } } // use default handling - return Promise.reject(); - } + throw new Error('Unable to handle body'); + }; } diff --git a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/gcp.test.ts b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/gcp.test.ts index fd0b3331b4ad1..40bd0ef1fa1b1 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/gcp.test.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/gcp.test.ts @@ -5,136 +5,185 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - -import type { Request, RequestOptions } from './cloud_service'; +/* eslint-disable dot-notation */ +jest.mock('node-fetch'); import { GCPCloudService } from './gcp'; - -type Callback = (err: unknown, res: unknown) => void; - -const GCP = new GCPCloudService(); +// eslint-disable-next-line @typescript-eslint/no-var-requires +const fetchMock = require('node-fetch') as jest.Mock; describe('GCP', () => { + const gcpService = new GCPCloudService(); + beforeEach(() => jest.clearAllMocks()); + it('is named "gcp"', () => { - expect(GCP.getName()).toEqual('gcp'); + expect(gcpService.getName()).toEqual('gcp'); }); describe('_checkIfService', () => { // GCP responds with the header that they expect (and request lowercases the header's name) - const headers = { 'metadata-flavor': 'Google' }; + const headers = new Map(); + headers.set('metadata-flavor', 'Google'); it('handles expected responses', async () => { + const basePath = 'http://169.254.169.254/computeMetadata/v1/instance/'; const metadata: Record = { id: 'abcdef', 'machine-type': 'projects/441331612345/machineTypes/f1-micro', zone: 'projects/441331612345/zones/us-fake4-c', }; - const request = ((req: RequestOptions, callback: Callback) => { - const basePath = 'http://169.254.169.254/computeMetadata/v1/instance/'; - - expect(req.method).toEqual('GET'); - expect((req.uri as string).startsWith(basePath)).toBe(true); - expect(req.headers!['Metadata-Flavor']).toEqual('Google'); - expect(req.json).toEqual(false); - const requestKey = (req.uri as string).substring(basePath.length); - let body = null; + fetchMock.mockImplementation((url: string) => { + const requestKey = url.substring(basePath.length); + let body: string | null = null; if (metadata[requestKey]) { body = metadata[requestKey]; } + return { + status: 200, + ok: true, + text: () => body, + headers, + }; + }); - callback(null, { statusCode: 200, body, headers }); - }) as Request; - const response = await GCP._checkIfService(request); + const response = await gcpService['_checkIfService'](); + const fetchParams = { + headers: { 'Metadata-Flavor': 'Google' }, + method: 'GET', + }; + expect(fetchMock).toBeCalledTimes(3); + expect(fetchMock).toHaveBeenNthCalledWith(1, `${basePath}id`, fetchParams); + expect(fetchMock).toHaveBeenNthCalledWith(2, `${basePath}machine-type`, fetchParams); + expect(fetchMock).toHaveBeenNthCalledWith(3, `${basePath}zone`, fetchParams); expect(response.isConfirmed()).toEqual(true); - expect(response.toJSON()).toEqual({ - name: GCP.getName(), - id: metadata.id, - region: 'us-fake4', - vm_type: 'f1-micro', - zone: 'us-fake4-c', - metadata: undefined, - }); + expect(response.toJSON()).toMatchInlineSnapshot(` + Object { + "id": "abcdef", + "metadata": undefined, + "name": "gcp", + "region": "us-fake4", + "vm_type": "f1-micro", + "zone": "us-fake4-c", + } + `); }); // NOTE: the CloudService method, checkIfService, catches the errors that follow it('handles unexpected responses', async () => { - const request = ((_req: RequestOptions, callback: Callback) => - callback(null, { statusCode: 200, headers })) as Request; + fetchMock.mockResolvedValue({ + status: 200, + ok: true, + headers, + text: () => undefined, + }); - expect(async () => { - await GCP._checkIfService(request); - }).rejects.toThrowErrorMatchingInlineSnapshot(`"unrecognized responses"`); + await expect(() => + gcpService['_checkIfService']() + ).rejects.toThrowErrorMatchingInlineSnapshot(`"unrecognized responses"`); }); it('handles unexpected responses without response header', async () => { - const body = 'xyz'; - const failedRequest = ((_req: RequestOptions, callback: Callback) => - callback(null, { statusCode: 200, body })) as Request; + fetchMock.mockResolvedValue({ + status: 200, + ok: true, + headers: new Map(), + text: () => 'xyz', + }); - expect(async () => { - await GCP._checkIfService(failedRequest); - }).rejects.toThrowErrorMatchingInlineSnapshot(`"unrecognized responses"`); + await expect(() => + gcpService['_checkIfService']() + ).rejects.toThrowErrorMatchingInlineSnapshot(`"GCP request failed"`); }); - it('handles not running on GCP with error by rethrowing it', async () => { + it('handles not running on GCP', async () => { const someError = new Error('expected: request failed'); - const failedRequest = ((_req: RequestOptions, callback: Callback) => - callback(someError, null)) as Request; + fetchMock.mockRejectedValue(someError); - expect(async () => { - await GCP._checkIfService(failedRequest); - }).rejects.toThrowError(someError); + await expect(() => + gcpService['_checkIfService']() + ).rejects.toThrowErrorMatchingInlineSnapshot(`"GCP request failed"`); }); it('handles not running on GCP with 404 response by throwing error', async () => { - const body = 'This is some random error text'; - const failedRequest = ((_req: RequestOptions, callback: Callback) => - callback(null, { statusCode: 404, headers, body })) as Request; + fetchMock.mockResolvedValue({ + status: 404, + ok: false, + headers, + text: () => 'This is some random error text', + }); - expect(async () => { - await GCP._checkIfService(failedRequest); - }).rejects.toThrowErrorMatchingInlineSnapshot(`"GCP request failed"`); + await expect(() => + gcpService['_checkIfService']() + ).rejects.toThrowErrorMatchingInlineSnapshot(`"GCP request failed"`); }); - it('handles not running on GCP with unexpected response by throwing error', async () => { - const failedRequest = ((_req: RequestOptions, callback: Callback) => - callback(null, null)) as Request; + it('handles GCP response even if some requests fail', async () => { + fetchMock + .mockResolvedValueOnce({ + status: 200, + ok: true, + headers, + text: () => 'some_id', + }) + .mockRejectedValueOnce({ + status: 500, + ok: false, + headers, + text: () => 'This is some random error text', + }) + .mockResolvedValueOnce({ + status: 404, + ok: false, + headers, + text: () => 'URI Not found', + }); + const response = await gcpService['_checkIfService'](); + + expect(fetchMock).toBeCalledTimes(3); - expect(async () => { - await GCP._checkIfService(failedRequest); - }).rejects.toThrowErrorMatchingInlineSnapshot(`"GCP request failed"`); + expect(response.isConfirmed()).toEqual(true); + expect(response.toJSON()).toMatchInlineSnapshot(` + Object { + "id": "some_id", + "metadata": undefined, + "name": "gcp", + "region": undefined, + "vm_type": undefined, + "zone": undefined, + } + `); }); }); - describe('_extractValue', () => { + describe('extractValue', () => { it('only handles strings', () => { // @ts-expect-error - expect(GCP._extractValue()).toBe(undefined); + expect(gcpService['extractValue']()).toBe(undefined); // @ts-expect-error - expect(GCP._extractValue(null, null)).toBe(undefined); + expect(gcpService['extractValue'](null, null)).toBe(undefined); // @ts-expect-error - expect(GCP._extractValue('abc', { field: 'abcxyz' })).toBe(undefined); + expect(gcpService['extractValue']('abc', { field: 'abcxyz' })).toBe(undefined); // @ts-expect-error - expect(GCP._extractValue('abc', 1234)).toBe(undefined); - expect(GCP._extractValue('abc/', 'abc/xyz')).toEqual('xyz'); + expect(gcpService['extractValue']('abc', 1234)).toBe(undefined); + expect(gcpService['extractValue']('abc/', 'abc/xyz')).toEqual('xyz'); }); it('uses the last index of the prefix to truncate', () => { - expect(GCP._extractValue('abc/', ' \n 123/abc/xyz\t \n')).toEqual('xyz'); + expect(gcpService['extractValue']('abc/', ' \n 123/abc/xyz\t \n')).toEqual('xyz'); }); }); - describe('_combineResponses', () => { + describe('combineResponses', () => { it('parses in expected format', () => { const id = '5702733457649812345'; const machineType = 'projects/441331612345/machineTypes/f1-micro'; const zone = 'projects/441331612345/zones/us-fake4-c'; - const response = GCP._combineResponses(id, machineType, zone); + const response = gcpService['combineResponses'](id, machineType, zone); - expect(response.getName()).toEqual(GCP.getName()); + expect(response.getName()).toEqual('gcp'); expect(response.isConfirmed()).toEqual(true); expect(response.toJSON()).toEqual({ name: 'gcp', @@ -152,9 +201,9 @@ describe('GCP', () => { const machineType = 'f1-micro'; const zone = 'us-fake4-c'; - const response = GCP._combineResponses(id, machineType, zone); + const response = gcpService['combineResponses'](id, machineType, zone); - expect(response.getName()).toEqual(GCP.getName()); + expect(response.getName()).toEqual('gcp'); expect(response.isConfirmed()).toEqual(true); expect(response.toJSON()).toEqual({ name: 'gcp', @@ -167,18 +216,16 @@ describe('GCP', () => { }); it('ignores unexpected response body', () => { + expect(() => gcpService['combineResponses']()).toThrow(); + expect(() => gcpService['combineResponses'](undefined, undefined, undefined)).toThrow(); // @ts-expect-error - expect(() => GCP._combineResponses()).toThrow(); - // @ts-expect-error - expect(() => GCP._combineResponses(undefined, undefined, undefined)).toThrow(); - // @ts-expect-error - expect(() => GCP._combineResponses(null, null, null)).toThrow(); + expect(() => gcpService['combineResponses'](null, null, null)).toThrow(); expect(() => // @ts-expect-error - GCP._combineResponses({ id: 'x' }, { machineType: 'a' }, { zone: 'b' }) + gcpService['combineResponses']({ id: 'x' }, { machineType: 'a' }, { zone: 'b' }) ).toThrow(); // @ts-expect-error - expect(() => GCP._combineResponses({ privateIp: 'a.b.c.d' })).toThrow(); + expect(() => gcpService['combineResponses']({ privateIp: 'a.b.c.d' })).toThrow(); }); }); }); diff --git a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/gcp.ts b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/gcp.ts index 565c07abd1d2c..2cdf3f87cfe8f 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/gcp.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/cloud/detector/gcp.ts @@ -6,14 +6,15 @@ * Side Public License, v 1. */ -import { isString } from 'lodash'; -import { promisify } from 'util'; -import { CloudService, CloudServiceOptions, Request, Response } from './cloud_service'; +import fetch, { Response } from 'node-fetch'; +import { CloudService } from './cloud_service'; import { CloudServiceResponse } from './cloud_response'; // GCP documentation shows both 'metadata.google.internal' (mostly) and '169.254.169.254' (sometimes) // To bypass potential DNS changes, the IP was used because it's shared with other cloud services const SERVICE_ENDPOINT = 'http://169.254.169.254/computeMetadata/v1/instance'; +// GCP required headers +const SERVICE_HEADERS = { 'Metadata-Flavor': 'Google' }; /** * Checks and loads the service metadata for an Google Cloud Platform VM if it is available. @@ -21,61 +22,54 @@ const SERVICE_ENDPOINT = 'http://169.254.169.254/computeMetadata/v1/instance'; * @internal */ export class GCPCloudService extends CloudService { - constructor(options: CloudServiceOptions = {}) { - super('gcp', options); + constructor() { + super('gcp'); } - _checkIfService(request: Request) { + protected _checkIfService = async () => { // we need to call GCP individually for each field we want metadata for const fields = ['id', 'machine-type', 'zone']; - const create = this._createRequestForField; - const allRequests = fields.map((field) => promisify(request)(create(field))); - return ( - Promise.all(allRequests) - // Note: there is no fallback option for GCP; - // responses are arrays containing [fullResponse, body]; - // because GCP returns plaintext, we have no way of validating - // without using the response code. - .then((responses) => { - return responses.map((response) => { - if (!response || response.statusCode === 404) { - throw new Error('GCP request failed'); - } - return this._extractBody(response, response.body); - }); - }) - .then(([id, machineType, zone]) => this._combineResponses(id, machineType, zone)) + const settledResponses = await Promise.allSettled( + fields.map(async (field) => { + return await fetch(`${SERVICE_ENDPOINT}/${field}`, { + method: 'GET', + headers: { ...SERVICE_HEADERS }, + }); + }) ); - } - _createRequestForField(field: string) { - return { - method: 'GET', - uri: `${SERVICE_ENDPOINT}/${field}`, - headers: { - // GCP requires this header - 'Metadata-Flavor': 'Google', - }, - // GCP does _not_ return JSON - json: false, - }; - } + const hasValidResponses = settledResponses.some(this.isValidResponse); - /** - * Extract the body if the response is valid and it came from GCP. - */ - _extractBody(response: Response, body?: Response['body']) { - if ( - response?.statusCode === 200 && - response.headers && - response.headers['metadata-flavor'] === 'Google' - ) { - return body; + if (!hasValidResponses) { + throw new Error('GCP request failed'); } - return null; - } + // Note: there is no fallback option for GCP; + // responses are arrays containing [fullResponse, body]; + // because GCP returns plaintext, we have no way of validating + // without using the response code. + const [id, machineType, zone] = await Promise.all( + settledResponses.map(async (settledResponse) => { + if (this.isValidResponse(settledResponse)) { + // GCP does _not_ return JSON + return await settledResponse.value.text(); + } + }) + ); + + return this.combineResponses(id, machineType, zone); + }; + + private isValidResponse = ( + settledResponse: PromiseSettledResult + ): settledResponse is PromiseFulfilledResult => { + if (settledResponse.status === 'rejected') { + return false; + } + const { value } = settledResponse; + return value.ok && value.status !== 404 && value.headers.get('metadata-flavor') === 'Google'; + }; /** * Parse the GCP responses, if possible. @@ -86,17 +80,11 @@ export class GCPCloudService extends CloudService { * machineType: 'projects/441331612345/machineTypes/f1-micro' * zone: 'projects/441331612345/zones/us-east4-c' */ - _combineResponses(id: string, machineType: string, zone: string) { - const vmId = isString(id) ? id.trim() : undefined; - const vmType = this._extractValue('machineTypes/', machineType); - const vmZone = this._extractValue('zones/', zone); - - let region; - - if (vmZone) { - // converts 'us-east4-c' into 'us-east4' - region = vmZone.substring(0, vmZone.lastIndexOf('-')); - } + private combineResponses = (id?: string, machineType?: string, zone?: string) => { + const vmId = typeof id === 'string' ? id.trim() : undefined; + const vmType = this.extractValue('machineTypes/', machineType); + const vmZone = this.extractValue('zones/', zone); + const region = vmZone ? vmZone.substring(0, vmZone.lastIndexOf('-')) : undefined; // ensure we actually have some data if (vmId || vmType || region || vmZone) { @@ -104,7 +92,7 @@ export class GCPCloudService extends CloudService { } throw new Error('unrecognized responses'); - } + }; /** * Extract the useful information returned from GCP while discarding @@ -113,15 +101,15 @@ export class GCPCloudService extends CloudService { * For example, this turns something like * 'projects/441331612345/machineTypes/f1-micro' into 'f1-micro'. */ - _extractValue(fieldPrefix: string, value: string) { - if (isString(value)) { - const index = value.lastIndexOf(fieldPrefix); - - if (index !== -1) { - return value.substring(index + fieldPrefix.length).trim(); - } + private extractValue = (fieldPrefix: string, value?: string) => { + if (typeof value !== 'string') { + return; } - return undefined; - } + const index = value.lastIndexOf(fieldPrefix); + + if (index !== -1) { + return value.substring(index + fieldPrefix.length).trim(); + } + }; } diff --git a/src/plugins/kibana_usage_collection/server/collectors/core/core_usage_collector.ts b/src/plugins/kibana_usage_collection/server/collectors/core/core_usage_collector.ts index f7a16b3f563bd..853681c47cf85 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/core/core_usage_collector.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/core/core_usage_collector.ts @@ -936,11 +936,51 @@ export function getCoreUsageCollector( 'How many times this API has been called by a non-Kibana client in a custom space.', }, }, - 'apiCalls.savedObjectsExport.allTypesSelected.yes': { + // Legacy dashboard import/export APIs + 'apiCalls.legacyDashboardExport.total': { + type: 'long', + _meta: { description: 'How many times this API has been called.' }, + }, + 'apiCalls.legacyDashboardExport.namespace.default.total': { + type: 'long', + _meta: { description: 'How many times this API has been called in the Default space.' }, + }, + 'apiCalls.legacyDashboardExport.namespace.default.kibanaRequest.yes': { type: 'long', _meta: { description: - 'How many times this API has been called with the `createNewCopiesEnabled` option.', + 'How many times this API has been called by the Kibana client in the Default space.', + }, + }, + 'apiCalls.legacyDashboardExport.namespace.default.kibanaRequest.no': { + type: 'long', + _meta: { + description: + 'How many times this API has been called by a non-Kibana client in the Default space.', + }, + }, + 'apiCalls.legacyDashboardExport.namespace.custom.total': { + type: 'long', + _meta: { description: 'How many times this API has been called in a custom space.' }, + }, + 'apiCalls.legacyDashboardExport.namespace.custom.kibanaRequest.yes': { + type: 'long', + _meta: { + description: + 'How many times this API has been called by the Kibana client in a custom space.', + }, + }, + 'apiCalls.legacyDashboardExport.namespace.custom.kibanaRequest.no': { + type: 'long', + _meta: { + description: + 'How many times this API has been called by a non-Kibana client in a custom space.', + }, + }, + 'apiCalls.savedObjectsExport.allTypesSelected.yes': { + type: 'long', + _meta: { + description: 'How many times this API has been called with all types selected.', }, }, 'apiCalls.savedObjectsExport.allTypesSelected.no': { @@ -949,6 +989,46 @@ export function getCoreUsageCollector( description: 'How many times this API has been called without all types selected.', }, }, + 'apiCalls.legacyDashboardImport.total': { + type: 'long', + _meta: { description: 'How many times this API has been called.' }, + }, + 'apiCalls.legacyDashboardImport.namespace.default.total': { + type: 'long', + _meta: { description: 'How many times this API has been called in the Default space.' }, + }, + 'apiCalls.legacyDashboardImport.namespace.default.kibanaRequest.yes': { + type: 'long', + _meta: { + description: + 'How many times this API has been called by the Kibana client in the Default space.', + }, + }, + 'apiCalls.legacyDashboardImport.namespace.default.kibanaRequest.no': { + type: 'long', + _meta: { + description: + 'How many times this API has been called by a non-Kibana client in the Default space.', + }, + }, + 'apiCalls.legacyDashboardImport.namespace.custom.total': { + type: 'long', + _meta: { description: 'How many times this API has been called in a custom space.' }, + }, + 'apiCalls.legacyDashboardImport.namespace.custom.kibanaRequest.yes': { + type: 'long', + _meta: { + description: + 'How many times this API has been called by the Kibana client in a custom space.', + }, + }, + 'apiCalls.legacyDashboardImport.namespace.custom.kibanaRequest.no': { + type: 'long', + _meta: { + description: + 'How many times this API has been called by a non-Kibana client in a custom space.', + }, + }, // Saved Objects Repository counters 'savedObjectsRepository.resolvedOutcome.exactMatch': { type: 'long', diff --git a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/constants.ts b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/constants.ts index d6201deff5fec..4661441a15a6b 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/constants.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/constants.ts @@ -31,11 +31,6 @@ export const MONITOR_EVENT_LOOP_DELAYS_RESET = 24 * 60 * 60 * 1000; */ export const MONITOR_EVENT_LOOP_DELAYS_START = 1 * 60 * 1000; -/** - * Event loop monitoring sampling rate in milliseconds. - */ -export const MONITOR_EVENT_LOOP_DELAYS_RESOLUTION = 10; - /** * Mean event loop delay threshold for logging a warning. */ diff --git a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/event_loop_delays.mocks.ts b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/event_loop_delays.mocks.ts deleted file mode 100644 index f266a27a7034f..0000000000000 --- a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/event_loop_delays.mocks.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { IntervalHistogram } from './event_loop_delays'; - -export const mockMonitorEnable = jest.fn(); -export const mockMonitorPercentile = jest.fn(); -export const mockMonitorReset = jest.fn(); -export const mockMonitorDisable = jest.fn(); -export const monitorEventLoopDelay = jest.fn().mockReturnValue({ - enable: mockMonitorEnable, - percentile: mockMonitorPercentile, - disable: mockMonitorDisable, - reset: mockMonitorReset, - ...createMockHistogram(), -}); - -jest.doMock('perf_hooks', () => ({ - monitorEventLoopDelay, -})); - -function createMockHistogram(overwrites: Partial = {}): IntervalHistogram { - const now = moment(); - - return { - min: 9093120, - max: 53247999, - mean: 11993238.600747818, - exceeds: 0, - stddev: 1168191.9357543814, - fromTimestamp: now.startOf('day').toISOString(), - lastUpdatedAt: now.toISOString(), - percentiles: { - '50': 12607487, - '75': 12615679, - '95': 12648447, - '99': 12713983, - }, - ...overwrites, - }; -} - -export const mocked = { - createHistogram: createMockHistogram, -}; diff --git a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/event_loop_delays.test.ts b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/event_loop_delays.test.ts deleted file mode 100644 index b40030e210176..0000000000000 --- a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/event_loop_delays.test.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { - mockMonitorEnable, - mockMonitorPercentile, - monitorEventLoopDelay, - mockMonitorReset, - mockMonitorDisable, -} from './event_loop_delays.mocks'; -import { EventLoopDelaysCollector } from './event_loop_delays'; - -describe('EventLoopDelaysCollector', () => { - jest.useFakeTimers('modern'); - const mockNow = jest.getRealSystemTime(); - jest.setSystemTime(mockNow); - - beforeEach(() => jest.clearAllMocks()); - afterAll(() => jest.useRealTimers()); - - test('#constructor enables monitoring', () => { - new EventLoopDelaysCollector(); - expect(monitorEventLoopDelay).toBeCalledWith({ resolution: 10 }); - expect(mockMonitorEnable).toBeCalledTimes(1); - }); - - test('#collect returns event loop delays histogram', () => { - const eventLoopDelaysCollector = new EventLoopDelaysCollector(); - const histogramData = eventLoopDelaysCollector.collect(); - expect(mockMonitorPercentile).toHaveBeenNthCalledWith(1, 50); - expect(mockMonitorPercentile).toHaveBeenNthCalledWith(2, 75); - expect(mockMonitorPercentile).toHaveBeenNthCalledWith(3, 95); - expect(mockMonitorPercentile).toHaveBeenNthCalledWith(4, 99); - - expect(Object.keys(histogramData)).toMatchInlineSnapshot(` - Array [ - "min", - "max", - "mean", - "exceeds", - "stddev", - "fromTimestamp", - "lastUpdatedAt", - "percentiles", - ] - `); - }); - test('#reset resets histogram data', () => { - const eventLoopDelaysCollector = new EventLoopDelaysCollector(); - eventLoopDelaysCollector.reset(); - expect(mockMonitorReset).toBeCalledTimes(1); - }); - test('#stop disables monitoring event loop delays', () => { - const eventLoopDelaysCollector = new EventLoopDelaysCollector(); - eventLoopDelaysCollector.stop(); - expect(mockMonitorDisable).toBeCalledTimes(1); - }); -}); diff --git a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/event_loop_delays.ts b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/event_loop_delays.ts deleted file mode 100644 index f5de44a061d5a..0000000000000 --- a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/event_loop_delays.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { EventLoopDelayMonitor } from 'perf_hooks'; -import { monitorEventLoopDelay } from 'perf_hooks'; -import { MONITOR_EVENT_LOOP_DELAYS_RESOLUTION } from './constants'; - -export interface IntervalHistogram { - fromTimestamp: string; - lastUpdatedAt: string; - min: number; - max: number; - mean: number; - exceeds: number; - stddev: number; - percentiles: { - 50: number; - 75: number; - 95: number; - 99: number; - }; -} - -export class EventLoopDelaysCollector { - private readonly loopMonitor: EventLoopDelayMonitor; - private fromTimestamp: Date; - - constructor() { - const monitor = monitorEventLoopDelay({ - resolution: MONITOR_EVENT_LOOP_DELAYS_RESOLUTION, - }); - monitor.enable(); - this.fromTimestamp = new Date(); - this.loopMonitor = monitor; - } - - public collect(): IntervalHistogram { - const { min, max, mean, exceeds, stddev } = this.loopMonitor; - - return { - min, - max, - mean, - exceeds, - stddev, - fromTimestamp: this.fromTimestamp.toISOString(), - lastUpdatedAt: new Date().toISOString(), - percentiles: { - 50: this.loopMonitor.percentile(50), - 75: this.loopMonitor.percentile(75), - 95: this.loopMonitor.percentile(95), - 99: this.loopMonitor.percentile(99), - }, - }; - } - - public reset() { - this.loopMonitor.reset(); - this.fromTimestamp = new Date(); - } - - public stop() { - this.loopMonitor.disable(); - } -} diff --git a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/rollups/integration_tests/daily_rollups.test.ts b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/rollups/integration_tests/daily_rollups.test.ts index 94840ccfc2748..64668a5f23de1 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/rollups/integration_tests/daily_rollups.test.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/rollups/integration_tests/daily_rollups.test.ts @@ -14,7 +14,7 @@ import { createRootWithCorePlugins, } from '../../../../../../../core/test_helpers/kbn_server'; import { rollDailyData } from '../daily'; -import { mocked } from '../../event_loop_delays.mocks'; +import { metricsServiceMock } from '../../../../../../../core/server/mocks'; import { SAVED_OBJECTS_DAILY_TYPE, @@ -26,18 +26,20 @@ import moment from 'moment'; const { startES } = createTestServers({ adjustTimeout: (t: number) => jest.setTimeout(t), }); - +const eventLoopDelaysMonitor = metricsServiceMock.createEventLoopDelaysMonitor(); function createRawObject(date: moment.MomentInput) { const pid = Math.round(Math.random() * 10000); + const instanceUuid = 'mock_instance'; + return { type: SAVED_OBJECTS_DAILY_TYPE, - id: serializeSavedObjectId({ pid, date }), + id: serializeSavedObjectId({ pid, date, instanceUuid }), attributes: { - ...mocked.createHistogram({ - fromTimestamp: moment(date).startOf('day').toISOString(), - lastUpdatedAt: moment(date).toISOString(), - }), + ...eventLoopDelaysMonitor.collect(), + fromTimestamp: moment(date).startOf('day').toISOString(), + lastUpdatedAt: moment(date).toISOString(), processId: pid, + instanceUuid, }, }; } diff --git a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/saved_objects.test.ts b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/saved_objects.test.ts index 022040615bd45..ddae0ff302829 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/saved_objects.test.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/saved_objects.test.ts @@ -11,21 +11,19 @@ import { serializeSavedObjectId, deleteHistogramSavedObjects, } from './saved_objects'; -import { savedObjectsRepositoryMock } from '../../../../../core/server/mocks'; +import { savedObjectsRepositoryMock, metricsServiceMock } from '../../../../../core/server/mocks'; import type { SavedObjectsFindResponse } from '../../../../../core/server/'; -import { mocked } from './event_loop_delays.mocks'; describe('serializeSavedObjectId', () => { it('returns serialized id', () => { - const id = serializeSavedObjectId({ date: 1623233091278, pid: 123 }); - expect(id).toBe('123::09062021'); + const id = serializeSavedObjectId({ instanceUuid: 'mock_uuid', date: 1623233091278, pid: 123 }); + expect(id).toBe('mock_uuid::123::09062021'); }); }); describe('storeHistogram', () => { - const mockHistogram = mocked.createHistogram(); + const eventLoopDelaysMonitor = metricsServiceMock.createEventLoopDelaysMonitor(); const mockInternalRepository = savedObjectsRepositoryMock.create(); - jest.useFakeTimers('modern'); const mockNow = jest.getRealSystemTime(); jest.setSystemTime(mockNow); @@ -34,13 +32,15 @@ describe('storeHistogram', () => { afterAll(() => jest.useRealTimers()); it('stores histogram data in a savedObject', async () => { - await storeHistogram(mockHistogram, mockInternalRepository); + const mockHistogram = eventLoopDelaysMonitor.collect(); + const instanceUuid = 'mock_uuid'; + await storeHistogram(mockHistogram, mockInternalRepository, instanceUuid); const pid = process.pid; - const id = serializeSavedObjectId({ date: mockNow, pid }); + const id = serializeSavedObjectId({ date: mockNow, pid, instanceUuid }); expect(mockInternalRepository.create).toBeCalledWith( 'event_loop_delays_daily', - { ...mockHistogram, processId: pid }, + { ...mockHistogram, processId: pid, instanceUuid }, { id, overwrite: true } ); }); diff --git a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/saved_objects.ts b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/saved_objects.ts index 610a6697da364..57a9bb3b739c0 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/saved_objects.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/saved_objects.ts @@ -12,12 +12,12 @@ import type { ISavedObjectsRepository, } from 'kibana/server'; import moment from 'moment'; -import type { IntervalHistogram } from './event_loop_delays'; - +import type { IntervalHistogram } from 'kibana/server'; export const SAVED_OBJECTS_DAILY_TYPE = 'event_loop_delays_daily'; export interface EventLoopDelaysDaily extends SavedObjectAttributes, IntervalHistogram { processId: number; + instanceUuid: string; } export function registerSavedObjectTypes(registerType: SavedObjectsServiceSetup['registerType']) { @@ -35,10 +35,18 @@ export function registerSavedObjectTypes(registerType: SavedObjectsServiceSetup[ }); } -export function serializeSavedObjectId({ date, pid }: { date: moment.MomentInput; pid: number }) { +export function serializeSavedObjectId({ + date, + pid, + instanceUuid, +}: { + date: moment.MomentInput; + pid: number; + instanceUuid: string; +}) { const formattedDate = moment(date).format('DDMMYYYY'); - return `${pid}::${formattedDate}`; + return `${instanceUuid}::${pid}::${formattedDate}`; } export async function deleteHistogramSavedObjects( @@ -59,14 +67,15 @@ export async function deleteHistogramSavedObjects( export async function storeHistogram( histogram: IntervalHistogram, - internalRepository: ISavedObjectsRepository + internalRepository: ISavedObjectsRepository, + instanceUuid: string ) { const pid = process.pid; - const id = serializeSavedObjectId({ date: histogram.lastUpdatedAt, pid }); + const id = serializeSavedObjectId({ date: histogram.lastUpdatedAt, pid, instanceUuid }); return await internalRepository.create( SAVED_OBJECTS_DAILY_TYPE, - { ...histogram, processId: pid }, + { ...histogram, processId: pid, instanceUuid }, { id, overwrite: true } ); } diff --git a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/schema.ts index 319e8c77438b8..757e96e5602f0 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/schema.ts @@ -11,6 +11,7 @@ import { MakeSchemaFrom } from 'src/plugins/usage_collection/server'; export interface EventLoopDelaysUsageReport { daily: Array<{ processId: number; + instanceUuid: string; lastUpdatedAt: string; fromTimestamp: string; min: number; @@ -37,6 +38,12 @@ export const eventLoopDelaysUsageSchema: MakeSchemaFrom { + const eventLoopDelaysMonitor = metricsServiceMock.createEventLoopDelaysMonitor(); const mockInternalRepository = savedObjectsRepositoryMock.create(); const stopMonitoringEventLoop$ = new Subject(); + const instanceUuid = 'mock_uuid'; beforeAll(() => jest.useFakeTimers('modern')); beforeEach(() => jest.clearAllMocks()); afterEach(() => stopMonitoringEventLoop$.next()); - it('initializes EventLoopDelaysCollector and starts timer', () => { + it('collects eventLoopDelaysMonitor metrics after start delay', () => { const collectionStartDelay = 1000; - startTrackingEventLoopDelaysUsage(mockInternalRepository, stopMonitoringEventLoop$, { - collectionStartDelay, - }); + startTrackingEventLoopDelaysUsage( + mockInternalRepository, + instanceUuid, + stopMonitoringEventLoop$, + eventLoopDelaysMonitor, + { + collectionStartDelay, + } + ); - expect(monitorEventLoopDelay).toBeCalledTimes(1); - expect(mockMonitorPercentile).toBeCalledTimes(0); + expect(eventLoopDelaysMonitor.collect).toBeCalledTimes(0); jest.advanceTimersByTime(collectionStartDelay); - expect(mockMonitorPercentile).toBeCalled(); + expect(eventLoopDelaysMonitor.collect).toBeCalledTimes(1); }); it('stores event loop delays every collectionInterval duration', () => { const collectionStartDelay = 100; const collectionInterval = 1000; - startTrackingEventLoopDelaysUsage(mockInternalRepository, stopMonitoringEventLoop$, { - collectionStartDelay, - collectionInterval, - }); + startTrackingEventLoopDelaysUsage( + mockInternalRepository, + instanceUuid, + stopMonitoringEventLoop$, + eventLoopDelaysMonitor, + { + collectionStartDelay, + collectionInterval, + } + ); expect(mockInternalRepository.create).toBeCalledTimes(0); jest.advanceTimersByTime(collectionStartDelay); @@ -54,28 +60,39 @@ describe('startTrackingEventLoopDelaysUsage', () => { expect(mockInternalRepository.create).toBeCalledTimes(3); }); - it('resets histogram every histogramReset duration', () => { + it('resets eventLoopDelaysMonitor every histogramReset duration', () => { const collectionStartDelay = 0; const collectionInterval = 1000; const histogramReset = 5000; - startTrackingEventLoopDelaysUsage(mockInternalRepository, stopMonitoringEventLoop$, { - collectionStartDelay, - collectionInterval, - histogramReset, - }); - expect(mockMonitorReset).toBeCalledTimes(0); + startTrackingEventLoopDelaysUsage( + mockInternalRepository, + instanceUuid, + stopMonitoringEventLoop$, + eventLoopDelaysMonitor, + { + collectionStartDelay, + collectionInterval, + histogramReset, + } + ); + + expect(eventLoopDelaysMonitor.reset).toBeCalledTimes(0); jest.advanceTimersByTime(collectionInterval * 5); - expect(mockMonitorReset).toBeCalledTimes(1); + expect(eventLoopDelaysMonitor.reset).toBeCalledTimes(1); jest.advanceTimersByTime(collectionInterval * 5); - expect(mockMonitorReset).toBeCalledTimes(2); + expect(eventLoopDelaysMonitor.reset).toBeCalledTimes(2); }); it('stops monitoring event loop delays once stopMonitoringEventLoop$.next is called', () => { - startTrackingEventLoopDelaysUsage(mockInternalRepository, stopMonitoringEventLoop$); - - expect(mockMonitorDisable).toBeCalledTimes(0); + startTrackingEventLoopDelaysUsage( + mockInternalRepository, + instanceUuid, + stopMonitoringEventLoop$, + eventLoopDelaysMonitor + ); + expect(eventLoopDelaysMonitor.stop).toBeCalledTimes(0); stopMonitoringEventLoop$.next(); - expect(mockMonitorDisable).toBeCalledTimes(1); + expect(eventLoopDelaysMonitor.stop).toBeCalledTimes(1); }); }); diff --git a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/track_delays.ts b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/track_delays.ts index 70638d3b07cbc..facdb549d0df7 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/track_delays.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/track_delays.ts @@ -9,13 +9,13 @@ import { takeUntil, finalize, map } from 'rxjs/operators'; import { Observable, timer } from 'rxjs'; import type { ISavedObjectsRepository } from 'kibana/server'; +import type { EventLoopDelaysMonitor } from '../../../../../core/server'; import { MONITOR_EVENT_LOOP_DELAYS_START, MONITOR_EVENT_LOOP_DELAYS_INTERVAL, MONITOR_EVENT_LOOP_DELAYS_RESET, } from './constants'; import { storeHistogram } from './saved_objects'; -import { EventLoopDelaysCollector } from './event_loop_delays'; /** * The monitoring of the event loop starts immediately. @@ -24,7 +24,9 @@ import { EventLoopDelaysCollector } from './event_loop_delays'; */ export function startTrackingEventLoopDelaysUsage( internalRepository: ISavedObjectsRepository, + instanceUuid: string, stopMonitoringEventLoop$: Observable, + eventLoopDelaysMonitor: EventLoopDelaysMonitor, configs: { collectionStartDelay?: number; collectionInterval?: number; @@ -37,20 +39,19 @@ export function startTrackingEventLoopDelaysUsage( histogramReset = MONITOR_EVENT_LOOP_DELAYS_RESET, } = configs; - const eventLoopDelaysCollector = new EventLoopDelaysCollector(); const resetOnCount = Math.ceil(histogramReset / collectionInterval); timer(collectionStartDelay, collectionInterval) .pipe( map((i) => (i + 1) % resetOnCount === 0), takeUntil(stopMonitoringEventLoop$), - finalize(() => eventLoopDelaysCollector.stop()) + finalize(() => eventLoopDelaysMonitor.stop()) ) .subscribe(async (shouldReset) => { - const histogram = eventLoopDelaysCollector.collect(); + const histogram = eventLoopDelaysMonitor.collect(); if (shouldReset) { - eventLoopDelaysCollector.reset(); + eventLoopDelaysMonitor.reset(); } - await storeHistogram(histogram, internalRepository); + await storeHistogram(histogram, internalRepository, instanceUuid); }); } diff --git a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/track_threshold.test.ts b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/track_threshold.test.ts index 1ff49a735a775..49b1943033719 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/track_threshold.test.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/track_threshold.test.ts @@ -7,13 +7,8 @@ */ import { Subject } from 'rxjs'; -import { - mockMonitorPercentile, - monitorEventLoopDelay, - mockMonitorReset, -} from './event_loop_delays.mocks'; +import { loggingSystemMock, metricsServiceMock } from '../../../../../core/server/mocks'; import { startTrackingEventLoopDelaysThreshold } from './track_threshold'; -import { loggingSystemMock } from '../../../../../core/server/mocks'; import { usageCountersServiceMock } from '../../../../usage_collection/server/usage_counters/usage_counters_service.mock'; describe('startTrackingEventLoopDelaysThreshold', () => { @@ -21,6 +16,7 @@ describe('startTrackingEventLoopDelaysThreshold', () => { const stopMonitoringEventLoop$ = new Subject(); const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); const mockEventLoopCounter = mockUsageCountersSetup.createUsageCounter('testCounter'); + const eventLoopDelaysMonitor = metricsServiceMock.createEventLoopDelaysMonitor(); beforeAll(() => jest.useFakeTimers('modern')); beforeEach(() => jest.clearAllMocks()); @@ -29,15 +25,20 @@ describe('startTrackingEventLoopDelaysThreshold', () => { it('initializes EventLoopDelaysCollector and starts timer', () => { const collectionStartDelay = 1000; const warnThreshold = 1000; - startTrackingEventLoopDelaysThreshold(mockEventLoopCounter, logger, stopMonitoringEventLoop$, { - warnThreshold, - collectionStartDelay, - }); + startTrackingEventLoopDelaysThreshold( + mockEventLoopCounter, + logger, + stopMonitoringEventLoop$, + eventLoopDelaysMonitor, + { + warnThreshold, + collectionStartDelay, + } + ); - expect(monitorEventLoopDelay).toBeCalledTimes(1); - expect(mockMonitorPercentile).toBeCalledTimes(0); + expect(eventLoopDelaysMonitor.collect).toBeCalledTimes(0); jest.advanceTimersByTime(collectionStartDelay); - expect(mockMonitorPercentile).toBeCalled(); + expect(eventLoopDelaysMonitor.collect).toBeCalledTimes(1); }); it('logs a warning and increments usage counter when the mean delay exceeds the threshold', () => { @@ -45,48 +46,60 @@ describe('startTrackingEventLoopDelaysThreshold', () => { const collectionInterval = 1000; const warnThreshold = 10; - startTrackingEventLoopDelaysThreshold(mockEventLoopCounter, logger, stopMonitoringEventLoop$, { - warnThreshold, - collectionStartDelay, - collectionInterval, - }); + startTrackingEventLoopDelaysThreshold( + mockEventLoopCounter, + logger, + stopMonitoringEventLoop$, + eventLoopDelaysMonitor, + { + warnThreshold, + collectionStartDelay, + collectionInterval, + } + ); expect(logger.warn).toBeCalledTimes(0); expect(mockEventLoopCounter.incrementCounter).toBeCalledTimes(0); - expect(mockMonitorReset).toBeCalledTimes(0); + expect(eventLoopDelaysMonitor.reset).toBeCalledTimes(0); jest.advanceTimersByTime(collectionStartDelay); expect(logger.warn).toBeCalledTimes(1); expect(mockEventLoopCounter.incrementCounter).toBeCalledTimes(1); - expect(mockMonitorReset).toBeCalledTimes(1); + expect(eventLoopDelaysMonitor.reset).toBeCalledTimes(1); jest.advanceTimersByTime(collectionInterval); expect(logger.warn).toBeCalledTimes(2); expect(mockEventLoopCounter.incrementCounter).toBeCalledTimes(2); - expect(mockMonitorReset).toBeCalledTimes(2); + expect(eventLoopDelaysMonitor.reset).toBeCalledTimes(2); jest.advanceTimersByTime(collectionInterval); expect(mockEventLoopCounter.incrementCounter).toBeCalledTimes(3); expect(logger.warn).toBeCalledTimes(3); - expect(mockMonitorReset).toBeCalledTimes(3); + expect(eventLoopDelaysMonitor.reset).toBeCalledTimes(3); }); it('does not log warning or increment usage if threshold did not exceed mean delay', () => { const collectionStartDelay = 100; const warnThreshold = 15; - startTrackingEventLoopDelaysThreshold(mockEventLoopCounter, logger, stopMonitoringEventLoop$, { - warnThreshold, - collectionStartDelay, - }); + startTrackingEventLoopDelaysThreshold( + mockEventLoopCounter, + logger, + stopMonitoringEventLoop$, + eventLoopDelaysMonitor, + { + warnThreshold, + collectionStartDelay, + } + ); expect(logger.warn).toBeCalledTimes(0); expect(mockEventLoopCounter.incrementCounter).toBeCalledTimes(0); - expect(mockMonitorReset).toBeCalledTimes(0); + expect(eventLoopDelaysMonitor.reset).toBeCalledTimes(0); jest.advanceTimersByTime(collectionStartDelay); expect(logger.warn).toBeCalledTimes(0); expect(mockEventLoopCounter.incrementCounter).toBeCalledTimes(0); - expect(mockMonitorReset).toBeCalledTimes(1); + expect(eventLoopDelaysMonitor.reset).toBeCalledTimes(1); }); }); diff --git a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/track_threshold.ts b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/track_threshold.ts index 246d88496a158..ba4e12a7bfced 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/track_threshold.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/event_loop_delays/track_threshold.ts @@ -17,7 +17,7 @@ import { MONITOR_EVENT_LOOP_WARN_THRESHOLD, ONE_MILLISECOND_AS_NANOSECONDS, } from './constants'; -import { EventLoopDelaysCollector } from './event_loop_delays'; +import type { EventLoopDelaysMonitor } from '../../../../../core/server'; /** * The monitoring of the event loop starts immediately. @@ -29,6 +29,7 @@ export function startTrackingEventLoopDelaysThreshold( eventLoopCounter: UsageCounter, logger: Logger, stopMonitoringEventLoop$: Observable, + eventLoopDelaysMonitor: EventLoopDelaysMonitor, configs: { warnThreshold?: number; collectionStartDelay?: number; @@ -41,14 +42,13 @@ export function startTrackingEventLoopDelaysThreshold( collectionInterval = MONITOR_EVENT_LOOP_THRESHOLD_INTERVAL, } = configs; - const eventLoopDelaysCollector = new EventLoopDelaysCollector(); timer(collectionStartDelay, collectionInterval) .pipe( takeUntil(stopMonitoringEventLoop$), - finalize(() => eventLoopDelaysCollector.stop()) + finalize(() => eventLoopDelaysMonitor.stop()) ) .subscribe(async () => { - const { mean } = eventLoopDelaysCollector.collect(); + const { mean } = eventLoopDelaysMonitor.collect(); const meanDurationMs = moment .duration(mean / ONE_MILLISECOND_AS_NANOSECONDS) .asMilliseconds(); @@ -64,6 +64,6 @@ export function startTrackingEventLoopDelaysThreshold( }); } - eventLoopDelaysCollector.reset(); + eventLoopDelaysMonitor.reset(); }); } 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 00bb24f5293fa..bc38b63730b20 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts @@ -68,10 +68,6 @@ export const stackManagementSchema: MakeSchemaFrom = { type: 'boolean', _meta: { description: 'Non-default value of setting.' }, }, - 'visualization:dimmingOpacity': { - type: 'float', - _meta: { description: 'Non-default value of setting.' }, - }, 'visualization:tileMap:maxPrecision': { type: 'long', _meta: { description: 'Non-default value of setting.' }, @@ -104,22 +100,10 @@ export const stackManagementSchema: MakeSchemaFrom = { type: 'keyword', _meta: { description: 'Non-default value of setting.' }, }, - 'timelion:default_rows': { - type: 'long', - _meta: { description: 'Non-default value of setting.' }, - }, - 'timelion:default_columns': { - type: 'long', - _meta: { description: 'Non-default value of setting.' }, - }, 'timelion:es.default_index': { type: 'keyword', _meta: { description: 'Non-default value of setting.' }, }, - 'timelion:showTutorial': { - type: 'boolean', - _meta: { description: 'Non-default value of setting.' }, - }, 'securitySolution:timeDefaults': { type: 'keyword', _meta: { description: 'Non-default value of setting.' }, @@ -400,10 +384,6 @@ export const stackManagementSchema: MakeSchemaFrom = { type: 'boolean', _meta: { description: 'Non-default value of setting.' }, }, - 'visualization:visualize:legacyChartsLibrary': { - type: 'boolean', - _meta: { description: 'Non-default value of setting.' }, - }, 'visualization:visualize:legacyPieChartsLibrary': { 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 2375de4a35467..24a20b458c789 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/types.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/management/types.ts @@ -27,7 +27,6 @@ export interface UsageStats { 'autocomplete:useTimeRange': boolean; 'autocomplete:valueSuggestionMethod': string; 'search:timeout': number; - 'visualization:visualize:legacyChartsLibrary': boolean; 'visualization:visualize:legacyPieChartsLibrary': boolean; 'doc_table:legacy': boolean; 'discover:modifyColumnsOnSwitch': boolean; @@ -41,7 +40,6 @@ export interface UsageStats { 'visualization:heatmap:maxBuckets': number; 'visualization:colorMapping': string; 'visualization:regionmap:showWarnings': boolean; - 'visualization:dimmingOpacity': number; 'visualization:tileMap:maxPrecision': number; 'csv:separator': string; 'visualization:tileMap:WMSdefaults': string; @@ -50,10 +48,7 @@ export interface UsageStats { 'timelion:max_buckets': number; 'timelion:es.timefield': string; 'timelion:min_interval': string; - 'timelion:default_rows': number; - 'timelion:default_columns': number; 'timelion:es.default_index': string; - 'timelion:showTutorial': boolean; 'securitySolution:timeDefaults': string; 'securitySolution:defaultAnomalyScore': number; 'securitySolution:refreshIntervalDefaults': string; diff --git a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/__snapshots__/index.test.ts.snap b/src/plugins/kibana_usage_collection/server/collectors/ops_stats/__snapshots__/index.test.ts.snap deleted file mode 100644 index 678237ffb6ea2..0000000000000 --- a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/__snapshots__/index.test.ts.snap +++ /dev/null @@ -1,43 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`telemetry_ops_stats should return something when there is a metric 1`] = ` -Object { - "concurrent_connections": 20, - "os": Object { - "load": Object { - "15m": 3, - "1m": 0.5, - "5m": 1, - }, - "memory": Object { - "free_in_bytes": 10, - "total_in_bytes": 10, - "used_in_bytes": 10, - }, - "platform": "darwin", - "platformRelease": "test", - "uptime_in_millis": 1000, - }, - "process": Object { - "event_loop_delay": 10, - "memory": Object { - "heap": Object { - "size_limit": 0, - "total_in_bytes": 0, - "used_in_bytes": 0, - }, - "resident_set_size_in_bytes": 0, - }, - "uptime_in_millis": 1000, - }, - "requests": Object { - "disconnects": 10, - "total": 100, - }, - "response_times": Object { - "average": 100, - "max": 200, - }, - "timestamp": Any, -} -`; diff --git a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/__snapshots__/ops_stats_collector.test.ts.snap b/src/plugins/kibana_usage_collection/server/collectors/ops_stats/__snapshots__/ops_stats_collector.test.ts.snap new file mode 100644 index 0000000000000..f962eca858199 --- /dev/null +++ b/src/plugins/kibana_usage_collection/server/collectors/ops_stats/__snapshots__/ops_stats_collector.test.ts.snap @@ -0,0 +1,59 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`telemetry_ops_stats should return something when there is a metric 1`] = ` +Object { + "concurrent_connections": 1, + "os": Object { + "load": Object { + "15m": 1, + "1m": 1, + "5m": 1, + }, + "memory": Object { + "free_in_bytes": 1, + "total_in_bytes": 1, + "used_in_bytes": 1, + }, + "platform": "darwin", + "platformRelease": "test", + "uptime_in_millis": 1, + }, + "process": Object { + "event_loop_delay": 1, + "event_loop_delay_histogram": Any, + "memory": Object { + "heap": Object { + "size_limit": 1, + "total_in_bytes": 1, + "used_in_bytes": 1, + }, + "resident_set_size_in_bytes": 1, + }, + "uptime_in_millis": 1, + }, + "processes": Array [ + Object { + "event_loop_delay": 1, + "event_loop_delay_histogram": Any, + "memory": Object { + "heap": Object { + "size_limit": 1, + "total_in_bytes": 1, + "used_in_bytes": 1, + }, + "resident_set_size_in_bytes": 1, + }, + "uptime_in_millis": 1, + }, + ], + "requests": Object { + "disconnects": 1, + "total": 1, + }, + "response_times": Object { + "average": 1, + "max": 1, + }, + "timestamp": Any, +} +`; diff --git a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/index.test.ts b/src/plugins/kibana_usage_collection/server/collectors/ops_stats/index.test.ts deleted file mode 100644 index dfd6a93b7ea18..0000000000000 --- a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/index.test.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { Subject } from 'rxjs'; -import { - Collector, - createUsageCollectionSetupMock, - createCollectorFetchContextMock, -} from '../../../../usage_collection/server/mocks'; - -import { registerOpsStatsCollector } from './'; -import { OpsMetrics } from '../../../../../core/server'; -import { loggingSystemMock } from '../../../../../core/server/mocks'; - -const logger = loggingSystemMock.createLogger(); - -describe('telemetry_ops_stats', () => { - let collector: Collector; - - const usageCollectionMock = createUsageCollectionSetupMock(); - usageCollectionMock.makeStatsCollector.mockImplementation((config) => { - collector = new Collector(logger, config); - return createUsageCollectionSetupMock().makeStatsCollector(config); - }); - - const metrics$ = new Subject(); - const mockedFetchContext = createCollectorFetchContextMock(); - - const metric: OpsMetrics = { - collected_at: new Date('2020-01-01 01:00:00'), - process: { - memory: { - heap: { - total_in_bytes: 0, - used_in_bytes: 0, - size_limit: 0, - }, - resident_set_size_in_bytes: 0, - }, - event_loop_delay: 10, - pid: 10, - uptime_in_millis: 1000, - }, - os: { - platform: 'darwin', - platformRelease: 'test', - load: { - '1m': 0.5, - '5m': 1, - '15m': 3, - }, - memory: { - total_in_bytes: 10, - free_in_bytes: 10, - used_in_bytes: 10, - }, - uptime_in_millis: 1000, - }, - response_times: { avg_in_millis: 100, max_in_millis: 200 }, - requests: { - disconnects: 10, - total: 100, - statusCodes: { 200: 100 }, - }, - concurrent_connections: 20, - }; - - beforeAll(() => registerOpsStatsCollector(usageCollectionMock, metrics$)); - afterAll(() => jest.clearAllTimers()); - - test('registered collector is set', () => { - expect(collector).not.toBeUndefined(); - expect(collector.type).toBe('kibana_stats'); - }); - - test('isReady should return false because no metrics have been provided yet', () => { - expect(collector.isReady()).toBe(false); - }); - - test('should return something when there is a metric', async () => { - metrics$.next(metric); - expect(collector.isReady()).toBe(true); - expect(await collector.fetch(mockedFetchContext)).toMatchSnapshot({ - concurrent_connections: 20, - os: { - load: { - '15m': 3, - '1m': 0.5, - '5m': 1, - }, - memory: { - free_in_bytes: 10, - total_in_bytes: 10, - used_in_bytes: 10, - }, - platform: 'darwin', - platformRelease: 'test', - uptime_in_millis: 1000, - }, - process: { - event_loop_delay: 10, - memory: { - heap: { - size_limit: 0, - total_in_bytes: 0, - used_in_bytes: 0, - }, - resident_set_size_in_bytes: 0, - }, - uptime_in_millis: 1000, - }, - requests: { - disconnects: 10, - total: 100, - }, - response_times: { - average: 100, - max: 200, - }, - timestamp: expect.any(String), - }); - }); -}); diff --git a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.test.ts b/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.test.ts new file mode 100644 index 0000000000000..54a7d3e220242 --- /dev/null +++ b/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.test.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 { Subject } from 'rxjs'; +import { take } from 'rxjs/operators'; +import { + Collector, + createUsageCollectionSetupMock, + createCollectorFetchContextMock, +} from '../../../../usage_collection/server/mocks'; + +import { registerOpsStatsCollector } from '.'; +import { OpsMetrics } from '../../../../../core/server'; +import { loggingSystemMock, metricsServiceMock } from '../../../../../core/server/mocks'; + +const logger = loggingSystemMock.createLogger(); + +describe('telemetry_ops_stats', () => { + let collector: Collector; + + const usageCollectionMock = createUsageCollectionSetupMock(); + const metricsServiceSetupMock = metricsServiceMock.createInternalSetupContract(); + + usageCollectionMock.makeStatsCollector.mockImplementation((config) => { + collector = new Collector(logger, config); + return createUsageCollectionSetupMock().makeStatsCollector(config); + }); + + const metrics$ = new Subject(); + const mockedFetchContext = createCollectorFetchContextMock(); + + beforeAll(() => registerOpsStatsCollector(usageCollectionMock, metrics$)); + afterAll(() => jest.clearAllTimers()); + + test('registered collector is set', () => { + expect(collector).not.toBeUndefined(); + expect(collector.type).toBe('kibana_stats'); + }); + + test('isReady should return false because no metrics have been provided yet', () => { + expect(collector.isReady()).toBe(false); + }); + + test('should return something when there is a metric', async () => { + const opsMetrics = await metricsServiceSetupMock.getOpsMetrics$().pipe(take(1)).toPromise(); + metrics$.next(opsMetrics); + expect(collector.isReady()).toBe(true); + expect(await collector.fetch(mockedFetchContext)).toMatchSnapshot({ + process: { + event_loop_delay_histogram: expect.any(Object), + }, + processes: [ + { + event_loop_delay_histogram: expect.any(Object), + }, + ], + timestamp: expect.any(String), + }); + }); +}); diff --git a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts b/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts index 7959b67b4f468..ca7cca2a9de8c 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts @@ -33,6 +33,11 @@ export function getOpsStatsCollector( // Ensure we only include the same data that Metricbeat collection would get // @ts-expect-error delete metrics.process.pid; + for (const process of metrics.processes) { + // @ts-expect-error + delete process.pid; + } + const responseTimes = { average: metrics.response_times.avg_in_millis, max: metrics.response_times.max_in_millis, diff --git a/src/plugins/kibana_usage_collection/server/collectors/saved_objects_counts/kibana_usage_collector.test.ts b/src/plugins/kibana_usage_collection/server/collectors/saved_objects_counts/kibana_usage_collector.test.ts index 6097910afe22b..fc9f9a6e8c2d3 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/saved_objects_counts/kibana_usage_collector.test.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/saved_objects_counts/kibana_usage_collector.test.ts @@ -56,7 +56,6 @@ describe('kibana_usage', () => { search: { total: 0 }, index_pattern: { total: 0 }, graph_workspace: { total: 0 }, - timelion_sheet: { total: 0 }, }); }); }); @@ -81,7 +80,6 @@ describe('getKibanaSavedObjectCounts', () => { search: { total: 0 }, index_pattern: { total: 0 }, graph_workspace: { total: 0 }, - timelion_sheet: { total: 0 }, }); }); @@ -91,7 +89,6 @@ describe('getKibanaSavedObjectCounts', () => { types: { buckets: [ { key: 'dashboard', doc_count: 1 }, - { key: 'timelion-sheet', doc_count: 2 }, { key: 'index-pattern', value: 2 }, // Malformed on purpose { key: 'graph_workspace', doc_count: 3 }, // already snake_cased ], @@ -106,7 +103,6 @@ describe('getKibanaSavedObjectCounts', () => { search: { total: 0 }, index_pattern: { total: 0 }, graph_workspace: { total: 3 }, - timelion_sheet: { total: 2 }, }); }); }); diff --git a/src/plugins/kibana_usage_collection/server/collectors/saved_objects_counts/kibana_usage_collector.ts b/src/plugins/kibana_usage_collection/server/collectors/saved_objects_counts/kibana_usage_collector.ts index 1ebb61c446083..13b9d0ca2104c 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/saved_objects_counts/kibana_usage_collector.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/saved_objects_counts/kibana_usage_collector.ts @@ -19,21 +19,13 @@ interface KibanaSavedObjectCounts { search: { total: number }; index_pattern: { total: number }; graph_workspace: { total: number }; - timelion_sheet: { total: number }; } interface KibanaUsage extends KibanaSavedObjectCounts { index: string; } -const TYPES = [ - 'dashboard', - 'visualization', - 'search', - 'index-pattern', - 'graph-workspace', - 'timelion-sheet', -]; +const TYPES = ['dashboard', 'visualization', 'search', 'index-pattern', 'graph-workspace']; export async function getKibanaSavedObjectCounts( esClient: ElasticsearchClient, @@ -89,12 +81,6 @@ export function registerKibanaUsageCollector( _meta: { description: 'Total number of graph_workspace saved objects' }, }, }, - timelion_sheet: { - total: { - type: 'long', - _meta: { description: 'Total number of timelion_sheet saved objects' }, - }, - }, }, async fetch({ esClient }) { const { diff --git a/src/plugins/kibana_usage_collection/server/collectors/ui_metric/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/ui_metric/schema.ts index fec314fc6b87e..5252ab24395aa 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/ui_metric/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/ui_metric/schema.ts @@ -28,7 +28,6 @@ const uiMetricFromDataPluginSchema: MakeSchemaFrom = { kibana: commonSchema, // It's a forward app so we'll likely never report it management: commonSchema, short_url_redirect: commonSchema, // It's a forward app so we'll likely never report it - timelion: commonSchema, visualize: commonSchema, // X-Pack diff --git a/src/plugins/kibana_usage_collection/server/plugin.test.ts b/src/plugins/kibana_usage_collection/server/plugin.test.ts index 1584366a42dc1..75c323ba0332f 100644 --- a/src/plugins/kibana_usage_collection/server/plugin.test.ts +++ b/src/plugins/kibana_usage_collection/server/plugin.test.ts @@ -42,6 +42,8 @@ describe('kibana_usage_collection', () => { expect(pluginInstance.setup(coreSetup, { usageCollection })).toBe(undefined); + expect(coreSetup.coreUsageData.registerUsageCounter).toHaveBeenCalled(); + await expect( Promise.all( usageCollectors.map(async (usageCollector) => { diff --git a/src/plugins/kibana_usage_collection/server/plugin.ts b/src/plugins/kibana_usage_collection/server/plugin.ts index dadb4283e84a7..07a70dfd56fb4 100644 --- a/src/plugins/kibana_usage_collection/server/plugin.ts +++ b/src/plugins/kibana_usage_collection/server/plugin.ts @@ -21,7 +21,7 @@ import type { Logger, CoreUsageDataStart, } from 'src/core/server'; -import { SavedObjectsClient } from '../../../core/server'; +import { SavedObjectsClient, EventLoopDelaysMonitor } from '../../../core/server'; import { startTrackingEventLoopDelaysUsage, startTrackingEventLoopDelaysThreshold, @@ -56,6 +56,7 @@ type SavedObjectsRegisterType = SavedObjectsServiceSetup['registerType']; export class KibanaUsageCollectionPlugin implements Plugin { private readonly logger: Logger; private readonly legacyConfig$: Observable; + private readonly instanceUuid: string; private savedObjectsClient?: ISavedObjectsRepository; private uiSettingsClient?: IUiSettingsClient; private metric$: Subject; @@ -68,11 +69,13 @@ export class KibanaUsageCollectionPlugin implements Plugin { this.legacyConfig$ = initializerContext.config.legacy.globalConfig$; this.metric$ = new Subject(); this.pluginStop$ = new Subject(); + this.instanceUuid = initializerContext.env.instanceUuid; } public setup(coreSetup: CoreSetup, { usageCollection }: KibanaUsageCollectionPluginsDepsSetup) { usageCollection.createUsageCounter('uiCounters'); this.eventLoopUsageCounter = usageCollection.createUsageCounter('eventLoop'); + coreSetup.coreUsageData.registerUsageCounter(usageCollection.createUsageCounter('core')); this.registerUsageCollectors( usageCollection, coreSetup, @@ -92,11 +95,17 @@ export class KibanaUsageCollectionPlugin implements Plugin { this.uiSettingsClient = uiSettings.asScopedToClient(savedObjectsClient); core.metrics.getOpsMetrics$().subscribe(this.metric$); this.coreUsageData = core.coreUsageData; - startTrackingEventLoopDelaysUsage(this.savedObjectsClient, this.pluginStop$.asObservable()); + startTrackingEventLoopDelaysUsage( + this.savedObjectsClient, + this.instanceUuid, + this.pluginStop$.asObservable(), + new EventLoopDelaysMonitor() + ); startTrackingEventLoopDelaysThreshold( this.eventLoopUsageCounter, this.logger, - this.pluginStop$.asObservable() + this.pluginStop$.asObservable(), + new EventLoopDelaysMonitor() ); } diff --git a/src/plugins/kibana_utils/jest.config.js b/src/plugins/kibana_utils/jest.config.js index 48b7bb62a8e68..a01ededd1e7c0 100644 --- a/src/plugins/kibana_utils/jest.config.js +++ b/src/plugins/kibana_utils/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/kibana_utils'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/kibana_utils', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/kibana_utils/{common,demos,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/legacy_export/README.md b/src/plugins/legacy_export/README.md deleted file mode 100644 index 551487a1122fc..0000000000000 --- a/src/plugins/legacy_export/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# `legacyExport` plugin [deprecated] - -The `legacyExport` plugin adds support for the legacy saved objects export format. diff --git a/src/plugins/legacy_export/jest.config.js b/src/plugins/legacy_export/jest.config.js deleted file mode 100644 index d5dd37c8249f9..0000000000000 --- a/src/plugins/legacy_export/jest.config.js +++ /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 and the Server Side Public License, v 1; you may 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/legacy_export'], -}; diff --git a/src/plugins/legacy_export/kibana.json b/src/plugins/legacy_export/kibana.json deleted file mode 100644 index 6c1b9ab5e9591..0000000000000 --- a/src/plugins/legacy_export/kibana.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": "legacyExport", - "owner": { - "name": "Kibana Core", - "githubTeam": "kibana-core" - }, - "version": "kibana", - "server": true, - "ui": false -} diff --git a/src/plugins/legacy_export/server/index.ts b/src/plugins/legacy_export/server/index.ts deleted file mode 100644 index 95716cdbd307d..0000000000000 --- a/src/plugins/legacy_export/server/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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { PluginInitializer } from 'src/core/server'; -import { LegacyExportPlugin } from './plugin'; - -export const plugin: PluginInitializer<{}, {}> = (context) => new LegacyExportPlugin(context); diff --git a/src/plugins/legacy_export/server/lib/index.ts b/src/plugins/legacy_export/server/lib/index.ts deleted file mode 100644 index 5ad29d1eab9f7..0000000000000 --- a/src/plugins/legacy_export/server/lib/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 and the Server Side Public License, v 1; you may 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 { exportDashboards } from './export/export_dashboards'; -export { importDashboards } from './import/import_dashboards'; diff --git a/src/plugins/legacy_export/server/plugin.ts b/src/plugins/legacy_export/server/plugin.ts deleted file mode 100644 index a6bdcdc19b0a1..0000000000000 --- a/src/plugins/legacy_export/server/plugin.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { Plugin, CoreSetup, PluginInitializerContext } from 'kibana/server'; -import { registerRoutes } from './routes'; - -/** @deprecated */ -export class LegacyExportPlugin implements Plugin<{}, {}> { - constructor(private readonly initContext: PluginInitializerContext) {} - - public setup({ http }: CoreSetup) { - const globalConfig = this.initContext.config.legacy.get(); - - const router = http.createRouter(); - registerRoutes( - router, - this.initContext.env.packageInfo.version, - globalConfig.savedObjects.maxImportPayloadBytes.getValueInBytes() - ); - - return {}; - } - - public start() { - return {}; - } - - public stop() {} -} diff --git a/src/plugins/legacy_export/server/routes/export.ts b/src/plugins/legacy_export/server/routes/export.ts deleted file mode 100644 index 8d5bd71c0b7e7..0000000000000 --- a/src/plugins/legacy_export/server/routes/export.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 moment from 'moment'; -import { schema } from '@kbn/config-schema'; -import { IRouter } from 'src/core/server'; -import { exportDashboards } from '../lib'; - -export const registerExportRoute = (router: IRouter, kibanaVersion: string) => { - router.get( - { - path: '/api/kibana/dashboards/export', - validate: { - query: schema.object({ - dashboard: schema.oneOf([schema.string(), schema.arrayOf(schema.string())]), - }), - }, - options: { - tags: ['api'], - }, - }, - async (ctx, req, res) => { - const ids = Array.isArray(req.query.dashboard) ? req.query.dashboard : [req.query.dashboard]; - const { client } = ctx.core.savedObjects; - - const exported = await exportDashboards(ids, client, kibanaVersion); - const filename = `kibana-dashboards.${moment.utc().format('YYYY-MM-DD-HH-mm-ss')}.json`; - const body = JSON.stringify(exported, null, ' '); - - return res.ok({ - body, - headers: { - 'Content-Disposition': `attachment; filename="${filename}"`, - 'Content-Type': 'application/json', - 'Content-Length': `${Buffer.byteLength(body, 'utf8')}`, - }, - }); - } - ); -}; diff --git a/src/plugins/legacy_export/server/routes/import.ts b/src/plugins/legacy_export/server/routes/import.ts deleted file mode 100644 index 4a2dbecd3e02a..0000000000000 --- a/src/plugins/legacy_export/server/routes/import.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 and the Server Side Public License, v 1; you may not 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 { IRouter, SavedObject } from 'src/core/server'; -import { importDashboards } from '../lib'; - -export const registerImportRoute = (router: IRouter, maxImportPayloadBytes: number) => { - router.post( - { - path: '/api/kibana/dashboards/import', - validate: { - body: schema.object({ - objects: schema.arrayOf(schema.recordOf(schema.string(), schema.any())), - version: schema.maybe(schema.string()), - }), - query: schema.object({ - force: schema.boolean({ defaultValue: false }), - exclude: schema.oneOf([schema.string(), schema.arrayOf(schema.string())], { - defaultValue: [], - }), - }), - }, - options: { - tags: ['api'], - body: { - maxBytes: maxImportPayloadBytes, - }, - }, - }, - async (ctx, req, res) => { - const { client } = ctx.core.savedObjects; - const objects = req.body.objects as SavedObject[]; - const { force, exclude } = req.query; - const result = await importDashboards(client, objects, { - overwrite: force, - exclude: Array.isArray(exclude) ? exclude : [exclude], - }); - return res.ok({ - body: result, - }); - } - ); -}; diff --git a/src/plugins/legacy_export/server/routes/index.ts b/src/plugins/legacy_export/server/routes/index.ts deleted file mode 100644 index c3153ae603ea4..0000000000000 --- a/src/plugins/legacy_export/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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { IRouter } from 'src/core/server'; -import { registerImportRoute } from './import'; -import { registerExportRoute } from './export'; - -export const registerRoutes = ( - router: IRouter, - kibanaVersion: string, - maxImportPayloadBytes: number -) => { - registerExportRoute(router, kibanaVersion); - registerImportRoute(router, maxImportPayloadBytes); -}; diff --git a/src/plugins/legacy_export/tsconfig.json b/src/plugins/legacy_export/tsconfig.json deleted file mode 100644 index 2f071b5ba6c56..0000000000000 --- a/src/plugins/legacy_export/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": [ - "server/**/*", - ], - "references": [ - { "path": "../../core/tsconfig.json" } - ] -} diff --git a/src/plugins/management/jest.config.js b/src/plugins/management/jest.config.js index e821012e9dc2e..ee5e50a753693 100644 --- a/src/plugins/management/jest.config.js +++ b/src/plugins/management/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/management'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/management', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/management/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/maps_ems/common/ems_defaults.ts b/src/plugins/maps_ems/common/ems_defaults.ts deleted file mode 100644 index 7eb82ac04858e..0000000000000 --- a/src/plugins/maps_ems/common/ems_defaults.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. - */ - -// Default config for the elastic hosted EMS endpoints -export const DEFAULT_EMS_FILE_API_URL = 'https://vector.maps.elastic.co'; -export const DEFAULT_EMS_TILE_API_URL = 'https://tiles.maps.elastic.co'; -export const DEFAULT_EMS_LANDING_PAGE_URL = 'https://maps.elastic.co/v7.15'; -export const DEFAULT_EMS_FONT_LIBRARY_URL = - 'https://tiles.maps.elastic.co/fonts/{fontstack}/{range}.pbf'; - -export const DEFAULT_EMS_ROADMAP_ID = 'road_map'; -export const DEFAULT_EMS_ROADMAP_DESATURATED_ID = 'road_map_desaturated'; -export const DEFAULT_EMS_DARKMAP_ID = 'dark_map'; diff --git a/src/plugins/maps_ems/common/index.ts b/src/plugins/maps_ems/common/index.ts index d83a3319d3d15..f7d7ff1102e59 100644 --- a/src/plugins/maps_ems/common/index.ts +++ b/src/plugins/maps_ems/common/index.ts @@ -6,10 +6,16 @@ * Side Public License, v 1. */ -// TODO: https://github.com/elastic/kibana/issues/109853 -/* eslint-disable @kbn/eslint/no_export_all */ - export const TMS_IN_YML_ID = 'TMS in config/kibana.yml'; -export * from './ems_defaults'; +export const DEFAULT_EMS_FILE_API_URL = 'https://vector.maps.elastic.co'; +export const DEFAULT_EMS_TILE_API_URL = 'https://tiles.maps.elastic.co'; +export const DEFAULT_EMS_LANDING_PAGE_URL = 'https://maps.elastic.co/v7.15'; +export const DEFAULT_EMS_FONT_LIBRARY_URL = + 'https://tiles.maps.elastic.co/fonts/{fontstack}/{range}.pbf'; + +export const DEFAULT_EMS_ROADMAP_ID = 'road_map'; +export const DEFAULT_EMS_ROADMAP_DESATURATED_ID = 'road_map_desaturated'; +export const DEFAULT_EMS_DARKMAP_ID = 'dark_map'; + export { ORIGIN } from './origin'; diff --git a/src/plugins/maps_ems/config.ts b/src/plugins/maps_ems/config.ts index ed1648ebbe8bb..710cb52f32a09 100644 --- a/src/plugins/maps_ems/config.ts +++ b/src/plugins/maps_ems/config.ts @@ -40,7 +40,6 @@ export const emsConfigSchema = schema.object({ tilemap: tilemapConfigSchema, includeElasticMapsService: schema.boolean({ defaultValue: true }), proxyElasticMapsServiceInMaps: schema.boolean({ defaultValue: false }), - manifestServiceUrl: schema.string({ defaultValue: '' }), emsUrl: schema.conditional( schema.siblingRef('proxyElasticMapsServiceInMaps'), true, diff --git a/src/plugins/maps_ems/jest.config.js b/src/plugins/maps_ems/jest.config.js index b7021c9119deb..4e2b09bb66305 100644 --- a/src/plugins/maps_ems/jest.config.js +++ b/src/plugins/maps_ems/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/maps_ems'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/maps_ems', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/maps_ems/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/maps_ems/public/index.ts b/src/plugins/maps_ems/public/index.ts index 50f55dd3157bc..a4a0fc45d9164 100644 --- a/src/plugins/maps_ems/public/index.ts +++ b/src/plugins/maps_ems/public/index.ts @@ -6,9 +6,6 @@ * Side Public License, v 1. */ -// TODO: https://github.com/elastic/kibana/issues/109853 -/* eslint-disable @kbn/eslint/no_export_all */ - import { PluginInitializerContext } from 'kibana/public'; import { MapsEmsPlugin } from './plugin'; import { IServiceSettings } from './service_settings'; @@ -27,9 +24,9 @@ export function plugin(initializerContext: PluginInitializerContext) { return new MapsEmsPlugin(initializerContext); } -export type { MapsEmsConfig } from '../config'; +export { TMS_IN_YML_ID } from '../common'; -export * from '../common'; +export type { MapsEmsConfig } from '../config'; export interface MapsEmsPluginSetup { config: MapsEmsConfig; diff --git a/src/plugins/maps_ems/server/index.ts b/src/plugins/maps_ems/server/index.ts index b8b84d222b958..7422dbcfcdec9 100644 --- a/src/plugins/maps_ems/server/index.ts +++ b/src/plugins/maps_ems/server/index.ts @@ -19,7 +19,6 @@ export const config: PluginConfigDescriptor = { tilemap: true, includeElasticMapsService: true, proxyElasticMapsServiceInMaps: true, - manifestServiceUrl: true, emsUrl: true, emsFileApiUrl: true, emsTileApiUrl: true, diff --git a/src/plugins/navigation/jest.config.js b/src/plugins/navigation/jest.config.js index 98cd0e3760a17..e31374a542563 100644 --- a/src/plugins/navigation/jest.config.js +++ b/src/plugins/navigation/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/navigation'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/navigation', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/navigation/public/**/*.{ts,tsx}'], }; diff --git a/src/plugins/newsfeed/jest.config.js b/src/plugins/newsfeed/jest.config.js index 580185836c978..43caa9227b9f6 100644 --- a/src/plugins/newsfeed/jest.config.js +++ b/src/plugins/newsfeed/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/newsfeed'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/newsfeed', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/newsfeed/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/presentation_util/jest.config.js b/src/plugins/presentation_util/jest.config.js index 2250d70acb475..cb1e18fd6d736 100644 --- a/src/plugins/presentation_util/jest.config.js +++ b/src/plugins/presentation_util/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/presentation_util'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/presentation_util', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/presentation_util/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/presentation_util/public/__stories__/render.tsx b/src/plugins/presentation_util/public/__stories__/render.tsx index 2588d2e3294ae..76725d08956bd 100644 --- a/src/plugins/presentation_util/public/__stories__/render.tsx +++ b/src/plugins/presentation_util/public/__stories__/render.tsx @@ -11,8 +11,9 @@ import React, { useRef, useEffect } from 'react'; import { ExpressionRenderDefinition, IInterpreterRenderHandlers } from 'src/plugins/expressions'; export const defaultHandlers: IInterpreterRenderHandlers = { - getRenderMode: () => 'display', + getRenderMode: () => 'view', isSyncColorsEnabled: () => false, + isInteractive: () => true, done: action('done'), onDestroy: action('onDestroy'), reload: action('reload'), diff --git a/src/plugins/saved_objects/jest.config.js b/src/plugins/saved_objects/jest.config.js index 77848e0dc6ed5..416385af2d214 100644 --- a/src/plugins/saved_objects/jest.config.js +++ b/src/plugins/saved_objects/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/saved_objects'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/saved_objects', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/saved_objects/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/saved_objects/public/saved_object/saved_object.test.ts b/src/plugins/saved_objects/public/saved_object/saved_object.test.ts index 842e7ad962572..6d35f94eec510 100644 --- a/src/plugins/saved_objects/public/saved_object/saved_object.test.ts +++ b/src/plugins/saved_objects/public/saved_object/saved_object.test.ts @@ -20,7 +20,7 @@ import { coreMock } from '../../../../core/public/mocks'; import { dataPluginMock, createSearchSourceMock } from '../../../../plugins/data/public/mocks'; import { createStubIndexPattern } from '../../../../plugins/data/common/stubs'; import { SavedObjectAttributes, SimpleSavedObject } from 'kibana/public'; -import { IndexPattern } from '../../../data/common/index_patterns/index_patterns'; +import { IndexPattern } from '../../../data/common'; import { savedObjectsDecoratorRegistryMock } from './decorators/registry.mock'; describe('Saved Object', () => { diff --git a/src/plugins/saved_objects_management/jest.config.js b/src/plugins/saved_objects_management/jest.config.js index a8fd7db1b7b45..e986e5a310eae 100644 --- a/src/plugins/saved_objects_management/jest.config.js +++ b/src/plugins/saved_objects_management/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/saved_objects_management'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/saved_objects_management', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/saved_objects_management/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/saved_objects_management/public/lib/import_legacy_file.test.ts b/src/plugins/saved_objects_management/public/lib/import_legacy_file.test.ts deleted file mode 100644 index 2554c78514de3..0000000000000 --- a/src/plugins/saved_objects_management/public/lib/import_legacy_file.test.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { importLegacyFile } from './import_legacy_file'; - -describe('importFile', () => { - it('should import a file with valid json format', async () => { - const file = new File([`{"text": "foo"}`], 'file.json'); - - const imported = await importLegacyFile(file); - expect(imported).toEqual({ text: 'foo' }); - }); - - it('should throw errors when file content is not parseable', async () => { - const file = new File([`not_parseable`], 'file.json'); - - await expect(importLegacyFile(file)).rejects.toThrowErrorMatchingInlineSnapshot( - `"Unexpected token o in JSON at position 1"` - ); - }); -}); diff --git a/src/plugins/saved_objects_management/public/lib/import_legacy_file.ts b/src/plugins/saved_objects_management/public/lib/import_legacy_file.ts deleted file mode 100644 index 3e605154f5339..0000000000000 --- a/src/plugins/saved_objects_management/public/lib/import_legacy_file.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may 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 async function importLegacyFile(file: File) { - return new Promise((resolve, reject) => { - const fr = new FileReader(); - fr.onload = (event) => { - const result = event.target!.result as string; - try { - resolve(JSON.parse(result)); - } catch (e) { - reject(e); - } - }; - fr.readAsText(file); - }); -} diff --git a/src/plugins/saved_objects_management/public/lib/index.ts b/src/plugins/saved_objects_management/public/lib/index.ts index df1485bedfc69..aefa5b614f618 100644 --- a/src/plugins/saved_objects_management/public/lib/index.ts +++ b/src/plugins/saved_objects_management/public/lib/index.ts @@ -13,17 +13,8 @@ export { getRelationships } from './get_relationships'; export { getSavedObjectCounts } from './get_saved_object_counts'; export { getSavedObjectLabel } from './get_saved_object_label'; export { importFile } from './import_file'; -export { importLegacyFile } from './import_legacy_file'; export { parseQuery } from './parse_query'; export { resolveImportErrors } from './resolve_import_errors'; -export { - resolveIndexPatternConflicts, - resolveSavedObjects, - resolveSavedSearches, - saveObject, - saveObjects, -} from './resolve_saved_objects'; -export { logLegacyImport } from './log_legacy_import'; export { processImportResponse, ProcessedImportResponse, diff --git a/src/plugins/saved_objects_management/public/lib/log_legacy_import.ts b/src/plugins/saved_objects_management/public/lib/log_legacy_import.ts deleted file mode 100644 index 70120f887afef..0000000000000 --- a/src/plugins/saved_objects_management/public/lib/log_legacy_import.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { HttpStart } from 'src/core/public'; - -export async function logLegacyImport(http: HttpStart) { - return http.post('/api/saved_objects/_log_legacy_import'); -} diff --git a/src/plugins/saved_objects_management/public/lib/process_import_response.ts b/src/plugins/saved_objects_management/public/lib/process_import_response.ts index d7da441ce9230..67c66bce1b331 100644 --- a/src/plugins/saved_objects_management/public/lib/process_import_response.ts +++ b/src/plugins/saved_objects_management/public/lib/process_import_response.ts @@ -40,8 +40,6 @@ export interface ProcessedImportResponse { unmatchedReferences: UnmatchedReference[]; status: 'success' | 'idle'; importCount: number; - conflictedSavedObjectsLinkedToSavedSearches: undefined; - conflictedSearchDocs: undefined; importWarnings: SavedObjectsImportWarning[]; } @@ -87,8 +85,6 @@ export function processImportResponse( ? 'success' : 'idle', importCount: response.successCount, - conflictedSavedObjectsLinkedToSavedSearches: undefined, - conflictedSearchDocs: undefined, importWarnings: response.warnings, }; } diff --git a/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts b/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts deleted file mode 100644 index b1c052e56ef22..0000000000000 --- a/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts +++ /dev/null @@ -1,399 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { - resolveSavedObjects, - resolveIndexPatternConflicts, - saveObjects, - saveObject, -} from './resolve_saved_objects'; -import { SavedObject, SavedObjectLoader } from '../../../saved_objects/public'; -import { IndexPatternsContract } from '../../../data/public'; -import { dataPluginMock } from '../../../data/public/mocks'; - -class SavedObjectNotFound extends Error { - constructor(options: Record) { - super(); - for (const option in options) { - if (options.hasOwnProperty(option)) { - (this as any)[option] = options[option]; - } - } - } -} - -const openModalMock = jest.fn(); - -const createObj = (props: Partial): SavedObject => - ({ - ...props, - } as SavedObject); - -describe('resolveSavedObjects', () => { - describe('resolveSavedObjects', () => { - it('should take in saved objects and spit out conflicts', async () => { - const savedObjects = [ - { - _type: 'search', - }, - { - _type: 'index-pattern', - _id: '1', - _source: { - title: 'pattern', - timeFieldName: '@timestamp', - }, - }, - { - _type: 'dashboard', - }, - { - _type: 'visualization', - }, - ]; - - const indexPatterns = ({ - get: async () => { - return { - create: () => '2', - }; - }, - create: async () => { - return '2'; - }, - cache: { - clear: () => {}, - }, - } as unknown) as IndexPatternsContract; - - const services = ([ - { - type: 'search', - get: async () => { - return { - applyESResp: async () => {}, - save: async () => { - throw new SavedObjectNotFound({ - savedObjectType: 'index-pattern', - }); - }, - }; - }, - }, - { - type: 'dashboard', - get: async () => { - return { - applyESResp: async () => {}, - save: async () => { - throw new SavedObjectNotFound({ - savedObjectType: 'index-pattern', - }); - }, - }; - }, - }, - { - type: 'visualization', - get: async () => { - return { - applyESResp: async () => {}, - save: async () => { - throw new SavedObjectNotFound({ - savedObjectType: 'index-pattern', - }); - }, - }; - }, - }, - ] as unknown) as SavedObjectLoader[]; - - const overwriteAll = false; - - const result = await resolveSavedObjects( - savedObjects, - overwriteAll, - services, - indexPatterns, - openModalMock - ); - - expect(result.conflictedIndexPatterns.length).toBe(3); - expect(result.conflictedSavedObjectsLinkedToSavedSearches.length).toBe(0); - expect(result.conflictedSearchDocs.length).toBe(0); - }); - - it('should bucket conflicts based on the type', async () => { - const savedObjects = [ - { - _type: 'search', - }, - { - _type: 'index-pattern', - _id: '1', - _source: { - title: 'pattern', - timeFieldName: '@timestamp', - }, - }, - { - _type: 'dashboard', - }, - { - _type: 'visualization', - }, - ]; - - const indexPatterns = ({ - get: async () => { - return { - create: () => '2', - }; - }, - create: async () => { - return '2'; - }, - cache: { - clear: () => {}, - }, - } as unknown) as IndexPatternsContract; - - const services = ([ - { - type: 'search', - get: async () => { - return { - applyESResp: async () => {}, - save: async () => { - throw new SavedObjectNotFound({ - savedObjectType: 'search', - }); - }, - }; - }, - }, - { - type: 'dashboard', - get: async () => { - return { - applyESResp: async () => {}, - save: async () => { - throw new SavedObjectNotFound({ - savedObjectType: 'index-pattern', - }); - }, - }; - }, - }, - { - type: 'visualization', - get: async () => { - return { - savedSearchId: '1', - applyESResp: async () => {}, - save: async () => { - throw new SavedObjectNotFound({ - savedObjectType: 'index-pattern', - }); - }, - }; - }, - }, - ] as unknown) as SavedObjectLoader[]; - - const overwriteAll = false; - - const result = await resolveSavedObjects( - savedObjects, - overwriteAll, - services, - indexPatterns, - openModalMock - ); - - expect(result.conflictedIndexPatterns.length).toBe(1); - expect(result.conflictedSavedObjectsLinkedToSavedSearches.length).toBe(1); - expect(result.conflictedSearchDocs.length).toBe(1); - }); - }); - - describe('resolveIndexPatternConflicts', () => { - let dependencies: Parameters[3]; - - beforeEach(() => { - const search = dataPluginMock.createStartContract().search; - - dependencies = { - indexPatterns: ({ - get: (id: string) => Promise.resolve({ id }), - } as unknown) as IndexPatternsContract, - search, - }; - }); - - it('should resave resolutions', async () => { - const save = jest.fn(); - - const conflictedIndexPatterns = ([ - { - obj: { - save, - }, - doc: { - _source: { - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - index: '1', - }), - }, - }, - }, - }, - { - obj: { - save, - }, - doc: { - _source: { - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - index: '3', - }), - }, - }, - }, - }, - ] as unknown) as Array<{ obj: SavedObject; doc: any }>; - - const resolutions = [ - { - oldId: '1', - newId: '2', - }, - { - oldId: '3', - newId: '4', - }, - { - oldId: '5', - newId: '5', - }, - ]; - - const overwriteAll = false; - - await resolveIndexPatternConflicts( - resolutions, - conflictedIndexPatterns, - overwriteAll, - dependencies - ); - - expect(save.mock.calls.length).toBe(2); - expect(save).toHaveBeenCalledWith({ confirmOverwrite: !overwriteAll }); - }); - - it('should resolve filter index conflicts', async () => { - const save = jest.fn(); - - const conflictedIndexPatterns = ([ - { - obj: { - save, - }, - doc: { - _source: { - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - index: '1', - filter: [{ meta: { index: 'filterIndex' } }], - }), - }, - }, - }, - }, - { - obj: { - save, - }, - doc: { - _source: { - kibanaSavedObjectMeta: { - searchSourceJSON: JSON.stringify({ - index: '3', - }), - }, - }, - }, - }, - ] as unknown) as Array<{ obj: SavedObject; doc: any }>; - - const resolutions = [ - { - oldId: '1', - newId: '2', - }, - { - oldId: '3', - newId: '4', - }, - { - oldId: 'filterIndex', - newId: 'newFilterIndex', - }, - ]; - - const overwriteAll = false; - - await resolveIndexPatternConflicts( - resolutions, - conflictedIndexPatterns, - overwriteAll, - dependencies - ); - - expect(save.mock.calls.length).toBe(2); - }); - }); - - describe('saveObjects', () => { - it('should save every object', async () => { - const save = jest.fn(); - - const objs = [ - createObj({ - save, - }), - createObj({ - save, - }), - ]; - - const overwriteAll = false; - - await saveObjects(objs, overwriteAll); - expect(save.mock.calls.length).toBe(2); - expect(save).toHaveBeenCalledWith({ confirmOverwrite: !overwriteAll }); - }); - }); - - describe('saveObject', () => { - it('should save the object', async () => { - const save = jest.fn(); - const obj = createObj({ - save, - }); - - const overwriteAll = false; - - await saveObject(obj, overwriteAll); - expect(save.mock.calls.length).toBe(1); - expect(save).toHaveBeenCalledWith({ confirmOverwrite: !overwriteAll }); - }); - }); -}); diff --git a/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts b/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts deleted file mode 100644 index 95bd41745553d..0000000000000 --- a/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts +++ /dev/null @@ -1,353 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { cloneDeep } from 'lodash'; -import { OverlayStart, SavedObjectReference } from 'src/core/public'; -import { SavedObject, SavedObjectLoader } from '../../../saved_objects/public'; -import { - DataPublicPluginStart, - IndexPatternsContract, - injectSearchSourceReferences, - IndexPatternSpec, -} from '../../../data/public'; -import { FailedImport } from './process_import_response'; -import { DuplicateDataViewError, IndexPattern } from '../../../data/public'; - -type SavedObjectsRawDoc = Record; - -async function getSavedObject(doc: SavedObjectsRawDoc, services: SavedObjectLoader[]) { - const service = services.find((s) => s.type === doc._type); - if (!service) { - return; - } - - const obj = await service.get(); - obj.id = doc._id; - obj.migrationVersion = doc._migrationVersion; - return obj; -} - -function addJsonFieldToIndexPattern( - target: Record, - sourceString: string, - fieldName: string, - indexName: string -) { - if (sourceString) { - try { - target[fieldName] = JSON.parse(sourceString); - } catch (error) { - throw new Error( - i18n.translate('savedObjectsManagement.parsingFieldErrorMessage', { - defaultMessage: - 'Error encountered parsing {fieldName} for index pattern {indexName}: {errorMessage}', - values: { - fieldName, - indexName, - errorMessage: error.message, - }, - }) - ); - } - } -} -async function importIndexPattern( - doc: SavedObjectsRawDoc, - indexPatterns: IndexPatternsContract, - overwriteAll: boolean = false, - openConfirm: OverlayStart['openConfirm'] -) { - // TODO: consolidate this is the code in create_index_pattern_wizard.js - const { - title, - timeFieldName, - fields, - fieldFormatMap, - sourceFilters, - type, - typeMeta, - } = doc._source; - const indexPatternSpec: IndexPatternSpec = { - id: doc._id, - title, - timeFieldName, - }; - let emptyPattern: IndexPattern; - if (type) { - indexPatternSpec.type = type; - } - addJsonFieldToIndexPattern(indexPatternSpec, fields, 'fields', title); - addJsonFieldToIndexPattern(indexPatternSpec, fieldFormatMap, 'fieldFormatMap', title); - addJsonFieldToIndexPattern(indexPatternSpec, sourceFilters, 'sourceFilters', title); - addJsonFieldToIndexPattern(indexPatternSpec, typeMeta, 'typeMeta', title); - try { - emptyPattern = await indexPatterns.createAndSave(indexPatternSpec, overwriteAll, true); - } catch (err) { - if (err instanceof DuplicateDataViewError) { - // We can override and we want to prompt for confirmation - const isConfirmed = await openConfirm( - i18n.translate('savedObjectsManagement.indexPattern.confirmOverwriteLabel', { - values: { title }, - defaultMessage: "Are you sure you want to overwrite '{title}'?", - }), - { - title: i18n.translate('savedObjectsManagement.indexPattern.confirmOverwriteTitle', { - defaultMessage: 'Overwrite {type}?', - values: { type }, - }), - confirmButtonText: i18n.translate( - 'savedObjectsManagement.indexPattern.confirmOverwriteButton', - { - defaultMessage: 'Overwrite', - } - ), - } - ); - - if (isConfirmed) { - emptyPattern = await indexPatterns.createAndSave(indexPatternSpec, true, true); - } else { - return; - } - } - } - - indexPatterns.clearCache(emptyPattern!.id); - return emptyPattern!.id; -} - -async function importDocument(obj: SavedObject, doc: SavedObjectsRawDoc, overwriteAll: boolean) { - await obj.applyESResp({ - references: doc._references || [], - ...cloneDeep(doc), - }); - return await obj.save({ confirmOverwrite: !overwriteAll }); -} - -function groupByType(docs: SavedObjectsRawDoc[]): Record { - const defaultDocTypes = { - searches: [], - indexPatterns: [], - other: [], - } as Record; - - return docs.reduce((types, doc) => { - switch (doc._type) { - case 'search': - types.searches.push(doc); - break; - case 'index-pattern': - types.indexPatterns.push(doc); - break; - default: - types.other.push(doc); - } - return types; - }, defaultDocTypes); -} - -export async function resolveIndexPatternConflicts( - resolutions: Array<{ oldId: string; newId: string }>, - conflictedIndexPatterns: any[], - overwriteAll: boolean, - dependencies: { - indexPatterns: IndexPatternsContract; - search: DataPublicPluginStart['search']; - } -) { - let importCount = 0; - - for (const { obj, doc } of conflictedIndexPatterns) { - const serializedSearchSource = JSON.parse( - doc._source.kibanaSavedObjectMeta?.searchSourceJSON || '{}' - ); - const oldIndexId = serializedSearchSource.index; - let allResolved = true; - const inlineResolution = resolutions.find(({ oldId }) => oldId === oldIndexId); - if (inlineResolution) { - serializedSearchSource.index = inlineResolution.newId; - } else { - allResolved = false; - } - - // Resolve filter index reference: - const filter = (serializedSearchSource.filter || []).map((f: any) => { - if (!(f.meta && f.meta.index)) { - return f; - } - - const resolution = resolutions.find(({ oldId }) => oldId === f.meta.index); - return resolution ? { ...f, ...{ meta: { ...f.meta, index: resolution.newId } } } : f; - }); - - if (filter.length > 0) { - serializedSearchSource.filter = filter; - } - - const replacedReferences = (doc._references || []).map((reference: SavedObjectReference) => { - const resolution = resolutions.find(({ oldId }) => oldId === reference.id); - if (resolution) { - return { ...reference, id: resolution.newId }; - } else { - allResolved = false; - } - - return reference; - }); - - const serializedSearchSourceWithInjectedReferences = injectSearchSourceReferences( - serializedSearchSource, - replacedReferences - ); - - if (!allResolved) { - // The user decided to skip this conflict so do nothing - continue; - } - obj.searchSource = await dependencies.search.searchSource.create( - serializedSearchSourceWithInjectedReferences - ); - if (await saveObject(obj, overwriteAll)) { - importCount++; - } - } - return importCount; -} - -export async function saveObjects(objs: SavedObject[], overwriteAll: boolean) { - let importCount = 0; - for (const obj of objs) { - if (await saveObject(obj, overwriteAll)) { - importCount++; - } - } - return importCount; -} - -export async function saveObject(obj: SavedObject, overwriteAll: boolean) { - return await obj.save({ confirmOverwrite: !overwriteAll }); -} - -export async function resolveSavedSearches( - savedSearches: any[], - services: SavedObjectLoader[], - indexPatterns: IndexPatternsContract, - overwriteAll: boolean -) { - let importCount = 0; - for (const searchDoc of savedSearches) { - const obj = await getSavedObject(searchDoc, services); - if (!obj) { - // Just ignore? - continue; - } - if (await importDocument(obj, searchDoc, overwriteAll)) { - importCount++; - } - } - return importCount; -} - -export async function resolveSavedObjects( - savedObjects: SavedObjectsRawDoc[], - overwriteAll: boolean, - services: SavedObjectLoader[], - indexPatterns: IndexPatternsContract, - confirmModalPromise: OverlayStart['openConfirm'] -) { - const docTypes = groupByType(savedObjects); - - // Keep track of how many we actually import because the user - // can cancel an override - let importedObjectCount = 0; - const failedImports: FailedImport[] = []; - // Start with the index patterns since everything is dependent on them - // As the confirmation opens a modal, and as we only allow one modal at a time - // (opening a new one close the previous with a rejection) - // we can't do that in parallel - for (const indexPatternDoc of docTypes.indexPatterns) { - try { - const importedIndexPatternId = await importIndexPattern( - indexPatternDoc, - indexPatterns, - overwriteAll, - confirmModalPromise - ); - if (importedIndexPatternId) { - importedObjectCount++; - } - } catch (error) { - failedImports.push({ obj: indexPatternDoc as any, error }); - } - } - - // We want to do the same for saved searches, but we want to keep them separate because they need - // to be applied _first_ because other saved objects can be dependent on those saved searches existing - const conflictedSearchDocs: any[] = []; - // Keep a record of the index patterns assigned to our imported saved objects that do not - // exist. We will provide a way for the user to manually select a new index pattern for those - // saved objects. - const conflictedIndexPatterns: any[] = []; - // Keep a record of any objects which fail to import for unknown reasons. - - // It's possible to have saved objects that link to saved searches which then link to index patterns - // and those could error out, but the error comes as an index pattern not found error. We can't resolve - // those the same as way as normal index pattern not found errors, but when those are fixed, it's very - // likely that these saved objects will work once resaved so keep them around to resave them. - const conflictedSavedObjectsLinkedToSavedSearches: any[] = []; - - for (const searchDoc of docTypes.searches) { - const obj = await getSavedObject(searchDoc, services); - - try { - if (await importDocument(obj, searchDoc, overwriteAll)) { - importedObjectCount++; - } - } catch (error) { - if (error.constructor.name === 'SavedObjectNotFound') { - if (error.savedObjectType === 'index-pattern') { - conflictedIndexPatterns.push({ obj, doc: searchDoc }); - } else { - conflictedSearchDocs.push(searchDoc); - } - } else { - failedImports.push({ obj, error }); - } - } - } - - for (const otherDoc of docTypes.other) { - const obj = await getSavedObject(otherDoc, services); - - try { - if (await importDocument(obj, otherDoc, overwriteAll)) { - importedObjectCount++; - } - } catch (error) { - const isIndexPatternNotFound = - error.constructor.name === 'SavedObjectNotFound' && - error.savedObjectType === 'index-pattern'; - if (isIndexPatternNotFound && obj.savedSearchId) { - conflictedSavedObjectsLinkedToSavedSearches.push(obj); - } else if (isIndexPatternNotFound) { - conflictedIndexPatterns.push({ obj, doc: otherDoc }); - } else { - failedImports.push({ obj, error }); - } - } - } - - return { - conflictedIndexPatterns, - conflictedSavedObjectsLinkedToSavedSearches, - conflictedSearchDocs, - importedObjectCount, - failedImports, - }; -} diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap index bd97f2e6bffb1..1affbd4d96463 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap @@ -195,9 +195,6 @@ exports[`Flyout conflicts should allow conflict resolution 2`] = ` "put": [MockFunction], }, "state": Object { - "conflictedIndexPatterns": undefined, - "conflictedSavedObjectsLinkedToSavedSearches": undefined, - "conflictedSearchDocs": undefined, "conflictingRecord": undefined, "error": undefined, "failedImports": Array [ @@ -238,7 +235,6 @@ exports[`Flyout conflicts should allow conflict resolution 2`] = ` "title": undefined, }, ], - "isLegacyFile": false, "loadingMessage": undefined, "status": "loading", "successfulImports": Array [], @@ -276,278 +272,6 @@ exports[`Flyout conflicts should allow conflict resolution 2`] = ` } `; -exports[`Flyout legacy conflicts should allow conflict resolution 1`] = ` - - - -

- -

-
-
- - - - - } - > -

- -

-
- -
- - - - } - > -

- - - , - } - } - /> -

-
-
- -
- - - - - - - - - - - - - - -
-`; - -exports[`Flyout legacy conflicts should handle errors 2`] = ` -Array [ - - } - > -

- -

-
, - - } - > -

- - - , - } - } - /> -

-
, - - } - > -

- The file could not be processed due to error: "foobar" -

-
, -] -`; - exports[`Flyout should render import step 1`] = ` diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/relationships.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/relationships.test.tsx.snap index c39263f304249..6c07cb0c46ec6 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/relationships.test.tsx.snap +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/relationships.test.tsx.snap @@ -14,6 +14,7 @@ exports[`Relationships should render dashboards normally 1`] = ` ({ +const createObject = ({ + namespaces, + hiddenType = false, +}: CreateObjectOptions = {}): SavedObjectWithMetadata => ({ id: 'foo', type: 'bar', attributes: {}, references: [], namespaces, - meta: {}, + meta: { + hiddenType, + }, }); describe('DeleteConfirmModal', () => { @@ -81,7 +87,7 @@ describe('DeleteConfirmModal', () => { isDeleting={false} onConfirm={onConfirm} onCancel={onCancel} - selectedObjects={[]} + selectedObjects={[createObject()]} /> ); wrapper.find('EuiButton').simulate('click'); @@ -90,6 +96,81 @@ describe('DeleteConfirmModal', () => { expect(onCancel).not.toHaveBeenCalled(); }); + describe('when trying to delete hidden objects', () => { + it('excludes the hidden objects from the table', () => { + const objs = [ + createObject({ hiddenType: true }), + createObject({ hiddenType: false }), + createObject({ hiddenType: true }), + ]; + const wrapper = mountWithIntl( + + ); + expect(wrapper.find('.euiTableRow')).toHaveLength(1); + }); + + it('displays a callout when at least one object cannot be deleted', () => { + const objs = [ + createObject({ hiddenType: false }), + createObject({ hiddenType: false }), + createObject({ hiddenType: true }), + ]; + const wrapper = mountWithIntl( + + ); + + const callout = findTestSubject(wrapper, 'cannotDeleteObjectsConfirmWarning'); + expect(callout).toHaveLength(1); + }); + + it('does not display a callout when all objects can be deleted', () => { + const objs = [ + createObject({ hiddenType: false }), + createObject({ hiddenType: false }), + createObject({ hiddenType: false }), + ]; + const wrapper = mountWithIntl( + + ); + + const callout = findTestSubject(wrapper, 'cannotDeleteObjectsConfirmWarning'); + expect(callout).toHaveLength(0); + }); + + it('disable the submit button when all objects cannot be deleted', () => { + const objs = [ + createObject({ hiddenType: true }), + createObject({ hiddenType: true }), + createObject({ hiddenType: true }), + ]; + const wrapper = mountWithIntl( + + ); + + expect(wrapper.find('EuiButton').getDOMNode()).toBeDisabled(); + }); + }); + describe('shared objects warning', () => { it('does not display a callout when no objects are shared', () => { const objs = [ diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/delete_confirm_modal.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/delete_confirm_modal.tsx index 7f1f3adc96d8b..e3ffc6d52a3ab 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/delete_confirm_modal.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/delete_confirm_modal.tsx @@ -86,7 +86,7 @@ export const DeleteConfirmModal: FC = ({ title={ } iconType="alert" @@ -95,7 +95,8 @@ export const DeleteConfirmModal: FC = ({

@@ -186,6 +187,7 @@ export const DeleteConfirmModal: FC = ({ fill color="danger" onClick={onConfirm} + disabled={deletableObjects.length === 0} data-test-subj="confirmModalConfirmButton" > ({ resolveImportErrors: resolveImportErrorsMock, })); - -export const importLegacyFileMock = jest.fn(); -jest.doMock('../../../lib/import_legacy_file', () => ({ - importLegacyFile: importLegacyFileMock, -})); - -export const resolveSavedObjectsMock = jest.fn(); -export const resolveSavedSearchesMock = jest.fn(); -export const resolveIndexPatternConflictsMock = jest.fn(); -export const saveObjectsMock = jest.fn(); -jest.doMock('../../../lib/resolve_saved_objects', () => ({ - resolveSavedObjects: resolveSavedObjectsMock, - resolveSavedSearches: resolveSavedSearchesMock, - resolveIndexPatternConflicts: resolveIndexPatternConflictsMock, - saveObjects: saveObjectsMock, -})); diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.test.tsx index a1eb94ab55cfa..f055817f69105 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.test.tsx @@ -6,15 +6,7 @@ * Side Public License, v 1. */ -import { - importFileMock, - importLegacyFileMock, - resolveImportErrorsMock, - resolveIndexPatternConflictsMock, - resolveSavedObjectsMock, - resolveSavedSearchesMock, - saveObjectsMock, -} from './flyout.test.mocks'; +import { importFileMock, resolveImportErrorsMock } from './flyout.test.mocks'; import React from 'react'; import { shallowWithI18nProvider } from '@kbn/test/jest'; @@ -28,10 +20,6 @@ const mockFile = ({ name: 'foo.ndjson', path: '/home/foo.ndjson', } as unknown) as File; -const legacyMockFile = ({ - name: 'foo.json', - path: '/home/foo.json', -} as unknown) as File; describe('Flyout', () => { let defaultProps: FlyoutProps; @@ -45,7 +33,7 @@ describe('Flyout', () => { }; beforeEach(() => { - const { http, overlays } = coreMock.createStart(); + const { http } = coreMock.createStart(); const search = dataPluginMock.createStartContract().search; const basePath = httpServiceMock.createBasePath(); @@ -59,7 +47,6 @@ describe('Flyout', () => { { id: '2', attributes: {} }, ]), } as any, - overlays, http, allowedTypes: ['search', 'index-pattern', 'visualization'], serviceRegistry: serviceRegistryMock.create(), @@ -107,31 +94,6 @@ describe('Flyout', () => { expect(component.state('file')).toBe(undefined); }); - it('should handle invalid files', async () => { - const component = shallowRender(defaultProps); - - // Ensure all promises resolve - await new Promise((resolve) => process.nextTick(resolve)); - // Ensure the state changes are reflected - component.update(); - - importLegacyFileMock.mockImplementation(() => { - throw new Error('foobar'); - }); - - await component.instance().legacyImport(); - expect(component.state('error')).toBe('The file could not be processed.'); - - importLegacyFileMock.mockImplementation(() => ({ - invalid: true, - })); - - await component.instance().legacyImport(); - expect(component.state('error')).toBe( - 'Saved objects file format is invalid and cannot be imported.' - ); - }); - describe('conflicts', () => { beforeEach(() => { importFileMock.mockImplementation(() => ({ @@ -169,7 +131,7 @@ describe('Flyout', () => { // Ensure the state changes are reflected component.update(); - component.setState({ file: mockFile, isLegacyFile: false }); + component.setState({ file: mockFile }); await component.instance().import(); expect(importFileMock).toHaveBeenCalledWith(defaultProps.http, mockFile, { @@ -177,9 +139,6 @@ describe('Flyout', () => { overwrite: true, }); expect(component.state()).toMatchObject({ - conflictedIndexPatterns: undefined, - conflictedSavedObjectsLinkedToSavedSearches: undefined, - conflictedSearchDocs: undefined, importCount: 0, status: 'idle', error: undefined, @@ -207,7 +166,7 @@ describe('Flyout', () => { // Ensure the state changes are reflected component.update(); - component.setState({ file: mockFile, isLegacyFile: false }); + component.setState({ file: mockFile }); await component.instance().import(); // Ensure it looks right @@ -250,7 +209,7 @@ describe('Flyout', () => { successfulImports, })); - component.setState({ file: mockFile, isLegacyFile: false }); + component.setState({ file: mockFile }); // Go through the import flow await component.instance().import(); @@ -267,194 +226,4 @@ describe('Flyout', () => { expect(cancelButton.prop('disabled')).toBe(true); }); }); - - describe('legacy conflicts', () => { - const mockData = [ - { - _id: '1', - _type: 'search', - }, - { - _id: '2', - _type: 'index-pattern', - }, - { - _id: '3', - _type: 'invalid', - }, - ]; - - const mockConflictedIndexPatterns = [ - { - doc: { - _type: 'index-pattern', - _id: '1', - _source: { - title: 'MyIndexPattern*', - }, - }, - obj: { - searchSource: { - getOwnField: (field: string) => { - if (field === 'index') { - return 'MyIndexPattern*'; - } - if (field === 'filter') { - return [{ meta: { index: 'filterIndex' } }]; - } - }, - }, - _serialize: () => { - return { references: [{ id: 'MyIndexPattern*' }, { id: 'filterIndex' }] }; - }, - }, - }, - ]; - - const mockConflictedSavedObjectsLinkedToSavedSearches = [2]; - const mockConflictedSearchDocs = [3]; - - beforeEach(() => { - importLegacyFileMock.mockImplementation(() => mockData); - resolveSavedObjectsMock.mockImplementation(() => ({ - conflictedIndexPatterns: mockConflictedIndexPatterns, - conflictedSavedObjectsLinkedToSavedSearches: mockConflictedSavedObjectsLinkedToSavedSearches, - conflictedSearchDocs: mockConflictedSearchDocs, - importedObjectCount: 2, - confirmModalPromise: () => {}, - })); - }); - - it('should figure out unmatchedReferences', async () => { - const component = shallowRender(defaultProps); - - // Ensure all promises resolve - await new Promise((resolve) => process.nextTick(resolve)); - // Ensure the state changes are reflected - component.update(); - - component.setState({ file: legacyMockFile, isLegacyFile: true }); - await component.instance().legacyImport(); - - expect(importLegacyFileMock).toHaveBeenCalledWith(legacyMockFile); - // Remove the last element from data since it should be filtered out - expect(resolveSavedObjectsMock).toHaveBeenCalledWith( - mockData.slice(0, 2).map((doc) => ({ ...doc, _migrationVersion: {} })), - true, - defaultProps.serviceRegistry.all().map((s) => s.service), - defaultProps.indexPatterns, - defaultProps.overlays.openConfirm - ); - - expect(component.state()).toMatchObject({ - conflictedIndexPatterns: mockConflictedIndexPatterns, - conflictedSavedObjectsLinkedToSavedSearches: mockConflictedSavedObjectsLinkedToSavedSearches, - conflictedSearchDocs: mockConflictedSearchDocs, - importCount: 2, - status: 'idle', - error: undefined, - unmatchedReferences: [ - { - existingIndexPatternId: 'MyIndexPattern*', - newIndexPatternId: undefined, - list: [ - { - id: 'MyIndexPattern*', - title: 'MyIndexPattern*', - type: 'index-pattern', - }, - ], - }, - { - existingIndexPatternId: 'filterIndex', - list: [ - { - id: 'filterIndex', - title: 'MyIndexPattern*', - type: 'index-pattern', - }, - ], - newIndexPatternId: undefined, - }, - ], - }); - }); - - it('should allow conflict resolution', async () => { - const component = shallowRender(defaultProps); - - // Ensure all promises resolve - await new Promise((resolve) => process.nextTick(resolve)); - // Ensure the state changes are reflected - component.update(); - - component.setState({ file: legacyMockFile, isLegacyFile: true }); - await component.instance().legacyImport(); - - // Ensure it looks right - component.update(); - expect(component).toMatchSnapshot(); - - // Ensure we can change the resolution - component.instance().onIndexChanged('MyIndexPattern*', { target: { value: '2' } }); - expect(component.state('unmatchedReferences')![0].newIndexPatternId).toBe('2'); - - // Let's resolve now - await component - .find('EuiButton[data-test-subj="importSavedObjectsConfirmBtn"]') - .simulate('click'); - // Ensure all promises resolve - await new Promise((resolve) => process.nextTick(resolve)); - expect(resolveIndexPatternConflictsMock).toHaveBeenCalledWith( - component.instance().resolutions, - mockConflictedIndexPatterns, - true, - { - search: defaultProps.search, - indexPatterns: defaultProps.indexPatterns, - } - ); - expect(saveObjectsMock).toHaveBeenCalledWith( - mockConflictedSavedObjectsLinkedToSavedSearches, - true - ); - expect(resolveSavedSearchesMock).toHaveBeenCalledWith( - mockConflictedSearchDocs, - defaultProps.serviceRegistry.all().map((s) => s.service), - defaultProps.indexPatterns, - true - ); - }); - - it('should handle errors', async () => { - const component = shallowRender(defaultProps); - - // Ensure all promises resolve - await new Promise((resolve) => process.nextTick(resolve)); - // Ensure the state changes are reflected - component.update(); - - resolveIndexPatternConflictsMock.mockImplementation(() => { - throw new Error('foobar'); - }); - - component.setState({ file: legacyMockFile, isLegacyFile: true }); - - // Go through the import flow - await component.instance().legacyImport(); - component.update(); - // Set a resolution - component.instance().onIndexChanged('MyIndexPattern*', { target: { value: '2' } }); - await component - .find('EuiButton[data-test-subj="importSavedObjectsConfirmBtn"]') - .simulate('click'); - // Ensure all promises resolve - await new Promise((resolve) => process.nextTick(resolve)); - - expect(component.state('error')).toMatchInlineSnapshot( - `"The file could not be processed due to error: \\"foobar\\""` - ); - expect(component.find('EuiFlyoutBody EuiCallOut')).toMatchSnapshot(); - }); - }); }); diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx index 8f4940ffb05c9..26de8c5f8b25a 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx @@ -7,7 +7,7 @@ */ import React, { Component, Fragment, ReactNode } from 'react'; -import { take, get as getField } from 'lodash'; +import { take } from 'lodash'; import { EuiFlyout, EuiFlyoutBody, @@ -31,7 +31,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; -import { OverlayStart, HttpStart, IBasePath } from 'src/core/public'; +import { HttpStart, IBasePath } from 'src/core/public'; import { IndexPatternsContract, IndexPattern, @@ -39,18 +39,10 @@ import { } from '../../../../../data/public'; import { importFile, - importLegacyFile, resolveImportErrors, - logLegacyImport, processImportResponse, ProcessedImportResponse, } from '../../../lib'; -import { - resolveSavedObjects, - resolveSavedSearches, - resolveIndexPatternConflicts, - saveObjects, -} from '../../../lib/resolve_saved_objects'; import { ISavedObjectsManagementServiceRegistry } from '../../../services'; import { FailedImportConflict, RetryDecision } from '../../../lib/resolve_import_errors'; import { OverwriteModal } from './overwrite_modal'; @@ -67,16 +59,12 @@ export interface FlyoutProps { done: () => void; newIndexPatternUrl: string; indexPatterns: IndexPatternsContract; - overlays: OverlayStart; http: HttpStart; basePath: IBasePath; search: DataPublicPluginStart['search']; } export interface FlyoutState { - conflictedIndexPatterns?: any[]; - conflictedSavedObjectsLinkedToSavedSearches?: any[]; - conflictedSearchDocs?: any[]; unmatchedReferences?: ProcessedImportResponse['unmatchedReferences']; unmatchedReferencesTablePagination: { pageIndex: number; pageSize: number }; failedImports?: ProcessedImportResponse['failedImports']; @@ -89,7 +77,6 @@ export interface FlyoutState { indexPatterns?: IndexPattern[]; importMode: ImportMode; loadingMessage?: string; - isLegacyFile: boolean; status: string; } @@ -114,9 +101,6 @@ export class Flyout extends Component { super(props); this.state = { - conflictedIndexPatterns: undefined, - conflictedSavedObjectsLinkedToSavedSearches: undefined, - conflictedSearchDocs: undefined, unmatchedReferences: undefined, unmatchedReferencesTablePagination: { pageIndex: 0, @@ -129,7 +113,6 @@ export class Flyout extends Component { indexPatterns: undefined, importMode: { createNewCopies: CREATE_NEW_COPIES_DEFAULT, overwrite: OVERWRITE_ALL_DEFAULT }, loadingMessage: undefined, - isLegacyFile: false, status: 'idle', }; } @@ -152,14 +135,11 @@ export class Flyout extends Component { setImportFile = (files: FileList | null) => { if (!files || !files[0]) { - this.setState({ file: undefined, isLegacyFile: false }); + this.setState({ file: undefined }); return; } const file = files[0]; - this.setState({ - file, - isLegacyFile: /\.json$/i.test(file.name) || file.type === 'application/json', - }); + this.setState({ file }); }; /** @@ -246,103 +226,6 @@ export class Flyout extends Component { } }; - legacyImport = async () => { - const { serviceRegistry, indexPatterns, overlays, http, allowedTypes } = this.props; - const { file, importMode } = this.state; - - this.setState({ status: 'loading', error: undefined }); - - // Log warning on server, don't wait for response - logLegacyImport(http); - - let contents; - try { - contents = await importLegacyFile(file!); - } catch (e) { - this.setState({ - status: 'error', - error: i18n.translate( - 'savedObjectsManagement.objectsTable.flyout.importLegacyFileErrorMessage', - { defaultMessage: 'The file could not be processed.' } - ), - }); - return; - } - - if (!Array.isArray(contents)) { - this.setState({ - status: 'error', - error: i18n.translate( - 'savedObjectsManagement.objectsTable.flyout.invalidFormatOfImportedFileErrorMessage', - { defaultMessage: 'Saved objects file format is invalid and cannot be imported.' } - ), - }); - return; - } - - contents = contents - .filter((content) => allowedTypes.includes(content._type)) - .map((doc) => ({ - ...doc, - // The server assumes that documents with no migrationVersion are up to date. - // That assumption enables Kibana and other API consumers to not have to build - // up migrationVersion prior to creating new objects. But it means that imports - // need to set migrationVersion to something other than undefined, so that imported - // docs are not seen as automatically up-to-date. - _migrationVersion: doc._migrationVersion || {}, - })); - - const { - conflictedIndexPatterns, - conflictedSavedObjectsLinkedToSavedSearches, - conflictedSearchDocs, - importedObjectCount, - failedImports, - } = await resolveSavedObjects( - contents, - importMode.overwrite, - serviceRegistry.all().map((e) => e.service), - indexPatterns, - overlays.openConfirm - ); - - const byId: Record = {}; - conflictedIndexPatterns - .map(({ doc, obj }) => { - return { doc, obj: obj._serialize() }; - }) - .forEach(({ doc, obj }) => - obj.references.forEach((ref: Record) => { - byId[ref.id] = byId[ref.id] != null ? byId[ref.id].concat({ doc, obj }) : [{ doc, obj }]; - }) - ); - const unmatchedReferences = Object.entries(byId).reduce( - (accum, [existingIndexPatternId, list]) => { - accum.push({ - existingIndexPatternId, - newIndexPatternId: undefined, - list: list.map(({ doc }) => ({ - id: existingIndexPatternId, - type: doc._type, - title: doc._source.title, - })), - }); - return accum; - }, - [] as any[] - ); - - this.setState({ - conflictedIndexPatterns, - conflictedSavedObjectsLinkedToSavedSearches, - conflictedSearchDocs, - failedImports, - unmatchedReferences, - importCount: importedObjectCount, - status: unmatchedReferences.length === 0 ? 'success' : 'idle', - }); - }; - public get hasUnmatchedReferences() { return this.state.unmatchedReferences && this.state.unmatchedReferences.length > 0; } @@ -362,89 +245,6 @@ export class Flyout extends Component { ); } - confirmLegacyImport = async () => { - const { - conflictedIndexPatterns, - importMode, - conflictedSavedObjectsLinkedToSavedSearches, - conflictedSearchDocs, - failedImports, - } = this.state; - - const { serviceRegistry, indexPatterns, search } = this.props; - - this.setState({ - error: undefined, - status: 'loading', - loadingMessage: undefined, - }); - - let importCount = this.state.importCount; - - if (this.hasUnmatchedReferences) { - try { - const resolutions = this.resolutions; - - // Do not Promise.all these calls as the order matters - this.setState({ - loadingMessage: i18n.translate( - 'savedObjectsManagement.objectsTable.flyout.confirmLegacyImport.resolvingConflictsLoadingMessage', - { defaultMessage: 'Resolving conflicts…' } - ), - }); - if (resolutions.length) { - importCount += await resolveIndexPatternConflicts( - resolutions, - conflictedIndexPatterns!, - importMode.overwrite, - { indexPatterns, search } - ); - } - this.setState({ - loadingMessage: i18n.translate( - 'savedObjectsManagement.objectsTable.flyout.confirmLegacyImport.savingConflictsLoadingMessage', - { defaultMessage: 'Saving conflicts…' } - ), - }); - importCount += await saveObjects( - conflictedSavedObjectsLinkedToSavedSearches!, - importMode.overwrite - ); - this.setState({ - loadingMessage: i18n.translate( - 'savedObjectsManagement.objectsTable.flyout.confirmLegacyImport.savedSearchAreLinkedProperlyLoadingMessage', - { defaultMessage: 'Ensure saved searches are linked properly…' } - ), - }); - importCount += await resolveSavedSearches( - conflictedSearchDocs!, - serviceRegistry.all().map((e) => e.service), - indexPatterns, - importMode.overwrite - ); - this.setState({ - loadingMessage: i18n.translate( - 'savedObjectsManagement.objectsTable.flyout.confirmLegacyImport.retryingFailedObjectsLoadingMessage', - { defaultMessage: 'Retrying failed objects…' } - ), - }); - importCount += await saveObjects( - failedImports!.map(({ obj }) => obj) as any[], - importMode.overwrite - ); - } catch (e) { - this.setState({ - status: 'error', - error: getErrorMessage(e), - loadingMessage: undefined, - }); - return; - } - } - - this.setState({ status: 'success', importCount }); - }; - onIndexChanged = (id: string, e: any) => { const value = e.target.value; this.setState((state) => { @@ -613,10 +413,8 @@ export class Flyout extends Component { const { status, loadingMessage, - importCount, failedImports = [], successfulImports = [], - isLegacyFile, importMode, importWarnings, } = this.state; @@ -635,7 +433,8 @@ export class Flyout extends Component { ); } - if (!isLegacyFile && status === 'success') { + // Import summary for completed import + if (status === 'success') { return ( { ); } - // Import summary for failed legacy import - if (failedImports.length && !this.hasUnmatchedReferences) { - return ( - - } - color="warning" - iconType="help" - > -

- -

-

- {failedImports - .map(({ error, obj }) => { - if (error.type === 'missing_references') { - return error.references.map((reference) => { - return i18n.translate( - 'savedObjectsManagement.objectsTable.flyout.importFailedMissingReference', - { - defaultMessage: '{type} [id={id}] could not locate {refType} [id={refId}]', - values: { - id: obj.id, - type: obj.type, - refId: reference.id, - refType: reference.type, - }, - } - ); - }); - } else if (error.type === 'unsupported_type') { - return i18n.translate( - 'savedObjectsManagement.objectsTable.flyout.importFailedUnsupportedType', - { - defaultMessage: '{type} [id={id}] unsupported type', - values: { - id: obj.id, - type: obj.type, - }, - } - ); - } - return getField(error, 'body.message', (error as any).message ?? ''); - }) - .join(' ')} -

-
- ); - } - - // Import summary for completed legacy import - if (status === 'success') { - if (importCount === 0) { - return ( - - } - color="primary" - /> - ); - } - - return ( - - } - color="success" - iconType="check" - > -

- -

-
- ); - } - + // Failed imports if (this.hasUnmatchedReferences) { return this.renderUnmatchedReferences(); } @@ -768,7 +466,7 @@ export class Flyout extends Component { } > { this.changeImportMode(newValues)} /> @@ -791,7 +488,7 @@ export class Flyout extends Component { } renderFooter() { - const { isLegacyFile, status } = this.state; + const { status } = this.state; const { done, close } = this.props; let confirmButton; @@ -808,7 +505,7 @@ export class Flyout extends Component { } else if (this.hasUnmatchedReferences) { confirmButton = ( { } else { confirmButton = ( { { return null; } - let legacyFileWarning; - if (this.state.isLegacyFile) { - legacyFileWarning = ( - <> - - } - color="warning" - iconType="help" - > -

- -

-
- - - ); - } - let indexPatternConflictsWarning; if (this.hasUnmatchedReferences) { indexPatternConflictsWarning = ( @@ -925,18 +595,12 @@ export class Flyout extends Component { ); } - if (!legacyFileWarning && !indexPatternConflictsWarning) { + if (!indexPatternConflictsWarning) { return null; } return ( - {legacyFileWarning && ( - - - {legacyFileWarning} - - )} {indexPatternConflictsWarning && ( diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.test.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.test.tsx index 2ece421238635..fbf50e0ee0c86 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.test.tsx @@ -32,14 +32,9 @@ describe('ImportModeControl', () => { jest.resetAllMocks(); }); - const props: ImportModeControlProps = { initialValues, updateSelection, isLegacyFile: false }; + const props: ImportModeControlProps = { initialValues, updateSelection }; - it('returns partial import mode control when used with a legacy file', async () => { - const wrapper = shallowWithI18nProvider(); - expect(wrapper.find('EuiFormFieldset')).toHaveLength(0); - }); - - it('returns full import mode control when used without a legacy file', async () => { + it('returns full import mode control', async () => { const wrapper = shallowWithI18nProvider(); expect(wrapper.find('EuiFormFieldset')).toHaveLength(1); }); diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.tsx index ee36ef67ee96a..6641e53be8f57 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_mode_control.tsx @@ -22,7 +22,6 @@ import { i18n } from '@kbn/i18n'; export interface ImportModeControlProps { initialValues: ImportMode; - isLegacyFile: boolean; updateSelection: (result: ImportMode) => void; } @@ -87,11 +86,7 @@ const createLabel = ({ text, tooltip }: { text: string; tooltip: string }) => ( ); -export const ImportModeControl = ({ - initialValues, - isLegacyFile, - updateSelection, -}: ImportModeControlProps) => { +export const ImportModeControl = ({ initialValues, updateSelection }: ImportModeControlProps) => { const [createNewCopies, setCreateNewCopies] = useState(initialValues.createNewCopies); const [overwrite, setOverwrite] = useState(initialValues.overwrite); @@ -104,20 +99,6 @@ export const ImportModeControl = ({ updateSelection({ createNewCopies, overwrite, ...partial }); }; - const overwriteRadio = ( - onChange({ overwrite: id === overwriteEnabled.id })} - disabled={createNewCopies && !isLegacyFile} - data-test-subj={'savedObjectsManagement-importModeControl-overwriteRadioGroup'} - /> - ); - - if (isLegacyFile) { - return overwriteRadio; - } - return ( onChange({ createNewCopies: false })} > - {overwriteRadio} + onChange({ overwrite: id === overwriteEnabled.id })} + disabled={createNewCopies} + data-test-subj={'savedObjectsManagement-importModeControl-overwriteRadioGroup'} + /> diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx index 5ea433f91d1a6..d4067cc21c2be 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx @@ -544,7 +544,6 @@ export class SavedObjectsTable extends Component diff --git a/src/plugins/saved_objects_tagging_oss/jest.config.js b/src/plugins/saved_objects_tagging_oss/jest.config.js index adb5b1e426180..e7b571e955ef1 100644 --- a/src/plugins/saved_objects_tagging_oss/jest.config.js +++ b/src/plugins/saved_objects_tagging_oss/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/saved_objects_tagging_oss'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/saved_objects_tagging_oss', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/saved_objects_tagging_oss/{common,public}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/screenshot_mode/jest.config.js b/src/plugins/screenshot_mode/jest.config.js index e84f3742f8c1d..e108ab786739f 100644 --- a/src/plugins/screenshot_mode/jest.config.js +++ b/src/plugins/screenshot_mode/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/screenshot_mode'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/screenshot_mode', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/screenshot_mode/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/security_oss/jest.config.js b/src/plugins/security_oss/jest.config.js index c62cad7e72cec..692d85f69a740 100644 --- a/src/plugins/security_oss/jest.config.js +++ b/src/plugins/security_oss/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/security_oss'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/security_oss', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/security_oss/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/share/jest.config.js b/src/plugins/share/jest.config.js index f347067849f71..aae58e3c57d1f 100644 --- a/src/plugins/share/jest.config.js +++ b/src/plugins/share/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/share'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/share', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/share/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/share/kibana.json b/src/plugins/share/kibana.json index 5580b723a095a..2616b299da28d 100644 --- a/src/plugins/share/kibana.json +++ b/src/plugins/share/kibana.json @@ -7,6 +7,7 @@ "name": "App Services", "githubTeam": "kibana-app-services" }, + "description": "Adds URL Service and sharing capabilities to Kibana", "requiredBundles": ["kibanaUtils"], "optionalPlugins": ["securityOss"] } diff --git a/src/plugins/share/public/index.ts b/src/plugins/share/public/index.ts index 1f999b59ddb61..74e849948d418 100644 --- a/src/plugins/share/public/index.ts +++ b/src/plugins/share/public/index.ts @@ -31,6 +31,7 @@ export { UrlGeneratorsService, } from './url_generators'; +export { RedirectOptions } from './url_service'; export { useLocatorUrl } from '../common/url_service/locators/use_locator_url'; import { SharePlugin } from './plugin'; diff --git a/src/plugins/share/public/url_service/redirect/redirect_manager.ts b/src/plugins/share/public/url_service/redirect/redirect_manager.ts index cc45e0d3126af..a5d895c7cbcf0 100644 --- a/src/plugins/share/public/url_service/redirect/redirect_manager.ts +++ b/src/plugins/share/public/url_service/redirect/redirect_manager.ts @@ -15,7 +15,15 @@ import type { UrlService } from '../../../common/url_service'; import { render } from './render'; import { parseSearchParams } from './util/parse_search_params'; -export interface RedirectOptions { +/** + * @public + * Serializable locator parameters that can be used by the redirect service to navigate to a location + * in Kibana. + * + * When passed to the public {@link SharePluginSetup['navigate']} function, locator params will also be + * migrated. + */ +export interface RedirectOptions

{ /** Locator ID. */ id: string; @@ -23,7 +31,7 @@ export interface RedirectOptions { version: string; /** Locator params. */ - params: unknown & SerializableRecord; + params: P; } export interface RedirectManagerDependencies { diff --git a/src/plugins/telemetry/jest.config.js b/src/plugins/telemetry/jest.config.js index 61e042b40b5d4..932c3c2851382 100644 --- a/src/plugins/telemetry/jest.config.js +++ b/src/plugins/telemetry/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/telemetry'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/telemetry', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/telemetry/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index b64c2fbe41265..666ba04654e15 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -1088,137 +1088,6 @@ } } }, - "timelion": { - "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" - } - } - } - } - } - } - }, "visualize": { "properties": { "appId": { @@ -6850,10 +6719,52 @@ "description": "How many times this API has been called by a non-Kibana client in a custom space." } }, + "apiCalls.legacyDashboardExport.total": { + "type": "long", + "_meta": { + "description": "How many times this API has been called." + } + }, + "apiCalls.legacyDashboardExport.namespace.default.total": { + "type": "long", + "_meta": { + "description": "How many times this API has been called in the Default space." + } + }, + "apiCalls.legacyDashboardExport.namespace.default.kibanaRequest.yes": { + "type": "long", + "_meta": { + "description": "How many times this API has been called by the Kibana client in the Default space." + } + }, + "apiCalls.legacyDashboardExport.namespace.default.kibanaRequest.no": { + "type": "long", + "_meta": { + "description": "How many times this API has been called by a non-Kibana client in the Default space." + } + }, + "apiCalls.legacyDashboardExport.namespace.custom.total": { + "type": "long", + "_meta": { + "description": "How many times this API has been called in a custom space." + } + }, + "apiCalls.legacyDashboardExport.namespace.custom.kibanaRequest.yes": { + "type": "long", + "_meta": { + "description": "How many times this API has been called by the Kibana client in a custom space." + } + }, + "apiCalls.legacyDashboardExport.namespace.custom.kibanaRequest.no": { + "type": "long", + "_meta": { + "description": "How many times this API has been called by a non-Kibana client in a custom space." + } + }, "apiCalls.savedObjectsExport.allTypesSelected.yes": { "type": "long", "_meta": { - "description": "How many times this API has been called with the `createNewCopiesEnabled` option." + "description": "How many times this API has been called with all types selected." } }, "apiCalls.savedObjectsExport.allTypesSelected.no": { @@ -6862,6 +6773,48 @@ "description": "How many times this API has been called without all types selected." } }, + "apiCalls.legacyDashboardImport.total": { + "type": "long", + "_meta": { + "description": "How many times this API has been called." + } + }, + "apiCalls.legacyDashboardImport.namespace.default.total": { + "type": "long", + "_meta": { + "description": "How many times this API has been called in the Default space." + } + }, + "apiCalls.legacyDashboardImport.namespace.default.kibanaRequest.yes": { + "type": "long", + "_meta": { + "description": "How many times this API has been called by the Kibana client in the Default space." + } + }, + "apiCalls.legacyDashboardImport.namespace.default.kibanaRequest.no": { + "type": "long", + "_meta": { + "description": "How many times this API has been called by a non-Kibana client in the Default space." + } + }, + "apiCalls.legacyDashboardImport.namespace.custom.total": { + "type": "long", + "_meta": { + "description": "How many times this API has been called in a custom space." + } + }, + "apiCalls.legacyDashboardImport.namespace.custom.kibanaRequest.yes": { + "type": "long", + "_meta": { + "description": "How many times this API has been called by the Kibana client in a custom space." + } + }, + "apiCalls.legacyDashboardImport.namespace.custom.kibanaRequest.no": { + "type": "long", + "_meta": { + "description": "How many times this API has been called by a non-Kibana client in a custom space." + } + }, "savedObjectsRepository.resolvedOutcome.exactMatch": { "type": "long", "_meta": { @@ -6928,6 +6881,12 @@ "description": "The process id of the monitored kibana instance." } }, + "instanceUuid": { + "type": "keyword", + "_meta": { + "description": "The uuid of the kibana instance." + } + }, "fromTimestamp": { "type": "date", "_meta": { @@ -7115,12 +7074,6 @@ "description": "Non-default value of setting." } }, - "visualization:dimmingOpacity": { - "type": "float", - "_meta": { - "description": "Non-default value of setting." - } - }, "visualization:tileMap:maxPrecision": { "type": "long", "_meta": { @@ -7169,30 +7122,12 @@ "description": "Non-default value of setting." } }, - "timelion:default_rows": { - "type": "long", - "_meta": { - "description": "Non-default value of setting." - } - }, - "timelion:default_columns": { - "type": "long", - "_meta": { - "description": "Non-default value of setting." - } - }, "timelion:es.default_index": { "type": "keyword", "_meta": { "description": "Non-default value of setting." } }, - "timelion:showTutorial": { - "type": "boolean", - "_meta": { - "description": "Non-default value of setting." - } - }, "securitySolution:timeDefaults": { "type": "keyword", "_meta": { @@ -7616,12 +7551,6 @@ "description": "Non-default value of setting." } }, - "visualization:visualize:legacyChartsLibrary": { - "type": "boolean", - "_meta": { - "description": "Non-default value of setting." - } - }, "visualization:visualize:legacyPieChartsLibrary": { "type": "boolean", "_meta": { @@ -7777,16 +7706,6 @@ } } } - }, - "timelion_sheet": { - "properties": { - "total": { - "type": "long", - "_meta": { - "description": "Total number of timelion_sheet saved objects" - } - } - } } } }, @@ -8318,25 +8237,6 @@ } } }, - "timelion": { - "type": "array", - "items": { - "properties": { - "key": { - "type": "keyword", - "_meta": { - "description": "The event that is tracked" - } - }, - "value": { - "type": "long", - "_meta": { - "description": "The value of the event" - } - } - } - } - }, "csm": { "type": "array", "items": { diff --git a/src/plugins/telemetry/schema/oss_root.json b/src/plugins/telemetry/schema/oss_root.json index c4dd1096a6e98..3748485465cc0 100644 --- a/src/plugins/telemetry/schema/oss_root.json +++ b/src/plugins/telemetry/schema/oss_root.json @@ -64,13 +64,6 @@ }, "kibana": { "properties": { - "timelion_sheet": { - "properties": { - "total": { - "type": "long" - } - } - }, "visualization": { "properties": { "total": { diff --git a/src/plugins/telemetry_collection_manager/jest.config.js b/src/plugins/telemetry_collection_manager/jest.config.js index f9615de4ab60a..7f58aa46cabf2 100644 --- a/src/plugins/telemetry_collection_manager/jest.config.js +++ b/src/plugins/telemetry_collection_manager/jest.config.js @@ -10,4 +10,10 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/telemetry_collection_manager'], + coverageDirectory: + '/target/kibana-coverage/jest/src/plugins/telemetry_collection_manager', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/telemetry_collection_manager/{common,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/telemetry_management_section/jest.config.js b/src/plugins/telemetry_management_section/jest.config.js index e1001bc787589..722496905de9e 100644 --- a/src/plugins/telemetry_management_section/jest.config.js +++ b/src/plugins/telemetry_management_section/jest.config.js @@ -10,4 +10,8 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/telemetry_management_section'], + coverageDirectory: + '/target/kibana-coverage/jest/src/plugins/telemetry_management_section', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/telemetry_management_section/public/**/*.{ts,tsx}'], }; diff --git a/src/plugins/timelion/README.md b/src/plugins/timelion/README.md deleted file mode 100644 index d29a33028e967..0000000000000 --- a/src/plugins/timelion/README.md +++ /dev/null @@ -1,2 +0,0 @@ -Contains the deprecated timelion application. For the timelion visualization, -which also contains the timelion APIs and backend, look at the vis_type_timelion plugin. diff --git a/src/plugins/timelion/kibana.json b/src/plugins/timelion/kibana.json deleted file mode 100644 index 4d48462a1ed6a..0000000000000 --- a/src/plugins/timelion/kibana.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "id": "timelion", - "version": "kibana", - "ui": true, - "server": true, - "requiredBundles": [ - "kibanaLegacy", - "kibanaUtils", - "visTypeTimelion" - ], - "requiredPlugins": [ - "visualizations", - "data", - "navigation", - "visTypeTimelion", - "savedObjects", - "kibanaLegacy" - ], - "owner": { - "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" - } -} diff --git a/src/plugins/timelion/public/_app.scss b/src/plugins/timelion/public/_app.scss deleted file mode 100644 index d8a6eb423a670..0000000000000 --- a/src/plugins/timelion/public/_app.scss +++ /dev/null @@ -1,83 +0,0 @@ -.timApp { - position: relative; - background: $euiColorEmptyShade; - - [ng-click] { - cursor: pointer; - } -} - -.timApp__container { - margin: $euiSizeM; -} - -.timApp__menus { - margin: $euiSizeM; -} - -.timApp__title { - display: flex; - align-items: center; - padding: $euiSizeM $euiSizeS; - font-size: $euiSize; - font-weight: $euiFontWeightBold; - border-bottom: 1px solid $euiColorLightShade; - flex-grow: 1; - background-color: $euiColorEmptyShade; -} - -.timApp__stats { - font-weight: $euiFontWeightRegular; - color: $euiColorMediumShade; -} - -.timApp__form { - display: flex; - align-items: flex-start; - margin-top: $euiSize; - margin-bottom: $euiSize; -} - -.timApp__expression { - display: flex; - flex: 1; - margin-right: $euiSizeS; -} - -.timApp__button { - margin-top: $euiSizeS; - padding: $euiSizeXS $euiSizeM; - font-size: $euiSize; - border: none; - border-radius: $euiSizeXS; - color: $euiColorEmptyShade; - background-color: $euiColorPrimary; -} - -.timApp__button--secondary { - margin-top: $euiSizeS; - padding: $euiSizeXS $euiSizeM; - font-size: $euiSize; - border: 1px solid $euiColorPrimary; - border-radius: $euiSizeXS; - color: $euiColorPrimary; - width: 100%; -} - -.timApp__sectionTitle { - margin-bottom: $euiSizeM; - font-size: 18px; - color: $euiColorDarkestShade; -} - -.timApp__helpText { - margin-bottom: $euiSize; - font-size: 14px; - color: $euiColorDarkShade; -} - -.timApp__label { - font-size: $euiSize; - line-height: 1.5; - font-weight: $euiFontWeightBold; -} diff --git a/src/plugins/timelion/public/_base.scss b/src/plugins/timelion/public/_base.scss deleted file mode 100644 index e71196a2e6df9..0000000000000 --- a/src/plugins/timelion/public/_base.scss +++ /dev/null @@ -1,18 +0,0 @@ -// Angular form states -.ng-invalid { - &.ng-dirty, - &.ng-touched { - border-color: $euiColorDanger; - } -} - -input[type='radio'], -input[type='checkbox'], -.radio, -.checkbox { - &[disabled], - fieldset[disabled] & { - cursor: default; - opacity: .8; - } -} diff --git a/src/plugins/timelion/public/app.js b/src/plugins/timelion/public/app.js deleted file mode 100644 index 4a4b2be679dd3..0000000000000 --- a/src/plugins/timelion/public/app.js +++ /dev/null @@ -1,655 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import _ from 'lodash'; - -import { i18n } from '@kbn/i18n'; - -import { createHashHistory } from 'history'; - -import { createKbnUrlStateStorage, withNotifyOnErrors } from '../../kibana_utils/public'; -import { syncQueryStateWithUrl } from '../../data/public'; - -import { getSavedSheetBreadcrumbs, getCreateBreadcrumbs } from './breadcrumbs'; -import { - addFatalError, - registerListenEventListener, - watchMultiDecorator, -} from '../../kibana_legacy/public'; -import { _LEGACY_ as visTypeTimelion } from '../../vis_type_timelion/public'; -import { initCellsDirective } from './directives/cells/cells'; -import { initFullscreenDirective } from './directives/fullscreen/fullscreen'; -import { initFixedElementDirective } from './directives/fixed_element'; -import { initTimelionLoadSheetDirective } from './directives/timelion_load_sheet'; -import { initTimelionHelpDirective } from './directives/timelion_help/timelion_help'; -import { initTimelionSaveSheetDirective } from './directives/timelion_save_sheet'; -import { initTimelionOptionsSheetDirective } from './directives/timelion_options_sheet'; -import { initSavedObjectSaveAsCheckBoxDirective } from './directives/saved_object_save_as_checkbox'; -import { initSavedObjectFinderDirective } from './directives/saved_object_finder'; -import { initTimelionTabsDirective } from './components/timelionhelp_tabs_directive'; -import { initTimelionTDeprecationDirective } from './components/timelion_deprecation_directive'; -import { initTimelionTopNavDirective } from './components/timelion_top_nav_directive'; -import { initInputFocusDirective } from './directives/input_focus'; -import { Chart } from './directives/chart/chart'; -import { TimelionInterval } from './directives/timelion_interval/timelion_interval'; -import { timelionExpInput } from './directives/timelion_expression_input'; -import { TimelionExpressionSuggestions } from './directives/timelion_expression_suggestions/timelion_expression_suggestions'; -import { initSavedSheetService } from './services/saved_sheets'; -import { initTimelionAppState } from './timelion_app_state'; - -import rootTemplate from './index.html'; - -export function initTimelionApp(app, deps) { - app.run(registerListenEventListener); - - const savedSheetLoader = initSavedSheetService(app, deps); - - app.factory('history', () => createHashHistory()); - app.factory('kbnUrlStateStorage', (history) => - createKbnUrlStateStorage({ - history, - useHash: deps.core.uiSettings.get('state:storeInSessionStorage'), - ...withNotifyOnErrors(deps.core.notifications.toasts), - }) - ); - app.config(watchMultiDecorator); - - app - .controller('TimelionVisController', function ($scope) { - $scope.$on('timelionChartRendered', (event) => { - event.stopPropagation(); - $scope.renderComplete(); - }); - }) - .constant('timelionPanels', deps.timelionPanels) - .directive('chart', Chart) - .directive('timelionInterval', TimelionInterval) - .directive('timelionExpressionSuggestions', TimelionExpressionSuggestions) - .directive('timelionExpressionInput', timelionExpInput(deps)); - - initTimelionHelpDirective(app); - initInputFocusDirective(app); - initTimelionTabsDirective(app, deps); - initTimelionTDeprecationDirective(app, deps); - initTimelionTopNavDirective(app, deps); - initSavedObjectFinderDirective(app, savedSheetLoader, deps.core.uiSettings); - initSavedObjectSaveAsCheckBoxDirective(app); - initCellsDirective(app); - initFixedElementDirective(app); - initFullscreenDirective(app); - initTimelionSaveSheetDirective(app); - initTimelionLoadSheetDirective(app); - initTimelionOptionsSheetDirective(app); - - const location = 'Timelion'; - - app.directive('timelionApp', function () { - return { - restrict: 'E', - controllerAs: 'timelionApp', - controller: timelionController, - }; - }); - - function timelionController( - $http, - $route, - $routeParams, - $scope, - $timeout, - history, - kbnUrlStateStorage - ) { - // Keeping this at app scope allows us to keep the current page when the user - // switches to say, the timepicker. - $scope.page = deps.core.uiSettings.get('timelion:showTutorial', true) ? 1 : 0; - $scope.setPage = (page) => ($scope.page = page); - const timefilter = deps.plugins.data.query.timefilter.timefilter; - - timefilter.enableAutoRefreshSelector(); - timefilter.enableTimeRangeSelector(); - - deps.core.chrome.docTitle.change('Timelion - Kibana'); - - // starts syncing `_g` portion of url with query services - const { stop: stopSyncingQueryServiceStateWithUrl } = syncQueryStateWithUrl( - deps.plugins.data.query, - kbnUrlStateStorage - ); - - const savedSheet = $route.current.locals.savedSheet; - - function getStateDefaults() { - return { - sheet: savedSheet.timelion_sheet, - selected: 0, - columns: savedSheet.timelion_columns, - rows: savedSheet.timelion_rows, - interval: savedSheet.timelion_interval, - }; - } - - const { stateContainer, stopStateSync } = initTimelionAppState({ - stateDefaults: getStateDefaults(), - kbnUrlStateStorage, - }); - - $scope.state = _.cloneDeep(stateContainer.getState()); - $scope.expression = _.clone($scope.state.sheet[$scope.state.selected]); - $scope.updatedSheets = []; - - const savedVisualizations = deps.plugins.visualizations.savedVisualizationsLoader; - const timezone = visTypeTimelion.getTimezone(deps.core.uiSettings); - - const defaultExpression = '.es(*)'; - - $scope.topNavMenu = getTopNavMenu(); - - $timeout(function () { - if (deps.core.uiSettings.get('timelion:showTutorial', true)) { - $scope.toggleMenu('showHelp'); - } - }, 0); - - $scope.transient = {}; - - function getTopNavMenu() { - const newSheetAction = { - id: 'new', - label: i18n.translate('timelion.topNavMenu.newSheetButtonLabel', { - defaultMessage: 'New', - }), - description: i18n.translate('timelion.topNavMenu.newSheetButtonAriaLabel', { - defaultMessage: 'New Sheet', - }), - run: function () { - history.push('/'); - $route.reload(); - }, - testId: 'timelionNewButton', - }; - - const addSheetAction = { - id: 'add', - label: i18n.translate('timelion.topNavMenu.addChartButtonLabel', { - defaultMessage: 'Add', - }), - description: i18n.translate('timelion.topNavMenu.addChartButtonAriaLabel', { - defaultMessage: 'Add a chart', - }), - run: function () { - $scope.$evalAsync(() => $scope.newCell()); - }, - testId: 'timelionAddChartButton', - }; - - const saveSheetAction = { - id: 'save', - label: i18n.translate('timelion.topNavMenu.saveSheetButtonLabel', { - defaultMessage: 'Save', - }), - description: i18n.translate('timelion.topNavMenu.saveSheetButtonAriaLabel', { - defaultMessage: 'Save Sheet', - }), - run: () => { - $scope.$evalAsync(() => $scope.toggleMenu('showSave')); - }, - testId: 'timelionSaveButton', - }; - - const deleteSheetAction = { - id: 'delete', - label: i18n.translate('timelion.topNavMenu.deleteSheetButtonLabel', { - defaultMessage: 'Delete', - }), - description: i18n.translate('timelion.topNavMenu.deleteSheetButtonAriaLabel', { - defaultMessage: 'Delete current sheet', - }), - disableButton: function () { - return !savedSheet.id; - }, - run: function () { - const title = savedSheet.title; - function doDelete() { - savedSheet - .delete() - .then(() => { - deps.core.notifications.toasts.addSuccess( - i18n.translate('timelion.topNavMenu.delete.modal.successNotificationText', { - defaultMessage: `Deleted '{title}'`, - values: { title }, - }) - ); - history.push('/'); - }) - .catch((error) => addFatalError(deps.core.fatalErrors, error, location)); - } - - const confirmModalOptions = { - confirmButtonText: i18n.translate( - 'timelion.topNavMenu.delete.modal.confirmButtonLabel', - { - defaultMessage: 'Delete', - } - ), - title: i18n.translate('timelion.topNavMenu.delete.modalTitle', { - defaultMessage: `Delete Timelion sheet '{title}'?`, - values: { title }, - }), - }; - - $scope.$evalAsync(() => { - deps.core.overlays - .openConfirm( - i18n.translate('timelion.topNavMenu.delete.modal.warningText', { - defaultMessage: `You can't recover deleted sheets.`, - }), - confirmModalOptions - ) - .then((isConfirmed) => { - if (isConfirmed) { - doDelete(); - } - }); - }); - }, - testId: 'timelionDeleteButton', - }; - - const openSheetAction = { - id: 'open', - label: i18n.translate('timelion.topNavMenu.openSheetButtonLabel', { - defaultMessage: 'Open', - }), - description: i18n.translate('timelion.topNavMenu.openSheetButtonAriaLabel', { - defaultMessage: 'Open Sheet', - }), - run: () => { - $scope.$evalAsync(() => $scope.toggleMenu('showLoad')); - }, - testId: 'timelionOpenButton', - }; - - const optionsAction = { - id: 'options', - label: i18n.translate('timelion.topNavMenu.optionsButtonLabel', { - defaultMessage: 'Options', - }), - description: i18n.translate('timelion.topNavMenu.optionsButtonAriaLabel', { - defaultMessage: 'Options', - }), - run: () => { - $scope.$evalAsync(() => $scope.toggleMenu('showOptions')); - }, - testId: 'timelionOptionsButton', - }; - - const helpAction = { - id: 'help', - label: i18n.translate('timelion.topNavMenu.helpButtonLabel', { - defaultMessage: 'Help', - }), - description: i18n.translate('timelion.topNavMenu.helpButtonAriaLabel', { - defaultMessage: 'Help', - }), - run: () => { - $scope.$evalAsync(() => $scope.toggleMenu('showHelp')); - }, - testId: 'timelionDocsButton', - }; - - if (deps.core.application.capabilities.timelion.save) { - return [ - newSheetAction, - addSheetAction, - saveSheetAction, - deleteSheetAction, - openSheetAction, - optionsAction, - helpAction, - ]; - } - return [newSheetAction, addSheetAction, openSheetAction, optionsAction, helpAction]; - } - - let refresher; - const setRefreshData = function () { - if (refresher) $timeout.cancel(refresher); - const interval = timefilter.getRefreshInterval(); - if (interval.value > 0 && !interval.pause) { - function startRefresh() { - refresher = $timeout(function () { - if (!$scope.running) $scope.search(); - startRefresh(); - }, interval.value); - } - startRefresh(); - } - }; - - const init = function () { - $scope.running = false; - $scope.search(); - setRefreshData(); - - $scope.model = { - timeRange: timefilter.getTime(), - refreshInterval: timefilter.getRefreshInterval(), - }; - - const unsubscribeStateUpdates = stateContainer.subscribe((state) => { - const clonedState = _.cloneDeep(state); - $scope.updatedSheets.forEach((updatedSheet) => { - clonedState.sheet[updatedSheet.id] = updatedSheet.expression; - }); - $scope.state = clonedState; - $scope.opts.state = clonedState; - $scope.expression = _.clone($scope.state.sheet[$scope.state.selected]); - $scope.search(); - }); - - timefilter.getFetch$().subscribe($scope.search); - - $scope.opts = { - saveExpression: saveExpression, - saveSheet: saveSheet, - savedSheet: savedSheet, - state: _.cloneDeep(stateContainer.getState()), - search: $scope.search, - dontShowHelp: function () { - deps.core.uiSettings.set('timelion:showTutorial', false); - $scope.setPage(0); - $scope.closeMenus(); - }, - }; - - $scope.$watch('opts.state.rows', function (newRow) { - const state = stateContainer.getState(); - if (state.rows !== newRow) { - stateContainer.transitions.set('rows', newRow); - } - }); - - $scope.$watch('opts.state.columns', function (newColumn) { - const state = stateContainer.getState(); - if (state.columns !== newColumn) { - stateContainer.transitions.set('columns', newColumn); - } - }); - - $scope.menus = { - showHelp: false, - showSave: false, - showLoad: false, - showOptions: false, - }; - - $scope.toggleMenu = (menuName) => { - const curState = $scope.menus[menuName]; - $scope.closeMenus(); - $scope.menus[menuName] = !curState; - }; - - $scope.closeMenus = () => { - _.forOwn($scope.menus, function (value, key) { - $scope.menus[key] = false; - }); - }; - - $scope.$on('$destroy', () => { - stopSyncingQueryServiceStateWithUrl(); - unsubscribeStateUpdates(); - stopStateSync(); - }); - }; - - $scope.onTimeUpdate = function ({ dateRange }) { - $scope.model.timeRange = { - ...dateRange, - }; - timefilter.setTime(dateRange); - if (!$scope.running) $scope.search(); - }; - - $scope.onRefreshChange = function ({ isPaused, refreshInterval }) { - $scope.model.refreshInterval = { - pause: isPaused, - value: refreshInterval, - }; - timefilter.setRefreshInterval({ - pause: isPaused, - value: refreshInterval ? refreshInterval : $scope.refreshInterval.value, - }); - - setRefreshData(); - }; - - $scope.$watch( - function () { - return savedSheet.lastSavedTitle; - }, - function (newTitle) { - if (savedSheet.id && newTitle) { - deps.core.chrome.docTitle.change(newTitle); - } - } - ); - - $scope.$watch('expression', function (newExpression) { - const state = stateContainer.getState(); - if (state.sheet[state.selected] !== newExpression) { - const updatedSheet = $scope.updatedSheets.find( - (updatedSheet) => updatedSheet.id === state.selected - ); - if (updatedSheet) { - updatedSheet.expression = newExpression; - } else { - $scope.updatedSheets.push({ - id: state.selected, - expression: newExpression, - }); - } - } - }); - - $scope.toggle = function (property) { - $scope[property] = !$scope[property]; - }; - - $scope.changeInterval = function (interval) { - $scope.currentInterval = interval; - }; - - $scope.updateChart = function () { - const state = stateContainer.getState(); - const newSheet = _.clone(state.sheet); - if ($scope.updatedSheets.length) { - $scope.updatedSheets.forEach((updatedSheet) => { - newSheet[updatedSheet.id] = updatedSheet.expression; - }); - $scope.updatedSheets = []; - } - stateContainer.transitions.updateState({ - interval: $scope.currentInterval ? $scope.currentInterval : state.interval, - sheet: newSheet, - }); - }; - - $scope.newSheet = function () { - history.push('/'); - }; - - $scope.removeSheet = function (removedIndex) { - const state = stateContainer.getState(); - const newSheet = state.sheet.filter((el, index) => index !== removedIndex); - $scope.updatedSheets = $scope.updatedSheets.filter((el) => el.id !== removedIndex); - stateContainer.transitions.updateState({ - sheet: newSheet, - selected: removedIndex ? removedIndex - 1 : removedIndex, - }); - }; - - $scope.newCell = function () { - const state = stateContainer.getState(); - const newSheet = [...state.sheet, defaultExpression]; - stateContainer.transitions.updateState({ sheet: newSheet, selected: newSheet.length - 1 }); - }; - - $scope.setActiveCell = function (cell) { - const state = stateContainer.getState(); - if (state.selected !== cell) { - stateContainer.transitions.updateState({ sheet: $scope.state.sheet, selected: cell }); - } - }; - - $scope.search = function () { - $scope.running = true; - const state = stateContainer.getState(); - - // parse the time range client side to make sure it behaves like other charts - const timeRangeBounds = timefilter.getBounds(); - - const httpResult = $http - .post('../api/timelion/run', { - sheet: state.sheet, - time: _.assignIn( - { - from: timeRangeBounds.min, - to: timeRangeBounds.max, - }, - { - interval: state.interval, - timezone: timezone, - } - ), - }) - .then((resp) => resp.data) - .catch((resp) => { - throw resp.data; - }); - - httpResult - .then(function (resp) { - $scope.stats = resp.stats; - $scope.sheet = resp.sheet; - _.forEach(resp.sheet, function (cell) { - if (cell.exception && cell.plot !== state.selected) { - stateContainer.transitions.set('selected', cell.plot); - } - }); - $scope.running = false; - }) - .catch(function (resp) { - $scope.sheet = []; - $scope.running = false; - - const err = new Error(resp.message); - err.stack = resp.stack; - deps.core.notifications.toasts.addError(err, { - title: i18n.translate('timelion.searchErrorTitle', { - defaultMessage: 'Timelion request error', - }), - }); - }); - }; - - $scope.safeSearch = _.debounce($scope.search, 500); - - function saveSheet() { - const state = stateContainer.getState(); - savedSheet.timelion_sheet = state.sheet; - savedSheet.timelion_interval = state.interval; - savedSheet.timelion_columns = state.columns; - savedSheet.timelion_rows = state.rows; - savedSheet.save().then(function (id) { - if (id) { - deps.core.notifications.toasts.addSuccess({ - title: i18n.translate('timelion.saveSheet.successNotificationText', { - defaultMessage: `Saved sheet '{title}'`, - values: { title: savedSheet.title }, - }), - 'data-test-subj': 'timelionSaveSuccessToast', - }); - - if (savedSheet.id !== $routeParams.id) { - history.push(`/${savedSheet.id}`); - } - } - }); - } - - async function saveExpression(title) { - const vis = await deps.plugins.visualizations.createVis('timelion', { - title, - params: { - expression: $scope.state.sheet[$scope.state.selected], - interval: $scope.state.interval, - }, - }); - const state = deps.plugins.visualizations.convertFromSerializedVis(vis.serialize()); - const visSavedObject = await savedVisualizations.get(); - Object.assign(visSavedObject, state); - const id = await visSavedObject.save(); - if (id) { - deps.core.notifications.toasts.addSuccess( - i18n.translate('timelion.saveExpression.successNotificationText', { - defaultMessage: `Saved expression '{title}'`, - values: { title: state.title }, - }) - ); - } - } - - init(); - } - - app.config(function ($routeProvider) { - $routeProvider - .when('/:id?', { - template: rootTemplate, - reloadOnSearch: false, - k7Breadcrumbs: ($injector, $route) => - $injector.invoke( - $route.current.params.id ? getSavedSheetBreadcrumbs : getCreateBreadcrumbs - ), - badge: () => { - if (deps.core.application.capabilities.timelion.save) { - return undefined; - } - - return { - text: i18n.translate('timelion.badge.readOnly.text', { - defaultMessage: 'Read only', - }), - tooltip: i18n.translate('timelion.badge.readOnly.tooltip', { - defaultMessage: 'Unable to save Timelion sheets', - }), - iconType: 'glasses', - }; - }, - resolve: { - savedSheet: function (savedSheets, $route) { - return savedSheets - .get($route.current.params.id) - .then((savedSheet) => { - if ($route.current.params.id) { - deps.core.chrome.recentlyAccessed.add( - savedSheet.getFullPath(), - savedSheet.title, - savedSheet.id - ); - } - return savedSheet; - }) - .catch(); - }, - }, - }) - .otherwise('/'); - }); -} diff --git a/src/plugins/timelion/public/application.ts b/src/plugins/timelion/public/application.ts deleted file mode 100644 index 1e3cf43f62655..0000000000000 --- a/src/plugins/timelion/public/application.ts +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import './index.scss'; - -import { EuiIcon } from '@elastic/eui'; -import angular, { IModule } from 'angular'; -// required for `ngSanitize` angular module -import 'angular-sanitize'; -// required for ngRoute -import 'angular-route'; -import 'angular-sortable-view'; -import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular'; -import { - IUiSettingsClient, - CoreStart, - PluginInitializerContext, - AppMountParameters, -} from 'kibana/public'; -import { getTimeChart } from './panels/timechart/timechart'; -import { Panel } from './panels/panel'; - -import { configureAppAngularModule } from '../../kibana_legacy/public'; -import { TimelionPluginStartDependencies } from './plugin'; -import { DataPublicPluginStart } from '../../data/public'; -// @ts-ignore -import { initTimelionApp } from './app'; - -export interface RenderDeps { - pluginInitializerContext: PluginInitializerContext; - mountParams: AppMountParameters; - core: CoreStart; - plugins: TimelionPluginStartDependencies; - timelionPanels: Map; -} - -export interface TimelionVisualizationDependencies { - uiSettings: IUiSettingsClient; - timelionPanels: Map; - data: DataPublicPluginStart; - $rootScope: any; - $compile: any; -} - -let angularModuleInstance: IModule | null = null; - -export const renderApp = (deps: RenderDeps) => { - if (!angularModuleInstance) { - angularModuleInstance = createLocalAngularModule(deps); - // global routing stuff - configureAppAngularModule( - angularModuleInstance, - { core: deps.core, env: deps.pluginInitializerContext.env }, - true - ); - initTimelionApp(angularModuleInstance, deps); - } - - const $injector = mountTimelionApp(deps.mountParams.appBasePath, deps.mountParams.element, deps); - - return () => { - $injector.get('$rootScope').$destroy(); - }; -}; - -function registerPanels(dependencies: TimelionVisualizationDependencies) { - const timeChartPanel: Panel = getTimeChart(dependencies); - - dependencies.timelionPanels.set(timeChartPanel.name, timeChartPanel); -} - -const mainTemplate = (basePath: string) => `

- -
`; - -const moduleName = 'app/timelion'; - -const thirdPartyAngularDependencies = ['ngSanitize', 'ngRoute', 'react', 'angular-sortable-view']; - -function mountTimelionApp(appBasePath: string, element: HTMLElement, deps: RenderDeps) { - const mountpoint = document.createElement('div'); - mountpoint.setAttribute('class', 'timelionAppContainer'); - // eslint-disable-next-line no-unsanitized/property - mountpoint.innerHTML = mainTemplate(appBasePath); - // bootstrap angular into detached element and attach it later to - // make angular-within-angular possible - const $injector = angular.bootstrap(mountpoint, [moduleName]); - - registerPanels({ - uiSettings: deps.core.uiSettings, - timelionPanels: deps.timelionPanels, - data: deps.plugins.data, - $rootScope: $injector.get('$rootScope'), - $compile: $injector.get('$compile'), - }); - element.appendChild(mountpoint); - return $injector; -} - -function createLocalAngularModule(deps: RenderDeps) { - createLocalI18nModule(); - createLocalIconModule(); - - const dashboardAngularModule = angular.module(moduleName, [ - ...thirdPartyAngularDependencies, - 'app/timelion/I18n', - 'app/timelion/icon', - ]); - return dashboardAngularModule; -} - -function createLocalIconModule() { - angular - .module('app/timelion/icon', ['react']) - .directive('icon', (reactDirective) => reactDirective(EuiIcon)); -} - -function createLocalI18nModule() { - angular - .module('app/timelion/I18n', []) - .provider('i18n', I18nProvider) - .filter('i18n', i18nFilter) - .directive('i18nId', i18nDirective); -} diff --git a/src/plugins/timelion/public/breadcrumbs.js b/src/plugins/timelion/public/breadcrumbs.js deleted file mode 100644 index aff173823946b..0000000000000 --- a/src/plugins/timelion/public/breadcrumbs.js +++ /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 { i18n } from '@kbn/i18n'; - -const ROOT_BREADCRUMB = { - text: i18n.translate('timelion.breadcrumbs.root', { - defaultMessage: 'Timelion', - }), - href: '#', -}; - -export function getCreateBreadcrumbs() { - return [ - ROOT_BREADCRUMB, - { - text: i18n.translate('timelion.breadcrumbs.create', { - defaultMessage: 'Create', - }), - }, - ]; -} - -export function getSavedSheetBreadcrumbs($route) { - const { savedSheet } = $route.current.locals; - return [ - ROOT_BREADCRUMB, - { - text: savedSheet.title, - }, - ]; -} diff --git a/src/plugins/timelion/public/components/timelion_deprecation.tsx b/src/plugins/timelion/public/components/timelion_deprecation.tsx deleted file mode 100644 index 117aabed6773c..0000000000000 --- a/src/plugins/timelion/public/components/timelion_deprecation.tsx +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiSpacer, EuiCallOut, EuiLink } from '@elastic/eui'; -import React from 'react'; -import { DocLinksStart } from '../../../../core/public'; - -export const TimelionDeprecation = ({ links }: DocLinksStart) => { - const timelionDeprecationLink = links.visualize.timelionDeprecation; - return ( - <> - - - - ), - }} - /> - } - color="warning" - iconType="alert" - size="s" - /> - - - ); -}; diff --git a/src/plugins/timelion/public/components/timelion_deprecation_directive.js b/src/plugins/timelion/public/components/timelion_deprecation_directive.js deleted file mode 100644 index 2aeea00991864..0000000000000 --- a/src/plugins/timelion/public/components/timelion_deprecation_directive.js +++ /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 React from 'react'; -import { TimelionDeprecation } from './timelion_deprecation'; - -export function initTimelionTDeprecationDirective(app, deps) { - app.directive('timelionDeprecation', function (reactDirective) { - return reactDirective( - () => { - return ( - - - - ); - }, - [], - { - restrict: 'E', - scope: { - docLinks: '=', - }, - } - ); - }); -} diff --git a/src/plugins/timelion/public/components/timelion_top_nav_directive.js b/src/plugins/timelion/public/components/timelion_top_nav_directive.js deleted file mode 100644 index 4ec3b40e47c52..0000000000000 --- a/src/plugins/timelion/public/components/timelion_top_nav_directive.js +++ /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 React from 'react'; - -export function initTimelionTopNavDirective(app, deps) { - app.directive('timelionTopNav', function (reactDirective) { - return reactDirective( - (props) => { - const { TopNavMenu } = deps.plugins.navigation.ui; - return ( - - - - ); - }, - [ - ['topNavMenu', { watchDepth: 'reference' }], - ['onTimeUpdate', { watchDepth: 'reference' }], - ], - { - restrict: 'E', - scope: { - topNavMenu: '=', - onTimeUpdate: '=', - }, - } - ); - }); -} diff --git a/src/plugins/timelion/public/components/timelionhelp_tabs.js b/src/plugins/timelion/public/components/timelionhelp_tabs.js deleted file mode 100644 index 537e1bfa393b7..0000000000000 --- a/src/plugins/timelion/public/components/timelionhelp_tabs.js +++ /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 PropTypes from 'prop-types'; -import React from 'react'; - -import { EuiTabs, EuiTab } from '@elastic/eui'; - -import { FormattedMessage } from '@kbn/i18n/react'; - -function handleClick(activateTab, tabName) { - activateTab(tabName); -} - -export function TimelionHelpTabs(props) { - return ( - - handleClick(props.activateTab, 'funcref')} - > - - - handleClick(props.activateTab, 'keyboardtips')} - > - - - - ); -} - -TimelionHelpTabs.propTypes = { - activeTab: PropTypes.string, - activateTab: PropTypes.func, -}; diff --git a/src/plugins/timelion/public/components/timelionhelp_tabs_directive.js b/src/plugins/timelion/public/components/timelionhelp_tabs_directive.js deleted file mode 100644 index a88e156cb5c51..0000000000000 --- a/src/plugins/timelion/public/components/timelionhelp_tabs_directive.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { TimelionHelpTabs } from './timelionhelp_tabs'; - -export function initTimelionTabsDirective(app, deps) { - app.directive('timelionHelpTabs', function (reactDirective) { - return reactDirective( - (props) => { - return ( - - - - ); - }, - [['activeTab'], ['activateTab', { watchDepth: 'reference' }]], - { - restrict: 'E', - scope: { - activeTab: '=', - activateTab: '=', - }, - } - ); - }); -} diff --git a/src/plugins/timelion/public/directives/_form.scss b/src/plugins/timelion/public/directives/_form.scss deleted file mode 100644 index 37a0cc4c0f3e5..0000000000000 --- a/src/plugins/timelion/public/directives/_form.scss +++ /dev/null @@ -1,83 +0,0 @@ -.form-control { - @include euiFontSizeS; - display: block; - width: 100%; - height: $euiFormControlCompressedHeight; - padding: $euiSizeXS $euiSizeM; - border: $euiBorderThin; - background-color: $euiFormBackgroundColor; - color: $euiTextColor; - border-radius: $euiBorderRadius; - cursor: pointer; - - &:not([type='range']) { - appearance: none; - } - - &:focus { - border-color: $euiColorPrimary; - outline: none; - box-shadow: none; - } -} - -select.form-control { // stylelint-disable-line selector-no-qualifying-type - // Makes the select arrow similar to EUI's arrowDown icon - background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"%3E%3Cpath fill="#{hexToRGB($euiTextColor)}" d="M13.0688508,5.15725038 L8.38423975,9.76827428 C8.17054415,9.97861308 7.82999214,9.97914095 7.61576025,9.76827428 L2.93114915,5.15725038 C2.7181359,4.94758321 2.37277319,4.94758321 2.15975994,5.15725038 C1.94674669,5.36691756 1.94674669,5.70685522 2.15975994,5.9165224 L6.84437104,10.5275463 C7.48517424,11.1582836 8.51644979,11.1566851 9.15562896,10.5275463 L13.8402401,5.9165224 C14.0532533,5.70685522 14.0532533,5.36691756 13.8402401,5.15725038 C13.6272268,4.94758321 13.2818641,4.94758321 13.0688508,5.15725038 Z"/%3E%3C/svg%3E'); - background-size: $euiSize; - background-repeat: no-repeat; - background-position: calc(100% - #{$euiSizeS}); - padding-right: $euiSizeXL; -} - -.fullWidth { - width: 100%; -} - -.timDropdownWarning { - margin-bottom: $euiSize; - padding: $euiSizeXS $euiSizeS; - color: $euiColorDarkestShade; - border-left: solid 2px $euiColorDanger; - font-size: $euiSizeM; -} - -.timFormCheckbox { - display: flex; - align-items: center; - line-height: 1.5; - position: relative; -} - -.timFormCheckbox__input { - appearance: none; - background-color: $euiColorLightestShade; - border: 1px solid $euiColorLightShade; - border-radius: $euiSizeXS; - width: $euiSize; - height: $euiSize; - font-size: $euiSizeM; - transition: background-color .1s linear; -} - -.timFormCheckbox__input:checked { - border-color: $euiColorPrimary; - background-color: $euiColorPrimary; -} - -.timFormCheckbox__icon { - position: absolute; - top: 0; - left: 2px; -} - -.timFormTextarea { - padding: $euiSizeXS $euiSizeM; - font-size: $euiSize; - line-height: 1.5; - color: $euiColorDarkestShade; - background-color: $euiFormBackgroundColor; - border: 1px solid $euiColorLightShade; - border-radius: $euiSizeXS; - transition: border-color .1s linear; -} diff --git a/src/plugins/timelion/public/directives/_index.scss b/src/plugins/timelion/public/directives/_index.scss deleted file mode 100644 index 2a015711062a6..0000000000000 --- a/src/plugins/timelion/public/directives/_index.scss +++ /dev/null @@ -1,7 +0,0 @@ -@import './timelion_expression_input'; -@import './cells/index'; -@import './timelion_expression_suggestions/index'; -@import './timelion_help/index'; -@import './timelion_interval/index'; -@import './saved_object_finder'; -@import './form'; diff --git a/src/plugins/timelion/public/directives/_saved_object_finder.scss b/src/plugins/timelion/public/directives/_saved_object_finder.scss deleted file mode 100644 index 55882fe78e99e..0000000000000 --- a/src/plugins/timelion/public/directives/_saved_object_finder.scss +++ /dev/null @@ -1,132 +0,0 @@ -.list-group-menu { - &.select-mode a { - outline: none; - color: tintOrShade($euiColorPrimary, 10%, 10%); - } - - .list-group-menu-item { - list-style: none; - color: tintOrShade($euiColorPrimary, 10%, 10%); - - &.active { - font-weight: bold; - background-color: $euiColorLightShade; - } - - &:hover { - background-color: tintOrShade($euiColorPrimary, 90%, 90%); - } - - li { - list-style: none; - color: tintOrShade($euiColorPrimary, 10%, 10%); - } - } -} - -saved-object-finder { - - .timSearchBar { - display: flex; - align-items: center; - } - - .timSearchBar__section { - position: relative; - margin-right: $euiSize; - flex: 1; - } - - .timSearchBar__icon { - position: absolute; - top: $euiSizeS; - left: $euiSizeS; - font-size: $euiSize; - color: $euiColorDarkShade; - } - - .timSearchBar__input { - padding: $euiSizeS $euiSizeM; - color: $euiColorDarkestShade; - background-color: $euiColorEmptyShade; - border: 1px solid $euiColorLightShade; - border-radius: $euiSizeXS; - transition: border-color .1s linear; - padding-left: $euiSizeXL; - width: 100%; - font-size: $euiSize; - } - - .timSearchBar__pagecount { - font-size: $euiSize; - color: $euiColorDarkShade; - } - - .list-sort-button { - border-top-left-radius: 0; - border-top-right-radius: 0; - border: none; - padding: $euiSizeS $euiSize; - font-weight: $euiFontWeightRegular; - background-color: $euiColorLightestShade; - margin-top: $euiSize; - } - - .li-striped { - li { - border: none; - } - - li:nth-child(even) { - background-color: $euiColorLightestShade; - } - - li:nth-child(odd) { - background-color: $euiColorEmptyShade; - } - - .paginate-heading { - font-weight: $euiFontWeightRegular; - color: $euiColorDarkestShade; - } - - .list-group-item { - padding: $euiSizeS $euiSize; - - ul { - padding: 0; - display: flex; - flex-direction: row; - - .finder-type { - margin-right: $euiSizeS; - } - } - - a { - display: block; - color: $euiColorPrimary; - - i { - color: shade($euiColorPrimary, 10%); - margin-right: $euiSizeS; - } - } - - &:first-child { - border-top-left-radius: 0; - border-top-right-radius: 0; - } - - &.list-group-no-results p { - margin-bottom: 0; - } - } - } - - paginate { - paginate-controls { - margin: $euiSize; - } - } -} diff --git a/src/plugins/timelion/public/directives/_timelion_expression_input.scss b/src/plugins/timelion/public/directives/_timelion_expression_input.scss deleted file mode 100644 index e4294d8454c7c..0000000000000 --- a/src/plugins/timelion/public/directives/_timelion_expression_input.scss +++ /dev/null @@ -1,15 +0,0 @@ -/** - * 1. Anchor suggestions beneath input. - * 2. Allow for option of positioning suggestions absolutely. - */ - -.timExpressionInput__container { - flex: 1 1 auto; - display: flex; - flex-direction: column; /* 1 */ - position: relative; /* 2 */ -} - -.timExpressionInput { - min-height: 70px; // Matches buttons on the right with new vertical rhythm sizing -} diff --git a/src/plugins/timelion/public/directives/cells/_cells.scss b/src/plugins/timelion/public/directives/cells/_cells.scss deleted file mode 100644 index d1e5e976fc8d2..0000000000000 --- a/src/plugins/timelion/public/directives/cells/_cells.scss +++ /dev/null @@ -1,61 +0,0 @@ -.timCell { - display: inline-block; - cursor: pointer; - position: relative; - box-sizing: border-box; - border: 2px dashed transparent; - // sass-lint:disable-block no-important - padding-left: 0 !important; - padding-right: 0 !important; - margin-bottom: $euiSizeM; - - &.active { - border-color: $euiColorLightShade; - } -} - -.timCell.running { - opacity: .5; -} - -.timCell__actions { - position: absolute; - bottom: $euiSizeXS; - left: $euiSizeXS; - - > .timCell__action, - > .timCell__id { - @include euiFontSizeXS; - font-weight: $euiFontWeightBold; - color: $euiColorMediumShade; - display: inline-block; - text-align: center; - width: $euiSizeL; - height: $euiSizeL; - border-radius: $euiSizeL / 2; - border: $euiBorderThin; - background-color: $euiColorLightestShade; - z-index: $euiZLevel1; - } - - > .timCell__action { - opacity: 0; - - &:focus { - opacity: 1; - } - - &:hover, - &:focus { - color: $euiTextColor; - border-color: $euiColorMediumShade; - background-color: $euiColorLightShade; - } - } -} - -.timCell:hover { - .timCell__action { - opacity: 1; - } -} diff --git a/src/plugins/timelion/public/directives/cells/_index.scss b/src/plugins/timelion/public/directives/cells/_index.scss deleted file mode 100644 index 8611b4d8ba1d0..0000000000000 --- a/src/plugins/timelion/public/directives/cells/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './cells'; diff --git a/src/plugins/timelion/public/directives/cells/cells.html b/src/plugins/timelion/public/directives/cells/cells.html deleted file mode 100644 index f90b85abaf920..0000000000000 --- a/src/plugins/timelion/public/directives/cells/cells.html +++ /dev/null @@ -1,52 +0,0 @@ -
- -
- -
-
-
{{$index + 1}}
- - - - -
-
- -
diff --git a/src/plugins/timelion/public/directives/cells/cells.js b/src/plugins/timelion/public/directives/cells/cells.js deleted file mode 100644 index af9e315a7d944..0000000000000 --- a/src/plugins/timelion/public/directives/cells/cells.js +++ /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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { move } from './collection'; -import { initTimelionGridDirective } from '../timelion_grid'; - -import html from './cells.html'; - -export function initCellsDirective(app) { - initTimelionGridDirective(app); - - app.directive('timelionCells', function () { - return { - restrict: 'E', - scope: { - sheet: '=', - state: '=', - transient: '=', - onSearch: '=', - onSelect: '=', - onRemoveSheet: '=', - }, - template: html, - link: function ($scope) { - $scope.removeCell = function (index) { - $scope.onRemoveSheet(index); - }; - - $scope.dropCell = function (item, partFrom, partTo, indexFrom, indexTo) { - move($scope.sheet, indexFrom, indexTo); - $scope.onSelect(indexTo); - }; - }, - }; - }); -} diff --git a/src/plugins/timelion/public/directives/cells/collection.ts b/src/plugins/timelion/public/directives/cells/collection.ts deleted file mode 100644 index 188f00bef16ae..0000000000000 --- a/src/plugins/timelion/public/directives/cells/collection.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import _ from 'lodash'; - -/** - * move an obj either up or down in the collection by - * injecting it either before/after the prev/next obj that - * satisfied the qualifier - * - * or, just from one index to another... - * - * @param {array} objs - the list to move the object within - * @param {number|any} obj - the object that should be moved, or the index that the object is currently at - * @param {number|boolean} below - the index to move the object to, or whether it should be moved up or down - * @param {function} qualifier - a lodash-y callback, object = _.where, string = _.pluck - * @return {array} - the objs argument - */ -export function move( - objs: any[], - obj: object | number, - below: number | boolean, - qualifier?: ((object: object, index: number) => any) | Record | string -): object[] { - const origI = _.isNumber(obj) ? obj : objs.indexOf(obj); - if (origI === -1) { - return objs; - } - - if (_.isNumber(below)) { - // move to a specific index - objs.splice(below, 0, objs.splice(origI, 1)[0]); - return objs; - } - - below = !!below; - qualifier = qualifier && _.iteratee(qualifier); - - const above = !below; - const finder = below ? _.findIndex : _.findLastIndex; - - // find the index of the next/previous obj that meets the qualifications - const targetI = finder(objs, (otherAgg, otherI) => { - if (below && otherI <= origI) { - return; - } - if (above && otherI >= origI) { - return; - } - return Boolean(_.isFunction(qualifier) && qualifier(otherAgg, otherI)); - }); - - if (targetI === -1) { - return objs; - } - - // place the obj at it's new index - objs.splice(targetI, 0, objs.splice(origI, 1)[0]); - return objs; -} diff --git a/src/plugins/timelion/public/directives/chart/chart.js b/src/plugins/timelion/public/directives/chart/chart.js deleted file mode 100644 index 8f02fb70436e7..0000000000000 --- a/src/plugins/timelion/public/directives/chart/chart.js +++ /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 and the Server Side Public License, v 1; you may not 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 function Chart(timelionPanels) { - return { - restrict: 'A', - scope: { - seriesList: '=chart', // The flot object, data, config and all - search: '=', // The function to execute to kick off a search - interval: '=', // Required for formatting x-axis ticks - rerenderTrigger: '=', - }, - link: function ($scope, $elem) { - let panelScope = $scope.$new(true); - - function render() { - panelScope.$destroy(); - - if (!$scope.seriesList) return; - - $scope.seriesList.render = $scope.seriesList.render || { - type: 'timechart', - }; - - const panelSchema = timelionPanels.get($scope.seriesList.render.type); - - if (!panelSchema) { - $elem.text( - i18n.translate('timelion.chart.seriesList.noSchemaWarning', { - defaultMessage: 'No such panel type: {renderType}', - values: { renderType: $scope.seriesList.render.type }, - }) - ); - return; - } - - panelScope = $scope.$new(true); - panelScope.seriesList = $scope.seriesList; - panelScope.interval = $scope.interval; - panelScope.search = $scope.search; - - panelSchema.render(panelScope, $elem); - } - - $scope.$watchGroup(['seriesList', 'rerenderTrigger'], render); - }, - }; -} diff --git a/src/plugins/timelion/public/directives/fixed_element.js b/src/plugins/timelion/public/directives/fixed_element.js deleted file mode 100644 index 4349161892367..0000000000000 --- a/src/plugins/timelion/public/directives/fixed_element.js +++ /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 $ from 'jquery'; - -export function initFixedElementDirective(app) { - app.directive('fixedElementRoot', function () { - return { - restrict: 'A', - link: function ($elem) { - let fixedAt; - $(window).bind('scroll', function () { - const fixed = $('[fixed-element]', $elem); - const body = $('[fixed-element-body]', $elem); - const top = fixed.offset().top; - - if ($(window).scrollTop() > top) { - // This is a gross hack, but its better than it was. I guess - fixedAt = $(window).scrollTop(); - fixed.addClass(fixed.attr('fixed-element')); - body.addClass(fixed.attr('fixed-element-body')); - body.css({ top: fixed.height() }); - } - - if ($(window).scrollTop() < fixedAt) { - fixed.removeClass(fixed.attr('fixed-element')); - body.removeClass(fixed.attr('fixed-element-body')); - body.removeAttr('style'); - } - }); - }, - }; - }); -} diff --git a/src/plugins/timelion/public/directives/fullscreen/fullscreen.html b/src/plugins/timelion/public/directives/fullscreen/fullscreen.html deleted file mode 100644 index 1ed6aa82ea3b9..0000000000000 --- a/src/plugins/timelion/public/directives/fullscreen/fullscreen.html +++ /dev/null @@ -1,14 +0,0 @@ -
-
-
- -
-
diff --git a/src/plugins/timelion/public/directives/fullscreen/fullscreen.js b/src/plugins/timelion/public/directives/fullscreen/fullscreen.js deleted file mode 100644 index 8403d861a4479..0000000000000 --- a/src/plugins/timelion/public/directives/fullscreen/fullscreen.js +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import html from './fullscreen.html'; - -export function initFullscreenDirective(app) { - app.directive('timelionFullscreen', function () { - return { - restrict: 'E', - scope: { - expression: '=', - series: '=', - state: '=', - transient: '=', - onSearch: '=', - }, - template: html, - }; - }); -} diff --git a/src/plugins/timelion/public/directives/input_focus.js b/src/plugins/timelion/public/directives/input_focus.js deleted file mode 100644 index 23b8c54d623c3..0000000000000 --- a/src/plugins/timelion/public/directives/input_focus.js +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may 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 initInputFocusDirective(app) { - app.directive('inputFocus', function ($parse, $timeout) { - return { - restrict: 'A', - link: function ($scope, $elem, attrs) { - const isDisabled = attrs.disableInputFocus && $parse(attrs.disableInputFocus)($scope); - if (!isDisabled) { - $timeout(function () { - $elem.focus(); - if (attrs.inputFocus === 'select') $elem.select(); - }); - } - }, - }; - }); -} diff --git a/src/plugins/timelion/public/directives/key_map.ts b/src/plugins/timelion/public/directives/key_map.ts deleted file mode 100644 index 3e28bf3d7a3d5..0000000000000 --- a/src/plugins/timelion/public/directives/key_map.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 and the Server Side Public License, v 1; you may 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 keyMap: { [key: number]: string } = { - 8: 'backspace', - 9: 'tab', - 13: 'enter', - 16: 'shift', - 17: 'ctrl', - 18: 'alt', - 19: 'pause', - 20: 'capsLock', - 27: 'escape', - 32: 'space', - 33: 'pageUp', - 34: 'pageDown', - 35: 'end', - 36: 'home', - 37: 'left', - 38: 'up', - 39: 'right', - 40: 'down', - 45: 'insert', - 46: 'delete', - 48: '0', - 49: '1', - 50: '2', - 51: '3', - 52: '4', - 53: '5', - 54: '6', - 55: '7', - 56: '8', - 57: '9', - 65: 'a', - 66: 'b', - 67: 'c', - 68: 'd', - 69: 'e', - 70: 'f', - 71: 'g', - 72: 'h', - 73: 'i', - 74: 'j', - 75: 'k', - 76: 'l', - 77: 'm', - 78: 'n', - 79: 'o', - 80: 'p', - 81: 'q', - 82: 'r', - 83: 's', - 84: 't', - 85: 'u', - 86: 'v', - 87: 'w', - 88: 'x', - 89: 'y', - 90: 'z', - 91: 'leftWindowKey', - 92: 'rightWindowKey', - 93: 'selectKey', - 96: '0', - 97: '1', - 98: '2', - 99: '3', - 100: '4', - 101: '5', - 102: '6', - 103: '7', - 104: '8', - 105: '9', - 106: 'multiply', - 107: 'add', - 109: 'subtract', - 110: 'period', - 111: 'divide', - 112: 'f1', - 113: 'f2', - 114: 'f3', - 115: 'f4', - 116: 'f5', - 117: 'f6', - 118: 'f7', - 119: 'f8', - 120: 'f9', - 121: 'f10', - 122: 'f11', - 123: 'f12', - 144: 'numLock', - 145: 'scrollLock', - 186: 'semiColon', - 187: 'equalSign', - 188: 'comma', - 189: 'dash', - 190: 'period', - 191: 'forwardSlash', - 192: 'graveAccent', - 219: 'openBracket', - 220: 'backSlash', - 221: 'closeBracket', - 222: 'singleQuote', - 224: 'meta', -}; diff --git a/src/plugins/timelion/public/directives/saved_object_finder.html b/src/plugins/timelion/public/directives/saved_object_finder.html deleted file mode 100644 index 1ce10efe4e0a8..0000000000000 --- a/src/plugins/timelion/public/directives/saved_object_finder.html +++ /dev/null @@ -1,112 +0,0 @@ -
-
-
- - -
- -
-

-
- - - -
-
-
-
- - - - - diff --git a/src/plugins/timelion/public/directives/saved_object_finder.js b/src/plugins/timelion/public/directives/saved_object_finder.js deleted file mode 100644 index 3bd6a2d9581f4..0000000000000 --- a/src/plugins/timelion/public/directives/saved_object_finder.js +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import _ from 'lodash'; -import rison from 'rison-node'; -import savedObjectFinderTemplate from './saved_object_finder.html'; -import { keyMap } from './key_map'; -import { - PaginateControlsDirectiveProvider, - PaginateDirectiveProvider, -} from '../../../kibana_legacy/public'; -import { PER_PAGE_SETTING } from '../../../saved_objects/public'; -import { VISUALIZE_ENABLE_LABS_SETTING } from '../../../visualizations/public'; - -export function initSavedObjectFinderDirective(app, savedSheetLoader, uiSettings) { - app - .directive('paginate', PaginateDirectiveProvider) - .directive('paginateControls', PaginateControlsDirectiveProvider) - .directive('savedObjectFinder', function () { - return { - restrict: 'E', - scope: { - type: '@', - // optional make-url attr, sets the userMakeUrl in our scope - userMakeUrl: '=?makeUrl', - // optional on-choose attr, sets the userOnChoose in our scope - userOnChoose: '=?onChoose', - // optional useLocalManagement attr, removes link to management section - useLocalManagement: '=?useLocalManagement', - /** - * @type {function} - an optional function. If supplied an `Add new X` button is shown - * and this function is called when clicked. - */ - onAddNew: '=', - /** - * @{type} boolean - set this to true, if you don't want the search box above the - * table to automatically gain focus once loaded - */ - disableAutoFocus: '=', - }, - template: savedObjectFinderTemplate, - controllerAs: 'finder', - controller: function ($scope, $element, $location, history) { - const self = this; - - // the text input element - const $input = $element.find('input[ng-model=filter]'); - - // The number of items to show in the list - $scope.perPage = uiSettings.get(PER_PAGE_SETTING); - - // the list that will hold the suggestions - const $list = $element.find('ul'); - - // the current filter string, used to check that returned results are still useful - let currentFilter = $scope.filter; - - // the most recently entered search/filter - let prevSearch; - - // the list of hits, used to render display - self.hits = []; - - self.service = savedSheetLoader; - self.properties = self.service.loaderProperties; - - filterResults(); - - /** - * Boolean that keeps track of whether hits are sorted ascending (true) - * or descending (false) by title - * @type {Boolean} - */ - self.isAscending = true; - - /** - * Sorts saved object finder hits either ascending or descending - * @param {Array} hits Array of saved finder object hits - * @return {Array} Array sorted either ascending or descending - */ - self.sortHits = function (hits) { - self.isAscending = !self.isAscending; - self.hits = self.isAscending - ? _.sortBy(hits, ['title']) - : _.sortBy(hits, ['title']).reverse(); - }; - - /** - * Passed the hit objects and will determine if the - * hit should have a url in the UI, returns it if so - * @return {string|null} - the url or nothing - */ - self.makeUrl = function (hit) { - if ($scope.userMakeUrl) { - return $scope.userMakeUrl(hit); - } - - if (!$scope.userOnChoose) { - return hit.url; - } - - return '#'; - }; - - self.preventClick = function ($event) { - $event.preventDefault(); - }; - - /** - * Called when a hit object is clicked, can override the - * url behavior if necessary. - */ - self.onChoose = function (hit, $event) { - if ($scope.userOnChoose) { - $scope.userOnChoose(hit, $event); - } - - const url = self.makeUrl(hit); - if (!url || url === '#' || url.charAt(0) !== '#') return; - - $event.preventDefault(); - - history.push(url.substr(1)); - }; - - $scope.$watch('filter', function (newFilter) { - // ensure that the currentFilter changes from undefined to '' - // which triggers - currentFilter = newFilter || ''; - filterResults(); - }); - - $scope.pageFirstItem = 0; - $scope.pageLastItem = 0; - $scope.onPageChanged = (page) => { - $scope.pageFirstItem = page.firstItem; - $scope.pageLastItem = page.lastItem; - }; - - //manages the state of the keyboard selector - self.selector = { - enabled: false, - index: -1, - }; - - self.getLabel = function () { - return _.words(self.properties.nouns).map(_.capitalize).join(' '); - }; - - //key handler for the filter text box - self.filterKeyDown = function ($event) { - switch (keyMap[$event.keyCode]) { - case 'enter': - if (self.hitCount !== 1) return; - const hit = self.hits[0]; - if (!hit) return; - - self.onChoose(hit, $event); - $event.preventDefault(); - break; - } - }; - - //key handler for the list items - self.hitKeyDown = function ($event, page, paginate) { - switch (keyMap[$event.keyCode]) { - case 'tab': - if (!self.selector.enabled) break; - - self.selector.index = -1; - self.selector.enabled = false; - - //if the user types shift-tab return to the textbox - //if the user types tab, set the focus to the currently selected hit. - if ($event.shiftKey) { - $input.focus(); - } else { - $list.find('li.active a').focus(); - } - - $event.preventDefault(); - break; - case 'down': - if (!self.selector.enabled) break; - - if (self.selector.index + 1 < page.length) { - self.selector.index += 1; - } - $event.preventDefault(); - break; - case 'up': - if (!self.selector.enabled) break; - - if (self.selector.index > 0) { - self.selector.index -= 1; - } - $event.preventDefault(); - break; - case 'right': - if (!self.selector.enabled) break; - - if (page.number < page.count) { - paginate.goToPage(page.number + 1); - self.selector.index = 0; - selectTopHit(); - } - $event.preventDefault(); - break; - case 'left': - if (!self.selector.enabled) break; - - if (page.number > 1) { - paginate.goToPage(page.number - 1); - self.selector.index = 0; - selectTopHit(); - } - $event.preventDefault(); - break; - case 'escape': - if (!self.selector.enabled) break; - - $input.focus(); - $event.preventDefault(); - break; - case 'enter': - if (!self.selector.enabled) break; - - const hitIndex = (page.number - 1) * paginate.perPage + self.selector.index; - const hit = self.hits[hitIndex]; - if (!hit) break; - - self.onChoose(hit, $event); - $event.preventDefault(); - break; - case 'shift': - break; - default: - $input.focus(); - break; - } - }; - - self.hitBlur = function () { - self.selector.index = -1; - self.selector.enabled = false; - }; - - self.manageObjects = function (type) { - $location.url('/management/kibana/objects?_a=' + rison.encode({ tab: type })); - }; - - self.hitCountNoun = function () { - return (self.hitCount === 1 - ? self.properties.noun - : self.properties.nouns - ).toLowerCase(); - }; - - function selectTopHit() { - setTimeout(function () { - //triggering a focus event kicks off a new angular digest cycle. - $list.find('a:first').focus(); - }, 0); - } - - function filterResults() { - if (!self.service) return; - if (!self.properties) return; - - // track the filter that we use for this search, - // but ensure that we don't search for the same - // thing twice. This is called from multiple places - // and needs to be smart about when it actually searches - const filter = currentFilter; - if (prevSearch === filter) return; - - prevSearch = filter; - - const isLabsEnabled = uiSettings.get(VISUALIZE_ENABLE_LABS_SETTING); - self.service.find(filter).then(function (hits) { - hits.hits = hits.hits.filter( - (hit) => isLabsEnabled || _.get(hit, 'type.stage') !== 'experimental' - ); - hits.total = hits.hits.length; - - // ensure that we don't display old results - // as we can't really cancel requests - if (currentFilter === filter) { - self.hitCount = hits.total; - self.hits = _.sortBy(hits.hits, ['title']); - } - }); - } - }, - }; - }); -} diff --git a/src/plugins/timelion/public/directives/saved_object_save_as_checkbox.html b/src/plugins/timelion/public/directives/saved_object_save_as_checkbox.html deleted file mode 100644 index a001ddc751748..0000000000000 --- a/src/plugins/timelion/public/directives/saved_object_save_as_checkbox.html +++ /dev/null @@ -1,29 +0,0 @@ -
-
- - -
- diff --git a/src/plugins/timelion/public/directives/saved_object_save_as_checkbox.js b/src/plugins/timelion/public/directives/saved_object_save_as_checkbox.js deleted file mode 100644 index 865e5ea473b85..0000000000000 --- a/src/plugins/timelion/public/directives/saved_object_save_as_checkbox.js +++ /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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import saveObjectSaveAsCheckboxTemplate from './saved_object_save_as_checkbox.html'; - -export function initSavedObjectSaveAsCheckBoxDirective(app) { - app.directive('savedObjectSaveAsCheckBox', function () { - return { - restrict: 'E', - template: saveObjectSaveAsCheckboxTemplate, - replace: true, - scope: { - savedObject: '=', - }, - }; - }); -} diff --git a/src/plugins/timelion/public/directives/timelion_expression_input.html b/src/plugins/timelion/public/directives/timelion_expression_input.html deleted file mode 100644 index 6c115118860ba..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_expression_input.html +++ /dev/null @@ -1,41 +0,0 @@ -
- - - - -
diff --git a/src/plugins/timelion/public/directives/timelion_expression_input.js b/src/plugins/timelion/public/directives/timelion_expression_input.js deleted file mode 100644 index c29c802914987..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_expression_input.js +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -/** - * Timelion Expression Autocompleter - * - * This directive allows users to enter multiline timelion expressions. If the user has entered - * a valid expression and then types a ".", this directive will display a list of suggestions. - * - * Users can navigate suggestions using the arrow keys. When a user selects a suggestion, it's - * inserted into the expression and the caret position is updated to be inside of the newly- - * added function's parentheses. - * - * Beneath the hood, we use a PEG grammar to validate the Timelion expression and detect if - * the caret is in a position within the expression that allows functions to be suggested. - * - * NOTE: This directive doesn't work well with contenteditable divs. Challenges include: - * - You have to replace markup with newline characters and spaces when passing the expression - * to the grammar. - * - You have to do the opposite when loading a saved expression, so that it appears correctly - * within the contenteditable (i.e. replace newlines with
markup). - * - The Range and Selection APIs ignore newlines when providing caret position, so there is - * literally no way to insert suggestions into the correct place in a multiline expression - * that has more than a single consecutive newline. - */ - -import _ from 'lodash'; -import $ from 'jquery'; -import timelionExpressionInputTemplate from './timelion_expression_input.html'; -import { - SUGGESTION_TYPE, - Suggestions, - suggest, - insertAtLocation, -} from './timelion_expression_input_helpers'; -import { comboBoxKeyCodes } from '@elastic/eui'; - -export function timelionExpInput(deps) { - return ($http, $timeout) => { - return { - restrict: 'E', - scope: { - rows: '=', - sheet: '=', - updateChart: '&', - shouldPopoverSuggestions: '@', - }, - replace: true, - template: timelionExpressionInputTemplate, - link: function (scope, elem) { - const argValueSuggestions = deps.plugins.visTypeTimelion.getArgValueSuggestions(); - const expressionInput = elem.find('[data-expression-input]'); - const functionReference = {}; - let suggestibleFunctionLocation = {}; - - scope.suggestions = new Suggestions(); - - function init() { - $http.get('../api/timelion/functions').then(function (resp) { - Object.assign(functionReference, { - byName: _.keyBy(resp.data, 'name'), - list: resp.data, - }); - }); - } - - function setCaretOffset(caretOffset) { - // Wait for Angular to update the input with the new expression and *then* we can set - // the caret position. - $timeout(() => { - expressionInput.focus(); - expressionInput[0].selectionStart = expressionInput[0].selectionEnd = caretOffset; - scope.$apply(); - }, 0); - } - - function insertSuggestionIntoExpression(suggestionIndex) { - if (scope.suggestions.isEmpty()) { - return; - } - - const { min, max } = suggestibleFunctionLocation; - let insertedValue; - let insertPositionMinOffset = 0; - - switch (scope.suggestions.type) { - case SUGGESTION_TYPE.FUNCTIONS: { - // Position the caret inside of the function parentheses. - insertedValue = `${scope.suggestions.list[suggestionIndex].name}()`; - - // min advanced one to not replace function '.' - insertPositionMinOffset = 1; - break; - } - case SUGGESTION_TYPE.ARGUMENTS: { - // Position the caret after the '=' - insertedValue = `${scope.suggestions.list[suggestionIndex].name}=`; - break; - } - case SUGGESTION_TYPE.ARGUMENT_VALUE: { - // Position the caret after the argument value - insertedValue = `${scope.suggestions.list[suggestionIndex].name}`; - break; - } - } - - const updatedExpression = insertAtLocation( - insertedValue, - scope.sheet, - min + insertPositionMinOffset, - max - ); - scope.sheet = updatedExpression; - - const newCaretOffset = min + insertedValue.length; - setCaretOffset(newCaretOffset); - } - - function scrollToSuggestionAt(index) { - // We don't cache these because the list changes based on user input. - const suggestionsList = $('[data-suggestions-list]'); - const suggestionListItem = $('[data-suggestion-list-item]')[index]; - // Scroll to the position of the item relative to the list, not to the window. - suggestionsList.scrollTop(suggestionListItem.offsetTop - suggestionsList[0].offsetTop); - } - - function getCursorPosition() { - if (expressionInput.length) { - return expressionInput[0].selectionStart; - } - return null; - } - - async function getSuggestions() { - const suggestions = await suggest( - scope.sheet, - functionReference.list, - getCursorPosition(), - argValueSuggestions - ); - - // We're using ES6 Promises, not $q, so we have to wrap this in $apply. - scope.$apply(() => { - if (suggestions) { - scope.suggestions.setList(suggestions.list, suggestions.type); - scope.suggestions.show(); - suggestibleFunctionLocation = suggestions.location; - $timeout(() => { - const suggestionsList = $('[data-suggestions-list]'); - suggestionsList.scrollTop(0); - }, 0); - return; - } - - suggestibleFunctionLocation = undefined; - scope.suggestions.reset(); - }); - } - - function isNavigationalKey(keyCode) { - const keyCodes = _.values(comboBoxKeyCodes); - return keyCodes.includes(keyCode); - } - - scope.onFocusInput = () => { - // Wait for the caret position of the input to update and then we can get suggestions - // (which depends on the caret position). - $timeout(getSuggestions, 0); - }; - - scope.onBlurInput = () => { - scope.suggestions.hide(); - }; - - scope.onKeyDownInput = (e) => { - // If we've pressed any non-navigational keys, then the user has typed something and we - // can exit early without doing any navigation. The keyup handler will pull up suggestions. - if (!isNavigationalKey(e.keyCode)) { - return; - } - - switch (e.keyCode) { - case comboBoxKeyCodes.UP: - if (scope.suggestions.isVisible) { - // Up and down keys navigate through suggestions. - e.preventDefault(); - scope.suggestions.stepForward(); - scrollToSuggestionAt(scope.suggestions.index); - } - break; - - case comboBoxKeyCodes.DOWN: - if (scope.suggestions.isVisible) { - // Up and down keys navigate through suggestions. - e.preventDefault(); - scope.suggestions.stepBackward(); - scrollToSuggestionAt(scope.suggestions.index); - } - break; - - case comboBoxKeyCodes.TAB: - // If there are no suggestions or none is selected, the user tabs to the next input. - if (scope.suggestions.isEmpty() || scope.suggestions.index < 0) { - // Before letting the tab be handled to focus the next element - // we need to hide the suggestions, otherwise it will focus these - // instead of the time interval select. - scope.suggestions.hide(); - return; - } - - // If we have suggestions, complete the selected one. - e.preventDefault(); - insertSuggestionIntoExpression(scope.suggestions.index); - break; - - case comboBoxKeyCodes.ENTER: - if (e.metaKey || e.ctrlKey) { - // Re-render the chart when the user hits CMD+ENTER. - e.preventDefault(); - scope.updateChart(); - } else if (!scope.suggestions.isEmpty()) { - // If the suggestions are open, complete the expression with the suggestion. - e.preventDefault(); - insertSuggestionIntoExpression(scope.suggestions.index); - } - break; - - case comboBoxKeyCodes.ESCAPE: - e.preventDefault(); - scope.suggestions.hide(); - break; - } - }; - - scope.onKeyUpInput = (e) => { - // If the user isn't navigating, then we should update the suggestions based on their input. - if (!isNavigationalKey(e.keyCode)) { - getSuggestions(); - } - }; - - scope.onClickExpression = () => { - getSuggestions(); - }; - - scope.onClickSuggestion = (index) => { - insertSuggestionIntoExpression(index); - }; - - scope.getActiveSuggestionId = () => { - if (scope.suggestions.isVisible && scope.suggestions.index > -1) { - return `timelionSuggestion${scope.suggestions.index}`; - } - return ''; - }; - - init(); - }, - }; - }; -} diff --git a/src/plugins/timelion/public/directives/timelion_expression_input_helpers.js b/src/plugins/timelion/public/directives/timelion_expression_input_helpers.js deleted file mode 100644 index 0bc5897c49d6f..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_expression_input_helpers.js +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import _ from 'lodash'; -import { _LEGACY_ as visTypeTimelion } from '../../../vis_type_timelion/public'; - -export const SUGGESTION_TYPE = { - ARGUMENTS: 'arguments', - ARGUMENT_VALUE: 'argument_value', - FUNCTIONS: 'functions', -}; - -export class Suggestions { - constructor() { - this.reset(); - } - - reset() { - this.index = -1; - this.list = []; - this.type = null; - this.isVisible = false; - } - - setList(list, type) { - this.list = list.sort((a, b) => { - if (a.name < b.name) { - return -1; - } - if (a.name > b.name) { - return 1; - } - // names must be equal - return 0; - }); - this.type = type; - - // Only try to position index inside of list range, when it was already focused - // beforehand (i.e. not -1) - if (this.index > -1) { - // We may get a shorter list than the one we have now, so we need to make sure our index doesn't - // fall outside of the new list's range. - this.index = Math.max(0, Math.min(this.index, this.list.length - 1)); - } - } - - getCount() { - return this.list.length; - } - - isEmpty() { - return this.list.length === 0; - } - - show() { - this.isVisible = true; - } - - hide() { - this.isVisible = false; - } - - stepForward() { - if (this.index > 0) { - this.index -= 1; - } - } - - stepBackward() { - if (this.index < this.list.length - 1) { - this.index += 1; - } - } -} - -function inLocation(cursorPosition, location) { - return cursorPosition >= location.min && cursorPosition <= location.max; -} - -function getArgumentsHelp(functionHelp, functionArgs = []) { - if (!functionHelp) { - return []; - } - - // Do not provide 'inputSeries' as argument suggestion for chainable functions - const argsHelp = functionHelp.chainable ? functionHelp.args.slice(1) : functionHelp.args.slice(0); - - // ignore arguments that are already provided in function declaration - const functionArgNames = functionArgs.map((arg) => { - return arg.name; - }); - return argsHelp.filter((arg) => { - return !functionArgNames.includes(arg.name); - }); -} - -async function extractSuggestionsFromParsedResult( - result, - cursorPosition, - functionList, - argValueSuggestions -) { - const activeFunc = result.functions.find((func) => { - return cursorPosition >= func.location.min && cursorPosition < func.location.max; - }); - - if (!activeFunc) { - return; - } - - const functionHelp = functionList.find((func) => { - return func.name === activeFunc.function; - }); - - // return function suggestion when cursor is outside of parentheses - // location range includes '.', function name, and '('. - const openParen = activeFunc.location.min + activeFunc.function.length + 2; - if (cursorPosition < openParen) { - return { list: [functionHelp], location: activeFunc.location, type: SUGGESTION_TYPE.FUNCTIONS }; - } - - // return argument value suggestions when cursor is inside argument value - const activeArg = activeFunc.arguments.find((argument) => { - return inLocation(cursorPosition, argument.location); - }); - if ( - activeArg && - activeArg.type === 'namedArg' && - inLocation(cursorPosition, activeArg.value.location) - ) { - const { function: functionName, arguments: functionArgs } = activeFunc; - - const { - name: argName, - value: { text: partialInput }, - } = activeArg; - - let valueSuggestions; - if (argValueSuggestions.hasDynamicSuggestionsForArgument(functionName, argName)) { - valueSuggestions = await argValueSuggestions.getDynamicSuggestionsForArgument( - functionName, - argName, - functionArgs, - partialInput - ); - } else { - const { suggestions: staticSuggestions } = functionHelp.args.find((arg) => { - return arg.name === activeArg.name; - }); - valueSuggestions = argValueSuggestions.getStaticSuggestionsForInput( - partialInput, - staticSuggestions - ); - } - return { - list: valueSuggestions, - location: activeArg.value.location, - type: SUGGESTION_TYPE.ARGUMENT_VALUE, - }; - } - - // return argument suggestions - const argsHelp = getArgumentsHelp(functionHelp, activeFunc.arguments); - const argumentSuggestions = argsHelp.filter((arg) => { - if (_.get(activeArg, 'type') === 'namedArg') { - return _.startsWith(arg.name, activeArg.name); - } else if (activeArg) { - return _.startsWith(arg.name, activeArg.text); - } - return true; - }); - const location = activeArg ? activeArg.location : { min: cursorPosition, max: cursorPosition }; - return { list: argumentSuggestions, location: location, type: SUGGESTION_TYPE.ARGUMENTS }; -} - -export async function suggest(expression, functionList, cursorPosition, argValueSuggestions) { - try { - const result = await visTypeTimelion.parseTimelionExpressionAsync(expression); - return await extractSuggestionsFromParsedResult( - result, - cursorPosition, - functionList, - argValueSuggestions - ); - } catch (e) { - let message; - try { - // The grammar will throw an error containing a message if the expression is formatted - // correctly and is prepared to accept suggestions. If the expression is not formatted - // correctly the grammar will just throw a regular PEG SyntaxError, and this JSON.parse - // attempt will throw an error. - message = JSON.parse(e.message); - } catch (e) { - // The expression isn't correctly formatted, so JSON.parse threw an error. - return; - } - - switch (message.type) { - case 'incompleteFunction': { - let list; - if (message.function) { - // The user has start typing a function name, so we'll filter the list down to only - // possible matches. - list = functionList.filter((func) => _.startsWith(func.name, message.function)); - } else { - // The user hasn't typed anything yet, so we'll just return the entire list. - list = functionList; - } - return { list, location: message.location, type: SUGGESTION_TYPE.FUNCTIONS }; - } - case 'incompleteArgument': { - const { currentFunction: functionName, currentArgs: functionArgs } = message; - const functionHelp = functionList.find((func) => func.name === functionName); - return { - list: getArgumentsHelp(functionHelp, functionArgs), - location: message.location, - type: SUGGESTION_TYPE.ARGUMENTS, - }; - } - case 'incompleteArgumentValue': { - const { name: argName, currentFunction: functionName, currentArgs: functionArgs } = message; - let valueSuggestions = []; - if (argValueSuggestions.hasDynamicSuggestionsForArgument(functionName, argName)) { - valueSuggestions = await argValueSuggestions.getDynamicSuggestionsForArgument( - functionName, - argName, - functionArgs - ); - } else { - const functionHelp = functionList.find((func) => func.name === functionName); - if (functionHelp) { - const argHelp = functionHelp.args.find((arg) => arg.name === argName); - if (argHelp && argHelp.suggestions) { - valueSuggestions = argHelp.suggestions; - } - } - } - return { - list: valueSuggestions, - location: { min: cursorPosition, max: cursorPosition }, - type: SUGGESTION_TYPE.ARGUMENT_VALUE, - }; - } - } - } -} - -export function insertAtLocation( - valueToInsert, - destination, - replacementRangeStart, - replacementRangeEnd -) { - // Insert the value at a location caret within the destination. - const prefix = destination.slice(0, replacementRangeStart); - const suffix = destination.slice(replacementRangeEnd, destination.length); - const result = `${prefix}${valueToInsert}${suffix}`; - return result; -} diff --git a/src/plugins/timelion/public/directives/timelion_expression_suggestions/_index.scss b/src/plugins/timelion/public/directives/timelion_expression_suggestions/_index.scss deleted file mode 100644 index 6fd0098aea68e..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_expression_suggestions/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './timelion_expression_suggestions'; diff --git a/src/plugins/timelion/public/directives/timelion_expression_suggestions/_timelion_expression_suggestions.scss b/src/plugins/timelion/public/directives/timelion_expression_suggestions/_timelion_expression_suggestions.scss deleted file mode 100644 index 4bf6ba24108d2..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_expression_suggestions/_timelion_expression_suggestions.scss +++ /dev/null @@ -1,36 +0,0 @@ -.timSuggestions { - @include euiBottomShadowMedium; - background-color: $euiColorLightestShade; - color: $euiTextColor; - border: $euiBorderThin; - // sass-lint:disable-block no-important - border-radius: 0 0 $euiBorderRadius $euiBorderRadius !important; - z-index: $euiZLevel9; - max-height: $euiSizeXL * 10; - overflow-y: auto; - - &.timSuggestions-isPopover { - position: absolute; - top: 100%; - } -} - -.timSuggestions__item { - border-bottom: $euiBorderThin; - padding: $euiSizeXS $euiSizeL; - - &:hover, - &.active { - background-color: $euiColorLightShade; - } -} - -.timSuggestions__details { - background-color: $euiColorLightestShade; - padding: $euiSizeM; - border-radius: $euiBorderRadius; - - > table { - margin-bottom: 0; - } -} diff --git a/src/plugins/timelion/public/directives/timelion_expression_suggestions/timelion_expression_suggestions.html b/src/plugins/timelion/public/directives/timelion_expression_suggestions/timelion_expression_suggestions.html deleted file mode 100644 index ddb9f21615aee..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_expression_suggestions/timelion_expression_suggestions.html +++ /dev/null @@ -1,109 +0,0 @@ -
-
- -
- -
-

- .{{suggestion.name}}() - - - - -

- -
-
- - - {{arg.name}}=({{arg.types.join(' | ')}}) - , - -
- -
- - - - - - - - - - - -
{{arg.name}}{{arg.types.join(', ')}}{{arg.help}}
-
-
-
- -
-

- {{suggestion.name}}= - - {{suggestion.help}} - -

-
- Accepts: - {{suggestion.types.join(', ')}} -
-
- -
-

- {{suggestion.name}} - - {{suggestion.help}} - -

-
- -
-
-
diff --git a/src/plugins/timelion/public/directives/timelion_expression_suggestions/timelion_expression_suggestions.js b/src/plugins/timelion/public/directives/timelion_expression_suggestions/timelion_expression_suggestions.js deleted file mode 100644 index cce0f17f4ef1a..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_expression_suggestions/timelion_expression_suggestions.js +++ /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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import template from './timelion_expression_suggestions.html'; - -export function TimelionExpressionSuggestions() { - return { - restrict: 'E', - scope: { - suggestions: '=', - suggestionsType: '=', - selectedIndex: '=', - onClickSuggestion: '&', - shouldPopover: '=', - }, - replace: true, - template, - link: function (scope) { - // This will prevent the expression input from losing focus. - scope.onMouseDown = (e) => e.preventDefault(); - }, - }; -} diff --git a/src/plugins/timelion/public/directives/timelion_grid.js b/src/plugins/timelion/public/directives/timelion_grid.js deleted file mode 100644 index cb55dd6b8e110..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_grid.js +++ /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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import $ from 'jquery'; - -export function initTimelionGridDirective(app) { - app.directive('timelionGrid', function () { - return { - restrict: 'A', - scope: { - timelionGridRows: '=', - timelionGridColumns: '=', - }, - link: function ($scope, $elem) { - function init() { - setDimensions(); - } - - $scope.$on('$destroy', function () { - $(window).off('resize'); //remove the handler added earlier - }); - - $(window).resize(function () { - setDimensions(); - }); - - $scope.$watchMulti(['timelionGridColumns', 'timelionGridRows'], function () { - setDimensions(); - }); - - function setDimensions() { - const borderSize = 2; - const headerSize = 45 + 35 + 28 + 20 * 2; // chrome + subnav + buttons + (container padding) - const verticalPadding = 10; - - if ($scope.timelionGridColumns != null) { - $elem.width($elem.parent().width() / $scope.timelionGridColumns - borderSize * 2); - } - - if ($scope.timelionGridRows != null) { - $elem.height( - ($(window).height() - headerSize) / $scope.timelionGridRows - - (verticalPadding + borderSize * 2) - ); - } - } - - init(); - }, - }; - }); -} diff --git a/src/plugins/timelion/public/directives/timelion_help/_index.scss b/src/plugins/timelion/public/directives/timelion_help/_index.scss deleted file mode 100644 index 4228e56180066..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_help/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './timelion_help'; diff --git a/src/plugins/timelion/public/directives/timelion_help/_timelion_help.scss b/src/plugins/timelion/public/directives/timelion_help/_timelion_help.scss deleted file mode 100644 index 1f8551116aab0..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_help/_timelion_help.scss +++ /dev/null @@ -1,33 +0,0 @@ -.timHelp { - // EUITODO: Make .euiText > code background transparent - code { - background-color: transparentize($euiTextColor, .9); - } -} - -.timHelp__buttons { - display: flex; - justify-content: space-between; -} - -.timHelp__functions { - height: $euiSizeXL * 10; - overflow-y: auto; -} - -.timHelp__links { - color: $euiColorPrimary; - - &:hover { - text-decoration: underline; - } -} - -/** - * 1. Override bootstrap .table styles. - */ -.timHelp__functionsTableRow:hover, -.timHelp__functionDetailsTable { - // sass-lint:disable-block no-important - background-color: $euiColorLightestShade !important; /* 1 */ -} diff --git a/src/plugins/timelion/public/directives/timelion_help/timelion_help.html b/src/plugins/timelion/public/directives/timelion_help/timelion_help.html deleted file mode 100644 index 4c4fdfe4faf51..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_help/timelion_help.html +++ /dev/null @@ -1,741 +0,0 @@ -
-
-
-

-

-

- - . -

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

-

-

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

-

- - - -

-

-
    -
  • - -

    - - - - - - -

    -
  • -
  • - -

    -
  • -
-

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

-

-

- - - -

-

-

-

-

- - - -

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

-

-

-

- - - - - - - - - - - - - - - - - -
.es(*), .es(US)
.es(*).color(#f66), .es(US).bars(1)
- .es(*).color(#f66).lines(fill=3), - .es(US).bars(1).points(radius=3, weight=1) -
(.es(*), .es(GB)).points()
-

- - . -

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

-

-

-

-

-

-

- - - -

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

- - - - -
-
- - . -
- -
- - - - - - - - -
.{{function.name}}(){{function.help}}
-
- - - - - - - - - - - -
{{arg.name}}{{arg.types.join(', ')}}{{arg.help}}
-
- -
-
-
-
-
- -
- -
-
-
-
-
Ctrl/Cmd + Enter
-
-
- - -
-
-
- -
-
-
-
Enter/Tab
-
-
Esc
-
-
-
-
diff --git a/src/plugins/timelion/public/directives/timelion_help/timelion_help.js b/src/plugins/timelion/public/directives/timelion_help/timelion_help.js deleted file mode 100644 index ee518a8bce75c..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_help/timelion_help.js +++ /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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import template from './timelion_help.html'; -import { i18n } from '@kbn/i18n'; -import _ from 'lodash'; -import moment from 'moment'; - -export function initTimelionHelpDirective(app) { - app.directive('timelionHelp', function ($http) { - return { - restrict: 'E', - template, - controller: function ($scope) { - $scope.functions = { - list: [], - details: null, - }; - - $scope.activeTab = 'funcref'; - $scope.activateTab = function (tabName) { - $scope.activeTab = tabName; - }; - - function init() { - $scope.es = { - invalidCount: 0, - }; - - $scope.translations = { - nextButtonLabel: i18n.translate('timelion.help.nextPageButtonLabel', { - defaultMessage: 'Next', - }), - previousButtonLabel: i18n.translate('timelion.help.previousPageButtonLabel', { - defaultMessage: 'Previous', - }), - dontShowHelpButtonLabel: i18n.translate('timelion.help.dontShowHelpButtonLabel', { - defaultMessage: `Don't show this again`, - }), - strongNextText: i18n.translate('timelion.help.welcome.content.strongNextText', { - defaultMessage: 'Next', - }), - emphasizedEverythingText: i18n.translate( - 'timelion.help.welcome.content.emphasizedEverythingText', - { - defaultMessage: 'everything', - } - ), - notValidAdvancedSettingsPath: i18n.translate( - 'timelion.help.configuration.notValid.advancedSettingsPathText', - { - defaultMessage: 'Management / Kibana / Advanced Settings', - } - ), - validAdvancedSettingsPath: i18n.translate( - 'timelion.help.configuration.valid.advancedSettingsPathText', - { - defaultMessage: 'Management/Kibana/Advanced Settings', - } - ), - esAsteriskQueryDescription: i18n.translate( - 'timelion.help.querying.esAsteriskQueryDescriptionText', - { - defaultMessage: 'hey Elasticsearch, find everything in my default index', - } - ), - esIndexQueryDescription: i18n.translate( - 'timelion.help.querying.esIndexQueryDescriptionText', - { - defaultMessage: 'use * as the q (query) for the logstash-* index', - } - ), - strongAddText: i18n.translate('timelion.help.expressions.strongAddText', { - defaultMessage: 'Add', - }), - twoExpressionsDescriptionTitle: i18n.translate( - 'timelion.help.expressions.examples.twoExpressionsDescriptionTitle', - { - defaultMessage: 'Double the fun.', - } - ), - customStylingDescriptionTitle: i18n.translate( - 'timelion.help.expressions.examples.customStylingDescriptionTitle', - { - defaultMessage: 'Custom styling.', - } - ), - namedArgumentsDescriptionTitle: i18n.translate( - 'timelion.help.expressions.examples.namedArgumentsDescriptionTitle', - { - defaultMessage: 'Named arguments.', - } - ), - groupedExpressionsDescriptionTitle: i18n.translate( - 'timelion.help.expressions.examples.groupedExpressionsDescriptionTitle', - { - defaultMessage: 'Grouped expressions.', - } - ), - }; - - getFunctions(); - checkElasticsearch(); - } - - function getFunctions() { - return $http.get('../api/timelion/functions').then(function (resp) { - $scope.functions.list = resp.data; - }); - } - $scope.recheckElasticsearch = function () { - $scope.es.valid = null; - checkElasticsearch().then(function (valid) { - if (!valid) $scope.es.invalidCount++; - }); - }; - - function checkElasticsearch() { - return $http.get('../api/timelion/validate/es').then(function (resp) { - if (resp.data.ok) { - $scope.es.valid = true; - $scope.es.stats = { - min: moment(resp.data.min).format('LLL'), - max: moment(resp.data.max).format('LLL'), - field: resp.data.field, - }; - } else { - $scope.es.valid = false; - $scope.es.invalidReason = (function () { - try { - const esResp = JSON.parse(resp.data.resp.response); - return _.get(esResp, 'error.root_cause[0].reason'); - } catch (e) { - if (_.get(resp, 'data.resp.message')) return _.get(resp, 'data.resp.message'); - if (_.get(resp, 'data.resp.output.payload.message')) - return _.get(resp, 'data.resp.output.payload.message'); - return i18n.translate('timelion.help.unknownErrorMessage', { - defaultMessage: 'Unknown error', - }); - } - })(); - } - return $scope.es.valid; - }); - } - init(); - }, - }; - }); -} diff --git a/src/plugins/timelion/public/directives/timelion_interval/_index.scss b/src/plugins/timelion/public/directives/timelion_interval/_index.scss deleted file mode 100644 index 2a201f9b35a4d..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_interval/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './timelion_interval'; diff --git a/src/plugins/timelion/public/directives/timelion_interval/_timelion_interval.scss b/src/plugins/timelion/public/directives/timelion_interval/_timelion_interval.scss deleted file mode 100644 index 7ce09155cafd8..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_interval/_timelion_interval.scss +++ /dev/null @@ -1,30 +0,0 @@ -timelion-interval { - display: flex; -} - -.timInterval__input { - width: $euiSizeXL * 2; - padding: $euiSizeXS $euiSizeM; - color: $euiColorDarkestShade; - border: 1px solid $euiColorLightShade; - border-radius: $euiSizeXS; - transition: border-color .1s linear; - font-size: 14px; -} - -.timInterval__input--compact { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} - -.timInterval__presets { - width: $euiSizeXL * 3; -} - -.timInterval__presets--compact { - width: $euiSizeXL * 1; - padding-left: 0; - border-left: none; - border-top-left-radius: 0; - border-bottom-left-radius: 0; -} diff --git a/src/plugins/timelion/public/directives/timelion_interval/timelion_interval.html b/src/plugins/timelion/public/directives/timelion_interval/timelion_interval.html deleted file mode 100644 index 49009355e49f4..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_interval/timelion_interval.html +++ /dev/null @@ -1,22 +0,0 @@ - diff --git a/src/plugins/timelion/public/directives/timelion_interval/timelion_interval.js b/src/plugins/timelion/public/directives/timelion_interval/timelion_interval.js deleted file mode 100644 index 55f50fff132eb..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_interval/timelion_interval.js +++ /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 _ from 'lodash'; -import $ from 'jquery'; -import template from './timelion_interval.html'; - -export function TimelionInterval($timeout) { - return { - restrict: 'E', - scope: { - // The interval model - model: '=', - changeInterval: '=', - }, - template, - link: function ($scope, $elem) { - $scope.intervalOptions = ['auto', '1s', '1m', '1h', '1d', '1w', '1M', '1y', 'other']; - $scope.intervalLabels = { - auto: 'auto', - '1s': '1 second', - '1m': '1 minute', - '1h': '1 hour', - '1d': '1 day', - '1w': '1 week', - '1M': '1 month', - '1y': '1 year', - other: 'other', - }; - - $scope.$watch('model', function (newVal, oldVal) { - // Only run this on initialization - if (newVal !== oldVal || oldVal == null) return; - - if (_.includes($scope.intervalOptions, newVal)) { - $scope.interval = newVal; - } else { - $scope.interval = 'other'; - } - - if (newVal !== 'other') { - $scope.otherInterval = newVal; - } - }); - - $scope.$watch('interval', function (newVal, oldVal) { - if (newVal === oldVal || $scope.model === newVal) return; - - if (newVal === 'other') { - $scope.otherInterval = oldVal; - $scope.changeInterval($scope.otherInterval); - $timeout(function () { - $('input', $elem).select(); - }, 0); - } else { - $scope.otherInterval = $scope.interval; - $scope.changeInterval($scope.interval); - } - }); - - $scope.$watch('otherInterval', function (newVal, oldVal) { - if (newVal === oldVal || $scope.model === newVal) return; - $scope.changeInterval(newVal); - }); - }, - }; -} diff --git a/src/plugins/timelion/public/directives/timelion_load_sheet.js b/src/plugins/timelion/public/directives/timelion_load_sheet.js deleted file mode 100644 index 83b8b4c2e262b..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_load_sheet.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. - */ - -import template from '../partials/load_sheet.html'; - -export function initTimelionLoadSheetDirective(app) { - app.directive('timelionLoad', function () { - return { - replace: true, - restrict: 'E', - template, - }; - }); -} diff --git a/src/plugins/timelion/public/directives/timelion_options_sheet.js b/src/plugins/timelion/public/directives/timelion_options_sheet.js deleted file mode 100644 index b3560111d4152..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_options_sheet.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. - */ - -import template from '../partials/sheet_options.html'; - -export function initTimelionOptionsSheetDirective(app) { - app.directive('timelionOptions', function () { - return { - replace: true, - restrict: 'E', - template, - }; - }); -} diff --git a/src/plugins/timelion/public/directives/timelion_save_sheet.js b/src/plugins/timelion/public/directives/timelion_save_sheet.js deleted file mode 100644 index 40289b1bb8353..0000000000000 --- a/src/plugins/timelion/public/directives/timelion_save_sheet.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. - */ - -import saveTemplate from '../partials/save_sheet.html'; - -export function initTimelionSaveSheetDirective(app) { - app.directive('timelionSave', function () { - return { - replace: true, - restrict: 'E', - template: saveTemplate, - }; - }); -} diff --git a/src/plugins/timelion/public/index.html b/src/plugins/timelion/public/index.html deleted file mode 100644 index 3fb518e81e882..0000000000000 --- a/src/plugins/timelion/public/index.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - -
- - - - - -
- -
-
- -
-
- -
- -
- - - -
-
- -
- - - -
-
-
- - diff --git a/src/plugins/timelion/public/index.scss b/src/plugins/timelion/public/index.scss deleted file mode 100644 index 7a4259b2a17c8..0000000000000 --- a/src/plugins/timelion/public/index.scss +++ /dev/null @@ -1,18 +0,0 @@ -/* Timelion plugin styles */ - -// Prefix all styles with "tim" to avoid conflicts. -// Examples -// timChart -// timChart__legend -// timChart__legend--small -// timChart__legend-isLoading - -@import './app'; -@import './base'; -@import './directives/index'; - -// these styles is needed to be loaded here explicitly if the timelion visualization was not opened in browser -// styles for timelion visualization are lazy loaded only while a vis is opened -// this will duplicate styles only if both Timelion app and timelion visualization are loaded -// could be left here as it is since the Timelion app is deprecated -@import '../../vis_type_timelion/public/legacy/timelion_vis.scss'; diff --git a/src/plugins/timelion/public/index.ts b/src/plugins/timelion/public/index.ts deleted file mode 100644 index 866d8a4ad20a2..0000000000000 --- a/src/plugins/timelion/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 and the Server Side Public License, v 1; you may not 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 'kibana/public'; -import { TimelionPlugin as Plugin } from './plugin'; - -export function plugin(initializerContext: PluginInitializerContext) { - return new Plugin(initializerContext); -} diff --git a/src/plugins/timelion/public/lib/observe_resize.js b/src/plugins/timelion/public/lib/observe_resize.js deleted file mode 100644 index d2902a59821c3..0000000000000 --- a/src/plugins/timelion/public/lib/observe_resize.js +++ /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 and the Server Side Public License, v 1; you may 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 default function ($elem, fn, frequency) { - frequency = frequency || 500; - let currentHeight = $elem.height(); - let currentWidth = $elem.width(); - - let timeout; - - function checkLoop() { - timeout = setTimeout(function () { - if (currentHeight !== $elem.height() || currentWidth !== $elem.width()) { - currentHeight = $elem.height(); - currentWidth = $elem.width(); - - if (currentWidth > 0 && currentWidth > 0) fn(); - } - checkLoop(); - }, frequency); - } - - checkLoop(); - - return function () { - clearTimeout(timeout); - }; -} diff --git a/src/plugins/timelion/public/panels/panel.ts b/src/plugins/timelion/public/panels/panel.ts deleted file mode 100644 index 333634976eba1..0000000000000 --- a/src/plugins/timelion/public/panels/panel.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 and the Server Side Public License, v 1; you may not 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'; - -interface PanelConfig { - help?: string; - render?: Function; -} - -export class Panel { - name: string; - help: string; - render: Function | undefined; - - constructor(name: string, config: PanelConfig) { - this.name = name; - this.help = config.help || ''; - this.render = config.render; - - if (!config.render) { - throw new Error( - i18n.translate('timelion.panels.noRenderFunctionErrorMessage', { - defaultMessage: 'Panel must have a rendering function', - }) - ); - } - } -} diff --git a/src/plugins/timelion/public/panels/timechart/schema.ts b/src/plugins/timelion/public/panels/timechart/schema.ts deleted file mode 100644 index dc26adc6ea5f5..0000000000000 --- a/src/plugins/timelion/public/panels/timechart/schema.ts +++ /dev/null @@ -1,386 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import _ from 'lodash'; -import $ from 'jquery'; -import moment from 'moment-timezone'; -// @ts-ignore -import observeResize from '../../lib/observe_resize'; -import { _LEGACY_ as visTypeTimelion } from '../../../../vis_type_timelion/public'; -import { TimelionVisualizationDependencies } from '../../application'; - -const DEBOUNCE_DELAY = 50; - -export function timechartFn(dependencies: TimelionVisualizationDependencies) { - const { - $rootScope, - $compile, - uiSettings, - data: { - query: { timefilter }, - }, - } = dependencies; - - return function () { - return { - help: 'Draw a timeseries chart', - render($scope: any, $elem: any) { - const template = '
'; - const formatters = visTypeTimelion.tickFormatters() as any; - const getxAxisFormatter = visTypeTimelion.xaxisFormatterProvider(uiSettings); - const generateTicks = visTypeTimelion.generateTicksProvider(); - - // TODO: I wonder if we should supply our own moment that sets this every time? - // could just use angular's injection to provide a moment service? - moment.tz.setDefault(uiSettings.get('dateFormat:tz')); - - const render = $scope.seriesList.render || {}; - - $scope.chart = $scope.seriesList.list; - $scope.interval = $scope.interval; - $scope.search = $scope.search || _.noop; - - let legendValueNumbers: any; - let legendCaption: any; - const debouncedSetLegendNumbers = _.debounce(setLegendNumbers, DEBOUNCE_DELAY, { - maxWait: DEBOUNCE_DELAY, - leading: true, - trailing: false, - }); - // ensure legend is the same height with or without a caption so legend items do not move around - const emptyCaption = '
'; - - const defaultOptions = { - xaxis: { - mode: 'time', - tickLength: 5, - timezone: 'browser', - }, - selection: { - mode: 'x', - color: '#ccc', - }, - crosshair: { - mode: 'x', - color: '#C66', - lineWidth: 2, - }, - grid: { - show: render.grid, - borderWidth: 0, - borderColor: null, - margin: 10, - hoverable: true, - autoHighlight: false, - }, - legend: { - backgroundColor: 'rgb(255,255,255,0)', - position: 'nw', - labelBoxBorderColor: 'rgb(255,255,255,0)', - labelFormatter(label: any, series: any) { - const wrapperSpan = document.createElement('span'); - const labelSpan = document.createElement('span'); - const numberSpan = document.createElement('span'); - - wrapperSpan.setAttribute('class', 'ngLegendValue'); - wrapperSpan.setAttribute('kbn-accessible-click', ''); - wrapperSpan.setAttribute('ng-click', `toggleSeries(${series._id})`); - wrapperSpan.setAttribute('ng-focus', `focusSeries(${series._id})`); - wrapperSpan.setAttribute('ng-mouseover', `highlightSeries(${series._id})`); - - labelSpan.setAttribute('ng-non-bindable', ''); - labelSpan.appendChild(document.createTextNode(label)); - numberSpan.setAttribute('class', 'ngLegendValueNumber'); - - wrapperSpan.appendChild(labelSpan); - wrapperSpan.appendChild(numberSpan); - - return wrapperSpan.outerHTML; - }, - }, - colors: [ - '#01A4A4', - '#C66', - '#D0D102', - '#616161', - '#00A1CB', - '#32742C', - '#F18D05', - '#113F8C', - '#61AE24', - '#D70060', - ], - }; - - const originalColorMap = new Map(); - $scope.chart.forEach((series: any, seriesIndex: any) => { - if (!series.color) { - const colorIndex = seriesIndex % defaultOptions.colors.length; - series.color = defaultOptions.colors[colorIndex]; - } - originalColorMap.set(series, series.color); - }); - - let highlightedSeries: any; - let focusedSeries: any; - function unhighlightSeries() { - if (highlightedSeries === null) { - return; - } - - highlightedSeries = null; - focusedSeries = null; - $scope.chart.forEach((series: any) => { - series.color = originalColorMap.get(series); // reset the colors - }); - drawPlot($scope.chart); - } - $scope.highlightSeries = _.debounce(function (id: any) { - if (highlightedSeries === id) { - return; - } - - highlightedSeries = id; - $scope.chart.forEach((series: any, seriesIndex: any) => { - if (seriesIndex !== id) { - series.color = 'rgba(128,128,128,0.1)'; // mark as grey - } else { - series.color = originalColorMap.get(series); // color it like it was - } - }); - drawPlot($scope.chart); - }, DEBOUNCE_DELAY); - $scope.focusSeries = function (id: any) { - focusedSeries = id; - $scope.highlightSeries(id); - }; - - $scope.toggleSeries = function (id: any) { - const series = $scope.chart[id]; - series._hide = !series._hide; - drawPlot($scope.chart); - }; - - const cancelResize = observeResize($elem, function () { - drawPlot($scope.chart); - }); - - $scope.$on('$destroy', function () { - cancelResize(); - $elem.off('plothover'); - $elem.off('plotselected'); - $elem.off('mouseleave'); - }); - - $elem.on('plothover', function (event: any, pos: any, item: any) { - $rootScope.$broadcast('timelionPlotHover', event, pos, item); - }); - - $elem.on('plotselected', function (event: any, ranges: any) { - timefilter.timefilter.setTime({ - from: moment(ranges.xaxis.from), - to: moment(ranges.xaxis.to), - }); - }); - - $elem.on('mouseleave', function () { - $rootScope.$broadcast('timelionPlotLeave'); - }); - - $scope.$on('timelionPlotHover', function (angularEvent: any, flotEvent: any, pos: any) { - if (!$scope.plot) return; - $scope.plot.setCrosshair(pos); - debouncedSetLegendNumbers(pos); - }); - - $scope.$on('timelionPlotLeave', function () { - if (!$scope.plot) return; - $scope.plot.clearCrosshair(); - clearLegendNumbers(); - }); - - // Shamelessly borrowed from the flotCrosshairs example - function setLegendNumbers(pos: any) { - unhighlightSeries(); - - const plot = $scope.plot; - - const axes = plot.getAxes(); - if (pos.x < axes.xaxis.min || pos.x > axes.xaxis.max) { - return; - } - - let i; - const dataset = plot.getData(); - if (legendCaption) { - legendCaption.text( - moment(pos.x).format( - _.get(dataset, '[0]._global.legend.timeFormat', visTypeTimelion.DEFAULT_TIME_FORMAT) - ) - ); - } - for (i = 0; i < dataset.length; ++i) { - const series = dataset[i]; - const useNearestPoint = series.lines.show && !series.lines.steps; - const precision = _.get(series, '_meta.precision', 2); - - if (series._hide) continue; - - const currentPoint = series.data.find((point: any, index: number) => { - if (index + 1 === series.data.length) { - return true; - } - if (useNearestPoint) { - return pos.x - point[0] < series.data[index + 1][0] - pos.x; - } else { - return pos.x < series.data[index + 1][0]; - } - }); - - const y = currentPoint[1]; - - if (y != null) { - let label = y.toFixed(precision); - if (series.yaxis.tickFormatter) { - label = series.yaxis.tickFormatter(label, series.yaxis); - } - legendValueNumbers.eq(i).text(`(${label})`); - } else { - legendValueNumbers.eq(i).empty(); - } - } - } - - function clearLegendNumbers() { - if (legendCaption) { - legendCaption.html(emptyCaption); - } - _.each(legendValueNumbers, function (num) { - $(num).empty(); - }); - } - - let legendScope = $scope.$new(); - function drawPlot(plotConfig: any) { - if (!$('.chart-canvas', $elem).length) $elem.html(template); - const canvasElem = $('.chart-canvas', $elem); - - // we can't use `$.plot` to draw the chart when the height or width is 0 - // so, we'll need another event to trigger drawPlot to actually draw it - if (canvasElem.height() === 0 || canvasElem.width() === 0) { - return; - } - - const title = _(plotConfig).map('_title').compact().last() as any; - $('.chart-top-title', $elem).text(title == null ? '' : title); - - const options = _.cloneDeep(defaultOptions) as any; - - // Get the X-axis tick format - const time = timefilter.timefilter.getBounds() as any; - const interval = visTypeTimelion.calculateInterval( - time.min.valueOf(), - time.max.valueOf(), - uiSettings.get('timelion:target_buckets') || 200, - $scope.interval, - uiSettings.get('timelion:min_interval') || '1ms' - ); - const format = getxAxisFormatter(interval); - - // Use moment to format ticks so we get timezone correction - options.xaxis.tickFormatter = function (val: any) { - return moment(val).format(format); - }; - - // Calculate how many ticks can fit on the axis - const tickLetterWidth = 7; - const tickPadding = 45; - options.xaxis.ticks = Math.floor( - $elem.width() / (format.length * tickLetterWidth + tickPadding) - ); - - const series = _.map(plotConfig, function (serie: any, index) { - serie = _.cloneDeep( - _.defaults(serie, { - shadowSize: 0, - lines: { - lineWidth: 3, - }, - }) - ); - serie._id = index; - - if (serie.color) { - const span = document.createElement('span'); - span.style.color = serie.color; - serie.color = span.style.color; - } - - if (serie._hide) { - serie.data = []; - serie.stack = false; - // serie.color = "#ddd"; - serie.label = '(hidden) ' + serie.label; - } - - if (serie._global) { - _.mergeWith(options, serie._global, function (objVal, srcVal) { - // This is kind of gross, it means that you can't replace a global value with a null - // best you can do is an empty string. Deal with it. - if (objVal == null) return srcVal; - if (srcVal == null) return objVal; - }); - } - - return serie; - }); - - if (options.yaxes) { - options.yaxes.forEach((yaxis: any) => { - if (yaxis && yaxis.units) { - yaxis.tickFormatter = formatters[yaxis.units.type]; - const byteModes = ['bytes', 'bytes/s']; - if (byteModes.includes(yaxis.units.type)) { - yaxis.tickGenerator = generateTicks; - } - } - }); - } - - // @ts-ignore - $scope.plot = $.plot(canvasElem, _.compact(series), options); - - if ($scope.plot) { - $scope.$emit('timelionChartRendered'); - } - - legendScope.$destroy(); - legendScope = $scope.$new(); - // Used to toggle the series, and for displaying values on hover - legendValueNumbers = canvasElem.find('.ngLegendValueNumber'); - _.each(canvasElem.find('.ngLegendValue'), function (elem) { - $compile(elem)(legendScope); - }); - - if (_.get($scope.plot.getData(), '[0]._global.legend.showTime', true)) { - legendCaption = $(''); - legendCaption.html(emptyCaption); - canvasElem.find('div.legend table').append(legendCaption); - - // legend has been re-created. Apply focus on legend element when previously set - if (focusedSeries || focusedSeries === 0) { - const $legendLabels = canvasElem.find('div.legend table .legendLabel>span'); - $legendLabels.get(focusedSeries).focus(); - } - } - } - $scope.$watch('chart', drawPlot); - }, - }; - }; -} diff --git a/src/plugins/timelion/public/panels/timechart/timechart.ts b/src/plugins/timelion/public/panels/timechart/timechart.ts deleted file mode 100644 index 6af7096bcb282..0000000000000 --- a/src/plugins/timelion/public/panels/timechart/timechart.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { timechartFn } from './schema'; -import { Panel } from '../panel'; -import { TimelionVisualizationDependencies } from '../../application'; - -export function getTimeChart(dependencies: TimelionVisualizationDependencies) { - // Schema is broken out so that it may be extended for use in other plugins - // Its also easier to test. - return new Panel('timechart', timechartFn(dependencies)()); -} diff --git a/src/plugins/timelion/public/partials/load_sheet.html b/src/plugins/timelion/public/partials/load_sheet.html deleted file mode 100644 index 8d8cf7193416c..0000000000000 --- a/src/plugins/timelion/public/partials/load_sheet.html +++ /dev/null @@ -1,12 +0,0 @@ -
-

- - -
diff --git a/src/plugins/timelion/public/partials/save_sheet.html b/src/plugins/timelion/public/partials/save_sheet.html deleted file mode 100644 index 7773a9d25df71..0000000000000 --- a/src/plugins/timelion/public/partials/save_sheet.html +++ /dev/null @@ -1,107 +0,0 @@ -
- - -
-
- - - - - - - -
-
- - - -
-
-
- - {{opts.state.sheet[opts.state.selected]}} -
-
- - -
-
- -
-
-
-
diff --git a/src/plugins/timelion/public/partials/sheet_options.html b/src/plugins/timelion/public/partials/sheet_options.html deleted file mode 100644 index eae5709331659..0000000000000 --- a/src/plugins/timelion/public/partials/sheet_options.html +++ /dev/null @@ -1,36 +0,0 @@ -
-

- -
-
- - -
-
- - -
-
-
diff --git a/src/plugins/timelion/public/plugin.ts b/src/plugins/timelion/public/plugin.ts deleted file mode 100644 index 63ea9a38e2795..0000000000000 --- a/src/plugins/timelion/public/plugin.ts +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { filter, map } from 'rxjs/operators'; -import { - CoreSetup, - Plugin, - PluginInitializerContext, - DEFAULT_APP_CATEGORIES, - AppMountParameters, - AppUpdater, - ScopedHistory, - AppNavLinkStatus, -} from '../../../core/public'; -import { Panel } from './panels/panel'; -import { KibanaLegacyStart } from '../../kibana_legacy/public'; -import { createKbnUrlTracker } from '../../kibana_utils/public'; -import { DataPublicPluginStart, esFilters, DataPublicPluginSetup } from '../../data/public'; -import { NavigationPublicPluginStart } from '../../navigation/public'; -import { VisualizationsStart } from '../../visualizations/public'; -import { SavedObjectsStart } from '../../saved_objects/public'; -import { - VisTypeTimelionPluginStart, - VisTypeTimelionPluginSetup, -} from '../../vis_type_timelion/public'; - -export interface TimelionPluginSetupDependencies { - data: DataPublicPluginSetup; - visTypeTimelion: VisTypeTimelionPluginSetup; -} - -export interface TimelionPluginStartDependencies { - data: DataPublicPluginStart; - navigation: NavigationPublicPluginStart; - visualizations: VisualizationsStart; - visTypeTimelion: VisTypeTimelionPluginStart; - savedObjects: SavedObjectsStart; - kibanaLegacy: KibanaLegacyStart; -} - -/** @internal */ -export class TimelionPlugin - implements Plugin { - initializerContext: PluginInitializerContext; - private appStateUpdater = new BehaviorSubject(() => ({})); - private stopUrlTracking: (() => void) | undefined = undefined; - private currentHistory: ScopedHistory | undefined = undefined; - - constructor(initializerContext: PluginInitializerContext) { - this.initializerContext = initializerContext; - } - - public setup( - core: CoreSetup, - { - data, - visTypeTimelion, - }: { data: DataPublicPluginSetup; visTypeTimelion: VisTypeTimelionPluginSetup } - ) { - const timelionPanels: Map = new Map(); - - const { appMounted, appUnMounted, stop: stopUrlTracker } = createKbnUrlTracker({ - baseUrl: core.http.basePath.prepend('/app/timelion'), - defaultSubUrl: '#/', - storageKey: `lastUrl:${core.http.basePath.get()}:timelion`, - navLinkUpdater$: this.appStateUpdater, - toastNotifications: core.notifications.toasts, - stateParams: [ - { - kbnUrlKey: '_g', - stateUpdate$: data.query.state$.pipe( - filter( - ({ changes }) => !!(changes.globalFilters || changes.time || changes.refreshInterval) - ), - map(({ state }) => ({ - ...state, - filters: state.filters?.filter(esFilters.isFilterPinned), - })) - ), - }, - ], - getHistory: () => this.currentHistory!, - }); - - this.stopUrlTracking = () => { - stopUrlTracker(); - }; - - core.application.register({ - id: 'timelion', - title: 'Timelion', - order: 8000, - defaultPath: '#/', - euiIconType: 'logoKibana', - category: DEFAULT_APP_CATEGORIES.kibana, - navLinkStatus: - visTypeTimelion.isUiEnabled === false ? AppNavLinkStatus.hidden : AppNavLinkStatus.default, - mount: async (params: AppMountParameters) => { - const [coreStart, pluginsStart] = await core.getStartServices(); - await pluginsStart.kibanaLegacy.loadAngularBootstrap(); - this.currentHistory = params.history; - - appMounted(); - - const unlistenParentHistory = params.history.listen(() => { - window.dispatchEvent(new HashChangeEvent('hashchange')); - }); - - const { renderApp } = await import('./application'); - params.element.classList.add('timelionAppContainer'); - const unmount = renderApp({ - mountParams: params, - pluginInitializerContext: this.initializerContext, - timelionPanels, - core: coreStart, - plugins: pluginsStart, - }); - return () => { - unlistenParentHistory(); - unmount(); - appUnMounted(); - }; - }, - }); - } - - public start() {} - - public stop(): void { - if (this.stopUrlTracking) { - this.stopUrlTracking(); - } - } -} diff --git a/src/plugins/timelion/public/services/_saved_sheet.ts b/src/plugins/timelion/public/services/_saved_sheet.ts deleted file mode 100644 index a903c70aad69b..0000000000000 --- a/src/plugins/timelion/public/services/_saved_sheet.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { IUiSettingsClient } from 'kibana/public'; -import { SavedObjectsStart } from '../../../saved_objects/public'; - -// Used only by the savedSheets service, usually no reason to change this -export function createSavedSheetClass(savedObjects: SavedObjectsStart, config: IUiSettingsClient) { - class SavedSheet extends savedObjects.SavedObjectClass { - static type = 'timelion-sheet'; - - // if type:sheet has no mapping, we push this mapping into ES - static mapping = { - title: 'text', - hits: 'integer', - description: 'text', - timelion_sheet: 'text', - timelion_interval: 'keyword', - timelion_other_interval: 'keyword', - timelion_chart_height: 'integer', - timelion_columns: 'integer', - timelion_rows: 'integer', - version: 'integer', - }; - - // Order these fields to the top, the rest are alphabetical - static fieldOrder = ['title', 'description']; - // SavedSheet constructor. Usually you'd interact with an instance of this. - // ID is option, without it one will be generated on save. - constructor(id: string) { - super({ - type: SavedSheet.type, - mapping: SavedSheet.mapping, - - // if this is null/undefined then the SavedObject will be assigned the defaults - id, - - // default values that will get assigned if the doc is new - defaults: { - title: 'New TimeLion Sheet', - hits: 0, - description: '', - timelion_sheet: ['.es(*)'], - timelion_interval: 'auto', - timelion_chart_height: 275, - timelion_columns: config.get('timelion:default_columns') || 2, - timelion_rows: config.get('timelion:default_rows') || 2, - version: 1, - }, - }); - this.showInRecentlyAccessed = true; - this.getFullPath = () => `/app/timelion#/${this.id}`; - } - } - - return SavedSheet as unknown; -} diff --git a/src/plugins/timelion/public/services/saved_sheets.ts b/src/plugins/timelion/public/services/saved_sheets.ts deleted file mode 100644 index 373bb895c9806..0000000000000 --- a/src/plugins/timelion/public/services/saved_sheets.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 { SavedObjectLoader } from '../../../saved_objects/public'; -import { createSavedSheetClass } from './_saved_sheet'; -import { RenderDeps } from '../application'; - -export function initSavedSheetService(app: angular.IModule, deps: RenderDeps) { - const savedObjectsClient = deps.core.savedObjects.client; - const SavedSheet = createSavedSheetClass(deps.plugins.savedObjects, deps.core.uiSettings); - - const savedSheetLoader = new SavedObjectLoader(SavedSheet, savedObjectsClient); - savedSheetLoader.urlFor = (id) => `#/${encodeURIComponent(id)}`; - // Customize loader properties since adding an 's' on type doesn't work for type 'timelion-sheet'. - savedSheetLoader.loaderProperties = { - name: 'timelion-sheet', - noun: 'Saved Sheets', - nouns: 'saved sheets', - }; - // This is the only thing that gets injected into controllers - app.service('savedSheets', function () { - return savedSheetLoader; - }); - - return savedSheetLoader; -} diff --git a/src/plugins/timelion/public/timelion_app_state.ts b/src/plugins/timelion/public/timelion_app_state.ts deleted file mode 100644 index 348a97583d37b..0000000000000 --- a/src/plugins/timelion/public/timelion_app_state.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { createStateContainer, syncState, IKbnUrlStateStorage } from '../../kibana_utils/public'; - -import { TimelionAppState, TimelionAppStateTransitions } from './types'; - -const STATE_STORAGE_KEY = '_a'; - -interface Arguments { - kbnUrlStateStorage: IKbnUrlStateStorage; - stateDefaults: TimelionAppState; -} - -export function initTimelionAppState({ stateDefaults, kbnUrlStateStorage }: Arguments) { - const urlState = kbnUrlStateStorage.get(STATE_STORAGE_KEY); - const initialState = { - ...stateDefaults, - ...urlState, - }; - - /* - make sure url ('_a') matches initial state - Initializing appState does two things - first it translates the defaults into AppState, - second it updates appState based on the url (the url trumps the defaults). This means if - we update the state format at all and want to handle BWC, we must not only migrate the - data stored with saved vis, but also any old state in the url. - */ - kbnUrlStateStorage.set(STATE_STORAGE_KEY, initialState, { replace: true }); - - const stateContainer = createStateContainer( - initialState, - { - set: (state) => (prop, value) => ({ ...state, [prop]: value }), - updateState: (state) => (newValues) => ({ ...state, ...newValues }), - } - ); - - const { start: startStateSync, stop: stopStateSync } = syncState({ - storageKey: STATE_STORAGE_KEY, - stateContainer: { - ...stateContainer, - set: (state) => { - if (state) { - // syncState utils requires to handle incoming "null" value - stateContainer.set(state); - } - }, - }, - stateStorage: kbnUrlStateStorage, - }); - - // start syncing the appState with the ('_a') url - startStateSync(); - - return { stateContainer, stopStateSync }; -} diff --git a/src/plugins/timelion/public/types.ts b/src/plugins/timelion/public/types.ts deleted file mode 100644 index bfdbd3878ec23..0000000000000 --- a/src/plugins/timelion/public/types.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export interface TimelionAppState { - sheet: string[]; - selected: number; - columns: number; - rows: number; - interval: string; -} - -export interface TimelionAppStateTransitions { - set: ( - state: TimelionAppState - ) => (prop: T, value: TimelionAppState[T]) => TimelionAppState; - updateState: ( - state: TimelionAppState - ) => (newValues: Partial) => TimelionAppState; -} diff --git a/src/plugins/timelion/server/config.ts b/src/plugins/timelion/server/config.ts deleted file mode 100644 index d74c4c237b2b7..0000000000000 --- a/src/plugins/timelion/server/config.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 and the Server Side Public License, v 1; you may not 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'; - -export const configSchema = { - schema: schema.object({ - graphiteUrls: schema.maybe(schema.arrayOf(schema.string())), - enabled: schema.boolean({ defaultValue: true }), - ui: schema.object({ - enabled: schema.boolean({ defaultValue: true }), - }), - }), -}; - -export type TimelionConfigType = TypeOf; diff --git a/src/plugins/timelion/server/deprecations.ts b/src/plugins/timelion/server/deprecations.ts deleted file mode 100644 index 2358dd313b74f..0000000000000 --- a/src/plugins/timelion/server/deprecations.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 { - CoreStart, - SavedObjectsClient, - Logger, - GetDeprecationsContext, - DeprecationsDetails, -} from 'src/core/server'; - -export const getTimelionSheetsCount = async ( - savedObjectsClient: Pick -) => { - const { total } = await savedObjectsClient.find({ type: 'timelion-sheet', perPage: 1 }); - return total; -}; - -export const showWarningMessageIfTimelionSheetWasFound = async ( - core: CoreStart, - logger: Logger -) => { - const { savedObjects } = core; - const savedObjectsClient = savedObjects.createInternalRepository(); - const count = await getTimelionSheetsCount(savedObjectsClient); - if (count > 0) { - logger.warn( - 'Deprecated since 7.0, the Timelion app will be removed in 7.16. To continue using your Timelion worksheets, migrate them to a dashboard. See https://www.elastic.co/guide/en/kibana/current/create-panels-with-timelion.html.' - ); - } -}; - -/** - * Deprecated since 7.0, the Timelion app will be removed in 8.0. - * To continue using your Timelion worksheets, migrate them to a dashboard. - * - * @link https://www.elastic.co/guide/en/kibana/master/timelion.html#timelion-deprecation - **/ -export async function getDeprecations({ - savedObjectsClient, -}: GetDeprecationsContext): Promise { - const deprecations: DeprecationsDetails[] = []; - const count = await getTimelionSheetsCount(savedObjectsClient); - - if (count > 0) { - deprecations.push({ - title: 'Found Timelion worksheets', - message: `You have ${count} Timelion worksheets. The Timelion app will be removed in 7.16. To continue using your Timelion worksheets, migrate them to a dashboard.`, - documentationUrl: - 'https://www.elastic.co/guide/en/kibana/current/create-panels-with-timelion.html', - level: 'warning', - correctiveActions: { - manualSteps: [ - 'Navigate to the Kibana Dashboard and click "Create dashboard".', - 'Select Timelion from the "New Visualization" window.', - 'Open a new tab, open the Timelion app, select the chart you want to copy, then copy the chart expression.', - 'Go to Timelion, paste the chart expression in the Timelion expression field, then click Update.', - 'In the toolbar, click Save.', - 'On the Save visualization window, enter the visualization Title, then click Save and return.', - ], - }, - }); - } - - return deprecations; -} diff --git a/src/plugins/timelion/server/index.ts b/src/plugins/timelion/server/index.ts deleted file mode 100644 index fb77df100766a..0000000000000 --- a/src/plugins/timelion/server/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. - */ - -import { PluginInitializerContext, PluginConfigDescriptor } from 'src/core/server'; -import { TimelionPlugin } from './plugin'; -import { configSchema, TimelionConfigType } from './config'; - -export const config: PluginConfigDescriptor = { - schema: configSchema.schema, -}; - -export const plugin = (context: PluginInitializerContext) => - new TimelionPlugin(context); diff --git a/src/plugins/timelion/server/plugin.ts b/src/plugins/timelion/server/plugin.ts deleted file mode 100644 index edbba9b565ae4..0000000000000 --- a/src/plugins/timelion/server/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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { CoreSetup, CoreStart, Plugin, PluginInitializerContext, Logger } from 'src/core/server'; -import { i18n } from '@kbn/i18n'; -import { schema } from '@kbn/config-schema'; -import { TimelionConfigType } from './config'; -import { timelionSheetSavedObjectType } from './saved_objects'; -import { getDeprecations, showWarningMessageIfTimelionSheetWasFound } from './deprecations'; - -export class TimelionPlugin implements Plugin { - private logger: Logger; - - constructor(context: PluginInitializerContext) { - this.logger = context.logger.get(); - } - - public setup(core: CoreSetup) { - core.capabilities.registerProvider(() => ({ - timelion: { - save: true, - show: true, - }, - })); - core.savedObjects.registerType(timelionSheetSavedObjectType); - - core.uiSettings.register({ - 'timelion:showTutorial': { - name: i18n.translate('timelion.uiSettings.showTutorialLabel', { - defaultMessage: 'Show tutorial', - }), - value: false, - description: i18n.translate('timelion.uiSettings.showTutorialDescription', { - defaultMessage: 'Should I show the tutorial by default when entering the timelion app?', - }), - category: ['timelion'], - schema: schema.boolean(), - }, - 'timelion:default_columns': { - name: i18n.translate('timelion.uiSettings.defaultColumnsLabel', { - defaultMessage: 'Default columns', - }), - value: 2, - description: i18n.translate('timelion.uiSettings.defaultColumnsDescription', { - defaultMessage: 'Number of columns on a timelion sheet by default', - }), - category: ['timelion'], - schema: schema.number(), - }, - 'timelion:default_rows': { - name: i18n.translate('timelion.uiSettings.defaultRowsLabel', { - defaultMessage: 'Default rows', - }), - value: 2, - description: i18n.translate('timelion.uiSettings.defaultRowsDescription', { - defaultMessage: 'Number of rows on a timelion sheet by default', - }), - category: ['timelion'], - schema: schema.number(), - }, - }); - - core.deprecations.registerDeprecations({ getDeprecations }); - } - start(core: CoreStart) { - showWarningMessageIfTimelionSheetWasFound(core, this.logger); - } - stop() {} -} diff --git a/src/plugins/timelion/server/saved_objects/index.ts b/src/plugins/timelion/server/saved_objects/index.ts deleted file mode 100644 index 0dd070958d09a..0000000000000 --- a/src/plugins/timelion/server/saved_objects/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 { timelionSheetSavedObjectType } from './timelion_sheet'; diff --git a/src/plugins/timelion/server/saved_objects/timelion_sheet.ts b/src/plugins/timelion/server/saved_objects/timelion_sheet.ts deleted file mode 100644 index 231e049280bb1..0000000000000 --- a/src/plugins/timelion/server/saved_objects/timelion_sheet.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 { SavedObjectsType } from 'kibana/server'; - -export const timelionSheetSavedObjectType: SavedObjectsType = { - name: 'timelion-sheet', - hidden: false, - namespaceType: 'single', - management: { - icon: 'visTimelion', - defaultSearchField: 'title', - importableAndExportable: true, - getTitle(obj) { - return obj.attributes.title; - }, - getInAppUrl(obj) { - return { - path: `/app/timelion#/${encodeURIComponent(obj.id)}`, - uiCapabilitiesPath: 'timelion.show', - }; - }, - }, - mappings: { - properties: { - description: { type: 'text' }, - hits: { type: 'integer' }, - kibanaSavedObjectMeta: { - properties: { - searchSourceJSON: { type: 'text' }, - }, - }, - timelion_chart_height: { type: 'integer' }, - timelion_columns: { type: 'integer' }, - timelion_interval: { type: 'keyword' }, - timelion_other_interval: { type: 'keyword' }, - timelion_rows: { type: 'integer' }, - timelion_sheet: { type: 'text' }, - title: { type: 'text' }, - version: { type: 'integer' }, - }, - }, -}; diff --git a/src/plugins/timelion/tsconfig.json b/src/plugins/timelion/tsconfig.json deleted file mode 100644 index 594901c3cc1ed..0000000000000 --- a/src/plugins/timelion/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": [ - "public/**/*", - "server/**/*" - ], - "references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../visualizations/tsconfig.json" }, - { "path": "../navigation/tsconfig.json" }, - { "path": "../vis_type_timelion/tsconfig.json" }, - { "path": "../saved_objects/tsconfig.json" }, - { "path": "../kibana_legacy/tsconfig.json" }, - ] -} diff --git a/src/plugins/ui_actions/jest.config.js b/src/plugins/ui_actions/jest.config.js index 8ee6a40e19541..f482574316632 100644 --- a/src/plugins/ui_actions/jest.config.js +++ b/src/plugins/ui_actions/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/ui_actions'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/ui_actions', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/ui_actions/public/**/*.{ts,tsx}'], }; diff --git a/src/plugins/ui_actions/kibana.json b/src/plugins/ui_actions/kibana.json index d112f6310a1fe..ceeadc05ee91e 100644 --- a/src/plugins/ui_actions/kibana.json +++ b/src/plugins/ui_actions/kibana.json @@ -7,5 +7,6 @@ "name": "App Services", "githubTeam": "kibana-app-services" }, + "description": "Adds UI Actions service to Kibana", "requiredBundles": ["kibanaUtils", "kibanaReact"] } diff --git a/src/plugins/url_forwarding/jest.config.js b/src/plugins/url_forwarding/jest.config.js index 5e452d70753d5..24a72465626f6 100644 --- a/src/plugins/url_forwarding/jest.config.js +++ b/src/plugins/url_forwarding/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/url_forwarding'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/url_forwarding', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/url_forwarding/public/**/*.{ts,tsx}'], }; diff --git a/src/plugins/url_forwarding/kibana.json b/src/plugins/url_forwarding/kibana.json index a8b0571230b72..3e48cf73de5ef 100644 --- a/src/plugins/url_forwarding/kibana.json +++ b/src/plugins/url_forwarding/kibana.json @@ -6,6 +6,5 @@ "owner": { "name": "Vis Editors", "githubTeam": "kibana-vis-editors" - }, - "requiredPlugins": ["kibanaLegacy"] + } } diff --git a/src/plugins/url_forwarding/public/forward_app/forward_app.test.ts b/src/plugins/url_forwarding/public/forward_app/forward_app.test.ts new file mode 100644 index 0000000000000..c45bde0d67891 --- /dev/null +++ b/src/plugins/url_forwarding/public/forward_app/forward_app.test.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 type { Location } from 'history'; +import type { AppMountParameters, CoreSetup, ScopedHistory } from 'kibana/public'; +import { coreMock } from '../../../../core/public/mocks'; +import type { UrlForwardingStart } from '../plugin'; +import { createLegacyUrlForwardApp } from './forward_app'; + +function createAppMountParams(hash: string): AppMountParameters { + return { + history: { + location: { + hash, + } as Location, + } as ScopedHistory, + } as AppMountParameters; +} + +describe('forward_app', () => { + let coreSetup: CoreSetup<{}, UrlForwardingStart>; + let coreStart: ReturnType; + + beforeEach(() => { + coreSetup = coreMock.createSetup({ basePath: '/base/path' }); + coreStart = coreMock.createStart({ basePath: '/base/path' }); + coreSetup.getStartServices = () => Promise.resolve([coreStart, {}, {} as any]); + }); + + it('should forward to defaultRoute if hash is not a known redirect', async () => { + coreStart.uiSettings.get.mockImplementation((key) => { + if (key === 'defaultRoute') return '/app/defaultApp'; + throw new Error('Mock implementation missing'); + }); + + const app = createLegacyUrlForwardApp(coreSetup, [ + { legacyAppId: 'discover', newAppId: 'discover', rewritePath: (p) => p }, + ]); + await app.mount(createAppMountParams('#/foobar')); + expect(coreStart.application.navigateToUrl).toHaveBeenCalledWith('/base/path/app/defaultApp'); + }); + + it('should not forward to defaultRoute if hash path is a known redirect', async () => { + const app = createLegacyUrlForwardApp(coreSetup, [ + { legacyAppId: 'discover', newAppId: 'discover', rewritePath: (p) => p }, + ]); + await app.mount(createAppMountParams('#/discover')); + expect(coreStart.application.navigateToUrl).not.toHaveBeenCalled(); + }); +}); diff --git a/src/plugins/url_forwarding/public/forward_app/forward_app.ts b/src/plugins/url_forwarding/public/forward_app/forward_app.ts index 96c4fab5f3331..3a66e207f8c26 100644 --- a/src/plugins/url_forwarding/public/forward_app/forward_app.ts +++ b/src/plugins/url_forwarding/public/forward_app/forward_app.ts @@ -23,23 +23,18 @@ export const createLegacyUrlForwardApp = ( async mount(params: AppMountParameters) { const hash = params.history.location.hash.substr(1); - if (!hash) { - const [, , kibanaLegacyStart] = await core.getStartServices(); - kibanaLegacyStart.navigateToDefaultApp(); - } - const [ { application, + uiSettings, http: { basePath }, }, ] = await core.getStartServices(); - const result = await navigateToLegacyKibanaUrl(hash, forwards, basePath, application); - - if (!result.navigated) { - const [, , kibanaLegacyStart] = await core.getStartServices(); - kibanaLegacyStart.navigateToDefaultApp(); + const { navigated } = navigateToLegacyKibanaUrl(hash, forwards, basePath, application); + if (!navigated) { + const defaultRoute = uiSettings.get('defaultRoute'); + application.navigateToUrl(basePath.prepend(defaultRoute)); } return () => {}; diff --git a/src/plugins/url_forwarding/public/mocks.ts b/src/plugins/url_forwarding/public/mocks.ts index 67b521b9d697d..582bb004b655e 100644 --- a/src/plugins/url_forwarding/public/mocks.ts +++ b/src/plugins/url_forwarding/public/mocks.ts @@ -17,7 +17,6 @@ const createSetupContract = (): Setup => ({ const createStartContract = (): Start => ({ getForwards: jest.fn(), - navigateToDefaultApp: jest.fn(), navigateToLegacyKibanaUrl: jest.fn(), }); diff --git a/src/plugins/url_forwarding/public/navigate_to_default_app.ts b/src/plugins/url_forwarding/public/navigate_to_default_app.ts deleted file mode 100644 index 0c934ac9c6844..0000000000000 --- a/src/plugins/url_forwarding/public/navigate_to_default_app.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { ApplicationStart, IBasePath } from 'kibana/public'; -import { ForwardDefinition } from './plugin'; - -export function navigateToDefaultApp( - defaultAppId: string, - forwards: ForwardDefinition[], - application: ApplicationStart, - basePath: IBasePath, - currentAppId: string | undefined, - overwriteHash: boolean -) { - // navigate to the respective path in the legacy kibana plugin by default (for unmigrated plugins) - let targetAppId = 'kibana'; - let targetAppPath = `#/${defaultAppId}`; - - // try to find an existing redirect for the target path if possible - // this avoids having to load the legacy app just to get redirected to a core application again afterwards - const relevantForward = forwards.find((forward) => defaultAppId.startsWith(forward.legacyAppId)); - if (relevantForward) { - targetAppPath = relevantForward.rewritePath(`/${defaultAppId}`); - targetAppId = relevantForward.newAppId; - } - - // when the correct app is already loaded, just set the hash to the right value - // otherwise use navigateToApp (or setting href in case of kibana app) - if (currentAppId !== targetAppId) { - application.navigateToApp(targetAppId, { path: targetAppPath, replace: true }); - } else if (overwriteHash) { - window.location.hash = targetAppPath; - } -} diff --git a/src/plugins/url_forwarding/public/plugin.ts b/src/plugins/url_forwarding/public/plugin.ts index 1151e853f28ba..ee56ba73eb24e 100644 --- a/src/plugins/url_forwarding/public/plugin.ts +++ b/src/plugins/url_forwarding/public/plugin.ts @@ -7,9 +7,6 @@ */ import { CoreStart, CoreSetup } from 'kibana/public'; -import { KibanaLegacyStart } from 'src/plugins/kibana_legacy/public'; -import { Subscription } from 'rxjs'; -import { navigateToDefaultApp } from './navigate_to_default_app'; import { createLegacyUrlForwardApp } from './forward_app'; import { navigateToLegacyKibanaUrl } from './forward_app/navigate_to_legacy_kibana_url'; @@ -21,8 +18,6 @@ export interface ForwardDefinition { export class UrlForwardingPlugin { private forwardDefinitions: ForwardDefinition[] = []; - private currentAppId: string | undefined; - private currentAppIdSubscription: Subscription | undefined; public setup(core: CoreSetup<{}, UrlForwardingStart>) { core.application.register(createLegacyUrlForwardApp(core, this.forwardDefinitions)); @@ -71,30 +66,8 @@ export class UrlForwardingPlugin { }; } - public start( - { application, http: { basePath }, uiSettings }: CoreStart, - { kibanaLegacy }: { kibanaLegacy: KibanaLegacyStart } - ) { - this.currentAppIdSubscription = application.currentAppId$.subscribe((currentAppId) => { - this.currentAppId = currentAppId; - }); + public start({ application, http: { basePath } }: CoreStart) { return { - /** - * Navigates to the app defined as kibana.defaultAppId. - * This takes redirects into account and uses the right mechanism to navigate. - */ - navigateToDefaultApp: ( - { overwriteHash }: { overwriteHash: boolean } = { overwriteHash: true } - ) => { - navigateToDefaultApp( - kibanaLegacy.config.defaultAppId, - this.forwardDefinitions, - application, - basePath, - this.currentAppId, - overwriteHash - ); - }, /** * Resolves the provided hash using the registered forwards and navigates to the target app. * If a navigation happened, `{ navigated: true }` will be returned. @@ -111,12 +84,6 @@ export class UrlForwardingPlugin { getForwards: () => this.forwardDefinitions, }; } - - public stop() { - if (this.currentAppIdSubscription) { - this.currentAppIdSubscription.unsubscribe(); - } - } } export type UrlForwardingSetup = ReturnType; diff --git a/src/plugins/usage_collection/jest.config.js b/src/plugins/usage_collection/jest.config.js index 25994eeec9820..f93d12327cc1b 100644 --- a/src/plugins/usage_collection/jest.config.js +++ b/src/plugins/usage_collection/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/usage_collection'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/usage_collection', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/usage_collection/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/src/plugins/vis_default_editor/jest.config.js b/src/plugins/vis_default_editor/jest.config.js index 52276e29c46c4..c921db167c1e9 100644 --- a/src/plugins/vis_default_editor/jest.config.js +++ b/src/plugins/vis_default_editor/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/vis_default_editor'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_default_editor', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/vis_default_editor/public/**/*.{ts,tsx}'], }; diff --git a/src/plugins/vis_default_editor/public/components/__snapshots__/agg.test.tsx.snap b/src/plugins/vis_default_editor/public/components/__snapshots__/agg.test.tsx.snap index 26173cddb3716..bc6d28bd5c1c4 100644 --- a/src/plugins/vis_default_editor/public/components/__snapshots__/agg.test.tsx.snap +++ b/src/plugins/vis_default_editor/public/components/__snapshots__/agg.test.tsx.snap @@ -19,6 +19,7 @@ exports[`DefaultEditorAgg component should init with the default set of props 1` /src/plugins/vis_type_markdown'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_type_markdown', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/vis_type_markdown/{public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/vis_type_metric/jest.config.js b/src/plugins/vis_type_metric/jest.config.js deleted file mode 100644 index 3029320d2e4d4..0000000000000 --- a/src/plugins/vis_type_metric/jest.config.js +++ /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 and the Server Side Public License, v 1; you may 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/vis_type_metric'], -}; diff --git a/src/plugins/vis_type_metric/public/plugin.ts b/src/plugins/vis_type_metric/public/plugin.ts deleted file mode 100644 index 051a10eb3c72f..0000000000000 --- a/src/plugins/vis_type_metric/public/plugin.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'kibana/public'; -import { Plugin as ExpressionsPublicPlugin } from '../../expressions/public'; -import { VisualizationsSetup } from '../../visualizations/public'; - -import { createMetricVisFn } from './metric_vis_fn'; -import { createMetricVisTypeDefinition } from './metric_vis_type'; -import { ChartsPluginSetup } from '../../charts/public'; -import { DataPublicPluginStart } from '../../data/public'; -import { setFormatService } from './services'; -import { ConfigSchema } from '../config'; -import { metricVisRenderer } from './metric_vis_renderer'; - -/** @internal */ -export interface MetricVisPluginSetupDependencies { - expressions: ReturnType; - visualizations: VisualizationsSetup; - charts: ChartsPluginSetup; -} - -/** @internal */ -export interface MetricVisPluginStartDependencies { - data: DataPublicPluginStart; -} - -/** @internal */ -export class MetricVisPlugin implements Plugin { - initializerContext: PluginInitializerContext; - - constructor(initializerContext: PluginInitializerContext) { - this.initializerContext = initializerContext; - } - - public setup( - core: CoreSetup, - { expressions, visualizations, charts }: MetricVisPluginSetupDependencies - ) { - expressions.registerFunction(createMetricVisFn); - expressions.registerRenderer(metricVisRenderer); - visualizations.createBaseVisualization(createMetricVisTypeDefinition()); - } - - public start(core: CoreStart, { data }: MetricVisPluginStartDependencies) { - setFormatService(data.fieldFormats); - } -} diff --git a/src/plugins/vis_type_metric/public/services.ts b/src/plugins/vis_type_metric/public/services.ts deleted file mode 100644 index 96d6b0f7a1cd3..0000000000000 --- a/src/plugins/vis_type_metric/public/services.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { createGetterSetter } from '../../kibana_utils/common'; -import { DataPublicPluginStart } from '../../data/public'; - -export const [getFormatService, setFormatService] = createGetterSetter< - DataPublicPluginStart['fieldFormats'] ->('metric data.fieldFormats'); diff --git a/src/plugins/vis_type_metric/public/to_ast.ts b/src/plugins/vis_type_metric/public/to_ast.ts deleted file mode 100644 index ec9c2b3b0157e..0000000000000 --- a/src/plugins/vis_type_metric/public/to_ast.ts +++ /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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { get } from 'lodash'; -import { getVisSchemas, SchemaConfig, VisToExpressionAst } from '../../visualizations/public'; -import { buildExpression, buildExpressionFunction } from '../../expressions/public'; -import { MetricVisExpressionFunctionDefinition } from './metric_vis_fn'; -import { - EsaggsExpressionFunctionDefinition, - IndexPatternLoadExpressionFunctionDefinition, -} from '../../data/public'; -import { VisParams } from './types'; - -const prepareDimension = (params: SchemaConfig) => { - const visdimension = buildExpressionFunction('visdimension', { accessor: params.accessor }); - - if (params.format) { - visdimension.addArgument('format', params.format.id); - visdimension.addArgument('formatParams', JSON.stringify(params.format.params)); - } - - return buildExpression([visdimension]); -}; - -export const toExpressionAst: VisToExpressionAst = (vis, params) => { - const esaggs = buildExpressionFunction('esaggs', { - index: buildExpression([ - buildExpressionFunction('indexPatternLoad', { - id: vis.data.indexPattern!.id!, - }), - ]), - metricsAtAllLevels: vis.isHierarchical(), - partialRows: false, - aggs: vis.data.aggs!.aggs.map((agg) => buildExpression(agg.toExpressionAst())), - }); - - const schemas = getVisSchemas(vis, params); - - const { - percentageMode, - percentageFormatPattern, - useRanges, - colorSchema, - metricColorMode, - colorsRange, - labels, - invertColors, - style, - } = vis.params.metric; - - // fix formatter for percentage mode - if (get(vis.params, 'metric.percentageMode') === true) { - schemas.metric.forEach((metric: SchemaConfig) => { - metric.format = { - id: 'percent', - params: { pattern: percentageFormatPattern }, - }; - }); - } - - // @ts-expect-error - const metricVis = buildExpressionFunction('metricVis', { - percentageMode, - colorSchema, - colorMode: metricColorMode, - useRanges, - invertColors, - showLabels: labels?.show ?? false, - }); - - if (style) { - metricVis.addArgument('bgFill', style.bgFill); - metricVis.addArgument('font', buildExpression(`font size=${style.fontSize}`)); - metricVis.addArgument('subText', style.subText); - } - - if (colorsRange) { - colorsRange.forEach((range: any) => { - metricVis.addArgument( - 'colorRange', - buildExpression(`range from=${range.from} to=${range.to}`) - ); - }); - } - - if (schemas.group) { - metricVis.addArgument('bucket', prepareDimension(schemas.group[0])); - } - - schemas.metric.forEach((metric) => { - metricVis.addArgument('metric', prepareDimension(metric)); - }); - - const ast = buildExpression([esaggs, metricVis]); - - return ast.toAst(); -}; diff --git a/src/plugins/vis_type_metric/public/types.ts b/src/plugins/vis_type_metric/public/types.ts deleted file mode 100644 index 45b8e17425891..0000000000000 --- a/src/plugins/vis_type_metric/public/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 and the Server Side Public License, v 1; you may not 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 '../../expressions/public'; -import { SchemaConfig } from '../../visualizations/public'; -import { ColorMode, Labels, Style, ColorSchemas } from '../../charts/public'; - -export const visType = 'metric'; - -export interface DimensionsVisParam { - metrics: SchemaConfig[]; - bucket?: SchemaConfig; -} - -export interface MetricVisParam { - percentageMode: boolean; - percentageFormatPattern?: string; - useRanges: boolean; - colorSchema: ColorSchemas; - metricColorMode: ColorMode; - colorsRange: Range[]; - labels: Labels; - invertColors: boolean; - style: Style; -} - -export interface VisParams { - addTooltip: boolean; - addLegend: boolean; - dimensions: DimensionsVisParam; - metric: MetricVisParam; - type: typeof visType; -} - -export interface MetricVisMetric { - value: any; - label: string; - color?: string; - bgColor?: string; - lightText: boolean; - rowIndex: number; -} diff --git a/src/plugins/vis_type_metric/tsconfig.json b/src/plugins/vis_type_metric/tsconfig.json deleted file mode 100644 index e430ec2460796..0000000000000 --- a/src/plugins/vis_type_metric/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": ["public/**/*", "server/**/*", "*.ts"], - "references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../visualizations/tsconfig.json" }, - { "path": "../charts/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../vis_default_editor/tsconfig.json" }, - { "path": "../field_formats/tsconfig.json" } - ] -} diff --git a/src/plugins/vis_type_table/README.md b/src/plugins/vis_type_table/README.md deleted file mode 100644 index a17d1142f0c09..0000000000000 --- a/src/plugins/vis_type_table/README.md +++ /dev/null @@ -1,8 +0,0 @@ -Contains the data table visualization, that allows presenting data in a simple table format. - -By default a new version of visualization will be used. To use the previous version of visualization the config must have the `vis_type_table.legacyVisEnabled: true` setting -configured in `kibana.dev.yml` or `kibana.yml`, as shown in the example below: - -```yaml -vis_type_table.legacyVisEnabled: true -``` \ No newline at end of file diff --git a/src/plugins/vis_type_table/common/index.ts b/src/plugins/vis_type_table/common/index.ts deleted file mode 100644 index 59cfa7e715f3b..0000000000000 --- a/src/plugins/vis_type_table/common/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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -// TODO: https://github.com/elastic/kibana/issues/110891 -/* eslint-disable @kbn/eslint/no_export_all */ - -export * from './types'; diff --git a/src/plugins/vis_type_table/config.ts b/src/plugins/vis_type_table/config.ts deleted file mode 100644 index ee027b79d5b5c..0000000000000 --- a/src/plugins/vis_type_table/config.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 and the Server Side Public License, v 1; you may not 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'; - -export const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), - legacyVisEnabled: schema.boolean({ defaultValue: false }), -}); - -export type ConfigSchema = TypeOf; diff --git a/src/plugins/vis_type_table/jest.config.js b/src/plugins/vis_type_table/jest.config.js deleted file mode 100644 index 9c91b1b813e52..0000000000000 --- a/src/plugins/vis_type_table/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 and the Server Side Public License, v 1; you may 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/vis_type_table'], - testRunner: 'jasmine2', - collectCoverageFrom: ['/src/plugins/vis_type_table/**/*.{js,ts,tsx}'], -}; diff --git a/src/plugins/vis_type_table/kibana.json b/src/plugins/vis_type_table/kibana.json deleted file mode 100644 index 389094802e999..0000000000000 --- a/src/plugins/vis_type_table/kibana.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "visTypeTable", - "version": "kibana", - "server": true, - "ui": true, - "requiredPlugins": [ - "expressions", - "visualizations", - "data", - "kibanaLegacy" - ], - "requiredBundles": [ - "kibanaUtils", - "kibanaReact", - "share", - "visDefaultEditor" - ], - "optionalPlugins": ["usageCollection"], - "owner": { - "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" - }, - "description": "Registers the datatable aggregation-based visualization. Currently it contains two implementations, the one based on EUI datagrid and the angular one. The second one is going to be removed in future minors." -} diff --git a/src/plugins/vis_type_table/public/index.ts b/src/plugins/vis_type_table/public/index.ts deleted file mode 100644 index e0ddf6e97e5ce..0000000000000 --- a/src/plugins/vis_type_table/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 and the Server Side Public License, v 1; you may not 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 'kibana/public'; -import { TableVisPlugin as Plugin } from './plugin'; - -export function plugin(initializerContext: PluginInitializerContext) { - return new Plugin(initializerContext); -} diff --git a/src/plugins/vis_type_table/public/legacy/__snapshots__/table_vis_legacy_fn.test.ts.snap b/src/plugins/vis_type_table/public/legacy/__snapshots__/table_vis_legacy_fn.test.ts.snap deleted file mode 100644 index a32609c2e3d34..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/__snapshots__/table_vis_legacy_fn.test.ts.snap +++ /dev/null @@ -1,44 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`interpreter/functions#table returns an object with the correct structure 1`] = ` -Object { - "as": "table_vis", - "type": "render", - "value": Object { - "visConfig": Object { - "dimensions": Object { - "buckets": Array [], - "metrics": Array [ - Object { - "accessor": 0, - "aggType": "count", - "format": Object { - "id": "number", - }, - "params": Object {}, - }, - ], - }, - "perPage": 10, - "showMetricsAtAllLevels": false, - "showPartialRows": false, - "showTotal": false, - "sort": Object { - "columnIndex": null, - "direction": null, - }, - "title": "My Chart title", - "totalFunc": "sum", - }, - "visData": Object { - "tables": Array [ - Object { - "columns": Array [], - "rows": Array [], - }, - ], - }, - "visType": "table", - }, -} -`; diff --git a/src/plugins/vis_type_table/public/legacy/_table_vis.scss b/src/plugins/vis_type_table/public/legacy/_table_vis.scss deleted file mode 100644 index 6ae3ddcca81a9..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/_table_vis.scss +++ /dev/null @@ -1,25 +0,0 @@ -// SASSTODO: Update naming to BEM -// This chart is actively being re-written to React and EUI -// Putting off renaming to avoid conflicts -.table-vis { - display: flex; - flex-direction: column; - flex: 1 1 0; - overflow: auto; - - @include euiScrollBar; -} - -.table-vis-container { - kbn-agg-table-group > .table > tbody > tr > td { - border-top: 0; - } - - .pagination-other-pages { - justify-content: flex-end; - } - - .pagination-size { - display: none; - } -} diff --git a/src/plugins/vis_type_table/public/legacy/agg_table/_agg_table.scss b/src/plugins/vis_type_table/public/legacy/agg_table/_agg_table.scss deleted file mode 100644 index 89c7f6664c2fa..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/agg_table/_agg_table.scss +++ /dev/null @@ -1,42 +0,0 @@ -kbn-agg-table, -kbn-agg-table-group { - display: block; -} - -.kbnAggTable { - display: flex; - flex: 1 1 auto; - flex-direction: column; -} - -.kbnAggTable__paginated { - flex: 1 1 auto; - overflow: auto; - - th { - text-align: left; - font-weight: $euiFontWeightBold; - } - - tr:hover td, - .kbnTableCellFilter { - background-color: $euiColorLightestShade; - } -} - -.kbnAggTable__controls { - flex: 0 0 auto; - display: flex; - align-items: center; - margin: $euiSizeS $euiSizeXS; - - > paginate-controls { - flex: 1 0 auto; - margin: 0; - padding: 0; - } -} - -.small { - font-size: .9em !important; -} diff --git a/src/plugins/vis_type_table/public/legacy/agg_table/_index.scss b/src/plugins/vis_type_table/public/legacy/agg_table/_index.scss deleted file mode 100644 index 340e08a76f1bd..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/agg_table/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './agg_table'; diff --git a/src/plugins/vis_type_table/public/legacy/agg_table/agg_table.html b/src/plugins/vis_type_table/public/legacy/agg_table/agg_table.html deleted file mode 100644 index 5107bd2048286..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/agg_table/agg_table.html +++ /dev/null @@ -1,34 +0,0 @@ - - -
-    - - - -     - - - - - -
-
diff --git a/src/plugins/vis_type_table/public/legacy/agg_table/agg_table.js b/src/plugins/vis_type_table/public/legacy/agg_table/agg_table.js deleted file mode 100644 index 8864326c0edc9..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/agg_table/agg_table.js +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import _ from 'lodash'; -import { CSV_SEPARATOR_SETTING, CSV_QUOTE_VALUES_SETTING } from '../../../../share/public'; -import aggTableTemplate from './agg_table.html'; -import { getFormatService } from '../../services'; -import { i18n } from '@kbn/i18n'; - -export function KbnAggTable(config, RecursionHelper) { - return { - restrict: 'E', - template: aggTableTemplate, - scope: { - table: '=', - dimensions: '=', - perPage: '=?', - sort: '=?', - exportTitle: '=?', - showTotal: '=', - totalFunc: '=', - percentageCol: '=', - filter: '=', - }, - controllerAs: 'aggTable', - compile: function ($el) { - // Use the compile function from the RecursionHelper, - // And return the linking function(s) which it returns - return RecursionHelper.compile($el); - }, - controller: function ($scope) { - const self = this; - - self._saveAs = require('@elastic/filesaver').saveAs; - self.csv = { - separator: config.get(CSV_SEPARATOR_SETTING), - quoteValues: config.get(CSV_QUOTE_VALUES_SETTING), - }; - - self.exportAsCsv = function (formatted) { - const csv = new Blob([self.toCsv(formatted)], { type: 'text/plain;charset=utf-8' }); - self._saveAs(csv, self.csv.filename); - }; - - self.toCsv = function (formatted) { - const rows = $scope.rows; - const columns = $scope.formattedColumns; - - const nonAlphaNumRE = /[^a-zA-Z0-9]/; - const allDoubleQuoteRE = /"/g; - - function escape(val) { - if (!formatted && _.isObject(val)) val = val.valueOf(); - val = String(val); - if (self.csv.quoteValues && nonAlphaNumRE.test(val)) { - val = '"' + val.replace(allDoubleQuoteRE, '""') + '"'; - } - return val; - } - - const csvRows = []; - for (const row of rows) { - const rowArray = []; - for (const col of columns) { - const value = row[col.id]; - const formattedValue = - formatted && col.formatter ? escape(col.formatter.convert(value)) : escape(value); - rowArray.push(formattedValue); - } - csvRows.push(rowArray); - } - - // add the columns to the rows - csvRows.unshift(columns.map(({ title }) => escape(title))); - - return csvRows - .map(function (row) { - return row.join(self.csv.separator) + '\r\n'; - }) - .join(''); - }; - - $scope.$watchMulti( - ['table', 'exportTitle', 'percentageCol', 'totalFunc', '=scope.dimensions'], - function () { - const { table, exportTitle, percentageCol } = $scope; - const showPercentage = percentageCol !== ''; - - if (!table) { - $scope.rows = null; - $scope.formattedColumns = null; - return; - } - - self.csv.filename = (exportTitle || table.title || 'unsaved') + '.csv'; - $scope.rows = table.rows; - $scope.formattedColumns = []; - - if (typeof $scope.dimensions === 'undefined') return; - - const { buckets, metrics } = $scope.dimensions; - - $scope.formattedColumns = table.columns - .map(function (col, i) { - const isBucket = buckets.find((bucket) => bucket.accessor === i); - const dimension = isBucket || metrics.find((metric) => metric.accessor === i); - - const formatter = dimension - ? getFormatService().deserialize(dimension.format) - : undefined; - - const formattedColumn = { - id: col.id, - title: col.name, - formatter: formatter, - filterable: !!isBucket, - }; - - if (!dimension) return; - - const last = i === table.columns.length - 1; - - if (last || !isBucket) { - formattedColumn.class = 'visualize-table-right'; - } - - const isDate = - dimension.format?.id === 'date' || dimension.format?.params?.id === 'date'; - const allowsNumericalAggregations = formatter?.allowsNumericalAggregations; - - let { totalFunc } = $scope; - if (typeof totalFunc === 'undefined' && showPercentage) { - totalFunc = 'sum'; - } - - if (allowsNumericalAggregations || isDate || totalFunc === 'count') { - const sum = (tableRows) => { - return _.reduce( - tableRows, - function (prev, curr) { - // some metrics return undefined for some of the values - // derivative is an example of this as it returns undefined in the first row - if (curr[col.id] === undefined) return prev; - return prev + curr[col.id]; - }, - 0 - ); - }; - - formattedColumn.sumTotal = sum(table.rows); - switch (totalFunc) { - case 'sum': { - if (!isDate) { - const total = formattedColumn.sumTotal; - formattedColumn.formattedTotal = formatter.convert(total); - formattedColumn.total = formattedColumn.sumTotal; - } - break; - } - case 'avg': { - if (!isDate) { - const total = sum(table.rows) / table.rows.length; - formattedColumn.formattedTotal = formatter.convert(total); - formattedColumn.total = total; - } - break; - } - case 'min': { - const total = _.chain(table.rows).map(col.id).min().value(); - formattedColumn.formattedTotal = formatter.convert(total); - formattedColumn.total = total; - break; - } - case 'max': { - const total = _.chain(table.rows).map(col.id).max().value(); - formattedColumn.formattedTotal = formatter.convert(total); - formattedColumn.total = total; - break; - } - case 'count': { - const total = table.rows.length; - formattedColumn.formattedTotal = total; - formattedColumn.total = total; - break; - } - default: - break; - } - } - - return formattedColumn; - }) - .filter((column) => column); - - if (showPercentage) { - const insertAtIndex = _.findIndex($scope.formattedColumns, { title: percentageCol }); - - // column to show percentage for was removed - if (insertAtIndex < 0) return; - - const { cols, rows } = addPercentageCol( - $scope.formattedColumns, - percentageCol, - table.rows, - insertAtIndex - ); - $scope.rows = rows; - $scope.formattedColumns = cols; - } - } - ); - }, - }; -} - -/** - * @param {Object[]} columns - the formatted columns that will be displayed - * @param {String} title - the title of the column to add to - * @param {Object[]} rows - the row data for the columns - * @param {Number} insertAtIndex - the index to insert the percentage column at - * @returns {Object} - cols and rows for the table to render now included percentage column(s) - */ -function addPercentageCol(columns, title, rows, insertAtIndex) { - const { id, sumTotal } = columns[insertAtIndex]; - const newId = `${id}-percents`; - const formatter = getFormatService().deserialize({ id: 'percent' }); - const i18nTitle = i18n.translate('visTypeTable.params.percentageTableColumnName', { - defaultMessage: '{title} percentages', - values: { title }, - }); - const newCols = insert(columns, insertAtIndex, { - title: i18nTitle, - id: newId, - formatter, - }); - const newRows = rows.map((row) => ({ - [newId]: row[id] / sumTotal, - ...row, - })); - - return { cols: newCols, rows: newRows }; -} - -function insert(arr, index, ...items) { - const newArray = [...arr]; - newArray.splice(index + 1, 0, ...items); - return newArray; -} diff --git a/src/plugins/vis_type_table/public/legacy/agg_table/agg_table.test.js b/src/plugins/vis_type_table/public/legacy/agg_table/agg_table.test.js deleted file mode 100644 index ecb4ade51b36c..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/agg_table/agg_table.test.js +++ /dev/null @@ -1,488 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import $ from 'jquery'; -import moment from 'moment-timezone'; -import angular from 'angular'; -import 'angular-mocks'; -import sinon from 'sinon'; -import { round } from 'lodash'; - -import { getFieldFormatsRegistry } from '../../../../data/public/test_utils'; -import { coreMock } from '../../../../../core/public/mocks'; -import { initAngularBootstrap } from '../../../../kibana_legacy/public/angular_bootstrap'; -import { setUiSettings } from '../../../../data/public/services'; -import { FORMATS_UI_SETTINGS } from '../../../../field_formats/common/'; -import { CSV_SEPARATOR_SETTING, CSV_QUOTE_VALUES_SETTING } from '../../../../share/public'; - -import { setFormatService } from '../../services'; -import { getInnerAngular } from '../get_inner_angular'; -import { initTableVisLegacyModule } from '../table_vis_legacy_module'; -import { tabifiedData } from './tabified_data'; - -const uiSettings = new Map(); - -describe('Table Vis - AggTable Directive', function () { - const core = coreMock.createStart(); - - core.uiSettings.set = jest.fn((key, value) => { - uiSettings.set(key, value); - }); - - core.uiSettings.get = jest.fn((key) => { - const defaultValues = { - dateFormat: 'MMM D, YYYY @ HH:mm:ss.SSS', - 'dateFormat:tz': 'UTC', - [FORMATS_UI_SETTINGS.SHORT_DOTS_ENABLE]: true, - [FORMATS_UI_SETTINGS.FORMAT_CURRENCY_DEFAULT_PATTERN]: '($0,0.[00])', - [FORMATS_UI_SETTINGS.FORMAT_NUMBER_DEFAULT_PATTERN]: '0,0.[000]', - [FORMATS_UI_SETTINGS.FORMAT_PERCENT_DEFAULT_PATTERN]: '0,0.[000]%', - [FORMATS_UI_SETTINGS.FORMAT_NUMBER_DEFAULT_LOCALE]: 'en', - [FORMATS_UI_SETTINGS.FORMAT_DEFAULT_TYPE_MAP]: {}, - [CSV_SEPARATOR_SETTING]: ',', - [CSV_QUOTE_VALUES_SETTING]: true, - }; - - return defaultValues[key] || uiSettings.get(key); - }); - - let $rootScope; - let $compile; - let settings; - - const initLocalAngular = () => { - const tableVisModule = getInnerAngular('kibana/table_vis', core); - initTableVisLegacyModule(tableVisModule); - }; - - beforeAll(async () => { - await initAngularBootstrap(); - }); - beforeEach(() => { - setUiSettings(core.uiSettings); - setFormatService(getFieldFormatsRegistry(core)); - initLocalAngular(); - angular.mock.module('kibana/table_vis'); - angular.mock.inject(($injector, config) => { - settings = config; - - $rootScope = $injector.get('$rootScope'); - $compile = $injector.get('$compile'); - }); - }); - - let $scope; - beforeEach(function () { - $scope = $rootScope.$new(); - }); - afterEach(function () { - $scope.$destroy(); - }); - - test('renders a simple response properly', function () { - $scope.dimensions = { - metrics: [{ accessor: 0, format: { id: 'number' }, params: {} }], - buckets: [], - }; - $scope.table = tabifiedData.metricOnly.tables[0]; - - const $el = $compile('')( - $scope - ); - $scope.$digest(); - - expect($el.find('tbody').length).toBe(1); - expect($el.find('td').length).toBe(1); - expect($el.find('td').text()).toEqual('1,000'); - }); - - test('renders nothing if the table is empty', function () { - $scope.dimensions = {}; - $scope.table = null; - const $el = $compile('')( - $scope - ); - $scope.$digest(); - - expect($el.find('tbody').length).toBe(0); - }); - - test('renders a complex response properly', async function () { - $scope.dimensions = { - buckets: [ - { accessor: 0, params: {} }, - { accessor: 2, params: {} }, - { accessor: 4, params: {} }, - ], - metrics: [ - { accessor: 1, params: {} }, - { accessor: 3, params: {} }, - { accessor: 5, params: {} }, - ], - }; - $scope.table = tabifiedData.threeTermBuckets.tables[0]; - const $el = $(''); - $compile($el)($scope); - $scope.$digest(); - - expect($el.find('tbody').length).toBe(1); - - const $rows = $el.find('tbody tr'); - expect($rows.length).toBeGreaterThan(0); - - function validBytes(str) { - const num = str.replace(/,/g, ''); - if (num !== '-') { - expect(num).toMatch(/^\d+$/); - } - } - - $rows.each(function () { - // 6 cells in every row - const $cells = $(this).find('td'); - expect($cells.length).toBe(6); - - const txts = $cells.map(function () { - return $(this).text().trim(); - }); - - // two character country code - expect(txts[0]).toMatch(/^(png|jpg|gif|html|css)$/); - validBytes(txts[1]); - - // country - expect(txts[2]).toMatch(/^\w\w$/); - validBytes(txts[3]); - - // os - expect(txts[4]).toMatch(/^(win|mac|linux)$/); - validBytes(txts[5]); - }); - }); - - describe('renders totals row', function () { - async function totalsRowTest(totalFunc, expected) { - function setDefaultTimezone() { - moment.tz.setDefault(settings.get('dateFormat:tz')); - } - - const oldTimezoneSetting = settings.get('dateFormat:tz'); - settings.set('dateFormat:tz', 'UTC'); - setDefaultTimezone(); - - $scope.dimensions = { - buckets: [ - { accessor: 0, params: {} }, - { accessor: 1, format: { id: 'date', params: { pattern: 'YYYY-MM-DD' } } }, - ], - metrics: [ - { accessor: 2, format: { id: 'number' } }, - { accessor: 3, format: { id: 'date' } }, - { accessor: 4, format: { id: 'number' } }, - { accessor: 5, format: { id: 'number' } }, - ], - }; - $scope.table = - tabifiedData.oneTermOneHistogramBucketWithTwoMetricsOneTopHitOneDerivative.tables[0]; - $scope.showTotal = true; - $scope.totalFunc = totalFunc; - const $el = $(``); - $compile($el)($scope); - $scope.$digest(); - - expect($el.find('tfoot').length).toBe(1); - - const $rows = $el.find('tfoot tr'); - expect($rows.length).toBe(1); - - const $cells = $($rows[0]).find('th'); - expect($cells.length).toBe(6); - - for (let i = 0; i < 6; i++) { - expect($($cells[i]).text().trim()).toBe(expected[i]); - } - settings.set('dateFormat:tz', oldTimezoneSetting); - setDefaultTimezone(); - } - test('as count', async function () { - await totalsRowTest('count', ['18', '18', '18', '18', '18', '18']); - }); - test('as min', async function () { - await totalsRowTest('min', [ - '', - '2014-09-28', - '9,283', - 'Sep 28, 2014 @ 00:00:00.000', - '1', - '11', - ]); - }); - test('as max', async function () { - await totalsRowTest('max', [ - '', - '2014-10-03', - '220,943', - 'Oct 3, 2014 @ 00:00:00.000', - '239', - '837', - ]); - }); - test('as avg', async function () { - await totalsRowTest('avg', ['', '', '87,221.5', '', '64.667', '206.833']); - }); - test('as sum', async function () { - await totalsRowTest('sum', ['', '', '1,569,987', '', '1,164', '3,723']); - }); - }); - - describe('aggTable.toCsv()', function () { - test('escapes rows and columns properly', function () { - const $el = $compile('')( - $scope - ); - $scope.$digest(); - - const $tableScope = $el.isolateScope(); - const aggTable = $tableScope.aggTable; - $tableScope.rows = [{ a: 1, b: 2, c: '"foobar"' }]; - $tableScope.formattedColumns = [ - { id: 'a', title: 'one' }, - { id: 'b', title: 'two' }, - { id: 'c', title: 'with double-quotes(")' }, - ]; - - expect(aggTable.toCsv()).toBe( - 'one,two,"with double-quotes("")"' + '\r\n' + '1,2,"""foobar"""' + '\r\n' - ); - }); - - test('exports rows and columns properly', async function () { - $scope.dimensions = { - buckets: [ - { accessor: 0, params: {} }, - { accessor: 2, params: {} }, - { accessor: 4, params: {} }, - ], - metrics: [ - { accessor: 1, params: {} }, - { accessor: 3, params: {} }, - { accessor: 5, params: {} }, - ], - }; - $scope.table = tabifiedData.threeTermBuckets.tables[0]; - - const $el = $compile('')( - $scope - ); - $scope.$digest(); - - const $tableScope = $el.isolateScope(); - const aggTable = $tableScope.aggTable; - $tableScope.table = $scope.table; - - const raw = aggTable.toCsv(false); - expect(raw).toBe( - '"extension: Descending","Average bytes","geo.src: Descending","Average bytes","machine.os: Descending","Average bytes"' + - '\r\n' + - 'png,412032,IT,9299,win,0' + - '\r\n' + - 'png,412032,IT,9299,mac,9299' + - '\r\n' + - 'png,412032,US,8293,linux,3992' + - '\r\n' + - 'png,412032,US,8293,mac,3029' + - '\r\n' + - 'css,412032,MX,9299,win,4992' + - '\r\n' + - 'css,412032,MX,9299,mac,5892' + - '\r\n' + - 'css,412032,US,8293,linux,3992' + - '\r\n' + - 'css,412032,US,8293,mac,3029' + - '\r\n' + - 'html,412032,CN,9299,win,4992' + - '\r\n' + - 'html,412032,CN,9299,mac,5892' + - '\r\n' + - 'html,412032,FR,8293,win,3992' + - '\r\n' + - 'html,412032,FR,8293,mac,3029' + - '\r\n' - ); - }); - - test('exports formatted rows and columns properly', async function () { - $scope.dimensions = { - buckets: [ - { accessor: 0, params: {} }, - { accessor: 2, params: {} }, - { accessor: 4, params: {} }, - ], - metrics: [ - { accessor: 1, params: {} }, - { accessor: 3, params: {} }, - { accessor: 5, params: {} }, - ], - }; - $scope.table = tabifiedData.threeTermBuckets.tables[0]; - - const $el = $compile('')( - $scope - ); - $scope.$digest(); - - const $tableScope = $el.isolateScope(); - const aggTable = $tableScope.aggTable; - $tableScope.table = $scope.table; - - // Create our own converter since the ones we use for tests don't actually transform the provided value - $tableScope.formattedColumns[0].formatter.convert = (v) => `${v}_formatted`; - - const formatted = aggTable.toCsv(true); - expect(formatted).toBe( - '"extension: Descending","Average bytes","geo.src: Descending","Average bytes","machine.os: Descending","Average bytes"' + - '\r\n' + - '"png_formatted",412032,IT,9299,win,0' + - '\r\n' + - '"png_formatted",412032,IT,9299,mac,9299' + - '\r\n' + - '"png_formatted",412032,US,8293,linux,3992' + - '\r\n' + - '"png_formatted",412032,US,8293,mac,3029' + - '\r\n' + - '"css_formatted",412032,MX,9299,win,4992' + - '\r\n' + - '"css_formatted",412032,MX,9299,mac,5892' + - '\r\n' + - '"css_formatted",412032,US,8293,linux,3992' + - '\r\n' + - '"css_formatted",412032,US,8293,mac,3029' + - '\r\n' + - '"html_formatted",412032,CN,9299,win,4992' + - '\r\n' + - '"html_formatted",412032,CN,9299,mac,5892' + - '\r\n' + - '"html_formatted",412032,FR,8293,win,3992' + - '\r\n' + - '"html_formatted",412032,FR,8293,mac,3029' + - '\r\n' - ); - }); - }); - - test('renders percentage columns', async function () { - $scope.dimensions = { - buckets: [ - { accessor: 0, params: {} }, - { accessor: 1, format: { id: 'date', params: { pattern: 'YYYY-MM-DD' } } }, - ], - metrics: [ - { accessor: 2, format: { id: 'number' } }, - { accessor: 3, format: { id: 'date' } }, - { accessor: 4, format: { id: 'number' } }, - { accessor: 5, format: { id: 'number' } }, - ], - }; - $scope.table = - tabifiedData.oneTermOneHistogramBucketWithTwoMetricsOneTopHitOneDerivative.tables[0]; - $scope.percentageCol = 'Average bytes'; - - const $el = $(``); - - $compile($el)($scope); - $scope.$digest(); - - const $headings = $el.find('th'); - expect($headings.length).toBe(7); - expect($headings.eq(3).text().trim()).toBe('Average bytes percentages'); - - const countColId = $scope.table.columns.find((col) => col.name === $scope.percentageCol).id; - const counts = $scope.table.rows.map((row) => row[countColId]); - const total = counts.reduce((sum, curr) => sum + curr, 0); - const $percentageColValues = $el.find('tbody tr').map((i, el) => $(el).find('td').eq(3).text()); - - $percentageColValues.each((i, value) => { - const percentage = `${round((counts[i] / total) * 100, 3)}%`; - expect(value).toBe(percentage); - }); - }); - - describe('aggTable.exportAsCsv()', function () { - let origBlob; - function FakeBlob(slices, opts) { - this.slices = slices; - this.opts = opts; - } - - beforeEach(function () { - origBlob = window.Blob; - window.Blob = FakeBlob; - }); - - afterEach(function () { - window.Blob = origBlob; - }); - - test('calls _saveAs properly', function () { - const $el = $compile('')($scope); - $scope.$digest(); - - const $tableScope = $el.isolateScope(); - const aggTable = $tableScope.aggTable; - - const saveAs = sinon.stub(aggTable, '_saveAs'); - $tableScope.rows = [{ a: 1, b: 2, c: '"foobar"' }]; - $tableScope.formattedColumns = [ - { id: 'a', title: 'one' }, - { id: 'b', title: 'two' }, - { id: 'c', title: 'with double-quotes(")' }, - ]; - - aggTable.csv.filename = 'somefilename.csv'; - aggTable.exportAsCsv(); - - expect(saveAs.callCount).toBe(1); - const call = saveAs.getCall(0); - expect(call.args[0]).toBeInstanceOf(FakeBlob); - expect(call.args[0].slices).toEqual([ - 'one,two,"with double-quotes("")"' + '\r\n' + '1,2,"""foobar"""' + '\r\n', - ]); - expect(call.args[0].opts).toEqual({ - type: 'text/plain;charset=utf-8', - }); - expect(call.args[1]).toBe('somefilename.csv'); - }); - - test('should use the export-title attribute', function () { - const expected = 'export file name'; - const $el = $compile( - `` - )($scope); - $scope.$digest(); - - const $tableScope = $el.isolateScope(); - const aggTable = $tableScope.aggTable; - $tableScope.table = { - columns: [], - rows: [], - }; - $tableScope.exportTitle = expected; - $scope.$digest(); - - expect(aggTable.csv.filename).toEqual(`${expected}.csv`); - }); - }); -}); diff --git a/src/plugins/vis_type_table/public/legacy/agg_table/agg_table_group.html b/src/plugins/vis_type_table/public/legacy/agg_table/agg_table_group.html deleted file mode 100644 index 4567b80b5f66c..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/agg_table/agg_table_group.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - -
- {{ table.title }} -
- - - -
- - - - - - - - - - - - -
- {{ table.title }} -
- - - -
diff --git a/src/plugins/vis_type_table/public/legacy/agg_table/agg_table_group.js b/src/plugins/vis_type_table/public/legacy/agg_table/agg_table_group.js deleted file mode 100644 index e9e71806a2bc3..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/agg_table/agg_table_group.js +++ /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 aggTableGroupTemplate from './agg_table_group.html'; - -export function KbnAggTableGroup(RecursionHelper) { - return { - restrict: 'E', - template: aggTableGroupTemplate, - scope: { - group: '=', - dimensions: '=', - perPage: '=?', - sort: '=?', - exportTitle: '=?', - showTotal: '=', - totalFunc: '=', - percentageCol: '=', - filter: '=', - }, - compile: function ($el) { - // Use the compile function from the RecursionHelper, - // And return the linking function(s) which it returns - return RecursionHelper.compile($el, { - post: function ($scope) { - $scope.$watch('group', function (group) { - // clear the previous "state" - $scope.rows = $scope.columns = false; - - if (!group || !group.tables.length) return; - - const childLayout = group.direction === 'row' ? 'rows' : 'columns'; - - $scope[childLayout] = group.tables; - }); - }, - }); - }, - }; -} diff --git a/src/plugins/vis_type_table/public/legacy/agg_table/agg_table_group.test.js b/src/plugins/vis_type_table/public/legacy/agg_table/agg_table_group.test.js deleted file mode 100644 index ba04b2f449f6d..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/agg_table/agg_table_group.test.js +++ /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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import $ from 'jquery'; -import angular from 'angular'; -import 'angular-mocks'; -import expect from '@kbn/expect'; - -import { getFieldFormatsRegistry } from '../../../../data/public/test_utils'; -import { coreMock } from '../../../../../core/public/mocks'; -import { setUiSettings } from '../../../../data/public/services'; -import { setFormatService } from '../../services'; -import { getInnerAngular } from '../get_inner_angular'; -import { initTableVisLegacyModule } from '../table_vis_legacy_module'; -import { initAngularBootstrap } from '../../../../kibana_legacy/public/angular_bootstrap'; -import { tabifiedData } from './tabified_data'; - -const uiSettings = new Map(); - -describe('Table Vis - AggTableGroup Directive', function () { - const core = coreMock.createStart(); - let $rootScope; - let $compile; - - core.uiSettings.set = jest.fn((key, value) => { - uiSettings.set(key, value); - }); - - core.uiSettings.get = jest.fn((key) => { - return uiSettings.get(key); - }); - - const initLocalAngular = () => { - const tableVisModule = getInnerAngular('kibana/table_vis', core); - initTableVisLegacyModule(tableVisModule); - }; - - beforeAll(async () => { - await initAngularBootstrap(); - }); - beforeEach(() => { - setUiSettings(core.uiSettings); - setFormatService(getFieldFormatsRegistry(core)); - initLocalAngular(); - angular.mock.module('kibana/table_vis'); - angular.mock.inject(($injector) => { - $rootScope = $injector.get('$rootScope'); - $compile = $injector.get('$compile'); - }); - }); - - let $scope; - beforeEach(function () { - $scope = $rootScope.$new(); - }); - afterEach(function () { - $scope.$destroy(); - }); - - it('renders a simple split response properly', function () { - $scope.dimensions = { - metrics: [{ accessor: 0, format: { id: 'number' }, params: {} }], - buckets: [], - }; - $scope.group = tabifiedData.metricOnly; - $scope.sort = { - columnIndex: null, - direction: null, - }; - const $el = $( - '' - ); - - $compile($el)($scope); - $scope.$digest(); - - // should create one sub-tbale - expect($el.find('kbn-agg-table').length).to.be(1); - }); - - it('renders nothing if the table list is empty', function () { - const $el = $( - '' - ); - - $scope.group = { - tables: [], - }; - - $compile($el)($scope); - $scope.$digest(); - - const $subTables = $el.find('kbn-agg-table'); - expect($subTables.length).to.be(0); - }); - - it('renders a complex response properly', function () { - $scope.dimensions = { - splitRow: [{ accessor: 0, params: {} }], - buckets: [ - { accessor: 2, params: {} }, - { accessor: 4, params: {} }, - ], - metrics: [ - { accessor: 1, params: {} }, - { accessor: 3, params: {} }, - { accessor: 5, params: {} }, - ], - }; - const group = ($scope.group = tabifiedData.threeTermBucketsWithSplit); - const $el = $( - '' - ); - $compile($el)($scope); - $scope.$digest(); - - const $subTables = $el.find('kbn-agg-table'); - expect($subTables.length).to.be(3); - - const $subTableHeaders = $el.find('.kbnAggTable__groupHeader'); - expect($subTableHeaders.length).to.be(3); - - $subTableHeaders.each(function (i) { - expect($(this).text()).to.be(group.tables[i].title); - }); - }); -}); diff --git a/src/plugins/vis_type_table/public/legacy/agg_table/tabified_data.js b/src/plugins/vis_type_table/public/legacy/agg_table/tabified_data.js deleted file mode 100644 index 54da06f2a5f90..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/agg_table/tabified_data.js +++ /dev/null @@ -1,784 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may 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 tabifiedData = { - metricOnly: { - tables: [ - { - columns: [ - { - id: 'col-0-1', - name: 'Count', - }, - ], - rows: [ - { - 'col-0-1': 1000, - }, - ], - }, - ], - }, - threeTermBuckets: { - tables: [ - { - columns: [ - { - id: 'col-0-agg_2', - name: 'extension: Descending', - }, - { - id: 'col-1-agg_1', - name: 'Average bytes', - }, - { - id: 'col-2-agg_3', - name: 'geo.src: Descending', - }, - { - id: 'col-3-agg_1', - name: 'Average bytes', - }, - { - id: 'col-4-agg_4', - name: 'machine.os: Descending', - }, - { - id: 'col-5-agg_1', - name: 'Average bytes', - }, - ], - rows: [ - { - 'col-0-agg_2': 'png', - 'col-2-agg_3': 'IT', - 'col-4-agg_4': 'win', - 'col-1-agg_1': 412032, - 'col-3-agg_1': 9299, - 'col-5-agg_1': 0, - }, - { - 'col-0-agg_2': 'png', - 'col-2-agg_3': 'IT', - 'col-4-agg_4': 'mac', - 'col-1-agg_1': 412032, - 'col-3-agg_1': 9299, - 'col-5-agg_1': 9299, - }, - { - 'col-0-agg_2': 'png', - 'col-2-agg_3': 'US', - 'col-4-agg_4': 'linux', - 'col-1-agg_1': 412032, - 'col-3-agg_1': 8293, - 'col-5-agg_1': 3992, - }, - { - 'col-0-agg_2': 'png', - 'col-2-agg_3': 'US', - 'col-4-agg_4': 'mac', - 'col-1-agg_1': 412032, - 'col-3-agg_1': 8293, - 'col-5-agg_1': 3029, - }, - { - 'col-0-agg_2': 'css', - 'col-2-agg_3': 'MX', - 'col-4-agg_4': 'win', - 'col-1-agg_1': 412032, - 'col-3-agg_1': 9299, - 'col-5-agg_1': 4992, - }, - { - 'col-0-agg_2': 'css', - 'col-2-agg_3': 'MX', - 'col-4-agg_4': 'mac', - 'col-1-agg_1': 412032, - 'col-3-agg_1': 9299, - 'col-5-agg_1': 5892, - }, - { - 'col-0-agg_2': 'css', - 'col-2-agg_3': 'US', - 'col-4-agg_4': 'linux', - 'col-1-agg_1': 412032, - 'col-3-agg_1': 8293, - 'col-5-agg_1': 3992, - }, - { - 'col-0-agg_2': 'css', - 'col-2-agg_3': 'US', - 'col-4-agg_4': 'mac', - 'col-1-agg_1': 412032, - 'col-3-agg_1': 8293, - 'col-5-agg_1': 3029, - }, - { - 'col-0-agg_2': 'html', - 'col-2-agg_3': 'CN', - 'col-4-agg_4': 'win', - 'col-1-agg_1': 412032, - 'col-3-agg_1': 9299, - 'col-5-agg_1': 4992, - }, - { - 'col-0-agg_2': 'html', - 'col-2-agg_3': 'CN', - 'col-4-agg_4': 'mac', - 'col-1-agg_1': 412032, - 'col-3-agg_1': 9299, - 'col-5-agg_1': 5892, - }, - { - 'col-0-agg_2': 'html', - 'col-2-agg_3': 'FR', - 'col-4-agg_4': 'win', - 'col-1-agg_1': 412032, - 'col-3-agg_1': 8293, - 'col-5-agg_1': 3992, - }, - { - 'col-0-agg_2': 'html', - 'col-2-agg_3': 'FR', - 'col-4-agg_4': 'mac', - 'col-1-agg_1': 412032, - 'col-3-agg_1': 8293, - 'col-5-agg_1': 3029, - }, - ], - }, - ], - }, - threeTermBucketsWithSplit: { - tables: [ - { - title: 'png: extension: Descending', - name: 'extension: Descending', - key: 'png', - column: 0, - row: 0, - table: { - columns: [ - { - id: 'col-0-agg_2', - name: 'extension: Descending', - }, - { - id: 'col-1-agg_3', - name: 'geo.src: Descending', - }, - { - id: 'col-2-agg_4', - name: 'machine.os: Descending', - }, - { - id: 'col-3-agg_1', - name: 'Average bytes', - }, - ], - rows: [ - { - 'col-0-agg_2': 'png', - 'col-1-agg_3': 'IT', - 'col-2-agg_4': 'win', - 'col-3-agg_1': 0, - }, - { - 'col-0-agg_2': 'png', - 'col-1-agg_3': 'IT', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 9299, - }, - { - 'col-0-agg_2': 'png', - 'col-1-agg_3': 'US', - 'col-2-agg_4': 'linux', - 'col-3-agg_1': 3992, - }, - { - 'col-0-agg_2': 'png', - 'col-1-agg_3': 'US', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 3029, - }, - { - 'col-0-agg_2': 'css', - 'col-1-agg_3': 'MX', - 'col-2-agg_4': 'win', - 'col-3-agg_1': 4992, - }, - { - 'col-0-agg_2': 'css', - 'col-1-agg_3': 'MX', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 5892, - }, - { - 'col-0-agg_2': 'css', - 'col-1-agg_3': 'US', - 'col-2-agg_4': 'linux', - 'col-3-agg_1': 3992, - }, - { - 'col-0-agg_2': 'css', - 'col-1-agg_3': 'US', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 3029, - }, - { - 'col-0-agg_2': 'html', - 'col-1-agg_3': 'CN', - 'col-2-agg_4': 'win', - 'col-3-agg_1': 4992, - }, - { - 'col-0-agg_2': 'html', - 'col-1-agg_3': 'CN', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 5892, - }, - { - 'col-0-agg_2': 'html', - 'col-1-agg_3': 'FR', - 'col-2-agg_4': 'win', - 'col-3-agg_1': 3992, - }, - { - 'col-0-agg_2': 'html', - 'col-1-agg_3': 'FR', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 3029, - }, - ], - }, - tables: [ - { - columns: [ - { - id: 'col-0-agg_2', - name: 'extension: Descending', - }, - { - id: 'col-1-agg_3', - name: 'geo.src: Descending', - }, - { - id: 'col-2-agg_4', - name: 'machine.os: Descending', - }, - { - id: 'col-3-agg_1', - name: 'Average bytes', - }, - ], - rows: [ - { - 'col-0-agg_2': 'png', - 'col-1-agg_3': 'IT', - 'col-2-agg_4': 'win', - 'col-3-agg_1': 0, - }, - { - 'col-0-agg_2': 'png', - 'col-1-agg_3': 'IT', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 9299, - }, - { - 'col-0-agg_2': 'png', - 'col-1-agg_3': 'US', - 'col-2-agg_4': 'linux', - 'col-3-agg_1': 3992, - }, - { - 'col-0-agg_2': 'png', - 'col-1-agg_3': 'US', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 3029, - }, - ], - }, - ], - }, - { - title: 'css: extension: Descending', - name: 'extension: Descending', - key: 'css', - column: 0, - row: 4, - table: { - columns: [ - { - id: 'col-0-agg_2', - name: 'extension: Descending', - }, - { - id: 'col-1-agg_3', - name: 'geo.src: Descending', - }, - { - id: 'col-2-agg_4', - name: 'machine.os: Descending', - }, - { - id: 'col-3-agg_1', - name: 'Average bytes', - }, - ], - rows: [ - { - 'col-0-agg_2': 'png', - 'col-1-agg_3': 'IT', - 'col-2-agg_4': 'win', - 'col-3-agg_1': 0, - }, - { - 'col-0-agg_2': 'png', - 'col-1-agg_3': 'IT', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 9299, - }, - { - 'col-0-agg_2': 'png', - 'col-1-agg_3': 'US', - 'col-2-agg_4': 'linux', - 'col-3-agg_1': 3992, - }, - { - 'col-0-agg_2': 'png', - 'col-1-agg_3': 'US', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 3029, - }, - { - 'col-0-agg_2': 'css', - 'col-1-agg_3': 'MX', - 'col-2-agg_4': 'win', - 'col-3-agg_1': 4992, - }, - { - 'col-0-agg_2': 'css', - 'col-1-agg_3': 'MX', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 5892, - }, - { - 'col-0-agg_2': 'css', - 'col-1-agg_3': 'US', - 'col-2-agg_4': 'linux', - 'col-3-agg_1': 3992, - }, - { - 'col-0-agg_2': 'css', - 'col-1-agg_3': 'US', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 3029, - }, - { - 'col-0-agg_2': 'html', - 'col-1-agg_3': 'CN', - 'col-2-agg_4': 'win', - 'col-3-agg_1': 4992, - }, - { - 'col-0-agg_2': 'html', - 'col-1-agg_3': 'CN', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 5892, - }, - { - 'col-0-agg_2': 'html', - 'col-1-agg_3': 'FR', - 'col-2-agg_4': 'win', - 'col-3-agg_1': 3992, - }, - { - 'col-0-agg_2': 'html', - 'col-1-agg_3': 'FR', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 3029, - }, - ], - }, - tables: [ - { - columns: [ - { - id: 'col-0-agg_2', - name: 'extension: Descending', - }, - { - id: 'col-1-agg_3', - name: 'geo.src: Descending', - }, - { - id: 'col-2-agg_4', - name: 'machine.os: Descending', - }, - { - id: 'col-3-agg_1', - name: 'Average bytes', - }, - ], - rows: [ - { - 'col-0-agg_2': 'css', - 'col-1-agg_3': 'MX', - 'col-2-agg_4': 'win', - 'col-3-agg_1': 4992, - }, - { - 'col-0-agg_2': 'css', - 'col-1-agg_3': 'MX', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 5892, - }, - { - 'col-0-agg_2': 'css', - 'col-1-agg_3': 'US', - 'col-2-agg_4': 'linux', - 'col-3-agg_1': 3992, - }, - { - 'col-0-agg_2': 'css', - 'col-1-agg_3': 'US', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 3029, - }, - ], - }, - ], - }, - { - title: 'html: extension: Descending', - name: 'extension: Descending', - key: 'html', - column: 0, - row: 8, - table: { - columns: [ - { - id: 'col-0-agg_2', - name: 'extension: Descending', - }, - { - id: 'col-1-agg_3', - name: 'geo.src: Descending', - }, - { - id: 'col-2-agg_4', - name: 'machine.os: Descending', - }, - { - id: 'col-3-agg_1', - name: 'Average bytes', - }, - ], - rows: [ - { - 'col-0-agg_2': 'png', - 'col-1-agg_3': 'IT', - 'col-2-agg_4': 'win', - 'col-3-agg_1': 0, - }, - { - 'col-0-agg_2': 'png', - 'col-1-agg_3': 'IT', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 9299, - }, - { - 'col-0-agg_2': 'png', - 'col-1-agg_3': 'US', - 'col-2-agg_4': 'linux', - 'col-3-agg_1': 3992, - }, - { - 'col-0-agg_2': 'png', - 'col-1-agg_3': 'US', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 3029, - }, - { - 'col-0-agg_2': 'css', - 'col-1-agg_3': 'MX', - 'col-2-agg_4': 'win', - 'col-3-agg_1': 4992, - }, - { - 'col-0-agg_2': 'css', - 'col-1-agg_3': 'MX', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 5892, - }, - { - 'col-0-agg_2': 'css', - 'col-1-agg_3': 'US', - 'col-2-agg_4': 'linux', - 'col-3-agg_1': 3992, - }, - { - 'col-0-agg_2': 'css', - 'col-1-agg_3': 'US', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 3029, - }, - { - 'col-0-agg_2': 'html', - 'col-1-agg_3': 'CN', - 'col-2-agg_4': 'win', - 'col-3-agg_1': 4992, - }, - { - 'col-0-agg_2': 'html', - 'col-1-agg_3': 'CN', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 5892, - }, - { - 'col-0-agg_2': 'html', - 'col-1-agg_3': 'FR', - 'col-2-agg_4': 'win', - 'col-3-agg_1': 3992, - }, - { - 'col-0-agg_2': 'html', - 'col-1-agg_3': 'FR', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 3029, - }, - ], - }, - tables: [ - { - columns: [ - { - id: 'col-0-agg_2', - name: 'extension: Descending', - }, - { - id: 'col-1-agg_3', - name: 'geo.src: Descending', - }, - { - id: 'col-2-agg_4', - name: 'machine.os: Descending', - }, - { - id: 'col-3-agg_1', - name: 'Average bytes', - }, - ], - rows: [ - { - 'col-0-agg_2': 'html', - 'col-1-agg_3': 'CN', - 'col-2-agg_4': 'win', - 'col-3-agg_1': 4992, - }, - { - 'col-0-agg_2': 'html', - 'col-1-agg_3': 'CN', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 5892, - }, - { - 'col-0-agg_2': 'html', - 'col-1-agg_3': 'FR', - 'col-2-agg_4': 'win', - 'col-3-agg_1': 3992, - }, - { - 'col-0-agg_2': 'html', - 'col-1-agg_3': 'FR', - 'col-2-agg_4': 'mac', - 'col-3-agg_1': 3029, - }, - ], - }, - ], - }, - ], - direction: 'row', - }, - oneTermOneHistogramBucketWithTwoMetricsOneTopHitOneDerivative: { - tables: [ - { - columns: [ - { - id: 'col-0-agg_3', - name: 'extension: Descending', - }, - { - id: 'col-1-agg_4', - name: '@timestamp per day', - }, - { - id: 'col-2-agg_1', - name: 'Average bytes', - }, - { - id: 'col-3-agg_2', - name: 'Min @timestamp', - }, - { - id: 'col-4-agg_5', - name: 'Derivative of Count', - }, - { - id: 'col-5-agg_6', - name: 'Last bytes', - }, - ], - rows: [ - { - 'col-0-agg_3': 'png', - 'col-1-agg_4': 1411862400000, - 'col-2-agg_1': 9283, - 'col-3-agg_2': 1411862400000, - 'col-5-agg_6': 23, - }, - { - 'col-0-agg_3': 'png', - 'col-1-agg_4': 1411948800000, - 'col-2-agg_1': 28349, - 'col-3-agg_2': 1411948800000, - 'col-4-agg_5': 203, - 'col-5-agg_6': 39, - }, - { - 'col-0-agg_3': 'png', - 'col-1-agg_4': 1412035200000, - 'col-2-agg_1': 84330, - 'col-3-agg_2': 1412035200000, - 'col-4-agg_5': 200, - 'col-5-agg_6': 329, - }, - { - 'col-0-agg_3': 'png', - 'col-1-agg_4': 1412121600000, - 'col-2-agg_1': 34992, - 'col-3-agg_2': 1412121600000, - 'col-4-agg_5': 103, - 'col-5-agg_6': 22, - }, - { - 'col-0-agg_3': 'png', - 'col-1-agg_4': 1412208000000, - 'col-2-agg_1': 145432, - 'col-3-agg_2': 1412208000000, - 'col-4-agg_5': 153, - 'col-5-agg_6': 93, - }, - { - 'col-0-agg_3': 'png', - 'col-1-agg_4': 1412294400000, - 'col-2-agg_1': 220943, - 'col-3-agg_2': 1412294400000, - 'col-4-agg_5': 239, - 'col-5-agg_6': 72, - }, - { - 'col-0-agg_3': 'css', - 'col-1-agg_4': 1411862400000, - 'col-2-agg_1': 9283, - 'col-3-agg_2': 1411862400000, - 'col-5-agg_6': 75, - }, - { - 'col-0-agg_3': 'css', - 'col-1-agg_4': 1411948800000, - 'col-2-agg_1': 28349, - 'col-3-agg_2': 1411948800000, - 'col-4-agg_5': 10, - 'col-5-agg_6': 11, - }, - { - 'col-0-agg_3': 'css', - 'col-1-agg_4': 1412035200000, - 'col-2-agg_1': 84330, - 'col-3-agg_2': 1412035200000, - 'col-4-agg_5': 24, - 'col-5-agg_6': 238, - }, - { - 'col-0-agg_3': 'css', - 'col-1-agg_4': 1412121600000, - 'col-2-agg_1': 34992, - 'col-3-agg_2': 1412121600000, - 'col-4-agg_5': 49, - 'col-5-agg_6': 343, - }, - { - 'col-0-agg_3': 'css', - 'col-1-agg_4': 1412208000000, - 'col-2-agg_1': 145432, - 'col-3-agg_2': 1412208000000, - 'col-4-agg_5': 100, - 'col-5-agg_6': 837, - }, - { - 'col-0-agg_3': 'css', - 'col-1-agg_4': 1412294400000, - 'col-2-agg_1': 220943, - 'col-3-agg_2': 1412294400000, - 'col-4-agg_5': 23, - 'col-5-agg_6': 302, - }, - { - 'col-0-agg_3': 'html', - 'col-1-agg_4': 1411862400000, - 'col-2-agg_1': 9283, - 'col-3-agg_2': 1411862400000, - 'col-5-agg_6': 30, - }, - { - 'col-0-agg_3': 'html', - 'col-1-agg_4': 1411948800000, - 'col-2-agg_1': 28349, - 'col-3-agg_2': 1411948800000, - 'col-4-agg_5': 1, - 'col-5-agg_6': 43, - }, - { - 'col-0-agg_3': 'html', - 'col-1-agg_4': 1412035200000, - 'col-2-agg_1': 84330, - 'col-3-agg_2': 1412035200000, - 'col-4-agg_5': 5, - 'col-5-agg_6': 88, - }, - { - 'col-0-agg_3': 'html', - 'col-1-agg_4': 1412121600000, - 'col-2-agg_1': 34992, - 'col-3-agg_2': 1412121600000, - 'col-4-agg_5': 10, - 'col-5-agg_6': 91, - }, - { - 'col-0-agg_3': 'html', - 'col-1-agg_4': 1412208000000, - 'col-2-agg_1': 145432, - 'col-3-agg_2': 1412208000000, - 'col-4-agg_5': 43, - 'col-5-agg_6': 534, - }, - { - 'col-0-agg_3': 'html', - 'col-1-agg_4': 1412294400000, - 'col-2-agg_1': 220943, - 'col-3-agg_2': 1412294400000, - 'col-4-agg_5': 1, - 'col-5-agg_6': 553, - }, - ], - }, - ], - }, -}; diff --git a/src/plugins/vis_type_table/public/legacy/get_inner_angular.ts b/src/plugins/vis_type_table/public/legacy/get_inner_angular.ts deleted file mode 100644 index 412dd904a5e87..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/get_inner_angular.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -// inner angular imports -// these are necessary to bootstrap the local angular. -// They can stay even after NP cutover -import angular from 'angular'; -// required for `ngSanitize` angular module -import 'angular-sanitize'; -import 'angular-recursion'; -import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular'; -import { CoreStart, IUiSettingsClient, PluginInitializerContext } from 'kibana/public'; -import { - PaginateDirectiveProvider, - PaginateControlsDirectiveProvider, - PrivateProvider, - watchMultiDecorator, - KbnAccessibleClickProvider, -} from '../../../kibana_legacy/public'; - -const thirdPartyAngularDependencies = ['ngSanitize', 'ui.bootstrap', 'RecursionHelper']; - -export function getAngularModule(name: string, core: CoreStart, context: PluginInitializerContext) { - const uiModule = getInnerAngular(name, core); - return uiModule; -} - -let initialized = false; - -export function getInnerAngular(name = 'kibana/table_vis', core: CoreStart) { - if (!initialized) { - createLocalPrivateModule(); - createLocalI18nModule(); - createLocalConfigModule(core.uiSettings); - createLocalPaginateModule(); - initialized = true; - } - return angular - .module(name, [ - ...thirdPartyAngularDependencies, - 'tableVisPaginate', - 'tableVisConfig', - 'tableVisPrivate', - 'tableVisI18n', - ]) - .config(watchMultiDecorator) - .directive('kbnAccessibleClick', KbnAccessibleClickProvider); -} - -function createLocalPrivateModule() { - angular.module('tableVisPrivate', []).provider('Private', PrivateProvider); -} - -function createLocalConfigModule(uiSettings: IUiSettingsClient) { - angular.module('tableVisConfig', []).provider('config', function () { - return { - $get: () => ({ - get: (value: string) => { - return uiSettings ? uiSettings.get(value) : undefined; - }, - // set method is used in agg_table mocha test - set: (key: string, value: string) => { - return uiSettings ? uiSettings.set(key, value) : undefined; - }, - }), - }; - }); -} - -function createLocalI18nModule() { - angular - .module('tableVisI18n', []) - .provider('i18n', I18nProvider) - .filter('i18n', i18nFilter) - .directive('i18nId', i18nDirective); -} - -function createLocalPaginateModule() { - angular - .module('tableVisPaginate', []) - .directive('paginate', PaginateDirectiveProvider) - .directive('paginateControls', PaginateControlsDirectiveProvider); -} diff --git a/src/plugins/vis_type_table/public/legacy/index.scss b/src/plugins/vis_type_table/public/legacy/index.scss deleted file mode 100644 index 0972c85e0dbe0..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/index.scss +++ /dev/null @@ -1,10 +0,0 @@ -// Prefix all styles with "tbv" to avoid conflicts. -// Examples -// tbvChart -// tbvChart__legend -// tbvChart__legend--small -// tbvChart__legend-isLoading - -@import './agg_table/index'; -@import './paginated_table/index'; -@import './table_vis'; diff --git a/src/plugins/vis_type_table/public/legacy/index.ts b/src/plugins/vis_type_table/public/legacy/index.ts deleted file mode 100644 index 6f7eb0686852f..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/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 { registerLegacyVis } from './register_legacy_vis'; diff --git a/src/plugins/vis_type_table/public/legacy/paginated_table/_index.scss b/src/plugins/vis_type_table/public/legacy/paginated_table/_index.scss deleted file mode 100644 index 23d56c09b2818..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/paginated_table/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './_table_cell_filter'; diff --git a/src/plugins/vis_type_table/public/legacy/paginated_table/_table_cell_filter.scss b/src/plugins/vis_type_table/public/legacy/paginated_table/_table_cell_filter.scss deleted file mode 100644 index 05d050362ce0b..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/paginated_table/_table_cell_filter.scss +++ /dev/null @@ -1,30 +0,0 @@ -.kbnTableCellFilter__hover { - position: relative; - - /** - * 1. Center vertically regardless of row height. - */ - .kbnTableCellFilter { - position: absolute; - white-space: nowrap; - right: 0; - top: 50%; /* 1 */ - transform: translateY(-50%); /* 1 */ - display: none; - } - - &:hover { - .kbnTableCellFilter { - display: inline; - } - - .kbnTableCellFilter__hover-show { - visibility: visible; - } - } -} - -.kbnTableCellFilter__hover-show { - // so that the cell doesn't change size on hover - visibility: hidden; -} diff --git a/src/plugins/vis_type_table/public/legacy/paginated_table/paginated_table.html b/src/plugins/vis_type_table/public/legacy/paginated_table/paginated_table.html deleted file mode 100644 index 12731eb386566..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/paginated_table/paginated_table.html +++ /dev/null @@ -1,55 +0,0 @@ - -
- - - - - - - - - - - - - -
- - - - - - -
- {{ col.formattedTotal }} -
-
- - - -
-
diff --git a/src/plugins/vis_type_table/public/legacy/paginated_table/paginated_table.js b/src/plugins/vis_type_table/public/legacy/paginated_table/paginated_table.js deleted file mode 100644 index 066134dbb5dc5..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/paginated_table/paginated_table.js +++ /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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import _ from 'lodash'; -import paginatedTableTemplate from './paginated_table.html'; - -export function PaginatedTable($filter) { - const orderBy = $filter('orderBy'); - - return { - restrict: 'E', - template: paginatedTableTemplate, - transclude: true, - scope: { - table: '=', - rows: '=', - columns: '=', - linkToTop: '=', - perPage: '=?', - sortHandler: '=?', - sort: '=?', - showSelector: '=?', - showTotal: '=', - totalFunc: '=', - filter: '=', - percentageCol: '=', - }, - controllerAs: 'paginatedTable', - controller: function ($scope) { - const self = this; - self.sort = { - columnIndex: null, - direction: null, - }; - - self.sortColumn = function (colIndex, sortDirection = 'asc') { - const col = $scope.columns[colIndex]; - - if (!col) return; - if (col.sortable === false) return; - - if (self.sort.columnIndex === colIndex) { - const directions = { - null: 'asc', - asc: 'desc', - desc: null, - }; - sortDirection = directions[self.sort.direction]; - } - - self.sort.columnIndex = colIndex; - self.sort.direction = sortDirection; - if ($scope.sort) { - _.assign($scope.sort, self.sort); - } - }; - - function valueGetter(row) { - const col = $scope.columns[self.sort.columnIndex]; - let value = row[col.id]; - if (typeof value === 'boolean') value = value ? 0 : 1; - return value; - } - - // Set the sort state if it is set - if ($scope.sort && $scope.sort.columnIndex !== null) { - self.sortColumn($scope.sort.columnIndex, $scope.sort.direction); - } - - function resortRows() { - const newSort = $scope.sort; - if (newSort && !_.isEqual(newSort, self.sort)) { - self.sortColumn(newSort.columnIndex, newSort.direction); - } - - if (!$scope.rows || !$scope.columns) { - $scope.sortedRows = false; - return; - } - - const sort = self.sort; - if (sort.direction == null) { - $scope.sortedRows = $scope.rows.slice(0); - } else { - $scope.sortedRows = orderBy($scope.rows, valueGetter, sort.direction === 'desc'); - } - } - - // update the sortedRows result - $scope.$watchMulti(['rows', 'columns', '[]sort', '[]paginatedTable.sort'], resortRows); - }, - }; -} diff --git a/src/plugins/vis_type_table/public/legacy/paginated_table/paginated_table.test.ts b/src/plugins/vis_type_table/public/legacy/paginated_table/paginated_table.test.ts deleted file mode 100644 index 3feff52f86792..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/paginated_table/paginated_table.test.ts +++ /dev/null @@ -1,464 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { isNumber, times, identity, random } from 'lodash'; -import angular, { IRootScopeService, IScope, ICompileService } from 'angular'; -import $ from 'jquery'; -import 'angular-sanitize'; -import 'angular-mocks'; - -import { initAngularBootstrap } from '../../../../kibana_legacy/public/angular_bootstrap'; -import { getAngularModule } from '../get_inner_angular'; -import { initTableVisLegacyModule } from '../table_vis_legacy_module'; -import { coreMock } from '../../../../../core/public/mocks'; - -interface Sort { - columnIndex: number; - direction: string; -} - -interface Row { - [key: string]: number | string; -} - -interface Column { - id?: string; - title: string; - formatter?: { - convert?: (val: string) => string; - }; - sortable?: boolean; -} - -interface Table { - columns: Column[]; - rows: Row[]; -} - -interface PaginatedTableScope extends IScope { - table?: Table; - cols?: Column[]; - rows?: Row[]; - perPage?: number; - sort?: Sort; - linkToTop?: boolean; -} - -describe('Table Vis - Paginated table', () => { - let $el: JQuery; - let $rootScope: IRootScopeService; - let $compile: ICompileService; - let $scope: PaginatedTableScope; - const defaultPerPage = 10; - let paginatedTable: any; - - beforeAll(async () => { - await initAngularBootstrap(); - }); - - const initLocalAngular = () => { - const tableVisModule = getAngularModule( - 'kibana/table_vis', - coreMock.createStart(), - coreMock.createPluginInitializerContext() - ); - initTableVisLegacyModule(tableVisModule); - }; - - beforeEach(initLocalAngular); - beforeEach(angular.mock.module('kibana/table_vis')); - - beforeEach( - angular.mock.inject((_$rootScope_: IRootScopeService, _$compile_: ICompileService) => { - $rootScope = _$rootScope_; - $compile = _$compile_; - $scope = $rootScope.$new(); - }) - ); - - afterEach(() => { - $scope.$destroy(); - }); - - const makeData = (colCount: number | Column[], rowCount: number | string[][]) => { - let columns: Column[] = []; - let rows: Row[] = []; - - if (isNumber(colCount)) { - times(colCount, (i) => { - columns.push({ id: `${i}`, title: `column${i}`, formatter: { convert: identity } }); - }); - } else { - columns = colCount.map( - (col, i) => - ({ - id: `${i}`, - title: col.title, - formatter: col.formatter || { convert: identity }, - } as Column) - ); - } - - if (isNumber(rowCount)) { - times(rowCount, (row) => { - const rowItems: Row = {}; - - times(columns.length, (col) => { - rowItems[`${col}`] = `item-${col}-${row}`; - }); - - rows.push(rowItems); - }); - } else { - rows = rowCount.map((row: string[]) => { - const newRow: Row = {}; - row.forEach((v, i) => (newRow[i] = v)); - return newRow; - }); - } - - return { - columns, - rows, - }; - }; - - const renderTable = ( - table: { columns: Column[]; rows: Row[] } | null, - cols: Column[], - rows: Row[], - perPage?: number, - sort?: Sort, - linkToTop?: boolean - ) => { - $scope.table = table || { columns: [], rows: [] }; - $scope.cols = cols || []; - $scope.rows = rows || []; - $scope.perPage = perPage || defaultPerPage; - $scope.sort = sort; - $scope.linkToTop = linkToTop; - - const template = ` - `; - const element = $compile(template)($scope); - $el = $(element); - - $scope.$digest(); - paginatedTable = element.controller('paginatedTable'); - }; - - describe('rendering', () => { - test('should not display without rows', () => { - const cols: Column[] = [ - { - id: 'col-1-1', - title: 'test1', - }, - ]; - const rows: Row[] = []; - - renderTable(null, cols, rows); - expect($el.children().length).toBe(0); - }); - - test('should render columns and rows', () => { - const data = makeData(2, 2); - const cols = data.columns; - const rows = data.rows; - - renderTable(data, cols, rows); - expect($el.children().length).toBe(1); - const tableRows = $el.find('tbody tr'); - - // should contain the row data - expect(tableRows.eq(0).find('td').eq(0).text()).toBe(rows[0][0]); - expect(tableRows.eq(0).find('td').eq(1).text()).toBe(rows[0][1]); - expect(tableRows.eq(1).find('td').eq(0).text()).toBe(rows[1][0]); - expect(tableRows.eq(1).find('td').eq(1).text()).toBe(rows[1][1]); - }); - - test('should paginate rows', () => { - // note: paginate truncates pages, so don't make too many - const rowCount = random(16, 24); - const perPageCount = random(5, 8); - const data = makeData(3, rowCount); - const pageCount = Math.ceil(rowCount / perPageCount); - - renderTable(data, data.columns, data.rows, perPageCount); - const tableRows = $el.find('tbody tr'); - expect(tableRows.length).toBe(perPageCount); - // add 2 for the first and last page links - expect($el.find('paginate-controls button').length).toBe(pageCount + 2); - }); - - test('should not show blank rows on last page', () => { - const rowCount = 7; - const perPageCount = 10; - const data = makeData(3, rowCount); - - renderTable(data, data.columns, data.rows, perPageCount); - const tableRows = $el.find('tbody tr'); - expect(tableRows.length).toBe(rowCount); - }); - - test('should not show link to top when not set', () => { - const data = makeData(5, 5); - renderTable(data, data.columns, data.rows, 10); - - const linkToTop = $el.find('[data-test-subj="paginateControlsLinkToTop"]'); - expect(linkToTop.length).toBe(0); - }); - - test('should show link to top when set', () => { - const data = makeData(5, 5); - renderTable(data, data.columns, data.rows, 10, undefined, true); - - const linkToTop = $el.find('[data-test-subj="paginateControlsLinkToTop"]'); - expect(linkToTop.length).toBe(1); - }); - }); - - describe('sorting', () => { - let data: Table; - let lastRowIndex: number; - - beforeEach(() => { - data = makeData(3, [ - ['bbbb', 'aaaa', 'zzzz'], - ['cccc', 'cccc', 'aaaa'], - ['zzzz', 'bbbb', 'bbbb'], - ['aaaa', 'zzzz', 'cccc'], - ]); - - lastRowIndex = data.rows.length - 1; - renderTable(data, data.columns, data.rows); - }); - - test('should not sort by default', () => { - const tableRows = $el.find('tbody tr'); - expect(tableRows.eq(0).find('td').eq(0).text()).toBe(data.rows[0][0]); - expect(tableRows.eq(lastRowIndex).find('td').eq(0).text()).toBe(data.rows[lastRowIndex][0]); - }); - - test('should do nothing when sorting by invalid column id', () => { - // sortColumn - paginatedTable.sortColumn(999); - $scope.$digest(); - - const tableRows = $el.find('tbody tr'); - expect(tableRows.eq(0).find('td').eq(0).text()).toBe('bbbb'); - expect(tableRows.eq(0).find('td').eq(1).text()).toBe('aaaa'); - expect(tableRows.eq(0).find('td').eq(2).text()).toBe('zzzz'); - }); - - test('should do nothing when sorting by non sortable column', () => { - data.columns[0].sortable = false; - - // sortColumn - paginatedTable.sortColumn(0); - $scope.$digest(); - - const tableRows = $el.find('tbody tr'); - expect(tableRows.eq(0).find('td').eq(0).text()).toBe('bbbb'); - expect(tableRows.eq(0).find('td').eq(1).text()).toBe('aaaa'); - expect(tableRows.eq(0).find('td').eq(2).text()).toBe('zzzz'); - }); - - test("should set the sort direction to asc when it's not explicitly set", () => { - paginatedTable.sortColumn(1); - $scope.$digest(); - - const tableRows = $el.find('tbody tr'); - expect(tableRows.eq(2).find('td').eq(1).text()).toBe('cccc'); - expect(tableRows.eq(1).find('td').eq(1).text()).toBe('bbbb'); - expect(tableRows.eq(0).find('td').eq(1).text()).toBe('aaaa'); - }); - - test('should allow you to explicitly set the sort direction', () => { - paginatedTable.sortColumn(1, 'desc'); - $scope.$digest(); - - const tableRows = $el.find('tbody tr'); - expect(tableRows.eq(0).find('td').eq(1).text()).toBe('zzzz'); - expect(tableRows.eq(1).find('td').eq(1).text()).toBe('cccc'); - expect(tableRows.eq(2).find('td').eq(1).text()).toBe('bbbb'); - }); - - test('should sort ascending on first invocation', () => { - // sortColumn - paginatedTable.sortColumn(0); - $scope.$digest(); - - const tableRows = $el.find('tbody tr'); - expect(tableRows.eq(0).find('td').eq(0).text()).toBe('aaaa'); - expect(tableRows.eq(lastRowIndex).find('td').eq(0).text()).toBe('zzzz'); - }); - - test('should sort descending on second invocation', () => { - // sortColumn - paginatedTable.sortColumn(0); - paginatedTable.sortColumn(0); - $scope.$digest(); - - const tableRows = $el.find('tbody tr'); - expect(tableRows.eq(0).find('td').eq(0).text()).toBe('zzzz'); - expect(tableRows.eq(lastRowIndex).find('td').eq(0).text()).toBe('aaaa'); - }); - - test('should clear sorting on third invocation', () => { - // sortColumn - paginatedTable.sortColumn(0); - paginatedTable.sortColumn(0); - paginatedTable.sortColumn(0); - $scope.$digest(); - - const tableRows = $el.find('tbody tr'); - expect(tableRows.eq(0).find('td').eq(0).text()).toBe(data.rows[0][0]); - expect(tableRows.eq(lastRowIndex).find('td').eq(0).text()).toBe('aaaa'); - }); - - test('should sort new column ascending', () => { - // sort by first column - paginatedTable.sortColumn(0); - $scope.$digest(); - - // sort by second column - paginatedTable.sortColumn(1); - $scope.$digest(); - - const tableRows = $el.find('tbody tr'); - expect(tableRows.eq(0).find('td').eq(1).text()).toBe('aaaa'); - expect(tableRows.eq(lastRowIndex).find('td').eq(1).text()).toBe('zzzz'); - }); - }); - - describe('sorting duplicate columns', () => { - let data; - const colText = 'test row'; - - beforeEach(() => { - const cols: Column[] = [{ title: colText }, { title: colText }, { title: colText }]; - const rows = [ - ['bbbb', 'aaaa', 'zzzz'], - ['cccc', 'cccc', 'aaaa'], - ['zzzz', 'bbbb', 'bbbb'], - ['aaaa', 'zzzz', 'cccc'], - ]; - data = makeData(cols, rows); - - renderTable(data, data.columns, data.rows); - }); - - test('should have duplicate column titles', () => { - const columns = $el.find('thead th span'); - columns.each((i, col) => { - expect($(col).text()).toBe(colText); - }); - }); - - test('should handle sorting on columns with the same name', () => { - // sort by the last column - paginatedTable.sortColumn(2); - $scope.$digest(); - - const tableRows = $el.find('tbody tr'); - expect(tableRows.eq(0).find('td').eq(0).text()).toBe('cccc'); - expect(tableRows.eq(0).find('td').eq(1).text()).toBe('cccc'); - expect(tableRows.eq(0).find('td').eq(2).text()).toBe('aaaa'); - expect(tableRows.eq(1).find('td').eq(2).text()).toBe('bbbb'); - expect(tableRows.eq(2).find('td').eq(2).text()).toBe('cccc'); - expect(tableRows.eq(3).find('td').eq(2).text()).toBe('zzzz'); - }); - - test('should sort correctly between columns', () => { - // sort by the last column - paginatedTable.sortColumn(2); - $scope.$digest(); - - let tableRows = $el.find('tbody tr'); - expect(tableRows.eq(0).find('td').eq(0).text()).toBe('cccc'); - expect(tableRows.eq(0).find('td').eq(1).text()).toBe('cccc'); - expect(tableRows.eq(0).find('td').eq(2).text()).toBe('aaaa'); - - // sort by the first column - paginatedTable.sortColumn(0); - $scope.$digest(); - - tableRows = $el.find('tbody tr'); - expect(tableRows.eq(0).find('td').eq(0).text()).toBe('aaaa'); - expect(tableRows.eq(0).find('td').eq(1).text()).toBe('zzzz'); - expect(tableRows.eq(0).find('td').eq(2).text()).toBe('cccc'); - - expect(tableRows.eq(1).find('td').eq(0).text()).toBe('bbbb'); - expect(tableRows.eq(2).find('td').eq(0).text()).toBe('cccc'); - expect(tableRows.eq(3).find('td').eq(0).text()).toBe('zzzz'); - }); - - test('should not sort duplicate columns', () => { - paginatedTable.sortColumn(1); - $scope.$digest(); - - const sorters = $el.find('thead th i'); - expect(sorters.eq(0).hasClass('fa-sort')).toBe(true); - expect(sorters.eq(1).hasClass('fa-sort')).toBe(false); - expect(sorters.eq(2).hasClass('fa-sort')).toBe(true); - }); - }); - - describe('object rows', () => { - let cols: Column[]; - let rows: any; - - beforeEach(() => { - cols = [ - { - title: 'object test', - id: '0', - formatter: { - convert: (val) => { - return val === 'zzz' ? '

hello

' : val; - }, - }, - }, - ]; - rows = [['aaaa'], ['zzz'], ['bbbb']]; - renderTable({ columns: cols, rows }, cols, rows); - }); - - test('should append object markup', () => { - const tableRows = $el.find('tbody tr'); - expect(tableRows.eq(0).find('h1').length).toBe(0); - expect(tableRows.eq(1).find('h1').length).toBe(1); - expect(tableRows.eq(2).find('h1').length).toBe(0); - }); - - test('should sort using object value', () => { - paginatedTable.sortColumn(0); - $scope.$digest(); - let tableRows = $el.find('tbody tr'); - expect(tableRows.eq(0).find('h1').length).toBe(0); - expect(tableRows.eq(1).find('h1').length).toBe(0); - // html row should be the last row - expect(tableRows.eq(2).find('h1').length).toBe(1); - - paginatedTable.sortColumn(0); - $scope.$digest(); - tableRows = $el.find('tbody tr'); - // html row should be the first row - expect(tableRows.eq(0).find('h1').length).toBe(1); - expect(tableRows.eq(1).find('h1').length).toBe(0); - expect(tableRows.eq(2).find('h1').length).toBe(0); - }); - }); -}); diff --git a/src/plugins/vis_type_table/public/legacy/paginated_table/rows.js b/src/plugins/vis_type_table/public/legacy/paginated_table/rows.js deleted file mode 100644 index d06e9e3bd870e..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/paginated_table/rows.js +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import $ from 'jquery'; -import _ from 'lodash'; -import angular from 'angular'; -import tableCellFilterHtml from './table_cell_filter.html'; - -export function KbnRows($compile) { - return { - restrict: 'A', - link: function ($scope, $el, attr) { - function addCell($tr, contents, column, row) { - function createCell() { - return $(document.createElement('td')); - } - - function createFilterableCell(value) { - const $template = $(tableCellFilterHtml); - $template.addClass('kbnTableCellFilter__hover'); - - const scope = $scope.$new(); - - scope.onFilterClick = (event, negate) => { - // Don't add filter if a link was clicked. - if ($(event.target).is('a')) { - return; - } - - $scope.filter({ - name: 'filterBucket', - data: { - data: [ - { - table: $scope.table, - row: $scope.rows.findIndex((r) => r === row), - column: $scope.table.columns.findIndex((c) => c.id === column.id), - value, - }, - ], - negate, - }, - }); - }; - - return $compile($template)(scope); - } - - let $cell; - let $cellContent; - - const contentsIsDefined = contents !== null && contents !== undefined; - - if (column.filterable && contentsIsDefined) { - $cell = createFilterableCell(contents); - // in jest tests 'angular' is using jqLite. In jqLite the method find lookups only by tags. - // Because of this, we should change a way how we get cell content so that tests will pass. - $cellContent = angular.element($cell[0].querySelector('[data-cell-content]')); - } else { - $cell = $cellContent = createCell(); - } - - // An AggConfigResult can "enrich" cell contents by applying a field formatter, - // which we want to do if possible. - contents = contentsIsDefined ? column.formatter.convert(contents, 'html') : ''; - - if (_.isObject(contents)) { - if (contents.attr) { - $cellContent.attr(contents.attr); - } - - if (contents.class) { - $cellContent.addClass(contents.class); - } - - if (contents.scope) { - $cellContent = $compile($cellContent.prepend(contents.markup))(contents.scope); - } else { - $cellContent.prepend(contents.markup); - } - - if (contents.attr) { - $cellContent.attr(contents.attr); - } - } else { - if (contents === '') { - $cellContent.prepend(' '); - } else { - $cellContent.prepend(contents); - } - } - - $tr.append($cell); - } - - $scope.$watchMulti([attr.kbnRows, attr.kbnRowsMin], function (vals) { - let rows = vals[0]; - const min = vals[1]; - - $el.empty(); - - if (!Array.isArray(rows)) rows = []; - - if (isFinite(min) && rows.length < min) { - // clone the rows so that we can add elements to it without upsetting the original - rows = _.clone(rows); - // crate the empty row which will be pushed into the row list over and over - const emptyRow = {}; - // push as many empty rows into the row array as needed - _.times(min - rows.length, function () { - rows.push(emptyRow); - }); - } - - rows.forEach(function (row) { - const $tr = $(document.createElement('tr')).appendTo($el); - $scope.columns.forEach((column) => { - const value = row[column.id]; - addCell($tr, value, column, row); - }); - }); - }); - }, - }; -} diff --git a/src/plugins/vis_type_table/public/legacy/paginated_table/table_cell_filter.html b/src/plugins/vis_type_table/public/legacy/paginated_table/table_cell_filter.html deleted file mode 100644 index 57ecb9b221611..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/paginated_table/table_cell_filter.html +++ /dev/null @@ -1,23 +0,0 @@ - -
- - - - - -
- diff --git a/src/plugins/vis_type_table/public/legacy/register_legacy_vis.ts b/src/plugins/vis_type_table/public/legacy/register_legacy_vis.ts deleted file mode 100644 index 447140267a3db..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/register_legacy_vis.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { METRIC_TYPE } from '@kbn/analytics'; -import { PluginInitializerContext, CoreSetup } from 'kibana/public'; - -import { TablePluginSetupDependencies, TablePluginStartDependencies } from '../plugin'; -import { createTableVisLegacyFn } from './table_vis_legacy_fn'; -import { getTableVisLegacyRenderer } from './table_vis_legacy_renderer'; -import { tableVisLegacyTypeDefinition } from './table_vis_legacy_type'; - -export const registerLegacyVis = ( - core: CoreSetup, - { expressions, visualizations, usageCollection }: TablePluginSetupDependencies, - context: PluginInitializerContext -) => { - usageCollection?.reportUiCounter('vis_type_table', METRIC_TYPE.LOADED, 'legacyVisEnabled'); - expressions.registerFunction(createTableVisLegacyFn); - expressions.registerRenderer(getTableVisLegacyRenderer(core, context)); - visualizations.createBaseVisualization(tableVisLegacyTypeDefinition); -}; diff --git a/src/plugins/vis_type_table/public/legacy/table_vis.html b/src/plugins/vis_type_table/public/legacy/table_vis.html deleted file mode 100644 index c469cd250755c..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/table_vis.html +++ /dev/null @@ -1,29 +0,0 @@ -
-
-
- - -
-
- -

-

-
-
- -
- - -
-
diff --git a/src/plugins/vis_type_table/public/legacy/table_vis_controller.js b/src/plugins/vis_type_table/public/legacy/table_vis_controller.js deleted file mode 100644 index 038c0947d3ed6..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/table_vis_controller.js +++ /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 { assign } from 'lodash'; - -export function TableVisController($scope) { - const uiStateSort = $scope.uiState ? $scope.uiState.get('vis.params.sort') : {}; - assign($scope.visParams.sort, uiStateSort); - - $scope.sort = $scope.visParams.sort; - $scope.$watchCollection('sort', function (newSort) { - $scope.uiState.set('vis.params.sort', newSort); - }); - - /** - * Recreate the entire table when: - * - the underlying data changes (esResponse) - * - one of the view options changes (vis.params) - */ - $scope.$watch('renderComplete', function () { - let tableGroups = ($scope.tableGroups = null); - let hasSomeRows = ($scope.hasSomeRows = null); - - if ($scope.esResponse) { - tableGroups = $scope.esResponse; - - hasSomeRows = tableGroups.tables.some(function haveRows(table) { - if (table.tables) return table.tables.some(haveRows); - return table.rows.length > 0; - }); - } - - $scope.hasSomeRows = hasSomeRows; - if (hasSomeRows) { - $scope.dimensions = $scope.visParams.dimensions; - $scope.tableGroups = tableGroups; - } - $scope.renderComplete(); - }); -} diff --git a/src/plugins/vis_type_table/public/legacy/table_vis_controller.test.ts b/src/plugins/vis_type_table/public/legacy/table_vis_controller.test.ts deleted file mode 100644 index e53d4e879bb3b..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/table_vis_controller.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 angular, { ICompileService, IRootScopeService, IScope } from 'angular'; -import 'angular-mocks'; -import 'angular-sanitize'; -import $ from 'jquery'; - -import { getAngularModule } from './get_inner_angular'; -import { initTableVisLegacyModule } from './table_vis_legacy_module'; -import { initAngularBootstrap } from '../../../kibana_legacy/public/angular_bootstrap'; -import { tableVisLegacyTypeDefinition } from './table_vis_legacy_type'; -import { Vis } from '../../../visualizations/public'; -import { createStubIndexPattern, stubFieldSpecMap } from '../../../data/public/stubs'; -import { tableVisLegacyResponseHandler } from './table_vis_legacy_response_handler'; -import { coreMock } from '../../../../core/public/mocks'; -import { IAggConfig, IndexPattern, search } from '../../../data/public'; -import { searchServiceMock } from '../../../data/public/search/mocks'; - -const { createAggConfigs } = searchServiceMock.createStartContract().aggs; - -const { tabifyAggResponse } = search; - -interface TableVisScope extends IScope { - [key: string]: any; -} - -const oneRangeBucket = { - hits: { - total: 6039, - max_score: 0, - hits: [], - }, - aggregations: { - agg_2: { - buckets: { - '0.0-1000.0': { - from: 0, - from_as_string: '0.0', - to: 1000, - to_as_string: '1000.0', - doc_count: 606, - }, - '1000.0-2000.0': { - from: 1000, - from_as_string: '1000.0', - to: 2000, - to_as_string: '2000.0', - doc_count: 298, - }, - }, - }, - }, -}; - -describe('Table Vis - Controller', () => { - let $rootScope: IRootScopeService & { [key: string]: any }; - let $compile: ICompileService; - let $scope: TableVisScope; - let $el: JQuery; - let tableAggResponse: any; - let tabifiedResponse: any; - let stubIndexPattern: IndexPattern; - - const initLocalAngular = () => { - const tableVisModule = getAngularModule( - 'kibana/table_vis', - coreMock.createStart(), - coreMock.createPluginInitializerContext() - ); - initTableVisLegacyModule(tableVisModule); - }; - - beforeAll(async () => { - await initAngularBootstrap(); - }); - beforeEach(initLocalAngular); - beforeEach(angular.mock.module('kibana/table_vis')); - - beforeEach( - angular.mock.inject((_$rootScope_: IRootScopeService, _$compile_: ICompileService) => { - $rootScope = _$rootScope_; - $compile = _$compile_; - tableAggResponse = tableVisLegacyResponseHandler; - }) - ); - - beforeEach(() => { - stubIndexPattern = createStubIndexPattern({ - spec: { - id: 'logstash-*', - title: 'logstash-*', - timeFieldName: 'time', - fields: stubFieldSpecMap, - }, - }); - }); - - function getRangeVis(params?: object) { - return ({ - type: tableVisLegacyTypeDefinition, - params: Object.assign({}, tableVisLegacyTypeDefinition.visConfig?.defaults, params), - data: { - aggs: createAggConfigs(stubIndexPattern, [ - { type: 'count', schema: 'metric' }, - { - type: 'range', - schema: 'bucket', - params: { - field: 'bytes', - ranges: [ - { from: 0, to: 1000 }, - { from: 1000, to: 2000 }, - ], - }, - }, - ]), - }, - } as unknown) as Vis; - } - - const dimensions = { - buckets: [ - { - accessor: 0, - }, - ], - metrics: [ - { - accessor: 1, - format: { id: 'range' }, - }, - ], - }; - - // basically a parameterized beforeEach - function initController(vis: Vis) { - vis.data.aggs!.aggs.forEach((agg: IAggConfig, i: number) => { - agg.id = 'agg_' + (i + 1); - }); - - tabifiedResponse = tabifyAggResponse(vis.data.aggs!, oneRangeBucket); - $rootScope.vis = vis; - $rootScope.visParams = vis.params; - $rootScope.uiState = { - get: jest.fn(), - set: jest.fn(), - }; - $rootScope.renderComplete = () => {}; - $rootScope.newScope = (scope: TableVisScope) => { - $scope = scope; - }; - - $el = $('
') - .attr('ng-controller', 'KbnTableVisController') - .attr('ng-init', 'newScope(this)'); - - $compile($el)($rootScope); - } - - // put a response into the controller - function attachEsResponseToScope(resp: object) { - $rootScope.esResponse = resp; - $rootScope.$apply(); - } - - // remove the response from the controller - function removeEsResponseFromScope() { - delete $rootScope.esResponse; - $rootScope.renderComplete = () => {}; - $rootScope.$apply(); - } - - test('exposes #tableGroups and #hasSomeRows when a response is attached to scope', async () => { - const vis: Vis = getRangeVis(); - initController(vis); - - expect(!$scope.tableGroups).toBeTruthy(); - expect(!$scope.hasSomeRows).toBeTruthy(); - - attachEsResponseToScope(await tableAggResponse(tabifiedResponse, dimensions)); - - expect($scope.hasSomeRows).toBeTruthy(); - expect($scope.tableGroups.tables).toBeDefined(); - expect($scope.tableGroups.tables.length).toBe(1); - expect($scope.tableGroups.tables[0].columns.length).toBe(2); - expect($scope.tableGroups.tables[0].rows.length).toBe(2); - }); - - test('clears #tableGroups and #hasSomeRows when the response is removed', async () => { - const vis = getRangeVis(); - initController(vis); - - attachEsResponseToScope(await tableAggResponse(tabifiedResponse, dimensions)); - removeEsResponseFromScope(); - - expect(!$scope.hasSomeRows).toBeTruthy(); - expect(!$scope.tableGroups).toBeTruthy(); - }); - - test('sets the sort on the scope when it is passed as a vis param', async () => { - const sortObj = { - columnIndex: 1, - direction: 'asc', - }; - const vis = getRangeVis({ sort: sortObj }); - initController(vis); - - attachEsResponseToScope(await tableAggResponse(tabifiedResponse, dimensions)); - - expect($scope.sort.columnIndex).toEqual(sortObj.columnIndex); - expect($scope.sort.direction).toEqual(sortObj.direction); - }); - - test('sets #hasSomeRows properly if the table group is empty', async () => { - const vis = getRangeVis(); - initController(vis); - - tabifiedResponse.rows = []; - - attachEsResponseToScope(await tableAggResponse(tabifiedResponse, dimensions)); - - expect($scope.hasSomeRows).toBeFalsy(); - expect(!$scope.tableGroups).toBeTruthy(); - }); - - test('passes partialRows:true to tabify based on the vis params', () => { - const vis = getRangeVis({ showPartialRows: true }); - initController(vis); - - expect((vis.type.hierarchicalData as Function)(vis)).toEqual(true); - }); - - test('passes partialRows:false to tabify based on the vis params', () => { - const vis = getRangeVis({ showPartialRows: false }); - initController(vis); - - expect((vis.type.hierarchicalData as Function)(vis)).toEqual(false); - }); -}); diff --git a/src/plugins/vis_type_table/public/legacy/table_vis_legacy_fn.test.ts b/src/plugins/vis_type_table/public/legacy/table_vis_legacy_fn.test.ts deleted file mode 100644 index 694edc66914be..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/table_vis_legacy_fn.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { createTableVisLegacyFn } from './table_vis_legacy_fn'; -import { tableVisLegacyResponseHandler } from './table_vis_legacy_response_handler'; - -import { functionWrapper } from '../../../expressions/common/expression_functions/specs/tests/utils'; - -jest.mock('./table_vis_legacy_response_handler', () => ({ - tableVisLegacyResponseHandler: jest.fn().mockReturnValue({ - tables: [{ columns: [], rows: [] }], - }), -})); - -describe('interpreter/functions#table', () => { - const fn = functionWrapper(createTableVisLegacyFn()); - const context = { - type: 'datatable', - rows: [{ 'col-0-1': 0 }], - columns: [{ id: 'col-0-1', name: 'Count' }], - }; - const visConfig = { - title: 'My Chart title', - perPage: 10, - showPartialRows: false, - showMetricsAtAllLevels: false, - sort: { - columnIndex: null, - direction: null, - }, - showTotal: false, - totalFunc: 'sum', - dimensions: { - metrics: [ - { - accessor: 0, - format: { - id: 'number', - }, - params: {}, - aggType: 'count', - }, - ], - buckets: [], - }, - }; - - beforeEach(() => { - jest.clearAllMocks(); - }); - - it('returns an object with the correct structure', async () => { - const actual = await fn(context, { visConfig: JSON.stringify(visConfig) }, undefined); - expect(actual).toMatchSnapshot(); - }); - - it('calls response handler with correct values', async () => { - await fn(context, { visConfig: JSON.stringify(visConfig) }, undefined); - expect(tableVisLegacyResponseHandler).toHaveBeenCalledTimes(1); - expect(tableVisLegacyResponseHandler).toHaveBeenCalledWith(context, visConfig.dimensions); - }); -}); diff --git a/src/plugins/vis_type_table/public/legacy/table_vis_legacy_fn.ts b/src/plugins/vis_type_table/public/legacy/table_vis_legacy_fn.ts deleted file mode 100644 index 01f0e45ec9c26..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/table_vis_legacy_fn.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { ExpressionFunctionDefinition, Datatable, Render } from 'src/plugins/expressions/public'; -import { tableVisLegacyResponseHandler, TableContext } from './table_vis_legacy_response_handler'; -import { TableVisConfig } from '../types'; -import { VIS_TYPE_TABLE } from '../../common'; - -export type Input = Datatable; - -interface Arguments { - visConfig: string | null; -} - -export interface TableVisRenderValue { - visData: TableContext; - visType: typeof VIS_TYPE_TABLE; - visConfig: TableVisConfig; -} - -export type TableExpressionFunctionDefinition = ExpressionFunctionDefinition< - 'kibana_table', - Input, - Arguments, - Render ->; - -export const createTableVisLegacyFn = (): TableExpressionFunctionDefinition => ({ - name: 'kibana_table', - type: 'render', - inputTypes: ['datatable'], - help: i18n.translate('visTypeTable.function.help', { - defaultMessage: 'Table visualization', - }), - args: { - visConfig: { - types: ['string', 'null'], - default: '"{}"', - help: '', - }, - }, - fn(input, args) { - const visConfig = args.visConfig && JSON.parse(args.visConfig); - const convertedData = tableVisLegacyResponseHandler(input, visConfig.dimensions); - - return { - type: 'render', - as: 'table_vis', - value: { - visData: convertedData, - visType: VIS_TYPE_TABLE, - visConfig, - }, - }; - }, -}); diff --git a/src/plugins/vis_type_table/public/legacy/table_vis_legacy_module.ts b/src/plugins/vis_type_table/public/legacy/table_vis_legacy_module.ts deleted file mode 100644 index 59ee876c04278..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/table_vis_legacy_module.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { IModule } from 'angular'; - -// @ts-ignore -import { TableVisController } from './table_vis_controller.js'; -// @ts-ignore -import { KbnAggTable } from './agg_table/agg_table'; -// @ts-ignore -import { KbnAggTableGroup } from './agg_table/agg_table_group'; -// @ts-ignore -import { KbnRows } from './paginated_table/rows'; -// @ts-ignore -import { PaginatedTable } from './paginated_table/paginated_table'; - -/** @internal */ -export const initTableVisLegacyModule = (angularIns: IModule): void => { - angularIns - .controller('KbnTableVisController', TableVisController) - .directive('kbnAggTable', KbnAggTable) - .directive('kbnAggTableGroup', KbnAggTableGroup) - .directive('kbnRows', KbnRows) - .directive('paginatedTable', PaginatedTable); -}; diff --git a/src/plugins/vis_type_table/public/legacy/table_vis_legacy_renderer.tsx b/src/plugins/vis_type_table/public/legacy/table_vis_legacy_renderer.tsx deleted file mode 100644 index bab973209c28c..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/table_vis_legacy_renderer.tsx +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { CoreSetup, PluginInitializerContext } from 'kibana/public'; -import { ExpressionRenderDefinition } from 'src/plugins/expressions'; -import { TablePluginStartDependencies } from '../plugin'; -import { TableVisRenderValue } from '../table_vis_fn'; -import { TableVisLegacyController } from './vis_controller'; - -const tableVisRegistry = new Map(); - -export const getTableVisLegacyRenderer: ( - core: CoreSetup, - context: PluginInitializerContext -) => ExpressionRenderDefinition = (core, context) => ({ - name: 'table_vis', - reuseDomNode: true, - render: async (domNode, config, handlers) => { - let registeredController = tableVisRegistry.get(domNode); - - if (!registeredController) { - const { getTableVisualizationControllerClass } = await import('./vis_controller'); - - const Controller = getTableVisualizationControllerClass(core, context); - registeredController = new Controller(domNode); - tableVisRegistry.set(domNode, registeredController); - - handlers.onDestroy(() => { - registeredController?.destroy(); - tableVisRegistry.delete(domNode); - }); - } - - await registeredController.render(config.visData, config.visConfig, handlers); - handlers.done(); - }, -}); diff --git a/src/plugins/vis_type_table/public/legacy/table_vis_legacy_response_handler.ts b/src/plugins/vis_type_table/public/legacy/table_vis_legacy_response_handler.ts deleted file mode 100644 index cb40b151eb31a..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/table_vis_legacy_response_handler.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { Required } from '@kbn/utility-types'; - -import { SchemaConfig } from 'src/plugins/visualizations/public'; -import { getFormatService } from '../services'; -import { Input } from './table_vis_legacy_fn'; - -interface Dimensions { - buckets: SchemaConfig[]; - metrics: SchemaConfig[]; - splitColumn?: SchemaConfig[]; - splitRow?: SchemaConfig[]; -} - -export interface TableContext { - tables: Array; - direction?: 'row' | 'column'; -} - -export interface TableGroup { - $parent: TableContext; - table: Input; - tables: Table[]; - title: string; - name: string; - key: any; - column: number; - row: number; -} - -export interface Table { - $parent?: TableGroup; - columns: Input['columns']; - rows: Input['rows']; -} - -export function tableVisLegacyResponseHandler(table: Input, dimensions: Dimensions): TableContext { - const converted: TableContext = { - tables: [], - }; - - const split = dimensions.splitColumn || dimensions.splitRow; - - if (split) { - converted.direction = dimensions.splitRow ? 'row' : 'column'; - const splitColumnIndex = split[0].accessor; - const splitColumnFormatter = getFormatService().deserialize(split[0].format); - const splitColumn = table.columns[splitColumnIndex]; - const splitMap: Record = {}; - let splitIndex = 0; - - table.rows.forEach((row, rowIndex) => { - const splitValue = row[splitColumn.id]; - - if (!splitMap.hasOwnProperty(splitValue)) { - splitMap[splitValue] = splitIndex++; - const tableGroup: Required = { - $parent: converted, - title: `${splitColumnFormatter.convert(splitValue)}: ${splitColumn.name}`, - name: splitColumn.name, - key: splitValue, - column: splitColumnIndex, - row: rowIndex, - table, - tables: [], - }; - - tableGroup.tables.push({ - $parent: tableGroup, - columns: table.columns, - rows: [], - }); - - converted.tables.push(tableGroup); - } - - const tableIndex = splitMap[splitValue]; - (converted.tables[tableIndex] as TableGroup).tables[0].rows.push(row); - }); - } else { - converted.tables.push({ - columns: table.columns, - rows: table.rows, - }); - } - - return converted; -} diff --git a/src/plugins/vis_type_table/public/legacy/table_vis_legacy_type.ts b/src/plugins/vis_type_table/public/legacy/table_vis_legacy_type.ts deleted file mode 100644 index e582f098a5fd5..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/table_vis_legacy_type.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 and the Server Side Public License, v 1; you may not 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 { AggGroupNames } from '../../../data/public'; -import { VisTypeDefinition } from '../../../visualizations/public'; - -import { TableOptions } from '../components/table_vis_options_lazy'; -import { VIS_EVENT_TO_TRIGGER } from '../../../visualizations/public'; -import { TableVisParams, VIS_TYPE_TABLE } from '../../common'; -import { toExpressionAstLegacy } from './to_ast_legacy'; - -export const tableVisLegacyTypeDefinition: VisTypeDefinition = { - name: VIS_TYPE_TABLE, - title: i18n.translate('visTypeTable.tableVisTitle', { - defaultMessage: 'Data table', - }), - icon: 'visTable', - description: i18n.translate('visTypeTable.tableVisDescription', { - defaultMessage: 'Display data in rows and columns.', - }), - getSupportedTriggers: () => { - return [VIS_EVENT_TO_TRIGGER.filter]; - }, - visConfig: { - defaults: { - perPage: 10, - showPartialRows: false, - showMetricsAtAllLevels: false, - sort: { - columnIndex: null, - direction: null, - }, - showTotal: false, - totalFunc: 'sum', - percentageCol: '', - }, - }, - editorConfig: { - optionsTemplate: TableOptions, - schemas: [ - { - group: AggGroupNames.Metrics, - name: 'metric', - title: i18n.translate('visTypeTable.tableVisEditorConfig.schemas.metricTitle', { - defaultMessage: 'Metric', - }), - aggFilter: ['!geo_centroid', '!geo_bounds', '!filtered_metric', '!single_percentile'], - aggSettings: { - top_hits: { - allowStrings: true, - }, - }, - min: 1, - defaults: [{ type: 'count', schema: 'metric' }], - }, - { - group: AggGroupNames.Buckets, - name: 'bucket', - title: i18n.translate('visTypeTable.tableVisEditorConfig.schemas.bucketTitle', { - defaultMessage: 'Split rows', - }), - aggFilter: ['!filter'], - }, - { - group: AggGroupNames.Buckets, - name: 'split', - title: i18n.translate('visTypeTable.tableVisEditorConfig.schemas.splitTitle', { - defaultMessage: 'Split table', - }), - min: 0, - max: 1, - aggFilter: ['!filter'], - }, - ], - }, - toExpressionAst: toExpressionAstLegacy, - hierarchicalData: (vis) => vis.params.showPartialRows || vis.params.showMetricsAtAllLevels, - requiresSearch: true, -}; diff --git a/src/plugins/vis_type_table/public/legacy/to_ast_legacy.ts b/src/plugins/vis_type_table/public/legacy/to_ast_legacy.ts deleted file mode 100644 index b4c8505bbde76..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/to_ast_legacy.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { - EsaggsExpressionFunctionDefinition, - IndexPatternLoadExpressionFunctionDefinition, -} from '../../../data/public'; -import { buildExpression, buildExpressionFunction } from '../../../expressions/public'; -import { getVisSchemas, VisToExpressionAst } from '../../../visualizations/public'; -import { TableVisParams } from '../../common'; -import { TableExpressionFunctionDefinition } from './table_vis_legacy_fn'; - -const buildTableVisConfig = ( - schemas: ReturnType, - visParams: TableVisParams -) => { - const metrics = schemas.metric; - const buckets = schemas.bucket || []; - const visConfig = { - dimensions: { - metrics, - buckets, - splitRow: schemas.split_row, - splitColumn: schemas.split_column, - }, - }; - - if (visParams.showPartialRows && !visParams.showMetricsAtAllLevels) { - // Handle case where user wants to see partial rows but not metrics at all levels. - // This requires calculating how many metrics will come back in the tabified response, - // and removing all metrics from the dimensions except the last set. - const metricsPerBucket = metrics.length / buckets.length; - visConfig.dimensions.metrics.splice(0, metricsPerBucket * buckets.length - metricsPerBucket); - } - return visConfig; -}; - -export const toExpressionAstLegacy: VisToExpressionAst = (vis, params) => { - const esaggs = buildExpressionFunction('esaggs', { - index: buildExpression([ - buildExpressionFunction('indexPatternLoad', { - id: vis.data.indexPattern!.id!, - }), - ]), - metricsAtAllLevels: vis.isHierarchical(), - partialRows: vis.params.showPartialRows, - aggs: vis.data.aggs!.aggs.map((agg) => buildExpression(agg.toExpressionAst())), - }); - - const schemas = getVisSchemas(vis, params); - - const visConfig = { - ...vis.params, - ...buildTableVisConfig(schemas, vis.params), - title: vis.title, - }; - - const table = buildExpressionFunction('kibana_table', { - visConfig: JSON.stringify(visConfig), - }); - - const ast = buildExpression([esaggs, table]); - - return ast.toAst(); -}; diff --git a/src/plugins/vis_type_table/public/legacy/vis_controller.ts b/src/plugins/vis_type_table/public/legacy/vis_controller.ts deleted file mode 100644 index a9cb22a056913..0000000000000 --- a/src/plugins/vis_type_table/public/legacy/vis_controller.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { CoreSetup, PluginInitializerContext } from 'kibana/public'; -import angular, { IModule, auto, IRootScopeService, IScope, ICompileService } from 'angular'; -import $ from 'jquery'; - -import './index.scss'; - -import { IInterpreterRenderHandlers } from 'src/plugins/expressions'; -import { getAngularModule } from './get_inner_angular'; -import { initTableVisLegacyModule } from './table_vis_legacy_module'; -// @ts-ignore -import tableVisTemplate from './table_vis.html'; -import { TablePluginStartDependencies } from '../plugin'; -import { TableVisConfig, TableVisData } from '../types'; - -const innerAngularName = 'kibana/table_vis'; - -export type TableVisLegacyController = InstanceType< - ReturnType ->; - -export function getTableVisualizationControllerClass( - core: CoreSetup, - context: PluginInitializerContext -) { - return class TableVisualizationController { - tableVisModule: IModule | undefined; - injector: auto.IInjectorService | undefined; - el: JQuery; - $rootScope: IRootScopeService | null = null; - $scope: (IScope & { [key: string]: any }) | undefined; - $compile: ICompileService | undefined; - - constructor(domeElement: Element) { - this.el = $(domeElement); - } - - getInjector() { - if (!this.injector) { - const mountpoint = document.createElement('div'); - mountpoint.className = 'visualization'; - this.injector = angular.bootstrap(mountpoint, [innerAngularName]); - this.el.append(mountpoint); - } - - return this.injector; - } - - async initLocalAngular() { - if (!this.tableVisModule) { - const [coreStart, { kibanaLegacy }] = await core.getStartServices(); - await kibanaLegacy.loadAngularBootstrap(); - this.tableVisModule = getAngularModule(innerAngularName, coreStart, context); - initTableVisLegacyModule(this.tableVisModule); - kibanaLegacy.loadFontAwesome(); - } - } - - async render( - esResponse: TableVisData, - visParams: TableVisConfig, - handlers: IInterpreterRenderHandlers - ): Promise { - await this.initLocalAngular(); - - return new Promise(async (resolve, reject) => { - try { - if (!this.$rootScope) { - const $injector = this.getInjector(); - this.$rootScope = $injector.get('$rootScope'); - this.$compile = $injector.get('$compile'); - } - - const updateScope = () => { - if (!this.$scope) { - return; - } - - this.$scope.visState = { - params: visParams, - title: visParams.title, - }; - this.$scope.esResponse = esResponse; - this.$scope.visParams = visParams; - this.$scope.renderComplete = resolve; - this.$scope.renderFailed = reject; - this.$scope.resize = Date.now(); - this.$scope.$apply(); - }; - - if (!this.$scope && this.$compile) { - this.$scope = this.$rootScope.$new(); - this.$scope.uiState = handlers.uiState; - this.$scope.filter = handlers.event; - updateScope(); - this.el.find('div').append(this.$compile(tableVisTemplate)(this.$scope)); - this.$scope.$apply(); - } else { - updateScope(); - } - } catch (error) { - reject(error); - } - }); - } - - destroy() { - if (this.$rootScope) { - this.$rootScope.$destroy(); - this.$rootScope = null; - } - } - }; -} diff --git a/src/plugins/vis_type_table/public/plugin.ts b/src/plugins/vis_type_table/public/plugin.ts deleted file mode 100644 index 0a9d477c26691..0000000000000 --- a/src/plugins/vis_type_table/public/plugin.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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, AsyncPlugin } from 'kibana/public'; -import { Plugin as ExpressionsPublicPlugin } from '../../expressions/public'; -import { VisualizationsSetup } from '../../visualizations/public'; -import { UsageCollectionSetup } from '../../usage_collection/public'; - -import { DataPublicPluginStart } from '../../data/public'; -import { setFormatService } from './services'; -import { KibanaLegacyStart } from '../../kibana_legacy/public'; - -interface ClientConfigType { - legacyVisEnabled: boolean; -} - -/** @internal */ -export interface TablePluginSetupDependencies { - expressions: ReturnType; - visualizations: VisualizationsSetup; - usageCollection?: UsageCollectionSetup; -} - -/** @internal */ -export interface TablePluginStartDependencies { - data: DataPublicPluginStart; - kibanaLegacy: KibanaLegacyStart; -} - -/** @internal */ -export class TableVisPlugin - implements AsyncPlugin { - initializerContext: PluginInitializerContext; - - constructor(initializerContext: PluginInitializerContext) { - this.initializerContext = initializerContext; - } - - public async setup( - core: CoreSetup, - deps: TablePluginSetupDependencies - ) { - const { legacyVisEnabled } = this.initializerContext.config.get(); - - if (legacyVisEnabled) { - const { registerLegacyVis } = await import('./legacy'); - registerLegacyVis(core, deps, this.initializerContext); - } else { - const { registerTableVis } = await import('./register_vis'); - registerTableVis(core, deps, this.initializerContext); - } - } - - public start(core: CoreStart, { data }: TablePluginStartDependencies) { - setFormatService(data.fieldFormats); - } -} diff --git a/src/plugins/vis_type_table/public/services.ts b/src/plugins/vis_type_table/public/services.ts deleted file mode 100644 index 3122e65714ac8..0000000000000 --- a/src/plugins/vis_type_table/public/services.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { createGetterSetter } from '../../kibana_utils/public'; -import { DataPublicPluginStart } from '../../data/public'; - -export const [getFormatService, setFormatService] = createGetterSetter< - DataPublicPluginStart['fieldFormats'] ->('table data.fieldFormats'); diff --git a/src/plugins/vis_type_table/public/to_ast.test.ts b/src/plugins/vis_type_table/public/to_ast.test.ts deleted file mode 100644 index 32b2b5939ed89..0000000000000 --- a/src/plugins/vis_type_table/public/to_ast.test.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { Vis } from 'src/plugins/visualizations/public'; -import { toExpressionAst } from './to_ast'; -import { AggTypes, TableVisParams } from '../common'; -import { buildExpressionFunction } from '../../expressions/public'; - -const mockSchemas = { - metric: [{ accessor: 1, format: { id: 'number' }, params: {}, label: 'Count', aggType: 'count' }], - bucket: [ - { - accessor: 0, - format: { id: 'date', params: { pattern: 'YYYY-MM-DD HH:mm' } }, - params: {}, - label: 'order_date per 3 hours', - aggType: 'date_histogram', - }, - ], -}; - -const mockTableExpressionFunction = { - addArgument: jest.fn(), -}; - -const mockTableExpression = { - toAst: jest.fn(), -}; - -jest.mock('../../visualizations/public', () => ({ - getVisSchemas: () => mockSchemas, -})); - -jest.mock('../../expressions/public', () => ({ - buildExpression: jest.fn(() => mockTableExpression), - buildExpressionFunction: jest.fn(() => mockTableExpressionFunction), -})); - -describe('table vis toExpressionAst function', () => { - let vis: Vis; - - beforeEach(() => { - vis = { - isHierarchical: () => false, - type: {}, - params: { - perPage: 20, - percentageCol: 'Count', - showLabel: false, - showMetricsAtAllLevels: true, - showPartialRows: true, - showTotal: true, - showToolbar: false, - totalFunc: AggTypes.SUM, - }, - data: { - indexPattern: { id: '123' }, - aggs: { - getResponseAggs: () => [], - aggs: [], - }, - }, - } as any; - }); - - afterEach(() => { - jest.clearAllMocks(); - }); - - it('should create table expression ast', () => { - toExpressionAst(vis, {} as any); - - expect((buildExpressionFunction as jest.Mock).mock.calls.length).toEqual(5); - expect((buildExpressionFunction as jest.Mock).mock.calls[0]).toEqual([ - 'indexPatternLoad', - { id: '123' }, - ]); - expect((buildExpressionFunction as jest.Mock).mock.calls[1]).toEqual([ - 'esaggs', - { - index: expect.any(Object), - metricsAtAllLevels: false, - partialRows: true, - aggs: [], - }, - ]); - // prepare metrics dimensions - expect((buildExpressionFunction as jest.Mock).mock.calls[2]).toEqual([ - 'visdimension', - { accessor: 1 }, - ]); - // prepare buckets dimensions - expect((buildExpressionFunction as jest.Mock).mock.calls[3]).toEqual([ - 'visdimension', - { accessor: 0 }, - ]); - // prepare table expression function - expect((buildExpressionFunction as jest.Mock).mock.calls[4]).toEqual([ - 'kibana_table', - { - buckets: [mockTableExpression], - metrics: [mockTableExpression], - perPage: 20, - percentageCol: 'Count', - row: undefined, - showMetricsAtAllLevels: true, - showPartialRows: true, - showToolbar: false, - showTotal: true, - title: undefined, - totalFunc: 'sum', - }, - ]); - }); - - it('should filter out invalid vis params', () => { - // @ts-expect-error - vis.params.sort = { columnIndex: null }; - toExpressionAst(vis, {} as any); - expect((buildExpressionFunction as jest.Mock).mock.calls[4][1].sort).toBeUndefined(); - }); -}); diff --git a/src/plugins/vis_type_table/public/to_ast.ts b/src/plugins/vis_type_table/public/to_ast.ts deleted file mode 100644 index f7fb620db1ca6..0000000000000 --- a/src/plugins/vis_type_table/public/to_ast.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { - EsaggsExpressionFunctionDefinition, - IndexPatternLoadExpressionFunctionDefinition, -} from '../../data/public'; -import { buildExpression, buildExpressionFunction } from '../../expressions/public'; -import { getVisSchemas, SchemaConfig, VisToExpressionAst } from '../../visualizations/public'; -import { TableVisParams } from '../common'; -import { TableExpressionFunctionDefinition } from './table_vis_fn'; - -const prepareDimension = (params: SchemaConfig) => { - const visdimension = buildExpressionFunction('visdimension', { accessor: params.accessor }); - - if (params.format) { - visdimension.addArgument('format', params.format.id); - visdimension.addArgument('formatParams', JSON.stringify(params.format.params)); - } - - return buildExpression([visdimension]); -}; - -const getMetrics = (schemas: ReturnType, visParams: TableVisParams) => { - const metrics = [...schemas.metric]; - - if (schemas.bucket && visParams.showPartialRows && !visParams.showMetricsAtAllLevels) { - // Handle case where user wants to see partial rows but not metrics at all levels. - // This requires calculating how many metrics will come back in the tabified response, - // and removing all metrics from the dimensions except the last set. - const metricsPerBucket = metrics.length / schemas.bucket.length; - metrics.splice(0, metricsPerBucket * schemas.bucket.length - metricsPerBucket); - } - - return metrics; -}; - -export const toExpressionAst: VisToExpressionAst = (vis, params) => { - const esaggs = buildExpressionFunction('esaggs', { - index: buildExpression([ - buildExpressionFunction('indexPatternLoad', { - id: vis.data.indexPattern!.id!, - }), - ]), - metricsAtAllLevels: vis.isHierarchical(), - partialRows: vis.params.showPartialRows, - aggs: vis.data.aggs!.aggs.map((agg) => buildExpression(agg.toExpressionAst())), - }); - - const schemas = getVisSchemas(vis, params); - const metrics = getMetrics(schemas, vis.params); - - const args = { - // explicitly pass each param to prevent extra values trapping - perPage: vis.params.perPage, - percentageCol: vis.params.percentageCol, - row: vis.params.row, - showPartialRows: vis.params.showPartialRows, - showMetricsAtAllLevels: vis.params.showMetricsAtAllLevels, - showToolbar: vis.params.showToolbar, - showTotal: vis.params.showTotal, - totalFunc: vis.params.totalFunc, - title: vis.title, - metrics: metrics.map(prepareDimension), - buckets: schemas.bucket?.map(prepareDimension), - }; - - const table = buildExpressionFunction('kibana_table', args); - - if (schemas.split_column) { - table.addArgument('splitColumn', prepareDimension(schemas.split_column[0])); - } - - if (schemas.split_row) { - table.addArgument('splitRow', prepareDimension(schemas.split_row[0])); - } - - const ast = buildExpression([esaggs, table]); - - return ast.toAst(); -}; diff --git a/src/plugins/vis_type_table/server/index.ts b/src/plugins/vis_type_table/server/index.ts deleted file mode 100644 index b3b20c22aaf52..0000000000000 --- a/src/plugins/vis_type_table/server/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { CoreSetup, PluginConfigDescriptor } from 'kibana/server'; -import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; - -import { configSchema, ConfigSchema } from '../config'; -import { registerVisTypeTableUsageCollector } from './usage_collector'; - -export const config: PluginConfigDescriptor = { - exposeToBrowser: { - legacyVisEnabled: true, - }, - schema: configSchema, - deprecations: ({ renameFromRoot }) => [ - renameFromRoot('table_vis.enabled', 'vis_type_table.enabled'), - ], -}; - -export const plugin = () => ({ - setup(core: CoreSetup, plugins: { usageCollection?: UsageCollectionSetup }) { - if (plugins.usageCollection) { - registerVisTypeTableUsageCollector(plugins.usageCollection); - } - }, - start() {}, -}); diff --git a/src/plugins/vis_type_table/tsconfig.json b/src/plugins/vis_type_table/tsconfig.json deleted file mode 100644 index 16f2f809bde38..0000000000000 --- a/src/plugins/vis_type_table/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - "*.ts" - ], - "references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../visualizations/tsconfig.json" }, - { "path": "../share/tsconfig.json" }, - { "path": "../usage_collection/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../kibana_legacy/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../vis_default_editor/tsconfig.json" }, - { "path": "../field_formats/tsconfig.json" } - ] -} diff --git a/src/plugins/vis_type_tagcloud/jest.config.js b/src/plugins/vis_type_tagcloud/jest.config.js deleted file mode 100644 index 3d24c536792bb..0000000000000 --- a/src/plugins/vis_type_tagcloud/jest.config.js +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may 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/vis_type_tagcloud'], - testRunner: 'jasmine2', -}; diff --git a/src/plugins/vis_type_tagcloud/public/__snapshots__/to_ast.test.ts.snap b/src/plugins/vis_type_tagcloud/public/__snapshots__/to_ast.test.ts.snap deleted file mode 100644 index fed6fb54288f2..0000000000000 --- a/src/plugins/vis_type_tagcloud/public/__snapshots__/to_ast.test.ts.snap +++ /dev/null @@ -1,190 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`tagcloud vis toExpressionAst function should match snapshot params fulfilled 1`] = ` -Object { - "chain": Array [ - Object { - "arguments": Object { - "aggs": Array [], - "index": Array [ - Object { - "chain": Array [ - Object { - "arguments": Object { - "id": Array [ - "123", - ], - }, - "function": "indexPatternLoad", - "type": "function", - }, - ], - "type": "expression", - }, - ], - "metricsAtAllLevels": Array [ - false, - ], - "partialRows": Array [ - false, - ], - }, - "function": "esaggs", - "type": "function", - }, - Object { - "arguments": Object { - "bucket": Array [ - Object { - "chain": Array [ - Object { - "arguments": Object { - "accessor": Array [ - 0, - ], - "format": Array [ - "terms", - ], - "formatParams": Array [ - "{\\"id\\":\\"string\\",\\"otherBucketLabel\\":\\"Other\\",\\"missingBucketLabel\\":\\"Missing\\"}", - ], - }, - "function": "visdimension", - "type": "function", - }, - ], - "type": "expression", - }, - ], - "maxFontSize": Array [ - 15, - ], - "metric": Array [ - Object { - "chain": Array [ - Object { - "arguments": Object { - "accessor": Array [ - 1, - ], - "format": Array [ - "number", - ], - }, - "function": "visdimension", - "type": "function", - }, - ], - "type": "expression", - }, - ], - "minFontSize": Array [ - 5, - ], - "orientation": Array [ - "single", - ], - "palette": Array [ - "default", - ], - "scale": Array [ - "linear", - ], - "showLabel": Array [ - true, - ], - }, - "function": "tagcloud", - "type": "function", - }, - ], - "type": "expression", -} -`; - -exports[`tagcloud vis toExpressionAst function should match snapshot without params 1`] = ` -Object { - "chain": Array [ - Object { - "arguments": Object { - "aggs": Array [], - "index": Array [ - Object { - "chain": Array [ - Object { - "arguments": Object { - "id": Array [ - "123", - ], - }, - "function": "indexPatternLoad", - "type": "function", - }, - ], - "type": "expression", - }, - ], - "metricsAtAllLevels": Array [ - false, - ], - "partialRows": Array [ - false, - ], - }, - "function": "esaggs", - "type": "function", - }, - Object { - "arguments": Object { - "bucket": Array [ - Object { - "chain": Array [ - Object { - "arguments": Object { - "accessor": Array [ - 0, - ], - "format": Array [ - "terms", - ], - "formatParams": Array [ - "{\\"id\\":\\"string\\",\\"otherBucketLabel\\":\\"Other\\",\\"missingBucketLabel\\":\\"Missing\\"}", - ], - }, - "function": "visdimension", - "type": "function", - }, - ], - "type": "expression", - }, - ], - "metric": Array [ - Object { - "chain": Array [ - Object { - "arguments": Object { - "accessor": Array [ - 1, - ], - "format": Array [ - "number", - ], - }, - "function": "visdimension", - "type": "function", - }, - ], - "type": "expression", - }, - ], - "showLabel": Array [ - false, - ], - }, - "function": "tagcloud", - "type": "function", - }, - ], - "type": "expression", -} -`; diff --git a/src/plugins/vis_type_tagcloud/public/plugin.ts b/src/plugins/vis_type_tagcloud/public/plugin.ts deleted file mode 100644 index 06e1c516d9e61..0000000000000 --- a/src/plugins/vis_type_tagcloud/public/plugin.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 and the Server Side Public License, v 1; you may not 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 } from 'kibana/public'; -import { VisualizationsSetup } from '../../visualizations/public'; -import { ChartsPluginSetup } from '../../charts/public'; - -import { getTagCloudVisTypeDefinition } from './tag_cloud_type'; -import { ConfigSchema } from '../config'; - -/** @internal */ -export interface TagCloudPluginSetupDependencies { - visualizations: VisualizationsSetup; - charts: ChartsPluginSetup; -} - -/** @internal */ -export interface TagCloudVisDependencies { - palettes: ChartsPluginSetup['palettes']; -} - -/** @internal */ -export class TagCloudPlugin implements Plugin { - initializerContext: PluginInitializerContext; - - constructor(initializerContext: PluginInitializerContext) { - this.initializerContext = initializerContext; - } - - public setup(core: CoreSetup, { visualizations, charts }: TagCloudPluginSetupDependencies) { - const visualizationDependencies: TagCloudVisDependencies = { - palettes: charts.palettes, - }; - - visualizations.createBaseVisualization(getTagCloudVisTypeDefinition(visualizationDependencies)); - } - - public start(core: CoreStart) {} -} diff --git a/src/plugins/vis_type_tagcloud/public/to_ast.test.ts b/src/plugins/vis_type_tagcloud/public/to_ast.test.ts deleted file mode 100644 index 4da9c525a4f93..0000000000000 --- a/src/plugins/vis_type_tagcloud/public/to_ast.test.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { Vis } from 'src/plugins/visualizations/public'; -import { toExpressionAst } from './to_ast'; -import { TagCloudVisParams } from './types'; - -const mockSchemas = { - metric: [{ accessor: 1, format: { id: 'number' }, params: {}, label: 'Count', aggType: 'count' }], - segment: [ - { - accessor: 0, - format: { - id: 'terms', - params: { - id: 'string', - otherBucketLabel: 'Other', - missingBucketLabel: 'Missing', - }, - }, - params: {}, - label: 'products.product_name.keyword: Descending', - aggType: 'terms', - }, - ], -}; - -jest.mock('../../visualizations/public', () => ({ - getVisSchemas: () => mockSchemas, -})); - -describe('tagcloud vis toExpressionAst function', () => { - let vis: Vis; - - beforeEach(() => { - vis = { - isHierarchical: () => false, - type: {}, - params: { - showLabel: false, - }, - data: { - indexPattern: { id: '123' }, - aggs: { - getResponseAggs: () => [], - aggs: [], - }, - }, - } as any; - }); - - it('should match snapshot without params', () => { - const actual = toExpressionAst(vis, {} as any); - expect(actual).toMatchSnapshot(); - }); - - it('should match snapshot params fulfilled', () => { - vis.params = { - scale: 'linear', - orientation: 'single', - minFontSize: 5, - maxFontSize: 15, - showLabel: true, - palette: { - type: 'palette', - name: 'default', - }, - metric: { accessor: 0, format: { id: 'number' } }, - }; - const actual = toExpressionAst(vis, {} as any); - expect(actual).toMatchSnapshot(); - }); -}); diff --git a/src/plugins/vis_type_tagcloud/public/to_ast.ts b/src/plugins/vis_type_tagcloud/public/to_ast.ts deleted file mode 100644 index c8810aa0397ee..0000000000000 --- a/src/plugins/vis_type_tagcloud/public/to_ast.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { - EsaggsExpressionFunctionDefinition, - IndexPatternLoadExpressionFunctionDefinition, -} from '../../data/public'; -import { buildExpression, buildExpressionFunction } from '../../expressions/public'; -import { getVisSchemas, SchemaConfig, VisToExpressionAst } from '../../visualizations/public'; -import { TagCloudVisParams } from './types'; - -const prepareDimension = (params: SchemaConfig) => { - const visdimension = buildExpressionFunction('visdimension', { accessor: params.accessor }); - - if (params.format) { - visdimension.addArgument('format', params.format.id); - visdimension.addArgument('formatParams', JSON.stringify(params.format.params)); - } - - return buildExpression([visdimension]); -}; - -export const toExpressionAst: VisToExpressionAst = (vis, params) => { - const esaggs = buildExpressionFunction('esaggs', { - index: buildExpression([ - buildExpressionFunction('indexPatternLoad', { - id: vis.data.indexPattern!.id!, - }), - ]), - metricsAtAllLevels: vis.isHierarchical(), - partialRows: false, - aggs: vis.data.aggs!.aggs.map((agg) => buildExpression(agg.toExpressionAst())), - }); - - const schemas = getVisSchemas(vis, params); - const { scale, orientation, minFontSize, maxFontSize, showLabel, palette } = vis.params; - - const tagcloud = buildExpressionFunction('tagcloud', { - scale, - orientation, - minFontSize, - maxFontSize, - showLabel, - metric: prepareDimension(schemas.metric[0]), - palette: palette?.name, - }); - - if (schemas.segment) { - tagcloud.addArgument('bucket', prepareDimension(schemas.segment[0])); - } - - const ast = buildExpression([esaggs, tagcloud]); - - return ast.toAst(); -}; diff --git a/src/plugins/vis_type_tagcloud/public/types.ts b/src/plugins/vis_type_tagcloud/public/types.ts deleted file mode 100644 index d855ae5ab65c6..0000000000000 --- a/src/plugins/vis_type_tagcloud/public/types.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 and the Server Side Public License, v 1; you may not 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 { ChartsPluginSetup, PaletteOutput } from '../../charts/public'; -import type { SerializedFieldFormat } from '../../expressions/public'; - -interface Dimension { - accessor: number; - format: { - id?: string; - params?: SerializedFieldFormat; - }; -} - -interface TagCloudCommonParams { - scale: 'linear' | 'log' | 'square root'; - orientation: 'single' | 'right angled' | 'multiple'; - minFontSize: number; - maxFontSize: number; - showLabel: boolean; -} - -export interface TagCloudVisParams extends TagCloudCommonParams { - palette: PaletteOutput; - metric: Dimension; - bucket?: Dimension; -} - -export interface TagCloudTypeProps { - palettes: ChartsPluginSetup['palettes']; -} diff --git a/src/plugins/vis_type_tagcloud/tsconfig.json b/src/plugins/vis_type_tagcloud/tsconfig.json deleted file mode 100644 index 043eed06c6bcb..0000000000000 --- a/src/plugins/vis_type_tagcloud/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": [ - "public/**/*", - "server/**/*", - "*.ts" - ], - "references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, - { "path": "../visualizations/tsconfig.json" }, - { "path": "../charts/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../vis_default_editor/tsconfig.json" }, - ] -} diff --git a/src/plugins/vis_type_timelion/README.md b/src/plugins/vis_type_timelion/README.md deleted file mode 100644 index 89d34527c51d6..0000000000000 --- a/src/plugins/vis_type_timelion/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Vis type Timelion - -Contains the timelion visualization and the timelion backend. - -# Generate a parser -If your grammar was changed in `public/chain.peg` you need to re-generate the static parser. You could use a grunt task: - -``` -grunt peg:timelion_chain -``` - -The generated parser will be appeared at `public/_generated_` folder, which is included in `.eslintignore` \ No newline at end of file diff --git a/src/plugins/vis_type_timelion/common/_generated_/chain.js b/src/plugins/vis_type_timelion/common/_generated_/chain.js deleted file mode 100644 index f812b94238d43..0000000000000 --- a/src/plugins/vis_type_timelion/common/_generated_/chain.js +++ /dev/null @@ -1,1780 +0,0 @@ -module.exports = (function() { - "use strict"; - - /* - * Generated by PEG.js 0.9.0. - * - * http://pegjs.org/ - */ - - function peg$subclass(child, parent) { - function ctor() { this.constructor = child; } - ctor.prototype = parent.prototype; - child.prototype = new ctor(); - } - - function peg$SyntaxError(message, expected, found, location) { - this.message = message; - this.expected = expected; - this.found = found; - this.location = location; - this.name = "SyntaxError"; - - if (typeof Error.captureStackTrace === "function") { - Error.captureStackTrace(this, peg$SyntaxError); - } - } - - peg$subclass(peg$SyntaxError, Error); - - function peg$parse(input) { - var options = arguments.length > 1 ? arguments[1] : {}, - parser = this, - - peg$FAILED = {}, - - peg$startRuleFunctions = { start: peg$parsestart }, - peg$startRuleFunction = peg$parsestart, - - peg$c0 = function(tree) { - return { - tree: tree.filter(function (o) {return o != null}), - functions: functions, - args: args, - variables: variables - } - }, - peg$c1 = ",", - peg$c2 = { type: "literal", value: ",", description: "\",\"" }, - peg$c3 = function(first, arg) {return arg}, - peg$c4 = function(first, rest) { - return [first].concat(rest); - }, - peg$c5 = "=", - peg$c6 = { type: "literal", value: "=", description: "\"=\"" }, - peg$c7 = function(name, value) { - var arg = { - type: 'namedArg', - name: name, - value: value, - location: simpleLocation(location()), - text: text() - }; - currentArgs.push(arg); - return arg; - }, - peg$c8 = function(value) { - var exception = { - type: 'incompleteArgument', - currentArgs: currentArgs, - currentFunction: currentFunction, - location: simpleLocation(location()), - text: text() - } - error(JSON.stringify(exception)); - }, - peg$c9 = function(name) { - var exception = { - type: 'incompleteArgumentValue', - currentArgs: currentArgs, - currentFunction: currentFunction, - name: name, - location: simpleLocation(location()), - text: text() - } - error(JSON.stringify(exception)); - }, - peg$c10 = function(element) {return element}, - peg$c11 = function(literal) { - var result = ltoo(literal); - result.location = simpleLocation(location()), - result.text = text(); - return result; - }, - peg$c12 = "$", - peg$c13 = { type: "literal", value: "$", description: "\"$\"" }, - peg$c14 = function(name) { - if (variables[name]) { - return variables[name]; - } else { - error('$' + name + ' is not defined') - } - }, - peg$c15 = function(name, value) { - variables[name] = value; - }, - peg$c16 = function(first, series) {return series}, - peg$c17 = function(first, rest) { - return [first].concat(rest) - }, - peg$c18 = /^[a-zA-Z]/, - peg$c19 = { type: "class", value: "[a-zA-Z]", description: "[a-zA-Z]" }, - peg$c20 = /^[.a-zA-Z0-9_\-]/, - peg$c21 = { type: "class", value: "[.a-zA-Z0-9_-]", description: "[.a-zA-Z0-9_-]" }, - peg$c22 = function(first, rest) { - currentFunction = first.join('') + rest.join(''); - currentArgs = []; - return currentFunction; - }, - peg$c23 = function(first, rest) { return first.join('') + rest.join('') }, - peg$c24 = { type: "other", description: "function" }, - peg$c25 = ".", - peg$c26 = { type: "literal", value: ".", description: "\".\"" }, - peg$c27 = "(", - peg$c28 = { type: "literal", value: "(", description: "\"(\"" }, - peg$c29 = ")", - peg$c30 = { type: "literal", value: ")", description: "\")\"" }, - peg$c31 = function(name, arg_list) { - var result = { - type: 'function', - function: name, - arguments: arg_list || [], - location: simpleLocation(location()), - text: text() - } - - result.arguments.forEach(function (arg) { - arg.function = name; - args.push(arg); - }) - - functions.push(result) - return result; - }, - peg$c32 = function(func) { - var exception = { - type: 'incompleteFunction', - function: func, - location: simpleLocation(location()), - text: text() - } - error(JSON.stringify(exception)); - }, - peg$c33 = "@", - peg$c34 = { type: "literal", value: "@", description: "\"@\"" }, - peg$c35 = ":", - peg$c36 = { type: "literal", value: ":", description: "\":\"" }, - peg$c37 = function(plot, series) { - return { - type: 'reference', - plot: plot, - series: series - } - }, - peg$c38 = function(plot) { - return { - type: 'reference', - plot: plot - } - }, - peg$c39 = function(func, rest) {return {type: 'chain', chain: [func].concat(rest)}}, - peg$c40 = function(grouped, functions) { - var first = { - type: 'chainList', - list: grouped - } - first.label = text(); - - return {type: "chain", chain: [first].concat(functions)}; - }, - peg$c41 = { type: "other", description: "literal" }, - peg$c42 = "\"", - peg$c43 = { type: "literal", value: "\"", description: "\"\\\"\"" }, - peg$c44 = function(chars) { return chars.join(''); }, - peg$c45 = "'", - peg$c46 = { type: "literal", value: "'", description: "\"'\"" }, - peg$c47 = "true", - peg$c48 = { type: "literal", value: "true", description: "\"true\"" }, - peg$c49 = function() { return true; }, - peg$c50 = "false", - peg$c51 = { type: "literal", value: "false", description: "\"false\"" }, - peg$c52 = function() { return false; }, - peg$c53 = "null", - peg$c54 = { type: "literal", value: "null", description: "\"null\"" }, - peg$c55 = function() { return null; }, - peg$c56 = /^[^()"',= \t]/, - peg$c57 = { type: "class", value: "[^()\"',=\\ \\t]", description: "[^()\"',=\\ \\t]" }, - peg$c58 = function(string) { // this also matches numbers via Number() - var result = string.join(''); - // Sort of hacky, but PEG doesn't have backtracking so - // a number rule is hard to read, and performs worse - if (isNaN(Number(result))) return result; - return Number(result) - }, - peg$c59 = /^[ \t\r\n]/, - peg$c60 = { type: "class", value: "[\\ \\t\\r\\n]", description: "[\\ \\t\\r\\n]" }, - peg$c61 = "\\", - peg$c62 = { type: "literal", value: "\\", description: "\"\\\\\"" }, - peg$c63 = function(sequence) { return sequence; }, - peg$c64 = /^[^"]/, - peg$c65 = { type: "class", value: "[^\"]", description: "[^\"]" }, - peg$c66 = /^[^']/, - peg$c67 = { type: "class", value: "[^']", description: "[^']" }, - peg$c68 = /^[0-9]/, - peg$c69 = { type: "class", value: "[0-9]", description: "[0-9]" }, - peg$c70 = function(digits) {return parseInt(digits.join(''))}, - - peg$currPos = 0, - peg$savedPos = 0, - peg$posDetailsCache = [{ line: 1, column: 1, seenCR: false }], - peg$maxFailPos = 0, - peg$maxFailExpected = [], - peg$silentFails = 0, - - peg$result; - - if ("startRule" in options) { - if (!(options.startRule in peg$startRuleFunctions)) { - throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); - } - - peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; - } - - function text() { - return input.substring(peg$savedPos, peg$currPos); - } - - function location() { - return peg$computeLocation(peg$savedPos, peg$currPos); - } - - function expected(description) { - throw peg$buildException( - null, - [{ type: "other", description: description }], - input.substring(peg$savedPos, peg$currPos), - peg$computeLocation(peg$savedPos, peg$currPos) - ); - } - - function error(message) { - throw peg$buildException( - message, - null, - input.substring(peg$savedPos, peg$currPos), - peg$computeLocation(peg$savedPos, peg$currPos) - ); - } - - function peg$computePosDetails(pos) { - var details = peg$posDetailsCache[pos], - p, ch; - - if (details) { - return details; - } else { - p = pos - 1; - while (!peg$posDetailsCache[p]) { - p--; - } - - details = peg$posDetailsCache[p]; - details = { - line: details.line, - column: details.column, - seenCR: details.seenCR - }; - - while (p < pos) { - ch = input.charAt(p); - if (ch === "\n") { - if (!details.seenCR) { details.line++; } - details.column = 1; - details.seenCR = false; - } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { - details.line++; - details.column = 1; - details.seenCR = true; - } else { - details.column++; - details.seenCR = false; - } - - p++; - } - - peg$posDetailsCache[pos] = details; - return details; - } - } - - function peg$computeLocation(startPos, endPos) { - var startPosDetails = peg$computePosDetails(startPos), - endPosDetails = peg$computePosDetails(endPos); - - return { - start: { - offset: startPos, - line: startPosDetails.line, - column: startPosDetails.column - }, - end: { - offset: endPos, - line: endPosDetails.line, - column: endPosDetails.column - } - }; - } - - function peg$fail(expected) { - if (peg$currPos < peg$maxFailPos) { return; } - - if (peg$currPos > peg$maxFailPos) { - peg$maxFailPos = peg$currPos; - peg$maxFailExpected = []; - } - - peg$maxFailExpected.push(expected); - } - - function peg$buildException(message, expected, found, location) { - function cleanupExpected(expected) { - var i = 1; - - expected.sort(function(a, b) { - if (a.description < b.description) { - return -1; - } else if (a.description > b.description) { - return 1; - } else { - return 0; - } - }); - - while (i < expected.length) { - if (expected[i - 1] === expected[i]) { - expected.splice(i, 1); - } else { - i++; - } - } - } - - function buildMessage(expected, found) { - function stringEscape(s) { - function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } - - return s - .replace(/\\/g, '\\\\') - .replace(/"/g, '\\"') - .replace(/\x08/g, '\\b') - .replace(/\t/g, '\\t') - .replace(/\n/g, '\\n') - .replace(/\f/g, '\\f') - .replace(/\r/g, '\\r') - .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) - .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) - .replace(/[\u0100-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) - .replace(/[\u1000-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); - } - - var expectedDescs = new Array(expected.length), - expectedDesc, foundDesc, i; - - for (i = 0; i < expected.length; i++) { - expectedDescs[i] = expected[i].description; - } - - expectedDesc = expected.length > 1 - ? expectedDescs.slice(0, -1).join(", ") - + " or " - + expectedDescs[expected.length - 1] - : expectedDescs[0]; - - foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; - - return "Expected " + expectedDesc + " but " + foundDesc + " found."; - } - - if (expected !== null) { - cleanupExpected(expected); - } - - return new peg$SyntaxError( - message !== null ? message : buildMessage(expected, found), - expected, - found, - location - ); - } - - function peg$parsestart() { - var s0, s1, s2; - - s0 = peg$currPos; - s1 = peg$parsespace(); - if (s1 === peg$FAILED) { - s1 = null; - } - if (s1 !== peg$FAILED) { - s2 = peg$parseseries(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c0(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsearg_list() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - s0 = peg$currPos; - s1 = peg$parseargument(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$parsespace(); - if (s4 === peg$FAILED) { - s4 = null; - } - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c1; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c2); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parsespace(); - if (s6 === peg$FAILED) { - s6 = null; - } - if (s6 !== peg$FAILED) { - s7 = peg$parseargument(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c3(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parsespace(); - if (s4 === peg$FAILED) { - s4 = null; - } - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c1; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c2); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parsespace(); - if (s6 === peg$FAILED) { - s6 = null; - } - if (s6 !== peg$FAILED) { - s7 = peg$parseargument(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c3(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - if (s2 !== peg$FAILED) { - s3 = peg$parsespace(); - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s4 = peg$c1; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c2); } - } - if (s4 === peg$FAILED) { - s4 = null; - } - if (s4 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c4(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseargument() { - var s0, s1, s2, s3, s4, s5; - - s0 = peg$currPos; - s1 = peg$parseargument_name(); - if (s1 !== peg$FAILED) { - s2 = peg$parsespace(); - if (s2 === peg$FAILED) { - s2 = null; - } - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 61) { - s3 = peg$c5; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c6); } - } - if (s3 !== peg$FAILED) { - s4 = peg$parsespace(); - if (s4 === peg$FAILED) { - s4 = null; - } - if (s4 !== peg$FAILED) { - s5 = peg$parsearg_type(); - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c7(s1, s5); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parsespace(); - if (s1 === peg$FAILED) { - s1 = null; - } - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 61) { - s2 = peg$c5; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c6); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parsespace(); - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - s4 = peg$parsearg_type(); - if (s4 === peg$FAILED) { - s4 = null; - } - if (s4 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c8(s4); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parseargument_name(); - if (s1 !== peg$FAILED) { - s2 = peg$parsespace(); - if (s2 === peg$FAILED) { - s2 = null; - } - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 61) { - s3 = peg$c5; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c6); } - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c9(s1); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parsearg_type(); - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c10(s1); - } - s0 = s1; - } - } - } - - return s0; - } - - function peg$parsearg_type() { - var s0, s1; - - s0 = peg$parsevariable_get(); - if (s0 === peg$FAILED) { - s0 = peg$parseseries_type(); - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parseliteral(); - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c11(s1); - } - s0 = s1; - } - } - - return s0; - } - - function peg$parsevariable_get() { - var s0, s1, s2; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 36) { - s1 = peg$c12; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c13); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parseargument_name(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c14(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsevariable_set() { - var s0, s1, s2, s3, s4, s5, s6; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 36) { - s1 = peg$c12; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c13); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parseargument_name(); - if (s2 !== peg$FAILED) { - s3 = peg$parsespace(); - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 61) { - s4 = peg$c5; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c6); } - } - if (s4 !== peg$FAILED) { - s5 = peg$parsespace(); - if (s5 === peg$FAILED) { - s5 = null; - } - if (s5 !== peg$FAILED) { - s6 = peg$parsearg_type(); - if (s6 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c15(s2, s6); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseseries_type() { - var s0; - - s0 = peg$parsevariable_set(); - if (s0 === peg$FAILED) { - s0 = peg$parsevariable_get(); - if (s0 === peg$FAILED) { - s0 = peg$parsegroup(); - if (s0 === peg$FAILED) { - s0 = peg$parsechain(); - if (s0 === peg$FAILED) { - s0 = peg$parsereference(); - } - } - } - } - - return s0; - } - - function peg$parseseries() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - s0 = peg$currPos; - s1 = peg$parseseries_type(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$parsespace(); - if (s4 === peg$FAILED) { - s4 = null; - } - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c1; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c2); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parsespace(); - if (s6 === peg$FAILED) { - s6 = null; - } - if (s6 !== peg$FAILED) { - s7 = peg$parseseries_type(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c16(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parsespace(); - if (s4 === peg$FAILED) { - s4 = null; - } - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c1; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c2); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parsespace(); - if (s6 === peg$FAILED) { - s6 = null; - } - if (s6 !== peg$FAILED) { - s7 = peg$parseseries_type(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s4 = peg$c16(s1, s7); - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 44) { - s3 = peg$c1; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c2); } - } - if (s3 === peg$FAILED) { - s3 = null; - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c17(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsefunction_name() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - s1 = []; - if (peg$c18.test(input.charAt(peg$currPos))) { - s2 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c19); } - } - if (s2 !== peg$FAILED) { - while (s2 !== peg$FAILED) { - s1.push(s2); - if (peg$c18.test(input.charAt(peg$currPos))) { - s2 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c19); } - } - } - } else { - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - s2 = []; - if (peg$c20.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c21); } - } - while (s3 !== peg$FAILED) { - s2.push(s3); - if (peg$c20.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c21); } - } - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c22(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseargument_name() { - var s0, s1, s2, s3; - - s0 = peg$currPos; - s1 = []; - if (peg$c18.test(input.charAt(peg$currPos))) { - s2 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c19); } - } - if (s2 !== peg$FAILED) { - while (s2 !== peg$FAILED) { - s1.push(s2); - if (peg$c18.test(input.charAt(peg$currPos))) { - s2 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c19); } - } - } - } else { - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - s2 = []; - if (peg$c20.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c21); } - } - while (s3 !== peg$FAILED) { - s2.push(s3); - if (peg$c20.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c21); } - } - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c23(s1, s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsefunction() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; - - peg$silentFails++; - s0 = peg$currPos; - s1 = peg$parsespace(); - if (s1 === peg$FAILED) { - s1 = null; - } - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 46) { - s2 = peg$c25; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c26); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parsefunction_name(); - if (s3 !== peg$FAILED) { - s4 = peg$parsespace(); - if (s4 === peg$FAILED) { - s4 = null; - } - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 40) { - s5 = peg$c27; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c28); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parsespace(); - if (s6 === peg$FAILED) { - s6 = null; - } - if (s6 !== peg$FAILED) { - s7 = peg$parsearg_list(); - if (s7 === peg$FAILED) { - s7 = null; - } - if (s7 !== peg$FAILED) { - s8 = peg$parsespace(); - if (s8 === peg$FAILED) { - s8 = null; - } - if (s8 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 41) { - s9 = peg$c29; - peg$currPos++; - } else { - s9 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c30); } - } - if (s9 !== peg$FAILED) { - s10 = peg$parsespace(); - if (s10 === peg$FAILED) { - s10 = null; - } - if (s10 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c31(s3, s7); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 46) { - s1 = peg$c25; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c26); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsefunction_name(); - if (s2 === peg$FAILED) { - s2 = null; - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c32(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c24); } - } - - return s0; - } - - function peg$parsereference() { - var s0, s1, s2, s3, s4; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 64) { - s1 = peg$c33; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c34); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parseinteger(); - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 58) { - s3 = peg$c35; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c36); } - } - if (s3 !== peg$FAILED) { - s4 = peg$parseinteger(); - if (s4 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c37(s2, s4); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 64) { - s1 = peg$c33; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c34); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parseinteger(); - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c38(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } - - return s0; - } - - function peg$parsechain() { - var s0, s1, s2, s3, s4; - - s0 = peg$currPos; - s1 = peg$parsefunction(); - if (s1 !== peg$FAILED) { - s2 = peg$parsespace(); - if (s2 === peg$FAILED) { - s2 = null; - } - if (s2 !== peg$FAILED) { - s3 = []; - s4 = peg$parsefunction(); - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$parsefunction(); - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c39(s1, s3); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsegroup() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 40) { - s1 = peg$c27; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c28); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parsespace(); - if (s2 === peg$FAILED) { - s2 = null; - } - if (s2 !== peg$FAILED) { - s3 = peg$parseseries(); - if (s3 !== peg$FAILED) { - s4 = peg$parsespace(); - if (s4 === peg$FAILED) { - s4 = null; - } - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c29; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c30); } - } - if (s5 !== peg$FAILED) { - s6 = []; - s7 = peg$parsefunction(); - while (s7 !== peg$FAILED) { - s6.push(s7); - s7 = peg$parsefunction(); - } - if (s6 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c40(s3, s6); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parseliteral() { - var s0, s1, s2, s3; - - peg$silentFails++; - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 34) { - s1 = peg$c42; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } - } - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$parsedq_char(); - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$parsedq_char(); - } - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 34) { - s3 = peg$c42; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c44(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 39) { - s1 = peg$c45; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c46); } - } - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$parsesq_char(); - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$parsesq_char(); - } - if (s2 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 39) { - s3 = peg$c45; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c46); } - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c44(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c47) { - s1 = peg$c47; - peg$currPos += 4; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c48); } - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c49(); - } - s0 = s1; - if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (input.substr(peg$currPos, 5) === peg$c50) { - s1 = peg$c50; - peg$currPos += 5; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c51); } - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c52(); - } - s0 = s1; - if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c53) { - s1 = peg$c53; - peg$currPos += 4; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c54); } - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c55(); - } - s0 = s1; - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = []; - if (peg$c56.test(input.charAt(peg$currPos))) { - s2 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c57); } - } - if (s2 !== peg$FAILED) { - while (s2 !== peg$FAILED) { - s1.push(s2); - if (peg$c56.test(input.charAt(peg$currPos))) { - s2 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c57); } - } - } - } else { - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c58(s1); - } - s0 = s1; - } - } - } - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c41); } - } - - return s0; - } - - function peg$parsespace() { - var s0, s1; - - s0 = []; - if (peg$c59.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c60); } - } - if (s1 !== peg$FAILED) { - while (s1 !== peg$FAILED) { - s0.push(s1); - if (peg$c59.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c60); } - } - } - } else { - s0 = peg$FAILED; - } - - return s0; - } - - function peg$parsedq_char() { - var s0, s1, s2; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 92) { - s1 = peg$c61; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c62); } - } - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 34) { - s2 = peg$c42; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } - } - if (s2 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 92) { - s2 = peg$c61; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c62); } - } - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c63(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - if (peg$c64.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c65); } - } - } - - return s0; - } - - function peg$parsesq_char() { - var s0, s1, s2; - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 92) { - s1 = peg$c61; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c62); } - } - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 39) { - s2 = peg$c45; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c46); } - } - if (s2 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 92) { - s2 = peg$c61; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c62); } - } - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c63(s2); - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - if (peg$c66.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c67); } - } - } - - return s0; - } - - function peg$parseinteger() { - var s0, s1, s2; - - s0 = peg$currPos; - s1 = []; - if (peg$c68.test(input.charAt(peg$currPos))) { - s2 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c69); } - } - if (s2 !== peg$FAILED) { - while (s2 !== peg$FAILED) { - s1.push(s2); - if (peg$c68.test(input.charAt(peg$currPos))) { - s2 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c69); } - } - } - } else { - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c70(s1); - } - s0 = s1; - - return s0; - } - - - function ltoo (literal) { - return {type: 'literal', value: literal} - } - - function simpleLocation (location) { - // Returns an object representing the position of the function within the expression, - // demarcated by the position of its first character and last character. We calculate these values - // using the offset because the expression could span multiple lines, and we don't want to deal - // with column and line values. - return { - min: location.start.offset, - max: location.end.offset - } - } - - var currentFunction; - var currentArgs = []; - - var functions = []; - var args = []; - var variables = {}; - - - - peg$result = peg$startRuleFunction(); - - if (peg$result !== peg$FAILED && peg$currPos === input.length) { - return peg$result; - } else { - if (peg$result !== peg$FAILED && peg$currPos < input.length) { - peg$fail({ type: "end", description: "end of input" }); - } - - throw peg$buildException( - null, - peg$maxFailExpected, - peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, - peg$maxFailPos < input.length - ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) - : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) - ); - } - } - - return { - SyntaxError: peg$SyntaxError, - parse: peg$parse - }; -})(); \ No newline at end of file diff --git a/src/plugins/vis_type_timelion/config.ts b/src/plugins/vis_type_timelion/config.ts deleted file mode 100644 index aa88d786af51e..0000000000000 --- a/src/plugins/vis_type_timelion/config.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 and the Server Side Public License, v 1; you may not 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'; - -export const configSchema = schema.object( - { - enabled: schema.boolean({ defaultValue: true }), - ui: schema.object({ enabled: schema.boolean({ defaultValue: false }) }), - graphiteUrls: schema.maybe(schema.arrayOf(schema.string())), - }, - // This option should be removed as soon as we entirely migrate config from legacy Timelion plugin. - { unknowns: 'allow' } -); - -export type ConfigSchema = TypeOf; diff --git a/src/plugins/vis_type_timelion/jest.config.js b/src/plugins/vis_type_timelion/jest.config.js deleted file mode 100644 index ed4eedaee2fbf..0000000000000 --- a/src/plugins/vis_type_timelion/jest.config.js +++ /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 and the Server Side Public License, v 1; you may 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/vis_type_timelion'], -}; diff --git a/src/plugins/vis_type_timelion/public/components/timelion_vis_component.tsx b/src/plugins/vis_type_timelion/public/components/timelion_vis_component.tsx deleted file mode 100644 index 858ba0ad64add..0000000000000 --- a/src/plugins/vis_type_timelion/public/components/timelion_vis_component.tsx +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { useCallback, useMemo, useRef } from 'react'; -import { compact, last, map } from 'lodash'; -import { - Chart, - Settings, - Position, - Axis, - TooltipType, - LegendPositionConfig, - LayoutDirection, -} from '@elastic/charts'; -import { EuiTitle } from '@elastic/eui'; - -import { useKibana } from '../../../kibana_react/public'; -import { useActiveCursor } from '../../../charts/public'; - -import { AreaSeriesComponent, BarSeriesComponent } from './series'; - -import { - extractAllYAxis, - withStaticPadding, - createTickFormat, - validateLegendPositionValue, - MAIN_GROUP_ID, -} from '../helpers/panel_utils'; - -import { colors } from '../helpers/chart_constants'; -import { getCharts } from '../helpers/plugin_services'; - -import type { Sheet } from '../helpers/timelion_request_handler'; -import type { IInterpreterRenderHandlers } from '../../../expressions'; -import type { TimelionVisDependencies } from '../plugin'; -import type { RangeFilterParams } from '../../../data/public'; -import type { Series } from '../helpers/timelion_request_handler'; - -import './timelion_vis.scss'; - -declare global { - interface Window { - /** - * Flag used to enable debugState on elastic charts - */ - _echDebugStateFlag?: boolean; - } -} - -interface TimelionVisComponentProps { - interval: string; - seriesList: Sheet; - onBrushEvent: (rangeFilterParams: RangeFilterParams) => void; - renderComplete: IInterpreterRenderHandlers['done']; -} - -const DefaultYAxis = () => ( - -); - -const renderYAxis = (series: Series[]) => { - const yAxisOptions = extractAllYAxis(series); - - const yAxis = yAxisOptions.map((option, index) => ( - - )); - - return yAxis.length ? yAxis : ; -}; - -const TimelionVisComponent = ({ - interval, - seriesList, - renderComplete, - onBrushEvent, -}: TimelionVisComponentProps) => { - const kibana = useKibana(); - const chartRef = useRef(null); - const chart = seriesList.list; - const chartsService = getCharts(); - - const chartTheme = chartsService.theme.useChartsTheme(); - const chartBaseTheme = chartsService.theme.useChartsBaseTheme(); - - const handleCursorUpdate = useActiveCursor(chartsService.activeCursor, chartRef, { - isDateHistogram: true, - }); - - const brushEndListener = useCallback( - ({ x }) => { - if (!x) { - return; - } - - onBrushEvent({ - gte: x[0], - lte: x[1], - }); - }, - [onBrushEvent] - ); - - const onRenderChange = useCallback( - (isRendered: boolean) => { - if (isRendered) { - renderComplete(); - } - }, - [renderComplete] - ); - - const title: string = useMemo(() => last(compact(map(seriesList.list, '_title'))) || '', [ - seriesList.list, - ]); - - const tickFormat = useMemo( - () => createTickFormat(interval, kibana.services.timefilter, kibana.services.uiSettings), - [interval, kibana.services.timefilter, kibana.services.uiSettings] - ); - - const legend = useMemo(() => { - const legendPosition: LegendPositionConfig = { - floating: true, - floatingColumns: 1, - vAlign: Position.Top, - hAlign: Position.Left, - direction: LayoutDirection.Vertical, - }; - let showLegend = true; - - chart.forEach((series) => { - if (series._global?.legend) { - const { show = true, position, noColumns = legendPosition.floatingColumns } = - series._global?.legend ?? {}; - - if (validateLegendPositionValue(position)) { - const [vAlign, hAlign] = position.split(''); - - legendPosition.vAlign = vAlign === 'n' ? Position.Top : Position.Bottom; - legendPosition.hAlign = hAlign === 'e' ? Position.Right : Position.Left; - } - - if (!show) { - showLegend = false; - } - - if (noColumns !== undefined) { - legendPosition.floatingColumns = noColumns; - } - } - }); - - return { legendPosition, showLegend }; - }, [chart]); - - return ( -
- {title && ( - -

{title}

-
- )} - - tickFormat(value), - type: TooltipType.VerticalCursor, - }} - externalPointerEvents={{ tooltip: { visible: false } }} - /> - - - - {renderYAxis(chart)} - - {chart.map((data, index) => { - const visData = { ...data }; - const SeriesComponent = data.bars ? BarSeriesComponent : AreaSeriesComponent; - - if (!visData.color) { - visData.color = colors[index % colors.length]; - } - return ( - - ); - })} - -
- ); -}; - -// default export required for React.Lazy -// eslint-disable-next-line import/no-default-export -export { TimelionVisComponent as default }; diff --git a/src/plugins/vis_type_timelion/public/index.ts b/src/plugins/vis_type_timelion/public/index.ts deleted file mode 100644 index 1ab572b497212..0000000000000 --- a/src/plugins/vis_type_timelion/public/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 'kibana/public'; -import { TimelionVisPlugin as Plugin } from './plugin'; - -import { tickFormatters } from './legacy/tick_formatters'; -import { getTimezone } from './helpers/get_timezone'; -import { xaxisFormatterProvider } from './helpers/xaxis_formatter'; -import { generateTicksProvider } from './helpers/tick_generator'; -import { DEFAULT_TIME_FORMAT, calculateInterval } from '../common/lib'; -import { parseTimelionExpressionAsync } from '../common/parser_async'; - -export function plugin(initializerContext: PluginInitializerContext) { - return new Plugin(initializerContext); -} - -// This export should be removed on removing Timeline APP -export const _LEGACY_ = { - DEFAULT_TIME_FORMAT, - calculateInterval, - parseTimelionExpressionAsync, - tickFormatters, - getTimezone, - xaxisFormatterProvider, - generateTicksProvider, -}; - -export { VisTypeTimelionPluginStart, VisTypeTimelionPluginSetup } from './plugin'; diff --git a/src/plugins/vis_type_timelion/public/legacy/timelion_vis_component.tsx b/src/plugins/vis_type_timelion/public/legacy/timelion_vis_component.tsx deleted file mode 100644 index ddac86fa73bee..0000000000000 --- a/src/plugins/vis_type_timelion/public/legacy/timelion_vis_component.tsx +++ /dev/null @@ -1,418 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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, useEffect, useMemo, useCallback } from 'react'; -import $ from 'jquery'; -import moment from 'moment-timezone'; -import { debounce, compact, get, each, cloneDeep, last, map } from 'lodash'; -import { useResizeObserver } from '@elastic/eui'; - -import { IInterpreterRenderHandlers } from 'src/plugins/expressions'; -import { useKibana } from '../../../kibana_react/public'; -import { DEFAULT_TIME_FORMAT } from '../../common/lib'; - -import { - buildSeriesData, - buildOptions, - SERIES_ID_ATTR, - LegacyAxis, - ACTIVE_CURSOR, - eventBus, -} from './panel_utils'; - -import { Series, Sheet } from '../helpers/timelion_request_handler'; -import { colors } from '../helpers/chart_constants'; -import { tickFormatters } from './tick_formatters'; -import { generateTicksProvider } from '../helpers/tick_generator'; - -import type { TimelionVisDependencies } from '../plugin'; -import type { RangeFilterParams } from '../../../data/common'; - -import './timelion_vis.scss'; - -interface CrosshairPlot extends jquery.flot.plot { - setCrosshair: (pos: Position) => void; - clearCrosshair: () => void; -} - -interface TimelionVisComponentProps { - onBrushEvent: (rangeFilterParams: RangeFilterParams) => void; - interval: string; - seriesList: Sheet; - renderComplete: IInterpreterRenderHandlers['done']; -} - -interface Position { - x: number; - x1: number; - y: number; - y1: number; - pageX: number; - pageY: number; -} - -interface Range { - to: number; - from: number; -} - -interface Ranges { - xaxis: Range; - yaxis: Range; -} - -const DEBOUNCE_DELAY = 50; -// ensure legend is the same height with or without a caption so legend items do not move around -const emptyCaption = '
'; - -function TimelionVisComponent({ - interval, - seriesList, - renderComplete, - onBrushEvent, -}: TimelionVisComponentProps) { - const kibana = useKibana(); - const [chart, setChart] = useState(() => cloneDeep(seriesList.list)); - const [canvasElem, setCanvasElem] = useState(); - const [chartElem, setChartElem] = useState(null); - - const [originalColorMap, setOriginalColorMap] = useState(() => new Map()); - - const [highlightedSeries, setHighlightedSeries] = useState(null); - const [focusedSeries, setFocusedSeries] = useState(); - const [plot, setPlot] = useState(); - - // Used to toggle the series, and for displaying values on hover - const [legendValueNumbers, setLegendValueNumbers] = useState>(); - const [legendCaption, setLegendCaption] = useState>(); - - const canvasRef = useCallback((node: HTMLDivElement | null) => { - if (node !== null) { - setCanvasElem(node); - } - }, []); - - const elementRef = useCallback((node: HTMLDivElement | null) => { - if (node !== null) { - setChartElem(node); - } - }, []); - - useEffect( - () => () => { - if (chartElem) { - $(chartElem).off('plotselected').off('plothover').off('mouseleave'); - } - }, - [chartElem] - ); - - /* eslint-disable-next-line react-hooks/exhaustive-deps */ - const highlightSeries = useCallback( - debounce(({ currentTarget }: JQuery.TriggeredEvent) => { - const id = Number(currentTarget.getAttribute(SERIES_ID_ATTR)); - if (highlightedSeries === id) { - return; - } - - setHighlightedSeries(id); - setChart((chartState) => - chartState.map((series: Series, seriesIndex: number) => { - series.color = - seriesIndex === id - ? originalColorMap.get(series) // color it like it was - : 'rgba(128,128,128,0.1)'; // mark as grey - - return series; - }) - ); - }, DEBOUNCE_DELAY), - [originalColorMap, highlightedSeries] - ); - - const focusSeries = useCallback( - (event: JQuery.TriggeredEvent) => { - const id = Number(event.currentTarget.getAttribute(SERIES_ID_ATTR)); - setFocusedSeries(id); - highlightSeries(event); - }, - [highlightSeries] - ); - - const toggleSeries = useCallback(({ currentTarget }: JQuery.TriggeredEvent) => { - const id = Number(currentTarget.getAttribute(SERIES_ID_ATTR)); - - setChart((chartState) => - chartState.map((series: Series, seriesIndex: number) => { - if (seriesIndex === id) { - series._hide = !series._hide; - } - return series; - }) - ); - }, []); - - const updateCaption = useCallback( - (plotData: any) => { - if (canvasElem && get(plotData, '[0]._global.legend.showTime', true)) { - const caption = $(''); - caption.html(emptyCaption); - setLegendCaption(caption); - - const canvasNode = $(canvasElem); - canvasNode.find('div.legend table').append(caption); - setLegendValueNumbers(canvasNode.find('.ngLegendValueNumber')); - - const legend = $(canvasElem).find('.ngLegendValue'); - if (legend) { - legend.click(toggleSeries); - legend.focus(focusSeries); - legend.mouseover(highlightSeries); - } - - // legend has been re-created. Apply focus on legend element when previously set - if (focusedSeries || focusedSeries === 0) { - canvasNode.find('div.legend table .legendLabel>span').get(focusedSeries).focus(); - } - } - }, - [focusedSeries, canvasElem, toggleSeries, focusSeries, highlightSeries] - ); - - const updatePlot = useCallback( - (chartValue: Series[], grid?: boolean) => { - if (canvasElem && canvasElem.clientWidth > 0 && canvasElem.clientHeight > 0) { - const options = buildOptions( - interval, - kibana.services.timefilter, - kibana.services.uiSettings, - chartElem?.clientWidth, - grid - ); - const updatedSeries = buildSeriesData(chartValue, options); - - if (options.yaxes) { - options.yaxes.forEach((yaxis: LegacyAxis) => { - if (yaxis && yaxis.units) { - const formatters = tickFormatters(); - yaxis.tickFormatter = formatters[yaxis.units.type as keyof typeof formatters]; - const byteModes = ['bytes', 'bytes/s']; - if (byteModes.includes(yaxis.units.type)) { - yaxis.tickGenerator = generateTicksProvider(); - } - } - }); - } - - const newPlot = $.plot($(canvasElem), updatedSeries, options); - setPlot(newPlot); - renderComplete(); - - updateCaption(newPlot.getData()); - } - }, - [canvasElem, chartElem?.clientWidth, renderComplete, kibana.services, interval, updateCaption] - ); - - const dimensions = useResizeObserver(chartElem); - - useEffect(() => { - updatePlot(chart, seriesList.render && seriesList.render.grid); - }, [chart, updatePlot, seriesList.render, dimensions]); - - useEffect(() => { - const colorsSet: Array<[Series, string]> = []; - const newChart = seriesList.list.map((series: Series, seriesIndex: number) => { - const newSeries = { ...series }; - if (!newSeries.color) { - const colorIndex = seriesIndex % colors.length; - newSeries.color = colors[colorIndex]; - } - colorsSet.push([newSeries, newSeries.color]); - return newSeries; - }); - setChart(newChart); - setOriginalColorMap(new Map(colorsSet)); - }, [seriesList.list]); - - const unhighlightSeries = useCallback(() => { - if (highlightedSeries === null) { - return; - } - - setHighlightedSeries(null); - setFocusedSeries(null); - - setChart((chartState) => - chartState.map((series: Series) => { - series.color = originalColorMap.get(series); // reset the colors - return series; - }) - ); - }, [originalColorMap, highlightedSeries]); - - // Shamelessly borrowed from the flotCrosshairs example - const setLegendNumbers = useCallback( - (pos: Position) => { - unhighlightSeries(); - - const axes = plot!.getAxes(); - if (pos.x < axes.xaxis.min! || pos.x > axes.xaxis.max!) { - return; - } - - const dataset = plot!.getData(); - if (legendCaption) { - legendCaption.text( - moment(pos.x).format(get(dataset, '[0]._global.legend.timeFormat', DEFAULT_TIME_FORMAT)) - ); - } - for (let i = 0; i < dataset.length; ++i) { - const series = dataset[i]; - const useNearestPoint = series.lines!.show && !series.lines!.steps; - const precision = get(series, '_meta.precision', 2); - - // We're setting this flag on top on the series object belonging to the flot library, so we're simply casting here. - if ((series as { _hide?: boolean })._hide) { - continue; - } - - const currentPoint = series.data.find((point: [number, number], index: number) => { - if (index + 1 === series.data.length) { - return true; - } - if (useNearestPoint) { - return pos.x - point[0] < series.data[index + 1][0] - pos.x; - } else { - return pos.x < series.data[index + 1][0]; - } - }); - - const y = currentPoint[1]; - - if (legendValueNumbers) { - if (y == null) { - legendValueNumbers.eq(i).empty(); - } else { - let label = y.toFixed(precision); - const formatter = ((series.yaxis as unknown) as LegacyAxis).tickFormatter; - if (formatter) { - label = formatter(Number(label), (series.yaxis as unknown) as LegacyAxis); - } - legendValueNumbers.eq(i).text(`(${label})`); - } - } - } - }, - [plot, legendValueNumbers, unhighlightSeries, legendCaption] - ); - - /* eslint-disable-next-line react-hooks/exhaustive-deps */ - const debouncedSetLegendNumbers = useCallback( - debounce(setLegendNumbers, DEBOUNCE_DELAY, { - maxWait: DEBOUNCE_DELAY, - leading: true, - trailing: false, - }), - [setLegendNumbers] - ); - - const clearLegendNumbers = useCallback(() => { - if (legendCaption) { - legendCaption.html(emptyCaption); - } - each(legendValueNumbers!, (num: Node) => { - $(num).empty(); - }); - }, [legendCaption, legendValueNumbers]); - - const plotHover = useCallback( - (pos: Position) => { - (plot as CrosshairPlot).setCrosshair(pos); - debouncedSetLegendNumbers(pos); - }, - [plot, debouncedSetLegendNumbers] - ); - - const plotHoverHandler = useCallback( - (event: JQuery.TriggeredEvent, pos: Position) => { - if (!plot) { - return; - } - plotHover(pos); - eventBus.trigger(ACTIVE_CURSOR, [event, pos]); - }, - [plot, plotHover] - ); - - useEffect(() => { - const updateCursor = (_: any, event: JQuery.TriggeredEvent, pos: Position) => { - if (!plot) { - return; - } - plotHover(pos); - }; - - eventBus.on(ACTIVE_CURSOR, updateCursor); - - return () => { - eventBus.off(ACTIVE_CURSOR, updateCursor); - }; - }, [plot, plotHover]); - - const mouseLeaveHandler = useCallback(() => { - if (!plot) { - return; - } - (plot as CrosshairPlot).clearCrosshair(); - clearLegendNumbers(); - }, [plot, clearLegendNumbers]); - - const plotSelectedHandler = useCallback( - (event: JQuery.TriggeredEvent, ranges: Ranges) => { - onBrushEvent({ - gte: ranges.xaxis.from, - lte: ranges.xaxis.to, - }); - }, - [onBrushEvent] - ); - - useEffect(() => { - if (chartElem) { - $(chartElem).off('plotselected').on('plotselected', plotSelectedHandler); - } - }, [chartElem, plotSelectedHandler]); - - useEffect(() => { - if (chartElem) { - $(chartElem).off('mouseleave').on('mouseleave', mouseLeaveHandler); - } - }, [chartElem, mouseLeaveHandler]); - - useEffect(() => { - if (chartElem) { - $(chartElem).off('plothover').on('plothover', plotHoverHandler); - } - }, [chartElem, plotHoverHandler]); - - const title: string = useMemo(() => last(compact(map(seriesList.list, '_title'))) || '', [ - seriesList.list, - ]); - - return ( -
-
{title}
-
-
- ); -} - -// default export required for React.Lazy -// eslint-disable-next-line import/no-default-export -export { TimelionVisComponent as default }; diff --git a/src/plugins/vis_type_timelion/public/plugin.ts b/src/plugins/vis_type_timelion/public/plugin.ts deleted file mode 100644 index 1784af4e77222..0000000000000 --- a/src/plugins/vis_type_timelion/public/plugin.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 and the Server Side Public License, v 1; you may not 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, - PluginInitializerContext, - IUiSettingsClient, - HttpSetup, -} from 'kibana/public'; -import type { Plugin as ExpressionsPlugin } from 'src/plugins/expressions/public'; -import type { - DataPublicPluginSetup, - DataPublicPluginStart, - TimefilterContract, -} from 'src/plugins/data/public'; -import type { VisualizationsSetup } from 'src/plugins/visualizations/public'; -import type { ChartsPluginSetup, ChartsPluginStart } from 'src/plugins/charts/public'; - -import { getTimelionVisualizationConfig } from './timelion_vis_fn'; -import { getTimelionVisDefinition } from './timelion_vis_type'; -import { setIndexPatterns, setDataSearch, setCharts } from './helpers/plugin_services'; - -import { getArgValueSuggestions } from './helpers/arg_value_suggestions'; -import { getTimelionVisRenderer } from './timelion_vis_renderer'; - -import type { ConfigSchema } from '../config'; - -/** @internal */ -export interface TimelionVisDependencies extends Partial { - uiSettings: IUiSettingsClient; - http: HttpSetup; - timefilter: TimefilterContract; -} - -/** @internal */ -export interface TimelionVisSetupDependencies { - expressions: ReturnType; - visualizations: VisualizationsSetup; - data: DataPublicPluginSetup; - charts: ChartsPluginSetup; -} - -/** @internal */ -export interface TimelionVisStartDependencies { - data: DataPublicPluginStart; - charts: ChartsPluginStart; -} - -/** @public */ -export interface VisTypeTimelionPluginStart { - getArgValueSuggestions: typeof getArgValueSuggestions; -} - -/** @public */ -export interface VisTypeTimelionPluginSetup { - isUiEnabled: boolean; -} - -/** @internal */ -export class TimelionVisPlugin - implements - Plugin< - VisTypeTimelionPluginSetup, - VisTypeTimelionPluginStart, - TimelionVisSetupDependencies, - TimelionVisStartDependencies - > { - constructor(public initializerContext: PluginInitializerContext) {} - - public setup( - { uiSettings, http }: CoreSetup, - { expressions, visualizations, data, charts }: TimelionVisSetupDependencies - ) { - const dependencies: TimelionVisDependencies = { - http, - uiSettings, - timefilter: data.query.timefilter.timefilter, - }; - - expressions.registerFunction(() => getTimelionVisualizationConfig(dependencies)); - expressions.registerRenderer(getTimelionVisRenderer(dependencies)); - visualizations.createBaseVisualization(getTimelionVisDefinition(dependencies)); - - return { - isUiEnabled: this.initializerContext.config.get().ui.enabled, - }; - } - - public start(core: CoreStart, { data, charts }: TimelionVisStartDependencies) { - setIndexPatterns(data.indexPatterns); - setDataSearch(data.search); - setCharts(charts); - - return { - getArgValueSuggestions, - }; - } -} diff --git a/src/plugins/vis_type_timelion/public/to_ast.ts b/src/plugins/vis_type_timelion/public/to_ast.ts deleted file mode 100644 index c743d9ce78f32..0000000000000 --- a/src/plugins/vis_type_timelion/public/to_ast.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { buildExpression, buildExpressionFunction } from '../../expressions/public'; -import { Vis } from '../../visualizations/public'; -import { TimelionExpressionFunctionDefinition, TimelionVisParams } from './timelion_vis_fn'; - -export const toExpressionAst = (vis: Vis) => { - const { expression, interval } = vis.params; - - const timelion = buildExpressionFunction('timelion_vis', { - expression, - interval, - }); - - const ast = buildExpression([timelion]); - - return ast.toAst(); -}; diff --git a/src/plugins/vis_type_timelion/server/index.ts b/src/plugins/vis_type_timelion/server/index.ts deleted file mode 100644 index 35f4182a50a86..0000000000000 --- a/src/plugins/vis_type_timelion/server/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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { PluginConfigDescriptor, PluginInitializerContext } from '../../../../src/core/server'; -import { configSchema, ConfigSchema } from '../config'; -import { TimelionPlugin } from './plugin'; - -export { PluginSetupContract } from './plugin'; - -export const config: PluginConfigDescriptor = { - schema: configSchema, - exposeToBrowser: { - ui: true, - }, - deprecations: ({ renameFromRoot }) => [ - renameFromRoot('timelion_vis.enabled', 'vis_type_timelion.enabled'), - renameFromRoot('timelion.enabled', 'vis_type_timelion.enabled'), - renameFromRoot('timelion.graphiteUrls', 'vis_type_timelion.graphiteUrls'), - renameFromRoot('timelion.ui.enabled', 'vis_type_timelion.ui.enabled', { silent: true }), - ], -}; -export const plugin = (initializerContext: PluginInitializerContext) => - new TimelionPlugin(initializerContext); diff --git a/src/plugins/vis_type_timelion/server/plugin.ts b/src/plugins/vis_type_timelion/server/plugin.ts deleted file mode 100644 index fc23569b351e6..0000000000000 --- a/src/plugins/vis_type_timelion/server/plugin.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { TypeOf } from '@kbn/config-schema'; -import { RecursiveReadonly } from '@kbn/utility-types'; -import { deepFreeze } from '@kbn/std'; - -import type { PluginStart, DataRequestHandlerContext } from '../../../../src/plugins/data/server'; -import { CoreSetup, PluginInitializerContext, Plugin } from '../../../../src/core/server'; -import { configSchema } from '../config'; -import loadFunctions from './lib/load_functions'; -import { functionsRoute } from './routes/functions'; -import { validateEsRoute } from './routes/validate_es'; -import { runRoute } from './routes/run'; -import { ConfigManager } from './lib/config_manager'; -import { getUiSettings } from './ui_settings'; - -/** - * Describes public Timelion plugin contract returned at the `setup` stage. - */ -export interface PluginSetupContract { - uiEnabled: boolean; -} - -export interface TimelionPluginStartDeps { - data: PluginStart; -} - -/** - * Represents Timelion Plugin instance that will be managed by the Kibana plugin system. - */ -export class TimelionPlugin - implements Plugin, void, TimelionPluginStartDeps> { - constructor(private readonly initializerContext: PluginInitializerContext) {} - - public setup(core: CoreSetup): RecursiveReadonly { - const config = this.initializerContext.config.get>(); - - const configManager = new ConfigManager(this.initializerContext.config); - - const functions = loadFunctions('series_functions'); - - const getFunction = (name: string) => { - if (functions[name]) { - return functions[name]; - } - - throw new Error( - i18n.translate('timelion.noFunctionErrorMessage', { - defaultMessage: 'No such function: {name}', - values: { name }, - }) - ); - }; - - const logger = this.initializerContext.logger.get('timelion'); - - const router = core.http.createRouter(); - - const deps = { - configManager, - functions, - getFunction, - logger, - core, - }; - - functionsRoute(router, deps); - runRoute(router, deps); - validateEsRoute(router); - - core.uiSettings.register(getUiSettings(config)); - - return deepFreeze({ uiEnabled: config.ui.enabled }); - } - - public start() { - this.initializerContext.logger.get().debug('Starting plugin'); - } - - public stop() { - this.initializerContext.logger.get().debug('Stopping plugin'); - } -} diff --git a/src/plugins/vis_type_timelion/tsconfig.json b/src/plugins/vis_type_timelion/tsconfig.json deleted file mode 100644 index efeab8d73db1e..0000000000000 --- a/src/plugins/vis_type_timelion/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - "*.ts" - ], - "references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../visualizations/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../vis_default_editor/tsconfig.json" }, - ] -} diff --git a/src/plugins/vis_type_timeseries/common/agg_utils.test.ts b/src/plugins/vis_type_timeseries/common/agg_utils.test.ts index 3e450c789b65d..63d81e2c43d40 100644 --- a/src/plugins/vis_type_timeseries/common/agg_utils.test.ts +++ b/src/plugins/vis_type_timeseries/common/agg_utils.test.ts @@ -60,6 +60,7 @@ describe('agg utils', () => { isFieldRequired: true, isFilterRatioSupported: false, isHistogramSupported: false, + isFieldFormattingDisabled: false, hasExtendedStats: true, }; const expected = [ @@ -95,6 +96,7 @@ describe('agg utils', () => { isFieldRequired: false, isFilterRatioSupported: false, isHistogramSupported: false, + isFieldFormattingDisabled: false, hasExtendedStats: false, }; const expected = [ diff --git a/src/plugins/vis_type_timeseries/common/agg_utils.ts b/src/plugins/vis_type_timeseries/common/agg_utils.ts index 8b071cc680af3..2f0488bdc4dbe 100644 --- a/src/plugins/vis_type_timeseries/common/agg_utils.ts +++ b/src/plugins/vis_type_timeseries/common/agg_utils.ts @@ -28,6 +28,7 @@ export interface Agg { isFieldRequired: boolean; isFilterRatioSupported: boolean; isHistogramSupported: boolean; + isFieldFormattingDisabled: boolean; hasExtendedStats: boolean; }; } @@ -37,6 +38,7 @@ const aggDefaultMeta = { isFieldRequired: true, isFilterRatioSupported: false, isHistogramSupported: false, + isFieldFormattingDisabled: false, hasExtendedStats: false, }; @@ -201,6 +203,7 @@ export const aggs: Agg[] = [ id: TSVB_METRIC_TYPES.CALCULATION, meta: { ...aggDefaultMeta, + isFieldFormattingDisabled: true, type: AGG_TYPE.PARENT_PIPELINE, label: i18n.translate('visTypeTimeseries.aggUtils.bucketScriptLabel', { defaultMessage: 'Bucket Script', @@ -342,6 +345,7 @@ export const aggs: Agg[] = [ id: TSVB_METRIC_TYPES.MATH, meta: { ...aggDefaultMeta, + isFieldFormattingDisabled: true, type: AGG_TYPE.SPECIAL, label: i18n.translate('visTypeTimeseries.aggUtils.mathLabel', { defaultMessage: 'Math' }), }, diff --git a/src/plugins/vis_type_timeseries/common/calculate_label.ts b/src/plugins/vis_type_timeseries/common/calculate_label.ts index 7ea035eef9234..d054698536b5b 100644 --- a/src/plugins/vis_type_timeseries/common/calculate_label.ts +++ b/src/plugins/vis_type_timeseries/common/calculate_label.ts @@ -82,7 +82,7 @@ export const calculateLabel = ( if (includes(paths, metric.type)) { const targetMetric = metrics.find((m) => startsWith(metric.field!, m.id)); - const targetLabel = calculateLabel(targetMetric!, metrics, fields); + const targetLabel = calculateLabel(targetMetric!, metrics, fields, isThrowErrorOnFieldNotFound); // For percentiles we need to parse the field id to extract the percentile // the user configured in the percentile aggregation and specified in the diff --git a/src/plugins/vis_type_timeseries/common/enums/index.ts b/src/plugins/vis_type_timeseries/common/enums/index.ts index 506abeea247c9..8a4d9a21f09a1 100644 --- a/src/plugins/vis_type_timeseries/common/enums/index.ts +++ b/src/plugins/vis_type_timeseries/common/enums/index.ts @@ -20,3 +20,12 @@ export enum TOOLTIP_MODES { SHOW_ALL = 'show_all', SHOW_FOCUSED = 'show_focused', } + +export enum DATA_FORMATTERS { + BYTES = 'bytes', + CUSTOM = 'custom', + DEFAULT = 'default', + DURATION = 'duration', + NUMBER = 'number', + PERCENT = 'percent', +} diff --git a/src/plugins/vis_type_timeseries/common/errors.ts b/src/plugins/vis_type_timeseries/common/errors.ts new file mode 100644 index 0000000000000..6a23a003d29ee --- /dev/null +++ b/src/plugins/vis_type_timeseries/common/errors.ts @@ -0,0 +1,58 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +/* eslint-disable max-classes-per-file */ + +import { i18n } from '@kbn/i18n'; + +export class UIError extends Error { + constructor(message: string) { + super(message); + } + + public get name() { + return this.constructor.name; + } + + public get errBody() { + return this.message; + } +} + +export class FieldNotFoundError extends UIError { + constructor(name: string) { + super( + i18n.translate('visTypeTimeseries.errors.fieldNotFound', { + defaultMessage: `Field "{field}" not found`, + values: { field: name }, + }) + ); + } +} + +export class ValidateIntervalError extends UIError { + constructor() { + super( + i18n.translate('visTypeTimeseries.errors.maxBucketsExceededErrorMessage', { + defaultMessage: + 'Your query attempted to fetch too much data. Reducing the time range or changing the interval used usually fixes the issue.', + }) + ); + } +} + +export class AggNotSupportedInMode extends UIError { + constructor(metricType: string, timeRangeMode: string) { + super( + i18n.translate('visTypeTimeseries.wrongAggregationErrorMessage', { + defaultMessage: 'The aggregation {metricType} is not supported in {timeRangeMode} mode', + values: { metricType, timeRangeMode }, + }) + ); + } +} diff --git a/src/plugins/vis_type_timeseries/common/fields_utils.ts b/src/plugins/vis_type_timeseries/common/fields_utils.ts index b64fcc383a1bb..1af0340dfa525 100644 --- a/src/plugins/vis_type_timeseries/common/fields_utils.ts +++ b/src/plugins/vis_type_timeseries/common/fields_utils.ts @@ -6,29 +6,10 @@ * Side Public License, v 1. */ -import { i18n } from '@kbn/i18n'; import { FieldSpec } from '../../data/common'; import { isNestedField } from '../../data/common'; import { FetchedIndexPattern, SanitizedFieldType } from './types'; - -export class FieldNotFoundError extends Error { - constructor(name: string) { - super( - i18n.translate('visTypeTimeseries.fields.fieldNotFound', { - defaultMessage: `Field "{field}" not found`, - values: { field: name }, - }) - ); - } - - public get name() { - return this.constructor.name; - } - - public get errBody() { - return this.message; - } -} +import { FieldNotFoundError } from './errors'; export const extractFieldLabel = ( fields: SanitizedFieldType[], diff --git a/src/plugins/vis_type_timeseries/common/types/vis_data.ts b/src/plugins/vis_type_timeseries/common/types/vis_data.ts index fb3e0db82f188..1a7be0b467004 100644 --- a/src/plugins/vis_type_timeseries/common/types/vis_data.ts +++ b/src/plugins/vis_type_timeseries/common/types/vis_data.ts @@ -39,6 +39,7 @@ export interface PanelSeries { export interface PanelData { id: string; label: string; + labelFormatted?: string; data: PanelDataArray[]; seriesId: string; splitByLabel: string; diff --git a/src/plugins/vis_type_timeseries/common/validate_interval.ts b/src/plugins/vis_type_timeseries/common/validate_interval.ts index 7f9ccf20c0eb1..7c7a4e7badfc0 100644 --- a/src/plugins/vis_type_timeseries/common/validate_interval.ts +++ b/src/plugins/vis_type_timeseries/common/validate_interval.ts @@ -6,28 +6,9 @@ * Side Public License, v 1. */ -import { i18n } from '@kbn/i18n'; import { GTE_INTERVAL_RE } from './interval_regexp'; import { parseInterval, TimeRangeBounds } from '../../data/common'; - -export class ValidateIntervalError extends Error { - constructor() { - super( - i18n.translate('visTypeTimeseries.validateInterval.notifier.maxBucketsExceededErrorMessage', { - defaultMessage: - 'Your query attempted to fetch too much data. Reducing the time range or changing the interval used usually fixes the issue.', - }) - ); - } - - public get name() { - return this.constructor.name; - } - - public get errBody() { - return this.message; - } -} +import { ValidateIntervalError } from './errors'; export function validateInterval(bounds: TimeRangeBounds, interval: string, maxBuckets: number) { const { min, max } = bounds; diff --git a/src/plugins/vis_type_timeseries/jest.config.js b/src/plugins/vis_type_timeseries/jest.config.js index 5007d995edc44..3d4333675f7d7 100644 --- a/src/plugins/vis_type_timeseries/jest.config.js +++ b/src/plugins/vis_type_timeseries/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/vis_type_timeseries'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_type_timeseries', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/vis_type_timeseries/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/src/plugins/vis_type_timeseries/public/application/components/_vis_with_splits.scss b/src/plugins/vis_type_timeseries/public/application/components/_vis_with_splits.scss index 36ab49c0cc807..6fa931f7ec80b 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/_vis_with_splits.scss +++ b/src/plugins/vis_type_timeseries/public/application/components/_vis_with_splits.scss @@ -23,3 +23,16 @@ min-height: $tvbSplitBlockVisMinSize / 1.25; } } + +// When there is only one visualization, expand the full height and remove all minimum sizes +.tvbSplitVis--one { + flex: 1; + + .tvbSplitVis__split { + min-width: 0; + + > .tvbVis { + min-height: 0; + } + } +} diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/agg.tsx b/src/plugins/vis_type_timeseries/public/application/components/aggs/agg.tsx index 17af812ae5ce3..08f8c072eef3b 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/aggs/agg.tsx +++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/agg.tsx @@ -6,40 +6,59 @@ * Side Public License, v 1. */ -import React, { HTMLAttributes } from 'react'; +import React, { useMemo, useEffect, HTMLAttributes } from 'react'; +import { EuiCode } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; // @ts-ignore import { aggToComponent } from '../lib/agg_to_component'; // @ts-ignore import { isMetricEnabled } from '../../lib/check_ui_restrictions'; -import { UnsupportedAgg } from './unsupported_agg'; -import { TemporaryUnsupportedAgg } from './temporary_unsupported_agg'; +import { getInvalidAggComponent } from './invalid_agg'; +// @ts-expect-error not typed yet +import { seriesChangeHandler } from '../lib/series_change_handler'; +import { checkIfNumericMetric } from '../lib/check_if_numeric_metric'; +import { getFormatterType } from '../lib/get_formatter_type'; +import { DATA_FORMATTERS } from '../../../../common/enums'; import type { Metric, Panel, Series, SanitizedFieldType } from '../../../../common/types'; -import { DragHandleProps } from '../../../types'; -import { TimeseriesUIRestrictions } from '../../../../common/ui_restrictions'; +import type { DragHandleProps } from '../../../types'; +import type { TimeseriesUIRestrictions } from '../../../../common/ui_restrictions'; interface AggProps extends HTMLAttributes { disableDelete: boolean; fields: Record; + name: string; model: Metric; panel: Panel; series: Series; siblings: Metric[]; uiRestrictions: TimeseriesUIRestrictions; dragHandleProps: DragHandleProps; + onChange: (part: Partial) => void; onAdd: () => void; - onChange: () => void; onDelete: () => void; } export function Agg(props: AggProps) { - const { model, uiRestrictions } = props; + const { model, uiRestrictions, series, name, onChange, fields, siblings } = props; let Component = aggToComponent[model.type]; if (!Component) { - Component = UnsupportedAgg; + Component = getInvalidAggComponent( + {props.model.type} }} + /> + ); } else if (!isMetricEnabled(model.type, uiRestrictions)) { - Component = TemporaryUnsupportedAgg; + Component = getInvalidAggComponent( + {props.model.type} }} + /> + ); } const style = { @@ -50,6 +69,34 @@ export function Agg(props: AggProps) { const indexPattern = props.series.override_index_pattern ? props.series.series_index_pattern : props.panel.index_pattern; + const isKibanaIndexPattern = props.panel.use_kibana_indexes || indexPattern === ''; + + const onAggChange = useMemo( + () => seriesChangeHandler({ name, model: series, onChange }, siblings), + [name, onChange, siblings, series] + ); + + useEffect(() => { + // formatter is based on the last agg, i.e. active or resulting one as pipeline + if (siblings[siblings.length - 1]?.id === model.id) { + const formatterType = getFormatterType(series.formatter); + const isNumericMetric = checkIfNumericMetric(model, fields, indexPattern); + const isNumberFormatter = ![DATA_FORMATTERS.DEFAULT, DATA_FORMATTERS.CUSTOM].includes( + formatterType + ); + + if (isNumberFormatter && !isNumericMetric) { + onChange({ formatter: DATA_FORMATTERS.DEFAULT }); + } + // in case of string index pattern mode, change default formatter depending on metric type + // "number" formatter for numeric metric and "" as custom formatter for any other type + if (formatterType === DATA_FORMATTERS.DEFAULT && !isKibanaIndexPattern) { + onChange({ + formatter: isNumericMetric ? DATA_FORMATTERS.NUMBER : '', + }); + } + } + }, [indexPattern, model, onChange, fields, series.formatter, isKibanaIndexPattern, siblings]); return (
@@ -58,7 +105,7 @@ export function Agg(props: AggProps) { disableDelete={props.disableDelete} model={props.model} onAdd={props.onAdd} - onChange={props.onChange} + onChange={onAggChange} onDelete={props.onDelete} panel={props.panel} series={props.series} diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/agg_select.tsx b/src/plugins/vis_type_timeseries/public/application/components/aggs/agg_select.tsx index 719ebbbe5a91d..2959712bb9f00 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/aggs/agg_select.tsx +++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/agg_select.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import React from 'react'; +import React, { useContext } from 'react'; import { EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; // @ts-ignore @@ -16,6 +16,8 @@ import { getAggsByType, getAggsByPredicate } from '../../../../common/agg_utils' import type { Agg } from '../../../../common/agg_utils'; import type { Metric } from '../../../../common/types'; import { TimeseriesUIRestrictions } from '../../../../common/ui_restrictions'; +import { PanelModelContext } from '../../contexts/panel_model_context'; +import { PANEL_TYPES, TIME_RANGE_DATA_MODES } from '../../../../common/enums'; type AggSelectOption = EuiComboBoxOptionOption; @@ -35,16 +37,35 @@ function filterByPanelType(panelType: string) { panelType === 'table' ? agg.value !== TSVB_METRIC_TYPES.SERIES_AGG : true; } +export function isMetricAvailableForPanel( + aggId: string, + panelType: string, + timeRangeMode?: string +) { + if ( + panelType !== PANEL_TYPES.TIMESERIES && + timeRangeMode === TIME_RANGE_DATA_MODES.ENTIRE_TIME_RANGE + ) { + return ( + !pipelineAggs.some((agg) => agg.value === aggId) && aggId !== TSVB_METRIC_TYPES.SERIES_AGG + ); + } + + return true; +} + interface AggSelectUiProps { id: string; panelType: string; siblings: Metric[]; value: string; uiRestrictions?: TimeseriesUIRestrictions; + timeRangeMode?: string; onChange: (currentlySelectedOptions: AggSelectOption[]) => void; } export function AggSelect(props: AggSelectUiProps) { + const panelModel = useContext(PanelModelContext); const { siblings, panelType, value, onChange, uiRestrictions, ...rest } = props; const selectedOptions = allAggOptions.filter((option) => { @@ -69,7 +90,10 @@ export function AggSelect(props: AggSelectUiProps) { } else { const disableSiblingAggs = (agg: AggSelectOption) => ({ ...agg, - disabled: !enablePipelines || !isMetricEnabled(agg.value, uiRestrictions), + disabled: + !enablePipelines || + !isMetricEnabled(agg.value, uiRestrictions) || + !isMetricAvailableForPanel(agg.value as string, panelType, panelModel?.time_range_mode), }); options = [ diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/aggs.tsx b/src/plugins/vis_type_timeseries/public/application/components/aggs/aggs.tsx index 0edd8b9c3feb5..516e3551fb010 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/aggs/aggs.tsx +++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/aggs.tsx @@ -12,7 +12,6 @@ import { EuiDraggable, EuiDroppable } from '@elastic/eui'; import { Agg } from './agg'; // @ts-ignore -import { seriesChangeHandler } from '../lib/series_change_handler'; import { handleAdd, handleDelete } from '../lib/collection_actions'; import { newMetricAggFn } from '../lib/new_metric_agg_fn'; import type { Panel, Series, SanitizedFieldType } from '../../../../common/types'; @@ -26,16 +25,14 @@ export interface AggsProps { model: Series; fields: Record; uiRestrictions: TimeseriesUIRestrictions; - onChange(): void; + onChange(part: Partial): void; } export class Aggs extends PureComponent { render() { - const { panel, model, fields, uiRestrictions } = this.props; + const { panel, model, fields, name, uiRestrictions, onChange } = this.props; const list = model.metrics; - const onChange = seriesChangeHandler(this.props, list); - return ( {list.map((row, idx) => ( @@ -51,6 +48,7 @@ export class Aggs extends PureComponent { key={row.id} disableDelete={list.length < 2} fields={fields} + name={name} model={row} onAdd={() => handleAdd(this.props, newMetricAggFn)} onChange={onChange} diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/invalid_agg.tsx b/src/plugins/vis_type_timeseries/public/application/components/aggs/invalid_agg.tsx new file mode 100644 index 0000000000000..7fb4b31c2347e --- /dev/null +++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/invalid_agg.tsx @@ -0,0 +1,41 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiTitle } from '@elastic/eui'; +import { AggRow } from './agg_row'; +import type { Metric } from '../../../../common/types'; +import { DragHandleProps } from '../../../types'; + +interface InvalidAggProps { + disableDelete: boolean; + model: Metric; + siblings: Metric[]; + dragHandleProps: DragHandleProps; + onAdd: () => void; + onDelete: () => void; +} + +export const getInvalidAggComponent = (message: JSX.Element | string) => ( + props: InvalidAggProps +) => { + return ( + + + {message} + + + ); +}; diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/math.js b/src/plugins/vis_type_timeseries/public/application/components/aggs/math.js index e92659e677860..f00a485f2d759 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/aggs/math.js +++ b/src/plugins/vis_type_timeseries/public/application/components/aggs/math.js @@ -69,6 +69,7 @@ export function MathAgg(props) { id={htmlId('aggregation')} siblings={props.siblings} value={model.type} + panelType={props.panel.type} onChange={handleSelectChange('type')} /> diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/temporary_unsupported_agg.tsx b/src/plugins/vis_type_timeseries/public/application/components/aggs/temporary_unsupported_agg.tsx deleted file mode 100644 index b85da5955ac65..0000000000000 --- a/src/plugins/vis_type_timeseries/public/application/components/aggs/temporary_unsupported_agg.tsx +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiCode, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { AggRow } from './agg_row'; -import type { Metric } from '../../../../common/types'; -import { DragHandleProps } from '../../../types'; - -interface TemporaryUnsupportedAggProps { - disableDelete: boolean; - model: Metric; - siblings: Metric[]; - dragHandleProps: DragHandleProps; - onAdd: () => void; - onDelete: () => void; -} - -export function TemporaryUnsupportedAgg(props: TemporaryUnsupportedAggProps) { - return ( - - - - {props.model.type} }} - /> - - - - ); -} diff --git a/src/plugins/vis_type_timeseries/public/application/components/aggs/unsupported_agg.tsx b/src/plugins/vis_type_timeseries/public/application/components/aggs/unsupported_agg.tsx deleted file mode 100644 index 70c5499597e66..0000000000000 --- a/src/plugins/vis_type_timeseries/public/application/components/aggs/unsupported_agg.tsx +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { EuiCode, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { AggRow } from './agg_row'; -import type { Metric } from '../../../../common/types'; -import { DragHandleProps } from '../../../types'; - -interface UnsupportedAggProps { - disableDelete: boolean; - model: Metric; - siblings: Metric[]; - dragHandleProps: DragHandleProps; - onAdd: () => void; - onDelete: () => void; -} - -export function UnsupportedAgg(props: UnsupportedAggProps) { - return ( - - - - {props.model.type} }} - /> - - - - ); -} diff --git a/src/plugins/vis_type_timeseries/public/application/components/data_format_picker.js b/src/plugins/vis_type_timeseries/public/application/components/data_format_picker.js deleted file mode 100644 index 12428b7fbe6a0..0000000000000 --- a/src/plugins/vis_type_timeseries/public/application/components/data_format_picker.js +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; -import _ from 'lodash'; -import { - htmlIdGenerator, - EuiComboBox, - EuiFlexGroup, - EuiFlexItem, - EuiFormRow, - EuiFieldText, - EuiLink, -} from '@elastic/eui'; -import { durationOutputOptions, durationInputOptions, isDuration } from './lib/durations'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; - -const DEFAULT_OUTPUT_PRECISION = '2'; - -class DataFormatPickerUI extends Component { - constructor(props) { - super(props); - - let from; - let to; - let decimals; - - if (isDuration(props.value)) { - [from, to, decimals] = props.value.split(','); - } - - this.state = { - from: from || 'ms', - to: to || 'ms', - decimals: decimals || '', - }; - } - - handleCustomChange = () => { - this.props.onChange([{ value: (this.custom && this.custom.value) || '' }]); - }; - - handleChange = (selectedOptions) => { - if (selectedOptions.length < 1) { - return; - } - - if (selectedOptions[0].value === 'custom') { - this.handleCustomChange(); - } else if (selectedOptions[0].value === 'duration') { - const { from, to, decimals } = this.state; - this.props.onChange([ - { - value: `${from},${to},${decimals}`, - }, - ]); - } else { - this.props.onChange(selectedOptions); - } - }; - - handleDurationChange(name) { - return (selectedOptions) => { - if (selectedOptions.length < 1) { - return; - } - - let newValue; - if (name === 'decimals') { - newValue = this.decimals.value; - } else { - newValue = selectedOptions[0].value; - } - - this.setState( - { - [name]: newValue, - }, - () => { - const { from, to, decimals } = this.state; - this.props.onChange([ - { - value: `${from},${to},${decimals}`, - }, - ]); - } - ); - }; - } - - render() { - const htmlId = htmlIdGenerator(); - const value = this.props.value || ''; - let defaultValue = value; - if (!_.includes(['bytes', 'number', 'percent'], value)) { - defaultValue = 'custom'; - } - if (isDuration(value)) { - defaultValue = 'duration'; - } - const { intl } = this.props; - const options = [ - { - label: intl.formatMessage({ - id: 'visTypeTimeseries.dataFormatPicker.bytesLabel', - defaultMessage: 'Bytes', - }), - value: 'bytes', - }, - { - label: intl.formatMessage({ - id: 'visTypeTimeseries.dataFormatPicker.numberLabel', - defaultMessage: 'Number', - }), - value: 'number', - }, - { - label: intl.formatMessage({ - id: 'visTypeTimeseries.dataFormatPicker.percentLabel', - defaultMessage: 'Percent', - }), - value: 'percent', - }, - { - label: intl.formatMessage({ - id: 'visTypeTimeseries.dataFormatPicker.durationLabel', - defaultMessage: 'Duration', - }), - value: 'duration', - }, - { - label: intl.formatMessage({ - id: 'visTypeTimeseries.dataFormatPicker.customLabel', - defaultMessage: 'Custom', - }), - value: 'custom', - }, - ]; - const selectedOption = options.find((option) => { - return defaultValue === option.value; - }); - - let custom; - if (defaultValue === 'duration') { - const [from, to, decimals] = value.split(','); - const selectedFrom = durationInputOptions.find((option) => from === option.value); - const selectedTo = durationOutputOptions.find((option) => to === option.value); - - return ( - - - - - - - - - } - > - - - - - - } - > - - - - - {selectedTo && selectedTo.value !== 'humanize' && ( - - - } - > - (this.decimals = el)} - placeholder={DEFAULT_OUTPUT_PRECISION} - onChange={this.handleDurationChange('decimals')} - /> - - - )} - - ); - } - if (defaultValue === 'custom') { - custom = ( - - - } - helpText={ - - - Numeral.js - - ), - }} - /> - - } - > - (this.custom = el)} - onChange={this.handleCustomChange} - /> - - - ); - } - return ( - - - - - - - {custom} - - ); - } -} - -DataFormatPickerUI.defaultProps = { - label: i18n.translate('visTypeTimeseries.defaultDataFormatterLabel', { - defaultMessage: 'Data Formatter', - }), -}; - -DataFormatPickerUI.propTypes = { - value: PropTypes.string, - label: PropTypes.string, - onChange: PropTypes.func, -}; - -export const DataFormatPicker = injectI18n(DataFormatPickerUI); diff --git a/src/plugins/vis_type_timeseries/public/application/components/data_format_picker.tsx b/src/plugins/vis_type_timeseries/public/application/components/data_format_picker.tsx new file mode 100644 index 0000000000000..fa76f8534f852 --- /dev/null +++ b/src/plugins/vis_type_timeseries/public/application/components/data_format_picker.tsx @@ -0,0 +1,310 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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, { useEffect, useMemo, useCallback, useState, ChangeEvent } from 'react'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; +import type { EuiComboBoxOptionOption } from '@elastic/eui'; +import { + htmlIdGenerator, + EuiComboBox, + EuiFieldText, + EuiFlexItem, + EuiFormRow, + EuiLink, + EuiSuperSelect, + EuiText, + EuiCode, +} from '@elastic/eui'; +import { DATA_FORMATTERS } from '../../../common/enums'; +import { getFormatterType } from './lib/get_formatter_type'; +import { durationInputOptions, durationOutputOptions, getDurationParams } from './lib/durations'; + +const DEFAULT_OUTPUT_PRECISION = '2'; +const DEFAULT_CUSTOM_FORMAT_PATTERN = '0,0.[000]'; + +const defaultOptionLabel = i18n.translate('visTypeTimeseries.dataFormatPicker.defaultLabel', { + defaultMessage: 'Default', +}); + +const getDataFormatPickerOptions = ( + shouldIncludeDefaultOption: boolean, + shouldIncludeNumberOptions: boolean +) => { + const additionalOptions = []; + + if (shouldIncludeDefaultOption) { + additionalOptions.push({ + value: DATA_FORMATTERS.DEFAULT, + inputDisplay: defaultOptionLabel, + dropdownDisplay: ( + <> + {defaultOptionLabel} + +

+ {i18n.translate('visTypeTimeseries.dataFormatPicker.defaultLabelDescription', { + defaultMessage: 'Applies common formatting', + })} +

+
+ + ), + 'data-test-subj': `tsvbDataFormatPicker-${DATA_FORMATTERS.DEFAULT}`, + }); + } + + if (shouldIncludeNumberOptions) { + additionalOptions.push( + { + value: DATA_FORMATTERS.NUMBER, + inputDisplay: i18n.translate('visTypeTimeseries.dataFormatPicker.numberLabel', { + defaultMessage: 'Number', + }), + 'data-test-subj': `tsvbDataFormatPicker-${DATA_FORMATTERS.NUMBER}`, + }, + { + value: DATA_FORMATTERS.BYTES, + inputDisplay: i18n.translate('visTypeTimeseries.dataFormatPicker.bytesLabel', { + defaultMessage: 'Bytes', + }), + 'data-test-subj': `tsvbDataFormatPicker-${DATA_FORMATTERS.BYTES}`, + }, + { + value: DATA_FORMATTERS.PERCENT, + inputDisplay: i18n.translate('visTypeTimeseries.dataFormatPicker.percentLabel', { + defaultMessage: 'Percent', + }), + 'data-test-subj': `tsvbDataFormatPicker-${DATA_FORMATTERS.PERCENT}`, + }, + { + value: DATA_FORMATTERS.DURATION, + inputDisplay: i18n.translate('visTypeTimeseries.dataFormatPicker.durationLabel', { + defaultMessage: 'Duration', + }), + 'data-test-subj': `tsvbDataFormatPicker-${DATA_FORMATTERS.DURATION}`, + } + ); + } + + return [ + ...additionalOptions, + { + value: DATA_FORMATTERS.CUSTOM, + inputDisplay: i18n.translate('visTypeTimeseries.dataFormatPicker.customLabel', { + defaultMessage: 'Custom', + }), + 'data-test-subj': `tsvbDataFormatPicker-${DATA_FORMATTERS.CUSTOM}`, + }, + ]; +}; + +interface DataFormatPickerProps { + formatterValue: string; + changeModelFormatter: (formatter: string) => void; + shouldIncludeDefaultOption: boolean; + shouldIncludeNumberOptions: boolean; +} + +const htmlId = htmlIdGenerator(); + +export const DataFormatPicker = ({ + formatterValue, + changeModelFormatter, + shouldIncludeDefaultOption, + shouldIncludeNumberOptions, +}: DataFormatPickerProps) => { + const options = useMemo( + () => getDataFormatPickerOptions(shouldIncludeDefaultOption, shouldIncludeNumberOptions), + [shouldIncludeDefaultOption, shouldIncludeNumberOptions] + ); + const [selectedFormatter, setSelectedFormatter] = useState(getFormatterType(formatterValue)); + const [customFormatPattern, setCustomFormatPattern] = useState( + selectedFormatter === DATA_FORMATTERS.CUSTOM ? formatterValue : '' + ); + const [durationParams, setDurationParams] = useState( + getDurationParams(selectedFormatter === DATA_FORMATTERS.DURATION ? formatterValue : 'ms,ms,') + ); + + useEffect(() => { + // formatter value is set to the first option in case options do not include selected formatter + if (!options.find(({ value }) => value === selectedFormatter)) { + const [{ value: firstOptionValue }] = options; + setSelectedFormatter(firstOptionValue); + changeModelFormatter(firstOptionValue); + } + }, [options, selectedFormatter, changeModelFormatter]); + + const handleChange = useCallback( + (selectedOption: DATA_FORMATTERS) => { + setSelectedFormatter(selectedOption); + if (selectedOption === DATA_FORMATTERS.DURATION) { + const { from, to, decimals } = durationParams; + changeModelFormatter(`${from},${to},${decimals}`); + } else if (selectedOption === DATA_FORMATTERS.CUSTOM) { + changeModelFormatter(customFormatPattern); + } else { + changeModelFormatter(selectedOption); + } + }, + [changeModelFormatter, customFormatPattern, durationParams] + ); + + const handleCustomFormatStringChange = useCallback( + (event: ChangeEvent) => { + const stringPattern = event.target.value; + changeModelFormatter(stringPattern); + setCustomFormatPattern(stringPattern); + }, + [changeModelFormatter] + ); + + const handleDurationParamsChange = useCallback( + (paramName: string, paramValue: string) => { + const newDurationParams = { ...durationParams, [paramName]: paramValue }; + setDurationParams(newDurationParams); + const { from, to, decimals } = newDurationParams; + changeModelFormatter(`${from},${to},${decimals}`); + }, + [changeModelFormatter, durationParams] + ); + + const handleDurationChange = useCallback( + (optionName: 'from' | 'to') => { + return ([{ value }]: Array>) => + handleDurationParamsChange(optionName, value!); + }, + [handleDurationParamsChange] + ); + + const handleDecimalsChange = useCallback( + (event: ChangeEvent) => + handleDurationParamsChange('decimals', event.target.value), + [handleDurationParamsChange] + ); + + let duration; + if (selectedFormatter === DATA_FORMATTERS.DURATION) { + const { from, to, decimals = DEFAULT_OUTPUT_PRECISION } = durationParams; + const selectedFrom = durationInputOptions.find(({ value }) => value === from); + const selectedTo = durationOutputOptions.find(({ value }) => value === to); + + duration = ( + <> + + + + + + + + + + + + {selectedTo?.value !== 'humanize' && ( + + + + + + )} + + ); + } + + let custom; + if (selectedFormatter === DATA_FORMATTERS.CUSTOM && shouldIncludeNumberOptions) { + custom = ( + + {DEFAULT_CUSTOM_FORMAT_PATTERN} }} + /> + } + helpText={ + + + + + + } + > + + + + ); + } + + return ( + <> + + + + + + {selectedFormatter === DATA_FORMATTERS.DURATION && duration} + {selectedFormatter === DATA_FORMATTERS.CUSTOM && custom} + + ); +}; diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/check_if_numeric_metric.test.ts b/src/plugins/vis_type_timeseries/public/application/components/lib/check_if_numeric_metric.test.ts new file mode 100644 index 0000000000000..17827275f86d8 --- /dev/null +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/check_if_numeric_metric.test.ts @@ -0,0 +1,59 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { METRIC_TYPES } from '../../../../../data/common'; +import { TSVB_METRIC_TYPES } from '../../../../common/enums'; +import { checkIfNumericMetric } from './check_if_numeric_metric'; + +import type { Metric } from '../../../../common/types'; + +describe('checkIfNumericMetric(metric, fields, indexPattern)', () => { + const indexPattern = { id: 'some_id' }; + const fields = { + some_id: [ + { name: 'number field', type: 'number' }, + { name: 'string field', type: 'string' }, + { name: 'date field', type: 'date' }, + ], + }; + + it('should return true for Count metric', () => { + const metric = { type: METRIC_TYPES.COUNT } as Metric; + + const actual = checkIfNumericMetric(metric, fields, indexPattern); + expect(actual).toBe(true); + }); + + it('should return true for Average metric', () => { + const metric = { field: 'number field', type: METRIC_TYPES.AVG } as Metric; + + const actual = checkIfNumericMetric(metric, fields, indexPattern); + expect(actual).toBe(true); + }); + + it('should return true for Top Hit metric with numeric field', () => { + const metric = { field: 'number field', type: TSVB_METRIC_TYPES.TOP_HIT } as Metric; + + const actual = checkIfNumericMetric(metric, fields, indexPattern); + expect(actual).toBe(true); + }); + + it('should return false for Top Hit metric with string field', () => { + const metric = { field: 'string field', type: TSVB_METRIC_TYPES.TOP_HIT } as Metric; + + const actual = checkIfNumericMetric(metric, fields, indexPattern); + expect(actual).toBe(false); + }); + + it('should return false for Top Hit metric with date field', () => { + const metric = { field: 'date field', type: TSVB_METRIC_TYPES.TOP_HIT } as Metric; + + const actual = checkIfNumericMetric(metric, fields, indexPattern); + expect(actual).toBe(false); + }); +}); diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/check_if_numeric_metric.ts b/src/plugins/vis_type_timeseries/public/application/components/lib/check_if_numeric_metric.ts new file mode 100644 index 0000000000000..a70abaeac9f82 --- /dev/null +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/check_if_numeric_metric.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 { getIndexPatternKey } from '../../../../common/index_patterns_utils'; +import { TSVB_METRIC_TYPES } from '../../../../common/enums'; +import { KBN_FIELD_TYPES } from '../../../../../data/public'; + +import type { Metric, IndexPatternValue } from '../../../../common/types'; +import type { VisFields } from '../../lib/fetch_fields'; + +// this function checks if metric has numeric value result +export const checkIfNumericMetric = ( + metric: Metric, + fields: VisFields, + indexPattern: IndexPatternValue +) => { + // currently only Top Hit could have not numeric value result + if (metric?.type === TSVB_METRIC_TYPES.TOP_HIT) { + const selectedField = fields[getIndexPatternKey(indexPattern)]?.find( + ({ name }) => name === metric?.field + ); + return selectedField?.type === KBN_FIELD_TYPES.NUMBER; + } + return true; +}; diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/check_if_series_have_same_formatters.test.ts b/src/plugins/vis_type_timeseries/public/application/components/lib/check_if_series_have_same_formatters.test.ts new file mode 100644 index 0000000000000..71aed8c7315e2 --- /dev/null +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/check_if_series_have_same_formatters.test.ts @@ -0,0 +1,82 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { checkIfSeriesHaveSameFormatters } from './check_if_series_have_same_formatters'; +import { DATA_FORMATTERS } from '../../../../common/enums'; +import type { Series } from '../../../../common/types'; + +describe('checkIfSeriesHaveSameFormatters(seriesModel, fieldFormatMap)', () => { + const fieldFormatMap = { + someField: { id: 'string', params: { transform: 'upper' } }, + anotherField: { id: 'number', params: { pattern: '$0,0.[00]' } }, + }; + + it('should return true for the same series formatters', () => { + const seriesModel = [ + { formatter: DATA_FORMATTERS.BYTES, metrics: [{ field: 'someField' }] }, + { formatter: DATA_FORMATTERS.BYTES, metrics: [{ field: 'anotherField' }] }, + ] as Series[]; + const result = checkIfSeriesHaveSameFormatters(seriesModel, fieldFormatMap); + + expect(result).toBe(true); + }); + + it('should return false for the different value_template series formatters', () => { + const seriesModel = [ + { + formatter: DATA_FORMATTERS.PERCENT, + value_template: '{{value}} first', + }, + { + formatter: DATA_FORMATTERS.PERCENT, + value_template: '{{value}} second', + }, + ] as Series[]; + const result = checkIfSeriesHaveSameFormatters(seriesModel, fieldFormatMap); + + expect(result).toBe(false); + }); + + it('should return true for the same field formatters', () => { + const seriesModel = [ + { formatter: DATA_FORMATTERS.DEFAULT, metrics: [{ field: 'someField' }] }, + { formatter: DATA_FORMATTERS.DEFAULT, metrics: [{ field: 'someField' }] }, + ] as Series[]; + const result = checkIfSeriesHaveSameFormatters(seriesModel, fieldFormatMap); + + expect(result).toBe(true); + }); + + it('should return false for the different field formatters', () => { + const seriesModel = [ + { formatter: DATA_FORMATTERS.DEFAULT, metrics: [{ field: 'someField' }] }, + { + formatter: DATA_FORMATTERS.DEFAULT, + + metrics: [{ field: 'anotherField' }], + }, + ] as Series[]; + const result = checkIfSeriesHaveSameFormatters(seriesModel, fieldFormatMap); + + expect(result).toBe(false); + }); + + it('should return false for when there is no custom formatter for a field', () => { + const seriesModel = [ + { + formatter: DATA_FORMATTERS.DEFAULT, + + metrics: [{ field: 'someField' }, { field: 'field' }], + }, + { formatter: DATA_FORMATTERS.DEFAULT, metrics: [{ field: 'someField' }] }, + ] as Series[]; + const result = checkIfSeriesHaveSameFormatters(seriesModel, fieldFormatMap); + + expect(result).toBe(false); + }); +}); diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/check_if_series_have_same_formatters.ts b/src/plugins/vis_type_timeseries/public/application/components/lib/check_if_series_have_same_formatters.ts new file mode 100644 index 0000000000000..afa1216406ab0 --- /dev/null +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/check_if_series_have_same_formatters.ts @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { last, isEqual } from 'lodash'; +import { DATA_FORMATTERS } from '../../../../common/enums'; +import type { Series } from '../../../../common/types'; +import type { FieldFormatMap } from '../../../../../data/common'; + +export const checkIfSeriesHaveSameFormatters = ( + seriesModel: Series[], + fieldFormatMap?: FieldFormatMap +) => { + const allSeriesHaveDefaultFormatting = seriesModel.every( + (seriesGroup) => seriesGroup.formatter === DATA_FORMATTERS.DEFAULT + ); + + return allSeriesHaveDefaultFormatting && fieldFormatMap + ? seriesModel + .map(({ metrics }) => fieldFormatMap[last(metrics)?.field ?? '']) + .every((fieldFormat, index, [firstSeriesFieldFormat]) => + isEqual(fieldFormat, firstSeriesFieldFormat) + ) + : seriesModel.every( + (series) => + series.formatter === seriesModel[0].formatter && + series.value_template === seriesModel[0].value_template + ); +}; diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_vars.js b/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_vars.js index 816bce5dac75b..867ba673cf1dd 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_vars.js +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/convert_series_to_vars.js @@ -7,32 +7,35 @@ */ import { set } from '@elastic/safer-lodash-set'; -import _ from 'lodash'; +import { startsWith, snakeCase } from 'lodash'; +import { BUCKET_TYPES, DATA_FORMATTERS } from '../../../../common/enums'; import { getLastValue } from '../../../../common/last_value_utils'; import { getValueOrEmpty, emptyLabel } from '../../../../common/empty_label'; import { createTickFormatter } from './tick_formatter'; +import { getMetricsField } from './get_metrics_field'; +import { createFieldFormatter } from './create_field_formatter'; import { labelDateFormatter } from './label_date_formatter'; import moment from 'moment'; -export const convertSeriesToVars = (series, model, dateFormat = 'lll', getConfig = null) => { +export const convertSeriesToVars = (series, model, getConfig = null, fieldFormatMap) => { const variables = {}; + const dateFormat = getConfig?.('dateFormat') ?? 'lll'; model.series.forEach((seriesModel) => { series - .filter((row) => _.startsWith(row.id, seriesModel.id)) + .filter((row) => startsWith(row.id, seriesModel.id)) .forEach((row) => { let label = getValueOrEmpty(row.label); if (label !== emptyLabel) { - label = _.snakeCase(label); + label = snakeCase(label); } - const varName = [label, _.snakeCase(seriesModel.var_name)].filter((v) => v).join('.'); + const varName = [label, snakeCase(seriesModel.var_name)].filter((v) => v).join('.'); - const formatter = createTickFormatter( - seriesModel.formatter, - seriesModel.value_template, - getConfig - ); + const formatter = + seriesModel.formatter === DATA_FORMATTERS.DEFAULT + ? createFieldFormatter(getMetricsField(seriesModel.metrics), fieldFormatMap) + : createTickFormatter(seriesModel.formatter, seriesModel.value_template, getConfig); const lastValue = getLastValue(row.data); const data = { @@ -47,8 +50,12 @@ export const convertSeriesToVars = (series, model, dateFormat = 'lll', getConfig }), }, }; + const rowLabel = + seriesModel.split_mode === BUCKET_TYPES.TERMS + ? createFieldFormatter(seriesModel.terms_field, fieldFormatMap)(row.label) + : row.label; set(variables, varName, data); - set(variables, `${label}.label`, row.label); + set(variables, `${label}.label`, rowLabel); /** * Handle the case when a field has "key_as_string" value. diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/create_field_formatter.test.ts b/src/plugins/vis_type_timeseries/public/application/components/lib/create_field_formatter.test.ts new file mode 100644 index 0000000000000..0173ca4db15ae --- /dev/null +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/create_field_formatter.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { createFieldFormatter } from './create_field_formatter'; +import { getFieldFormatsRegistry } from '../../../../../data/public/test_utils'; +import { setFieldFormats } from '../../../services'; +import { FORMATS_UI_SETTINGS } from 'src/plugins/field_formats/common'; +import type { CoreSetup } from 'kibana/public'; + +const mockUiSettings = ({ + get: jest.fn((item: keyof typeof mockUiSettings) => mockUiSettings[item]), + [FORMATS_UI_SETTINGS.FORMAT_BYTES_DEFAULT_PATTERN]: '0,0.[000]b', + [FORMATS_UI_SETTINGS.FORMAT_NUMBER_DEFAULT_PATTERN]: '0,0.[000]', +} as unknown) as CoreSetup['uiSettings']; + +describe('createFieldFormatter(fieldName, fieldFormatMap?, contextType?, hasColorRules)', () => { + setFieldFormats( + getFieldFormatsRegistry(({ + uiSettings: mockUiSettings, + } as unknown) as CoreSetup) + ); + const value = 1234567890; + const stringValue = 'some string'; + const fieldFormatMap = { + bytesField: { + id: 'bytes', + }, + stringField: { + id: 'string', + params: { + transform: 'base64', + }, + }, + colorField: { + id: 'color', + params: { + fieldType: 'number', + colors: [ + { + range: '-Infinity:Infinity', + regex: '', + text: '#D36086', + background: '#ffffff', + }, + ], + }, + }, + urlField: { + id: 'url', + params: { + urlTemplate: 'https://{{value}}', + labelTemplate: '{{value}}', + }, + }, + }; + + it('should return byte formatted value for bytesField', () => { + const formatter = createFieldFormatter('bytesField', fieldFormatMap); + + expect(formatter(value)).toBe('1.15GB'); + }); + + it('should return base64 formatted value for stringField', () => { + const formatter = createFieldFormatter('stringField', fieldFormatMap); + + expect(formatter(value)).toBe('×møç®ü÷'); + }); + + it('should return color formatted value for colorField', () => { + const formatter = createFieldFormatter('colorField', fieldFormatMap, 'html'); + + expect(formatter(value)).toBe( + '1234567890' + ); + }); + + it('should return number formatted value wrapped in span for colorField when color rules are applied', () => { + const formatter = createFieldFormatter('colorField', fieldFormatMap, 'html', true); + + expect(formatter(value)).toBe('1,234,567,890'); + }); + + it('should return not formatted string value for colorField when color rules are applied', () => { + const formatter = createFieldFormatter('colorField', fieldFormatMap, 'html', true); + + expect(formatter(stringValue)).toBe(stringValue); + }); + + it('should return url formatted value for urlField', () => { + const formatter = createFieldFormatter('urlField', fieldFormatMap, 'html'); + + expect(formatter(value)).toBe( + '1234567890' + ); + }); + + it('should return "-" for null value when field has format', () => { + const formatter = createFieldFormatter('bytesField', fieldFormatMap); + + expect(formatter(null)).toBe('-'); + }); + + it('should return "-" for null value when field that has no format', () => { + const formatter = createFieldFormatter('urlField', fieldFormatMap); + + expect(formatter(null)).toBe('-'); + }); + + it('should return number formatted value for number when field has no format', () => { + const formatter = createFieldFormatter('noSuchField', fieldFormatMap); + + expect(formatter(value)).toBe('1,234,567,890'); + }); + + it('should not format string value when field has no format', () => { + const formatter = createFieldFormatter('noSuchField', fieldFormatMap); + + expect(formatter(stringValue)).toBe(stringValue); + }); +}); diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/create_field_formatter.ts b/src/plugins/vis_type_timeseries/public/application/components/lib/create_field_formatter.ts new file mode 100644 index 0000000000000..5cba549220f2c --- /dev/null +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/create_field_formatter.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 { isNumber } from 'lodash'; +import { getFieldFormats } from '../../../services'; +import { isEmptyValue, DISPLAY_EMPTY_VALUE } from '../../../../common/last_value_utils'; +import { FIELD_FORMAT_IDS } from '../../../../../field_formats/common'; +import type { FieldFormatMap } from '../../../../../data/common'; +import type { FieldFormatsContentType } from '../../../../../field_formats/common'; + +const DEFAULT_FIELD_FORMAT = { id: 'number' }; + +export const createFieldFormatter = ( + fieldName: string = '', + fieldFormatMap?: FieldFormatMap, + contextType?: FieldFormatsContentType, + hasColorRules: boolean = false +) => { + const serializedFieldFormat = fieldFormatMap?.[fieldName]; + // field formatting should be skipped either there's no such field format in fieldFormatMap + // or it's color formatting and color rules are already applied + const shouldSkipFormatting = + !serializedFieldFormat || + (hasColorRules && serializedFieldFormat?.id === FIELD_FORMAT_IDS.COLOR); + + const fieldFormat = getFieldFormats().deserialize( + shouldSkipFormatting ? DEFAULT_FIELD_FORMAT : serializedFieldFormat + ); + + return (value: unknown) => { + if (isEmptyValue(value)) { + return DISPLAY_EMPTY_VALUE; + } + return isNumber(value) || !shouldSkipFormatting + ? fieldFormat.convert(value, contextType) + : value; + }; +}; diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/durations.js b/src/plugins/vis_type_timeseries/public/application/components/lib/durations.js deleted file mode 100644 index ac1eb76e7063d..0000000000000 --- a/src/plugins/vis_type_timeseries/public/application/components/lib/durations.js +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { i18n } from '@kbn/i18n'; - -const durationBaseOptions = [ - { - label: i18n.translate('visTypeTimeseries.durationOptions.millisecondsLabel', { - defaultMessage: 'Milliseconds', - }), - value: 'ms', - }, - { - label: i18n.translate('visTypeTimeseries.durationOptions.secondsLabel', { - defaultMessage: 'Seconds', - }), - value: 's', - }, - { - label: i18n.translate('visTypeTimeseries.durationOptions.minutesLabel', { - defaultMessage: 'Minutes', - }), - value: 'm', - }, - { - label: i18n.translate('visTypeTimeseries.durationOptions.hoursLabel', { - defaultMessage: 'Hours', - }), - value: 'h', - }, - { - label: i18n.translate('visTypeTimeseries.durationOptions.daysLabel', { - defaultMessage: 'Days', - }), - value: 'd', - }, - { - label: i18n.translate('visTypeTimeseries.durationOptions.weeksLabel', { - defaultMessage: 'Weeks', - }), - value: 'w', - }, - { - label: i18n.translate('visTypeTimeseries.durationOptions.monthsLabel', { - defaultMessage: 'Months', - }), - value: 'M', - }, - { - label: i18n.translate('visTypeTimeseries.durationOptions.yearsLabel', { - defaultMessage: 'Years', - }), - value: 'Y', - }, -]; - -export const durationOutputOptions = [ - { - label: i18n.translate('visTypeTimeseries.durationOptions.humanize', { - defaultMessage: 'Human readable', - }), - value: 'humanize', - }, - ...durationBaseOptions, -]; - -export const durationInputOptions = [ - { - label: i18n.translate('visTypeTimeseries.durationOptions.picosecondsLabel', { - defaultMessage: 'Picoseconds', - }), - value: 'ps', - }, - { - label: i18n.translate('visTypeTimeseries.durationOptions.nanosecondsLabel', { - defaultMessage: 'Nanoseconds', - }), - value: 'ns', - }, - { - label: i18n.translate('visTypeTimeseries.durationOptions.microsecondsLabel', { - defaultMessage: 'Microseconds', - }), - value: 'us', - }, - ...durationBaseOptions, -]; - -export const inputFormats = { - ps: 'picoseconds', - ns: 'nanoseconds', - us: 'microseconds', - ms: 'milliseconds', - s: 'seconds', - m: 'minutes', - h: 'hours', - d: 'days', - w: 'weeks', - M: 'months', - Y: 'years', -}; - -export const outputFormats = { - humanize: 'humanize', - ms: 'asMilliseconds', - s: 'asSeconds', - m: 'asMinutes', - h: 'asHours', - d: 'asDays', - w: 'asWeeks', - M: 'asMonths', - Y: 'asYears', -}; - -export const isDuration = (format) => { - const splittedFormat = format.split(','); - const [input, output] = splittedFormat; - - return Boolean(inputFormats[input] && outputFormats[output]) && splittedFormat.length === 3; -}; diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/durations.test.js b/src/plugins/vis_type_timeseries/public/application/components/lib/durations.test.ts similarity index 100% rename from src/plugins/vis_type_timeseries/public/application/components/lib/durations.test.js rename to src/plugins/vis_type_timeseries/public/application/components/lib/durations.test.ts diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/durations.ts b/src/plugins/vis_type_timeseries/public/application/components/lib/durations.ts new file mode 100644 index 0000000000000..df84c5d6781da --- /dev/null +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/durations.ts @@ -0,0 +1,140 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; + +const durationBaseOptions = [ + { + label: i18n.translate('visTypeTimeseries.durationOptions.millisecondsLabel', { + defaultMessage: 'Milliseconds', + }), + value: 'ms', + }, + { + label: i18n.translate('visTypeTimeseries.durationOptions.secondsLabel', { + defaultMessage: 'Seconds', + }), + value: 's', + }, + { + label: i18n.translate('visTypeTimeseries.durationOptions.minutesLabel', { + defaultMessage: 'Minutes', + }), + value: 'm', + }, + { + label: i18n.translate('visTypeTimeseries.durationOptions.hoursLabel', { + defaultMessage: 'Hours', + }), + value: 'h', + }, + { + label: i18n.translate('visTypeTimeseries.durationOptions.daysLabel', { + defaultMessage: 'Days', + }), + value: 'd', + }, + { + label: i18n.translate('visTypeTimeseries.durationOptions.weeksLabel', { + defaultMessage: 'Weeks', + }), + value: 'w', + }, + { + label: i18n.translate('visTypeTimeseries.durationOptions.monthsLabel', { + defaultMessage: 'Months', + }), + value: 'M', + }, + { + label: i18n.translate('visTypeTimeseries.durationOptions.yearsLabel', { + defaultMessage: 'Years', + }), + value: 'Y', + }, +]; + +export const durationOutputOptions = [ + { + label: i18n.translate('visTypeTimeseries.durationOptions.humanize', { + defaultMessage: 'Human readable', + }), + value: 'humanize', + }, + ...durationBaseOptions, +]; + +export const durationInputOptions = [ + { + label: i18n.translate('visTypeTimeseries.durationOptions.picosecondsLabel', { + defaultMessage: 'Picoseconds', + }), + value: 'ps', + }, + { + label: i18n.translate('visTypeTimeseries.durationOptions.nanosecondsLabel', { + defaultMessage: 'Nanoseconds', + }), + value: 'ns', + }, + { + label: i18n.translate('visTypeTimeseries.durationOptions.microsecondsLabel', { + defaultMessage: 'Microseconds', + }), + value: 'us', + }, + ...durationBaseOptions, +]; + +export const inputFormats = { + ps: 'picoseconds', + ns: 'nanoseconds', + us: 'microseconds', + ms: 'milliseconds', + s: 'seconds', + m: 'minutes', + h: 'hours', + d: 'days', + w: 'weeks', + M: 'months', + Y: 'years', +}; +type InputFormat = keyof typeof inputFormats; + +export const outputFormats = { + humanize: 'humanize', + ms: 'asMilliseconds', + s: 'asSeconds', + m: 'asMinutes', + h: 'asHours', + d: 'asDays', + w: 'asWeeks', + M: 'asMonths', + Y: 'asYears', +}; +type OutputFormat = keyof typeof outputFormats; + +export const getDurationParams = (format: string) => { + const [from, to, decimals] = format.split(','); + + return { + from, + to, + decimals, + }; +}; + +export const isDuration = (format: string) => { + const splittedFormat = format.split(','); + const [input, output] = splittedFormat; + + return ( + Boolean(inputFormats[input as InputFormat] && outputFormats[output as OutputFormat]) && + splittedFormat.length === 3 + ); +}; diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/get_formatter_type.test.ts b/src/plugins/vis_type_timeseries/public/application/components/lib/get_formatter_type.test.ts new file mode 100644 index 0000000000000..59b778a084902 --- /dev/null +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/get_formatter_type.test.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 { DATA_FORMATTERS } from '../../../../common/enums'; +import { getFormatterType } from './get_formatter_type'; + +describe('getFormatterType(formatter)', () => { + it('should return bytes formatter for "bytes"', () => { + const actual = getFormatterType(DATA_FORMATTERS.BYTES); + + expect(actual).toBe(DATA_FORMATTERS.BYTES); + }); + + it('should return duration formatter for duration format string', () => { + const actual = getFormatterType('ns,ms,2'); + + expect(actual).toBe(DATA_FORMATTERS.DURATION); + }); + + it('should return custom formatter for Numeral.js pattern', () => { + const actual = getFormatterType('$ 0.00'); + + expect(actual).toBe(DATA_FORMATTERS.CUSTOM); + }); +}); diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/get_formatter_type.ts b/src/plugins/vis_type_timeseries/public/application/components/lib/get_formatter_type.ts new file mode 100644 index 0000000000000..eb6b2c40f31a5 --- /dev/null +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/get_formatter_type.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 { DATA_FORMATTERS } from '../../../../common/enums'; +import { isDuration } from './durations'; + +export const getFormatterType = (formatter: string) => { + if ( + [ + DATA_FORMATTERS.NUMBER, + DATA_FORMATTERS.BYTES, + DATA_FORMATTERS.PERCENT, + DATA_FORMATTERS.DEFAULT, + ].includes(formatter as DATA_FORMATTERS) + ) { + return formatter as DATA_FORMATTERS; + } + + return formatter && isDuration(formatter) ? DATA_FORMATTERS.DURATION : DATA_FORMATTERS.CUSTOM; +}; diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/get_metrics_field.test.ts b/src/plugins/vis_type_timeseries/public/application/components/lib/get_metrics_field.test.ts new file mode 100644 index 0000000000000..88d671af2f1ae --- /dev/null +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/get_metrics_field.test.ts @@ -0,0 +1,53 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { getMetricsField } from './get_metrics_field'; +import type { Metric } from '../../../../common/types'; + +describe('getMetricsField(metrics)', () => { + it('should return last metric field', () => { + const metrics = [ + { id: 'some-id', type: 'avg', field: 'some field' }, + { id: 'another-id', type: 'sum_bucket', field: 'some-id' }, + { id: 'one-more-id', type: 'top_hit', field: 'one more field' }, + ] as Metric[]; + + const field = getMetricsField(metrics); + expect(field).toBe('one more field'); + }); + + it('should return undefined when last metric has no field', () => { + const metrics = [ + { id: 'some-id', type: 'avg', field: 'some field' }, + { id: 'another-id', type: 'count' }, + ] as Metric[]; + + const field = getMetricsField(metrics); + expect(field).toBeUndefined(); + }); + + it('should return field of basic aggregation', () => { + const metrics = [ + { id: 'some-id', type: 'avg', field: 'some field' }, + { id: 'another-id', type: 'sum_bucket', field: 'some-id' }, + ] as Metric[]; + + const field = getMetricsField(metrics); + expect(field).toBe('some field'); + }); + + it('should return undefined when basic aggregation has no field', () => { + const metrics = [ + { id: 'some-id', type: 'filter_ratio' }, + { id: 'another-id', type: 'max_bucket', field: 'some-id' }, + ] as Metric[]; + + const field = getMetricsField(metrics); + expect(field).toBeUndefined(); + }); +}); diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/get_metrics_field.ts b/src/plugins/vis_type_timeseries/public/application/components/lib/get_metrics_field.ts new file mode 100644 index 0000000000000..c61f147c388f3 --- /dev/null +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/get_metrics_field.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 { last } from 'lodash'; +import { Metric } from '../../../../common/types'; +import { getAggByPredicate, isBasicAgg } from '../../../../common/agg_utils'; + +export const getMetricsField = (metrics: Metric[]) => { + const selectedMetric = last(metrics); + + if (selectedMetric) { + const { isFieldRequired, isFieldFormattingDisabled } = getAggByPredicate( + selectedMetric.type + )?.meta; + + if (isFieldRequired && !isFieldFormattingDisabled) { + return isBasicAgg(selectedMetric) + ? selectedMetric.field + : metrics.find(({ id }) => selectedMetric.field === id)?.field; + } + } +}; diff --git a/src/plugins/vis_type_timeseries/public/application/components/lib/new_series_fn.js b/src/plugins/vis_type_timeseries/public/application/components/lib/new_series_fn.js index 9064cd1afc3f4..ad12302473059 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/lib/new_series_fn.js +++ b/src/plugins/vis_type_timeseries/public/application/components/lib/new_series_fn.js @@ -24,7 +24,7 @@ export const newSeriesFn = (obj = {}) => { metrics: [newMetricAggFn()], separate_axis: 0, axis_position: 'right', - formatter: 'number', + formatter: 'default', chart_type: 'line', line_width: 1, point_size: 1, diff --git a/src/plugins/vis_type_timeseries/public/application/components/markdown_editor.js b/src/plugins/vis_type_timeseries/public/application/components/markdown_editor.js index 27622e29c2061..046b1c5799836 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/markdown_editor.js +++ b/src/plugins/vis_type_timeseries/public/application/components/markdown_editor.js @@ -20,8 +20,15 @@ import { CodeEditor, MarkdownLang } from '../../../../kibana_react/public'; import { EuiText, EuiCodeBlock, EuiSpacer, EuiTitle } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; +import { getDataStart } from '../../services'; +import { fetchIndexPattern } from '../../../common/index_patterns_utils'; export class MarkdownEditor extends Component { + constructor(props) { + super(props); + this.state = { fieldFormatMap: undefined }; + } + handleChange = (value) => { this.props.onChange({ markdown: value }); }; @@ -38,17 +45,22 @@ export class MarkdownEditor extends Component { } }; + async componentDidMount() { + const { indexPatterns } = getDataStart(); + const { indexPattern } = await fetchIndexPattern(this.props.model.index_pattern, indexPatterns); + this.setState({ fieldFormatMap: indexPattern?.fieldFormatMap }); + } + render() { const { visData, model, getConfig } = this.props; if (!visData) { return null; } - const dateFormat = getConfig('dateFormat'); const series = _.get(visData, `${model.id}.series`, []); - const variables = convertSeriesToVars(series, model, dateFormat, this.props.getConfig); + const variables = convertSeriesToVars(series, model, getConfig, this.state.fieldFormatMap); const rows = []; - const rawFormatter = createTickFormatter('0.[0000]', null, this.props.getConfig); + const rawFormatter = createTickFormatter('0.[0000]', null, getConfig); const createPrimitiveRow = (key) => { const snippet = `{{ ${key} }}`; diff --git a/src/plugins/vis_type_timeseries/public/application/components/series_config.js b/src/plugins/vis_type_timeseries/public/application/components/series_config.js index 86781c9922e46..b4907d4eaa5c2 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/series_config.js +++ b/src/plugins/vis_type_timeseries/public/application/components/series_config.js @@ -6,12 +6,13 @@ * Side Public License, v 1. */ import { i18n } from '@kbn/i18n'; +import { last } from 'lodash'; import { FormattedMessage } from '@kbn/i18n/react'; import PropTypes from 'prop-types'; -import React from 'react'; +import React, { useMemo, useCallback } from 'react'; import { DataFormatPicker } from './data_format_picker'; -import { createSelectHandler } from './lib/create_select_handler'; import { createTextHandler } from './lib/create_text_handler'; +import { checkIfNumericMetric } from './lib/check_if_numeric_metric'; import { YesNo } from './yes_no'; import { IndexPattern } from './index_pattern'; import { @@ -24,34 +25,34 @@ import { EuiHorizontalRule, } from '@elastic/eui'; import { SeriesConfigQueryBarWithIgnoreGlobalFilter } from './series_config_query_bar_with_ignore_global_filter'; +import { DATA_FORMATTERS } from '../../../common/enums'; export const SeriesConfig = (props) => { - const defaults = { offset_time: '', value_template: '' }; + const defaults = { offset_time: '', value_template: '{{value}}' }; const model = { ...defaults, ...props.model }; - const handleSelectChange = createSelectHandler(props.onChange); const handleTextChange = createTextHandler(props.onChange); const htmlId = htmlIdGenerator(); const seriesIndexPattern = props.model.override_index_pattern ? props.model.series_index_pattern : props.indexPatternForQuery; + const changeModelFormatter = useCallback((formatter) => props.onChange({ formatter }), [props]); + const isNumericMetric = useMemo( + () => checkIfNumericMetric(last(model.metrics), props.fields, seriesIndexPattern), + [model.metrics, props.fields, seriesIndexPattern] + ); + const isKibanaIndexPattern = props.panel.use_kibana_indexes || seriesIndexPattern === ''; + return (
- - - - - - - - - + + { + + + + + + + + + { - const indexPatternValue = model.index_pattern || ''; - const { indexPatterns } = getDataStart(); - const { indexPattern } = await fetchIndexPattern(indexPatternValue, indexPatterns); let event; // trigger applyFilter if no index pattern found, url drilldowns are supported only // for the index pattern mode @@ -98,15 +94,11 @@ function TimeseriesVisualization({ handlers.event(event); }, - [handlers, model] + [handlers, indexPattern, model] ); const handleFilterClick = useCallback( async (series: PanelData[], points: Array<[GeometryValue, XYChartSeriesIdentifier]>) => { - const indexPatternValue = model.index_pattern || ''; - const { indexPatterns } = getDataStart(); - const { indexPattern } = await fetchIndexPattern(indexPatternValue, indexPatterns); - // it should work only if index pattern is found if (!indexPattern) return; @@ -129,7 +121,7 @@ function TimeseriesVisualization({ handlers.event(event); }, - [handlers, model] + [handlers, indexPattern, model] ); const handleUiState = useCallback( @@ -152,17 +144,16 @@ function TimeseriesVisualization({ const shouldDisplayLastValueIndicator = isLastValueMode && !model.hide_last_value_indicator && model.type !== PANEL_TYPES.TIMESERIES; + const [firstSeries] = + (isVisTableData(visData) ? visData.series : visData[model.id]?.series) ?? []; + if (VisComponent) { return ( {shouldDisplayLastValueIndicator && ( diff --git a/src/plugins/vis_type_timeseries/public/application/components/vis_editor.tsx b/src/plugins/vis_type_timeseries/public/application/components/vis_editor.tsx index 152ae43bebd64..5e4ff436ff1e6 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/vis_editor.tsx +++ b/src/plugins/vis_type_timeseries/public/application/components/vis_editor.tsx @@ -12,9 +12,8 @@ import { share } from 'rxjs/operators'; import { isEqual, isEmpty, debounce } from 'lodash'; import { EventEmitter } from 'events'; import type { IUiSettingsClient } from 'kibana/public'; -import { +import type { Vis, - PersistedState, VisualizeEmbeddableContract, } from '../../../../../plugins/visualizations/public'; import { KibanaContextProvider } from '../../../../../plugins/kibana_react/public'; @@ -31,8 +30,9 @@ import { TIME_RANGE_DATA_MODES, TIME_RANGE_MODE_KEY } from '../../../common/enum import { VisPicker } from './vis_picker'; import { fetchFields, VisFields } from '../lib/fetch_fields'; import { getDataStart, getCoreStart } from '../../services'; -import { TimeseriesVisParams } from '../../types'; +import type { TimeseriesVisParams } from '../../types'; import { UseIndexPatternModeCallout } from './use_index_patter_mode_callout'; +import type { EditorRenderProps } from '../../../../visualize/public'; const VIS_STATE_DEBOUNCE_DELAY = 200; const APP_NAME = 'VisEditor'; @@ -42,7 +42,9 @@ export interface TimeseriesEditorProps { embeddableHandler: VisualizeEmbeddableContract; eventEmitter: EventEmitter; timeRange: TimeRange; - uiState: PersistedState; + filters: EditorRenderProps['filters']; + query: EditorRenderProps['query']; + uiState: EditorRenderProps['uiState']; vis: Vis; } @@ -189,6 +191,8 @@ export class VisEditor extends Component includes(row.id, s.id)); const newProps = {}; if (seriesDef) { - newProps.formatter = createTickFormatter( - seriesDef.formatter, - seriesDef.value_template, - props.getConfig - ); + const hasTextColorRules = model.gauge_color_rules.some(({ text }) => text); + newProps.formatter = + seriesDef.formatter === DATA_FORMATTERS.DEFAULT + ? createFieldFormatter( + getMetricsField(seriesDef.metrics), + fieldFormatMap, + 'html', + hasTextColorRules + ) + : createTickFormatter(seriesDef.formatter, seriesDef.value_template, getConfig); } if (i === 0 && colors.gauge) newProps.color = colors.gauge; return assign({}, row, newProps); diff --git a/src/plugins/vis_type_timeseries/public/application/components/vis_types/index.ts b/src/plugins/vis_type_timeseries/public/application/components/vis_types/index.ts index 544e2bf49690a..b2e40940b8001 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/vis_types/index.ts +++ b/src/plugins/vis_type_timeseries/public/application/components/vis_types/index.ts @@ -14,6 +14,7 @@ import { PaletteRegistry } from 'src/plugins/charts/public'; import { TimeseriesVisParams } from '../../../types'; import type { TimeseriesVisData, PanelData } from '../../../../common/types'; +import type { FieldFormatMap } from '../../../../../data/common'; /** * Lazy load each visualization type, since the only one is presented on the screen at the same time. @@ -61,4 +62,5 @@ export interface TimeseriesVisProps { getConfig: IUiSettingsClient['get']; syncColors: boolean; palettesService: PaletteRegistry; + fieldFormatMap?: FieldFormatMap; } diff --git a/src/plugins/vis_type_timeseries/public/application/components/vis_types/markdown/vis.js b/src/plugins/vis_type_timeseries/public/application/components/vis_types/markdown/vis.js index ef6b30be30a30..fc7019bd38293 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/vis_types/markdown/vis.js +++ b/src/plugins/vis_type_timeseries/public/application/components/vis_types/markdown/vis.js @@ -21,9 +21,9 @@ import { isBackgroundInverted } from '../../../lib/set_is_reversed'; const getMarkdownId = (id) => `markdown-${id}`; function MarkdownVisualization(props) { - const { backgroundColor, model, visData, getConfig } = props; + const { backgroundColor, model, visData, getConfig, fieldFormatMap } = props; const series = get(visData, `${model.id}.series`, []); - const variables = convertSeriesToVars(series, model, getConfig('dateFormat'), props.getConfig); + const variables = convertSeriesToVars(series, model, getConfig, fieldFormatMap); const markdownElementId = getMarkdownId(uuid.v1()); const panelBackgroundColor = model.background_color || backgroundColor; diff --git a/src/plugins/vis_type_timeseries/public/application/components/vis_types/metric/vis.js b/src/plugins/vis_type_timeseries/public/application/components/vis_types/metric/vis.js index b35ee977d3e44..90e2a57d925a6 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/vis_types/metric/vis.js +++ b/src/plugins/vis_type_timeseries/public/application/components/vis_types/metric/vis.js @@ -9,9 +9,12 @@ import PropTypes from 'prop-types'; import React from 'react'; import { visWithSplits } from '../../vis_with_splits'; +import { getMetricsField } from '../../lib/get_metrics_field'; import { createTickFormatter } from '../../lib/tick_formatter'; +import { createFieldFormatter } from '../../lib/create_field_formatter'; import { get, isUndefined, assign, includes, pick } from 'lodash'; import { Metric } from '../../../visualizations/views/metric'; +import { DATA_FORMATTERS } from '../../../../../common/enums'; import { getLastValue } from '../../../../../common/last_value_utils'; import { isBackgroundInverted } from '../../../lib/set_is_reversed'; import { getOperator, shouldOperate } from '../../../../../common/operators_utils'; @@ -36,7 +39,7 @@ function getColors(props) { } function MetricVisualization(props) { - const { backgroundColor, model, visData } = props; + const { backgroundColor, model, visData, fieldFormatMap, getConfig } = props; const colors = getColors(props); const series = get(visData, `${model.id}.series`, []) .filter((row) => row) @@ -44,11 +47,15 @@ function MetricVisualization(props) { const seriesDef = model.series.find((s) => includes(row.id, s.id)); const newProps = {}; if (seriesDef) { - newProps.formatter = createTickFormatter( - seriesDef.formatter, - seriesDef.value_template, - props.getConfig - ); + newProps.formatter = + seriesDef.formatter === DATA_FORMATTERS.DEFAULT + ? createFieldFormatter( + getMetricsField(seriesDef.metrics), + fieldFormatMap, + 'html', + colors.color + ) + : createTickFormatter(seriesDef.formatter, seriesDef.value_template, getConfig); } if (i === 0 && colors.color) newProps.color = colors.color; return assign({}, pick(row, ['label', 'data']), newProps); diff --git a/src/plugins/vis_type_timeseries/public/application/components/vis_types/table/config.js b/src/plugins/vis_type_timeseries/public/application/components/vis_types/table/config.js index 094c33f131fd9..e7d13e1497f5c 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/vis_types/table/config.js +++ b/src/plugins/vis_type_timeseries/public/application/components/vis_types/table/config.js @@ -10,6 +10,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import uuid from 'uuid'; import { i18n } from '@kbn/i18n'; +import { last } from 'lodash'; import { DataFormatPicker } from '../../data_format_picker'; import { createSelectHandler } from '../../lib/create_select_handler'; @@ -31,7 +32,9 @@ import { } from '@elastic/eui'; 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'; export class TableSeriesConfig extends Component { UNSAFE_componentWillMount() { @@ -43,8 +46,10 @@ export class TableSeriesConfig extends Component { } } + changeModelFormatter = (formatter) => this.props.onChange({ formatter }); + render() { - const defaults = { offset_time: '', value_template: '' }; + 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); @@ -110,13 +115,24 @@ export class TableSeriesConfig extends Component { return model.aggregate_function === option.value; }); + const isNumericMetric = checkIfNumericMetric( + last(model.metrics), + this.props.fields, + this.props.indexPatternForQuery + ); + const isKibanaIndexPattern = + this.props.panel.use_kibana_indexes || this.props.indexPatternForQuery === ''; + return (
- - - - + + diff --git a/src/plugins/vis_type_timeseries/public/application/components/vis_types/table/vis.js b/src/plugins/vis_type_timeseries/public/application/components/vis_types/table/vis.js index ba235a20b97ce..21d7de9f1d880 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/vis_types/table/vis.js +++ b/src/plugins/vis_type_timeseries/public/application/components/vis_types/table/vis.js @@ -11,13 +11,16 @@ import React, { Component } from 'react'; import { parse as parseUrl } from 'url'; import PropTypes from 'prop-types'; import { RedirectAppLinks } from '../../../../../../kibana_react/public'; +import { getMetricsField } from '../../lib/get_metrics_field'; import { createTickFormatter } from '../../lib/tick_formatter'; +import { createFieldFormatter } from '../../lib/create_field_formatter'; import { isSortable } from './is_sortable'; import { EuiToolTip, EuiIcon } from '@elastic/eui'; import { replaceVars } from '../../lib/replace_vars'; import { FIELD_FORMAT_IDS } from '../../../../../../../plugins/field_formats/common'; import { FormattedMessage } from '@kbn/i18n/react'; import { getFieldFormats, getCoreStart } from '../../../../services'; +import { DATA_FORMATTERS } from '../../../../../common/enums'; import { getValueOrEmpty } from '../../../../../common/empty_label'; function getColor(rules, colorKey, value) { @@ -57,26 +60,40 @@ class TableVis extends Component { } renderRow = (row) => { - const { model } = this.props; + const { model, fieldFormatMap, getConfig } = this.props; let rowDisplay = getValueOrEmpty( model.pivot_type === 'date' ? this.dateFormatter.convert(row.key) : row.key ); + // we should skip url field formatting for key if tsvb have drilldown_url + if (fieldFormatMap?.[model.pivot_id]?.id !== FIELD_FORMAT_IDS.URL || !model.drilldown_url) { + const formatter = createFieldFormatter(model?.pivot_id, fieldFormatMap, 'html'); + rowDisplay = ; // eslint-disable-line react/no-danger + } + if (model.drilldown_url) { const url = replaceVars(model.drilldown_url, {}, { key: row.key }); rowDisplay = {rowDisplay}; } + const columns = row.series .filter((item) => item) .map((item) => { const column = this.visibleSeries.find((c) => c.id === item.id); if (!column) return null; - const formatter = createTickFormatter( - column.formatter, - column.value_template, - this.props.getConfig + const hasColorRules = column.color_rules?.some( + ({ value, operator, text }) => value || operator || text ); + const formatter = + column.formatter === DATA_FORMATTERS.DEFAULT + ? createFieldFormatter( + getMetricsField(column.metrics), + fieldFormatMap, + 'html', + hasColorRules + ) + : createTickFormatter(column.formatter, column.value_template, getConfig); const value = formatter(item.last); let trend; if (column.trend_arrows) { @@ -95,7 +112,8 @@ class TableVis extends Component { className="eui-textRight" style={style} > - {value} + {/* eslint-disable-next-line react/no-danger */} + {trend} ); diff --git a/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/config.js b/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/config.js index 01ba8b6e28114..4257c35a6d4c2 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/config.js +++ b/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/config.js @@ -8,7 +8,9 @@ import { i18n } from '@kbn/i18n'; import PropTypes from 'prop-types'; -import React, { useState, useEffect } from 'react'; +import { last } from 'lodash'; +import React, { useMemo, useState, useEffect, useCallback } from 'react'; +import { DATA_FORMATTERS } from '../../../../../common/enums'; import { DataFormatPicker } from '../../data_format_picker'; import { createSelectHandler } from '../../lib/create_select_handler'; import { YesNo } from '../../yes_no'; @@ -29,6 +31,7 @@ import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; import { SeriesConfigQueryBarWithIgnoreGlobalFilter } from '../../series_config_query_bar_with_ignore_global_filter'; import { PalettePicker } from '../../palette_picker'; import { getCharts } from '../../../../services'; +import { checkIfNumericMetric } from '../../lib/check_if_numeric_metric'; import { isPercentDisabled } from '../../lib/stacked'; import { STACKED_OPTIONS } from '../../../visualizations/constants/chart'; @@ -328,6 +331,13 @@ export const TimeseriesConfig = injectI18n(function (props) { ? props.model.series_index_pattern : props.indexPatternForQuery; + const changeModelFormatter = useCallback((formatter) => props.onChange({ formatter }), [props]); + const isNumericMetric = useMemo( + () => checkIfNumericMetric(last(model.metrics), props.fields, seriesIndexPattern), + [model.metrics, props.fields, seriesIndexPattern] + ); + const isKibanaIndexPattern = props.panel.use_kibana_indexes || seriesIndexPattern === ''; + const initialPalette = model.palette ?? { type: 'palette', name: 'default', @@ -344,10 +354,13 @@ export const TimeseriesConfig = injectI18n(function (props) { return (
- - - - + + diff --git a/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/vis.js b/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/vis.js index d9440804701b2..fed295fef9d30 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/vis.js +++ b/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/vis.js @@ -13,7 +13,10 @@ import { startsWith, get, cloneDeep, map } from 'lodash'; import { htmlIdGenerator } from '@elastic/eui'; import { ScaleType } from '@elastic/charts'; +import { getMetricsField } from '../../lib/get_metrics_field'; import { createTickFormatter } from '../../lib/tick_formatter'; +import { createFieldFormatter } from '../../lib/create_field_formatter'; +import { checkIfSeriesHaveSameFormatters } from '../../lib/check_if_series_have_same_formatters'; import { TimeSeries } from '../../../visualizations/views/timeseries'; import { MarkdownSimple } from '../../../../../../../plugins/kibana_react/public'; import { replaceVars } from '../../lib/replace_vars'; @@ -21,6 +24,7 @@ import { getInterval } from '../../lib/get_interval'; import { createIntervalBasedFormatter } from '../../lib/create_interval_based_formatter'; import { STACKED_OPTIONS } from '../../../visualizations/constants'; import { getCoreStart } from '../../../../services'; +import { DATA_FORMATTERS } from '../../../../../common/enums'; class TimeseriesVisualization extends Component { static propTypes = { @@ -51,6 +55,16 @@ class TimeseriesVisualization extends Component { }; applyDocTo = (template) => (doc) => { + const { fieldFormatMap } = this.props; + + // formatting each doc value with custom field formatter if fieldFormatMap contains that doc field name + Object.keys(doc).forEach((fieldName) => { + if (fieldFormatMap?.[fieldName]) { + const valueFieldFormatter = createFieldFormatter(fieldName, fieldFormatMap); + doc[fieldName] = valueFieldFormatter(doc[fieldName]); + } + }); + const vars = replaceVars(template, null, doc, { noEscape: true, }); @@ -139,7 +153,16 @@ class TimeseriesVisualization extends Component { }; render() { - const { model, visData, onBrush, onFilterClick, syncColors, palettesService } = this.props; + const { + model, + visData, + onBrush, + onFilterClick, + syncColors, + palettesService, + fieldFormatMap, + getConfig, + } = this.props; const series = get(visData, `${model.id}.series`, []); const interval = getInterval(visData, model); const yAxisIdGenerator = htmlIdGenerator('yaxis'); @@ -152,10 +175,6 @@ class TimeseriesVisualization extends Component { const yAxis = []; let mainDomainAdded = false; - const allSeriesHaveSameFormatters = seriesModel.every( - (seriesGroup) => seriesGroup.formatter === seriesModel[0].formatter - ); - this.showToastNotification = null; seriesModel.forEach((seriesGroup) => { @@ -166,10 +185,12 @@ class TimeseriesVisualization extends Component { ? TimeseriesVisualization.getYAxisDomain(seriesGroup) : undefined; const isCustomDomain = groupId !== mainAxisGroupId; - const seriesGroupTickFormatter = TimeseriesVisualization.getTickFormatter( - seriesGroup, - this.props.getConfig - ); + + const seriesGroupTickFormatter = + seriesGroup.formatter === DATA_FORMATTERS.DEFAULT + ? createFieldFormatter(getMetricsField(seriesGroup.metrics), fieldFormatMap) + : TimeseriesVisualization.getTickFormatter(seriesGroup, getConfig); + const palette = { ...seriesGroup.palette, name: @@ -214,8 +235,12 @@ class TimeseriesVisualization extends Component { : seriesGroupTickFormatter, }); } else if (!mainDomainAdded) { + const tickFormatter = checkIfSeriesHaveSameFormatters(seriesModel, fieldFormatMap) + ? seriesGroupTickFormatter + : (val) => val; + TimeseriesVisualization.addYAxis(yAxis, { - tickFormatter: allSeriesHaveSameFormatters ? seriesGroupTickFormatter : (val) => val, + tickFormatter, id: yAxisIdGenerator('main'), groupId: mainAxisGroupId, position: model.axis_position, diff --git a/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/vis.test.js b/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/vis.test.js index fd155623d5da7..d6e7484e903bf 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/vis.test.js +++ b/src/plugins/vis_type_timeseries/public/application/components/vis_types/timeseries/vis.test.js @@ -11,9 +11,15 @@ import { shallow } from 'enzyme'; import { TimeSeries } from '../../../visualizations/views/timeseries'; import TimeseriesVisualization from './vis'; import { setFieldFormats } from '../../../../services'; +import { createFieldFormatter } from '../../lib/create_field_formatter'; import { FORMATS_UI_SETTINGS } from '../../../../../../field_formats/common'; +import { METRIC_TYPES } from '../../../../../../data/common'; import { getFieldFormatsRegistry } from '../../../../../../data/public/test_utils'; +jest.mock('../../../../../../data/public/services', () => ({ + getUiSettings: () => ({ get: jest.fn() }), +})); + describe('TimeseriesVisualization', () => { describe('TimeSeries Y-Axis formatted value', () => { const config = { @@ -29,19 +35,34 @@ describe('TimeseriesVisualization', () => { }) ); - const setupTimeSeriesPropsWithFormatters = (...formatters) => { - const series = formatters.map((formatter) => ({ - id, + const setupTimeSeriesProps = (formatters, valueTemplates) => { + const series = formatters.map((formatter, index) => ({ + id: id + index, formatter, + value_template: valueTemplates?.[index], data: [], + metrics: [ + { + type: METRIC_TYPES.AVG, + field: `field${index}`, + }, + ], })); + const fieldFormatMap = { + field0: { id: 'duration', params: { inputFormat: 'years' } }, + field1: { id: 'duration', params: { inputFormat: 'years' } }, + field2: { id: 'duration', params: { inputFormat: 'months' } }, + field3: { id: 'number', params: { pattern: '$0,0.[00]' } }, + }; + const timeSeriesVisualization = shallow( config[key]} model={{ id, series, + use_kibana_indexes: true, }} visData={{ [id]: { @@ -49,56 +70,69 @@ describe('TimeseriesVisualization', () => { series, }, }} + fieldFormatMap={fieldFormatMap} + createCustomFieldFormatter={createFieldFormatter} /> ); return timeSeriesVisualization.find(TimeSeries).props(); }; - test('should be byte for single byte series', () => { - const timeSeriesProps = setupTimeSeriesPropsWithFormatters('byte'); + test('should return byte formatted value from yAxis formatter for single byte series', () => { + const timeSeriesProps = setupTimeSeriesProps(['byte']); const yAxisFormattedValue = timeSeriesProps.yAxis[0].tickFormatter(value); expect(yAxisFormattedValue).toBe('500B'); }); - test('should have custom format for single series', () => { - const timeSeriesProps = setupTimeSeriesPropsWithFormatters('0.00bitd'); + test('should return custom formatted value from yAxis formatter for single series with custom formatter', () => { + const timeSeriesProps = setupTimeSeriesProps(['0.00bitd']); const yAxisFormattedValue = timeSeriesProps.yAxis[0].tickFormatter(value); expect(yAxisFormattedValue).toBe('500.00bit'); }); - test('should be the same number for byte and percent series', () => { - const timeSeriesProps = setupTimeSeriesPropsWithFormatters('byte', 'percent'); + test('should return the same number from yAxis formatter for byte and percent series', () => { + const timeSeriesProps = setupTimeSeriesProps(['byte', 'percent']); const yAxisFormattedValue = timeSeriesProps.yAxis[0].tickFormatter(value); expect(yAxisFormattedValue).toBe(value); }); - test('should be the same stringified number for byte and percent series', () => { - const timeSeriesProps = setupTimeSeriesPropsWithFormatters('byte', 'percent'); + test('should return the same stringified number from yAxis formatter for byte and percent series', () => { + const timeSeriesProps = setupTimeSeriesProps(['byte', 'percent']); const yAxisFormattedValue = timeSeriesProps.yAxis[0].tickFormatter(value.toString()); expect(yAxisFormattedValue).toBe('500'); }); - test('should be byte for two byte formatted series', () => { - const timeSeriesProps = setupTimeSeriesPropsWithFormatters('byte', 'byte'); + test('should return byte formatted value from yAxis formatter and from two byte formatted series with the same value templates', () => { + const timeSeriesProps = setupTimeSeriesProps(['byte', 'byte']); + const { series, yAxis } = timeSeriesProps; - const yAxisFormattedValue = timeSeriesProps.yAxis[0].tickFormatter(value); - const firstSeriesFormattedValue = timeSeriesProps.series[0].tickFormat(value); + expect(series[0].tickFormat(value)).toBe('500B'); + expect(series[1].tickFormat(value)).toBe('500B'); + expect(yAxis[0].tickFormatter(value)).toBe('500B'); + }); - expect(firstSeriesFormattedValue).toBe('500B'); - expect(yAxisFormattedValue).toBe(firstSeriesFormattedValue); + test('should return simple number from yAxis formatter and different values from the same byte formatters, but with different value templates', () => { + const timeSeriesProps = setupTimeSeriesProps( + ['byte', 'byte'], + ['{{value}}', '{{value}} value'] + ); + const { series, yAxis } = timeSeriesProps; + + expect(series[0].tickFormat(value)).toBe('500B'); + expect(series[1].tickFormat(value)).toBe('500B value'); + expect(yAxis[0].tickFormatter(value)).toBe(value); }); - test('should be percent for three percent formatted series', () => { - const timeSeriesProps = setupTimeSeriesPropsWithFormatters('percent', 'percent', 'percent'); + test('should return percent formatted value from yAxis formatter and three percent formatted series with the same value templates', () => { + const timeSeriesProps = setupTimeSeriesProps(['percent', 'percent', 'percent']); const yAxisFormattedValue = timeSeriesProps.yAxis[0].tickFormatter(value); const firstSeriesFormattedValue = timeSeriesProps.series[0].tickFormat(value); @@ -106,5 +140,56 @@ describe('TimeseriesVisualization', () => { expect(firstSeriesFormattedValue).toBe('50000%'); expect(yAxisFormattedValue).toBe(firstSeriesFormattedValue); }); + + test('should return simple number from yAxis formatter and different values for the same value templates, but with different formatters', () => { + const timeSeriesProps = setupTimeSeriesProps( + ['number', 'byte'], + ['{{value}} template', '{{value}} template'] + ); + const { series, yAxis } = timeSeriesProps; + + expect(series[0].tickFormat(value)).toBe('500 template'); + expect(series[1].tickFormat(value)).toBe('500B template'); + expect(yAxis[0].tickFormatter(value)).toBe(value); + }); + + test('should return field formatted value for yAxis and single series with default formatter', () => { + const timeSeriesProps = setupTimeSeriesProps(['default']); + const { series, yAxis } = timeSeriesProps; + + expect(series[0].tickFormat(value)).toBe('500 years'); + expect(yAxis[0].tickFormatter(value)).toBe('500 years'); + }); + + test('should return custom field formatted value for yAxis and both series having same fieldFormats', () => { + const timeSeriesProps = setupTimeSeriesProps(['default', 'default']); + const { series, yAxis } = timeSeriesProps; + + expect(series[0].tickFormat(value)).toBe('500 years'); + expect(series[1].tickFormat(value)).toBe('500 years'); + expect(yAxis[0].tickFormatter(value)).toBe('500 years'); + }); + + test('should return simple number from yAxis formatter and default formatted values for series', () => { + const timeSeriesProps = setupTimeSeriesProps(['default', 'default', 'default', 'default']); + const { series, yAxis } = timeSeriesProps; + + expect(series[0].tickFormat(value)).toBe('500 years'); + expect(series[1].tickFormat(value)).toBe('500 years'); + expect(series[2].tickFormat(value)).toBe('42 years'); + expect(series[3].tickFormat(value)).toBe('$500'); + expect(yAxis[0].tickFormatter(value)).toBe(value); + }); + + test('should return simple number from yAxis formatter and correctly formatted series values', () => { + const timeSeriesProps = setupTimeSeriesProps(['default', 'byte', 'percent', 'default']); + const { series, yAxis } = timeSeriesProps; + + expect(series[0].tickFormat(value)).toBe('500 years'); + expect(series[1].tickFormat(value)).toBe('500B'); + expect(series[2].tickFormat(value)).toBe('50000%'); + expect(series[3].tickFormat(value)).toBe('$500'); + expect(yAxis[0].tickFormatter(value)).toBe(value); + }); }); }); diff --git a/src/plugins/vis_type_timeseries/public/application/components/vis_types/top_n/vis.js b/src/plugins/vis_type_timeseries/public/application/components/vis_types/top_n/vis.js index 0b3a24615c0e3..8176f6ece2805 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/vis_types/top_n/vis.js +++ b/src/plugins/vis_type_timeseries/public/application/components/vis_types/top_n/vis.js @@ -7,7 +7,9 @@ */ import { getCoreStart } from '../../../../services'; +import { getMetricsField } from '../../lib/get_metrics_field'; import { createTickFormatter } from '../../lib/tick_formatter'; +import { createFieldFormatter } from '../../lib/create_field_formatter'; import { TopN } from '../../../visualizations/views/top_n'; import { getLastValue } from '../../../../../common/last_value_utils'; import { isBackgroundInverted } from '../../../lib/set_is_reversed'; @@ -15,6 +17,7 @@ import { replaceVars } from '../../lib/replace_vars'; import PropTypes from 'prop-types'; import React from 'react'; import { sortBy, first, get } from 'lodash'; +import { DATA_FORMATTERS } from '../../../../../common/enums'; import { getOperator, shouldOperate } from '../../../../../common/operators_utils'; function sortByDirection(data, direction, fn) { @@ -38,17 +41,17 @@ function sortSeries(visData, model) { } function TopNVisualization(props) { - const { backgroundColor, model, visData } = props; + const { backgroundColor, model, visData, fieldFormatMap, getConfig } = props; const series = sortSeries(visData, model).map((item) => { const id = first(item.id.split(/:/)); const seriesConfig = model.series.find((s) => s.id === id); if (seriesConfig) { - const tickFormatter = createTickFormatter( - seriesConfig.formatter, - seriesConfig.value_template, - props.getConfig - ); + const tickFormatter = + seriesConfig.formatter === DATA_FORMATTERS.DEFAULT + ? createFieldFormatter(getMetricsField(seriesConfig.metrics), fieldFormatMap, 'html') + : createTickFormatter(seriesConfig.formatter, seriesConfig.value_template, getConfig); + const value = getLastValue(item.data); let color = item.color || seriesConfig.color; if (model.bar_color_rules) { diff --git a/src/plugins/vis_type_timeseries/public/application/components/vis_with_splits.js b/src/plugins/vis_type_timeseries/public/application/components/vis_with_splits.js index 945a7ac986d3e..b8ce63bd35dca 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/vis_with_splits.js +++ b/src/plugins/vis_type_timeseries/public/application/components/vis_with_splits.js @@ -7,6 +7,7 @@ */ import React, { useCallback } from 'react'; +import classNames from 'classnames'; import { getDisplayName } from './lib/get_display_name'; import { labelDateFormatter } from './lib/label_date_formatter'; import { findIndex, first } from 'lodash'; @@ -15,7 +16,7 @@ import { getSplitByTermsColor } from '../lib/get_split_by_terms_color'; export function visWithSplits(WrappedComponent) { function SplitVisComponent(props) { - const { model, visData, syncColors, palettesService } = props; + const { model, visData, syncColors, palettesService, fieldFormatMap } = props; const getSeriesColor = useCallback( (seriesName, seriesId, baseColor) => { @@ -34,14 +35,14 @@ export function visWithSplits(WrappedComponent) { seriesPalette: palette, palettesRegistry: palettesService, syncColors, + fieldFormatMap, }; return getSplitByTermsColor(props) || null; }, - [model, palettesService, syncColors, visData] + [fieldFormatMap, model.id, model.series, palettesService, syncColors, visData] ); - if (!model || !visData || !visData[model.id] || visData[model.id].series.length === 1) - return ; + if (!model || !visData || !visData[model.id]) return ; if (visData[model.id].series.every((s) => s.id.split(':').length === 1)) { return ; } @@ -114,12 +115,17 @@ export function visWithSplits(WrappedComponent) { additionalLabel={getValueOrEmpty(additionalLabel)} backgroundColor={props.backgroundColor} getConfig={props.getConfig} + fieldFormatMap={props.fieldFormatMap} />
); }); - return
{rows}
; + const hasOneVis = visData[model.id].series.length === 1; + + return ( +
{rows}
+ ); } SplitVisComponent.displayName = `SplitVisComponent(${getDisplayName(WrappedComponent)})`; diff --git a/src/plugins/vis_type_timeseries/public/application/editor_controller.tsx b/src/plugins/vis_type_timeseries/public/application/editor_controller.tsx index 844dca039cf62..2f5ee2b8a631d 100644 --- a/src/plugins/vis_type_timeseries/public/application/editor_controller.tsx +++ b/src/plugins/vis_type_timeseries/public/application/editor_controller.tsx @@ -26,7 +26,7 @@ export class EditorController implements IEditorController { private embeddableHandler: VisualizeEmbeddableContract ) {} - render({ timeRange, uiState }: EditorRenderProps) { + render({ timeRange, uiState, filters, query }: EditorRenderProps) { const I18nContext = getI18n().Context; render( @@ -38,6 +38,8 @@ export class EditorController implements IEditorController { embeddableHandler={this.embeddableHandler} eventEmitter={this.eventEmitter} uiState={uiState} + filters={filters} + query={query} /> , this.el diff --git a/src/plugins/vis_type_timeseries/public/application/visualizations/views/_gauge.scss b/src/plugins/vis_type_timeseries/public/application/visualizations/views/_gauge.scss index 7f3c049a131d2..fdab7f02957e0 100644 --- a/src/plugins/vis_type_timeseries/public/application/visualizations/views/_gauge.scss +++ b/src/plugins/vis_type_timeseries/public/application/visualizations/views/_gauge.scss @@ -47,6 +47,8 @@ font-size: .9em; /* 1 */ line-height: 1em; /* 1 */ text-align: center; + // make gauge value the target for pointer-events + pointer-events: all; .tvbVisGauge--reversed & { color: $tvbValueColorReversed; @@ -71,4 +73,6 @@ display: flex; flex-direction: column; flex: 1 0 auto; + // disable gauge container pointer-events as it shouldn't be event target + pointer-events: none; } diff --git a/src/plugins/vis_type_timeseries/public/application/visualizations/views/gauge.js b/src/plugins/vis_type_timeseries/public/application/visualizations/views/gauge.js index 723a054baeeae..ca5021a882932 100644 --- a/src/plugins/vis_type_timeseries/public/application/visualizations/views/gauge.js +++ b/src/plugins/vis_type_timeseries/public/application/visualizations/views/gauge.js @@ -117,7 +117,8 @@ export class Gauge extends Component { ref="label" data-test-subj="gaugeValue" > - {formatter(value)} + {/* eslint-disable-next-line react/no-danger */} +
{additionalLabel}
@@ -135,7 +136,8 @@ export class Gauge extends Component { ref="label" data-test-subj="gaugeValue" > - {formatter(value)} + {/* eslint-disable-next-line react/no-danger */} +
{title} diff --git a/src/plugins/vis_type_timeseries/public/application/visualizations/views/metric.js b/src/plugins/vis_type_timeseries/public/application/visualizations/views/metric.js index bc4230d0a15ef..0ceb2daa831be 100644 --- a/src/plugins/vis_type_timeseries/public/application/visualizations/views/metric.js +++ b/src/plugins/vis_type_timeseries/public/application/visualizations/views/metric.js @@ -101,7 +101,8 @@ export class Metric extends Component {
{secondaryLabel}
- {secondaryValue} + {/* eslint-disable-next-line react/no-danger */} +
); @@ -132,7 +133,8 @@ export class Metric extends Component { data-test-subj="tsvbMetricValue" className="tvbVisMetric__value--primary" > - {primaryValue} + {/* eslint-disable-next-line react/no-danger */} +
{secondarySnippet} diff --git a/src/plugins/vis_type_timeseries/public/application/visualizations/views/timeseries/index.js b/src/plugins/vis_type_timeseries/public/application/visualizations/views/timeseries/index.js index b470352eec56a..35f0118cc8525 100644 --- a/src/plugins/vis_type_timeseries/public/application/visualizations/views/timeseries/index.js +++ b/src/plugins/vis_type_timeseries/public/application/visualizations/views/timeseries/index.js @@ -141,6 +141,7 @@ export const TimeSeries = ({ debugState={window._echDebugStateFlag ?? false} showLegend={legend} showLegendExtra={true} + allowBrushingLastHistogramBucket={true} legendPosition={legendPosition} onBrushEnd={onBrushEndListener} onElementClick={(args) => handleElementClick(args)} diff --git a/src/plugins/vis_type_timeseries/public/application/visualizations/views/top_n.js b/src/plugins/vis_type_timeseries/public/application/visualizations/views/top_n.js index 72b2c7ce34fd8..aaec701a42eea 100644 --- a/src/plugins/vis_type_timeseries/public/application/visualizations/views/top_n.js +++ b/src/plugins/vis_type_timeseries/public/application/visualizations/views/top_n.js @@ -139,7 +139,8 @@ export class TopN extends Component { - {formatter(lastValue)} + {/* eslint-disable-next-line react/no-danger */} + ); diff --git a/src/plugins/vis_type_timeseries/public/metrics_type.ts b/src/plugins/vis_type_timeseries/public/metrics_type.ts index b68812b9828e3..5d4a61c1edb82 100644 --- a/src/plugins/vis_type_timeseries/public/metrics_type.ts +++ b/src/plugins/vis_type_timeseries/public/metrics_type.ts @@ -77,7 +77,7 @@ export const metricsVisDefinition: VisTypeDefinition< ], separate_axis: 0, axis_position: 'right', - formatter: 'number', + formatter: 'default', chart_type: 'line', line_width: 1, point_size: 1, @@ -105,8 +105,8 @@ export const metricsVisDefinition: VisTypeDefinition< editor: TSVB_EDITOR_NAME, }, options: { - showQueryBar: false, - showFilterBar: false, + showQueryBar: true, + showFilterBar: true, showIndexSelection: false, }, toExpressionAst, @@ -117,6 +117,7 @@ export const metricsVisDefinition: VisTypeDefinition< return []; }, inspectorAdapters: {}, + requiresSearch: true, getUsedIndexPattern: async (params: VisParams) => { const { indexPatterns } = getDataStart(); const indexPatternValue = params.index_pattern; diff --git a/src/plugins/vis_type_timeseries/public/timeseries_vis_renderer.tsx b/src/plugins/vis_type_timeseries/public/timeseries_vis_renderer.tsx index 3f324fcfc2f20..9a19ddc285ebb 100644 --- a/src/plugins/vis_type_timeseries/public/timeseries_vis_renderer.tsx +++ b/src/plugins/vis_type_timeseries/public/timeseries_vis_renderer.tsx @@ -13,11 +13,12 @@ import { render, unmountComponentAtNode } from 'react-dom'; import { I18nProvider } from '@kbn/i18n/react'; import { IUiSettingsClient } from 'kibana/public'; +import { fetchIndexPattern } from '../common/index_patterns_utils'; import { VisualizationContainer, PersistedState } from '../../visualizations/public'; import type { TimeseriesVisData } from '../common/types'; import { isVisTableData } from '../common/vis_data_utils'; -import { getCharts } from './services'; +import { getCharts, getDataStart } from './services'; import type { TimeseriesVisParams } from './types'; import type { ExpressionRenderDefinition } from '../../expressions/common'; @@ -49,9 +50,15 @@ export const getTimeseriesVisRenderer: (deps: { handlers.onDestroy(() => { unmountComponentAtNode(domNode); }); + const { visParams: model, visData, syncColors } = config; const { palettes } = getCharts(); - const showNoResult = !checkIfDataExists(config.visData, config.visParams); - const palettesService = await palettes.getPalettes(); + const { indexPatterns } = getDataStart(); + + const showNoResult = !checkIfDataExists(visData, model); + const [palettesService, { indexPattern }] = await Promise.all([ + palettes.getPalettes(), + fetchIndexPattern(model.index_pattern, indexPatterns), + ]); render( @@ -59,15 +66,16 @@ export const getTimeseriesVisRenderer: (deps: { data-test-subj="timeseriesVis" handlers={handlers} showNoResult={showNoResult} - error={get(config.visData, [config.visParams.id, 'error'])} + error={get(visData, [model.id, 'error'])} > diff --git a/src/plugins/vis_type_timeseries/server/lib/get_vis_data.ts b/src/plugins/vis_type_timeseries/server/lib/get_vis_data.ts index 817812a88ca98..bc4fbf9159a00 100644 --- a/src/plugins/vis_type_timeseries/server/lib/get_vis_data.ts +++ b/src/plugins/vis_type_timeseries/server/lib/get_vis_data.ts @@ -30,6 +30,7 @@ export async function getVisData( ): Promise { const uiSettings = requestContext.core.uiSettings.client; const esShardTimeout = await framework.getEsShardTimeout(); + const fieldFormatService = await framework.getFieldFormatsService(uiSettings); const indexPatternsService = await framework.getIndexPatternsService(requestContext); const esQueryConfig = await getEsQueryConfig(uiSettings); @@ -40,6 +41,7 @@ export async function getVisData( const services: VisTypeTimeseriesRequestServices = { esQueryConfig, esShardTimeout, + fieldFormatService, indexPatternsService, uiSettings, cachedIndexPatternFetcher, diff --git a/src/plugins/vis_type_timeseries/server/lib/search_strategies/capabilities/default_search_capabilities.test.ts b/src/plugins/vis_type_timeseries/server/lib/search_strategies/capabilities/default_search_capabilities.test.ts index 8029e8684c441..351691d4c42a3 100644 --- a/src/plugins/vis_type_timeseries/server/lib/search_strategies/capabilities/default_search_capabilities.test.ts +++ b/src/plugins/vis_type_timeseries/server/lib/search_strategies/capabilities/default_search_capabilities.test.ts @@ -7,12 +7,14 @@ */ import { DefaultSearchCapabilities } from './default_search_capabilities'; +import type { Panel } from '../../../../common/types'; describe('DefaultSearchCapabilities', () => { let defaultSearchCapabilities: DefaultSearchCapabilities; beforeEach(() => { defaultSearchCapabilities = new DefaultSearchCapabilities({ + panel: {} as Panel, timezone: 'UTC', maxBucketsLimit: 2000, }); diff --git a/src/plugins/vis_type_timeseries/server/lib/search_strategies/capabilities/default_search_capabilities.ts b/src/plugins/vis_type_timeseries/server/lib/search_strategies/capabilities/default_search_capabilities.ts index b60d2e61e9a43..0240ac93b60e8 100644 --- a/src/plugins/vis_type_timeseries/server/lib/search_strategies/capabilities/default_search_capabilities.ts +++ b/src/plugins/vis_type_timeseries/server/lib/search_strategies/capabilities/default_search_capabilities.ts @@ -13,19 +13,30 @@ import { getSuitableUnit, } from '../../vis_data/helpers/unit_to_seconds'; import { RESTRICTIONS_KEYS } from '../../../../common/ui_restrictions'; +import { + TIME_RANGE_DATA_MODES, + PANEL_TYPES, + BUCKET_TYPES, + TSVB_METRIC_TYPES, +} from '../../../../common/enums'; +import { getAggsByType, AGG_TYPE } from '../../../../common/agg_utils'; +import type { Panel } from '../../../../common/types'; export interface SearchCapabilitiesOptions { timezone?: string; maxBucketsLimit: number; + panel?: Panel; } export class DefaultSearchCapabilities { public timezone: SearchCapabilitiesOptions['timezone']; public maxBucketsLimit: SearchCapabilitiesOptions['maxBucketsLimit']; + public panel?: Panel; constructor(options: SearchCapabilitiesOptions) { this.timezone = options.timezone; this.maxBucketsLimit = options.maxBucketsLimit; + this.panel = options.panel; } public get defaultTimeInterval() { @@ -33,6 +44,28 @@ export class DefaultSearchCapabilities { } public get whiteListedMetrics() { + if ( + this.panel && + this.panel.type !== PANEL_TYPES.TIMESERIES && + this.panel.time_range_mode === TIME_RANGE_DATA_MODES.ENTIRE_TIME_RANGE + ) { + const aggs = getAggsByType((agg) => agg.id); + const allAvailableAggs = [ + ...aggs[AGG_TYPE.METRIC], + ...aggs[AGG_TYPE.SIBLING_PIPELINE], + TSVB_METRIC_TYPES.MATH, + BUCKET_TYPES.TERMS, + ].reduce( + (availableAggs, aggType) => ({ + ...availableAggs, + [aggType]: { + '*': true, + }, + }), + {} + ); + return this.createUiRestriction(allAvailableAggs); + } return this.createUiRestriction(); } diff --git a/src/plugins/vis_type_timeseries/server/lib/search_strategies/capabilities/rollup_search_capabilities.test.ts b/src/plugins/vis_type_timeseries/server/lib/search_strategies/capabilities/rollup_search_capabilities.test.ts index 7426c74dc2426..e1cc1f1f26eb2 100644 --- a/src/plugins/vis_type_timeseries/server/lib/search_strategies/capabilities/rollup_search_capabilities.test.ts +++ b/src/plugins/vis_type_timeseries/server/lib/search_strategies/capabilities/rollup_search_capabilities.test.ts @@ -7,6 +7,7 @@ */ import { Unit } from '@elastic/datemath'; +import type { Panel } from '../../../../common/types'; import { RollupSearchCapabilities } from './rollup_search_capabilities'; describe('Rollup Search Capabilities', () => { @@ -32,7 +33,7 @@ describe('Rollup Search Capabilities', () => { }; rollupSearchCaps = new RollupSearchCapabilities( - { maxBucketsLimit: 2000, timezone: 'UTC' }, + { maxBucketsLimit: 2000, timezone: 'UTC', panel: {} as Panel }, fieldsCapabilities, rollupIndex ); diff --git a/src/plugins/vis_type_timeseries/server/lib/search_strategies/search_strategies_registry.test.ts b/src/plugins/vis_type_timeseries/server/lib/search_strategies/search_strategies_registry.test.ts index f6114a4117bb8..7f5f12602998f 100644 --- a/src/plugins/vis_type_timeseries/server/lib/search_strategies/search_strategies_registry.test.ts +++ b/src/plugins/vis_type_timeseries/server/lib/search_strategies/search_strategies_registry.test.ts @@ -52,7 +52,7 @@ describe('SearchStrategyRegister', () => { }); test('should return a DefaultSearchStrategy instance', async () => { - const req = { body: {} } as VisTypeTimeseriesRequest; + const req = { body: { panels: [] } } as VisTypeTimeseriesRequest; const { searchStrategy, capabilities } = (await registry.getViableStrategy( requestContext, @@ -73,7 +73,7 @@ describe('SearchStrategyRegister', () => { }); test('should return a MockSearchStrategy instance', async () => { - const req = { body: {} } as VisTypeTimeseriesRequest; + const req = { body: { panels: [] } } as VisTypeTimeseriesRequest; const anotherSearchStrategy = new MockSearchStrategy(); registry.addStrategy(anotherSearchStrategy); diff --git a/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.test.ts b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.test.ts index 9fa79c7b80f8c..3638a438ec736 100644 --- a/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.test.ts +++ b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.test.ts @@ -27,9 +27,11 @@ describe('DefaultSearchStrategy', () => { let req: VisTypeTimeseriesVisDataRequest; beforeEach(() => { - req = { - body: {}, - } as VisTypeTimeseriesVisDataRequest; + req = ({ + body: { + panels: [], + }, + } as unknown) as VisTypeTimeseriesVisDataRequest; defaultSearchStrategy = new DefaultSearchStrategy(); }); @@ -46,6 +48,7 @@ describe('DefaultSearchStrategy', () => { expect(value.capabilities).toMatchInlineSnapshot(` DefaultSearchCapabilities { "maxBucketsLimit": undefined, + "panel": undefined, "timezone": undefined, } `); diff --git a/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts index 17451f7e5777e..34892ec797c0b 100644 --- a/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts +++ b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts @@ -27,6 +27,7 @@ export class DefaultSearchStrategy extends AbstractSearchStrategy { return { isViable: true, capabilities: new DefaultSearchCapabilities({ + panel: req.body.panels ? req.body.panels[0] : null, timezone: req.body.timerange?.timezone, maxBucketsLimit: await uiSettings.get(MAX_BUCKETS_SETTING), }), diff --git a/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts index 0ac00863d0a73..7a1d1574aa7bb 100644 --- a/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts +++ b/src/plugins/vis_type_timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts @@ -74,6 +74,7 @@ export class RollupSearchStrategy extends AbstractSearchStrategy { capabilities = new RollupSearchCapabilities( { maxBucketsLimit: await uiSettings.get(MAX_BUCKETS_SETTING), + panel: req.body.panels ? req.body.panels[0] : null, }, fieldsCapabilities, rollupIndex diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/get_series_data.ts b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_series_data.ts index 8d495d68eb625..a9a3825f5a9df 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/get_series_data.ts +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_series_data.ts @@ -13,6 +13,8 @@ import { getAnnotations } from './get_annotations'; import { handleResponseBody } from './series/handle_response_body'; import { getSeriesRequestParams } from './series/get_request_params'; import { getActiveSeries } from './helpers/get_active_series'; +import { isAggSupported } from './helpers/check_aggs'; +import { isEntireTimeRangeMode } from './helpers/get_timerange_mode'; import type { VisTypeTimeseriesRequestHandlerContext, VisTypeTimeseriesVisDataRequest, @@ -27,13 +29,16 @@ export async function getSeriesData( panel: Panel, services: VisTypeTimeseriesRequestServices ) { - const panelIndex = await services.cachedIndexPatternFetcher(panel.index_pattern); + const { + cachedIndexPatternFetcher, + searchStrategyRegistry, + indexPatternsService, + fieldFormatService, + } = services; - const strategy = await services.searchStrategyRegistry.getViableStrategy( - requestContext, - req, - panelIndex - ); + const panelIndex = await cachedIndexPatternFetcher(panel.index_pattern); + + const strategy = await searchStrategyRegistry.getViableStrategy(requestContext, req, panelIndex); if (!strategy) { throw new Error( @@ -52,19 +57,30 @@ export async function getSeriesData( const handleError = handleErrorResponse(panel); try { - const bodiesPromises = getActiveSeries(panel).map((series) => - getSeriesRequestParams(req, panel, panelIndex, series, capabilities, services) - ); + const bodiesPromises = getActiveSeries(panel).map((series) => { + if (isEntireTimeRangeMode(panel, series)) { + isAggSupported(series.metrics); + } - const searches = await Promise.all(bodiesPromises); - const data = await searchStrategy.search(requestContext, req, searches); + return getSeriesRequestParams(req, panel, panelIndex, series, capabilities, services); + }); - const handleResponseBodyFn = handleResponseBody(panel, req, { - indexPatternsService: services.indexPatternsService, - cachedIndexPatternFetcher: services.cachedIndexPatternFetcher, + const fieldFetchServices = { + indexPatternsService, + cachedIndexPatternFetcher, searchStrategy, capabilities, - }); + }; + + const handleResponseBodyFn = handleResponseBody( + panel, + req, + fieldFetchServices, + fieldFormatService + ); + + const searches = await Promise.all(bodiesPromises); + const data = await searchStrategy.search(requestContext, req, searches); const series = await Promise.all( data.map( diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/get_table_data.ts b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_table_data.ts index 7e1332f801856..3b53147dc6f93 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/get_table_data.ts +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_table_data.ts @@ -15,6 +15,8 @@ import { processBucket } from './table/process_bucket'; import { createFieldsFetcher } from '../search_strategies/lib/fields_fetcher'; import { extractFieldLabel } from '../../../common/fields_utils'; +import { isAggSupported } from './helpers/check_aggs'; +import { isEntireTimeRangeMode } from './helpers/get_timerange_mode'; import type { VisTypeTimeseriesRequestHandlerContext, @@ -71,6 +73,12 @@ export async function getTableData( const handleError = handleErrorResponse(panel); try { + if (isEntireTimeRangeMode(panel)) { + panel.series.forEach((column) => { + isAggSupported(column.metrics); + }); + } + const body = await buildTableRequest({ req, panel, diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/check_aggs.ts b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/check_aggs.ts new file mode 100644 index 0000000000000..bc420045dd434 --- /dev/null +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/check_aggs.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 { AggNotSupportedInMode } from '../../../../common/errors'; +import { getAggsByType, AGG_TYPE } from '../../../../common/agg_utils'; +import { TSVB_METRIC_TYPES, TIME_RANGE_DATA_MODES } from '../../../../common/enums'; +import { Metric } from '../../../../common/types'; + +export function isAggSupported(metrics: Metric[]) { + const parentPipelineAggs = getAggsByType((agg) => agg.id)[AGG_TYPE.PARENT_PIPELINE]; + const metricTypes = metrics.filter( + (metric) => + parentPipelineAggs.includes(metric.type) || metric.type === TSVB_METRIC_TYPES.SERIES_AGG + ); + + if (metricTypes.length) { + throw new AggNotSupportedInMode( + metricTypes.map((metric) => metric.type).join(', '), + TIME_RANGE_DATA_MODES.ENTIRE_TIME_RANGE + ); + } +} diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/index.ts b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/index.ts index 41d302422c0b7..7dfecc9811dd9 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/index.ts +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/index.ts @@ -15,6 +15,7 @@ export { getBucketsPath } from './get_buckets_path'; export { isEntireTimeRangeMode, isLastValueTimerangeMode } from './get_timerange_mode'; export { getLastMetric } from './get_last_metric'; export { getSplits } from './get_splits'; +export { isAggSupported } from './check_aggs'; // @ts-expect-error no typed yet export { bucketTransform } from './bucket_transform'; diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.js index cec3e82d5e37c..6349a75993aa8 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.js +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.js @@ -11,6 +11,8 @@ import { getBucketSize } from '../../helpers/get_bucket_size'; import { offsetTime } from '../../offset_time'; import { isLastValueTimerangeMode } from '../../helpers/get_timerange_mode'; import { search, UI_SETTINGS } from '../../../../../../../plugins/data/server'; +import { AGG_TYPE, getAggsByType } from '../../../../../common/agg_utils'; +import { TSVB_METRIC_TYPES } from '../../../../../common/enums'; const { dateHistogramInterval } = search.aggs; @@ -30,19 +32,17 @@ export function dateHistogram( const { timeField, interval, maxBars } = await buildSeriesMetaParams(); const { from, to } = offsetTime(req, series.offset_time); + const { timezone } = capabilities; + const { intervalString } = getBucketSize( + req, + interval, + capabilities, + maxBars ? Math.min(maxBarsUiSettings, maxBars) : barTargetUiSettings + ); let bucketInterval; const overwriteDateHistogramForLastBucketMode = () => { - const { timezone } = capabilities; - - const { intervalString } = getBucketSize( - req, - interval, - capabilities, - maxBars ? Math.min(maxBarsUiSettings, maxBars) : barTargetUiSettings - ); - overwrite(doc, `aggs.${series.id}.aggs.timeseries.date_histogram`, { field: timeField, min_doc_count: 0, @@ -58,12 +58,35 @@ export function dateHistogram( }; const overwriteDateHistogramForEntireTimerangeMode = () => { - overwrite(doc, `aggs.${series.id}.aggs.timeseries.auto_date_histogram`, { + const metricAggs = getAggsByType((agg) => agg.id)[AGG_TYPE.METRIC]; + + // we should use auto_date_histogram only for metric aggregations and math + if ( + series.metrics.every( + (metric) => metricAggs.includes(metric.type) || metric.type === TSVB_METRIC_TYPES.MATH + ) + ) { + overwrite(doc, `aggs.${series.id}.aggs.timeseries.auto_date_histogram`, { + field: timeField, + buckets: 1, + }); + + bucketInterval = `${to.valueOf() - from.valueOf()}ms`; + return; + } + + overwrite(doc, `aggs.${series.id}.aggs.timeseries.date_histogram`, { field: timeField, - buckets: 1, + min_doc_count: 0, + time_zone: timezone, + extended_bounds: { + min: from.valueOf(), + max: to.valueOf(), + }, + ...dateHistogramInterval(intervalString), }); - bucketInterval = `${to.valueOf() - from.valueOf()}ms`; + bucketInterval = intervalString; }; isLastValueTimerangeMode(panel, series) diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.test.js index 022718ece435d..b09b2c28d77e3 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.test.js +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.test.js @@ -36,7 +36,7 @@ describe('dateHistogram(req, panel, series)', () => { interval: '10s', id: 'panelId', }; - series = { id: 'test' }; + series = { id: 'test', metrics: [{ type: 'avg' }] }; config = { allowLeadingWildcards: true, queryStringOptions: {}, diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/date_histogram.ts b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/date_histogram.ts index ac19a266430f3..27470d5868a5c 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/date_histogram.ts +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/date_histogram.ts @@ -9,6 +9,8 @@ import { overwrite, getBucketSize, isLastValueTimerangeMode, getTimerange } from '../../helpers'; import { calculateAggRoot } from './calculate_agg_root'; import { search, UI_SETTINGS } from '../../../../../../../plugins/data/server'; +import { AGG_TYPE, getAggsByType } from '../../../../../common/agg_utils'; +import { TSVB_METRIC_TYPES } from '../../../../../common/enums'; import type { TableRequestProcessorsFunction, TableSearchRequestMeta } from './types'; @@ -32,10 +34,10 @@ export const dateHistogram: TableRequestProcessorsFunction = ({ panelId: panel.id, }; - const overwriteDateHistogramForLastBucketMode = () => { - const { intervalString } = getBucketSize(req, interval, capabilities, barTargetUiSettings); - const { timezone } = capabilities; + const { intervalString } = getBucketSize(req, interval, capabilities, barTargetUiSettings); + const { timezone } = capabilities; + const overwriteDateHistogramForLastBucketMode = () => { panel.series.forEach((column) => { const aggRoot = calculateAggRoot(doc, column); @@ -58,19 +60,41 @@ export const dateHistogram: TableRequestProcessorsFunction = ({ }; const overwriteDateHistogramForEntireTimerangeMode = () => { - const intervalString = `${to.valueOf() - from.valueOf()}ms`; + const metricAggs = getAggsByType((agg) => agg.id)[AGG_TYPE.METRIC]; + let bucketInterval; panel.series.forEach((column) => { const aggRoot = calculateAggRoot(doc, column); - overwrite(doc, `${aggRoot}.timeseries.auto_date_histogram`, { - field: timeField, - buckets: 1, - }); + // we should use auto_date_histogram only for metric aggregations and math + if ( + column.metrics.every( + (metric) => metricAggs.includes(metric.type) || metric.type === TSVB_METRIC_TYPES.MATH + ) + ) { + overwrite(doc, `${aggRoot}.timeseries.auto_date_histogram`, { + field: timeField, + buckets: 1, + }); + + bucketInterval = `${to.valueOf() - from.valueOf()}ms`; + } else { + overwrite(doc, `${aggRoot}.timeseries.date_histogram`, { + field: timeField, + min_doc_count: 0, + time_zone: timezone, + extended_bounds: { + min: from.valueOf(), + max: to.valueOf(), + }, + ...dateHistogramInterval(intervalString), + }); + bucketInterval = intervalString; + } overwrite(doc, aggRoot.replace(/\.aggs$/, '.meta'), { ...meta, - intervalString, + intervalString: bucketInterval, }); }); }; diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/format_label.ts b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/format_label.ts new file mode 100644 index 0000000000000..7908cbccb9845 --- /dev/null +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/format_label.ts @@ -0,0 +1,55 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { KBN_FIELD_TYPES } from '@kbn/field-types'; +import { BUCKET_TYPES, PANEL_TYPES } from '../../../../../common/enums'; +import type { Panel, PanelData, Series } from '../../../../../common/types'; +import type { FieldFormatsRegistry } from '../../../../../../field_formats/common'; +import type { createFieldsFetcher } from '../../../search_strategies/lib/fields_fetcher'; +import type { CachedIndexPatternFetcher } from '../../../search_strategies/lib/cached_index_pattern_fetcher'; + +export function formatLabel( + resp: unknown, + panel: Panel, + series: Series, + meta: any, + extractFields: ReturnType, + fieldFormatService: FieldFormatsRegistry, + cachedIndexPatternFetcher: CachedIndexPatternFetcher +) { + return (next: (results: PanelData[]) => unknown) => async (results: PanelData[]) => { + const { terms_field: termsField, split_mode: splitMode } = series; + + const isKibanaIndexPattern = panel.use_kibana_indexes || panel.index_pattern === ''; + // no need to format labels for markdown as they also used there as variables keys + const shouldFormatLabels = + isKibanaIndexPattern && + termsField && + splitMode === BUCKET_TYPES.TERMS && + panel.type !== PANEL_TYPES.MARKDOWN; + + if (shouldFormatLabels) { + const { indexPattern } = await cachedIndexPatternFetcher({ id: meta.index }); + const getFieldFormatByName = (fieldName: string) => + fieldFormatService.deserialize(indexPattern?.fieldFormatMap?.[fieldName]); + + results + .filter(({ seriesId }) => series.id === seriesId) + .forEach((item) => { + const formattedLabel = getFieldFormatByName(termsField!).convert(item.label); + item.label = formattedLabel; + const termsFieldType = indexPattern?.fields.find(({ name }) => name === termsField)?.type; + if (termsFieldType === KBN_FIELD_TYPES.DATE) { + item.labelFormatted = formattedLabel; + } + }); + } + + return next(results); + }; +} diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/index.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/index.js index 71c3bdf5e5c23..68385bb5cbbe4 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/index.js +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/index.js @@ -17,6 +17,7 @@ import { stdSibling } from './std_sibling'; import { timeShift } from './time_shift'; import { dropLastBucket } from './drop_last_bucket'; import { mathAgg } from './math'; +import { formatLabel } from './format_label'; export const processors = [ percentile, @@ -29,4 +30,5 @@ export const processors = [ seriesAgg, timeShift, dropLastBucket, + formatLabel, ]; diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/series/handle_response_body.ts b/src/plugins/vis_type_timeseries/server/lib/vis_data/series/handle_response_body.ts index 6642fd8f5d79e..78e9f971a61dd 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/series/handle_response_body.ts +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/series/handle_response_body.ts @@ -17,11 +17,13 @@ import { FieldsFetcherServices, } from '../../search_strategies/lib/fields_fetcher'; import { VisTypeTimeseriesVisDataRequest } from '../../../types'; +import type { FieldFormatsRegistry } from '../../../../../field_formats/common'; export function handleResponseBody( panel: Panel, req: VisTypeTimeseriesVisDataRequest, - services: FieldsFetcherServices + services: FieldsFetcherServices, + fieldFormatService: FieldFormatsRegistry ) { return async (resp: any) => { if (resp.error) { @@ -55,7 +57,9 @@ export function handleResponseBody( panel, series, meta, - extractFields + extractFields, + fieldFormatService, + services.cachedIndexPatternFetcher ); return await processor([]); diff --git a/src/plugins/vis_type_timeseries/server/plugin.ts b/src/plugins/vis_type_timeseries/server/plugin.ts index 58cd58c812e4d..d2ecb07c0273d 100644 --- a/src/plugins/vis_type_timeseries/server/plugin.ts +++ b/src/plugins/vis_type_timeseries/server/plugin.ts @@ -13,6 +13,7 @@ import { Plugin, Logger, KibanaRequest, + IUiSettingsClient, } from 'src/core/server'; import { Observable } from 'rxjs'; import { Server } from '@hapi/hapi'; @@ -29,6 +30,7 @@ import type { VisTypeTimeseriesRequestHandlerContext, VisTypeTimeseriesVisDataRequest, } from './types'; +import type { FieldFormatsRegistry } from '../../field_formats/common'; import { SearchStrategyRegistry, @@ -70,6 +72,7 @@ export interface Framework { getIndexPatternsService: ( requestContext: VisTypeTimeseriesRequestHandlerContext ) => Promise; + getFieldFormatsService: (uiSettings: IUiSettingsClient) => Promise; getEsShardTimeout: () => Promise; } @@ -111,6 +114,11 @@ export class VisTypeTimeseriesPlugin implements Plugin { requestContext.core.elasticsearch.client.asCurrentUser ); }, + getFieldFormatsService: async (uiSettings) => { + const [, { data }] = await core.getStartServices(); + + return data.fieldFormats.fieldFormatServiceFactory(uiSettings); + }, }; searchStrategyRegistry.addStrategy(new DefaultSearchStrategy()); diff --git a/src/plugins/vis_type_timeseries/server/types.ts b/src/plugins/vis_type_timeseries/server/types.ts index 11131f33e4a1c..40ced72933012 100644 --- a/src/plugins/vis_type_timeseries/server/types.ts +++ b/src/plugins/vis_type_timeseries/server/types.ts @@ -11,6 +11,7 @@ import { EsQueryConfig } from '@kbn/es-query'; import { SharedGlobalConfig } from 'kibana/server'; import type { IRouter, IUiSettingsClient, KibanaRequest } from 'src/core/server'; import type { DataRequestHandlerContext, IndexPatternsService } from '../../data/server'; +import type { FieldFormatsRegistry } from '../../field_formats/common'; import type { Series, VisPayload } from '../common/types'; import type { SearchStrategyRegistry } from './lib/search_strategies'; import type { CachedIndexPatternFetcher } from './lib/search_strategies/lib/cached_index_pattern_fetcher'; @@ -33,6 +34,7 @@ export interface VisTypeTimeseriesRequestServices { indexPatternsService: IndexPatternsService; searchStrategyRegistry: SearchStrategyRegistry; cachedIndexPatternFetcher: CachedIndexPatternFetcher; + fieldFormatService: FieldFormatsRegistry; buildSeriesMetaParams: ( index: FetchedIndexPattern, useKibanaIndexes: boolean, diff --git a/src/plugins/vis_type_vega/jest.config.js b/src/plugins/vis_type_vega/jest.config.js deleted file mode 100644 index c3e2ea5203364..0000000000000 --- a/src/plugins/vis_type_vega/jest.config.js +++ /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 and the Server Side Public License, v 1; you may 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/vis_type_vega'], -}; diff --git a/src/plugins/vis_type_vega/public/__snapshots__/vega_visualization.test.js.snap b/src/plugins/vis_type_vega/public/__snapshots__/vega_visualization.test.js.snap deleted file mode 100644 index c70c4406a34f2..0000000000000 --- a/src/plugins/vis_type_vega/public/__snapshots__/vega_visualization.test.js.snap +++ /dev/null @@ -1,7 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`VegaVisualizations VegaVisualization - basics should show vega graph (may fail in dev env) 1`] = `"
"`; - -exports[`VegaVisualizations VegaVisualization - basics should show vegalite graph and update on resize (may fail in dev env) 1`] = `"
  • \\"width\\" and \\"height\\" params are ignored because \\"autosize\\" is enabled. Set \\"autosize\\": \\"none\\" to disable
"`; - -exports[`VegaVisualizations VegaVisualization - basics should show vegalite graph and update on resize (may fail in dev env) 2`] = `"
  • \\"width\\" and \\"height\\" params are ignored because \\"autosize\\" is enabled. Set \\"autosize\\": \\"none\\" to disable
"`; diff --git a/src/plugins/vis_type_vega/public/plugin.ts b/src/plugins/vis_type_vega/public/plugin.ts deleted file mode 100644 index f935362d21604..0000000000000 --- a/src/plugins/vis_type_vega/public/plugin.ts +++ /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 and the Server Side Public License, v 1; you may not 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 } from '../../../core/public'; -import { Plugin as ExpressionsPublicPlugin } from '../../expressions/public'; -import { DataPublicPluginSetup, DataPublicPluginStart } from '../../data/public'; -import { VisualizationsSetup } from '../../visualizations/public'; -import { Setup as InspectorSetup } from '../../inspector/public'; - -import { - setNotifications, - setData, - setInjectedVars, - setUISettings, - setInjectedMetadata, - setMapServiceSettings, - setDocLinks, -} from './services'; - -import { createVegaFn } from './vega_fn'; -import { createVegaTypeDefinition } from './vega_type'; -import { IServiceSettings, MapsEmsPluginSetup } from '../../maps_ems/public'; -import { ConfigSchema } from '../config'; - -import { getVegaInspectorView } from './vega_inspector'; -import { getVegaVisRenderer } from './vega_vis_renderer'; -import { MapServiceSettings } from './vega_view/vega_map_view/map_service_settings'; - -/** @internal */ -export interface VegaVisualizationDependencies { - core: CoreSetup; - plugins: { - data: DataPublicPluginSetup; - }; - getServiceSettings: () => Promise; -} - -/** @internal */ -export interface VegaPluginSetupDependencies { - expressions: ReturnType; - visualizations: VisualizationsSetup; - inspector: InspectorSetup; - data: DataPublicPluginSetup; - mapsEms: MapsEmsPluginSetup; -} - -/** @internal */ -export interface VegaPluginStartDependencies { - data: DataPublicPluginStart; -} - -/** @internal */ -export class VegaPlugin implements Plugin { - initializerContext: PluginInitializerContext; - - constructor(initializerContext: PluginInitializerContext) { - this.initializerContext = initializerContext; - } - - public setup( - core: CoreSetup, - { inspector, data, expressions, visualizations, mapsEms }: VegaPluginSetupDependencies - ) { - setInjectedVars({ - enableExternalUrls: this.initializerContext.config.get().enableExternalUrls, - emsTileLayerId: core.injectedMetadata.getInjectedVar('emsTileLayerId', true), - }); - - setUISettings(core.uiSettings); - - setMapServiceSettings( - new MapServiceSettings(mapsEms.config, this.initializerContext.env.packageInfo.version) - ); - - const visualizationDependencies: Readonly = { - core, - plugins: { - data, - }, - getServiceSettings: mapsEms.getServiceSettings, - }; - - inspector.registerView(getVegaInspectorView({ uiSettings: core.uiSettings })); - - expressions.registerFunction(() => createVegaFn(visualizationDependencies)); - expressions.registerRenderer(getVegaVisRenderer(visualizationDependencies)); - - visualizations.createBaseVisualization(createVegaTypeDefinition()); - } - - public start(core: CoreStart, { data }: VegaPluginStartDependencies) { - setNotifications(core.notifications); - setData(data); - setInjectedMetadata(core.injectedMetadata); - setDocLinks(core.docLinks); - } -} diff --git a/src/plugins/vis_type_vega/public/services.ts b/src/plugins/vis_type_vega/public/services.ts deleted file mode 100644 index f67fe4794e783..0000000000000 --- a/src/plugins/vis_type_vega/public/services.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 and the Server Side Public License, v 1; you may not 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, NotificationsStart, IUiSettingsClient, DocLinksStart } from 'src/core/public'; - -import { DataPublicPluginStart } from '../../data/public'; -import { createGetterSetter } from '../../kibana_utils/public'; -import { MapServiceSettings } from './vega_view/vega_map_view/map_service_settings'; - -export const [getData, setData] = createGetterSetter('Data'); - -export const [getNotifications, setNotifications] = createGetterSetter( - 'Notifications' -); - -export const [getUISettings, setUISettings] = createGetterSetter('UISettings'); - -export const [getInjectedMetadata, setInjectedMetadata] = createGetterSetter< - CoreStart['injectedMetadata'] ->('InjectedMetadata'); - -export const [ - getMapServiceSettings, - setMapServiceSettings, -] = createGetterSetter('MapServiceSettings'); - -export const [getInjectedVars, setInjectedVars] = createGetterSetter<{ - enableExternalUrls: boolean; - emsTileLayerId: unknown; -}>('InjectedVars'); - -export const getEnableExternalUrls = () => getInjectedVars().enableExternalUrls; - -export const [getDocLinks, setDocLinks] = createGetterSetter('docLinks'); diff --git a/src/plugins/vis_type_vega/public/to_ast.ts b/src/plugins/vis_type_vega/public/to_ast.ts deleted file mode 100644 index 8f0bd952bc54e..0000000000000 --- a/src/plugins/vis_type_vega/public/to_ast.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { buildExpression, buildExpressionFunction } from '../../expressions/public'; -import { Vis } from '../../visualizations/public'; -import { VegaExpressionFunctionDefinition, VisParams } from './vega_fn'; - -export const toExpressionAst = (vis: Vis) => { - const vega = buildExpressionFunction('vega', { - spec: vis.params.spec, - }); - - const ast = buildExpression([vega]); - - return ast.toAst(); -}; diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/constants.ts b/src/plugins/vis_type_vega/public/vega_view/vega_map_view/constants.ts deleted file mode 100644 index 04957fda5b8ff..0000000000000 --- a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/constants.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { Style } from '@kbn/mapbox-gl'; -import { TMS_IN_YML_ID } from '../../../../maps_ems/public'; - -export const vegaLayerId = 'vega'; -export const userConfiguredLayerId = TMS_IN_YML_ID; -export const defaultMapConfig = { - maxZoom: 20, - minZoom: 0, - tileSize: 256, -}; - -export const defaultMabBoxStyle: Style = { - /** - * according to the MapBox documentation that value should be '8' - * @see (https://docs.mapbox.com/mapbox-gl-js/style-spec/root/#version) - */ - version: 8, - sources: {}, - layers: [], -}; - -export const defaultProjection = { - name: 'projection', - type: 'mercator', - scale: { signal: '512*pow(2,zoom)/2/PI' }, - rotate: [{ signal: '-longitude' }, 0, 0], - center: [0, { signal: 'latitude' }], - translate: [{ signal: 'width/2' }, { signal: 'height/2' }], - fit: false, -}; diff --git a/src/plugins/vis_type_vega/server/plugin.ts b/src/plugins/vis_type_vega/server/plugin.ts deleted file mode 100644 index b884dcd1a1d15..0000000000000 --- a/src/plugins/vis_type_vega/server/plugin.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 and the Server Side Public License, v 1; you may not 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 } from '../../../core/server'; -import { registerVegaUsageCollector } from './usage_collector'; -import { - ConfigObservable, - VisTypeVegaPluginSetupDependencies, - VisTypeVegaPluginSetup, - VisTypeVegaPluginStart, -} from './types'; - -export class VisTypeVegaPlugin implements Plugin { - private readonly config: ConfigObservable; - - constructor(initializerContext: PluginInitializerContext) { - this.config = initializerContext.config.legacy.globalConfig$; - } - - public setup(core: CoreSetup, { home, usageCollection }: VisTypeVegaPluginSetupDependencies) { - if (usageCollection) { - registerVegaUsageCollector(usageCollection, this.config, { home }); - } - return {}; - } - - public start(core: CoreStart) { - return {}; - } - public stop() {} -} diff --git a/src/plugins/vis_type_vega/server/types.ts b/src/plugins/vis_type_vega/server/types.ts deleted file mode 100644 index affd93dedb8ca..0000000000000 --- a/src/plugins/vis_type_vega/server/types.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { SharedGlobalConfig } from 'kibana/server'; -import { HomeServerPluginSetup } from '../../home/server'; -import { UsageCollectionSetup } from '../../usage_collection/server'; - -export type ConfigObservable = Observable; - -export interface VegaSavedObjectAttributes { - title: string; - type: string; - params: { - spec: string; - }; -} - -export interface VisTypeVegaPluginSetupDependencies { - usageCollection?: UsageCollectionSetup; - home?: HomeServerPluginSetup; -} - -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface VisTypeVegaPluginSetup {} -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface VisTypeVegaPluginStart {} diff --git a/src/plugins/vis_type_vega/tsconfig.json b/src/plugins/vis_type_vega/tsconfig.json deleted file mode 100644 index 62bdd0262b4a5..0000000000000 --- a/src/plugins/vis_type_vega/tsconfig.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true, - "strictNullChecks": false - }, - "include": [ - "server/**/*", - "public/**/*", - "*.ts", - // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 - "public/test_utils/vega_map_test.json" - ], - "references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../visualizations/tsconfig.json" }, - { "path": "../maps_ems/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, - { "path": "../inspector/tsconfig.json" }, - { "path": "../home/tsconfig.json" }, - { "path": "../usage_collection/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../vis_default_editor/tsconfig.json" }, - { "path": "../es_ui_shared/tsconfig.json" }, - ] -} diff --git a/src/plugins/vis_type_metric/config.ts b/src/plugins/vis_types/metric/config.ts similarity index 100% rename from src/plugins/vis_type_metric/config.ts rename to src/plugins/vis_types/metric/config.ts diff --git a/src/plugins/vis_types/metric/jest.config.js b/src/plugins/vis_types/metric/jest.config.js new file mode 100644 index 0000000000000..e6de1dd63b34d --- /dev/null +++ b/src/plugins/vis_types/metric/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/vis_types/metric'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_types/metric', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/vis_types/metric/{public,server}/**/*.{ts,tsx}'], +}; diff --git a/src/plugins/vis_type_metric/kibana.json b/src/plugins/vis_types/metric/kibana.json similarity index 100% rename from src/plugins/vis_type_metric/kibana.json rename to src/plugins/vis_types/metric/kibana.json diff --git a/src/plugins/vis_type_metric/public/__snapshots__/metric_vis_fn.test.ts.snap b/src/plugins/vis_types/metric/public/__snapshots__/metric_vis_fn.test.ts.snap similarity index 100% rename from src/plugins/vis_type_metric/public/__snapshots__/metric_vis_fn.test.ts.snap rename to src/plugins/vis_types/metric/public/__snapshots__/metric_vis_fn.test.ts.snap diff --git a/src/plugins/vis_type_metric/public/__snapshots__/to_ast.test.ts.snap b/src/plugins/vis_types/metric/public/__snapshots__/to_ast.test.ts.snap similarity index 100% rename from src/plugins/vis_type_metric/public/__snapshots__/to_ast.test.ts.snap rename to src/plugins/vis_types/metric/public/__snapshots__/to_ast.test.ts.snap diff --git a/src/plugins/vis_type_metric/public/components/__snapshots__/metric_vis_component.test.tsx.snap b/src/plugins/vis_types/metric/public/components/__snapshots__/metric_vis_component.test.tsx.snap similarity index 100% rename from src/plugins/vis_type_metric/public/components/__snapshots__/metric_vis_component.test.tsx.snap rename to src/plugins/vis_types/metric/public/components/__snapshots__/metric_vis_component.test.tsx.snap diff --git a/src/plugins/vis_type_metric/public/components/metric_vis.scss b/src/plugins/vis_types/metric/public/components/metric_vis.scss similarity index 100% rename from src/plugins/vis_type_metric/public/components/metric_vis.scss rename to src/plugins/vis_types/metric/public/components/metric_vis.scss diff --git a/src/plugins/vis_type_metric/public/components/metric_vis_component.test.tsx b/src/plugins/vis_types/metric/public/components/metric_vis_component.test.tsx similarity index 100% rename from src/plugins/vis_type_metric/public/components/metric_vis_component.test.tsx rename to src/plugins/vis_types/metric/public/components/metric_vis_component.test.tsx diff --git a/src/plugins/vis_type_metric/public/components/metric_vis_component.tsx b/src/plugins/vis_types/metric/public/components/metric_vis_component.tsx similarity index 88% rename from src/plugins/vis_type_metric/public/components/metric_vis_component.tsx rename to src/plugins/vis_types/metric/public/components/metric_vis_component.tsx index 87ca902f6c090..837ec5ff60dc5 100644 --- a/src/plugins/vis_type_metric/public/components/metric_vis_component.tsx +++ b/src/plugins/vis_types/metric/public/components/metric_vis_component.tsx @@ -11,13 +11,13 @@ import React, { Component } from 'react'; import { isColorDark } from '@elastic/eui'; import { MetricVisValue } from './metric_vis_value'; import { Input } from '../metric_vis_fn'; -import type { FieldFormatsContentType, IFieldFormat } from '../../../field_formats/common'; -import { Datatable } from '../../../expressions/public'; -import { getHeatmapColors } from '../../../charts/public'; +import type { FieldFormatsContentType, IFieldFormat } from '../../../../field_formats/common'; +import { Datatable } from '../../../../expressions/public'; +import { getHeatmapColors } from '../../../../charts/public'; import { VisParams, MetricVisMetric } from '../types'; import { getFormatService } from '../services'; -import { SchemaConfig } from '../../../visualizations/public'; -import { Range } from '../../../expressions/public'; +import { ExpressionValueVisDimension } from '../../../../visualizations/public'; +import { Range } from '../../../../expressions/public'; import './metric_vis.scss'; @@ -98,6 +98,16 @@ class MetricVisComponent extends Component { return fieldFormatter.convert(value, format); }; + private getColumn( + accessor: ExpressionValueVisDimension['accessor'], + columns: Datatable['columns'] = [] + ) { + if (typeof accessor === 'number') { + return columns[accessor]; + } + return columns.filter(({ id }) => accessor.id === id)[0]; + } + private processTableGroups(table: Datatable) { const config = this.props.visParams.metric; const dimensions = this.props.visParams.dimensions; @@ -112,13 +122,12 @@ class MetricVisComponent extends Component { let bucketFormatter: IFieldFormat; if (dimensions.bucket) { - bucketColumnId = table.columns[dimensions.bucket.accessor].id; + bucketColumnId = this.getColumn(dimensions.bucket.accessor, table.columns).id; bucketFormatter = getFormatService().deserialize(dimensions.bucket.format); } - dimensions.metrics.forEach((metric: SchemaConfig) => { - const columnIndex = metric.accessor; - const column = table?.columns[columnIndex]; + dimensions.metrics.forEach((metric: ExpressionValueVisDimension) => { + const column = this.getColumn(metric.accessor, table?.columns); const formatter = getFormatService().deserialize(metric.format); table.rows.forEach((row, rowIndex) => { let title = column.name; diff --git a/src/plugins/vis_type_metric/public/components/metric_vis_options.tsx b/src/plugins/vis_types/metric/public/components/metric_vis_options.tsx similarity index 98% rename from src/plugins/vis_type_metric/public/components/metric_vis_options.tsx rename to src/plugins/vis_types/metric/public/components/metric_vis_options.tsx index 5c6c4bf95b4f2..22152b331a907 100644 --- a/src/plugins/vis_type_metric/public/components/metric_vis_options.tsx +++ b/src/plugins/vis_types/metric/public/components/metric_vis_options.tsx @@ -27,8 +27,8 @@ import { ColorSchemaOptions, RangeOption, PercentageModeOption, -} from '../../../vis_default_editor/public'; -import { ColorMode, colorSchemas } from '../../../charts/public'; +} from '../../../../vis_default_editor/public'; +import { ColorMode, colorSchemas } from '../../../../charts/public'; import { MetricVisParam, VisParams } from '../types'; const metricColorMode = [ diff --git a/src/plugins/vis_type_metric/public/components/metric_vis_value.test.tsx b/src/plugins/vis_types/metric/public/components/metric_vis_value.test.tsx similarity index 100% rename from src/plugins/vis_type_metric/public/components/metric_vis_value.test.tsx rename to src/plugins/vis_types/metric/public/components/metric_vis_value.test.tsx diff --git a/src/plugins/vis_type_metric/public/components/metric_vis_value.tsx b/src/plugins/vis_types/metric/public/components/metric_vis_value.tsx similarity index 100% rename from src/plugins/vis_type_metric/public/components/metric_vis_value.tsx rename to src/plugins/vis_types/metric/public/components/metric_vis_value.tsx diff --git a/src/plugins/vis_type_metric/public/index.ts b/src/plugins/vis_types/metric/public/index.ts similarity index 100% rename from src/plugins/vis_type_metric/public/index.ts rename to src/plugins/vis_types/metric/public/index.ts diff --git a/src/plugins/vis_type_metric/public/metric_vis_fn.test.ts b/src/plugins/vis_types/metric/public/metric_vis_fn.test.ts similarity index 90% rename from src/plugins/vis_type_metric/public/metric_vis_fn.test.ts rename to src/plugins/vis_types/metric/public/metric_vis_fn.test.ts index 432b1f2fe02b7..3844c0f21ed05 100644 --- a/src/plugins/vis_type_metric/public/metric_vis_fn.test.ts +++ b/src/plugins/vis_types/metric/public/metric_vis_fn.test.ts @@ -7,8 +7,8 @@ */ import { createMetricVisFn } from './metric_vis_fn'; -import { functionWrapper } from '../../expressions/common/expression_functions/specs/tests/utils'; -import { Datatable } from '../../expressions/common/expression_types/specs'; +import { functionWrapper } from '../../../expressions/common/expression_functions/specs/tests/utils'; +import { Datatable } from '../../../expressions/common/expression_types/specs'; describe('interpreter/functions#metric', () => { const fn = functionWrapper(createMetricVisFn()); diff --git a/src/plugins/vis_type_metric/public/metric_vis_fn.ts b/src/plugins/vis_types/metric/public/metric_vis_fn.ts similarity index 92% rename from src/plugins/vis_type_metric/public/metric_vis_fn.ts rename to src/plugins/vis_types/metric/public/metric_vis_fn.ts index ab62c3e941e28..210552732bc0a 100644 --- a/src/plugins/vis_type_metric/public/metric_vis_fn.ts +++ b/src/plugins/vis_types/metric/public/metric_vis_fn.ts @@ -14,10 +14,11 @@ import { Range, Render, Style, -} from '../../expressions/public'; -import { visType, DimensionsVisParam, VisParams } from './types'; -import { prepareLogTable, Dimension } from '../../visualizations/public'; -import { ColorSchemas, vislibColorMaps, ColorMode } from '../../charts/public'; +} from '../../../expressions/public'; +import { visType, VisParams } from './types'; +import { prepareLogTable, Dimension } from '../../../visualizations/public'; +import { ColorSchemas, vislibColorMaps, ColorMode } from '../../../charts/public'; +import { ExpressionValueVisDimension } from '../../../visualizations/public'; export type Input = Datatable; @@ -32,8 +33,8 @@ interface Arguments { subText: string; colorRange: Range[]; font: Style; - metric: any[]; // these aren't typed yet - bucket: any; // these aren't typed yet + metric: ExpressionValueVisDimension[]; + bucket: ExpressionValueVisDimension; } export interface MetricVisRenderValue { @@ -150,14 +151,6 @@ export const createMetricVisFn = (): MetricVisExpressionFunctionDefinition => ({ }, }, fn(input, args, handlers) { - const dimensions: DimensionsVisParam = { - metrics: args.metric, - }; - - if (args.bucket) { - dimensions.bucket = args.bucket; - } - if (args.percentageMode && (!args.colorRange || args.colorRange.length === 0)) { throw new Error('colorRange must be provided when using percentageMode'); } @@ -184,6 +177,7 @@ export const createMetricVisFn = (): MetricVisExpressionFunctionDefinition => ({ const logTable = prepareLogTable(input, argsTable); handlers.inspectorAdapters.tables.logDatatable('default', logTable); } + return { type: 'render', as: 'metric_vis', @@ -209,7 +203,10 @@ export const createMetricVisFn = (): MetricVisExpressionFunctionDefinition => ({ fontSize, }, }, - dimensions, + dimensions: { + metrics: args.metric, + ...(args.bucket ? { bucket: args.bucket } : {}), + }, }, }, }; diff --git a/src/plugins/vis_type_metric/public/metric_vis_renderer.tsx b/src/plugins/vis_types/metric/public/metric_vis_renderer.tsx similarity index 88% rename from src/plugins/vis_type_metric/public/metric_vis_renderer.tsx rename to src/plugins/vis_types/metric/public/metric_vis_renderer.tsx index 0fc904a325a99..0bd2efbfe2efb 100644 --- a/src/plugins/vis_type_metric/public/metric_vis_renderer.tsx +++ b/src/plugins/vis_types/metric/public/metric_vis_renderer.tsx @@ -9,8 +9,8 @@ import React, { lazy } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { VisualizationContainer } from '../../visualizations/public'; -import { ExpressionRenderDefinition } from '../../expressions/common/expression_renderers'; +import { VisualizationContainer } from '../../../visualizations/public'; +import { ExpressionRenderDefinition } from '../../../expressions/common/expression_renderers'; import { MetricVisRenderValue } from './metric_vis_fn'; // @ts-ignore const MetricVisComponent = lazy(() => import('./components/metric_vis_component')); diff --git a/src/plugins/vis_type_metric/public/metric_vis_type.ts b/src/plugins/vis_types/metric/public/metric_vis_type.ts similarity index 93% rename from src/plugins/vis_type_metric/public/metric_vis_type.ts rename to src/plugins/vis_types/metric/public/metric_vis_type.ts index 382ef925c5282..9fc3856ba0edf 100644 --- a/src/plugins/vis_type_metric/public/metric_vis_type.ts +++ b/src/plugins/vis_types/metric/public/metric_vis_type.ts @@ -8,9 +8,9 @@ import { i18n } from '@kbn/i18n'; import { MetricVisOptions } from './components/metric_vis_options'; -import { ColorSchemas, ColorMode } from '../../charts/public'; -import { VisTypeDefinition } from '../../visualizations/public'; -import { AggGroupNames } from '../../data/public'; +import { ColorSchemas, ColorMode } from '../../../charts/public'; +import { VisTypeDefinition } from '../../../visualizations/public'; +import { AggGroupNames } from '../../../data/public'; import { toExpressionAst } from './to_ast'; import { VisParams } from './types'; diff --git a/src/plugins/vis_types/metric/public/plugin.ts b/src/plugins/vis_types/metric/public/plugin.ts new file mode 100644 index 0000000000000..205c02d8e9c3b --- /dev/null +++ b/src/plugins/vis_types/metric/public/plugin.ts @@ -0,0 +1,53 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 } from 'kibana/public'; +import { Plugin as ExpressionsPublicPlugin } from '../../../expressions/public'; +import { VisualizationsSetup } from '../../../visualizations/public'; + +import { createMetricVisFn } from './metric_vis_fn'; +import { createMetricVisTypeDefinition } from './metric_vis_type'; +import { ChartsPluginSetup } from '../../../charts/public'; +import { DataPublicPluginStart } from '../../../data/public'; +import { setFormatService } from './services'; +import { ConfigSchema } from '../config'; +import { metricVisRenderer } from './metric_vis_renderer'; + +/** @internal */ +export interface MetricVisPluginSetupDependencies { + expressions: ReturnType; + visualizations: VisualizationsSetup; + charts: ChartsPluginSetup; +} + +/** @internal */ +export interface MetricVisPluginStartDependencies { + data: DataPublicPluginStart; +} + +/** @internal */ +export class MetricVisPlugin implements Plugin { + initializerContext: PluginInitializerContext; + + constructor(initializerContext: PluginInitializerContext) { + this.initializerContext = initializerContext; + } + + public setup( + core: CoreSetup, + { expressions, visualizations, charts }: MetricVisPluginSetupDependencies + ) { + expressions.registerFunction(createMetricVisFn); + expressions.registerRenderer(metricVisRenderer); + visualizations.createBaseVisualization(createMetricVisTypeDefinition()); + } + + public start(core: CoreStart, { data }: MetricVisPluginStartDependencies) { + setFormatService(data.fieldFormats); + } +} diff --git a/src/plugins/vis_types/metric/public/services.ts b/src/plugins/vis_types/metric/public/services.ts new file mode 100644 index 0000000000000..e705513675e71 --- /dev/null +++ b/src/plugins/vis_types/metric/public/services.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 { createGetterSetter } from '../../../kibana_utils/common'; +import { DataPublicPluginStart } from '../../../data/public'; + +export const [getFormatService, setFormatService] = createGetterSetter< + DataPublicPluginStart['fieldFormats'] +>('metric data.fieldFormats'); diff --git a/src/plugins/vis_type_metric/public/to_ast.test.ts b/src/plugins/vis_types/metric/public/to_ast.test.ts similarity index 100% rename from src/plugins/vis_type_metric/public/to_ast.test.ts rename to src/plugins/vis_types/metric/public/to_ast.test.ts diff --git a/src/plugins/vis_types/metric/public/to_ast.ts b/src/plugins/vis_types/metric/public/to_ast.ts new file mode 100644 index 0000000000000..10c782c9a50fb --- /dev/null +++ b/src/plugins/vis_types/metric/public/to_ast.ts @@ -0,0 +1,102 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { get } from 'lodash'; +import { getVisSchemas, SchemaConfig, VisToExpressionAst } from '../../../visualizations/public'; +import { buildExpression, buildExpressionFunction } from '../../../expressions/public'; +import { MetricVisExpressionFunctionDefinition } from './metric_vis_fn'; +import { + EsaggsExpressionFunctionDefinition, + IndexPatternLoadExpressionFunctionDefinition, +} from '../../../data/public'; +import { VisParams } from './types'; + +const prepareDimension = (params: SchemaConfig) => { + const visdimension = buildExpressionFunction('visdimension', { accessor: params.accessor }); + + if (params.format) { + visdimension.addArgument('format', params.format.id); + visdimension.addArgument('formatParams', JSON.stringify(params.format.params)); + } + + return buildExpression([visdimension]); +}; + +export const toExpressionAst: VisToExpressionAst = (vis, params) => { + const esaggs = buildExpressionFunction('esaggs', { + index: buildExpression([ + buildExpressionFunction('indexPatternLoad', { + id: vis.data.indexPattern!.id!, + }), + ]), + metricsAtAllLevels: vis.isHierarchical(), + partialRows: false, + aggs: vis.data.aggs!.aggs.map((agg) => buildExpression(agg.toExpressionAst())), + }); + + const schemas = getVisSchemas(vis, params); + + const { + percentageMode, + percentageFormatPattern, + useRanges, + colorSchema, + metricColorMode, + colorsRange, + labels, + invertColors, + style, + } = vis.params.metric; + + // fix formatter for percentage mode + if (get(vis.params, 'metric.percentageMode') === true) { + schemas.metric.forEach((metric: SchemaConfig) => { + metric.format = { + id: 'percent', + params: { pattern: percentageFormatPattern }, + }; + }); + } + + // @ts-expect-error + const metricVis = buildExpressionFunction('metricVis', { + percentageMode, + colorSchema, + colorMode: metricColorMode, + useRanges, + invertColors, + showLabels: labels?.show ?? false, + }); + + if (style) { + metricVis.addArgument('bgFill', style.bgFill); + metricVis.addArgument('font', buildExpression(`font size=${style.fontSize}`)); + metricVis.addArgument('subText', style.subText); + } + + if (colorsRange) { + colorsRange.forEach((range: any) => { + metricVis.addArgument( + 'colorRange', + buildExpression(`range from=${range.from} to=${range.to}`) + ); + }); + } + + if (schemas.group) { + metricVis.addArgument('bucket', prepareDimension(schemas.group[0])); + } + + schemas.metric.forEach((metric) => { + metricVis.addArgument('metric', prepareDimension(metric)); + }); + + const ast = buildExpression([esaggs, metricVis]); + + return ast.toAst(); +}; diff --git a/src/plugins/vis_types/metric/public/types.ts b/src/plugins/vis_types/metric/public/types.ts new file mode 100644 index 0000000000000..8e86c0217bba6 --- /dev/null +++ b/src/plugins/vis_types/metric/public/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 { Range } from '../../../expressions/public'; +import { ExpressionValueVisDimension } from '../../../visualizations/public'; +import { ColorMode, Labels, Style, ColorSchemas } from '../../../charts/public'; + +export const visType = 'metric'; + +export interface DimensionsVisParam { + metrics: ExpressionValueVisDimension[]; + bucket?: ExpressionValueVisDimension; +} + +export interface MetricVisParam { + percentageMode: boolean; + percentageFormatPattern?: string; + useRanges: boolean; + colorSchema: ColorSchemas; + metricColorMode: ColorMode; + colorsRange: Range[]; + labels: Labels; + invertColors: boolean; + style: Style; +} + +export interface VisParams { + addTooltip: boolean; + addLegend: boolean; + dimensions: DimensionsVisParam; + metric: MetricVisParam; + type: typeof visType; +} + +export interface MetricVisMetric { + value: any; + label: string; + color?: string; + bgColor?: string; + lightText: boolean; + rowIndex: number; +} diff --git a/src/plugins/vis_type_metric/server/index.ts b/src/plugins/vis_types/metric/server/index.ts similarity index 100% rename from src/plugins/vis_type_metric/server/index.ts rename to src/plugins/vis_types/metric/server/index.ts diff --git a/src/plugins/vis_types/metric/tsconfig.json b/src/plugins/vis_types/metric/tsconfig.json new file mode 100644 index 0000000000000..e8c878425ff70 --- /dev/null +++ b/src/plugins/vis_types/metric/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": ["public/**/*", "server/**/*", "*.ts"], + "references": [ + { "path": "../../../core/tsconfig.json" }, + { "path": "../../data/tsconfig.json" }, + { "path": "../../visualizations/tsconfig.json" }, + { "path": "../../charts/tsconfig.json" }, + { "path": "../../expressions/tsconfig.json" }, + { "path": "../../kibana_utils/tsconfig.json" }, + { "path": "../../vis_default_editor/tsconfig.json" }, + { "path": "../../field_formats/tsconfig.json" } + ] +} diff --git a/src/plugins/vis_types/pie/jest.config.js b/src/plugins/vis_types/pie/jest.config.js index 505ea97f489f7..d9afd1d718c85 100644 --- a/src/plugins/vis_types/pie/jest.config.js +++ b/src/plugins/vis_types/pie/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../../..', roots: ['/src/plugins/vis_types/pie'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_types/pie', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/vis_types/pie/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/vis_types/pie/public/components/visualization_noresults.tsx b/src/plugins/vis_types/pie/public/components/visualization_noresults.tsx new file mode 100644 index 0000000000000..1ae5340c9791a --- /dev/null +++ b/src/plugins/vis_types/pie/public/components/visualization_noresults.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 and the Server Side Public License, v 1; you may not 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, EuiText } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +export const VisualizationNoResults = ({ hasNegativeValues = false }) => { + return ( + + {hasNegativeValues + ? i18n.translate('visTypePie.negativeValuesFound', { + defaultMessage: "Pie/donut charts can't render with negative values.", + }) + : i18n.translate('visTypePie.noResultsFoundTitle', { + defaultMessage: 'No results found', + })} + + } + /> + ); +}; diff --git a/src/plugins/vis_types/pie/public/pie_component.test.tsx b/src/plugins/vis_types/pie/public/pie_component.test.tsx index c70cad285f2ae..846daa1e45710 100644 --- a/src/plugins/vis_types/pie/public/pie_component.test.tsx +++ b/src/plugins/vis_types/pie/public/pie_component.test.tsx @@ -10,6 +10,7 @@ import React from 'react'; import { Settings, TooltipType, SeriesIdentifier } from '@elastic/charts'; import { chartPluginMock } from '../../../charts/public/mocks'; import { dataPluginMock } from '../../../data/public/mocks'; +import type { Datatable } from '../../../expressions/public'; import { shallow, mount } from 'enzyme'; import { findTestSubject } from '@elastic/eui/lib/test'; import { act } from 'react-dom/test-utils'; @@ -120,4 +121,64 @@ describe('PieComponent', function () { ]); expect(wrapperProps.fireEvent).toHaveBeenCalled(); }); + + it('renders the no results component if all the values are zero', () => { + const newVisData = ({ + type: 'datatable', + columns: [ + { + id: 'col-1-1', + name: 'Count', + }, + { + id: 'col-0-2', + name: 'filters', + }, + ], + rows: [ + { + 'col-0-2': 'Carrier : "JetBeats" ', + 'col-1-1': 0, + }, + { + 'col-0-2': 'Carrier : "ES-Air" ', + 'col-1-1': 0, + }, + ], + } as unknown) as Datatable; + const newProps = { ...wrapperProps, visData: newVisData }; + const component = mount(); + expect(findTestSubject(component, 'pieVisualizationError').text()).toEqual('No results found'); + }); + + it('renders the no results component if there are negative values', () => { + const newVisData = ({ + type: 'datatable', + columns: [ + { + id: 'col-1-1', + name: 'Count', + }, + { + id: 'col-0-2', + name: 'filters', + }, + ], + rows: [ + { + 'col-0-2': 'Carrier : "JetBeats" ', + 'col-1-1': -10, + }, + { + 'col-0-2': 'Carrier : "ES-Air" ', + 'col-1-1': -10, + }, + ], + } as unknown) as Datatable; + const newProps = { ...wrapperProps, visData: newVisData }; + const component = mount(); + expect(findTestSubject(component, 'pieVisualizationError').text()).toEqual( + "Pie/donut charts can't render with negative values." + ); + }); }); diff --git a/src/plugins/vis_types/pie/public/pie_component.tsx b/src/plugins/vis_types/pie/public/pie_component.tsx index a5475a76e27cd..c41b47f9aa683 100644 --- a/src/plugins/vis_types/pie/public/pie_component.tsx +++ b/src/plugins/vis_types/pie/public/pie_component.tsx @@ -48,6 +48,7 @@ import { getSplitDimensionAccessor, } from './utils'; import { ChartSplit, SMALL_MULTIPLES_ID } from './components/chart_split'; +import { VisualizationNoResults } from './components/visualization_noresults'; import './chart.scss'; @@ -186,10 +187,8 @@ const PieComponent = (props: PieComponentProps) => { const { visData, visParams, services, syncColors } = props; function getSliceValue(d: Datum, metricColumn: DatatableColumn) { - if (typeof d[metricColumn.id] === 'number' && d[metricColumn.id] !== 0) { - return d[metricColumn.id]; - } - return Number.EPSILON; + const value = d[metricColumn.id]; + return Number.isFinite(value) && value >= 0 ? value : 0; } // formatters @@ -285,82 +284,110 @@ const PieComponent = (props: PieComponentProps) => { ? visData.columns[visParams.dimensions.splitRow[0].accessor] : undefined; + /** + * Checks whether data have all zero values. + * If so, the no data container is loaded. + */ + const isAllZeros = useMemo(() => visData.rows.every((row) => row[metricColumn.id] === 0), [ + visData.rows, + metricColumn, + ]); + + /** + * Checks whether data have negative values. + * If so, the no data container is loaded. + */ + const hasNegative = useMemo( + () => + visData.rows.some((row) => { + const value = row[metricColumn.id]; + return typeof value === 'number' && value < 0; + }), + [visData.rows, metricColumn] + ); + + const canShowPieChart = !isAllZeros && !hasNegative; + return (
-
- - - - + ) : ( +
+ { - handleSliceClick( - args[0][0] as LayerValue[], - bucketColumns, - visData, - splitChartDimension, - splitChartFormatter - ); - }} - legendAction={getLegendActions( - canFilter, - getLegendActionEventData(visData), - handleLegendAction, - visParams, - services.actions, - services.fieldFormats - )} - theme={[ - chartTheme, - { - legend: { - labelOptions: { - maxLines: visParams.truncateLegend ? visParams.maxLegendLines ?? 1 : 0, + /> + + + { + handleSliceClick( + args[0][0] as LayerValue[], + bucketColumns, + visData, + splitChartDimension, + splitChartFormatter + ); + }} + legendAction={getLegendActions( + canFilter, + getLegendActionEventData(visData), + handleLegendAction, + visParams, + services.actions, + services.fieldFormats + )} + theme={[ + chartTheme, + { + legend: { + labelOptions: { + maxLines: visParams.truncateLegend ? visParams.maxLegendLines ?? 1 : 0, + }, }, }, - }, - ]} - baseTheme={chartBaseTheme} - onRenderChange={onRenderChange} - /> - getSliceValue(d, metricColumn)} - percentFormatter={(d: number) => percentFormatter.convert(d / 100)} - valueGetter={ - !visParams.labels.show || - visParams.labels.valuesFormat === ValueFormats.VALUE || - !visParams.labels.values - ? undefined - : 'percent' - } - valueFormatter={(d: number) => - !visParams.labels.show || !visParams.labels.values - ? '' - : metricFieldFormatter.convert(d) - } - layers={layers} - config={config} - topGroove={!visParams.labels.show ? 0 : undefined} - /> - -
+ ]} + baseTheme={chartBaseTheme} + onRenderChange={onRenderChange} + /> + getSliceValue(d, metricColumn)} + percentFormatter={(d: number) => percentFormatter.convert(d / 100)} + valueGetter={ + !visParams.labels.show || + visParams.labels.valuesFormat === ValueFormats.VALUE || + !visParams.labels.values + ? undefined + : 'percent' + } + valueFormatter={(d: number) => + !visParams.labels.show || !visParams.labels.values + ? '' + : metricFieldFormatter.convert(d) + } + layers={layers} + config={config} + topGroove={!visParams.labels.show ? 0 : undefined} + /> +
+
+ )}
); }; diff --git a/src/plugins/vis_types/table/README.md b/src/plugins/vis_types/table/README.md new file mode 100644 index 0000000000000..b3aa1983fb8ef --- /dev/null +++ b/src/plugins/vis_types/table/README.md @@ -0,0 +1,3 @@ +Contains the data table visualization, that allows presenting data in a simple table format. + +Aggregation-based datatable visualizations use the EuiDataGrid component. diff --git a/src/plugins/vis_types/table/common/index.ts b/src/plugins/vis_types/table/common/index.ts new file mode 100644 index 0000000000000..ad8e27c95a5ec --- /dev/null +++ b/src/plugins/vis_types/table/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 and the Server Side Public License, v 1; you may 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 { AggTypes, TableVisParams, VIS_TYPE_TABLE } from './types'; diff --git a/src/plugins/vis_type_table/common/types.ts b/src/plugins/vis_types/table/common/types.ts similarity index 100% rename from src/plugins/vis_type_table/common/types.ts rename to src/plugins/vis_types/table/common/types.ts diff --git a/src/plugins/vis_type_tagcloud/config.ts b/src/plugins/vis_types/table/config.ts similarity index 100% rename from src/plugins/vis_type_tagcloud/config.ts rename to src/plugins/vis_types/table/config.ts diff --git a/src/plugins/vis_types/table/jest.config.js b/src/plugins/vis_types/table/jest.config.js new file mode 100644 index 0000000000000..cc6c194aa7cb4 --- /dev/null +++ b/src/plugins/vis_types/table/jest.config.js @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../..', + roots: ['/src/plugins/vis_types/table'], + testRunner: 'jasmine2', + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_types/table', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/vis_types/table/{common,public,server}/**/*.{js,ts,tsx}', + ], +}; diff --git a/src/plugins/vis_types/table/kibana.json b/src/plugins/vis_types/table/kibana.json new file mode 100644 index 0000000000000..b3ebd5117bbc8 --- /dev/null +++ b/src/plugins/vis_types/table/kibana.json @@ -0,0 +1,24 @@ +{ + "id": "visTypeTable", + "version": "kibana", + "server": true, + "ui": true, + "requiredPlugins": [ + "expressions", + "visualizations", + "data", + "kibanaLegacy" + ], + "requiredBundles": [ + "kibanaUtils", + "kibanaReact", + "share", + "visDefaultEditor" + ], + "optionalPlugins": ["usageCollection"], + "owner": { + "name": "Vis Editors", + "githubTeam": "kibana-vis-editors" + }, + "description": "Registers the datatable aggregation-based visualization." +} diff --git a/src/plugins/vis_type_table/public/__snapshots__/table_vis_fn.test.ts.snap b/src/plugins/vis_types/table/public/__snapshots__/table_vis_fn.test.ts.snap similarity index 100% rename from src/plugins/vis_type_table/public/__snapshots__/table_vis_fn.test.ts.snap rename to src/plugins/vis_types/table/public/__snapshots__/table_vis_fn.test.ts.snap diff --git a/src/plugins/vis_type_table/public/components/__snapshots__/table_vis_basic.test.tsx.snap b/src/plugins/vis_types/table/public/components/__snapshots__/table_vis_basic.test.tsx.snap similarity index 100% rename from src/plugins/vis_type_table/public/components/__snapshots__/table_vis_basic.test.tsx.snap rename to src/plugins/vis_types/table/public/components/__snapshots__/table_vis_basic.test.tsx.snap diff --git a/src/plugins/vis_type_table/public/components/__snapshots__/table_vis_cell.test.tsx.snap b/src/plugins/vis_types/table/public/components/__snapshots__/table_vis_cell.test.tsx.snap similarity index 100% rename from src/plugins/vis_type_table/public/components/__snapshots__/table_vis_cell.test.tsx.snap rename to src/plugins/vis_types/table/public/components/__snapshots__/table_vis_cell.test.tsx.snap diff --git a/src/plugins/vis_type_table/public/components/index.ts b/src/plugins/vis_types/table/public/components/index.ts similarity index 100% rename from src/plugins/vis_type_table/public/components/index.ts rename to src/plugins/vis_types/table/public/components/index.ts diff --git a/src/plugins/vis_type_table/public/components/table_vis_basic.test.tsx b/src/plugins/vis_types/table/public/components/table_vis_basic.test.tsx similarity index 100% rename from src/plugins/vis_type_table/public/components/table_vis_basic.test.tsx rename to src/plugins/vis_types/table/public/components/table_vis_basic.test.tsx diff --git a/src/plugins/vis_type_table/public/components/table_vis_basic.tsx b/src/plugins/vis_types/table/public/components/table_vis_basic.tsx similarity index 100% rename from src/plugins/vis_type_table/public/components/table_vis_basic.tsx rename to src/plugins/vis_types/table/public/components/table_vis_basic.tsx diff --git a/src/plugins/vis_type_table/public/components/table_vis_cell.test.tsx b/src/plugins/vis_types/table/public/components/table_vis_cell.test.tsx similarity index 100% rename from src/plugins/vis_type_table/public/components/table_vis_cell.test.tsx rename to src/plugins/vis_types/table/public/components/table_vis_cell.test.tsx diff --git a/src/plugins/vis_type_table/public/components/table_vis_cell.tsx b/src/plugins/vis_types/table/public/components/table_vis_cell.tsx similarity index 100% rename from src/plugins/vis_type_table/public/components/table_vis_cell.tsx rename to src/plugins/vis_types/table/public/components/table_vis_cell.tsx diff --git a/src/plugins/vis_type_table/public/components/table_vis_columns.tsx b/src/plugins/vis_types/table/public/components/table_vis_columns.tsx similarity index 100% rename from src/plugins/vis_type_table/public/components/table_vis_columns.tsx rename to src/plugins/vis_types/table/public/components/table_vis_columns.tsx diff --git a/src/plugins/vis_type_table/public/components/table_vis_controls.tsx b/src/plugins/vis_types/table/public/components/table_vis_controls.tsx similarity index 96% rename from src/plugins/vis_type_table/public/components/table_vis_controls.tsx rename to src/plugins/vis_types/table/public/components/table_vis_controls.tsx index 01dd693a31ff8..28e4b84796d98 100644 --- a/src/plugins/vis_type_table/public/components/table_vis_controls.tsx +++ b/src/plugins/vis_types/table/public/components/table_vis_controls.tsx @@ -19,13 +19,13 @@ import { i18n } from '@kbn/i18n'; import { DatatableColumn, DatatableRow } from 'src/plugins/expressions'; import { CoreStart } from 'kibana/public'; -import { useKibana } from '../../../kibana_react/public'; -import { exporters } from '../../../data/public'; +import { useKibana } from '../../../../kibana_react/public'; +import { exporters } from '../../../../data/public'; import { CSV_SEPARATOR_SETTING, CSV_QUOTE_VALUES_SETTING, downloadFileAs, -} from '../../../share/public'; +} from '../../../../share/public'; import { getFormatService } from '../services'; interface TableVisControlsProps { diff --git a/src/plugins/vis_type_table/public/components/table_vis_options.tsx b/src/plugins/vis_types/table/public/components/table_vis_options.tsx similarity index 96% rename from src/plugins/vis_type_table/public/components/table_vis_options.tsx rename to src/plugins/vis_types/table/public/components/table_vis_options.tsx index 2906a51e5d05f..8a6b8586fce7d 100644 --- a/src/plugins/vis_type_table/public/components/table_vis_options.tsx +++ b/src/plugins/vis_types/table/public/components/table_vis_options.tsx @@ -13,8 +13,12 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { VisEditorOptionsProps } from 'src/plugins/visualizations/public'; -import { search } from '../../../data/public'; -import { SwitchOption, SelectOption, NumberInputOption } from '../../../vis_default_editor/public'; +import { search } from '../../../../data/public'; +import { + SwitchOption, + SelectOption, + NumberInputOption, +} from '../../../../vis_default_editor/public'; import { TableVisParams } from '../../common'; import { totalAggregations } from './utils'; diff --git a/src/plugins/vis_type_table/public/components/table_vis_options_lazy.tsx b/src/plugins/vis_types/table/public/components/table_vis_options_lazy.tsx similarity index 100% rename from src/plugins/vis_type_table/public/components/table_vis_options_lazy.tsx rename to src/plugins/vis_types/table/public/components/table_vis_options_lazy.tsx diff --git a/src/plugins/vis_type_table/public/components/table_vis_split.tsx b/src/plugins/vis_types/table/public/components/table_vis_split.tsx similarity index 100% rename from src/plugins/vis_type_table/public/components/table_vis_split.tsx rename to src/plugins/vis_types/table/public/components/table_vis_split.tsx diff --git a/src/plugins/vis_type_table/public/components/table_visualization.scss b/src/plugins/vis_types/table/public/components/table_visualization.scss similarity index 100% rename from src/plugins/vis_type_table/public/components/table_visualization.scss rename to src/plugins/vis_types/table/public/components/table_visualization.scss diff --git a/src/plugins/vis_type_table/public/components/table_visualization.test.tsx b/src/plugins/vis_types/table/public/components/table_visualization.test.tsx similarity index 97% rename from src/plugins/vis_type_table/public/components/table_visualization.test.tsx rename to src/plugins/vis_types/table/public/components/table_visualization.test.tsx index 44c315cdbd9e4..0de7e8c15105a 100644 --- a/src/plugins/vis_type_table/public/components/table_visualization.test.tsx +++ b/src/plugins/vis_types/table/public/components/table_visualization.test.tsx @@ -13,7 +13,7 @@ jest.mock('../utils', () => ({ import React from 'react'; import { shallow } from 'enzyme'; import { IInterpreterRenderHandlers } from 'src/plugins/expressions'; -import { coreMock } from '../../../../core/public/mocks'; +import { coreMock } from '../../../../../core/public/mocks'; import { TableVisConfig, TableVisData } from '../types'; import TableVisualizationComponent from './table_visualization'; import { useUiState } from '../utils'; diff --git a/src/plugins/vis_type_table/public/components/table_visualization.tsx b/src/plugins/vis_types/table/public/components/table_visualization.tsx similarity index 96% rename from src/plugins/vis_type_table/public/components/table_visualization.tsx rename to src/plugins/vis_types/table/public/components/table_visualization.tsx index c5a4f42cbb65e..356913146890b 100644 --- a/src/plugins/vis_type_table/public/components/table_visualization.tsx +++ b/src/plugins/vis_types/table/public/components/table_visualization.tsx @@ -13,7 +13,7 @@ import classNames from 'classnames'; import { CoreStart } from 'kibana/public'; import { IInterpreterRenderHandlers } from 'src/plugins/expressions'; import type { PersistedState } from 'src/plugins/visualizations/public'; -import { KibanaContextProvider } from '../../../kibana_react/public'; +import { KibanaContextProvider } from '../../../../kibana_react/public'; import { TableVisConfig, TableVisData } from '../types'; import { TableVisBasic } from './table_vis_basic'; import { TableVisSplit } from './table_vis_split'; diff --git a/src/plugins/vis_type_table/public/components/utils.ts b/src/plugins/vis_types/table/public/components/utils.ts similarity index 100% rename from src/plugins/vis_type_table/public/components/utils.ts rename to src/plugins/vis_types/table/public/components/utils.ts diff --git a/src/plugins/vis_types/table/public/index.ts b/src/plugins/vis_types/table/public/index.ts new file mode 100644 index 0000000000000..700a794e5a4c7 --- /dev/null +++ b/src/plugins/vis_types/table/public/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { TableVisPlugin as Plugin } from './plugin'; + +export function plugin() { + return new Plugin(); +} diff --git a/src/plugins/vis_types/table/public/plugin.ts b/src/plugins/vis_types/table/public/plugin.ts new file mode 100644 index 0000000000000..fa02550f5048d --- /dev/null +++ b/src/plugins/vis_types/table/public/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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { CoreSetup, CoreStart, Plugin } from 'kibana/public'; +import { Plugin as ExpressionsPublicPlugin } from '../../../expressions/public'; +import { VisualizationsSetup } from '../../../visualizations/public'; +import { UsageCollectionSetup } from '../../../usage_collection/public'; + +import { DataPublicPluginStart } from '../../../data/public'; +import { setFormatService } from './services'; +import { registerTableVis } from './register_vis'; + +/** @internal */ +export interface TablePluginSetupDependencies { + expressions: ReturnType; + visualizations: VisualizationsSetup; + usageCollection?: UsageCollectionSetup; +} + +/** @internal */ +export interface TablePluginStartDependencies { + data: DataPublicPluginStart; +} + +/** @internal */ +export class TableVisPlugin + implements Plugin { + public setup(core: CoreSetup, deps: TablePluginSetupDependencies) { + registerTableVis(core, deps); + } + + public start(core: CoreStart, { data }: TablePluginStartDependencies) { + setFormatService(data.fieldFormats); + } +} diff --git a/src/plugins/vis_type_table/public/register_vis.ts b/src/plugins/vis_types/table/public/register_vis.ts similarity index 84% rename from src/plugins/vis_type_table/public/register_vis.ts rename to src/plugins/vis_types/table/public/register_vis.ts index cf15203b04864..b80dccccaff0a 100644 --- a/src/plugins/vis_type_table/public/register_vis.ts +++ b/src/plugins/vis_types/table/public/register_vis.ts @@ -6,8 +6,7 @@ * Side Public License, v 1. */ -import { PluginInitializerContext, CoreSetup } from 'kibana/public'; - +import { CoreSetup } from 'kibana/public'; import { TablePluginSetupDependencies, TablePluginStartDependencies } from './plugin'; import { createTableVisFn } from './table_vis_fn'; import { getTableVisRenderer } from './table_vis_renderer'; @@ -15,8 +14,7 @@ import { tableVisTypeDefinition } from './table_vis_type'; export const registerTableVis = async ( core: CoreSetup, - { expressions, visualizations }: TablePluginSetupDependencies, - context: PluginInitializerContext + { expressions, visualizations }: TablePluginSetupDependencies ) => { const [coreStart] = await core.getStartServices(); expressions.registerFunction(createTableVisFn); diff --git a/src/plugins/vis_types/table/public/services.ts b/src/plugins/vis_types/table/public/services.ts new file mode 100644 index 0000000000000..d4d83c9e92c67 --- /dev/null +++ b/src/plugins/vis_types/table/public/services.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 { createGetterSetter } from '../../../kibana_utils/public'; +import { DataPublicPluginStart } from '../../../data/public'; + +export const [getFormatService, setFormatService] = createGetterSetter< + DataPublicPluginStart['fieldFormats'] +>('table data.fieldFormats'); diff --git a/src/plugins/vis_type_table/public/table_vis_fn.test.ts b/src/plugins/vis_types/table/public/table_vis_fn.test.ts similarity index 92% rename from src/plugins/vis_type_table/public/table_vis_fn.test.ts rename to src/plugins/vis_types/table/public/table_vis_fn.test.ts index c6eb8601824ec..8b08bca160478 100644 --- a/src/plugins/vis_type_table/public/table_vis_fn.test.ts +++ b/src/plugins/vis_types/table/public/table_vis_fn.test.ts @@ -9,8 +9,8 @@ import { createTableVisFn } from './table_vis_fn'; import { tableVisResponseHandler } from './utils'; -import { functionWrapper } from '../../expressions/common/expression_functions/specs/tests/utils'; -import { Datatable } from '../../expressions/common/expression_types/specs'; +import { functionWrapper } from '../../../expressions/common/expression_functions/specs/tests/utils'; +import { Datatable } from '../../../expressions/common/expression_types/specs'; jest.mock('./utils', () => ({ tableVisResponseHandler: jest.fn().mockReturnValue({ diff --git a/src/plugins/vis_type_table/public/table_vis_fn.ts b/src/plugins/vis_types/table/public/table_vis_fn.ts similarity index 97% rename from src/plugins/vis_type_table/public/table_vis_fn.ts rename to src/plugins/vis_types/table/public/table_vis_fn.ts index 9473a9a2663ab..ebddb0b4b7fef 100644 --- a/src/plugins/vis_type_table/public/table_vis_fn.ts +++ b/src/plugins/vis_types/table/public/table_vis_fn.ts @@ -7,8 +7,8 @@ */ import { i18n } from '@kbn/i18n'; -import { ExpressionFunctionDefinition, Datatable, Render } from '../../expressions/public'; -import { prepareLogTable, Dimension } from '../../visualizations/public'; +import { ExpressionFunctionDefinition, Datatable, Render } from '../../../expressions/public'; +import { prepareLogTable, Dimension } from '../../../visualizations/public'; import { TableVisData, TableVisConfig } from './types'; import { VIS_TYPE_TABLE } from '../common'; import { tableVisResponseHandler } from './utils'; diff --git a/src/plugins/vis_type_table/public/table_vis_renderer.tsx b/src/plugins/vis_types/table/public/table_vis_renderer.tsx similarity index 89% rename from src/plugins/vis_type_table/public/table_vis_renderer.tsx rename to src/plugins/vis_types/table/public/table_vis_renderer.tsx index 257755de62d0d..e9f2002b71062 100644 --- a/src/plugins/vis_type_table/public/table_vis_renderer.tsx +++ b/src/plugins/vis_types/table/public/table_vis_renderer.tsx @@ -10,8 +10,8 @@ import React, { lazy } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import { CoreStart } from 'kibana/public'; -import { VisualizationContainer } from '../../visualizations/public'; -import { ExpressionRenderDefinition } from '../../expressions/common/expression_renderers'; +import { VisualizationContainer } from '../../../visualizations/public'; +import { ExpressionRenderDefinition } from '../../../expressions/common/expression_renderers'; import { TableVisRenderValue } from './table_vis_fn'; const TableVisualizationComponent = lazy(() => import('./components/table_visualization')); diff --git a/src/plugins/vis_type_table/public/table_vis_type.ts b/src/plugins/vis_types/table/public/table_vis_type.ts similarity index 94% rename from src/plugins/vis_type_table/public/table_vis_type.ts rename to src/plugins/vis_types/table/public/table_vis_type.ts index a49748fe86c96..4664e87cea79b 100644 --- a/src/plugins/vis_type_table/public/table_vis_type.ts +++ b/src/plugins/vis_types/table/public/table_vis_type.ts @@ -8,8 +8,8 @@ import { i18n } from '@kbn/i18n'; -import { AggGroupNames } from '../../data/public'; -import { VIS_EVENT_TO_TRIGGER, VisTypeDefinition } from '../../visualizations/public'; +import { AggGroupNames } from '../../../data/public'; +import { VIS_EVENT_TO_TRIGGER, VisTypeDefinition } from '../../../visualizations/public'; import { TableVisParams, VIS_TYPE_TABLE } from '../common'; import { TableOptions } from './components/table_vis_options_lazy'; import { toExpressionAst } from './to_ast'; diff --git a/src/plugins/vis_types/table/public/to_ast.test.ts b/src/plugins/vis_types/table/public/to_ast.test.ts new file mode 100644 index 0000000000000..e8f987909a534 --- /dev/null +++ b/src/plugins/vis_types/table/public/to_ast.test.ts @@ -0,0 +1,127 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Vis } from 'src/plugins/visualizations/public'; +import { toExpressionAst } from './to_ast'; +import { AggTypes, TableVisParams } from '../common'; +import { buildExpressionFunction } from '../../../expressions/public'; + +const mockSchemas = { + metric: [{ accessor: 1, format: { id: 'number' }, params: {}, label: 'Count', aggType: 'count' }], + bucket: [ + { + accessor: 0, + format: { id: 'date', params: { pattern: 'YYYY-MM-DD HH:mm' } }, + params: {}, + label: 'order_date per 3 hours', + aggType: 'date_histogram', + }, + ], +}; + +const mockTableExpressionFunction = { + addArgument: jest.fn(), +}; + +const mockTableExpression = { + toAst: jest.fn(), +}; + +jest.mock('../../../visualizations/public', () => ({ + getVisSchemas: () => mockSchemas, +})); + +jest.mock('../../../expressions/public', () => ({ + buildExpression: jest.fn(() => mockTableExpression), + buildExpressionFunction: jest.fn(() => mockTableExpressionFunction), +})); + +describe('table vis toExpressionAst function', () => { + let vis: Vis; + + beforeEach(() => { + vis = { + isHierarchical: () => false, + type: {}, + params: { + perPage: 20, + percentageCol: 'Count', + showLabel: false, + showMetricsAtAllLevels: true, + showPartialRows: true, + showTotal: true, + showToolbar: false, + totalFunc: AggTypes.SUM, + }, + data: { + indexPattern: { id: '123' }, + aggs: { + getResponseAggs: () => [], + aggs: [], + }, + }, + } as any; + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + it('should create table expression ast', () => { + toExpressionAst(vis, {} as any); + + expect((buildExpressionFunction as jest.Mock).mock.calls.length).toEqual(5); + expect((buildExpressionFunction as jest.Mock).mock.calls[0]).toEqual([ + 'indexPatternLoad', + { id: '123' }, + ]); + expect((buildExpressionFunction as jest.Mock).mock.calls[1]).toEqual([ + 'esaggs', + { + index: expect.any(Object), + metricsAtAllLevels: false, + partialRows: true, + aggs: [], + }, + ]); + // prepare metrics dimensions + expect((buildExpressionFunction as jest.Mock).mock.calls[2]).toEqual([ + 'visdimension', + { accessor: 1 }, + ]); + // prepare buckets dimensions + expect((buildExpressionFunction as jest.Mock).mock.calls[3]).toEqual([ + 'visdimension', + { accessor: 0 }, + ]); + // prepare table expression function + expect((buildExpressionFunction as jest.Mock).mock.calls[4]).toEqual([ + 'kibana_table', + { + buckets: [mockTableExpression], + metrics: [mockTableExpression], + perPage: 20, + percentageCol: 'Count', + row: undefined, + showMetricsAtAllLevels: true, + showPartialRows: true, + showToolbar: false, + showTotal: true, + title: undefined, + totalFunc: 'sum', + }, + ]); + }); + + it('should filter out invalid vis params', () => { + // @ts-expect-error + vis.params.sort = { columnIndex: null }; + toExpressionAst(vis, {} as any); + expect((buildExpressionFunction as jest.Mock).mock.calls[4][1].sort).toBeUndefined(); + }); +}); diff --git a/src/plugins/vis_types/table/public/to_ast.ts b/src/plugins/vis_types/table/public/to_ast.ts new file mode 100644 index 0000000000000..8e1c92c8dde4f --- /dev/null +++ b/src/plugins/vis_types/table/public/to_ast.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 { + EsaggsExpressionFunctionDefinition, + IndexPatternLoadExpressionFunctionDefinition, +} from '../../../data/public'; +import { buildExpression, buildExpressionFunction } from '../../../expressions/public'; +import { getVisSchemas, SchemaConfig, VisToExpressionAst } from '../../../visualizations/public'; +import { TableVisParams } from '../common'; +import { TableExpressionFunctionDefinition } from './table_vis_fn'; + +const prepareDimension = (params: SchemaConfig) => { + const visdimension = buildExpressionFunction('visdimension', { accessor: params.accessor }); + + if (params.format) { + visdimension.addArgument('format', params.format.id); + visdimension.addArgument('formatParams', JSON.stringify(params.format.params)); + } + + return buildExpression([visdimension]); +}; + +const getMetrics = (schemas: ReturnType, visParams: TableVisParams) => { + const metrics = [...schemas.metric]; + + if (schemas.bucket && visParams.showPartialRows && !visParams.showMetricsAtAllLevels) { + // Handle case where user wants to see partial rows but not metrics at all levels. + // This requires calculating how many metrics will come back in the tabified response, + // and removing all metrics from the dimensions except the last set. + const metricsPerBucket = metrics.length / schemas.bucket.length; + metrics.splice(0, metricsPerBucket * schemas.bucket.length - metricsPerBucket); + } + + return metrics; +}; + +export const toExpressionAst: VisToExpressionAst = (vis, params) => { + const esaggs = buildExpressionFunction('esaggs', { + index: buildExpression([ + buildExpressionFunction('indexPatternLoad', { + id: vis.data.indexPattern!.id!, + }), + ]), + metricsAtAllLevels: vis.isHierarchical(), + partialRows: vis.params.showPartialRows, + aggs: vis.data.aggs!.aggs.map((agg) => buildExpression(agg.toExpressionAst())), + }); + + const schemas = getVisSchemas(vis, params); + const metrics = getMetrics(schemas, vis.params); + + const args = { + // explicitly pass each param to prevent extra values trapping + perPage: vis.params.perPage, + percentageCol: vis.params.percentageCol, + row: vis.params.row, + showPartialRows: vis.params.showPartialRows, + showMetricsAtAllLevels: vis.params.showMetricsAtAllLevels, + showToolbar: vis.params.showToolbar, + showTotal: vis.params.showTotal, + totalFunc: vis.params.totalFunc, + title: vis.title, + metrics: metrics.map(prepareDimension), + buckets: schemas.bucket?.map(prepareDimension), + }; + + const table = buildExpressionFunction('kibana_table', args); + + if (schemas.split_column) { + table.addArgument('splitColumn', prepareDimension(schemas.split_column[0])); + } + + if (schemas.split_row) { + table.addArgument('splitRow', prepareDimension(schemas.split_row[0])); + } + + const ast = buildExpression([esaggs, table]); + + return ast.toAst(); +}; diff --git a/src/plugins/vis_type_table/public/types.ts b/src/plugins/vis_types/table/public/types.ts similarity index 100% rename from src/plugins/vis_type_table/public/types.ts rename to src/plugins/vis_types/table/public/types.ts diff --git a/src/plugins/vis_type_table/public/utils/add_percentage_column.test.ts b/src/plugins/vis_types/table/public/utils/add_percentage_column.test.ts similarity index 100% rename from src/plugins/vis_type_table/public/utils/add_percentage_column.test.ts rename to src/plugins/vis_types/table/public/utils/add_percentage_column.test.ts diff --git a/src/plugins/vis_type_table/public/utils/add_percentage_column.ts b/src/plugins/vis_types/table/public/utils/add_percentage_column.ts similarity index 100% rename from src/plugins/vis_type_table/public/utils/add_percentage_column.ts rename to src/plugins/vis_types/table/public/utils/add_percentage_column.ts diff --git a/src/plugins/vis_type_table/public/utils/create_formatted_table.test.ts b/src/plugins/vis_types/table/public/utils/create_formatted_table.test.ts similarity index 100% rename from src/plugins/vis_type_table/public/utils/create_formatted_table.test.ts rename to src/plugins/vis_types/table/public/utils/create_formatted_table.test.ts diff --git a/src/plugins/vis_type_table/public/utils/create_formatted_table.ts b/src/plugins/vis_types/table/public/utils/create_formatted_table.ts similarity index 100% rename from src/plugins/vis_type_table/public/utils/create_formatted_table.ts rename to src/plugins/vis_types/table/public/utils/create_formatted_table.ts diff --git a/src/plugins/vis_type_table/public/utils/index.ts b/src/plugins/vis_types/table/public/utils/index.ts similarity index 100% rename from src/plugins/vis_type_table/public/utils/index.ts rename to src/plugins/vis_types/table/public/utils/index.ts diff --git a/src/plugins/vis_type_table/public/utils/table_vis_response_handler.test.ts b/src/plugins/vis_types/table/public/utils/table_vis_response_handler.test.ts similarity index 100% rename from src/plugins/vis_type_table/public/utils/table_vis_response_handler.test.ts rename to src/plugins/vis_types/table/public/utils/table_vis_response_handler.test.ts diff --git a/src/plugins/vis_type_table/public/utils/table_vis_response_handler.ts b/src/plugins/vis_types/table/public/utils/table_vis_response_handler.ts similarity index 100% rename from src/plugins/vis_type_table/public/utils/table_vis_response_handler.ts rename to src/plugins/vis_types/table/public/utils/table_vis_response_handler.ts diff --git a/src/plugins/vis_type_table/public/utils/use/index.ts b/src/plugins/vis_types/table/public/utils/use/index.ts similarity index 100% rename from src/plugins/vis_type_table/public/utils/use/index.ts rename to src/plugins/vis_types/table/public/utils/use/index.ts diff --git a/src/plugins/vis_type_table/public/utils/use/use_pagination.test.ts b/src/plugins/vis_types/table/public/utils/use/use_pagination.test.ts similarity index 100% rename from src/plugins/vis_type_table/public/utils/use/use_pagination.test.ts rename to src/plugins/vis_types/table/public/utils/use/use_pagination.test.ts diff --git a/src/plugins/vis_type_table/public/utils/use/use_pagination.ts b/src/plugins/vis_types/table/public/utils/use/use_pagination.ts similarity index 100% rename from src/plugins/vis_type_table/public/utils/use/use_pagination.ts rename to src/plugins/vis_types/table/public/utils/use/use_pagination.ts diff --git a/src/plugins/vis_type_table/public/utils/use/use_ui_state.test.ts b/src/plugins/vis_types/table/public/utils/use/use_ui_state.test.ts similarity index 100% rename from src/plugins/vis_type_table/public/utils/use/use_ui_state.test.ts rename to src/plugins/vis_types/table/public/utils/use/use_ui_state.test.ts diff --git a/src/plugins/vis_type_table/public/utils/use/use_ui_state.ts b/src/plugins/vis_types/table/public/utils/use/use_ui_state.ts similarity index 100% rename from src/plugins/vis_type_table/public/utils/use/use_ui_state.ts rename to src/plugins/vis_types/table/public/utils/use/use_ui_state.ts diff --git a/src/plugins/vis_types/table/server/index.ts b/src/plugins/vis_types/table/server/index.ts new file mode 100644 index 0000000000000..b98fdd9c445db --- /dev/null +++ b/src/plugins/vis_types/table/server/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 { CoreSetup, PluginConfigDescriptor } from 'kibana/server'; +import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; + +import { configSchema, ConfigSchema } from '../config'; +import { registerVisTypeTableUsageCollector } from './usage_collector'; + +export const config: PluginConfigDescriptor = { + schema: configSchema, + deprecations: ({ renameFromRoot }) => [ + renameFromRoot('table_vis.enabled', 'vis_type_table.enabled'), + ], +}; + +export const plugin = () => ({ + setup(core: CoreSetup, plugins: { usageCollection?: UsageCollectionSetup }) { + if (plugins.usageCollection) { + registerVisTypeTableUsageCollector(plugins.usageCollection); + } + }, + start() {}, +}); diff --git a/src/plugins/vis_type_table/server/usage_collector/get_stats.test.ts b/src/plugins/vis_types/table/server/usage_collector/get_stats.test.ts similarity index 96% rename from src/plugins/vis_type_table/server/usage_collector/get_stats.test.ts rename to src/plugins/vis_types/table/server/usage_collector/get_stats.test.ts index 76f067e3a23d7..4c91def40300e 100644 --- a/src/plugins/vis_type_table/server/usage_collector/get_stats.test.ts +++ b/src/plugins/vis_types/table/server/usage_collector/get_stats.test.ts @@ -7,7 +7,7 @@ */ import { getStats } from './get_stats'; -import type { SavedObjectsClientContract } from '../../../../core/server'; +import type { SavedObjectsClientContract } from '../../../../../core/server'; const mockVisualizations = { saved_objects: [ diff --git a/src/plugins/vis_type_table/server/usage_collector/get_stats.ts b/src/plugins/vis_types/table/server/usage_collector/get_stats.ts similarity index 95% rename from src/plugins/vis_type_table/server/usage_collector/get_stats.ts rename to src/plugins/vis_types/table/server/usage_collector/get_stats.ts index ef948c2d7b70b..ac8d759c94c76 100644 --- a/src/plugins/vis_type_table/server/usage_collector/get_stats.ts +++ b/src/plugins/vis_types/table/server/usage_collector/get_stats.ts @@ -12,8 +12,8 @@ import type { ISavedObjectsRepository, SavedObjectsClientContract, SavedObjectsFindResult, -} from '../../../../core/server'; -import type { SavedVisState } from '../../../visualizations/common'; +} from '../../../../../core/server'; +import type { SavedVisState } from '../../../../visualizations/common'; export interface VisTypeTableUsage { /** diff --git a/src/plugins/vis_type_table/server/usage_collector/index.ts b/src/plugins/vis_types/table/server/usage_collector/index.ts similarity index 100% rename from src/plugins/vis_type_table/server/usage_collector/index.ts rename to src/plugins/vis_types/table/server/usage_collector/index.ts diff --git a/src/plugins/vis_type_table/server/usage_collector/register_usage_collector.test.ts b/src/plugins/vis_types/table/server/usage_collector/register_usage_collector.test.ts similarity index 97% rename from src/plugins/vis_type_table/server/usage_collector/register_usage_collector.test.ts rename to src/plugins/vis_types/table/server/usage_collector/register_usage_collector.test.ts index d32435ac45406..b65c698f219a6 100644 --- a/src/plugins/vis_type_table/server/usage_collector/register_usage_collector.test.ts +++ b/src/plugins/vis_types/table/server/usage_collector/register_usage_collector.test.ts @@ -9,7 +9,7 @@ import { createUsageCollectionSetupMock, createCollectorFetchContextMock, -} from '../../../usage_collection/server/mocks'; +} from '../../../../usage_collection/server/mocks'; import { registerVisTypeTableUsageCollector } from './register_usage_collector'; import { getStats } from './get_stats'; diff --git a/src/plugins/vis_type_table/server/usage_collector/register_usage_collector.ts b/src/plugins/vis_types/table/server/usage_collector/register_usage_collector.ts similarity index 92% rename from src/plugins/vis_type_table/server/usage_collector/register_usage_collector.ts rename to src/plugins/vis_types/table/server/usage_collector/register_usage_collector.ts index 74044c9ae70c0..ed176fc9222bc 100644 --- a/src/plugins/vis_type_table/server/usage_collector/register_usage_collector.ts +++ b/src/plugins/vis_types/table/server/usage_collector/register_usage_collector.ts @@ -7,7 +7,7 @@ */ import { getStats, VisTypeTableUsage } from './get_stats'; -import type { UsageCollectionSetup } from '../../../usage_collection/server'; +import type { UsageCollectionSetup } from '../../../../usage_collection/server'; export function registerVisTypeTableUsageCollector(collectorSet: UsageCollectionSetup) { const collector = collectorSet.makeUsageCollector({ diff --git a/src/plugins/vis_types/table/tsconfig.json b/src/plugins/vis_types/table/tsconfig.json new file mode 100644 index 0000000000000..9325064d571d0 --- /dev/null +++ b/src/plugins/vis_types/table/tsconfig.json @@ -0,0 +1,28 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + "*.ts" + ], + "references": [ + { "path": "../../../core/tsconfig.json" }, + { "path": "../../data/tsconfig.json" }, + { "path": "../../visualizations/tsconfig.json" }, + { "path": "../../share/tsconfig.json" }, + { "path": "../../usage_collection/tsconfig.json" }, + { "path": "../../expressions/tsconfig.json" }, + { "path": "../../kibana_utils/tsconfig.json" }, + { "path": "../../kibana_legacy/tsconfig.json" }, + { "path": "../../kibana_react/tsconfig.json" }, + { "path": "../../vis_default_editor/tsconfig.json" }, + { "path": "../../field_formats/tsconfig.json" } + ] +} diff --git a/src/plugins/vis_types/tagcloud/config.ts b/src/plugins/vis_types/tagcloud/config.ts new file mode 100644 index 0000000000000..b831d26854c30 --- /dev/null +++ b/src/plugins/vis_types/tagcloud/config.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 { schema, TypeOf } from '@kbn/config-schema'; + +export const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: true }), +}); + +export type ConfigSchema = TypeOf; diff --git a/src/plugins/vis_types/tagcloud/jest.config.js b/src/plugins/vis_types/tagcloud/jest.config.js new file mode 100644 index 0000000000000..9785690d5e8b4 --- /dev/null +++ b/src/plugins/vis_types/tagcloud/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../..', + roots: ['/src/plugins/vis_types/tagcloud'], + testRunner: 'jasmine2', + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_types/tagcloud', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/vis_types/tagcloud/{public,server}/**/*.{ts,tsx}'], +}; diff --git a/src/plugins/vis_type_tagcloud/kibana.json b/src/plugins/vis_types/tagcloud/kibana.json similarity index 100% rename from src/plugins/vis_type_tagcloud/kibana.json rename to src/plugins/vis_types/tagcloud/kibana.json diff --git a/src/plugins/vis_types/tagcloud/public/__snapshots__/to_ast.test.ts.snap b/src/plugins/vis_types/tagcloud/public/__snapshots__/to_ast.test.ts.snap new file mode 100644 index 0000000000000..9e4c3071db8d6 --- /dev/null +++ b/src/plugins/vis_types/tagcloud/public/__snapshots__/to_ast.test.ts.snap @@ -0,0 +1,292 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`tagcloud vis toExpressionAst function should match snapshot params fulfilled with DatatableColumn vis_dimension.accessor at metric 1`] = ` +Object { + "chain": Array [ + Object { + "arguments": Object { + "aggs": Array [], + "index": Array [ + Object { + "chain": Array [ + Object { + "arguments": Object { + "id": Array [ + "123", + ], + }, + "function": "indexPatternLoad", + "type": "function", + }, + ], + "type": "expression", + }, + ], + "metricsAtAllLevels": Array [ + false, + ], + "partialRows": Array [ + false, + ], + }, + "function": "esaggs", + "type": "function", + }, + Object { + "arguments": Object { + "bucket": Array [ + Object { + "chain": Array [ + Object { + "arguments": Object { + "accessor": Array [ + 0, + ], + "format": Array [ + "terms", + ], + "formatParams": Array [ + "{\\"id\\":\\"string\\",\\"otherBucketLabel\\":\\"Other\\",\\"missingBucketLabel\\":\\"Missing\\"}", + ], + }, + "function": "visdimension", + "type": "function", + }, + ], + "type": "expression", + }, + ], + "maxFontSize": Array [ + 15, + ], + "metric": Array [ + Object { + "chain": Array [ + Object { + "arguments": Object { + "accessor": Array [ + 1, + ], + "format": Array [ + "number", + ], + }, + "function": "visdimension", + "type": "function", + }, + ], + "type": "expression", + }, + ], + "minFontSize": Array [ + 5, + ], + "orientation": Array [ + "single", + ], + "palette": Array [ + "default", + ], + "scale": Array [ + "linear", + ], + "showLabel": Array [ + true, + ], + }, + "function": "tagcloud", + "type": "function", + }, + ], + "type": "expression", +} +`; + +exports[`tagcloud vis toExpressionAst function should match snapshot params fulfilled with number vis_dimension.accessor at metric 1`] = ` +Object { + "chain": Array [ + Object { + "arguments": Object { + "aggs": Array [], + "index": Array [ + Object { + "chain": Array [ + Object { + "arguments": Object { + "id": Array [ + "123", + ], + }, + "function": "indexPatternLoad", + "type": "function", + }, + ], + "type": "expression", + }, + ], + "metricsAtAllLevels": Array [ + false, + ], + "partialRows": Array [ + false, + ], + }, + "function": "esaggs", + "type": "function", + }, + Object { + "arguments": Object { + "bucket": Array [ + Object { + "chain": Array [ + Object { + "arguments": Object { + "accessor": Array [ + 0, + ], + "format": Array [ + "terms", + ], + "formatParams": Array [ + "{\\"id\\":\\"string\\",\\"otherBucketLabel\\":\\"Other\\",\\"missingBucketLabel\\":\\"Missing\\"}", + ], + }, + "function": "visdimension", + "type": "function", + }, + ], + "type": "expression", + }, + ], + "maxFontSize": Array [ + 15, + ], + "metric": Array [ + Object { + "chain": Array [ + Object { + "arguments": Object { + "accessor": Array [ + 1, + ], + "format": Array [ + "number", + ], + }, + "function": "visdimension", + "type": "function", + }, + ], + "type": "expression", + }, + ], + "minFontSize": Array [ + 5, + ], + "orientation": Array [ + "single", + ], + "palette": Array [ + "default", + ], + "scale": Array [ + "linear", + ], + "showLabel": Array [ + true, + ], + }, + "function": "tagcloud", + "type": "function", + }, + ], + "type": "expression", +} +`; + +exports[`tagcloud vis toExpressionAst function should match snapshot without params 1`] = ` +Object { + "chain": Array [ + Object { + "arguments": Object { + "aggs": Array [], + "index": Array [ + Object { + "chain": Array [ + Object { + "arguments": Object { + "id": Array [ + "123", + ], + }, + "function": "indexPatternLoad", + "type": "function", + }, + ], + "type": "expression", + }, + ], + "metricsAtAllLevels": Array [ + false, + ], + "partialRows": Array [ + false, + ], + }, + "function": "esaggs", + "type": "function", + }, + Object { + "arguments": Object { + "bucket": Array [ + Object { + "chain": Array [ + Object { + "arguments": Object { + "accessor": Array [ + 0, + ], + "format": Array [ + "terms", + ], + "formatParams": Array [ + "{\\"id\\":\\"string\\",\\"otherBucketLabel\\":\\"Other\\",\\"missingBucketLabel\\":\\"Missing\\"}", + ], + }, + "function": "visdimension", + "type": "function", + }, + ], + "type": "expression", + }, + ], + "metric": Array [ + Object { + "chain": Array [ + Object { + "arguments": Object { + "accessor": Array [ + 1, + ], + "format": Array [ + "number", + ], + }, + "function": "visdimension", + "type": "function", + }, + ], + "type": "expression", + }, + ], + "showLabel": Array [ + false, + ], + }, + "function": "tagcloud", + "type": "function", + }, + ], + "type": "expression", +} +`; diff --git a/src/plugins/vis_type_tagcloud/public/components/collections.ts b/src/plugins/vis_types/tagcloud/public/components/collections.ts similarity index 100% rename from src/plugins/vis_type_tagcloud/public/components/collections.ts rename to src/plugins/vis_types/tagcloud/public/components/collections.ts diff --git a/src/plugins/vis_type_tagcloud/public/components/get_tag_cloud_options.tsx b/src/plugins/vis_types/tagcloud/public/components/get_tag_cloud_options.tsx similarity index 100% rename from src/plugins/vis_type_tagcloud/public/components/get_tag_cloud_options.tsx rename to src/plugins/vis_types/tagcloud/public/components/get_tag_cloud_options.tsx diff --git a/src/plugins/vis_type_tagcloud/public/components/tag_cloud_options.tsx b/src/plugins/vis_types/tagcloud/public/components/tag_cloud_options.tsx similarity index 92% rename from src/plugins/vis_type_tagcloud/public/components/tag_cloud_options.tsx rename to src/plugins/vis_types/tagcloud/public/components/tag_cloud_options.tsx index 6682799a8038a..ff5f1e6edd6f8 100644 --- a/src/plugins/vis_type_tagcloud/public/components/tag_cloud_options.tsx +++ b/src/plugins/vis_types/tagcloud/public/components/tag_cloud_options.tsx @@ -9,10 +9,10 @@ import React, { useState, useEffect } from 'react'; import { EuiPanel } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import type { PaletteRegistry } from '../../../charts/public'; -import { VisEditorOptionsProps } from '../../../visualizations/public'; -import { SelectOption, SwitchOption, PalettePicker } from '../../../vis_default_editor/public'; -import { ValidatedDualRange } from '../../../kibana_react/public'; +import type { PaletteRegistry } from '../../../../charts/public'; +import { VisEditorOptionsProps } from '../../../../visualizations/public'; +import { SelectOption, SwitchOption, PalettePicker } from '../../../../vis_default_editor/public'; +import { ValidatedDualRange } from '../../../../kibana_react/public'; import { TagCloudVisParams, TagCloudTypeProps } from '../types'; import { collections } from './collections'; diff --git a/src/plugins/vis_type_tagcloud/public/index.ts b/src/plugins/vis_types/tagcloud/public/index.ts similarity index 100% rename from src/plugins/vis_type_tagcloud/public/index.ts rename to src/plugins/vis_types/tagcloud/public/index.ts diff --git a/src/plugins/vis_types/tagcloud/public/plugin.ts b/src/plugins/vis_types/tagcloud/public/plugin.ts new file mode 100644 index 0000000000000..cc99480de7099 --- /dev/null +++ b/src/plugins/vis_types/tagcloud/public/plugin.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 { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'kibana/public'; +import { VisualizationsSetup } from '../../../visualizations/public'; +import { ChartsPluginSetup } from '../../../charts/public'; + +import { getTagCloudVisTypeDefinition } from './tag_cloud_type'; +import { ConfigSchema } from '../config'; + +/** @internal */ +export interface TagCloudPluginSetupDependencies { + visualizations: VisualizationsSetup; + charts: ChartsPluginSetup; +} + +/** @internal */ +export interface TagCloudVisDependencies { + palettes: ChartsPluginSetup['palettes']; +} + +/** @internal */ +export class TagCloudPlugin implements Plugin { + initializerContext: PluginInitializerContext; + + constructor(initializerContext: PluginInitializerContext) { + this.initializerContext = initializerContext; + } + + public setup(core: CoreSetup, { visualizations, charts }: TagCloudPluginSetupDependencies) { + const visualizationDependencies: TagCloudVisDependencies = { + palettes: charts.palettes, + }; + + visualizations.createBaseVisualization(getTagCloudVisTypeDefinition(visualizationDependencies)); + } + + public start(core: CoreStart) {} +} diff --git a/src/plugins/vis_type_tagcloud/public/tag_cloud_type.ts b/src/plugins/vis_types/tagcloud/public/tag_cloud_type.ts similarity index 94% rename from src/plugins/vis_type_tagcloud/public/tag_cloud_type.ts rename to src/plugins/vis_types/tagcloud/public/tag_cloud_type.ts index b3ab5cd3d7af7..a193a7fecc1fd 100644 --- a/src/plugins/vis_type_tagcloud/public/tag_cloud_type.ts +++ b/src/plugins/vis_types/tagcloud/public/tag_cloud_type.ts @@ -7,8 +7,8 @@ */ import { i18n } from '@kbn/i18n'; -import { AggGroupNames } from '../../data/public'; -import { VIS_EVENT_TO_TRIGGER } from '../../visualizations/public'; +import { AggGroupNames } from '../../../data/public'; +import { VIS_EVENT_TO_TRIGGER } from '../../../visualizations/public'; import { getTagCloudOptions } from './components/get_tag_cloud_options'; import { toExpressionAst } from './to_ast'; diff --git a/src/plugins/vis_types/tagcloud/public/to_ast.test.ts b/src/plugins/vis_types/tagcloud/public/to_ast.test.ts new file mode 100644 index 0000000000000..6de1d4fb3e75d --- /dev/null +++ b/src/plugins/vis_types/tagcloud/public/to_ast.test.ts @@ -0,0 +1,117 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Vis, VisToExpressionAstParams } from '../../../visualizations/public'; +import { toExpressionAst } from './to_ast'; +import { TagCloudVisParams } from './types'; + +const mockedSchemas = { + metric: [{ accessor: 1, format: { id: 'number' }, params: {}, label: 'Count', aggType: 'count' }], + segment: [ + { + accessor: 0, + format: { + id: 'terms', + params: { + id: 'string', + otherBucketLabel: 'Other', + missingBucketLabel: 'Missing', + }, + }, + params: {}, + label: 'products.product_name.keyword: Descending', + aggType: 'terms', + }, + ], +}; + +jest.mock('../../../visualizations/public', () => ({ + getVisSchemas: () => mockedSchemas, +})); + +describe('tagcloud vis toExpressionAst function', () => { + let vis: Vis; + + beforeEach(() => { + vis = ({ + isHierarchical: () => false, + type: {}, + params: { + showLabel: false, + }, + data: { + indexPattern: { id: '123' }, + aggs: { + getResponseAggs: () => [], + aggs: [], + }, + }, + } as unknown) as Vis; + }); + + it('should match snapshot without params', () => { + const actual = toExpressionAst(vis, {} as VisToExpressionAstParams); + expect(actual).toMatchSnapshot(); + }); + + it('should match snapshot params fulfilled with number vis_dimension.accessor at metric', () => { + vis.params = { + scale: 'linear', + orientation: 'single', + minFontSize: 5, + maxFontSize: 15, + showLabel: true, + palette: { + type: 'palette', + name: 'default', + }, + metric: { + type: 'vis_dimension', + accessor: 0, + format: { + id: 'number', + params: { + id: 'number', + }, + }, + }, + }; + const actual = toExpressionAst(vis, {} as VisToExpressionAstParams); + expect(actual).toMatchSnapshot(); + }); + + it('should match snapshot params fulfilled with DatatableColumn vis_dimension.accessor at metric', () => { + vis.params = { + scale: 'linear', + orientation: 'single', + minFontSize: 5, + maxFontSize: 15, + showLabel: true, + palette: { + type: 'palette', + name: 'default', + }, + metric: { + type: 'vis_dimension', + accessor: { + id: 'count', + name: 'count', + meta: { type: 'number' }, + }, + format: { + id: 'number', + params: { + id: 'number', + }, + }, + }, + }; + const actual = toExpressionAst(vis, {} as VisToExpressionAstParams); + expect(actual).toMatchSnapshot(); + }); +}); diff --git a/src/plugins/vis_types/tagcloud/public/to_ast.ts b/src/plugins/vis_types/tagcloud/public/to_ast.ts new file mode 100644 index 0000000000000..b5256c586d1da --- /dev/null +++ b/src/plugins/vis_types/tagcloud/public/to_ast.ts @@ -0,0 +1,60 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { + EsaggsExpressionFunctionDefinition, + IndexPatternLoadExpressionFunctionDefinition, +} from '../../../data/public'; +import { buildExpression, buildExpressionFunction } from '../../../expressions/public'; +import { getVisSchemas, SchemaConfig, VisToExpressionAst } from '../../../visualizations/public'; +import { TagCloudVisParams } from './types'; + +const prepareDimension = (params: SchemaConfig) => { + const visdimension = buildExpressionFunction('visdimension', { accessor: params.accessor }); + + if (params.format) { + visdimension.addArgument('format', params.format.id); + visdimension.addArgument('formatParams', JSON.stringify(params.format.params)); + } + + return buildExpression([visdimension]); +}; + +export const toExpressionAst: VisToExpressionAst = (vis, params) => { + const esaggs = buildExpressionFunction('esaggs', { + index: buildExpression([ + buildExpressionFunction('indexPatternLoad', { + id: vis.data.indexPattern!.id!, + }), + ]), + metricsAtAllLevels: vis.isHierarchical(), + partialRows: false, + aggs: vis.data.aggs!.aggs.map((agg) => buildExpression(agg.toExpressionAst())), + }); + + const schemas = getVisSchemas(vis, params); + const { scale, orientation, minFontSize, maxFontSize, showLabel, palette } = vis.params; + + const tagcloud = buildExpressionFunction('tagcloud', { + scale, + orientation, + minFontSize, + maxFontSize, + showLabel, + metric: prepareDimension(schemas.metric[0]), + palette: palette?.name, + }); + + if (schemas.segment) { + tagcloud.addArgument('bucket', prepareDimension(schemas.segment[0])); + } + + const ast = buildExpression([esaggs, tagcloud]); + + return ast.toAst(); +}; diff --git a/src/plugins/vis_types/tagcloud/public/types.ts b/src/plugins/vis_types/tagcloud/public/types.ts new file mode 100644 index 0000000000000..996555ae99f83 --- /dev/null +++ b/src/plugins/vis_types/tagcloud/public/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 { ChartsPluginSetup, PaletteOutput } from '../../../charts/public'; +import { ExpressionValueVisDimension } from '../../../visualizations/public'; + +interface TagCloudCommonParams { + scale: 'linear' | 'log' | 'square root'; + orientation: 'single' | 'right angled' | 'multiple'; + minFontSize: number; + maxFontSize: number; + showLabel: boolean; +} + +export interface TagCloudVisParams extends TagCloudCommonParams { + palette: PaletteOutput; + metric: ExpressionValueVisDimension; + bucket?: ExpressionValueVisDimension; +} + +export interface TagCloudTypeProps { + palettes: ChartsPluginSetup['palettes']; +} diff --git a/src/plugins/vis_type_tagcloud/server/index.ts b/src/plugins/vis_types/tagcloud/server/index.ts similarity index 100% rename from src/plugins/vis_type_tagcloud/server/index.ts rename to src/plugins/vis_types/tagcloud/server/index.ts diff --git a/src/plugins/vis_types/tagcloud/tsconfig.json b/src/plugins/vis_types/tagcloud/tsconfig.json new file mode 100644 index 0000000000000..4087f9f04c92b --- /dev/null +++ b/src/plugins/vis_types/tagcloud/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + "public/**/*", + "server/**/*", + "*.ts" + ], + "references": [ + { "path": "../../../core/tsconfig.json" }, + { "path": "../../data/tsconfig.json" }, + { "path": "../../expressions/tsconfig.json" }, + { "path": "../../visualizations/tsconfig.json" }, + { "path": "../../charts/tsconfig.json" }, + { "path": "../../kibana_react/tsconfig.json" }, + { "path": "../../vis_default_editor/tsconfig.json" }, + ] +} diff --git a/src/plugins/vis_types/timelion/README.md b/src/plugins/vis_types/timelion/README.md new file mode 100644 index 0000000000000..145774e768e9e --- /dev/null +++ b/src/plugins/vis_types/timelion/README.md @@ -0,0 +1,6 @@ +# Vis type Timelion + +Contains the timelion visualization and the timelion backend. + +# Generate a parser +If your grammar was changed in `packages/@kbn-timelion-grammar` you need to re-generate the static parser. You can do this with `yarn kbn build`. \ No newline at end of file diff --git a/src/plugins/vis_type_timelion/common/constants.ts b/src/plugins/vis_types/timelion/common/constants.ts similarity index 100% rename from src/plugins/vis_type_timelion/common/constants.ts rename to src/plugins/vis_types/timelion/common/constants.ts diff --git a/src/plugins/vis_type_timelion/common/lib/calculate_interval.test.ts b/src/plugins/vis_types/timelion/common/lib/calculate_interval.test.ts similarity index 100% rename from src/plugins/vis_type_timelion/common/lib/calculate_interval.test.ts rename to src/plugins/vis_types/timelion/common/lib/calculate_interval.test.ts diff --git a/src/plugins/vis_type_timelion/common/lib/calculate_interval.ts b/src/plugins/vis_types/timelion/common/lib/calculate_interval.ts similarity index 100% rename from src/plugins/vis_type_timelion/common/lib/calculate_interval.ts rename to src/plugins/vis_types/timelion/common/lib/calculate_interval.ts diff --git a/src/plugins/vis_type_timelion/common/lib/index.ts b/src/plugins/vis_types/timelion/common/lib/index.ts similarity index 100% rename from src/plugins/vis_type_timelion/common/lib/index.ts rename to src/plugins/vis_types/timelion/common/lib/index.ts diff --git a/src/plugins/vis_type_timelion/common/lib/to_milliseconds.ts b/src/plugins/vis_types/timelion/common/lib/to_milliseconds.ts similarity index 100% rename from src/plugins/vis_type_timelion/common/lib/to_milliseconds.ts rename to src/plugins/vis_types/timelion/common/lib/to_milliseconds.ts diff --git a/src/plugins/vis_type_timelion/common/parser.ts b/src/plugins/vis_types/timelion/common/parser.ts similarity index 96% rename from src/plugins/vis_type_timelion/common/parser.ts rename to src/plugins/vis_types/timelion/common/parser.ts index b6c16a6f7b4ed..dc1bbf1e42440 100644 --- a/src/plugins/vis_type_timelion/common/parser.ts +++ b/src/plugins/vis_types/timelion/common/parser.ts @@ -7,7 +7,7 @@ */ // @ts-ignore -import { parse } from './_generated_/chain'; +import { parse } from '@kbn/timelion-grammar'; export interface ExpressionLocation { min: number; diff --git a/src/plugins/vis_type_timelion/common/parser_async.ts b/src/plugins/vis_types/timelion/common/parser_async.ts similarity index 100% rename from src/plugins/vis_type_timelion/common/parser_async.ts rename to src/plugins/vis_types/timelion/common/parser_async.ts diff --git a/src/plugins/vis_type_timelion/common/types.ts b/src/plugins/vis_types/timelion/common/types.ts similarity index 100% rename from src/plugins/vis_type_timelion/common/types.ts rename to src/plugins/vis_types/timelion/common/types.ts diff --git a/src/plugins/vis_type_timelion/common/vis_data.ts b/src/plugins/vis_types/timelion/common/vis_data.ts similarity index 100% rename from src/plugins/vis_type_timelion/common/vis_data.ts rename to src/plugins/vis_types/timelion/common/vis_data.ts diff --git a/src/plugins/vis_types/timelion/config.ts b/src/plugins/vis_types/timelion/config.ts new file mode 100644 index 0000000000000..cfd3d13c277e9 --- /dev/null +++ b/src/plugins/vis_types/timelion/config.ts @@ -0,0 +1,16 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { schema, TypeOf } from '@kbn/config-schema'; + +export const configSchema = schema.object({ + graphiteUrls: schema.maybe(schema.arrayOf(schema.string())), + enabled: schema.boolean({ defaultValue: true }), +}); + +export type ConfigSchema = TypeOf; diff --git a/src/plugins/vis_types/timelion/jest.config.js b/src/plugins/vis_types/timelion/jest.config.js new file mode 100644 index 0000000000000..a6c7d7b3f230f --- /dev/null +++ b/src/plugins/vis_types/timelion/jest.config.js @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may 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/vis_types/timelion'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_types/timelion', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/vis_types/timelion/{common,public,server}/**/*.{js,ts,tsx}', + ], +}; diff --git a/src/plugins/vis_type_timelion/kibana.json b/src/plugins/vis_types/timelion/kibana.json similarity index 100% rename from src/plugins/vis_type_timelion/kibana.json rename to src/plugins/vis_types/timelion/kibana.json diff --git a/src/plugins/vis_type_timelion/public/__snapshots__/to_ast.test.ts.snap b/src/plugins/vis_types/timelion/public/__snapshots__/to_ast.test.ts.snap similarity index 100% rename from src/plugins/vis_type_timelion/public/__snapshots__/to_ast.test.ts.snap rename to src/plugins/vis_types/timelion/public/__snapshots__/to_ast.test.ts.snap diff --git a/src/plugins/vis_type_timelion/public/components/index.ts b/src/plugins/vis_types/timelion/public/components/index.ts similarity index 100% rename from src/plugins/vis_type_timelion/public/components/index.ts rename to src/plugins/vis_types/timelion/public/components/index.ts diff --git a/src/plugins/vis_type_timelion/public/components/series/area.tsx b/src/plugins/vis_types/timelion/public/components/series/area.tsx similarity index 100% rename from src/plugins/vis_type_timelion/public/components/series/area.tsx rename to src/plugins/vis_types/timelion/public/components/series/area.tsx diff --git a/src/plugins/vis_type_timelion/public/components/series/bar.tsx b/src/plugins/vis_types/timelion/public/components/series/bar.tsx similarity index 100% rename from src/plugins/vis_type_timelion/public/components/series/bar.tsx rename to src/plugins/vis_types/timelion/public/components/series/bar.tsx diff --git a/src/plugins/vis_type_timelion/public/components/series/index.ts b/src/plugins/vis_types/timelion/public/components/series/index.ts similarity index 100% rename from src/plugins/vis_type_timelion/public/components/series/index.ts rename to src/plugins/vis_types/timelion/public/components/series/index.ts diff --git a/src/plugins/vis_type_timelion/public/components/timelion_expression_input.tsx b/src/plugins/vis_types/timelion/public/components/timelion_expression_input.tsx similarity index 96% rename from src/plugins/vis_type_timelion/public/components/timelion_expression_input.tsx rename to src/plugins/vis_types/timelion/public/components/timelion_expression_input.tsx index d518d9718d5e7..dd949f57bce28 100644 --- a/src/plugins/vis_type_timelion/public/components/timelion_expression_input.tsx +++ b/src/plugins/vis_types/timelion/public/components/timelion_expression_input.tsx @@ -11,7 +11,7 @@ import { EuiFormLabel } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { monaco } from '@kbn/monaco'; -import { CodeEditor, useKibana } from '../../../kibana_react/public'; +import { CodeEditor, useKibana } from '../../../../kibana_react/public'; import { suggest, getSuggestion } from './timelion_expression_input_helpers'; import { getArgValueSuggestions } from '../helpers/arg_value_suggestions'; import { ITimelionFunction, TimelionFunctionArgs } from '../../common/types'; @@ -96,7 +96,7 @@ function TimelionExpressionInput({ value, setValue }: TimelionExpressionInputPro
-
+
void; + renderComplete: IInterpreterRenderHandlers['done']; +} + +const DefaultYAxis = () => ( + +); + +const renderYAxis = (series: Series[]) => { + const yAxisOptions = extractAllYAxis(series); + + const yAxis = yAxisOptions.map((option, index) => ( + + )); + + return yAxis.length ? yAxis : ; +}; + +const TimelionVisComponent = ({ + interval, + seriesList, + renderComplete, + onBrushEvent, +}: TimelionVisComponentProps) => { + const kibana = useKibana(); + const chartRef = useRef(null); + const chart = seriesList.list; + const chartsService = getCharts(); + + const chartTheme = chartsService.theme.useChartsTheme(); + const chartBaseTheme = chartsService.theme.useChartsBaseTheme(); + + const handleCursorUpdate = useActiveCursor(chartsService.activeCursor, chartRef, { + isDateHistogram: true, + }); + + const brushEndListener = useCallback( + ({ x }) => { + if (!x) { + return; + } + + onBrushEvent({ + gte: x[0], + lte: x[1], + }); + }, + [onBrushEvent] + ); + + const onRenderChange = useCallback( + (isRendered: boolean) => { + if (isRendered) { + renderComplete(); + } + }, + [renderComplete] + ); + + const title: string = useMemo(() => last(compact(map(seriesList.list, '_title'))) || '', [ + seriesList.list, + ]); + + const tickFormat = useMemo( + () => createTickFormat(interval, kibana.services.timefilter, kibana.services.uiSettings), + [interval, kibana.services.timefilter, kibana.services.uiSettings] + ); + + const legend = useMemo(() => { + const legendPosition: LegendPositionConfig = { + floating: true, + floatingColumns: 1, + vAlign: Position.Top, + hAlign: Position.Left, + direction: LayoutDirection.Vertical, + }; + let showLegend = true; + + chart.forEach((series) => { + if (series._global?.legend) { + const { show = true, position, noColumns = legendPosition.floatingColumns } = + series._global?.legend ?? {}; + + if (validateLegendPositionValue(position)) { + const [vAlign, hAlign] = position.split(''); + + legendPosition.vAlign = vAlign === 'n' ? Position.Top : Position.Bottom; + legendPosition.hAlign = hAlign === 'e' ? Position.Right : Position.Left; + } + + if (!show) { + showLegend = false; + } + + if (noColumns !== undefined) { + legendPosition.floatingColumns = noColumns; + } + } + }); + + return { legendPosition, showLegend }; + }, [chart]); + + return ( +
+ {title && ( + +

{title}

+
+ )} + + tickFormat(value), + type: TooltipType.VerticalCursor, + }} + externalPointerEvents={{ tooltip: { visible: false } }} + /> + + + + {renderYAxis(chart)} + + {chart.map((data, index) => { + const visData = { ...data }; + const SeriesComponent = data.bars ? BarSeriesComponent : AreaSeriesComponent; + + if (!visData.color) { + visData.color = colors[index % colors.length]; + } + return ( + + ); + })} + +
+ ); +}; + +// default export required for React.Lazy +// eslint-disable-next-line import/no-default-export +export { TimelionVisComponent as default }; diff --git a/src/plugins/vis_type_timelion/public/helpers/arg_value_suggestions.ts b/src/plugins/vis_types/timelion/public/helpers/arg_value_suggestions.ts similarity index 99% rename from src/plugins/vis_type_timelion/public/helpers/arg_value_suggestions.ts rename to src/plugins/vis_types/timelion/public/helpers/arg_value_suggestions.ts index 8685ed3102fa6..b2f60b4092bf7 100644 --- a/src/plugins/vis_type_timelion/public/helpers/arg_value_suggestions.ts +++ b/src/plugins/vis_types/timelion/public/helpers/arg_value_suggestions.ts @@ -10,7 +10,7 @@ import { get } from 'lodash'; import { getIndexPatterns } from './plugin_services'; import { TimelionFunctionArgs } from '../../common/types'; import { TimelionExpressionFunction, TimelionExpressionArgument } from '../../common/parser'; -import { indexPatterns as indexPatternsUtils, KBN_FIELD_TYPES } from '../../../data/public'; +import { indexPatterns as indexPatternsUtils, KBN_FIELD_TYPES } from '../../../../data/public'; export function getArgValueSuggestions() { const indexPatterns = getIndexPatterns(); diff --git a/src/plugins/vis_type_timelion/public/helpers/chart_constants.ts b/src/plugins/vis_types/timelion/public/helpers/chart_constants.ts similarity index 100% rename from src/plugins/vis_type_timelion/public/helpers/chart_constants.ts rename to src/plugins/vis_types/timelion/public/helpers/chart_constants.ts diff --git a/src/plugins/vis_type_timelion/public/helpers/get_timezone.ts b/src/plugins/vis_types/timelion/public/helpers/get_timezone.ts similarity index 100% rename from src/plugins/vis_type_timelion/public/helpers/get_timezone.ts rename to src/plugins/vis_types/timelion/public/helpers/get_timezone.ts diff --git a/src/plugins/vis_type_timelion/public/helpers/panel_utils.ts b/src/plugins/vis_types/timelion/public/helpers/panel_utils.ts similarity index 100% rename from src/plugins/vis_type_timelion/public/helpers/panel_utils.ts rename to src/plugins/vis_types/timelion/public/helpers/panel_utils.ts diff --git a/src/plugins/vis_type_timelion/public/helpers/plugin_services.ts b/src/plugins/vis_types/timelion/public/helpers/plugin_services.ts similarity index 91% rename from src/plugins/vis_type_timelion/public/helpers/plugin_services.ts rename to src/plugins/vis_types/timelion/public/helpers/plugin_services.ts index 58fcf510ff792..0e9014437b325 100644 --- a/src/plugins/vis_type_timelion/public/helpers/plugin_services.ts +++ b/src/plugins/vis_types/timelion/public/helpers/plugin_services.ts @@ -8,7 +8,7 @@ import type { IndexPatternsContract, ISearchStart } from 'src/plugins/data/public'; import type { ChartsPluginStart } from 'src/plugins/charts/public'; -import { createGetterSetter } from '../../../kibana_utils/public'; +import { createGetterSetter } from '../../../../kibana_utils/public'; export const [getIndexPatterns, setIndexPatterns] = createGetterSetter( 'IndexPatterns' diff --git a/src/plugins/vis_type_timelion/public/helpers/tick_formatters.test.ts b/src/plugins/vis_types/timelion/public/helpers/tick_formatters.test.ts similarity index 100% rename from src/plugins/vis_type_timelion/public/helpers/tick_formatters.test.ts rename to src/plugins/vis_types/timelion/public/helpers/tick_formatters.test.ts diff --git a/src/plugins/vis_type_timelion/public/helpers/tick_formatters.ts b/src/plugins/vis_types/timelion/public/helpers/tick_formatters.ts similarity index 100% rename from src/plugins/vis_type_timelion/public/helpers/tick_formatters.ts rename to src/plugins/vis_types/timelion/public/helpers/tick_formatters.ts diff --git a/src/plugins/vis_type_timelion/public/helpers/tick_generator.test.ts b/src/plugins/vis_types/timelion/public/helpers/tick_generator.test.ts similarity index 100% rename from src/plugins/vis_type_timelion/public/helpers/tick_generator.test.ts rename to src/plugins/vis_types/timelion/public/helpers/tick_generator.test.ts diff --git a/src/plugins/vis_type_timelion/public/helpers/tick_generator.ts b/src/plugins/vis_types/timelion/public/helpers/tick_generator.ts similarity index 100% rename from src/plugins/vis_type_timelion/public/helpers/tick_generator.ts rename to src/plugins/vis_types/timelion/public/helpers/tick_generator.ts diff --git a/src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts b/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts similarity index 99% rename from src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts rename to src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts index ffadfde6204de..e44d74cfd72ab 100644 --- a/src/plugins/vis_type_timelion/public/helpers/timelion_request_handler.ts +++ b/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts @@ -8,7 +8,7 @@ import { i18n } from '@kbn/i18n'; import type { KibanaExecutionContext } from 'kibana/public'; -import { KibanaContext, TimeRange, Filter, esQuery, Query } from '../../../data/public'; +import { KibanaContext, TimeRange, Filter, esQuery, Query } from '../../../../data/public'; import { TimelionVisDependencies } from '../plugin'; import { getTimezone } from './get_timezone'; import { TimelionVisParams } from '../timelion_vis_fn'; diff --git a/src/plugins/vis_type_timelion/public/helpers/xaxis_formatter.ts b/src/plugins/vis_types/timelion/public/helpers/xaxis_formatter.ts similarity index 100% rename from src/plugins/vis_type_timelion/public/helpers/xaxis_formatter.ts rename to src/plugins/vis_types/timelion/public/helpers/xaxis_formatter.ts diff --git a/src/plugins/vis_types/timelion/public/index.ts b/src/plugins/vis_types/timelion/public/index.ts new file mode 100644 index 0000000000000..8161f844e8f73 --- /dev/null +++ b/src/plugins/vis_types/timelion/public/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 'kibana/public'; +import { TimelionVisPlugin as Plugin } from './plugin'; + +export function plugin(initializerContext: PluginInitializerContext) { + return new Plugin(initializerContext); +} + +export { VisTypeTimelionPluginStart } from './plugin'; diff --git a/src/plugins/vis_type_timelion/public/legacy/panel_utils.ts b/src/plugins/vis_types/timelion/public/legacy/panel_utils.ts similarity index 100% rename from src/plugins/vis_type_timelion/public/legacy/panel_utils.ts rename to src/plugins/vis_types/timelion/public/legacy/panel_utils.ts diff --git a/src/plugins/vis_type_timelion/public/legacy/tick_formatters.test.ts b/src/plugins/vis_types/timelion/public/legacy/tick_formatters.test.ts similarity index 100% rename from src/plugins/vis_type_timelion/public/legacy/tick_formatters.test.ts rename to src/plugins/vis_types/timelion/public/legacy/tick_formatters.test.ts diff --git a/src/plugins/vis_type_timelion/public/legacy/tick_formatters.ts b/src/plugins/vis_types/timelion/public/legacy/tick_formatters.ts similarity index 100% rename from src/plugins/vis_type_timelion/public/legacy/tick_formatters.ts rename to src/plugins/vis_types/timelion/public/legacy/tick_formatters.ts diff --git a/src/plugins/vis_type_timelion/public/legacy/timelion_vis.scss b/src/plugins/vis_types/timelion/public/legacy/timelion_vis.scss similarity index 100% rename from src/plugins/vis_type_timelion/public/legacy/timelion_vis.scss rename to src/plugins/vis_types/timelion/public/legacy/timelion_vis.scss diff --git a/src/plugins/vis_types/timelion/public/legacy/timelion_vis_component.tsx b/src/plugins/vis_types/timelion/public/legacy/timelion_vis_component.tsx new file mode 100644 index 0000000000000..1fdb1b37f1c8b --- /dev/null +++ b/src/plugins/vis_types/timelion/public/legacy/timelion_vis_component.tsx @@ -0,0 +1,418 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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, useEffect, useMemo, useCallback } from 'react'; +import $ from 'jquery'; +import moment from 'moment-timezone'; +import { debounce, compact, get, each, cloneDeep, last, map } from 'lodash'; +import { useResizeObserver } from '@elastic/eui'; + +import { IInterpreterRenderHandlers } from 'src/plugins/expressions'; +import { useKibana } from '../../../../kibana_react/public'; +import { DEFAULT_TIME_FORMAT } from '../../common/lib'; + +import { + buildSeriesData, + buildOptions, + SERIES_ID_ATTR, + LegacyAxis, + ACTIVE_CURSOR, + eventBus, +} from './panel_utils'; + +import { Series, Sheet } from '../helpers/timelion_request_handler'; +import { colors } from '../helpers/chart_constants'; +import { tickFormatters } from './tick_formatters'; +import { generateTicksProvider } from '../helpers/tick_generator'; + +import type { TimelionVisDependencies } from '../plugin'; +import type { RangeFilterParams } from '../../../../data/common'; + +import './timelion_vis.scss'; + +interface CrosshairPlot extends jquery.flot.plot { + setCrosshair: (pos: Position) => void; + clearCrosshair: () => void; +} + +interface TimelionVisComponentProps { + onBrushEvent: (rangeFilterParams: RangeFilterParams) => void; + interval: string; + seriesList: Sheet; + renderComplete: IInterpreterRenderHandlers['done']; +} + +interface Position { + x: number; + x1: number; + y: number; + y1: number; + pageX: number; + pageY: number; +} + +interface Range { + to: number; + from: number; +} + +interface Ranges { + xaxis: Range; + yaxis: Range; +} + +const DEBOUNCE_DELAY = 50; +// ensure legend is the same height with or without a caption so legend items do not move around +const emptyCaption = '
'; + +function TimelionVisComponent({ + interval, + seriesList, + renderComplete, + onBrushEvent, +}: TimelionVisComponentProps) { + const kibana = useKibana(); + const [chart, setChart] = useState(() => cloneDeep(seriesList.list)); + const [canvasElem, setCanvasElem] = useState(); + const [chartElem, setChartElem] = useState(null); + + const [originalColorMap, setOriginalColorMap] = useState(() => new Map()); + + const [highlightedSeries, setHighlightedSeries] = useState(null); + const [focusedSeries, setFocusedSeries] = useState(); + const [plot, setPlot] = useState(); + + // Used to toggle the series, and for displaying values on hover + const [legendValueNumbers, setLegendValueNumbers] = useState>(); + const [legendCaption, setLegendCaption] = useState>(); + + const canvasRef = useCallback((node: HTMLDivElement | null) => { + if (node !== null) { + setCanvasElem(node); + } + }, []); + + const elementRef = useCallback((node: HTMLDivElement | null) => { + if (node !== null) { + setChartElem(node); + } + }, []); + + useEffect( + () => () => { + if (chartElem) { + $(chartElem).off('plotselected').off('plothover').off('mouseleave'); + } + }, + [chartElem] + ); + + /* eslint-disable-next-line react-hooks/exhaustive-deps */ + const highlightSeries = useCallback( + debounce(({ currentTarget }: JQuery.TriggeredEvent) => { + const id = Number(currentTarget.getAttribute(SERIES_ID_ATTR)); + if (highlightedSeries === id) { + return; + } + + setHighlightedSeries(id); + setChart((chartState) => + chartState.map((series: Series, seriesIndex: number) => { + series.color = + seriesIndex === id + ? originalColorMap.get(series) // color it like it was + : 'rgba(128,128,128,0.1)'; // mark as grey + + return series; + }) + ); + }, DEBOUNCE_DELAY), + [originalColorMap, highlightedSeries] + ); + + const focusSeries = useCallback( + (event: JQuery.TriggeredEvent) => { + const id = Number(event.currentTarget.getAttribute(SERIES_ID_ATTR)); + setFocusedSeries(id); + highlightSeries(event); + }, + [highlightSeries] + ); + + const toggleSeries = useCallback(({ currentTarget }: JQuery.TriggeredEvent) => { + const id = Number(currentTarget.getAttribute(SERIES_ID_ATTR)); + + setChart((chartState) => + chartState.map((series: Series, seriesIndex: number) => { + if (seriesIndex === id) { + series._hide = !series._hide; + } + return series; + }) + ); + }, []); + + const updateCaption = useCallback( + (plotData: any) => { + if (canvasElem && get(plotData, '[0]._global.legend.showTime', true)) { + const caption = $(''); + caption.html(emptyCaption); + setLegendCaption(caption); + + const canvasNode = $(canvasElem); + canvasNode.find('div.legend table').append(caption); + setLegendValueNumbers(canvasNode.find('.ngLegendValueNumber')); + + const legend = $(canvasElem).find('.ngLegendValue'); + if (legend) { + legend.click(toggleSeries); + legend.focus(focusSeries); + legend.mouseover(highlightSeries); + } + + // legend has been re-created. Apply focus on legend element when previously set + if (focusedSeries || focusedSeries === 0) { + canvasNode.find('div.legend table .legendLabel>span').get(focusedSeries).focus(); + } + } + }, + [focusedSeries, canvasElem, toggleSeries, focusSeries, highlightSeries] + ); + + const updatePlot = useCallback( + (chartValue: Series[], grid?: boolean) => { + if (canvasElem && canvasElem.clientWidth > 0 && canvasElem.clientHeight > 0) { + const options = buildOptions( + interval, + kibana.services.timefilter, + kibana.services.uiSettings, + chartElem?.clientWidth, + grid + ); + const updatedSeries = buildSeriesData(chartValue, options); + + if (options.yaxes) { + options.yaxes.forEach((yaxis: LegacyAxis) => { + if (yaxis && yaxis.units) { + const formatters = tickFormatters(); + yaxis.tickFormatter = formatters[yaxis.units.type as keyof typeof formatters]; + const byteModes = ['bytes', 'bytes/s']; + if (byteModes.includes(yaxis.units.type)) { + yaxis.tickGenerator = generateTicksProvider(); + } + } + }); + } + + const newPlot = $.plot($(canvasElem), updatedSeries, options); + setPlot(newPlot); + renderComplete(); + + updateCaption(newPlot.getData()); + } + }, + [canvasElem, chartElem?.clientWidth, renderComplete, kibana.services, interval, updateCaption] + ); + + const dimensions = useResizeObserver(chartElem); + + useEffect(() => { + updatePlot(chart, seriesList.render && seriesList.render.grid); + }, [chart, updatePlot, seriesList.render, dimensions]); + + useEffect(() => { + const colorsSet: Array<[Series, string]> = []; + const newChart = seriesList.list.map((series: Series, seriesIndex: number) => { + const newSeries = { ...series }; + if (!newSeries.color) { + const colorIndex = seriesIndex % colors.length; + newSeries.color = colors[colorIndex]; + } + colorsSet.push([newSeries, newSeries.color]); + return newSeries; + }); + setChart(newChart); + setOriginalColorMap(new Map(colorsSet)); + }, [seriesList.list]); + + const unhighlightSeries = useCallback(() => { + if (highlightedSeries === null) { + return; + } + + setHighlightedSeries(null); + setFocusedSeries(null); + + setChart((chartState) => + chartState.map((series: Series) => { + series.color = originalColorMap.get(series); // reset the colors + return series; + }) + ); + }, [originalColorMap, highlightedSeries]); + + // Shamelessly borrowed from the flotCrosshairs example + const setLegendNumbers = useCallback( + (pos: Position) => { + unhighlightSeries(); + + const axes = plot!.getAxes(); + if (pos.x < axes.xaxis.min! || pos.x > axes.xaxis.max!) { + return; + } + + const dataset = plot!.getData(); + if (legendCaption) { + legendCaption.text( + moment(pos.x).format(get(dataset, '[0]._global.legend.timeFormat', DEFAULT_TIME_FORMAT)) + ); + } + for (let i = 0; i < dataset.length; ++i) { + const series = dataset[i]; + const useNearestPoint = series.lines!.show && !series.lines!.steps; + const precision = get(series, '_meta.precision', 2); + + // We're setting this flag on top on the series object belonging to the flot library, so we're simply casting here. + if ((series as { _hide?: boolean })._hide) { + continue; + } + + const currentPoint = series.data.find((point: [number, number], index: number) => { + if (index + 1 === series.data.length) { + return true; + } + if (useNearestPoint) { + return pos.x - point[0] < series.data[index + 1][0] - pos.x; + } else { + return pos.x < series.data[index + 1][0]; + } + }); + + const y = currentPoint[1]; + + if (legendValueNumbers) { + if (y == null) { + legendValueNumbers.eq(i).empty(); + } else { + let label = y.toFixed(precision); + const formatter = ((series.yaxis as unknown) as LegacyAxis).tickFormatter; + if (formatter) { + label = formatter(Number(label), (series.yaxis as unknown) as LegacyAxis); + } + legendValueNumbers.eq(i).text(`(${label})`); + } + } + } + }, + [plot, legendValueNumbers, unhighlightSeries, legendCaption] + ); + + /* eslint-disable-next-line react-hooks/exhaustive-deps */ + const debouncedSetLegendNumbers = useCallback( + debounce(setLegendNumbers, DEBOUNCE_DELAY, { + maxWait: DEBOUNCE_DELAY, + leading: true, + trailing: false, + }), + [setLegendNumbers] + ); + + const clearLegendNumbers = useCallback(() => { + if (legendCaption) { + legendCaption.html(emptyCaption); + } + each(legendValueNumbers!, (num: Node) => { + $(num).empty(); + }); + }, [legendCaption, legendValueNumbers]); + + const plotHover = useCallback( + (pos: Position) => { + (plot as CrosshairPlot).setCrosshair(pos); + debouncedSetLegendNumbers(pos); + }, + [plot, debouncedSetLegendNumbers] + ); + + const plotHoverHandler = useCallback( + (event: JQuery.TriggeredEvent, pos: Position) => { + if (!plot) { + return; + } + plotHover(pos); + eventBus.trigger(ACTIVE_CURSOR, [event, pos]); + }, + [plot, plotHover] + ); + + useEffect(() => { + const updateCursor = (_: any, event: JQuery.TriggeredEvent, pos: Position) => { + if (!plot) { + return; + } + plotHover(pos); + }; + + eventBus.on(ACTIVE_CURSOR, updateCursor); + + return () => { + eventBus.off(ACTIVE_CURSOR, updateCursor); + }; + }, [plot, plotHover]); + + const mouseLeaveHandler = useCallback(() => { + if (!plot) { + return; + } + (plot as CrosshairPlot).clearCrosshair(); + clearLegendNumbers(); + }, [plot, clearLegendNumbers]); + + const plotSelectedHandler = useCallback( + (event: JQuery.TriggeredEvent, ranges: Ranges) => { + onBrushEvent({ + gte: ranges.xaxis.from, + lte: ranges.xaxis.to, + }); + }, + [onBrushEvent] + ); + + useEffect(() => { + if (chartElem) { + $(chartElem).off('plotselected').on('plotselected', plotSelectedHandler); + } + }, [chartElem, plotSelectedHandler]); + + useEffect(() => { + if (chartElem) { + $(chartElem).off('mouseleave').on('mouseleave', mouseLeaveHandler); + } + }, [chartElem, mouseLeaveHandler]); + + useEffect(() => { + if (chartElem) { + $(chartElem).off('plothover').on('plothover', plotHoverHandler); + } + }, [chartElem, plotHoverHandler]); + + const title: string = useMemo(() => last(compact(map(seriesList.list, '_title'))) || '', [ + seriesList.list, + ]); + + return ( +
+
{title}
+
+
+ ); +} + +// default export required for React.Lazy +// eslint-disable-next-line import/no-default-export +export { TimelionVisComponent as default }; diff --git a/src/plugins/vis_types/timelion/public/plugin.ts b/src/plugins/vis_types/timelion/public/plugin.ts new file mode 100644 index 0000000000000..acc10f9914695 --- /dev/null +++ b/src/plugins/vis_types/timelion/public/plugin.ts @@ -0,0 +1,96 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { + CoreSetup, + CoreStart, + Plugin, + PluginInitializerContext, + IUiSettingsClient, + HttpSetup, +} from 'kibana/public'; +import type { Plugin as ExpressionsPlugin } from 'src/plugins/expressions/public'; +import type { + DataPublicPluginSetup, + DataPublicPluginStart, + TimefilterContract, +} from 'src/plugins/data/public'; +import type { VisualizationsSetup } from 'src/plugins/visualizations/public'; +import type { ChartsPluginSetup, ChartsPluginStart } from 'src/plugins/charts/public'; + +import { getTimelionVisualizationConfig } from './timelion_vis_fn'; +import { getTimelionVisDefinition } from './timelion_vis_type'; +import { setIndexPatterns, setDataSearch, setCharts } from './helpers/plugin_services'; + +import { getArgValueSuggestions } from './helpers/arg_value_suggestions'; +import { getTimelionVisRenderer } from './timelion_vis_renderer'; + +import type { ConfigSchema } from '../config'; + +/** @internal */ +export interface TimelionVisDependencies extends Partial { + uiSettings: IUiSettingsClient; + http: HttpSetup; + timefilter: TimefilterContract; +} + +/** @internal */ +export interface TimelionVisSetupDependencies { + expressions: ReturnType; + visualizations: VisualizationsSetup; + data: DataPublicPluginSetup; + charts: ChartsPluginSetup; +} + +/** @internal */ +export interface TimelionVisStartDependencies { + data: DataPublicPluginStart; + charts: ChartsPluginStart; +} + +/** @public */ +export interface VisTypeTimelionPluginStart { + getArgValueSuggestions: typeof getArgValueSuggestions; +} + +/** @internal */ +export class TimelionVisPlugin + implements + Plugin< + void, + VisTypeTimelionPluginStart, + TimelionVisSetupDependencies, + TimelionVisStartDependencies + > { + constructor(public initializerContext: PluginInitializerContext) {} + + public setup( + { uiSettings, http }: CoreSetup, + { expressions, visualizations, data, charts }: TimelionVisSetupDependencies + ) { + const dependencies: TimelionVisDependencies = { + http, + uiSettings, + timefilter: data.query.timefilter.timefilter, + }; + + expressions.registerFunction(() => getTimelionVisualizationConfig(dependencies)); + expressions.registerRenderer(getTimelionVisRenderer(dependencies)); + visualizations.createBaseVisualization(getTimelionVisDefinition(dependencies)); + } + + public start(core: CoreStart, { data, charts }: TimelionVisStartDependencies) { + setIndexPatterns(data.indexPatterns); + setDataSearch(data.search); + setCharts(charts); + + return { + getArgValueSuggestions, + }; + } +} diff --git a/src/plugins/vis_type_timelion/public/timelion_options.scss b/src/plugins/vis_types/timelion/public/timelion_options.scss similarity index 100% rename from src/plugins/vis_type_timelion/public/timelion_options.scss rename to src/plugins/vis_types/timelion/public/timelion_options.scss diff --git a/src/plugins/vis_type_timelion/public/timelion_options.tsx b/src/plugins/vis_types/timelion/public/timelion_options.tsx similarity index 96% rename from src/plugins/vis_type_timelion/public/timelion_options.tsx rename to src/plugins/vis_types/timelion/public/timelion_options.tsx index ed22efb38be1c..7879eb88e0bd2 100644 --- a/src/plugins/vis_type_timelion/public/timelion_options.tsx +++ b/src/plugins/vis_types/timelion/public/timelion_options.tsx @@ -10,7 +10,7 @@ import React, { useCallback } from 'react'; import { EuiPanel } from '@elastic/eui'; import { VisEditorOptionsProps } from 'src/plugins/visualizations/public'; -import { KibanaContextProvider } from '../../kibana_react/public'; +import { KibanaContextProvider } from '../../../kibana_react/public'; import { TimelionVisParams } from './timelion_vis_fn'; import { TimelionInterval, TimelionExpressionInput } from './components'; diff --git a/src/plugins/vis_type_timelion/public/timelion_vis_fn.ts b/src/plugins/vis_types/timelion/public/timelion_vis_fn.ts similarity index 96% rename from src/plugins/vis_type_timelion/public/timelion_vis_fn.ts rename to src/plugins/vis_types/timelion/public/timelion_vis_fn.ts index 2f775728667b6..dd3dfd5cd60a0 100644 --- a/src/plugins/vis_type_timelion/public/timelion_vis_fn.ts +++ b/src/plugins/vis_types/timelion/public/timelion_vis_fn.ts @@ -15,7 +15,7 @@ import { } from './helpers/timelion_request_handler'; import { TIMELION_VIS_NAME } from './timelion_vis_type'; import { TimelionVisDependencies } from './plugin'; -import { KibanaContext, Filter, Query, TimeRange } from '../../data/public'; +import { KibanaContext, Filter, Query, TimeRange } from '../../../data/public'; type Input = KibanaContext | null; type Output = Promise>; diff --git a/src/plugins/vis_type_timelion/public/timelion_vis_renderer.tsx b/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx similarity index 92% rename from src/plugins/vis_type_timelion/public/timelion_vis_renderer.tsx rename to src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx index b14055a4d6b63..c74c0f2ee6c2d 100644 --- a/src/plugins/vis_type_timelion/public/timelion_vis_renderer.tsx +++ b/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx @@ -10,12 +10,12 @@ import React, { lazy } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import { ExpressionRenderDefinition } from 'src/plugins/expressions'; -import { KibanaContextProvider } from '../../kibana_react/public'; -import { VisualizationContainer } from '../../visualizations/public'; +import { KibanaContextProvider } from '../../../kibana_react/public'; +import { VisualizationContainer } from '../../../visualizations/public'; import { TimelionVisDependencies } from './plugin'; import { TimelionRenderValue } from './timelion_vis_fn'; import { UI_SETTINGS } from '../common/constants'; -import { RangeFilterParams } from '../../data/public'; +import { RangeFilterParams } from '../../../data/public'; const TimelionVisComponent = lazy(() => import('./components/timelion_vis_component')); const TimelionVisLegacyComponent = lazy(() => import('./legacy/timelion_vis_component')); diff --git a/src/plugins/vis_type_timelion/public/timelion_vis_type.tsx b/src/plugins/vis_types/timelion/public/timelion_vis_type.tsx similarity index 93% rename from src/plugins/vis_type_timelion/public/timelion_vis_type.tsx rename to src/plugins/vis_types/timelion/public/timelion_vis_type.tsx index d607a26485afe..3462ae8df5cd5 100644 --- a/src/plugins/vis_type_timelion/public/timelion_vis_type.tsx +++ b/src/plugins/vis_types/timelion/public/timelion_vis_type.tsx @@ -9,7 +9,7 @@ import React, { lazy } from 'react'; import { i18n } from '@kbn/i18n'; -import { DefaultEditorSize } from '../../vis_default_editor/public'; +import { DefaultEditorSize } from '../../../vis_default_editor/public'; import { TimelionOptionsProps } from './timelion_options'; import { TimelionVisDependencies } from './plugin'; import { toExpressionAst } from './to_ast'; @@ -17,7 +17,7 @@ import { getIndexPatterns } from './helpers/plugin_services'; import { parseTimelionExpressionAsync } from '../common/parser_async'; -import { VIS_EVENT_TO_TRIGGER, VisParams } from '../../visualizations/public'; +import { VIS_EVENT_TO_TRIGGER, VisParams } from '../../../visualizations/public'; const TimelionOptions = lazy(() => import('./timelion_options')); diff --git a/src/plugins/vis_type_timelion/public/to_ast.test.ts b/src/plugins/vis_types/timelion/public/to_ast.test.ts similarity index 100% rename from src/plugins/vis_type_timelion/public/to_ast.test.ts rename to src/plugins/vis_types/timelion/public/to_ast.test.ts diff --git a/src/plugins/vis_types/timelion/public/to_ast.ts b/src/plugins/vis_types/timelion/public/to_ast.ts new file mode 100644 index 0000000000000..cf0a24a0e3d3e --- /dev/null +++ b/src/plugins/vis_types/timelion/public/to_ast.ts @@ -0,0 +1,24 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { buildExpression, buildExpressionFunction } from '../../../expressions/public'; +import { Vis } from '../../../visualizations/public'; +import { TimelionExpressionFunctionDefinition, TimelionVisParams } from './timelion_vis_fn'; + +export const toExpressionAst = (vis: Vis) => { + const { expression, interval } = vis.params; + + const timelion = buildExpressionFunction('timelion_vis', { + expression, + interval, + }); + + const ast = buildExpression([timelion]); + + return ast.toAst(); +}; diff --git a/src/plugins/vis_type_timelion/server/fit_functions/average.js b/src/plugins/vis_types/timelion/server/fit_functions/average.js similarity index 100% rename from src/plugins/vis_type_timelion/server/fit_functions/average.js rename to src/plugins/vis_types/timelion/server/fit_functions/average.js diff --git a/src/plugins/vis_type_timelion/server/fit_functions/average.test.js b/src/plugins/vis_types/timelion/server/fit_functions/average.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/fit_functions/average.test.js rename to src/plugins/vis_types/timelion/server/fit_functions/average.test.js diff --git a/src/plugins/vis_type_timelion/server/fit_functions/carry.js b/src/plugins/vis_types/timelion/server/fit_functions/carry.js similarity index 100% rename from src/plugins/vis_type_timelion/server/fit_functions/carry.js rename to src/plugins/vis_types/timelion/server/fit_functions/carry.js diff --git a/src/plugins/vis_type_timelion/server/fit_functions/carry.test.js b/src/plugins/vis_types/timelion/server/fit_functions/carry.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/fit_functions/carry.test.js rename to src/plugins/vis_types/timelion/server/fit_functions/carry.test.js diff --git a/src/plugins/vis_type_timelion/server/fit_functions/nearest.js b/src/plugins/vis_types/timelion/server/fit_functions/nearest.js similarity index 100% rename from src/plugins/vis_type_timelion/server/fit_functions/nearest.js rename to src/plugins/vis_types/timelion/server/fit_functions/nearest.js diff --git a/src/plugins/vis_type_timelion/server/fit_functions/none.js b/src/plugins/vis_types/timelion/server/fit_functions/none.js similarity index 100% rename from src/plugins/vis_type_timelion/server/fit_functions/none.js rename to src/plugins/vis_types/timelion/server/fit_functions/none.js diff --git a/src/plugins/vis_type_timelion/server/fit_functions/scale.js b/src/plugins/vis_types/timelion/server/fit_functions/scale.js similarity index 100% rename from src/plugins/vis_type_timelion/server/fit_functions/scale.js rename to src/plugins/vis_types/timelion/server/fit_functions/scale.js diff --git a/src/plugins/vis_type_timelion/server/handlers/chain_runner.js b/src/plugins/vis_types/timelion/server/handlers/chain_runner.js similarity index 100% rename from src/plugins/vis_type_timelion/server/handlers/chain_runner.js rename to src/plugins/vis_types/timelion/server/handlers/chain_runner.js diff --git a/src/plugins/vis_type_timelion/server/handlers/lib/arg_type.js b/src/plugins/vis_types/timelion/server/handlers/lib/arg_type.js similarity index 100% rename from src/plugins/vis_type_timelion/server/handlers/lib/arg_type.js rename to src/plugins/vis_types/timelion/server/handlers/lib/arg_type.js diff --git a/src/plugins/vis_type_timelion/server/handlers/lib/index_arguments.js b/src/plugins/vis_types/timelion/server/handlers/lib/index_arguments.js similarity index 100% rename from src/plugins/vis_type_timelion/server/handlers/lib/index_arguments.js rename to src/plugins/vis_types/timelion/server/handlers/lib/index_arguments.js diff --git a/src/plugins/vis_type_timelion/server/handlers/lib/parse_sheet.js b/src/plugins/vis_types/timelion/server/handlers/lib/parse_sheet.js similarity index 100% rename from src/plugins/vis_type_timelion/server/handlers/lib/parse_sheet.js rename to src/plugins/vis_types/timelion/server/handlers/lib/parse_sheet.js diff --git a/src/plugins/vis_type_timelion/server/handlers/lib/parse_sheet.test.js b/src/plugins/vis_types/timelion/server/handlers/lib/parse_sheet.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/handlers/lib/parse_sheet.test.js rename to src/plugins/vis_types/timelion/server/handlers/lib/parse_sheet.test.js diff --git a/src/plugins/vis_type_timelion/server/handlers/lib/preprocess_chain.js b/src/plugins/vis_types/timelion/server/handlers/lib/preprocess_chain.js similarity index 100% rename from src/plugins/vis_type_timelion/server/handlers/lib/preprocess_chain.js rename to src/plugins/vis_types/timelion/server/handlers/lib/preprocess_chain.js diff --git a/src/plugins/vis_type_timelion/server/handlers/lib/reposition_arguments.js b/src/plugins/vis_types/timelion/server/handlers/lib/reposition_arguments.js similarity index 100% rename from src/plugins/vis_type_timelion/server/handlers/lib/reposition_arguments.js rename to src/plugins/vis_types/timelion/server/handlers/lib/reposition_arguments.js diff --git a/src/plugins/vis_type_timelion/server/handlers/lib/tl_config.js b/src/plugins/vis_types/timelion/server/handlers/lib/tl_config.js similarity index 100% rename from src/plugins/vis_type_timelion/server/handlers/lib/tl_config.js rename to src/plugins/vis_types/timelion/server/handlers/lib/tl_config.js diff --git a/src/plugins/vis_type_timelion/server/handlers/lib/validate_arg.js b/src/plugins/vis_types/timelion/server/handlers/lib/validate_arg.js similarity index 100% rename from src/plugins/vis_type_timelion/server/handlers/lib/validate_arg.js rename to src/plugins/vis_types/timelion/server/handlers/lib/validate_arg.js diff --git a/src/plugins/vis_type_timelion/server/handlers/lib/validate_time.js b/src/plugins/vis_types/timelion/server/handlers/lib/validate_time.js similarity index 100% rename from src/plugins/vis_type_timelion/server/handlers/lib/validate_time.js rename to src/plugins/vis_types/timelion/server/handlers/lib/validate_time.js diff --git a/src/plugins/vis_types/timelion/server/index.ts b/src/plugins/vis_types/timelion/server/index.ts new file mode 100644 index 0000000000000..396ef8b61c7bc --- /dev/null +++ b/src/plugins/vis_types/timelion/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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { PluginConfigDescriptor, PluginInitializerContext } from '../../../../../src/core/server'; +import { configSchema, ConfigSchema } from '../config'; +import { TimelionPlugin } from './plugin'; + +export const config: PluginConfigDescriptor = { + schema: configSchema, +}; + +export const plugin = (initializerContext: PluginInitializerContext) => + new TimelionPlugin(initializerContext); diff --git a/src/plugins/vis_type_timelion/server/lib/alter.js b/src/plugins/vis_types/timelion/server/lib/alter.js similarity index 100% rename from src/plugins/vis_type_timelion/server/lib/alter.js rename to src/plugins/vis_types/timelion/server/lib/alter.js diff --git a/src/plugins/vis_type_timelion/server/lib/as_sorted.js b/src/plugins/vis_types/timelion/server/lib/as_sorted.js similarity index 100% rename from src/plugins/vis_type_timelion/server/lib/as_sorted.js rename to src/plugins/vis_types/timelion/server/lib/as_sorted.js diff --git a/src/plugins/vis_type_timelion/server/lib/build_target.js b/src/plugins/vis_types/timelion/server/lib/build_target.js similarity index 100% rename from src/plugins/vis_type_timelion/server/lib/build_target.js rename to src/plugins/vis_types/timelion/server/lib/build_target.js diff --git a/src/plugins/vis_type_timelion/server/lib/classes/chainable.js b/src/plugins/vis_types/timelion/server/lib/classes/chainable.js similarity index 100% rename from src/plugins/vis_type_timelion/server/lib/classes/chainable.js rename to src/plugins/vis_types/timelion/server/lib/classes/chainable.js diff --git a/src/plugins/vis_type_timelion/server/lib/classes/datasource.js b/src/plugins/vis_types/timelion/server/lib/classes/datasource.js similarity index 100% rename from src/plugins/vis_type_timelion/server/lib/classes/datasource.js rename to src/plugins/vis_types/timelion/server/lib/classes/datasource.js diff --git a/src/plugins/vis_type_timelion/server/lib/classes/timelion_function.d.ts b/src/plugins/vis_types/timelion/server/lib/classes/timelion_function.d.ts similarity index 100% rename from src/plugins/vis_type_timelion/server/lib/classes/timelion_function.d.ts rename to src/plugins/vis_types/timelion/server/lib/classes/timelion_function.d.ts diff --git a/src/plugins/vis_type_timelion/server/lib/classes/timelion_function.js b/src/plugins/vis_types/timelion/server/lib/classes/timelion_function.js similarity index 100% rename from src/plugins/vis_type_timelion/server/lib/classes/timelion_function.js rename to src/plugins/vis_types/timelion/server/lib/classes/timelion_function.js diff --git a/src/plugins/vis_type_timelion/server/lib/config_manager.ts b/src/plugins/vis_types/timelion/server/lib/config_manager.ts similarity index 100% rename from src/plugins/vis_type_timelion/server/lib/config_manager.ts rename to src/plugins/vis_types/timelion/server/lib/config_manager.ts diff --git a/src/plugins/vis_type_timelion/server/lib/functions_md.js b/src/plugins/vis_types/timelion/server/lib/functions_md.js similarity index 100% rename from src/plugins/vis_type_timelion/server/lib/functions_md.js rename to src/plugins/vis_types/timelion/server/lib/functions_md.js diff --git a/src/plugins/vis_type_timelion/server/lib/get_namespaced_settings.js b/src/plugins/vis_types/timelion/server/lib/get_namespaced_settings.js similarity index 100% rename from src/plugins/vis_type_timelion/server/lib/get_namespaced_settings.js rename to src/plugins/vis_types/timelion/server/lib/get_namespaced_settings.js diff --git a/src/plugins/vis_type_timelion/server/lib/load_functions.d.ts b/src/plugins/vis_types/timelion/server/lib/load_functions.d.ts similarity index 100% rename from src/plugins/vis_type_timelion/server/lib/load_functions.d.ts rename to src/plugins/vis_types/timelion/server/lib/load_functions.d.ts diff --git a/src/plugins/vis_type_timelion/server/lib/load_functions.js b/src/plugins/vis_types/timelion/server/lib/load_functions.js similarity index 100% rename from src/plugins/vis_type_timelion/server/lib/load_functions.js rename to src/plugins/vis_types/timelion/server/lib/load_functions.js diff --git a/src/plugins/vis_type_timelion/server/lib/load_functions.test.js b/src/plugins/vis_types/timelion/server/lib/load_functions.test.js similarity index 92% rename from src/plugins/vis_type_timelion/server/lib/load_functions.test.js rename to src/plugins/vis_types/timelion/server/lib/load_functions.test.js index 0f63c92cc05a8..1508670523733 100644 --- a/src/plugins/vis_type_timelion/server/lib/load_functions.test.js +++ b/src/plugins/vis_types/timelion/server/lib/load_functions.test.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -const fn = require(`src/plugins/vis_type_timelion/server/lib/load_functions`); +const fn = require(`src/plugins/vis_types/timelion/server/lib/load_functions`); const expect = require('chai').expect; diff --git a/src/plugins/vis_type_timelion/server/lib/offset_time.js b/src/plugins/vis_types/timelion/server/lib/offset_time.js similarity index 100% rename from src/plugins/vis_type_timelion/server/lib/offset_time.js rename to src/plugins/vis_types/timelion/server/lib/offset_time.js diff --git a/src/plugins/vis_type_timelion/server/lib/offset_time.test.js b/src/plugins/vis_types/timelion/server/lib/offset_time.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/lib/offset_time.test.js rename to src/plugins/vis_types/timelion/server/lib/offset_time.test.js diff --git a/src/plugins/vis_type_timelion/server/lib/process_function_definition.js b/src/plugins/vis_types/timelion/server/lib/process_function_definition.js similarity index 100% rename from src/plugins/vis_type_timelion/server/lib/process_function_definition.js rename to src/plugins/vis_types/timelion/server/lib/process_function_definition.js diff --git a/src/plugins/vis_type_timelion/server/lib/reduce.js b/src/plugins/vis_types/timelion/server/lib/reduce.js similarity index 88% rename from src/plugins/vis_type_timelion/server/lib/reduce.js rename to src/plugins/vis_types/timelion/server/lib/reduce.js index b4fd689028652..65fc4b61a2926 100644 --- a/src/plugins/vis_type_timelion/server/lib/reduce.js +++ b/src/plugins/vis_types/timelion/server/lib/reduce.js @@ -7,6 +7,7 @@ */ import _ from 'lodash'; +import { asyncMap } from '@kbn/std'; function allSeriesContainKey(seriesList, key) { const containsKeyInitialValue = true; @@ -48,16 +49,17 @@ async function pairwiseReduce(left, right, fn) { }); // pairwise reduce seriesLists - const pairwiseSeriesList = { type: 'seriesList', list: [] }; - left.list.forEach(async (leftSeries) => { - const first = { type: 'seriesList', list: [leftSeries] }; - const second = { type: 'seriesList', list: [indexedList[leftSeries[pairwiseField]]] }; - const reducedSeriesList = await reduce([first, second], fn); - const reducedSeries = reducedSeriesList.list[0]; - reducedSeries.label = leftSeries[pairwiseField]; - pairwiseSeriesList.list.push(reducedSeries); - }); - return pairwiseSeriesList; + return { + type: 'seriesList', + list: await asyncMap(left.list, async (leftSeries) => { + const first = { type: 'seriesList', list: [leftSeries] }; + const second = { type: 'seriesList', list: [indexedList[leftSeries[pairwiseField]]] }; + const reducedSeriesList = await reduce([first, second], fn); + const reducedSeries = reducedSeriesList.list[0]; + reducedSeries.label = leftSeries[pairwiseField]; + return reducedSeries; + }), + }; } /** diff --git a/src/plugins/vis_type_timelion/server/lib/split_interval.js b/src/plugins/vis_types/timelion/server/lib/split_interval.js similarity index 100% rename from src/plugins/vis_type_timelion/server/lib/split_interval.js rename to src/plugins/vis_types/timelion/server/lib/split_interval.js diff --git a/src/plugins/vis_type_timelion/server/lib/unzip_pairs.js b/src/plugins/vis_types/timelion/server/lib/unzip_pairs.js similarity index 100% rename from src/plugins/vis_type_timelion/server/lib/unzip_pairs.js rename to src/plugins/vis_types/timelion/server/lib/unzip_pairs.js diff --git a/src/plugins/vis_types/timelion/server/plugin.ts b/src/plugins/vis_types/timelion/server/plugin.ts new file mode 100644 index 0000000000000..b44aad5575b19 --- /dev/null +++ b/src/plugins/vis_types/timelion/server/plugin.ts @@ -0,0 +1,81 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 { TypeOf } from '@kbn/config-schema'; + +import type { + PluginStart, + DataRequestHandlerContext, +} from '../../../../../src/plugins/data/server'; +import { CoreSetup, PluginInitializerContext, Plugin } from '../../../../../src/core/server'; +import { configSchema } from '../config'; +import loadFunctions from './lib/load_functions'; +import { functionsRoute } from './routes/functions'; +import { validateEsRoute } from './routes/validate_es'; +import { runRoute } from './routes/run'; +import { ConfigManager } from './lib/config_manager'; +import { getUiSettings } from './ui_settings'; + +export interface TimelionPluginStartDeps { + data: PluginStart; +} + +/** + * Represents Timelion Plugin instance that will be managed by the Kibana plugin system. + */ +export class TimelionPlugin implements Plugin { + constructor(private readonly initializerContext: PluginInitializerContext) {} + + public setup(core: CoreSetup): void { + const config = this.initializerContext.config.get>(); + + const configManager = new ConfigManager(this.initializerContext.config); + + const functions = loadFunctions('series_functions'); + + const getFunction = (name: string) => { + if (functions[name]) { + return functions[name]; + } + + throw new Error( + i18n.translate('timelion.noFunctionErrorMessage', { + defaultMessage: 'No such function: {name}', + values: { name }, + }) + ); + }; + + const logger = this.initializerContext.logger.get('timelion'); + + const router = core.http.createRouter(); + + const deps = { + configManager, + functions, + getFunction, + logger, + core, + }; + + functionsRoute(router, deps); + runRoute(router, deps); + validateEsRoute(router); + + core.uiSettings.register(getUiSettings(config)); + } + + public start() { + this.initializerContext.logger.get().debug('Starting plugin'); + } + + public stop() { + this.initializerContext.logger.get().debug('Stopping plugin'); + } +} diff --git a/src/plugins/vis_type_timelion/server/routes/functions.ts b/src/plugins/vis_types/timelion/server/routes/functions.ts similarity index 100% rename from src/plugins/vis_type_timelion/server/routes/functions.ts rename to src/plugins/vis_types/timelion/server/routes/functions.ts diff --git a/src/plugins/vis_type_timelion/server/routes/run.ts b/src/plugins/vis_types/timelion/server/routes/run.ts similarity index 100% rename from src/plugins/vis_type_timelion/server/routes/run.ts rename to src/plugins/vis_types/timelion/server/routes/run.ts diff --git a/src/plugins/vis_type_timelion/server/routes/validate_es.ts b/src/plugins/vis_types/timelion/server/routes/validate_es.ts similarity index 96% rename from src/plugins/vis_type_timelion/server/routes/validate_es.ts rename to src/plugins/vis_types/timelion/server/routes/validate_es.ts index 70eacc5ce8518..1e894e09c6e1b 100644 --- a/src/plugins/vis_type_timelion/server/routes/validate_es.ts +++ b/src/plugins/vis_types/timelion/server/routes/validate_es.ts @@ -8,7 +8,7 @@ import _ from 'lodash'; import { IRouter } from 'kibana/server'; -import type { DataRequestHandlerContext } from '../../../data/server'; +import type { DataRequestHandlerContext } from '../../../../data/server'; export function validateEsRoute(router: IRouter) { router.get( diff --git a/src/plugins/vis_type_timelion/server/series_functions/abs.js b/src/plugins/vis_types/timelion/server/series_functions/abs.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/abs.js rename to src/plugins/vis_types/timelion/server/series_functions/abs.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/abs.test.js b/src/plugins/vis_types/timelion/server/series_functions/abs.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/abs.test.js rename to src/plugins/vis_types/timelion/server/series_functions/abs.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/aggregate/aggregate.test.js b/src/plugins/vis_types/timelion/server/series_functions/aggregate/aggregate.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/aggregate/aggregate.test.js rename to src/plugins/vis_types/timelion/server/series_functions/aggregate/aggregate.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/aggregate/avg.js b/src/plugins/vis_types/timelion/server/series_functions/aggregate/avg.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/aggregate/avg.js rename to src/plugins/vis_types/timelion/server/series_functions/aggregate/avg.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/aggregate/cardinality.js b/src/plugins/vis_types/timelion/server/series_functions/aggregate/cardinality.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/aggregate/cardinality.js rename to src/plugins/vis_types/timelion/server/series_functions/aggregate/cardinality.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/aggregate/first.js b/src/plugins/vis_types/timelion/server/series_functions/aggregate/first.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/aggregate/first.js rename to src/plugins/vis_types/timelion/server/series_functions/aggregate/first.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/aggregate/index.js b/src/plugins/vis_types/timelion/server/series_functions/aggregate/index.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/aggregate/index.js rename to src/plugins/vis_types/timelion/server/series_functions/aggregate/index.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/aggregate/last.js b/src/plugins/vis_types/timelion/server/series_functions/aggregate/last.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/aggregate/last.js rename to src/plugins/vis_types/timelion/server/series_functions/aggregate/last.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/aggregate/max.js b/src/plugins/vis_types/timelion/server/series_functions/aggregate/max.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/aggregate/max.js rename to src/plugins/vis_types/timelion/server/series_functions/aggregate/max.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/aggregate/min.js b/src/plugins/vis_types/timelion/server/series_functions/aggregate/min.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/aggregate/min.js rename to src/plugins/vis_types/timelion/server/series_functions/aggregate/min.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/aggregate/sum.js b/src/plugins/vis_types/timelion/server/series_functions/aggregate/sum.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/aggregate/sum.js rename to src/plugins/vis_types/timelion/server/series_functions/aggregate/sum.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/bars.js b/src/plugins/vis_types/timelion/server/series_functions/bars.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/bars.js rename to src/plugins/vis_types/timelion/server/series_functions/bars.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/bars.test.js b/src/plugins/vis_types/timelion/server/series_functions/bars.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/bars.test.js rename to src/plugins/vis_types/timelion/server/series_functions/bars.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/color.js b/src/plugins/vis_types/timelion/server/series_functions/color.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/color.js rename to src/plugins/vis_types/timelion/server/series_functions/color.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/color.test.js b/src/plugins/vis_types/timelion/server/series_functions/color.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/color.test.js rename to src/plugins/vis_types/timelion/server/series_functions/color.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/condition.js b/src/plugins/vis_types/timelion/server/series_functions/condition.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/condition.js rename to src/plugins/vis_types/timelion/server/series_functions/condition.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/condition.test.js b/src/plugins/vis_types/timelion/server/series_functions/condition.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/condition.test.js rename to src/plugins/vis_types/timelion/server/series_functions/condition.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/cusum.js b/src/plugins/vis_types/timelion/server/series_functions/cusum.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/cusum.js rename to src/plugins/vis_types/timelion/server/series_functions/cusum.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/cusum.test.js b/src/plugins/vis_types/timelion/server/series_functions/cusum.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/cusum.test.js rename to src/plugins/vis_types/timelion/server/series_functions/cusum.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/derivative.js b/src/plugins/vis_types/timelion/server/series_functions/derivative.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/derivative.js rename to src/plugins/vis_types/timelion/server/series_functions/derivative.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/derivative.test.js b/src/plugins/vis_types/timelion/server/series_functions/derivative.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/derivative.test.js rename to src/plugins/vis_types/timelion/server/series_functions/derivative.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/divide.js b/src/plugins/vis_types/timelion/server/series_functions/divide.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/divide.js rename to src/plugins/vis_types/timelion/server/series_functions/divide.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/divide.test.js b/src/plugins/vis_types/timelion/server/series_functions/divide.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/divide.test.js rename to src/plugins/vis_types/timelion/server/series_functions/divide.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/es/es.test.js b/src/plugins/vis_types/timelion/server/series_functions/es/es.test.js similarity index 99% rename from src/plugins/vis_type_timelion/server/series_functions/es/es.test.js rename to src/plugins/vis_types/timelion/server/series_functions/es/es.test.js index c2940c6d7731a..f55ee31f39799 100644 --- a/src/plugins/vis_type_timelion/server/series_functions/es/es.test.js +++ b/src/plugins/vis_types/timelion/server/series_functions/es/es.test.js @@ -17,7 +17,7 @@ import esResponse from '../fixtures/es_response'; import _ from 'lodash'; import sinon from 'sinon'; import invoke from '../helpers/invoke_series_fn.js'; -import { UI_SETTINGS } from '../../../../data/server'; +import { UI_SETTINGS } from '../../../../../data/server'; describe('es', () => { let tlConfig; diff --git a/src/plugins/vis_type_timelion/server/series_functions/es/index.js b/src/plugins/vis_types/timelion/server/series_functions/es/index.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/es/index.js rename to src/plugins/vis_types/timelion/server/series_functions/es/index.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/es/lib/agg_body.js b/src/plugins/vis_types/timelion/server/series_functions/es/lib/agg_body.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/es/lib/agg_body.js rename to src/plugins/vis_types/timelion/server/series_functions/es/lib/agg_body.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/es/lib/agg_response_to_series_list.js b/src/plugins/vis_types/timelion/server/series_functions/es/lib/agg_response_to_series_list.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/es/lib/agg_response_to_series_list.js rename to src/plugins/vis_types/timelion/server/series_functions/es/lib/agg_response_to_series_list.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/es/lib/build_request.js b/src/plugins/vis_types/timelion/server/series_functions/es/lib/build_request.js similarity index 97% rename from src/plugins/vis_type_timelion/server/series_functions/es/lib/build_request.js rename to src/plugins/vis_types/timelion/server/series_functions/es/lib/build_request.js index 7d55a772c7fc1..20e3f71801854 100644 --- a/src/plugins/vis_type_timelion/server/series_functions/es/lib/build_request.js +++ b/src/plugins/vis_types/timelion/server/series_functions/es/lib/build_request.js @@ -10,7 +10,7 @@ import _ from 'lodash'; import moment from 'moment'; import { buildAggBody } from './agg_body'; import createDateAgg from './create_date_agg'; -import { UI_SETTINGS } from '../../../../../data/server'; +import { UI_SETTINGS } from '../../../../../../data/server'; export default function buildRequest(config, tlConfig, scriptFields, runtimeFields, timeout) { const bool = { must: [] }; diff --git a/src/plugins/vis_type_timelion/server/series_functions/es/lib/create_date_agg.js b/src/plugins/vis_types/timelion/server/series_functions/es/lib/create_date_agg.js similarity index 97% rename from src/plugins/vis_type_timelion/server/series_functions/es/lib/create_date_agg.js rename to src/plugins/vis_types/timelion/server/series_functions/es/lib/create_date_agg.js index bd6cf8a4b7c5e..e12ad035a2b61 100644 --- a/src/plugins/vis_type_timelion/server/series_functions/es/lib/create_date_agg.js +++ b/src/plugins/vis_types/timelion/server/series_functions/es/lib/create_date_agg.js @@ -7,7 +7,7 @@ */ import { buildAggBody } from './agg_body'; -import { search, METRIC_TYPES } from '../../../../../data/server'; +import { search, METRIC_TYPES } from '../../../../../../data/server'; const { dateHistogramInterval } = search.aggs; diff --git a/src/plugins/vis_type_timelion/server/series_functions/first.js b/src/plugins/vis_types/timelion/server/series_functions/first.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/first.js rename to src/plugins/vis_types/timelion/server/series_functions/first.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/first.test.js b/src/plugins/vis_types/timelion/server/series_functions/first.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/first.test.js rename to src/plugins/vis_types/timelion/server/series_functions/first.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/fit.js b/src/plugins/vis_types/timelion/server/series_functions/fit.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/fit.js rename to src/plugins/vis_types/timelion/server/series_functions/fit.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/fit.test.js b/src/plugins/vis_types/timelion/server/series_functions/fit.test.js similarity index 98% rename from src/plugins/vis_type_timelion/server/series_functions/fit.test.js rename to src/plugins/vis_types/timelion/server/series_functions/fit.test.js index 7e853d4d74e49..b755a3f80e338 100644 --- a/src/plugins/vis_type_timelion/server/series_functions/fit.test.js +++ b/src/plugins/vis_types/timelion/server/series_functions/fit.test.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -const fn = require(`src/plugins/vis_type_timelion/server/series_functions/fit`); +const fn = require(`src/plugins/vis_types/timelion/server/series_functions/fit`); import moment from 'moment'; const expect = require('chai').expect; import invoke from './helpers/invoke_series_fn.js'; diff --git a/src/plugins/vis_type_timelion/server/series_functions/fixtures/bucket_list.js b/src/plugins/vis_types/timelion/server/series_functions/fixtures/bucket_list.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/fixtures/bucket_list.js rename to src/plugins/vis_types/timelion/server/series_functions/fixtures/bucket_list.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/fixtures/es_response.js b/src/plugins/vis_types/timelion/server/series_functions/fixtures/es_response.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/fixtures/es_response.js rename to src/plugins/vis_types/timelion/server/series_functions/fixtures/es_response.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/fixtures/series_list.js b/src/plugins/vis_types/timelion/server/series_functions/fixtures/series_list.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/fixtures/series_list.js rename to src/plugins/vis_types/timelion/server/series_functions/fixtures/series_list.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/fixtures/tl_config.js b/src/plugins/vis_types/timelion/server/series_functions/fixtures/tl_config.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/fixtures/tl_config.js rename to src/plugins/vis_types/timelion/server/series_functions/fixtures/tl_config.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/graphite.js b/src/plugins/vis_types/timelion/server/series_functions/graphite.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/graphite.js rename to src/plugins/vis_types/timelion/server/series_functions/graphite.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/graphite.test.js b/src/plugins/vis_types/timelion/server/series_functions/graphite.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/graphite.test.js rename to src/plugins/vis_types/timelion/server/series_functions/graphite.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/helpers/get_series.js b/src/plugins/vis_types/timelion/server/series_functions/helpers/get_series.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/helpers/get_series.js rename to src/plugins/vis_types/timelion/server/series_functions/helpers/get_series.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/helpers/get_series_list.js b/src/plugins/vis_types/timelion/server/series_functions/helpers/get_series_list.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/helpers/get_series_list.js rename to src/plugins/vis_types/timelion/server/series_functions/helpers/get_series_list.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/helpers/get_single_series_list.js b/src/plugins/vis_types/timelion/server/series_functions/helpers/get_single_series_list.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/helpers/get_single_series_list.js rename to src/plugins/vis_types/timelion/server/series_functions/helpers/get_single_series_list.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/helpers/invoke_series_fn.js b/src/plugins/vis_types/timelion/server/series_functions/helpers/invoke_series_fn.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/helpers/invoke_series_fn.js rename to src/plugins/vis_types/timelion/server/series_functions/helpers/invoke_series_fn.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/hide.js b/src/plugins/vis_types/timelion/server/series_functions/hide.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/hide.js rename to src/plugins/vis_types/timelion/server/series_functions/hide.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/hide.test.js b/src/plugins/vis_types/timelion/server/series_functions/hide.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/hide.test.js rename to src/plugins/vis_types/timelion/server/series_functions/hide.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/holt/index.js b/src/plugins/vis_types/timelion/server/series_functions/holt/index.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/holt/index.js rename to src/plugins/vis_types/timelion/server/series_functions/holt/index.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/holt/lib/des.js b/src/plugins/vis_types/timelion/server/series_functions/holt/lib/des.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/holt/lib/des.js rename to src/plugins/vis_types/timelion/server/series_functions/holt/lib/des.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/holt/lib/ses.js b/src/plugins/vis_types/timelion/server/series_functions/holt/lib/ses.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/holt/lib/ses.js rename to src/plugins/vis_types/timelion/server/series_functions/holt/lib/ses.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/holt/lib/tes.js b/src/plugins/vis_types/timelion/server/series_functions/holt/lib/tes.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/holt/lib/tes.js rename to src/plugins/vis_types/timelion/server/series_functions/holt/lib/tes.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/label.js b/src/plugins/vis_types/timelion/server/series_functions/label.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/label.js rename to src/plugins/vis_types/timelion/server/series_functions/label.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/label.test.js b/src/plugins/vis_types/timelion/server/series_functions/label.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/label.test.js rename to src/plugins/vis_types/timelion/server/series_functions/label.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/legend.js b/src/plugins/vis_types/timelion/server/series_functions/legend.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/legend.js rename to src/plugins/vis_types/timelion/server/series_functions/legend.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/legend.test.js b/src/plugins/vis_types/timelion/server/series_functions/legend.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/legend.test.js rename to src/plugins/vis_types/timelion/server/series_functions/legend.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/lines.js b/src/plugins/vis_types/timelion/server/series_functions/lines.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/lines.js rename to src/plugins/vis_types/timelion/server/series_functions/lines.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/lines.test.js b/src/plugins/vis_types/timelion/server/series_functions/lines.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/lines.test.js rename to src/plugins/vis_types/timelion/server/series_functions/lines.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/log.js b/src/plugins/vis_types/timelion/server/series_functions/log.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/log.js rename to src/plugins/vis_types/timelion/server/series_functions/log.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/log.test.js b/src/plugins/vis_types/timelion/server/series_functions/log.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/log.test.js rename to src/plugins/vis_types/timelion/server/series_functions/log.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/max.js b/src/plugins/vis_types/timelion/server/series_functions/max.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/max.js rename to src/plugins/vis_types/timelion/server/series_functions/max.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/max.test.js b/src/plugins/vis_types/timelion/server/series_functions/max.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/max.test.js rename to src/plugins/vis_types/timelion/server/series_functions/max.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/min.js b/src/plugins/vis_types/timelion/server/series_functions/min.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/min.js rename to src/plugins/vis_types/timelion/server/series_functions/min.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/min.test.js b/src/plugins/vis_types/timelion/server/series_functions/min.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/min.test.js rename to src/plugins/vis_types/timelion/server/series_functions/min.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/movingaverage.js b/src/plugins/vis_types/timelion/server/series_functions/movingaverage.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/movingaverage.js rename to src/plugins/vis_types/timelion/server/series_functions/movingaverage.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/movingaverage.test.js b/src/plugins/vis_types/timelion/server/series_functions/movingaverage.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/movingaverage.test.js rename to src/plugins/vis_types/timelion/server/series_functions/movingaverage.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/movingstd.js b/src/plugins/vis_types/timelion/server/series_functions/movingstd.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/movingstd.js rename to src/plugins/vis_types/timelion/server/series_functions/movingstd.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/movingstd.test.js b/src/plugins/vis_types/timelion/server/series_functions/movingstd.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/movingstd.test.js rename to src/plugins/vis_types/timelion/server/series_functions/movingstd.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/multiply.js b/src/plugins/vis_types/timelion/server/series_functions/multiply.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/multiply.js rename to src/plugins/vis_types/timelion/server/series_functions/multiply.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/multiply.test.js b/src/plugins/vis_types/timelion/server/series_functions/multiply.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/multiply.test.js rename to src/plugins/vis_types/timelion/server/series_functions/multiply.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/points.js b/src/plugins/vis_types/timelion/server/series_functions/points.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/points.js rename to src/plugins/vis_types/timelion/server/series_functions/points.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/points.test.js b/src/plugins/vis_types/timelion/server/series_functions/points.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/points.test.js rename to src/plugins/vis_types/timelion/server/series_functions/points.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/precision.js b/src/plugins/vis_types/timelion/server/series_functions/precision.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/precision.js rename to src/plugins/vis_types/timelion/server/series_functions/precision.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/precision.test.js b/src/plugins/vis_types/timelion/server/series_functions/precision.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/precision.test.js rename to src/plugins/vis_types/timelion/server/series_functions/precision.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/props.js b/src/plugins/vis_types/timelion/server/series_functions/props.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/props.js rename to src/plugins/vis_types/timelion/server/series_functions/props.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/quandl.js b/src/plugins/vis_types/timelion/server/series_functions/quandl.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/quandl.js rename to src/plugins/vis_types/timelion/server/series_functions/quandl.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/quandl.test.js b/src/plugins/vis_types/timelion/server/series_functions/quandl.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/quandl.test.js rename to src/plugins/vis_types/timelion/server/series_functions/quandl.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/range.js b/src/plugins/vis_types/timelion/server/series_functions/range.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/range.js rename to src/plugins/vis_types/timelion/server/series_functions/range.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/range.test.js b/src/plugins/vis_types/timelion/server/series_functions/range.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/range.test.js rename to src/plugins/vis_types/timelion/server/series_functions/range.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/scale_interval.js b/src/plugins/vis_types/timelion/server/series_functions/scale_interval.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/scale_interval.js rename to src/plugins/vis_types/timelion/server/series_functions/scale_interval.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/scale_interval.test.js b/src/plugins/vis_types/timelion/server/series_functions/scale_interval.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/scale_interval.test.js rename to src/plugins/vis_types/timelion/server/series_functions/scale_interval.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/static.js b/src/plugins/vis_types/timelion/server/series_functions/static.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/static.js rename to src/plugins/vis_types/timelion/server/series_functions/static.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/static.test.js b/src/plugins/vis_types/timelion/server/series_functions/static.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/static.test.js rename to src/plugins/vis_types/timelion/server/series_functions/static.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/subtract.js b/src/plugins/vis_types/timelion/server/series_functions/subtract.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/subtract.js rename to src/plugins/vis_types/timelion/server/series_functions/subtract.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/subtract.test.js b/src/plugins/vis_types/timelion/server/series_functions/subtract.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/subtract.test.js rename to src/plugins/vis_types/timelion/server/series_functions/subtract.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/sum.js b/src/plugins/vis_types/timelion/server/series_functions/sum.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/sum.js rename to src/plugins/vis_types/timelion/server/series_functions/sum.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/sum.test.js b/src/plugins/vis_types/timelion/server/series_functions/sum.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/sum.test.js rename to src/plugins/vis_types/timelion/server/series_functions/sum.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/title.js b/src/plugins/vis_types/timelion/server/series_functions/title.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/title.js rename to src/plugins/vis_types/timelion/server/series_functions/title.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/title.test.js b/src/plugins/vis_types/timelion/server/series_functions/title.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/title.test.js rename to src/plugins/vis_types/timelion/server/series_functions/title.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/trend/index.js b/src/plugins/vis_types/timelion/server/series_functions/trend/index.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/trend/index.js rename to src/plugins/vis_types/timelion/server/series_functions/trend/index.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/trend/lib/regress.js b/src/plugins/vis_types/timelion/server/series_functions/trend/lib/regress.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/trend/lib/regress.js rename to src/plugins/vis_types/timelion/server/series_functions/trend/lib/regress.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/trim.js b/src/plugins/vis_types/timelion/server/series_functions/trim.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/trim.js rename to src/plugins/vis_types/timelion/server/series_functions/trim.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/trim.test.js b/src/plugins/vis_types/timelion/server/series_functions/trim.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/trim.test.js rename to src/plugins/vis_types/timelion/server/series_functions/trim.test.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/worldbank.js b/src/plugins/vis_types/timelion/server/series_functions/worldbank.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/worldbank.js rename to src/plugins/vis_types/timelion/server/series_functions/worldbank.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/worldbank_indicators.js b/src/plugins/vis_types/timelion/server/series_functions/worldbank_indicators.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/worldbank_indicators.js rename to src/plugins/vis_types/timelion/server/series_functions/worldbank_indicators.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/yaxis.js b/src/plugins/vis_types/timelion/server/series_functions/yaxis.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/yaxis.js rename to src/plugins/vis_types/timelion/server/series_functions/yaxis.js diff --git a/src/plugins/vis_type_timelion/server/series_functions/yaxis.test.js b/src/plugins/vis_types/timelion/server/series_functions/yaxis.test.js similarity index 100% rename from src/plugins/vis_type_timelion/server/series_functions/yaxis.test.js rename to src/plugins/vis_types/timelion/server/series_functions/yaxis.test.js diff --git a/src/plugins/vis_type_timelion/server/timelion.json b/src/plugins/vis_types/timelion/server/timelion.json similarity index 100% rename from src/plugins/vis_type_timelion/server/timelion.json rename to src/plugins/vis_types/timelion/server/timelion.json diff --git a/src/plugins/vis_type_timelion/server/types.ts b/src/plugins/vis_types/timelion/server/types.ts similarity index 100% rename from src/plugins/vis_type_timelion/server/types.ts rename to src/plugins/vis_types/timelion/server/types.ts diff --git a/src/plugins/vis_type_timelion/server/ui_settings.ts b/src/plugins/vis_types/timelion/server/ui_settings.ts similarity index 100% rename from src/plugins/vis_type_timelion/server/ui_settings.ts rename to src/plugins/vis_types/timelion/server/ui_settings.ts diff --git a/src/plugins/vis_types/timelion/tsconfig.json b/src/plugins/vis_types/timelion/tsconfig.json new file mode 100644 index 0000000000000..8613f381e5e4f --- /dev/null +++ b/src/plugins/vis_types/timelion/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + "*.ts" + ], + "references": [ + { "path": "../../../core/tsconfig.json" }, + { "path": "../../visualizations/tsconfig.json" }, + { "path": "../../data/tsconfig.json" }, + { "path": "../../expressions/tsconfig.json" }, + { "path": "../../kibana_utils/tsconfig.json" }, + { "path": "../../kibana_react/tsconfig.json" }, + { "path": "../../vis_default_editor/tsconfig.json" }, + ] +} diff --git a/src/plugins/vis_type_vega/config.ts b/src/plugins/vis_types/vega/config.ts similarity index 100% rename from src/plugins/vis_type_vega/config.ts rename to src/plugins/vis_types/vega/config.ts diff --git a/src/plugins/vis_types/vega/jest.config.js b/src/plugins/vis_types/vega/jest.config.js new file mode 100644 index 0000000000000..33c2d8e7aa1ed --- /dev/null +++ b/src/plugins/vis_types/vega/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/vis_types/vega'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_types/vega', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/vis_types/vega/{public,server}/**/*.{js,ts,tsx}'], +}; diff --git a/src/plugins/vis_type_vega/kibana.json b/src/plugins/vis_types/vega/kibana.json similarity index 100% rename from src/plugins/vis_type_vega/kibana.json rename to src/plugins/vis_types/vega/kibana.json diff --git a/src/plugins/vis_types/vega/public/__snapshots__/vega_visualization.test.js.snap b/src/plugins/vis_types/vega/public/__snapshots__/vega_visualization.test.js.snap new file mode 100644 index 0000000000000..8915dbcc149c4 --- /dev/null +++ b/src/plugins/vis_types/vega/public/__snapshots__/vega_visualization.test.js.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`VegaVisualizations VegaVisualization - basics should show vega graph (may fail in dev env) 1`] = `"
"`; + +exports[`VegaVisualizations VegaVisualization - basics should show vegalite graph and update on resize (may fail in dev env) 1`] = `"
  • \\"width\\" and \\"height\\" params are ignored because \\"autosize\\" is enabled. Set \\"autosize\\": \\"none\\" to disable
"`; + +exports[`VegaVisualizations VegaVisualization - basics should show vegalite graph and update on resize (may fail in dev env) 2`] = `"
  • \\"width\\" and \\"height\\" params are ignored because \\"autosize\\" is enabled. Set \\"autosize\\": \\"none\\" to disable
"`; diff --git a/src/plugins/vis_type_vega/public/components/experimental_map_vis_info.tsx b/src/plugins/vis_types/vega/public/components/experimental_map_vis_info.tsx similarity index 96% rename from src/plugins/vis_type_vega/public/components/experimental_map_vis_info.tsx rename to src/plugins/vis_types/vega/public/components/experimental_map_vis_info.tsx index ca0cb0f0ff797..2de6eb490196c 100644 --- a/src/plugins/vis_type_vega/public/components/experimental_map_vis_info.tsx +++ b/src/plugins/vis_types/vega/public/components/experimental_map_vis_info.tsx @@ -10,7 +10,7 @@ import { parse } from 'hjson'; import React from 'react'; import { EuiCallOut, EuiLink } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { Vis } from '../../../visualizations/public'; +import { Vis } from '../../../../visualizations/public'; function ExperimentalMapLayerInfo() { const title = ( diff --git a/src/plugins/vis_type_vega/public/components/vega_actions_menu.tsx b/src/plugins/vis_types/vega/public/components/vega_actions_menu.tsx similarity index 100% rename from src/plugins/vis_type_vega/public/components/vega_actions_menu.tsx rename to src/plugins/vis_types/vega/public/components/vega_actions_menu.tsx diff --git a/src/plugins/vis_type_vega/public/components/vega_editor.scss b/src/plugins/vis_types/vega/public/components/vega_editor.scss similarity index 100% rename from src/plugins/vis_type_vega/public/components/vega_editor.scss rename to src/plugins/vis_types/vega/public/components/vega_editor.scss diff --git a/src/plugins/vis_type_vega/public/components/vega_help_menu.tsx b/src/plugins/vis_types/vega/public/components/vega_help_menu.tsx similarity index 100% rename from src/plugins/vis_type_vega/public/components/vega_help_menu.tsx rename to src/plugins/vis_types/vega/public/components/vega_help_menu.tsx diff --git a/src/plugins/vis_type_vega/public/components/vega_vis.scss b/src/plugins/vis_types/vega/public/components/vega_vis.scss similarity index 100% rename from src/plugins/vis_type_vega/public/components/vega_vis.scss rename to src/plugins/vis_types/vega/public/components/vega_vis.scss diff --git a/src/plugins/vis_type_vega/public/components/vega_vis_component.tsx b/src/plugins/vis_types/vega/public/components/vega_vis_component.tsx similarity index 100% rename from src/plugins/vis_type_vega/public/components/vega_vis_component.tsx rename to src/plugins/vis_types/vega/public/components/vega_vis_component.tsx diff --git a/src/plugins/vis_type_vega/public/components/vega_vis_editor.tsx b/src/plugins/vis_types/vega/public/components/vega_vis_editor.tsx similarity index 97% rename from src/plugins/vis_type_vega/public/components/vega_vis_editor.tsx rename to src/plugins/vis_types/vega/public/components/vega_vis_editor.tsx index 9150b31343799..d2f586eac9885 100644 --- a/src/plugins/vis_type_vega/public/components/vega_vis_editor.tsx +++ b/src/plugins/vis_types/vega/public/components/vega_vis_editor.tsx @@ -13,7 +13,7 @@ import 'brace/mode/hjson'; import { i18n } from '@kbn/i18n'; import { VisEditorOptionsProps } from 'src/plugins/visualizations/public'; -import { EuiCodeEditor } from '../../../es_ui_shared/public'; +import { EuiCodeEditor } from '../../../../es_ui_shared/public'; import { getNotifications } from '../services'; import { VisParams } from '../vega_fn'; import { VegaHelpMenu } from './vega_help_menu'; diff --git a/src/plugins/vis_type_vega/public/components/vega_vis_editor_lazy.tsx b/src/plugins/vis_types/vega/public/components/vega_vis_editor_lazy.tsx similarity index 100% rename from src/plugins/vis_type_vega/public/components/vega_vis_editor_lazy.tsx rename to src/plugins/vis_types/vega/public/components/vega_vis_editor_lazy.tsx diff --git a/src/plugins/vis_type_vega/public/data_model/ems_file_parser.ts b/src/plugins/vis_types/vega/public/data_model/ems_file_parser.ts similarity index 97% rename from src/plugins/vis_type_vega/public/data_model/ems_file_parser.ts rename to src/plugins/vis_types/vega/public/data_model/ems_file_parser.ts index c79ebe02c0d3f..3001da2008e40 100644 --- a/src/plugins/vis_type_vega/public/data_model/ems_file_parser.ts +++ b/src/plugins/vis_types/vega/public/data_model/ems_file_parser.ts @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; // @ts-ignore import { bypassExternalUrlCheck } from '../vega_view/vega_base_view'; -import { IServiceSettings, FileLayer } from '../../../maps_ems/public'; +import { IServiceSettings, FileLayer } from '../../../../maps_ems/public'; import { Data, UrlObject, EmsQueryRequest } from './types'; /** diff --git a/src/plugins/vis_type_vega/public/data_model/es_query_parser.test.js b/src/plugins/vis_types/vega/public/data_model/es_query_parser.test.js similarity index 100% rename from src/plugins/vis_type_vega/public/data_model/es_query_parser.test.js rename to src/plugins/vis_types/vega/public/data_model/es_query_parser.test.js diff --git a/src/plugins/vis_type_vega/public/data_model/es_query_parser.ts b/src/plugins/vis_types/vega/public/data_model/es_query_parser.ts similarity index 100% rename from src/plugins/vis_type_vega/public/data_model/es_query_parser.ts rename to src/plugins/vis_types/vega/public/data_model/es_query_parser.ts diff --git a/src/plugins/vis_type_vega/public/data_model/search_api.test.ts b/src/plugins/vis_types/vega/public/data_model/search_api.test.ts similarity index 95% rename from src/plugins/vis_type_vega/public/data_model/search_api.test.ts rename to src/plugins/vis_types/vega/public/data_model/search_api.test.ts index d0739453e43ec..27dc1627ae229 100644 --- a/src/plugins/vis_type_vega/public/data_model/search_api.test.ts +++ b/src/plugins/vis_types/vega/public/data_model/search_api.test.ts @@ -7,9 +7,9 @@ */ import { extendSearchParamsWithRuntimeFields } from './search_api'; -import { dataPluginMock } from '../../../data/public/mocks'; +import { dataPluginMock } from '../../../../data/public/mocks'; -import { getSearchParamsFromRequest, DataPublicPluginStart } from '../../../data/public'; +import { getSearchParamsFromRequest, DataPublicPluginStart } from '../../../../data/public'; const mockComputedFields = ( dataStart: DataPublicPluginStart, diff --git a/src/plugins/vis_type_vega/public/data_model/search_api.ts b/src/plugins/vis_types/vega/public/data_model/search_api.ts similarity index 95% rename from src/plugins/vis_type_vega/public/data_model/search_api.ts rename to src/plugins/vis_types/vega/public/data_model/search_api.ts index efdbf96e54f05..e00cf647930a8 100644 --- a/src/plugins/vis_type_vega/public/data_model/search_api.ts +++ b/src/plugins/vis_types/vega/public/data_model/search_api.ts @@ -14,10 +14,10 @@ import { SearchRequest, DataPublicPluginStart, IEsSearchResponse, -} from '../../../data/public'; -import { search as dataPluginSearch } from '../../../data/public'; +} from '../../../../data/public'; +import { search as dataPluginSearch } from '../../../../data/public'; import type { VegaInspectorAdapters } from '../vega_inspector'; -import type { RequestResponder } from '../../../inspector/public'; +import type { RequestResponder } from '../../../../inspector/public'; /** @internal **/ export const extendSearchParamsWithRuntimeFields = async ( diff --git a/src/plugins/vis_type_vega/public/data_model/time_cache.test.js b/src/plugins/vis_types/vega/public/data_model/time_cache.test.js similarity index 100% rename from src/plugins/vis_type_vega/public/data_model/time_cache.test.js rename to src/plugins/vis_types/vega/public/data_model/time_cache.test.js diff --git a/src/plugins/vis_type_vega/public/data_model/time_cache.ts b/src/plugins/vis_types/vega/public/data_model/time_cache.ts similarity index 95% rename from src/plugins/vis_type_vega/public/data_model/time_cache.ts rename to src/plugins/vis_types/vega/public/data_model/time_cache.ts index 13c01b5fe83bc..cc9619e143437 100644 --- a/src/plugins/vis_type_vega/public/data_model/time_cache.ts +++ b/src/plugins/vis_types/vega/public/data_model/time_cache.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ -import { TimefilterContract } from '../../../data/public'; -import { TimeRange } from '../../../data/common'; +import { TimefilterContract } from '../../../../data/public'; +import { TimeRange } from '../../../../data/common'; import { CacheBounds } from './types'; /** diff --git a/src/plugins/vis_type_vega/public/data_model/types.ts b/src/plugins/vis_types/vega/public/data_model/types.ts similarity index 100% rename from src/plugins/vis_type_vega/public/data_model/types.ts rename to src/plugins/vis_types/vega/public/data_model/types.ts diff --git a/src/plugins/vis_type_vega/public/data_model/url_parser.ts b/src/plugins/vis_types/vega/public/data_model/url_parser.ts similarity index 100% rename from src/plugins/vis_type_vega/public/data_model/url_parser.ts rename to src/plugins/vis_types/vega/public/data_model/url_parser.ts diff --git a/src/plugins/vis_type_vega/public/data_model/utils.ts b/src/plugins/vis_types/vega/public/data_model/utils.ts similarity index 100% rename from src/plugins/vis_type_vega/public/data_model/utils.ts rename to src/plugins/vis_types/vega/public/data_model/utils.ts diff --git a/src/plugins/vis_type_vega/public/data_model/vega_parser.test.js b/src/plugins/vis_types/vega/public/data_model/vega_parser.test.js similarity index 100% rename from src/plugins/vis_type_vega/public/data_model/vega_parser.test.js rename to src/plugins/vis_types/vega/public/data_model/vega_parser.test.js diff --git a/src/plugins/vis_type_vega/public/data_model/vega_parser.ts b/src/plugins/vis_types/vega/public/data_model/vega_parser.ts similarity index 99% rename from src/plugins/vis_type_vega/public/data_model/vega_parser.ts rename to src/plugins/vis_types/vega/public/data_model/vega_parser.ts index bc7d72c042841..3ae95c0393b5a 100644 --- a/src/plugins/vis_type_vega/public/data_model/vega_parser.ts +++ b/src/plugins/vis_types/vega/public/data_model/vega_parser.ts @@ -22,7 +22,7 @@ import { EmsFileParser } from './ems_file_parser'; import { UrlParser } from './url_parser'; import { SearchAPI } from './search_api'; import { TimeCache } from './time_cache'; -import { IServiceSettings } from '../../../maps_ems/public'; +import { IServiceSettings } from '../../../../maps_ems/public'; import { Bool, Data, diff --git a/src/plugins/vis_type_vega/public/default.spec.hjson b/src/plugins/vis_types/vega/public/default.spec.hjson similarity index 100% rename from src/plugins/vis_type_vega/public/default.spec.hjson rename to src/plugins/vis_types/vega/public/default.spec.hjson diff --git a/src/plugins/vis_type_vega/public/default_spec.ts b/src/plugins/vis_types/vega/public/default_spec.ts similarity index 100% rename from src/plugins/vis_type_vega/public/default_spec.ts rename to src/plugins/vis_types/vega/public/default_spec.ts diff --git a/src/plugins/vis_type_vega/public/index.ts b/src/plugins/vis_types/vega/public/index.ts similarity index 100% rename from src/plugins/vis_type_vega/public/index.ts rename to src/plugins/vis_types/vega/public/index.ts diff --git a/src/plugins/vis_type_vega/public/lib/extract_index_pattern.test.ts b/src/plugins/vis_types/vega/public/lib/extract_index_pattern.test.ts similarity index 97% rename from src/plugins/vis_type_vega/public/lib/extract_index_pattern.test.ts rename to src/plugins/vis_types/vega/public/lib/extract_index_pattern.test.ts index 6feb8fce9c5a3..39aadc009b93c 100644 --- a/src/plugins/vis_type_vega/public/lib/extract_index_pattern.test.ts +++ b/src/plugins/vis_types/vega/public/lib/extract_index_pattern.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { dataPluginMock } from '../../../data/public/mocks'; +import { dataPluginMock } from '../../../../data/public/mocks'; import { extractIndexPatternsFromSpec } from './extract_index_pattern'; import { setData } from '../services'; diff --git a/src/plugins/vis_type_vega/public/lib/extract_index_pattern.ts b/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts similarity index 94% rename from src/plugins/vis_type_vega/public/lib/extract_index_pattern.ts rename to src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts index 81f30ca9bbe2c..0d25db665ce7f 100644 --- a/src/plugins/vis_type_vega/public/lib/extract_index_pattern.ts +++ b/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts @@ -10,7 +10,7 @@ import { flatten } from 'lodash'; import { getData } from '../services'; import type { Data, VegaSpec } from '../data_model/types'; -import type { IndexPattern } from '../../../data/public'; +import type { IndexPattern } from '../../../../data/public'; export const extractIndexPatternsFromSpec = async (spec: VegaSpec) => { const { indexPatterns } = getData(); diff --git a/src/plugins/vis_type_vega/public/lib/vega_state_restorer.test.ts b/src/plugins/vis_types/vega/public/lib/vega_state_restorer.test.ts similarity index 100% rename from src/plugins/vis_type_vega/public/lib/vega_state_restorer.test.ts rename to src/plugins/vis_types/vega/public/lib/vega_state_restorer.test.ts diff --git a/src/plugins/vis_type_vega/public/lib/vega_state_restorer.ts b/src/plugins/vis_types/vega/public/lib/vega_state_restorer.ts similarity index 100% rename from src/plugins/vis_type_vega/public/lib/vega_state_restorer.ts rename to src/plugins/vis_types/vega/public/lib/vega_state_restorer.ts diff --git a/src/plugins/vis_types/vega/public/plugin.ts b/src/plugins/vis_types/vega/public/plugin.ts new file mode 100644 index 0000000000000..942c1673ad202 --- /dev/null +++ b/src/plugins/vis_types/vega/public/plugin.ts @@ -0,0 +1,102 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 } from '../../../../core/public'; +import { Plugin as ExpressionsPublicPlugin } from '../../../expressions/public'; +import { DataPublicPluginSetup, DataPublicPluginStart } from '../../../data/public'; +import { VisualizationsSetup } from '../../../visualizations/public'; +import { Setup as InspectorSetup } from '../../../inspector/public'; + +import { + setNotifications, + setData, + setInjectedVars, + setUISettings, + setInjectedMetadata, + setMapServiceSettings, + setDocLinks, +} from './services'; + +import { createVegaFn } from './vega_fn'; +import { createVegaTypeDefinition } from './vega_type'; +import { IServiceSettings, MapsEmsPluginSetup } from '../../../maps_ems/public'; +import { ConfigSchema } from '../config'; + +import { getVegaInspectorView } from './vega_inspector'; +import { getVegaVisRenderer } from './vega_vis_renderer'; +import { MapServiceSettings } from './vega_view/vega_map_view/map_service_settings'; + +/** @internal */ +export interface VegaVisualizationDependencies { + core: CoreSetup; + plugins: { + data: DataPublicPluginSetup; + }; + getServiceSettings: () => Promise; +} + +/** @internal */ +export interface VegaPluginSetupDependencies { + expressions: ReturnType; + visualizations: VisualizationsSetup; + inspector: InspectorSetup; + data: DataPublicPluginSetup; + mapsEms: MapsEmsPluginSetup; +} + +/** @internal */ +export interface VegaPluginStartDependencies { + data: DataPublicPluginStart; +} + +/** @internal */ +export class VegaPlugin implements Plugin { + initializerContext: PluginInitializerContext; + + constructor(initializerContext: PluginInitializerContext) { + this.initializerContext = initializerContext; + } + + public setup( + core: CoreSetup, + { inspector, data, expressions, visualizations, mapsEms }: VegaPluginSetupDependencies + ) { + setInjectedVars({ + enableExternalUrls: this.initializerContext.config.get().enableExternalUrls, + emsTileLayerId: core.injectedMetadata.getInjectedVar('emsTileLayerId', true), + }); + + setUISettings(core.uiSettings); + + setMapServiceSettings( + new MapServiceSettings(mapsEms.config, this.initializerContext.env.packageInfo.version) + ); + + const visualizationDependencies: Readonly = { + core, + plugins: { + data, + }, + getServiceSettings: mapsEms.getServiceSettings, + }; + + inspector.registerView(getVegaInspectorView({ uiSettings: core.uiSettings })); + + expressions.registerFunction(() => createVegaFn(visualizationDependencies)); + expressions.registerRenderer(getVegaVisRenderer(visualizationDependencies)); + + visualizations.createBaseVisualization(createVegaTypeDefinition()); + } + + public start(core: CoreStart, { data }: VegaPluginStartDependencies) { + setNotifications(core.notifications); + setData(data); + setInjectedMetadata(core.injectedMetadata); + setDocLinks(core.docLinks); + } +} diff --git a/src/plugins/vis_types/vega/public/services.ts b/src/plugins/vis_types/vega/public/services.ts new file mode 100644 index 0000000000000..1cdb24ff7b02c --- /dev/null +++ b/src/plugins/vis_types/vega/public/services.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 { CoreStart, NotificationsStart, IUiSettingsClient, DocLinksStart } from 'src/core/public'; + +import { DataPublicPluginStart } from '../../../data/public'; +import { createGetterSetter } from '../../../kibana_utils/public'; +import { MapServiceSettings } from './vega_view/vega_map_view/map_service_settings'; + +export const [getData, setData] = createGetterSetter('Data'); + +export const [getNotifications, setNotifications] = createGetterSetter( + 'Notifications' +); + +export const [getUISettings, setUISettings] = createGetterSetter('UISettings'); + +export const [getInjectedMetadata, setInjectedMetadata] = createGetterSetter< + CoreStart['injectedMetadata'] +>('InjectedMetadata'); + +export const [ + getMapServiceSettings, + setMapServiceSettings, +] = createGetterSetter('MapServiceSettings'); + +export const [getInjectedVars, setInjectedVars] = createGetterSetter<{ + enableExternalUrls: boolean; + emsTileLayerId: unknown; +}>('InjectedVars'); + +export const getEnableExternalUrls = () => getInjectedVars().enableExternalUrls; + +export const [getDocLinks, setDocLinks] = createGetterSetter('docLinks'); diff --git a/src/plugins/vis_type_vega/public/test_utils/default.spec.json b/src/plugins/vis_types/vega/public/test_utils/default.spec.json similarity index 100% rename from src/plugins/vis_type_vega/public/test_utils/default.spec.json rename to src/plugins/vis_types/vega/public/test_utils/default.spec.json diff --git a/src/plugins/vis_type_vega/public/test_utils/vega_graph.json b/src/plugins/vis_types/vega/public/test_utils/vega_graph.json similarity index 100% rename from src/plugins/vis_type_vega/public/test_utils/vega_graph.json rename to src/plugins/vis_types/vega/public/test_utils/vega_graph.json diff --git a/src/plugins/vis_type_vega/public/test_utils/vega_map_test.json b/src/plugins/vis_types/vega/public/test_utils/vega_map_test.json similarity index 100% rename from src/plugins/vis_type_vega/public/test_utils/vega_map_test.json rename to src/plugins/vis_types/vega/public/test_utils/vega_map_test.json diff --git a/src/plugins/vis_type_vega/public/test_utils/vegalite_graph.json b/src/plugins/vis_types/vega/public/test_utils/vegalite_graph.json similarity index 100% rename from src/plugins/vis_type_vega/public/test_utils/vegalite_graph.json rename to src/plugins/vis_types/vega/public/test_utils/vegalite_graph.json diff --git a/src/plugins/vis_types/vega/public/to_ast.ts b/src/plugins/vis_types/vega/public/to_ast.ts new file mode 100644 index 0000000000000..f9ff7effafe49 --- /dev/null +++ b/src/plugins/vis_types/vega/public/to_ast.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 { buildExpression, buildExpressionFunction } from '../../../expressions/public'; +import { Vis } from '../../../visualizations/public'; +import { VegaExpressionFunctionDefinition, VisParams } from './vega_fn'; + +export const toExpressionAst = (vis: Vis) => { + const vega = buildExpressionFunction('vega', { + spec: vis.params.spec, + }); + + const ast = buildExpression([vega]); + + return ast.toAst(); +}; diff --git a/src/plugins/vis_type_vega/public/vega_fn.ts b/src/plugins/vis_types/vega/public/vega_fn.ts similarity index 89% rename from src/plugins/vis_type_vega/public/vega_fn.ts rename to src/plugins/vis_types/vega/public/vega_fn.ts index 775bd2623028b..cbdc131ab7e2a 100644 --- a/src/plugins/vis_type_vega/public/vega_fn.ts +++ b/src/plugins/vis_types/vega/public/vega_fn.ts @@ -8,12 +8,16 @@ import { get } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { ExecutionContextSearch } from '../../data/public'; -import { ExecutionContext, ExpressionFunctionDefinition, Render } from '../../expressions/public'; +import { ExecutionContextSearch } from '../../../data/public'; +import { + ExecutionContext, + ExpressionFunctionDefinition, + Render, +} from '../../../expressions/public'; import { VegaVisualizationDependencies } from './plugin'; import { createVegaRequestHandler } from './vega_request_handler'; import { VegaInspectorAdapters } from './vega_inspector/index'; -import { KibanaContext, TimeRange, Query } from '../../data/public'; +import { KibanaContext, TimeRange, Query } from '../../../data/public'; import { VegaParser } from './data_model/vega_parser'; type Input = KibanaContext | { type: 'null' }; diff --git a/src/plugins/vis_type_vega/public/vega_inspector/components/data_viewer.tsx b/src/plugins/vis_types/vega/public/vega_inspector/components/data_viewer.tsx similarity index 100% rename from src/plugins/vis_type_vega/public/vega_inspector/components/data_viewer.tsx rename to src/plugins/vis_types/vega/public/vega_inspector/components/data_viewer.tsx diff --git a/src/plugins/vis_type_vega/public/vega_inspector/components/index.ts b/src/plugins/vis_types/vega/public/vega_inspector/components/index.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_inspector/components/index.ts rename to src/plugins/vis_types/vega/public/vega_inspector/components/index.ts diff --git a/src/plugins/vis_type_vega/public/vega_inspector/components/inspector_data_grid.tsx b/src/plugins/vis_types/vega/public/vega_inspector/components/inspector_data_grid.tsx similarity index 100% rename from src/plugins/vis_type_vega/public/vega_inspector/components/inspector_data_grid.tsx rename to src/plugins/vis_types/vega/public/vega_inspector/components/inspector_data_grid.tsx diff --git a/src/plugins/vis_type_vega/public/vega_inspector/components/signal_viewer.tsx b/src/plugins/vis_types/vega/public/vega_inspector/components/signal_viewer.tsx similarity index 100% rename from src/plugins/vis_type_vega/public/vega_inspector/components/signal_viewer.tsx rename to src/plugins/vis_types/vega/public/vega_inspector/components/signal_viewer.tsx diff --git a/src/plugins/vis_type_vega/public/vega_inspector/components/spec_viewer.tsx b/src/plugins/vis_types/vega/public/vega_inspector/components/spec_viewer.tsx similarity index 97% rename from src/plugins/vis_type_vega/public/vega_inspector/components/spec_viewer.tsx rename to src/plugins/vis_types/vega/public/vega_inspector/components/spec_viewer.tsx index 135c23b21d7d4..9c13857076d8b 100644 --- a/src/plugins/vis_type_vega/public/vega_inspector/components/spec_viewer.tsx +++ b/src/plugins/vis_types/vega/public/vega_inspector/components/spec_viewer.tsx @@ -19,7 +19,7 @@ import { CommonProps, } from '@elastic/eui'; import { VegaAdapter } from '../vega_adapter'; -import { CodeEditor } from '../../../../kibana_react/public'; +import { CodeEditor } from '../../../../../kibana_react/public'; interface SpecViewerProps extends CommonProps { vegaAdapter: VegaAdapter; diff --git a/src/plugins/vis_type_vega/public/vega_inspector/index.ts b/src/plugins/vis_types/vega/public/vega_inspector/index.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_inspector/index.ts rename to src/plugins/vis_types/vega/public/vega_inspector/index.ts diff --git a/src/plugins/vis_type_vega/public/vega_inspector/vega_adapter.ts b/src/plugins/vis_types/vega/public/vega_inspector/vega_adapter.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_inspector/vega_adapter.ts rename to src/plugins/vis_types/vega/public/vega_inspector/vega_adapter.ts diff --git a/src/plugins/vis_type_vega/public/vega_inspector/vega_data_inspector.scss b/src/plugins/vis_types/vega/public/vega_inspector/vega_data_inspector.scss similarity index 100% rename from src/plugins/vis_type_vega/public/vega_inspector/vega_data_inspector.scss rename to src/plugins/vis_types/vega/public/vega_inspector/vega_data_inspector.scss diff --git a/src/plugins/vis_type_vega/public/vega_inspector/vega_data_inspector.tsx b/src/plugins/vis_types/vega/public/vega_inspector/vega_data_inspector.tsx similarity index 96% rename from src/plugins/vis_type_vega/public/vega_inspector/vega_data_inspector.tsx rename to src/plugins/vis_types/vega/public/vega_inspector/vega_data_inspector.tsx index 497c8a9ed1af3..75618df307150 100644 --- a/src/plugins/vis_type_vega/public/vega_inspector/vega_data_inspector.tsx +++ b/src/plugins/vis_types/vega/public/vega_inspector/vega_data_inspector.tsx @@ -14,7 +14,7 @@ import { EuiTabbedContent } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { VegaInspectorAdapters } from './vega_inspector'; import { DataViewer, SignalViewer, SpecViewer } from './components'; -import { InspectorViewProps } from '../../../inspector/public'; +import { InspectorViewProps } from '../../../../inspector/public'; export type VegaDataInspectorProps = InspectorViewProps; diff --git a/src/plugins/vis_type_vega/public/vega_inspector/vega_inspector.tsx b/src/plugins/vis_types/vega/public/vega_inspector/vega_inspector.tsx similarity index 94% rename from src/plugins/vis_type_vega/public/vega_inspector/vega_inspector.tsx rename to src/plugins/vis_types/vega/public/vega_inspector/vega_inspector.tsx index e02ae780acab1..1ca95b84f53ae 100644 --- a/src/plugins/vis_type_vega/public/vega_inspector/vega_inspector.tsx +++ b/src/plugins/vis_types/vega/public/vega_inspector/vega_inspector.tsx @@ -11,8 +11,8 @@ import { EuiLoadingSpinner } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { IUiSettingsClient } from 'kibana/public'; -import { KibanaContextProvider } from '../../../kibana_react/public'; -import { Adapters, RequestAdapter, InspectorViewDescription } from '../../../inspector/public'; +import { KibanaContextProvider } from '../../../../kibana_react/public'; +import { Adapters, RequestAdapter, InspectorViewDescription } from '../../../../inspector/public'; import { VegaAdapter } from './vega_adapter'; import type { VegaDataInspectorProps } from './vega_data_inspector'; diff --git a/src/plugins/vis_type_vega/public/vega_request_handler.ts b/src/plugins/vis_types/vega/public/vega_request_handler.ts similarity index 96% rename from src/plugins/vis_type_vega/public/vega_request_handler.ts rename to src/plugins/vis_types/vega/public/vega_request_handler.ts index 4f07785f43c4f..2ae7169c2f732 100644 --- a/src/plugins/vis_type_vega/public/vega_request_handler.ts +++ b/src/plugins/vis_types/vega/public/vega_request_handler.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import type { KibanaExecutionContext } from 'src/core/public'; -import { Filter, esQuery, TimeRange, Query } from '../../data/public'; +import { Filter, esQuery, TimeRange, Query } from '../../../data/public'; import { SearchAPI } from './data_model/search_api'; import { TimeCache } from './data_model/time_cache'; diff --git a/src/plugins/vis_type_vega/public/vega_type.ts b/src/plugins/vis_types/vega/public/vega_type.ts similarity index 95% rename from src/plugins/vis_type_vega/public/vega_type.ts rename to src/plugins/vis_types/vega/public/vega_type.ts index 902f79d03e680..74899f5cfb3a4 100644 --- a/src/plugins/vis_type_vega/public/vega_type.ts +++ b/src/plugins/vis_types/vega/public/vega_type.ts @@ -9,8 +9,8 @@ import { i18n } from '@kbn/i18n'; import { parse } from 'hjson'; -import { DefaultEditorSize } from '../../vis_default_editor/public'; -import { VIS_EVENT_TO_TRIGGER, VisGroups, VisTypeDefinition } from '../../visualizations/public'; +import { DefaultEditorSize } from '../../../vis_default_editor/public'; +import { VIS_EVENT_TO_TRIGGER, VisGroups, VisTypeDefinition } from '../../../visualizations/public'; import { getDefaultSpec } from './default_spec'; import { extractIndexPatternsFromSpec } from './lib/extract_index_pattern'; diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_base_view.d.ts b/src/plugins/vis_types/vega/public/vega_view/vega_base_view.d.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_view/vega_base_view.d.ts rename to src/plugins/vis_types/vega/public/vega_view/vega_base_view.d.ts diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_base_view.js b/src/plugins/vis_types/vega/public/vega_view/vega_base_view.js similarity index 99% rename from src/plugins/vis_type_vega/public/vega_view/vega_base_view.js rename to src/plugins/vis_types/vega/public/vega_view/vega_base_view.js index 0cf3f16c3d20c..a41197293bbdc 100644 --- a/src/plugins/vis_type_vega/public/vega_view/vega_base_view.js +++ b/src/plugins/vis_types/vega/public/vega_view/vega_base_view.js @@ -16,7 +16,7 @@ import { Utils } from '../data_model/utils'; import { euiPaletteColorBlind } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { TooltipHandler } from './vega_tooltip'; -import { esFilters } from '../../../data/public'; +import { esFilters } from '../../../../data/public'; import { getEnableExternalUrls, getData } from '../services'; import { extractIndexPatternsFromSpec } from '../lib/extract_index_pattern'; diff --git a/src/plugins/vis_types/vega/public/vega_view/vega_map_view/constants.ts b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/constants.ts new file mode 100644 index 0000000000000..a2a3cd464276f --- /dev/null +++ b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/constants.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 { Style } from '@kbn/mapbox-gl'; +import { TMS_IN_YML_ID } from '../../../../../maps_ems/public'; + +export const vegaLayerId = 'vega'; +export const userConfiguredLayerId = TMS_IN_YML_ID; +export const defaultMapConfig = { + maxZoom: 20, + minZoom: 0, + tileSize: 256, +}; + +export const defaultMabBoxStyle: Style = { + /** + * according to the MapBox documentation that value should be '8' + * @see (https://docs.mapbox.com/mapbox-gl-js/style-spec/root/#version) + */ + version: 8, + sources: {}, + layers: [], +}; + +export const defaultProjection = { + name: 'projection', + type: 'mercator', + scale: { signal: '512*pow(2,zoom)/2/PI' }, + rotate: [{ signal: '-longitude' }, 0, 0], + center: [0, { signal: 'latitude' }], + translate: [{ signal: 'width/2' }, { signal: 'height/2' }], + fit: false, +}; diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/index.ts b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/layers/index.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/index.ts rename to src/plugins/vis_types/vega/public/vega_view/vega_map_view/layers/index.ts diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/tms_raster_layer.test.ts b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/layers/tms_raster_layer.test.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/tms_raster_layer.test.ts rename to src/plugins/vis_types/vega/public/vega_view/vega_map_view/layers/tms_raster_layer.test.ts diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/tms_raster_layer.ts b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/layers/tms_raster_layer.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/tms_raster_layer.ts rename to src/plugins/vis_types/vega/public/vega_view/vega_map_view/layers/tms_raster_layer.ts diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/types.ts b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/layers/types.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/types.ts rename to src/plugins/vis_types/vega/public/vega_view/vega_map_view/layers/types.ts diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/vega_layer.test.ts b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/layers/vega_layer.test.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/vega_layer.test.ts rename to src/plugins/vis_types/vega/public/vega_view/vega_map_view/layers/vega_layer.test.ts diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/vega_layer.ts b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/layers/vega_layer.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/vega_layer.ts rename to src/plugins/vis_types/vega/public/vega_view/vega_map_view/layers/vega_layer.ts diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/map_service_settings.test.ts b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/map_service_settings.test.ts similarity index 98% rename from src/plugins/vis_type_vega/public/vega_view/vega_map_view/map_service_settings.test.ts rename to src/plugins/vis_types/vega/public/vega_view/vega_map_view/map_service_settings.test.ts index c459220d4aa86..95fee2ea3820d 100644 --- a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/map_service_settings.test.ts +++ b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/map_service_settings.test.ts @@ -10,7 +10,7 @@ import { get } from 'lodash'; import { uiSettingsServiceMock } from 'src/core/public/mocks'; import { MapServiceSettings, getAttributionsForTmsService } from './map_service_settings'; -import type { MapsEmsConfig } from '../../../../maps_ems/public'; +import type { MapsEmsConfig } from '../../../../../maps_ems/public'; import { EMSClient, TMSService } from '@elastic/ems-client'; import { setUISettings } from '../../services'; diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/map_service_settings.ts b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/map_service_settings.ts similarity index 97% rename from src/plugins/vis_type_vega/public/vega_view/vega_map_view/map_service_settings.ts rename to src/plugins/vis_types/vega/public/vega_view/vega_map_view/map_service_settings.ts index 8874db7737a4e..3399d0628ad65 100644 --- a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/map_service_settings.ts +++ b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/map_service_settings.ts @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import type { EMSClient, TMSService } from '@elastic/ems-client'; import { getUISettings } from '../../services'; import { userConfiguredLayerId } from './constants'; -import type { MapsEmsConfig } from '../../../../maps_ems/public'; +import type { MapsEmsConfig } from '../../../../../maps_ems/public'; type EmsClientConfig = ConstructorParameters[0]; diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/utils/index.ts b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/utils/index.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_view/vega_map_view/utils/index.ts rename to src/plugins/vis_types/vega/public/vega_view/vega_map_view/utils/index.ts diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/utils/validation_helper.test.ts b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/utils/validation_helper.test.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_view/vega_map_view/utils/validation_helper.test.ts rename to src/plugins/vis_types/vega/public/vega_view/vega_map_view/utils/validation_helper.test.ts diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/utils/validation_helper.ts b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/utils/validation_helper.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_view/vega_map_view/utils/validation_helper.ts rename to src/plugins/vis_types/vega/public/vega_view/vega_map_view/utils/validation_helper.ts diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/utils/vsi_helper.test.ts b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/utils/vsi_helper.test.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_view/vega_map_view/utils/vsi_helper.test.ts rename to src/plugins/vis_types/vega/public/vega_view/vega_map_view/utils/vsi_helper.test.ts diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/utils/vsi_helper.ts b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/utils/vsi_helper.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_view/vega_map_view/utils/vsi_helper.ts rename to src/plugins/vis_types/vega/public/vega_view/vega_map_view/utils/vsi_helper.ts diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/vega_map_view.scss b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/vega_map_view.scss similarity index 100% rename from src/plugins/vis_type_vega/public/vega_view/vega_map_view/vega_map_view.scss rename to src/plugins/vis_types/vega/public/vega_view/vega_map_view/vega_map_view.scss diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/view.test.ts b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/view.test.ts similarity index 97% rename from src/plugins/vis_type_vega/public/vega_view/vega_map_view/view.test.ts rename to src/plugins/vis_types/vega/public/vega_view/vega_map_view/view.test.ts index 17a098649ebbf..e4bf4977094fd 100644 --- a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/view.test.ts +++ b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/view.test.ts @@ -15,9 +15,9 @@ import { VegaParser } from '../../data_model/vega_parser'; import { TimeCache } from '../../data_model/time_cache'; import { SearchAPI } from '../../data_model/search_api'; import vegaMap from '../../test_utils/vega_map_test.json'; -import { coreMock } from '../../../../../core/public/mocks'; -import { dataPluginMock } from '../../../../data/public/mocks'; -import type { IServiceSettings, MapsEmsConfig } from '../../../../maps_ems/public'; +import { coreMock } from '../../../../../../core/public/mocks'; +import { dataPluginMock } from '../../../../../data/public/mocks'; +import type { IServiceSettings, MapsEmsConfig } from '../../../../../maps_ems/public'; import { MapServiceSettings } from './map_service_settings'; import { userConfiguredLayerId } from './constants'; import { diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_map_view/view.ts b/src/plugins/vis_types/vega/public/vega_view/vega_map_view/view.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_view/vega_map_view/view.ts rename to src/plugins/vis_types/vega/public/vega_view/vega_map_view/view.ts diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_tooltip.js b/src/plugins/vis_types/vega/public/vega_view/vega_tooltip.js similarity index 100% rename from src/plugins/vis_type_vega/public/vega_view/vega_tooltip.js rename to src/plugins/vis_types/vega/public/vega_view/vega_tooltip.js diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_view.d.ts b/src/plugins/vis_types/vega/public/vega_view/vega_view.d.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_view/vega_view.d.ts rename to src/plugins/vis_types/vega/public/vega_view/vega_view.d.ts diff --git a/src/plugins/vis_type_vega/public/vega_view/vega_view.js b/src/plugins/vis_types/vega/public/vega_view/vega_view.js similarity index 100% rename from src/plugins/vis_type_vega/public/vega_view/vega_view.js rename to src/plugins/vis_types/vega/public/vega_view/vega_view.js diff --git a/src/plugins/vis_type_vega/public/vega_vis_renderer.tsx b/src/plugins/vis_types/vega/public/vega_vis_renderer.tsx similarity index 94% rename from src/plugins/vis_type_vega/public/vega_vis_renderer.tsx rename to src/plugins/vis_types/vega/public/vega_vis_renderer.tsx index 0d9ba493281fa..77af6dfdcf042 100644 --- a/src/plugins/vis_type_vega/public/vega_vis_renderer.tsx +++ b/src/plugins/vis_types/vega/public/vega_vis_renderer.tsx @@ -10,7 +10,7 @@ import React, { lazy } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import { ExpressionRenderDefinition } from 'src/plugins/expressions'; -import { VisualizationContainer } from '../../visualizations/public'; +import { VisualizationContainer } from '../../../visualizations/public'; import { VegaVisualizationDependencies } from './plugin'; import { RenderValue } from './vega_fn'; const VegaVisComponent = lazy(() => import('./components/vega_vis_component')); diff --git a/src/plugins/vis_type_vega/public/vega_visualization.test.js b/src/plugins/vis_types/vega/public/vega_visualization.test.js similarity index 89% rename from src/plugins/vis_type_vega/public/vega_visualization.test.js rename to src/plugins/vis_types/vega/public/vega_visualization.test.js index ba1121b8894e0..05a88880822ca 100644 --- a/src/plugins/vis_type_vega/public/vega_visualization.test.js +++ b/src/plugins/vis_types/vega/public/vega_visualization.test.js @@ -19,8 +19,8 @@ import { VegaParser } from './data_model/vega_parser'; import { SearchAPI } from './data_model/search_api'; import { setInjectedVars, setData, setNotifications } from './services'; -import { coreMock } from '../../../core/public/mocks'; -import { dataPluginMock } from '../../data/public/mocks'; +import { coreMock } from '../../../../core/public/mocks'; +import { dataPluginMock } from '../../../data/public/mocks'; jest.mock('./default_spec', () => ({ getDefaultSpec: () => jest.requireActual('./test_utils/default.spec.json'), @@ -81,9 +81,7 @@ describe('VegaVisualizations', () => { mockWidth.mockRestore(); mockHeight.mockRestore(); }); - - // SKIP: https://github.com/elastic/kibana/issues/83385 - test.skip('should show vegalite graph and update on resize (may fail in dev env)', async () => { + test('should show vegalite graph and update on resize (may fail in dev env)', async () => { let vegaVis; try { vegaVis = new VegaVisualization(domNode, jest.fn()); @@ -105,7 +103,7 @@ describe('VegaVisualizations', () => { expect(domNode.innerHTML).toMatchSnapshot(); mockedWidthValue = 256; - mockedHeightValue = 256; + mockedHeightValue = 250; await vegaVis.vegaView.resize(); @@ -115,8 +113,7 @@ describe('VegaVisualizations', () => { } }); - // SKIP: https://github.com/elastic/kibana/issues/83385 - test.skip('should show vega graph (may fail in dev env)', async () => { + test('should show vega graph (may fail in dev env)', async () => { let vegaVis; try { vegaVis = new VegaVisualization(domNode, jest.fn()); diff --git a/src/plugins/vis_type_vega/public/vega_visualization.ts b/src/plugins/vis_types/vega/public/vega_visualization.ts similarity index 100% rename from src/plugins/vis_type_vega/public/vega_visualization.ts rename to src/plugins/vis_types/vega/public/vega_visualization.ts diff --git a/src/plugins/vis_type_vega/server/index.ts b/src/plugins/vis_types/vega/server/index.ts similarity index 100% rename from src/plugins/vis_type_vega/server/index.ts rename to src/plugins/vis_types/vega/server/index.ts diff --git a/src/plugins/vis_types/vega/server/plugin.ts b/src/plugins/vis_types/vega/server/plugin.ts new file mode 100644 index 0000000000000..51a783456d6b2 --- /dev/null +++ b/src/plugins/vis_types/vega/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 } from '../../../../core/server'; +import { registerVegaUsageCollector } from './usage_collector'; +import { + ConfigObservable, + VisTypeVegaPluginSetupDependencies, + VisTypeVegaPluginSetup, + VisTypeVegaPluginStart, +} from './types'; + +export class VisTypeVegaPlugin implements Plugin { + private readonly config: ConfigObservable; + + constructor(initializerContext: PluginInitializerContext) { + this.config = initializerContext.config.legacy.globalConfig$; + } + + public setup(core: CoreSetup, { home, usageCollection }: VisTypeVegaPluginSetupDependencies) { + if (usageCollection) { + registerVegaUsageCollector(usageCollection, this.config, { home }); + } + return {}; + } + + public start(core: CoreStart) { + return {}; + } + public stop() {} +} diff --git a/src/plugins/vis_types/vega/server/types.ts b/src/plugins/vis_types/vega/server/types.ts new file mode 100644 index 0000000000000..626d22b59181a --- /dev/null +++ b/src/plugins/vis_types/vega/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 and the Server Side Public License, v 1; you may not 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 { SharedGlobalConfig } from 'kibana/server'; +import { HomeServerPluginSetup } from '../../../home/server'; +import { UsageCollectionSetup } from '../../../usage_collection/server'; + +export type ConfigObservable = Observable; + +export interface VegaSavedObjectAttributes { + title: string; + type: string; + params: { + spec: string; + }; +} + +export interface VisTypeVegaPluginSetupDependencies { + usageCollection?: UsageCollectionSetup; + home?: HomeServerPluginSetup; +} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface VisTypeVegaPluginSetup {} +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface VisTypeVegaPluginStart {} diff --git a/src/plugins/vis_type_vega/server/usage_collector/get_usage_collector.mock.ts b/src/plugins/vis_types/vega/server/usage_collector/get_usage_collector.mock.ts similarity index 100% rename from src/plugins/vis_type_vega/server/usage_collector/get_usage_collector.mock.ts rename to src/plugins/vis_types/vega/server/usage_collector/get_usage_collector.mock.ts diff --git a/src/plugins/vis_type_vega/server/usage_collector/get_usage_collector.test.ts b/src/plugins/vis_types/vega/server/usage_collector/get_usage_collector.test.ts similarity index 94% rename from src/plugins/vis_type_vega/server/usage_collector/get_usage_collector.test.ts rename to src/plugins/vis_types/vega/server/usage_collector/get_usage_collector.test.ts index 82aba087dedc1..aa1b8e447bbca 100644 --- a/src/plugins/vis_type_vega/server/usage_collector/get_usage_collector.test.ts +++ b/src/plugins/vis_types/vega/server/usage_collector/get_usage_collector.test.ts @@ -7,9 +7,9 @@ */ import { getStats } from './get_usage_collector'; -import { createCollectorFetchContextMock } from '../../../usage_collection/server/mocks'; -import type { HomeServerPluginSetup } from '../../../home/server'; -import type { SavedObjectsClientContract } from '../../../../core/server'; +import { createCollectorFetchContextMock } from '../../../../usage_collection/server/mocks'; +import type { HomeServerPluginSetup } from '../../../../home/server'; +import type { SavedObjectsClientContract } from '../../../../../core/server'; const mockedSavedObjects = [ // vega-lite lib spec diff --git a/src/plugins/vis_type_vega/server/usage_collector/get_usage_collector.ts b/src/plugins/vis_types/vega/server/usage_collector/get_usage_collector.ts similarity index 93% rename from src/plugins/vis_type_vega/server/usage_collector/get_usage_collector.ts rename to src/plugins/vis_types/vega/server/usage_collector/get_usage_collector.ts index ae99021745a0c..0e67af1c2e890 100644 --- a/src/plugins/vis_type_vega/server/usage_collector/get_usage_collector.ts +++ b/src/plugins/vis_types/vega/server/usage_collector/get_usage_collector.ts @@ -8,8 +8,11 @@ import { parse } from 'hjson'; -import type { SavedObjectsClientContract, SavedObjectsFindResult } from '../../../../core/server'; -import type { SavedVisState } from '../../../visualizations/common'; +import type { + SavedObjectsClientContract, + SavedObjectsFindResult, +} from '../../../../../core/server'; +import type { SavedVisState } from '../../../../visualizations/common'; import type { VegaSavedObjectAttributes, VisTypeVegaPluginSetupDependencies } from '../types'; type UsageCollectorDependencies = Pick; @@ -75,7 +78,7 @@ export const getStats = async ( const doTelemetry = ({ params }: SavedVisState) => { try { - const spec = parse(params.spec, { legacyRoot: false }); + const spec = parse(params.spec as string, { legacyRoot: false }); if (spec) { shouldPublishTelemetry = true; diff --git a/src/plugins/vis_type_vega/server/usage_collector/index.ts b/src/plugins/vis_types/vega/server/usage_collector/index.ts similarity index 100% rename from src/plugins/vis_type_vega/server/usage_collector/index.ts rename to src/plugins/vis_types/vega/server/usage_collector/index.ts diff --git a/src/plugins/vis_type_vega/server/usage_collector/register_vega_collector.test.ts b/src/plugins/vis_types/vega/server/usage_collector/register_vega_collector.test.ts similarity index 95% rename from src/plugins/vis_type_vega/server/usage_collector/register_vega_collector.test.ts rename to src/plugins/vis_types/vega/server/usage_collector/register_vega_collector.test.ts index fc488540293ad..137dd2f17375c 100644 --- a/src/plugins/vis_type_vega/server/usage_collector/register_vega_collector.test.ts +++ b/src/plugins/vis_types/vega/server/usage_collector/register_vega_collector.test.ts @@ -9,11 +9,11 @@ import { createUsageCollectionSetupMock, createCollectorFetchContextMock, -} from '../../../usage_collection/server/mocks'; +} from '../../../../usage_collection/server/mocks'; import { mockStats, mockGetStats } from './get_usage_collector.mock'; import { registerVegaUsageCollector } from './register_vega_collector'; -import type { HomeServerPluginSetup } from '../../../home/server'; +import type { HomeServerPluginSetup } from '../../../../home/server'; import type { ConfigObservable } from '../types'; describe('registerVegaUsageCollector', () => { diff --git a/src/plugins/vis_type_vega/server/usage_collector/register_vega_collector.ts b/src/plugins/vis_types/vega/server/usage_collector/register_vega_collector.ts similarity index 93% rename from src/plugins/vis_type_vega/server/usage_collector/register_vega_collector.ts rename to src/plugins/vis_types/vega/server/usage_collector/register_vega_collector.ts index ef65b58a8315b..27af5aa57e38b 100644 --- a/src/plugins/vis_type_vega/server/usage_collector/register_vega_collector.ts +++ b/src/plugins/vis_types/vega/server/usage_collector/register_vega_collector.ts @@ -7,7 +7,7 @@ */ import { getStats, VegaUsage } from './get_usage_collector'; -import type { UsageCollectionSetup } from '../../../usage_collection/server'; +import type { UsageCollectionSetup } from '../../../../usage_collection/server'; import type { ConfigObservable, VisTypeVegaPluginSetupDependencies } from '../types'; export function registerVegaUsageCollector( diff --git a/src/plugins/vis_types/vega/tsconfig.json b/src/plugins/vis_types/vega/tsconfig.json new file mode 100644 index 0000000000000..ed7690ac70d1a --- /dev/null +++ b/src/plugins/vis_types/vega/tsconfig.json @@ -0,0 +1,31 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true, + "strictNullChecks": false + }, + "include": [ + "server/**/*", + "public/**/*", + "*.ts", + // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 + "public/test_utils/vega_map_test.json" + ], + "references": [ + { "path": "../../../core/tsconfig.json" }, + { "path": "../../data/tsconfig.json" }, + { "path": "../../visualizations/tsconfig.json" }, + { "path": "../../maps_ems/tsconfig.json" }, + { "path": "../../expressions/tsconfig.json" }, + { "path": "../../inspector/tsconfig.json" }, + { "path": "../../home/tsconfig.json" }, + { "path": "../../usage_collection/tsconfig.json" }, + { "path": "../../kibana_utils/tsconfig.json" }, + { "path": "../../kibana_react/tsconfig.json" }, + { "path": "../../vis_default_editor/tsconfig.json" }, + { "path": "../../es_ui_shared/tsconfig.json" }, + ] +} diff --git a/src/plugins/vis_types/vislib/common/index.ts b/src/plugins/vis_types/vislib/common/index.ts index ad560e0a3023c..6daae0548c038 100644 --- a/src/plugins/vis_types/vislib/common/index.ts +++ b/src/plugins/vis_types/vislib/common/index.ts @@ -6,5 +6,4 @@ * Side Public License, v 1. */ -export const DIMMING_OPACITY_SETTING = 'visualization:dimmingOpacity'; export const HEATMAP_MAX_BUCKETS_SETTING = 'visualization:heatmap:maxBuckets'; diff --git a/src/plugins/vis_types/vislib/jest.config.js b/src/plugins/vis_types/vislib/jest.config.js index 6b6d7c3361ecf..cc80a320765d8 100644 --- a/src/plugins/vis_types/vislib/jest.config.js +++ b/src/plugins/vis_types/vislib/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../../..', roots: ['/src/plugins/vis_types/vislib'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_types/vislib', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/vis_types/vislib/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/src/plugins/vis_types/vislib/public/area.ts b/src/plugins/vis_types/vislib/public/area.ts deleted file mode 100644 index f4ac79e12bbe2..0000000000000 --- a/src/plugins/vis_types/vislib/public/area.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. - */ - -import { xyVisTypes } from '../../xy/public'; -import { VisTypeDefinition } from '../../../visualizations/public'; - -import { toExpressionAst } from './to_ast'; -import { BasicVislibParams } from './types'; - -export const areaVisTypeDefinition = { - ...xyVisTypes.area(), - toExpressionAst, -} as VisTypeDefinition; diff --git a/src/plugins/vis_types/vislib/public/fixtures/dispatch_bar_chart_config_normal.json b/src/plugins/vis_types/vislib/public/fixtures/dispatch_bar_chart_config_normal.json deleted file mode 100644 index a72cebcfdf2c8..0000000000000 --- a/src/plugins/vis_types/vislib/public/fixtures/dispatch_bar_chart_config_normal.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "seriesParams": [ - { - "data": { - "id": "1", - "label": "Count" - }, - "drawLinesBetweenPoints": true, - "interpolate": "cardinal", - "mode": "stacked", - "show": "true", - "showCircles": true, - "type": "histogram", - "valueAxis": "ValueAxis-1" - } - ], - "valueAxes": [ - { - "id": "ValueAxis-1", - "name": "LeftAxis-1", - "position": "left", - "scale": { - "type": "linear", - "mode": "normal" - }, - "show": true, - "style": {}, - "type": "value" - } - ] -} \ No newline at end of file diff --git a/src/plugins/vis_types/vislib/public/fixtures/dispatch_bar_chart_config_percentage.json b/src/plugins/vis_types/vislib/public/fixtures/dispatch_bar_chart_config_percentage.json deleted file mode 100644 index 1fb4bc89bf4e9..0000000000000 --- a/src/plugins/vis_types/vislib/public/fixtures/dispatch_bar_chart_config_percentage.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "seriesParams": [ - { - "data": { - "id": "1", - "label": "Count" - }, - "drawLinesBetweenPoints": true, - "interpolate": "cardinal", - "mode": "stacked", - "show": "true", - "showCircles": true, - "type": "histogram", - "valueAxis": "ValueAxis-1" - } - ], - "valueAxes": [ - { - "id": "ValueAxis-1", - "labels": { - "show": true, - "rotate": 0, - "filter": false, - "truncate": 100 - }, - "name": "LeftAxis-1", - "position": "left", - "scale": { - "type": "linear", - "mode": "percentage" - }, - "show": true, - "style": {}, - "title": { - "text": "Count" - }, - "type": "value" - } - ] -} \ No newline at end of file diff --git a/src/plugins/vis_types/vislib/public/fixtures/dispatch_bar_chart_d3.json b/src/plugins/vis_types/vislib/public/fixtures/dispatch_bar_chart_d3.json deleted file mode 100644 index f614ab64d7b34..0000000000000 --- a/src/plugins/vis_types/vislib/public/fixtures/dispatch_bar_chart_d3.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "series": [ - { - "id": "1", - "rawId": "Late Aircraft Delay-col-2-1", - "label": "Late Aircraft Delay" - }, - { - "id": "1", - "rawId": "No Delay-col-2-1", - "label": "No Delay" - }, - { - "id": "1", - "rawId": "NAS Delay-col-2-1", - "label": "NAS Delay" - } - ] -} \ No newline at end of file diff --git a/src/plugins/vis_types/vislib/public/fixtures/dispatch_bar_chart_data_point.json b/src/plugins/vis_types/vislib/public/fixtures/dispatch_bar_chart_data_point.json deleted file mode 100644 index 19bb7b30d6e6a..0000000000000 --- a/src/plugins/vis_types/vislib/public/fixtures/dispatch_bar_chart_data_point.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "parent": { - "accessor": "col-1-3", - "column": 1, - "params": {} - }, - "series": "No Delay", - "seriesId": "No Delay-col-2-1" -} \ No newline at end of file diff --git a/src/plugins/vis_types/vislib/public/histogram.ts b/src/plugins/vis_types/vislib/public/histogram.ts deleted file mode 100644 index bb4f570c6a2d8..0000000000000 --- a/src/plugins/vis_types/vislib/public/histogram.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. - */ - -import { xyVisTypes } from '../../xy/public'; -import { VisTypeDefinition } from '../../../visualizations/public'; - -import { toExpressionAst } from './to_ast'; -import { BasicVislibParams } from './types'; - -export const histogramVisTypeDefinition = { - ...xyVisTypes.histogram(), - toExpressionAst, -} as VisTypeDefinition; diff --git a/src/plugins/vis_types/vislib/public/horizontal_bar.ts b/src/plugins/vis_types/vislib/public/horizontal_bar.ts deleted file mode 100644 index 37aa79a0b1aee..0000000000000 --- a/src/plugins/vis_types/vislib/public/horizontal_bar.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. - */ - -import { xyVisTypes } from '../../xy/public'; -import { VisTypeDefinition } from '../../../visualizations/public'; - -import { toExpressionAst } from './to_ast'; -import { BasicVislibParams } from './types'; - -export const horizontalBarVisTypeDefinition = { - ...xyVisTypes.horizontalBar(), - toExpressionAst, -} as VisTypeDefinition; diff --git a/src/plugins/vis_types/vislib/public/line.ts b/src/plugins/vis_types/vislib/public/line.ts deleted file mode 100644 index 0f33c393e0643..0000000000000 --- a/src/plugins/vis_types/vislib/public/line.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. - */ - -import { xyVisTypes } from '../../xy/public'; -import { VisTypeDefinition } from '../../../visualizations/public'; - -import { toExpressionAst } from './to_ast'; -import { BasicVislibParams } from './types'; - -export const lineVisTypeDefinition = { - ...xyVisTypes.line(), - toExpressionAst, -} as VisTypeDefinition; diff --git a/src/plugins/vis_types/vislib/public/plugin.ts b/src/plugins/vis_types/vislib/public/plugin.ts index 24ba7741cab91..b0385475f7105 100644 --- a/src/plugins/vis_types/vislib/public/plugin.ts +++ b/src/plugins/vis_types/vislib/public/plugin.ts @@ -13,16 +13,11 @@ import { VisualizationsSetup } from '../../../visualizations/public'; import { ChartsPluginSetup } from '../../../charts/public'; import { DataPublicPluginStart } from '../../../data/public'; import { KibanaLegacyStart } from '../../../kibana_legacy/public'; -import { LEGACY_CHARTS_LIBRARY } from '../../xy/common/index'; import { LEGACY_PIE_CHARTS_LIBRARY } from '../../pie/common/index'; import { createVisTypeVislibVisFn } from './vis_type_vislib_vis_fn'; import { createPieVisFn } from './pie_fn'; -import { - convertedTypeDefinitions, - pieVisTypeDefinition, - visLibVisTypeDefinitions, -} from './vis_type_vislib_vis_types'; +import { visLibVisTypeDefinitions, pieVisTypeDefinition } from './vis_type_vislib_vis_types'; import { setFormatService, setDataActions } from './services'; import { getVislibVisRenderer } from './vis_renderer'; @@ -51,11 +46,8 @@ export class VisTypeVislibPlugin core: VisTypeVislibCoreSetup, { expressions, visualizations, charts }: VisTypeVislibPluginSetupDependencies ) { - const typeDefinitions = !core.uiSettings.get(LEGACY_CHARTS_LIBRARY, false) - ? convertedTypeDefinitions - : visLibVisTypeDefinitions; // register vislib XY axis charts - typeDefinitions.forEach(visualizations.createBaseVisualization); + visLibVisTypeDefinitions.forEach(visualizations.createBaseVisualization); expressions.registerRenderer(getVislibVisRenderer(core, charts)); expressions.registerFunction(createVisTypeVislibVisFn()); diff --git a/src/plugins/vis_types/vislib/public/types.ts b/src/plugins/vis_types/vislib/public/types.ts index 5196f0e33f404..9184e2a4c884c 100644 --- a/src/plugins/vis_types/vislib/public/types.ts +++ b/src/plugins/vis_types/vislib/public/types.ts @@ -37,12 +37,7 @@ export const GaugeType = Object.freeze({ export type GaugeType = $Values; export const VislibChartType = Object.freeze({ - Histogram: 'histogram' as const, - HorizontalBar: 'horizontal_bar' as const, - Line: 'line' as const, Pie: 'pie' as const, - Area: 'area' as const, - PointSeries: 'point_series' as const, Heatmap: 'heatmap' as const, Gauge: 'gauge' as const, Goal: 'goal' as const, diff --git a/src/plugins/vis_types/vislib/public/vis_type_vislib_vis_types.ts b/src/plugins/vis_types/vislib/public/vis_type_vislib_vis_types.ts index 325c9256d7184..6ecb63ca31b37 100644 --- a/src/plugins/vis_types/vislib/public/vis_type_vislib_vis_types.ts +++ b/src/plugins/vis_types/vislib/public/vis_type_vislib_vis_types.ts @@ -7,27 +7,13 @@ */ import { VisTypeDefinition } from 'src/plugins/visualizations/public'; -import { histogramVisTypeDefinition } from './histogram'; -import { lineVisTypeDefinition } from './line'; -import { areaVisTypeDefinition } from './area'; import { heatmapVisTypeDefinition } from './heatmap'; -import { horizontalBarVisTypeDefinition } from './horizontal_bar'; import { gaugeVisTypeDefinition } from './gauge'; import { goalVisTypeDefinition } from './goal'; export { pieVisTypeDefinition } from './pie'; export const visLibVisTypeDefinitions: Array> = [ - histogramVisTypeDefinition, - lineVisTypeDefinition, - areaVisTypeDefinition, - heatmapVisTypeDefinition, - horizontalBarVisTypeDefinition, - gaugeVisTypeDefinition, - goalVisTypeDefinition, -]; - -export const convertedTypeDefinitions: Array> = [ heatmapVisTypeDefinition, gaugeVisTypeDefinition, goalVisTypeDefinition, diff --git a/src/plugins/vis_types/vislib/public/vislib/VISLIB.md b/src/plugins/vis_types/vislib/public/vislib/VISLIB.md index 05ca9a51b19eb..1f17228dda7ab 100644 --- a/src/plugins/vis_types/vislib/public/vislib/VISLIB.md +++ b/src/plugins/vis_types/vislib/public/vislib/VISLIB.md @@ -1,4 +1,8 @@ -# Vislib general overview +# Charts supported + +Vislib supports the heatmap and gauge/goal charts from the aggregation-based visualizations. It also contains the legacy implemementation of the pie chart (enabled by the visualization:visualize:legacyPieChartsLibrary advanced setting). + +# General overview `vis.js` constructor accepts vis parameters and render method accepts data. it exposes event emitter interface so we can listen to certain events like 'renderComplete'. @@ -18,7 +22,4 @@ All base visualizations extend from `visualizations/_chart` ### Point series chart -`visualizations/point_series` takes care of drawing the point series chart (no axes or titles, just the chart itself). It creates all the series defined and calls render method on them. - -currently there are 3 series types available (line, area, bars), they all extend from `visualizations/point_series/_point_series`. - +`visualizations/point_series` takes care of drawing the point series chart (no axes or titles, just the chart itself). It creates all the series defined and calls render method on them. \ No newline at end of file diff --git a/src/plugins/vis_types/vislib/public/vislib/_index.scss b/src/plugins/vis_types/vislib/public/vislib/_index.scss index 78e16224a67a3..00b22df06f10d 100644 --- a/src/plugins/vis_types/vislib/public/vislib/_index.scss +++ b/src/plugins/vis_types/vislib/public/vislib/_index.scss @@ -5,5 +5,4 @@ @import './components/tooltip/index'; @import './components/legend/index'; -@import './visualizations/point_series/index'; @import './visualizations/gauges/index'; diff --git a/src/plugins/vis_types/vislib/public/vislib/components/legend/legend.tsx b/src/plugins/vis_types/vislib/public/vislib/components/legend/legend.tsx index 4701d07ab83e6..cc557ff274fa1 100644 --- a/src/plugins/vis_types/vislib/public/vislib/components/legend/legend.tsx +++ b/src/plugins/vis_types/vislib/public/vislib/components/legend/legend.tsx @@ -11,6 +11,7 @@ import classNames from 'classnames'; import { compact, uniqBy, map, every, isUndefined } from 'lodash'; import { i18n } from '@kbn/i18n'; +import { asyncForEach } from '@kbn/std'; import { EuiPopoverProps, EuiIcon, keys, htmlIdGenerator } from '@elastic/eui'; import { PersistedState } from '../../../../../../visualizations/public'; @@ -127,13 +128,14 @@ export class VisLegend extends PureComponent { new Promise(async (resolve, reject) => { try { const filterableLabels = new Set(); - items.forEach(async (item) => { + await asyncForEach(items, async (item) => { const canFilter = await this.canFilter(item); if (canFilter) { filterableLabels.add(item.label); } }); + this.setState( { filterableLabels, diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/axis/axis.test.js b/src/plugins/vis_types/vislib/public/vislib/lib/axis/axis.test.js index f8dcf8edc6bee..ef4f08cac35f6 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/axis/axis.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/axis/axis.test.js @@ -96,7 +96,7 @@ describe('Vislib Axis Class Test Suite', function () { const visConfig = new VisConfig( { - type: 'histogram', + type: 'heatmap', }, data, mockUiState, diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/axis/axis_title.test.js b/src/plugins/vis_types/vislib/public/vislib/lib/axis/axis_title.test.js index 90e5a4ee6defb..b5a158e173b0d 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/axis/axis_title.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/axis/axis_title.test.js @@ -103,7 +103,7 @@ describe('Vislib AxisTitle Class Test Suite', function () { dataObj = new Data(data, getMockUiState(), () => undefined); visConfig = new VisConfig( { - type: 'histogram', + type: 'heatmap', }, data, getMockUiState(), diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/axis/x_axis.test.js b/src/plugins/vis_types/vislib/public/vislib/lib/axis/x_axis.test.js index 5b2ff31727074..1ded9e48fcfd3 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/axis/x_axis.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/axis/x_axis.test.js @@ -101,7 +101,7 @@ describe('Vislib xAxis Class Test Suite', function () { const visConfig = new VisConfig( { - type: 'histogram', + type: 'heatmap', }, data, mockUiState, diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/axis/y_axis.test.js b/src/plugins/vis_types/vislib/public/vislib/lib/axis/y_axis.test.js index c69a029fca18c..5bbfde01197e5 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/axis/y_axis.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/axis/y_axis.test.js @@ -81,7 +81,7 @@ function createData(seriesData) { buildYAxis = function (params) { const visConfig = new VisConfig( { - type: 'histogram', + type: 'heatmap', }, data, mockUiState, diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/chart_title.test.js b/src/plugins/vis_types/vislib/public/vislib/lib/chart_title.test.js index 291b2da81b8ce..54b326a292845 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/chart_title.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/chart_title.test.js @@ -99,7 +99,7 @@ describe('Vislib ChartTitle Class Test Suite', function () { const visConfig = new VisConfig( { - type: 'histogram', + type: 'heatmap', title: { text: 'rows', }, diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/dispatch.js b/src/plugins/vis_types/vislib/public/vislib/lib/dispatch.js index 30fd0f1fcbbd2..e93ed922b3fd1 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/dispatch.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/dispatch.js @@ -9,7 +9,6 @@ import d3 from 'd3'; import { get, pull, rest, size, reduce } from 'lodash'; import $ from 'jquery'; -import { DIMMING_OPACITY_SETTING } from '../../../common'; /** * Handles event responses @@ -280,7 +279,7 @@ export class Dispatch { const addEvent = this.addEvent; const $el = this.handler.el; if (!this.handler.highlight) { - this.handler.highlight = self.getHighlighter(self.uiSettings); + this.handler.highlight = self.getHighlighter(); } function hover(d, i) { @@ -375,20 +374,18 @@ export class Dispatch { /** * return function to Highlight the element that is under the cursor * by reducing the opacity of all the elements on the graph. - * @param uiSettings * @method getHighlighter */ - getHighlighter(uiSettings) { + getHighlighter() { return function highlight(element) { const label = this.getAttribute('data-label'); if (!label) return; - const dimming = uiSettings.get(DIMMING_OPACITY_SETTING); $(element) .parent() .find('[data-label]') .css('opacity', 1) //Opacity 1 is needed to avoid the css application .not((els, el) => String($(el).data('label')) === label) - .css('opacity', justifyOpacity(dimming)); + .css('opacity', 0.5); }; } @@ -470,9 +467,3 @@ export class Dispatch { function validBrushClick(event) { return event.button === 0; } - -function justifyOpacity(opacity) { - const decimalNumber = parseFloat(opacity, 10); - const fallbackOpacity = 0.5; - return 0 <= decimalNumber && decimalNumber <= 1 ? decimalNumber : fallbackOpacity; -} diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/dispatch.test.js b/src/plugins/vis_types/vislib/public/vislib/lib/dispatch.test.js index dfc36a364e7ad..21a3dc069d8c6 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/dispatch.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/dispatch.test.js @@ -8,6 +8,7 @@ import _ from 'lodash'; import d3 from 'd3'; +import $ from 'jquery'; import { setHTMLElementClientSizes, setSVGElementGetBBox, @@ -23,6 +24,7 @@ import { getVis } from '../visualizations/_vis_fixture'; let mockedHTMLElementClientSizes; let mockedSVGElementGetBBox; let mockedSVGElementGetComputedTextLength; +let mockWidth; describe('Vislib Dispatch Class Test Suite', function () { function destroyVis(vis) { @@ -37,22 +39,43 @@ describe('Vislib Dispatch Class Test Suite', function () { mockedHTMLElementClientSizes = setHTMLElementClientSizes(512, 512); mockedSVGElementGetBBox = setSVGElementGetBBox(100); mockedSVGElementGetComputedTextLength = setSVGElementGetComputedTextLength(100); + mockWidth = jest.spyOn($.prototype, 'width').mockReturnValue(900); }); afterAll(() => { mockedHTMLElementClientSizes.mockRestore(); mockedSVGElementGetBBox.mockRestore(); mockedSVGElementGetComputedTextLength.mockRestore(); + mockWidth.mockRestore(); }); describe('', function () { let vis; let mockUiState; - beforeEach(() => { - vis = getVis(); + const vislibParams = { + type: 'heatmap', + addLegend: true, + addTooltip: true, + colorsNumber: 4, + colorSchema: 'Greens', + setColorRange: false, + percentageMode: true, + percentageFormatPattern: '0.0%', + invertColors: false, + colorsRange: [], + }; + + function generateVis(opts = {}) { + const config = _.defaultsDeep({}, opts, vislibParams); + vis = getVis(config); mockUiState = getMockUiState(); + vis.on('brush', _.noop); vis.render(data, mockUiState); + } + + beforeEach(() => { + generateVis(); }); afterEach(function () { @@ -74,11 +97,29 @@ describe('Vislib Dispatch Class Test Suite', function () { let vis; let mockUiState; - beforeEach(() => { + const vislibParams = { + type: 'heatmap', + addLegend: true, + addTooltip: true, + colorsNumber: 4, + colorSchema: 'Greens', + setColorRange: false, + percentageMode: true, + percentageFormatPattern: '0.0%', + invertColors: false, + colorsRange: [], + }; + + function generateVis(opts = {}) { + const config = _.defaultsDeep({}, opts, vislibParams); + vis = getVis(config); mockUiState = getMockUiState(); - vis = getVis(); vis.on('brush', _.noop); vis.render(data, mockUiState); + } + + beforeEach(() => { + generateVis(); }); afterEach(function () { @@ -183,9 +224,22 @@ describe('Vislib Dispatch Class Test Suite', function () { }); describe('Custom event handlers', function () { + const vislibParams = { + type: 'heatmap', + addLegend: true, + addTooltip: true, + colorsNumber: 4, + colorSchema: 'Greens', + setColorRange: false, + percentageMode: true, + percentageFormatPattern: '0.0%', + invertColors: false, + colorsRange: [], + }; + const config = _.defaultsDeep({}, vislibParams); + const vis = getVis(config); + const mockUiState = getMockUiState(); test('should attach whatever gets passed on vis.on() to chart.events', function (done) { - const vis = getVis(); - const mockUiState = getMockUiState(); vis.on('someEvent', _.noop); vis.render(data, mockUiState); @@ -198,8 +252,6 @@ describe('Vislib Dispatch Class Test Suite', function () { }); test('can be added after rendering', function () { - const vis = getVis(); - const mockUiState = getMockUiState(); vis.render(data, mockUiState); vis.on('someEvent', _.noop); diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/dispatch_vertical_bar_chart.test.js b/src/plugins/vis_types/vislib/public/vislib/lib/dispatch_vertical_bar_chart.test.js deleted file mode 100644 index 0374f082f1676..0000000000000 --- a/src/plugins/vis_types/vislib/public/vislib/lib/dispatch_vertical_bar_chart.test.js +++ /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 mockDispatchDataD3 from '../../fixtures/dispatch_bar_chart_d3.json'; -import { Dispatch } from './dispatch'; -import mockdataPoint from '../../fixtures/dispatch_bar_chart_data_point.json'; -import mockConfigPercentage from '../../fixtures/dispatch_bar_chart_config_percentage.json'; -import mockConfigNormal from '../../fixtures/dispatch_bar_chart_config_normal.json'; - -jest.mock('d3', () => ({ - event: { - target: { - nearestViewportElement: { - __data__: mockDispatchDataD3, - }, - }, - }, -})); - -function getHandlerMock(config = {}, data = {}) { - return { - visConfig: { get: (id, fallback) => config[id] || fallback }, - data, - }; -} - -describe('Vislib event responses dispatcher', () => { - test('return data for a vertical bars popover in percentage mode', () => { - const dataPoint = mockdataPoint; - const handlerMock = getHandlerMock(mockConfigPercentage); - const dispatch = new Dispatch(handlerMock); - const actual = dispatch.eventResponse(dataPoint, 0); - expect(actual.isPercentageMode).toBeTruthy(); - }); - - test('return data for a vertical bars popover in normal mode', () => { - const dataPoint = mockdataPoint; - const handlerMock = getHandlerMock(mockConfigNormal); - const dispatch = new Dispatch(handlerMock); - const actual = dispatch.eventResponse(dataPoint, 0); - expect(actual.isPercentageMode).toBeFalsy(); - }); -}); diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/handler.test.js b/src/plugins/vis_types/vislib/public/vislib/lib/handler.test.js index 326a29f3690bc..60ffaf3f3d19c 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/handler.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/handler.test.js @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import _ from 'lodash'; import $ from 'jquery'; import { setHTMLElementClientSizes, @@ -26,6 +26,7 @@ const names = ['series', 'columns', 'rows', 'stackedSeries']; let mockedHTMLElementClientSizes; let mockedSVGElementGetBBox; let mockedSVGElementGetComputedTextLength; +let mockWidth; dateHistogramArray.forEach(function (data, i) { describe('Vislib Handler Test Suite for ' + names[i] + ' Data', function () { @@ -36,10 +37,24 @@ dateHistogramArray.forEach(function (data, i) { mockedHTMLElementClientSizes = setHTMLElementClientSizes(512, 512); mockedSVGElementGetBBox = setSVGElementGetBBox(100); mockedSVGElementGetComputedTextLength = setSVGElementGetComputedTextLength(100); + mockWidth = jest.spyOn($.prototype, 'width').mockReturnValue(900); }); beforeEach(() => { - vis = getVis(); + const vislibParams = { + type: 'heatmap', + addLegend: true, + addTooltip: true, + colorsNumber: 4, + colorSchema: 'Greens', + setColorRange: false, + percentageMode: true, + percentageFormatPattern: '0.0%', + invertColors: false, + colorsRange: [], + }; + const config = _.defaultsDeep({}, vislibParams); + vis = getVis(config); vis.render(data, getMockUiState()); }); @@ -51,6 +66,7 @@ dateHistogramArray.forEach(function (data, i) { mockedHTMLElementClientSizes.mockRestore(); mockedSVGElementGetBBox.mockRestore(); mockedSVGElementGetComputedTextLength.mockRestore(); + mockWidth.mockRestore(); }); describe('render Method', function () { diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/layout/_layout.scss b/src/plugins/vis_types/vislib/public/vislib/lib/layout/_layout.scss index a6896a9181b4e..7ead0b314c7ad 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/layout/_layout.scss +++ b/src/plugins/vis_types/vislib/public/vislib/lib/layout/_layout.scss @@ -187,10 +187,6 @@ fill: $visHoverBackgroundColor; } - .visAreaChart__overlapArea { - opacity: .8; - } - .series > path, .series > rect { stroke-opacity: 1; diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/layout/layout.test.js b/src/plugins/vis_types/vislib/public/vislib/lib/layout/layout.test.js index f4ea2d3898d25..af59f011515d0 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/layout/layout.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/layout/layout.test.js @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import _ from 'lodash'; import d3 from 'd3'; import $ from 'jquery'; import { @@ -30,6 +30,7 @@ const names = ['series', 'columns', 'rows', 'stackedSeries']; let mockedHTMLElementClientSizes; let mockedSVGElementGetBBox; let mockedSVGElementGetComputedTextLength; +let mockWidth; dateHistogramArray.forEach(function (data, i) { describe('Vislib Layout Class Test Suite for ' + names[i] + ' Data', function () { @@ -42,10 +43,24 @@ dateHistogramArray.forEach(function (data, i) { mockedHTMLElementClientSizes = setHTMLElementClientSizes(512, 512); mockedSVGElementGetBBox = setSVGElementGetBBox(100); mockedSVGElementGetComputedTextLength = setSVGElementGetComputedTextLength(100); + mockWidth = jest.spyOn($.prototype, 'width').mockReturnValue(900); }); beforeEach(() => { - vis = getVis(); + const vislibParams = { + type: 'heatmap', + addLegend: true, + addTooltip: true, + colorsNumber: 4, + colorSchema: 'Greens', + setColorRange: false, + percentageMode: true, + percentageFormatPattern: '0.0%', + invertColors: false, + colorsRange: [], + }; + const config = _.defaultsDeep({}, vislibParams); + vis = getVis(config); mockUiState = getMockUiState(); vis.render(data, mockUiState); numberOfCharts = vis.handler.charts.length; @@ -59,6 +74,7 @@ dateHistogramArray.forEach(function (data, i) { mockedHTMLElementClientSizes.mockRestore(); mockedSVGElementGetBBox.mockRestore(); mockedSVGElementGetComputedTextLength.mockRestore(); + mockWidth.mockRestore(); }); describe('createLayout Method', function () { @@ -81,7 +97,7 @@ dateHistogramArray.forEach(function (data, i) { beforeEach(function () { const visConfig = new VisConfig( { - type: 'histogram', + type: 'heatmap', }, data, mockUiState, @@ -125,7 +141,7 @@ dateHistogramArray.forEach(function (data, i) { expect(function () { testLayout.layout({ - parent: 'histogram', + parent: 'heatmap', type: 'div', }); }).toThrowError(); diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/types/index.js b/src/plugins/vis_types/vislib/public/vislib/lib/types/index.js index dcfff3618ab91..4a9dd0bd512ca 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/types/index.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/types/index.js @@ -11,12 +11,7 @@ import { vislibPieConfig } from './pie'; import { vislibGaugeConfig } from './gauge'; export const vislibTypesConfig = { - histogram: pointSeries.column, - horizontal_bar: pointSeries.column, - line: pointSeries.line, pie: vislibPieConfig, - area: pointSeries.area, - point_series: pointSeries.line, heatmap: pointSeries.heatmap, gauge: vislibGaugeConfig, goal: vislibGaugeConfig, diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/types/point_series.js b/src/plugins/vis_types/vislib/public/vislib/lib/types/point_series.js index 9753cbb78ea5c..2328a09205dd6 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/types/point_series.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/types/point_series.js @@ -193,41 +193,6 @@ function create(opts) { } export const vislibPointSeriesTypes = { - line: create(), - - column: create({ - expandLastBucket: true, - }), - - area: create({ - alerts: [ - { - type: 'warning', - msg: - 'Positive and negative values are not accurately represented by stacked ' + - 'area charts. Either changing the chart mode to "overlap" or using a ' + - 'bar chart is recommended.', - test: function (_, data) { - if (!data.shouldBeStacked() || data.maxNumberOfSeries() < 2) return; - - const hasPos = data.getYMax(data._getY) > 0; - const hasNeg = data.getYMin(data._getY) < 0; - return hasPos && hasNeg; - }, - }, - { - type: 'warning', - msg: - 'Parts of or the entire area chart might not be displayed due to null ' + - 'values in the data. A line chart is recommended when displaying data ' + - 'with null values.', - test: function (_, data) { - return data.hasNullValues(); - }, - }, - ], - }), - heatmap: (cfg, data) => { const defaults = create()(cfg, data); const hasCharts = defaults.charts.length; diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/types/point_series.test.js b/src/plugins/vis_types/vislib/public/vislib/lib/types/point_series.test.js index aa2fe39c34ec3..c0764e6a39ed6 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/types/point_series.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/types/point_series.test.js @@ -8,10 +8,6 @@ import stackedSeries from '../../../fixtures/mock_data/date_histogram/_stacked_series'; import { vislibPointSeriesTypes } from './point_series'; -import percentileTestdata from './testdata_linechart_percentile.json'; -import percentileTestdataResult from './testdata_linechart_percentile_result.json'; -import percentileTestdataFloatValue from './testdata_linechart_percentile_float_value.json'; -import percentileTestdataFloatValueResult from './testdata_linechart_percentile_float_value_result.json'; const maxBucketData = { get: (prop) => { @@ -84,7 +80,7 @@ describe('vislibPointSeriesTypes', () => { describe('axis formatters', () => { it('should create a value axis config with the default y axis formatter', () => { - const parsedConfig = vislibPointSeriesTypes.line({}, maxBucketData); + const parsedConfig = vislibPointSeriesTypes.heatmap({}, maxBucketData); expect(parsedConfig.valueAxes.length).toEqual(1); expect(parsedConfig.valueAxes[0].labels.axisFormatter).toBe( maxBucketData.data.yAxisFormatter @@ -95,7 +91,7 @@ describe('vislibPointSeriesTypes', () => { const axisFormatter1 = jest.fn(); const axisFormatter2 = jest.fn(); const axisFormatter3 = jest.fn(); - const parsedConfig = vislibPointSeriesTypes.line( + const parsedConfig = vislibPointSeriesTypes.heatmap( { valueAxes: [ { @@ -166,67 +162,3 @@ describe('vislibPointSeriesTypes', () => { }); }); }); - -describe('Point Series Config Type Class Test Suite', function () { - let parsedConfig; - const histogramConfig = { - type: 'histogram', - addLegend: true, - tooltip: { - show: true, - }, - categoryAxes: [ - { - id: 'CategoryAxis-1', - type: 'category', - title: {}, - }, - ], - valueAxes: [ - { - id: 'ValueAxis-1', - type: 'value', - labels: {}, - title: {}, - }, - ], - }; - - describe('histogram chart', function () { - beforeEach(function () { - parsedConfig = vislibPointSeriesTypes.column(histogramConfig, maxBucketData); - }); - it('should not throw an error when more than 25 series are provided', function () { - expect(parsedConfig.error).toBeUndefined(); - }); - - it('should set axis title and formatter from data', () => { - expect(parsedConfig.categoryAxes[0].title.text).toEqual(maxBucketData.data.xAxisLabel); - expect(parsedConfig.valueAxes[0].labels.axisFormatter).toBeDefined(); - }); - }); - - describe('line chart', function () { - function prepareData({ cfg, data }) { - const percentileDataObj = { - get: (prop) => { - return maxBucketData[prop] || maxBucketData.data[prop] || null; - }, - getLabels: () => [], - data: data, - }; - const parsedConfig = vislibPointSeriesTypes.line(cfg, percentileDataObj); - return parsedConfig; - } - - it('should render a percentile line chart', function () { - const parsedConfig = prepareData(percentileTestdata); - expect(parsedConfig).toMatchObject(percentileTestdataResult); - }); - - it('should render a percentile line chart when value is float', function () { - const parsedConfig = prepareData(percentileTestdataFloatValue); - expect(parsedConfig).toMatchObject(percentileTestdataFloatValueResult); - }); - }); -}); diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/types/testdata_linechart_percentile.json b/src/plugins/vis_types/vislib/public/vislib/lib/types/testdata_linechart_percentile.json deleted file mode 100644 index 50d6eab03e3f7..0000000000000 --- a/src/plugins/vis_types/vislib/public/vislib/lib/types/testdata_linechart_percentile.json +++ /dev/null @@ -1,464 +0,0 @@ -{ - "cfg": { - "addLegend": true, - "addTimeMarker": false, - "addTooltip": true, - "categoryAxes": [ - { - "id": "CategoryAxis-1", - "labels": { - "show": true, - "truncate": 100 - }, - "position": "bottom", - "scale": { - "type": "linear" - }, - "show": true, - "style": {}, - "title": {}, - "type": "category" - } - ], - "dimensions": { - "x": { - "accessor": 0, - "format": { - "id": "date", - "params": { - "pattern": "YYYY-MM-DD" - } - }, - "params": { - "date": true, - "interval": 86400000, - "format": "YYYY-MM-DD", - "bounds": { - "min": "2019-05-10T04:00:00.000Z", - "max": "2019-05-12T10:18:57.342Z" - } - }, - "aggType": "date_histogram" - }, - "y": [ - { - "accessor": 1, - "format": { - "id": "number", - "params": { - "pattern": "$0,0.[00]" - } - }, - "params": {}, - "aggType": "percentiles" - }, - { - "accessor": 2, - "format": { - "id": "number", - "params": { - "pattern": "$0,0.[00]" - } - }, - "params": {}, - "aggType": "percentiles" - } - ] - }, - "grid": { - "categoryLines": false, - "style": { - "color": "#eee" - } - }, - "legendPosition": "right", - "seriesParams": [ - { - "data": { - "id": "1", - "label": "Percentiles of AvgTicketPrice" - }, - "drawLinesBetweenPoints": true, - "interpolate": "cardinal", - "mode": "normal", - "show": "true", - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - } - ], - "times": [], - "type": "area", - "valueAxes": [ - { - "id": "ValueAxis-1", - "labels": { - "filter": false, - "rotate": 0, - "show": true, - "truncate": 100 - }, - "name": "LeftAxis-1", - "position": "left", - "scale": { - "mode": "normal", - "type": "linear" - }, - "show": true, - "style": {}, - "title": { - "text": "Percentiles of AvgTicketPrice" - }, - "type": "value" - } - ] - }, - "data": { - "uiState": {}, - "data": { - "xAxisOrderedValues": [ - 1557460800000, - 1557547200000 - ], - "xAxisFormat": { - "id": "date", - "params": { - "pattern": "YYYY-MM-DD" - } - }, - "xAxisLabel": "timestamp per day", - "ordered": { - "interval": 86400000, - "date": true, - "min": 1557460800000, - "max": 1557656337342 - }, - "yAxisFormat": { - "id": "number", - "params": { - "pattern": "$0,0.[00]" - } - }, - "yAxisLabel": "", - "hits": 2 - }, - "series": [ - { - "id": "1.1", - "rawId": "col-1-1.1", - "label": "1st percentile of AvgTicketPrice", - "values": [ - { - "x": 1557460800000, - "y": 116.33676605224609, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 0, - "value": 1557460800000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 1, - "row": 0, - "value": 116.33676605224609 - }, - "parent": null, - "series": "1st percentile of AvgTicketPrice", - "seriesId": "col-1-1.1" - }, - { - "x": 1557547200000, - "y": 223, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 1, - "value": 1557547200000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 1, - "row": 1, - "value": 223 - }, - "parent": null, - "series": "1st percentile of AvgTicketPrice", - "seriesId": "col-1-1.1" - } - ] - }, - { - "id": "1.50", - "rawId": "col-2-1.50", - "label": "50th percentile of AvgTicketPrice", - "values": [ - { - "x": 1557460800000, - "y": 658.8453063964844, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 0, - "value": 1557460800000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 2, - "row": 0, - "value": 658 - }, - "parent": null, - "series": "50th percentile of AvgTicketPrice", - "seriesId": "col-2-1.50" - }, - { - "x": 1557547200000, - "y": 756, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 1, - "value": 1557547200000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 2, - "row": 1, - "value": 756.2283554077148 - }, - "parent": null, - "series": "50th percentile of AvgTicketPrice", - "seriesId": "col-2-1.50" - } - ] - } - ], - "type": "series", - "labels": [ - "1st percentile of AvgTicketPrice", - "50th percentile of AvgTicketPrice" - ] - } - -} diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value.json b/src/plugins/vis_types/vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value.json deleted file mode 100644 index 1987c59f6722b..0000000000000 --- a/src/plugins/vis_types/vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value.json +++ /dev/null @@ -1,463 +0,0 @@ -{ - "cfg": { - "addLegend": true, - "addTimeMarker": false, - "addTooltip": true, - "categoryAxes": [ - { - "id": "CategoryAxis-1", - "labels": { - "show": true, - "truncate": 100 - }, - "position": "bottom", - "scale": { - "type": "linear" - }, - "show": true, - "style": {}, - "title": {}, - "type": "category" - } - ], - "dimensions": { - "x": { - "accessor": 0, - "format": { - "id": "date", - "params": { - "pattern": "YYYY-MM-DD" - } - }, - "params": { - "date": true, - "interval": 86400000, - "format": "YYYY-MM-DD", - "bounds": { - "min": "2019-05-10T04:00:00.000Z", - "max": "2019-05-12T10:18:57.342Z" - } - }, - "aggType": "date_histogram" - }, - "y": [ - { - "accessor": 1, - "format": { - "id": "number", - "params": { - "pattern": "$0,0.[00]" - } - }, - "params": {}, - "aggType": "percentiles" - }, - { - "accessor": 2, - "format": { - "id": "number", - "params": { - "pattern": "$0,0.[00]" - } - }, - "params": {}, - "aggType": "percentiles" - } - ] - }, - "grid": { - "categoryLines": false, - "style": { - "color": "#eee" - } - }, - "legendPosition": "right", - "seriesParams": [ - { - "data": { - "id": "1", - "label": "Percentiles of AvgTicketPrice" - }, - "drawLinesBetweenPoints": true, - "interpolate": "cardinal", - "mode": "normal", - "show": "true", - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - } - ], - "times": [], - "type": "area", - "valueAxes": [ - { - "id": "ValueAxis-1", - "labels": { - "filter": false, - "rotate": 0, - "show": true, - "truncate": 100 - }, - "name": "LeftAxis-1", - "position": "left", - "scale": { - "mode": "normal", - "type": "linear" - }, - "show": true, - "style": {}, - "title": { - "text": "Percentiles of AvgTicketPrice" - }, - "type": "value" - } - ] - }, - "data": { - "uiState": {}, - "data": { - "xAxisOrderedValues": [ - 1557460800000, - 1557547200000 - ], - "xAxisFormat": { - "id": "date", - "params": { - "pattern": "YYYY-MM-DD" - } - }, - "xAxisLabel": "timestamp per day", - "ordered": { - "interval": 86400000, - "date": true, - "min": 1557460800000, - "max": 1557656337342 - }, - "yAxisFormat": { - "id": "number", - "params": { - "pattern": "$0,0.[00]" - } - }, - "yAxisLabel": "", - "hits": 2 - }, - "series": [ - { - "id": "1.['1.1']", - "rawId": "col-1-1.['1.1']", - "label": "1.1th percentile of AvgTicketPrice", - "values": [ - { - "x": 1557460800000, - "y": 116.33676605224609, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 0, - "value": 1557460800000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 1, - "row": 0, - "value": 116.33676605224609 - }, - "parent": null, - "series": "1.1th percentile of AvgTicketPrice", - "seriesId": "col-1-1.['1.1']" - }, - { - "x": 1557547200000, - "y": 223, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 1, - "value": 1557547200000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 1, - "row": 1, - "value": 223 - }, - "parent": null, - "series": "1.1th percentile of AvgTicketPrice", - "seriesId": "col-1-1.['1.1']" - } - ] - }, - { - "id": "1.50", - "rawId": "col-2-1.50", - "label": "50th percentile of AvgTicketPrice", - "values": [ - { - "x": 1557460800000, - "y": 658.8453063964844, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 0, - "value": 1557460800000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 2, - "row": 0, - "value": 658 - }, - "parent": null, - "series": "50th percentile of AvgTicketPrice", - "seriesId": "col-2-1.50" - }, - { - "x": 1557547200000, - "y": 756, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 1, - "value": 1557547200000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 2, - "row": 1, - "value": 756.2283554077148 - }, - "parent": null, - "series": "50th percentile of AvgTicketPrice", - "seriesId": "col-2-1.50" - } - ] - } - ], - "type": "series", - "labels": [ - "1.1th percentile of AvgTicketPrice", - "50th percentile of AvgTicketPrice" - ] - } -} diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value_result.json b/src/plugins/vis_types/vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value_result.json deleted file mode 100644 index ae1f3cbf24c33..0000000000000 --- a/src/plugins/vis_types/vislib/public/vislib/lib/types/testdata_linechart_percentile_float_value_result.json +++ /dev/null @@ -1,456 +0,0 @@ -{ - "addLegend": true, - "addTimeMarker": false, - "addTooltip": true, - "categoryAxes": [ - { - "id": "CategoryAxis-1", - "labels": { - "show": true, - "truncate": 100 - }, - "position": "bottom", - "scale": { - "type": "linear" - }, - "show": true, - "style": {}, - "title": { - "text": "Date Histogram" - }, - "type": "category" - } - ], - "dimensions": { - "x": { - "accessor": 0, - "format": { - "id": "date", - "params": { - "pattern": "YYYY-MM-DD" - } - }, - "params": { - "date": true, - "interval": 86400000, - "format": "YYYY-MM-DD", - "bounds": { - "min": "2019-05-10T04:00:00.000Z", - "max": "2019-05-12T10:18:57.342Z" - } - }, - "aggType": "date_histogram" - }, - "y": [ - { - "accessor": 1, - "format": { - "id": "number", - "params": { - "pattern": "$0,0.[00]" - } - }, - "params": {}, - "aggType": "percentiles" - }, - { - "accessor": 2, - "format": { - "id": "number", - "params": { - "pattern": "$0,0.[00]" - } - }, - "params": {}, - "aggType": "percentiles" - } - ] - }, - "grid": { - "categoryLines": false, - "style": { - "color": "#eee" - } - }, - "legendPosition": "right", - "seriesParams": [ - { - "data": { - "id": "1", - "label": "Percentiles of AvgTicketPrice" - }, - "drawLinesBetweenPoints": true, - "interpolate": "cardinal", - "mode": "normal", - "show": "true", - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - } - ], - "times": [], - "type": "point_series", - "valueAxes": [ - { - "id": "ValueAxis-1", - "labels": { - "filter": false, - "rotate": 0, - "show": true, - "truncate": 100 - }, - "name": "LeftAxis-1", - "position": "left", - "scale": { - "mode": "normal", - "type": "linear" - }, - "show": true, - "style": {}, - "title": { - "text": "Percentiles of AvgTicketPrice" - }, - "type": "value" - } - ], - "chartTitle": {}, - "mode": "normal", - "tooltip": { - "show": true - }, - "charts": [ - { - "type": "point_series", - "addTimeMarker": false, - "series": [ - { - "show": true, - "type": "area", - "mode": "normal", - "drawLinesBetweenPoints": true, - "showCircles": true, - "data": { - "id": "1.['1.1']", - "rawId": "col-1-1.['1.1']", - "label": "1.1th percentile of AvgTicketPrice", - "values": [ - { - "x": 1557460800000, - "y": 116.33676605224609, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 0, - "value": 1557460800000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 1, - "row": 0, - "value": 116.33676605224609 - }, - "parent": null, - "series": "1.1th percentile of AvgTicketPrice", - "seriesId": "col-1-1.['1.1']" - }, - { - "x": 1557547200000, - "y": 223, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 1, - "value": 1557547200000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 1, - "row": 1, - "value": 223 - }, - "parent": null, - "series": "1.1th percentile of AvgTicketPrice", - "seriesId": "col-1-1.['1.1']" - } - ] - } - }, - { - "data": { - "id": "1.50", - "rawId": "col-2-1.50", - "label": "50th percentile of AvgTicketPrice", - "values": [ - { - "x": 1557460800000, - "y": 658.8453063964844, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 0, - "value": 1557460800000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 2, - "row": 0, - "value": 658 - }, - "parent": null, - "series": "50th percentile of AvgTicketPrice", - "seriesId": "col-2-1.50" - }, - { - "x": 1557547200000, - "y": 756, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 1, - "value": 1557547200000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.['1.1']", - "name": "1.1th percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.['1.1']": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.['1.1']": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 2, - "row": 1, - "value": 756.2283554077148 - }, - "parent": null, - "series": "50th percentile of AvgTicketPrice", - "seriesId": "col-2-1.50" - } - ] - }, - "drawLinesBetweenPoints": true, - "interpolate": "cardinal", - "mode": "normal", - "show": "true", - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - } - ] - } - ], - "enableHover": true -} diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/types/testdata_linechart_percentile_result.json b/src/plugins/vis_types/vislib/public/vislib/lib/types/testdata_linechart_percentile_result.json deleted file mode 100644 index f2ee245a8431f..0000000000000 --- a/src/plugins/vis_types/vislib/public/vislib/lib/types/testdata_linechart_percentile_result.json +++ /dev/null @@ -1,458 +0,0 @@ -{ - "addLegend": true, - "addTimeMarker": false, - "addTooltip": true, - "categoryAxes": [ - { - "id": "CategoryAxis-1", - "labels": { - "show": true, - "truncate": 100 - }, - "position": "bottom", - "scale": { - "type": "linear" - }, - "show": true, - "style": {}, - "title": { - "text": "Date Histogram" - }, - "type": "category" - } - ], - "dimensions": { - "x": { - "accessor": 0, - "format": { - "id": "date", - "params": { - "pattern": "YYYY-MM-DD" - } - }, - "params": { - "date": true, - "interval": 86400000, - "format": "YYYY-MM-DD", - "bounds": { - "min": "2019-05-10T04:00:00.000Z", - "max": "2019-05-12T10:18:57.342Z" - } - }, - "aggType": "date_histogram" - }, - "y": [ - { - "accessor": 1, - "format": { - "id": "number", - "params": { - "pattern": "$0,0.[00]" - } - }, - "params": {}, - "aggType": "percentiles" - }, - { - "accessor": 2, - "format": { - "id": "number", - "params": { - "pattern": "$0,0.[00]" - } - }, - "params": {}, - "aggType": "percentiles" - } - ] - }, - "grid": { - "categoryLines": false, - "style": { - "color": "#eee" - } - }, - "legendPosition": "right", - "seriesParams": [ - { - "data": { - "id": "1", - "label": "Percentiles of AvgTicketPrice" - }, - "drawLinesBetweenPoints": true, - "interpolate": "cardinal", - "mode": "normal", - "show": "true", - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - } - ], - "times": [], - "type": "point_series", - "valueAxes": [ - { - "id": "ValueAxis-1", - "labels": { - "filter": false, - "rotate": 0, - "show": true, - "truncate": 100 - }, - "name": "LeftAxis-1", - "position": "left", - "scale": { - "mode": "normal", - "type": "linear" - }, - "show": true, - "style": {}, - "title": { - "text": "Percentiles of AvgTicketPrice" - }, - "type": "value" - } - ], - "chartTitle": {}, - "mode": "normal", - "tooltip": { - "show": true - }, - "charts": [ - { - "type": "point_series", - "addTimeMarker": false, - "series": [ - { - "data": { - "id": "1.1", - "rawId": "col-1-1.1", - "label": "1st percentile of AvgTicketPrice", - "values": [ - { - "x": 1557460800000, - "y": 116.33676605224609, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 0, - "value": 1557460800000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 1, - "row": 0, - "value": 116.33676605224609 - }, - "parent": null, - "series": "1st percentile of AvgTicketPrice", - "seriesId": "col-1-1.1" - }, - { - "x": 1557547200000, - "y": 223, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 1, - "value": 1557547200000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 1, - "row": 1, - "value": 223 - }, - "parent": null, - "series": "1st percentile of AvgTicketPrice", - "seriesId": "col-1-1.1" - } - ] - }, - "drawLinesBetweenPoints": true, - "interpolate": "cardinal", - "mode": "normal", - "show": "true", - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - }, - { - "data": { - "id": "1.50", - "rawId": "col-2-1.50", - "label": "50th percentile of AvgTicketPrice", - "values": [ - { - "x": 1557460800000, - "y": 658.8453063964844, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 0, - "value": 1557460800000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 2, - "row": 0, - "value": 658 - }, - "parent": null, - "series": "50th percentile of AvgTicketPrice", - "seriesId": "col-2-1.50" - }, - { - "x": 1557547200000, - "y": 756, - "extraMetrics": [], - "xRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 0, - "row": 1, - "value": 1557547200000 - }, - "yRaw": { - "table": { - "columns": [ - { - "id": "col-0-2", - "name": "timestamp per day" - }, - { - "id": "col-1-1.1", - "name": "1st percentile of AvgTicketPrice" - }, - { - "id": "col-2-1.50", - "name": "50th percentile of AvgTicketPrice" - } - ], - "rows": [ - { - "col-0-2": 1557460800000, - "col-1-1.1": 116, - "col-2-1.50": 658 - }, - { - "col-0-2": 1557547200000, - "col-1-1.1": 223, - "col-2-1.50": 756 - } - ] - }, - "column": 2, - "row": 1, - "value": 756.2283554077148 - }, - "parent": null, - "series": "50th percentile of AvgTicketPrice", - "seriesId": "col-2-1.50" - } - ] - }, - "drawLinesBetweenPoints": true, - "interpolate": "cardinal", - "mode": "normal", - "show": "true", - "showCircles": true, - "type": "line", - "valueAxis": "ValueAxis-1" - } - ] - } - ], - "enableHover": true -} diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/vis_config.test.js b/src/plugins/vis_types/vislib/public/vislib/lib/vis_config.test.js index 441c5d9969c4f..1ae32aa4b5473 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/vis_config.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/vis_config.test.js @@ -78,7 +78,7 @@ describe('Vislib VisConfig Class Test Suite', function () { visConfig = new VisConfig( { - type: 'point_series', + type: 'heatmap', }, data, getMockUiState(), diff --git a/src/plugins/vis_types/vislib/public/vislib/vis.js b/src/plugins/vis_types/vislib/public/vislib/vis.js index 2afe5ff8281ee..790dc1ecfa2d4 100644 --- a/src/plugins/vis_types/vislib/public/vislib/vis.js +++ b/src/plugins/vis_types/vislib/public/vislib/vis.js @@ -13,7 +13,7 @@ import { EventEmitter } from 'events'; import { VislibError } from './errors'; import { VisConfig } from './lib/vis_config'; import { Handler } from './lib/handler'; -import { DIMMING_OPACITY_SETTING, HEATMAP_MAX_BUCKETS_SETTING } from '../../common'; +import { HEATMAP_MAX_BUCKETS_SETTING } from '../../common'; /** * Creates the visualizations. @@ -28,7 +28,6 @@ export class Vis extends EventEmitter { super(); this.element = element.get ? element.get(0) : element; this.visConfigArgs = _.cloneDeep(visConfigArgs); - this.visConfigArgs.dimmingOpacity = core.uiSettings.get(DIMMING_OPACITY_SETTING); this.visConfigArgs.heatmapMaxBuckets = core.uiSettings.get(HEATMAP_MAX_BUCKETS_SETTING); this.charts = charts; this.uiSettings = core.uiSettings; diff --git a/src/plugins/vis_types/vislib/public/vislib/vis.test.js b/src/plugins/vis_types/vislib/public/vislib/vis.test.js index 1614175f7e2a4..46afbd1c62f69 100644 --- a/src/plugins/vis_types/vislib/public/vislib/vis.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/vis.test.js @@ -26,6 +26,7 @@ const names = ['series', 'columns', 'rows', 'stackedSeries']; let mockedHTMLElementClientSizes; let mockedSVGElementGetBBox; let mockedSVGElementGetComputedTextLength; +let mockWidth; dataArray.forEach(function (data, i) { describe('Vislib Vis Test Suite for ' + names[i] + ' Data', function () { @@ -35,16 +36,30 @@ dataArray.forEach(function (data, i) { let mockUiState; let secondVis; let numberOfCharts; + let config; beforeAll(() => { mockedHTMLElementClientSizes = setHTMLElementClientSizes(512, 512); mockedSVGElementGetBBox = setSVGElementGetBBox(100); mockedSVGElementGetComputedTextLength = setSVGElementGetComputedTextLength(100); + mockWidth = jest.spyOn($.prototype, 'width').mockReturnValue(900); }); beforeEach(() => { - vis = getVis(); - secondVis = getVis(); + config = { + type: 'heatmap', + addLegend: true, + addTooltip: true, + colorsNumber: 4, + colorSchema: 'Greens', + setColorRange: false, + percentageMode: true, + percentageFormatPattern: '0.0%', + invertColors: false, + colorsRange: [], + }; + vis = getVis(config); + secondVis = getVis(config); mockUiState = getMockUiState(); }); @@ -57,6 +72,7 @@ dataArray.forEach(function (data, i) { mockedHTMLElementClientSizes.mockRestore(); mockedSVGElementGetBBox.mockRestore(); mockedSVGElementGetComputedTextLength.mockRestore(); + mockWidth.mockRestore(); }); describe('render Method', function () { diff --git a/src/plugins/vis_types/vislib/public/vislib/visualizations/_vis_fixture.js b/src/plugins/vis_types/vislib/public/vislib/visualizations/_vis_fixture.js index f4e2e4b977b8f..7313d1c8f8eac 100644 --- a/src/plugins/vis_types/vislib/public/vislib/visualizations/_vis_fixture.js +++ b/src/plugins/vis_types/vislib/public/vislib/visualizations/_vis_fixture.js @@ -51,7 +51,7 @@ export function getVis(vislibParams, element) { defaultYExtents: false, setYExtents: false, yAxis: {}, - type: 'histogram', + type: 'heatmap', }), coreMock.createSetup(), chartPluginMock.createStartContract() diff --git a/src/plugins/vis_types/vislib/public/vislib/visualizations/chart.test.js b/src/plugins/vis_types/vislib/public/vislib/visualizations/chart.test.js index 97ea3313d81de..c105102dc6ab9 100644 --- a/src/plugins/vis_types/vislib/public/vislib/visualizations/chart.test.js +++ b/src/plugins/vis_types/vislib/public/vislib/visualizations/chart.test.js @@ -7,7 +7,12 @@ */ import d3 from 'd3'; -import { setHTMLElementClientSizes, setSVGElementGetBBox } from '@kbn/test/jest'; +import $ from 'jquery'; +import { + setHTMLElementClientSizes, + setSVGElementGetBBox, + setSVGElementGetComputedTextLength, +} from '@kbn/test/jest'; import { Chart } from './_chart'; import { getMockUiState } from '../../fixtures/mocks'; import { getVis } from './_vis_fixture'; @@ -96,22 +101,31 @@ describe('Vislib _chart Test Suite', function () { let mockedHTMLElementClientSizes; let mockedSVGElementGetBBox; + let mockedSVGElementGetComputedTextLength; + let mockWidth; beforeAll(() => { mockedHTMLElementClientSizes = setHTMLElementClientSizes(512, 512); mockedSVGElementGetBBox = setSVGElementGetBBox(100); + mockedSVGElementGetComputedTextLength = setSVGElementGetComputedTextLength(100); + mockWidth = jest.spyOn($.prototype, 'width').mockReturnValue(900); }); beforeEach(() => { el = d3.select('body').append('div').attr('class', 'column-chart'); config = { - type: 'histogram', - addTooltip: true, + type: 'heatmap', addLegend: true, - zeroFill: true, + addTooltip: true, + colorsNumber: 4, + colorSchema: 'Greens', + setColorRange: false, + percentageMode: true, + percentageFormatPattern: '0.0%', + invertColors: false, + colorsRange: [], }; - vis = getVis(config, el[0][0]); vis.render(data, getMockUiState()); @@ -126,6 +140,8 @@ describe('Vislib _chart Test Suite', function () { afterAll(() => { mockedHTMLElementClientSizes.mockRestore(); mockedSVGElementGetBBox.mockRestore(); + mockedSVGElementGetComputedTextLength.mockRestore(); + mockWidth.mockRestore(); }); test('should be a constructor for visualization modules', function () { diff --git a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series.js b/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series.js index b4ab2ea2992c5..dae60fda47631 100644 --- a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series.js +++ b/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series.js @@ -13,10 +13,8 @@ import $ from 'jquery'; import { Tooltip } from '../components/tooltip'; import { Chart } from './_chart'; import { TimeMarker } from './time_marker'; -import { seriesTypes } from './point_series/series_types'; import { touchdownTemplate } from '../partials/touchdown_template'; - -const seriTypes = seriesTypes; +import { HeatmapChart } from './point_series/heatmap_chart'; /** * Line Chart Visualization @@ -233,9 +231,7 @@ export class PointSeries extends Chart { self.series = []; _.each(self.chartConfig.series, (seriArgs, i) => { if (!seriArgs.show) return; - const SeriClass = - seriTypes[seriArgs.type || self.handler.visConfig.get('chart.type')] || seriTypes.line; - const series = new SeriClass( + const series = new HeatmapChart( self.handler, svg, data.series[i], diff --git a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/_index.scss b/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/_index.scss deleted file mode 100644 index 53fce786ecc15..0000000000000 --- a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './labels'; diff --git a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/_labels.scss b/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/_labels.scss deleted file mode 100644 index 8bcd17fd55ddf..0000000000000 --- a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/_labels.scss +++ /dev/null @@ -1,20 +0,0 @@ -$visColumnChartBarLabelDarkColor: #000; // EUI doesn't yet have a variable for fully black in all themes; -$visColumnChartBarLabelLightColor: $euiColorGhost; - -.visColumnChart__barLabel { - font-size: 8pt; - pointer-events: none; -} - -.visColumnChart__barLabel--stack { - dominant-baseline: central; - text-anchor: middle; -} - -.visColumnChart__bar-label--dark { - fill: $visColumnChartBarLabelDarkColor; -} - -.visColumnChart__bar-label--light { - fill: $visColumnChartBarLabelLightColor; -} diff --git a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/area_chart.js b/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/area_chart.js deleted file mode 100644 index 2e2ce79247c3d..0000000000000 --- a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/area_chart.js +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import d3 from 'd3'; -import _ from 'lodash'; -import $ from 'jquery'; -import { PointSeries } from './_point_series'; - -const defaults = { - mode: 'normal', - showCircles: true, - radiusRatio: 9, - showLines: true, - interpolate: 'linear', - color: undefined, - fillColor: undefined, -}; -/** - * Area chart visualization - * - * @class AreaChart - * @constructor - * @extends Chart - * @param handler {Object} Reference to the Handler Class Constructor - * @param el {HTMLElement} HTML element to which the chart will be appended - * @param chartData {Object} Elasticsearch query results for this specific - * chart - */ -export class AreaChart extends PointSeries { - constructor(handler, chartEl, chartData, seriesConfigArgs, uiSettings) { - super(handler, chartEl, chartData, seriesConfigArgs, uiSettings); - - this.seriesConfig = _.defaults(seriesConfigArgs || {}, defaults); - this.isOverlapping = this.seriesConfig.mode !== 'stacked'; - if (this.isOverlapping) { - // Default opacity should return to 0.6 on mouseout - const defaultOpacity = 0.6; - this.seriesConfig.defaultOpacity = defaultOpacity; - handler.highlight = function (element) { - const label = this.getAttribute('data-label'); - if (!label) return; - - const highlightOpacity = 0.8; - const highlightElements = $('[data-label]', element.parentNode).filter(function (els, el) { - return `${$(el).data('label')}` === label; - }); - $('[data-label]', element.parentNode) - .not(highlightElements) - .css('opacity', defaultOpacity / 2); // half of the default opacity - highlightElements.css('opacity', highlightOpacity); - }; - handler.unHighlight = function (element) { - $('[data-label]', element).css('opacity', defaultOpacity); - - //The legend should keep max opacity - $('[data-label]', $(element).siblings()).css('opacity', 1); - }; - } - } - - addPath(svg, data) { - const ordered = this.handler.data.get('ordered'); - const isTimeSeries = ordered && ordered.date; - const isOverlapping = this.isOverlapping; - const color = this.handler.data.getColorFunc(); - const xScale = this.getCategoryAxis().getScale(); - const yScale = this.getValueAxis().getScale(); - const interpolate = this.seriesConfig.interpolate; - const isHorizontal = this.getCategoryAxis().axisConfig.isHorizontal(); - - // Data layers - const layer = svg.append('g').attr('class', function (d, i) { - return 'series series-' + i; - }); - - // Append path - const path = layer - .append('path') - .attr('data-label', data.label) - .style('fill', () => color(data.label)) - .style('stroke', () => color(data.label)) - .classed('visAreaChart__overlapArea', function () { - return isOverlapping; - }) - .attr('clip-path', 'url(#' + this.baseChart.clipPathId + ')'); - - function x(d) { - if (isTimeSeries) { - return xScale(d.x); - } - return xScale(d.x) + xScale.rangeBand() / 2; - } - - function y1(d) { - const y0 = d.y0 || 0; - const y = d.y || 0; - return yScale(y0 + y); - } - - function y0(d) { - const y0 = d.y0 || 0; - return yScale(y0); - } - - function getArea() { - if (isHorizontal) { - return d3.svg.area().x(x).y0(y0).y1(y1); - } else { - return d3.svg.area().y(x).x0(y0).x1(y1); - } - } - - // update - path - .attr('d', function () { - const area = getArea() - .defined(function (d) { - return !_.isNull(d.y); - }) - .interpolate(interpolate); - return area(data.values); - }) - .style('stroke-width', '1px'); - - return path; - } - - /** - * Adds SVG circles to area chart - * - * @method addCircles - * @param svg {HTMLElement} SVG to which circles are appended - * @param data {Array} Chart data array - * @returns {D3.UpdateSelection} SVG with circles added - */ - addCircles(svg, data) { - const color = this.handler.data.getColorFunc(); - const xScale = this.getCategoryAxis().getScale(); - const yScale = this.getValueAxis().getScale(); - const ordered = this.handler.data.get('ordered'); - const circleRadius = 12; - const circleStrokeWidth = 0; - const tooltip = this.baseChart.tooltip; - const isTooltip = this.handler.visConfig.get('tooltip.show'); - const isOverlapping = this.isOverlapping; - const isHorizontal = this.getCategoryAxis().axisConfig.isHorizontal(); - - const layer = svg - .append('g') - .attr('class', 'points area') - .attr('clip-path', 'url(#' + this.baseChart.clipPathId + ')'); - - // append the circles - const circles = layer.selectAll('circles').data(function appendData() { - return data.values.filter(function isZeroOrNull(d) { - return d.y !== 0 && !_.isNull(d.y); - }); - }); - - // exit - circles.exit().remove(); - - // enter - circles - .enter() - .append('circle') - .attr('data-label', data.label) - .attr('stroke', () => { - return color(data.label); - }) - .attr('fill', 'transparent') - .attr('stroke-width', circleStrokeWidth); - - function cx(d) { - if (ordered && ordered.date) { - return xScale(d.x); - } - return xScale(d.x) + xScale.rangeBand() / 2; - } - - function cy(d) { - const y = d.y || 0; - if (isOverlapping) { - return yScale(y); - } - return yScale(d.y0 + y); - } - - // update - circles - .attr('cx', isHorizontal ? cx : cy) - .attr('cy', isHorizontal ? cy : cx) - .attr('r', circleRadius); - - // Add tooltip - if (isTooltip) { - circles.call(tooltip.render()); - } - - return circles; - } - - addPathEvents(path) { - const events = this.events; - if (this.handler.visConfig.get('enableHover')) { - const hover = events.addHoverEvent(); - const mouseout = events.addMouseoutEvent(); - path.call(hover).call(mouseout); - } - } - - /** - * Renders d3 visualization - * - * @method draw - * @returns {Function} Creates the area chart - */ - draw() { - const self = this; - - return function (selection) { - selection.each(function () { - const svg = self.chartEl.append('g'); - svg.data([self.chartData]); - - const path = self.addPath(svg, self.chartData); - self.addPathEvents(path); - const circles = self.addCircles(svg, self.chartData); - self.addCircleEvents(circles); - - if (self.thresholdLineOptions.show) { - self.addThresholdLine(self.chartEl); - } - self.events.emit('rendered', { - chart: self.chartData, - }); - - return svg; - }); - }; - } -} diff --git a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/area_chart.test.js b/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/area_chart.test.js deleted file mode 100644 index 68b0728026498..0000000000000 --- a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/area_chart.test.js +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import d3 from 'd3'; -import _ from 'lodash'; -import $ from 'jquery'; -import { - setHTMLElementClientSizes, - setSVGElementGetBBox, - setSVGElementGetComputedTextLength, -} from '@kbn/test/jest'; - -import { getMockUiState } from '../../../fixtures/mocks'; -import { getVis } from '../_vis_fixture'; - -const dataTypesArray = { - 'series pos': import('../../../fixtures/mock_data/date_histogram/_series'), - 'series pos neg': import('../../../fixtures/mock_data/date_histogram/_series_pos_neg'), - 'series neg': import('../../../fixtures/mock_data/date_histogram/_series_neg'), - 'term columns': import('../../../fixtures/mock_data/terms/_columns'), - 'range rows': import('../../../fixtures/mock_data/range/_rows'), - stackedSeries: import('../../../fixtures/mock_data/date_histogram/_stacked_series'), -}; - -const vislibParams = { - type: 'area', - addLegend: true, - addTooltip: true, - mode: 'stacked', -}; - -let mockedHTMLElementClientSizes; -let mockedSVGElementGetBBox; -let mockedSVGElementGetComputedTextLength; - -_.forOwn(dataTypesArray, function (dataType, dataTypeName) { - describe('Vislib Area Chart Test Suite for ' + dataTypeName + ' Data', function () { - let vis; - let mockUiState; - - beforeAll(() => { - mockedHTMLElementClientSizes = setHTMLElementClientSizes(512, 512); - mockedSVGElementGetBBox = setSVGElementGetBBox(100); - mockedSVGElementGetComputedTextLength = setSVGElementGetComputedTextLength(100); - }); - - beforeEach(async () => { - vis = getVis(vislibParams); - mockUiState = getMockUiState(); - vis.on('brush', _.noop); - vis.render(await dataType, mockUiState); - }); - - afterEach(function () { - vis.destroy(); - }); - - afterAll(() => { - mockedHTMLElementClientSizes.mockRestore(); - mockedSVGElementGetBBox.mockRestore(); - mockedSVGElementGetComputedTextLength.mockRestore(); - }); - - describe('stackData method', function () { - let stackedData; - let isStacked; - - beforeEach(function () { - vis.handler.charts.forEach(function (chart) { - stackedData = chart.chartData; - - isStacked = stackedData.series.every(function (arr) { - return arr.values.every(function (d) { - return _.isNumber(d.y0); - }); - }); - }); - }); - - test('should append a d.y0 key to the data object', function () { - expect(isStacked).toBe(true); - }); - }); - - describe('addPath method', function () { - test('should append a area paths', function () { - vis.handler.charts.forEach(function (chart) { - expect($(chart.chartEl).find('path').length).toBeGreaterThan(0); - }); - }); - }); - - describe('addPathEvents method', function () { - let path; - let d3selectedPath; - let onMouseOver; - - beforeEach(function () { - vis.handler.charts.forEach(function (chart) { - path = $(chart.chartEl).find('path')[0]; - d3selectedPath = d3.select(path)[0][0]; - - // d3 instance of click and hover - onMouseOver = !!d3selectedPath.__onmouseover; - }); - }); - - test('should attach a hover event', function () { - vis.handler.charts.forEach(function () { - expect(onMouseOver).toBe(true); - }); - }); - }); - - describe('addCircleEvents method', function () { - let circle; - let brush; - let d3selectedCircle; - let onBrush; - let onClick; - let onMouseOver; - - beforeEach(() => { - vis.handler.charts.forEach(function (chart) { - circle = $(chart.chartEl).find('circle')[0]; - brush = $(chart.chartEl).find('.brush'); - d3selectedCircle = d3.select(circle)[0][0]; - - // d3 instance of click and hover - onBrush = !!brush; - onClick = !!d3selectedCircle.__onclick; - onMouseOver = !!d3selectedCircle.__onmouseover; - }); - }); - - // D3 brushing requires that a g element is appended that - // listens for mousedown events. This g element includes - // listeners, however, I was not able to test for the listener - // function being present. I will need to update this test - // in the future. - test('should attach a brush g element', function () { - vis.handler.charts.forEach(function () { - expect(onBrush).toBe(true); - }); - }); - - test('should attach a click event', function () { - vis.handler.charts.forEach(function () { - expect(onClick).toBe(true); - }); - }); - - test('should attach a hover event', function () { - vis.handler.charts.forEach(function () { - expect(onMouseOver).toBe(true); - }); - }); - }); - - describe('addCircles method', function () { - test('should append circles', function () { - vis.handler.charts.forEach(function (chart) { - expect($(chart.chartEl).find('circle').length).toBeGreaterThan(0); - }); - }); - - test('should not draw circles where d.y === 0', function () { - vis.handler.charts.forEach(function (chart) { - const series = chart.chartData.series; - const isZero = series.some(function (d) { - return d.y === 0; - }); - const circles = $.makeArray($(chart.chartEl).find('circle')); - const isNotDrawn = circles.some(function (d) { - return d.__data__.y === 0; - }); - - if (isZero) { - expect(isNotDrawn).toBe(false); - } - }); - }); - }); - - describe('draw method', function () { - test('should return a function', function () { - vis.handler.charts.forEach(function (chart) { - expect(_.isFunction(chart.draw())).toBe(true); - }); - }); - - test('should return a yMin and yMax', function () { - vis.handler.charts.forEach(function (chart) { - const yAxis = chart.handler.valueAxes[0]; - const domain = yAxis.getScale().domain(); - - expect(domain[0]).not.toBe(undefined); - expect(domain[1]).not.toBe(undefined); - }); - }); - - test('should render a zero axis line', function () { - vis.handler.charts.forEach(function (chart) { - const yAxis = chart.handler.valueAxes[0]; - - if (yAxis.yMin < 0 && yAxis.yMax > 0) { - expect($(chart.chartEl).find('line.zero-line').length).toBe(1); - } - }); - }); - }); - - describe('defaultYExtents is true', function () { - beforeEach(async function () { - vis.visConfigArgs.defaultYExtents = true; - vis.render(await dataType, mockUiState); - }); - - test('should return yAxis extents equal to data extents', function () { - vis.handler.charts.forEach(function (chart) { - const yAxis = chart.handler.valueAxes[0]; - const min = vis.handler.valueAxes[0].axisScale.getYMin(); - const max = vis.handler.valueAxes[0].axisScale.getYMax(); - const domain = yAxis.getScale().domain(); - expect(domain[0]).toEqual(min); - expect(domain[1]).toEqual(max); - }); - }); - }); - [0, 2, 4, 8].forEach(function (boundsMarginValue) { - describe('defaultYExtents is true and boundsMargin is defined', function () { - beforeEach(async function () { - vis.visConfigArgs.defaultYExtents = true; - vis.visConfigArgs.boundsMargin = boundsMarginValue; - vis.render(await dataType, mockUiState); - }); - - test('should return yAxis extents equal to data extents with boundsMargin', function () { - vis.handler.charts.forEach(function (chart) { - const yAxis = chart.handler.valueAxes[0]; - const min = vis.handler.valueAxes[0].axisScale.getYMin(); - const max = vis.handler.valueAxes[0].axisScale.getYMax(); - const domain = yAxis.getScale().domain(); - if (min < 0 && max < 0) { - expect(domain[0]).toEqual(min); - expect(domain[1] - boundsMarginValue).toEqual(max); - } else if (min > 0 && max > 0) { - expect(domain[0] + boundsMarginValue).toEqual(min); - expect(domain[1]).toEqual(max); - } else { - expect(domain[0]).toEqual(min); - expect(domain[1]).toEqual(max); - } - }); - }); - }); - }); - }); -}); diff --git a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/column_chart.js b/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/column_chart.js deleted file mode 100644 index 1c543d06e9be9..0000000000000 --- a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/column_chart.js +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import _ from 'lodash'; -import d3 from 'd3'; -import { isColorDark } from '@elastic/eui/lib/services'; -import { PointSeries } from './_point_series'; - -const defaults = { - mode: 'normal', - showTooltip: true, - color: undefined, - fillColor: undefined, - showLabel: true, -}; - -/** - * Histogram intervals are not always equal widths, e.g, monthly time intervals. - * It is more visually appealing to vary bar width so that gutter width is constant. - */ -function datumWidth(defaultWidth, datum, nextDatum, scale, gutterWidth, groupCount = 1) { - let datumWidth = defaultWidth; - if (nextDatum) { - datumWidth = (scale(nextDatum.x) - scale(datum.x) - gutterWidth) / groupCount; - // To handle data-sets with holes, do not let width be larger than default. - if (datumWidth > defaultWidth) { - datumWidth = defaultWidth; - } - } - return datumWidth; -} - -/** - * Vertical Bar Chart Visualization: renders vertical and/or stacked bars - * - * @class ColumnChart - * @constructor - * @extends Chart - * @param handler {Object} Reference to the Handler Class Constructor - * @param el {HTMLElement} HTML element to which the chart will be appended - * @param chartData {Object} Elasticsearch query results for this specific chart - */ -export class ColumnChart extends PointSeries { - constructor(handler, chartEl, chartData, seriesConfigArgs, uiSettings) { - super(handler, chartEl, chartData, seriesConfigArgs, uiSettings); - this.seriesConfig = _.defaults(seriesConfigArgs || {}, defaults); - this.labelOptions = _.defaults(handler.visConfig.get('labels', {}), defaults.showLabel); - } - - addBars(svg, data) { - const self = this; - const color = this.handler.data.getColorFunc(); - const tooltip = this.baseChart.tooltip; - const isTooltip = this.handler.visConfig.get('tooltip.show'); - - const layer = svg - .append('g') - .attr('class', 'series histogram') - .attr('clip-path', 'url(#' + this.baseChart.clipPathId + ')'); - - const bars = layer.selectAll('rect').data( - data.values.filter(function (d) { - return !_.isNull(d.y); - }) - ); - - bars.exit().remove(); - - bars - .enter() - .append('rect') - .attr('data-label', data.label) - .attr('fill', () => color(data.label)) - .attr('stroke', () => color(data.label)); - - self.updateBars(bars); - - // Add tooltip - if (isTooltip) { - bars.call(tooltip.render()); - } - - return bars; - } - - /** - * Determines whether bars are grouped or stacked and updates the D3 - * selection - * - * @method updateBars - * @param bars {D3.UpdateSelection} SVG with rect added - * @returns {D3.UpdateSelection} - */ - updateBars(bars) { - if (this.seriesConfig.mode === 'stacked') { - return this.addStackedBars(bars); - } - return this.addGroupedBars(bars); - } - - /** - * Adds stacked bars to column chart visualization - * - * @method addStackedBars - * @param bars {D3.UpdateSelection} SVG with rect added - * @returns {D3.UpdateSelection} - */ - addStackedBars(bars) { - const xScale = this.getCategoryAxis().getScale(); - const yScale = this.getValueAxis().getScale(); - const isHorizontal = this.getCategoryAxis().axisConfig.isHorizontal(); - const isTimeScale = this.getCategoryAxis().axisConfig.isTimeDomain(); - const isLabels = this.labelOptions.show; - const yMin = yScale.domain()[0]; - const gutterSpacingPercentage = 0.15; - const chartData = this.chartData; - const getGroupedNum = this.getGroupedNum.bind(this); - const groupCount = this.getGroupedCount(); - - let barWidth; - let gutterWidth; - - if (isTimeScale) { - const { min, interval } = this.handler.data.get('ordered'); - let intervalWidth = xScale(min + interval) - xScale(min); - intervalWidth = Math.abs(intervalWidth); - - gutterWidth = intervalWidth * gutterSpacingPercentage; - barWidth = (intervalWidth - gutterWidth) / groupCount; - } - - function x(d, i) { - const groupNum = getGroupedNum(d.seriesId); - - if (isTimeScale) { - return ( - xScale(d.x) + - datumWidth(barWidth, d, bars.data()[i + 1], xScale, gutterWidth, groupCount) * groupNum - ); - } - return xScale(d.x) + (xScale.rangeBand() / groupCount) * groupNum; - } - - function y(d) { - if ((isHorizontal && d.y < 0) || (!isHorizontal && d.y > 0)) { - return yScale(d.y0); - } - return yScale(d.y0 + d.y); - } - - function labelX(d, i) { - return x(d, i) + widthFunc(d, i) / 2; - } - - function labelY(d) { - return y(d) + heightFunc(d) / 2; - } - - function labelDisplay(d, i) { - if (isHorizontal && this.getBBox().width > widthFunc(d, i)) return 'none'; - if (!isHorizontal && this.getBBox().width > heightFunc(d)) return 'none'; - if (isHorizontal && this.getBBox().height > heightFunc(d)) return 'none'; - if (!isHorizontal && this.getBBox().height > widthFunc(d, i)) return 'none'; - return 'block'; - } - - function widthFunc(d, i) { - if (isTimeScale) { - return datumWidth(barWidth, d, bars.data()[i + 1], xScale, gutterWidth, groupCount); - } - return xScale.rangeBand() / groupCount; - } - - function heightFunc(d) { - // for split bars or for one series, - // last series will have d.y0 = 0 - if (d.y0 === 0 && yMin > 0) { - return yScale(yMin) - yScale(d.y); - } - return Math.abs(yScale(d.y0) - yScale(d.y0 + d.y)); - } - - function formatValue(d) { - return chartData.yAxisFormatter(d.y); - } - - // update - bars - .attr('x', isHorizontal ? x : y) - .attr('width', isHorizontal ? widthFunc : heightFunc) - .attr('y', isHorizontal ? y : x) - .attr('height', isHorizontal ? heightFunc : widthFunc); - - const layer = d3.select(bars[0].parentNode); - const barLabels = layer.selectAll('text').data( - chartData.values.filter(function (d) { - return !_.isNull(d.y); - }) - ); - - if (isLabels) { - const colorFunc = this.handler.data.getColorFunc(); - const d3Color = d3.rgb(colorFunc(chartData.label)); - let labelClass; - if (isColorDark(d3Color.r, d3Color.g, d3Color.b)) { - labelClass = 'visColumnChart__bar-label--light'; - } else { - labelClass = 'visColumnChart__bar-label--dark'; - } - - barLabels - .enter() - .append('text') - .text(formatValue) - .attr('class', `visColumnChart__barLabel visColumnChart__barLabel--stack ${labelClass}`) - .attr('x', isHorizontal ? labelX : labelY) - .attr('y', isHorizontal ? labelY : labelX) - - // display must apply last, because labelDisplay decision it based - // on text bounding box which depends on actual applied style. - .attr('display', labelDisplay); - } - - return bars; - } - - /** - * Adds grouped bars to column chart visualization - * - * @method addGroupedBars - * @param bars {D3.UpdateSelection} SVG with rect added - * @returns {D3.UpdateSelection} - */ - addGroupedBars(bars) { - const xScale = this.getCategoryAxis().getScale(); - const yScale = this.getValueAxis().getScale(); - const chartData = this.chartData; - const groupCount = this.getGroupedCount(); - const gutterSpacingPercentage = 0.15; - const isTimeScale = this.getCategoryAxis().axisConfig.isTimeDomain(); - const isHorizontal = this.getCategoryAxis().axisConfig.isHorizontal(); - const isLogScale = this.getValueAxis().axisConfig.isLogScale(); - const isLabels = this.labelOptions.show; - const getGroupedNum = this.getGroupedNum.bind(this); - - let barWidth; - let gutterWidth; - - if (isTimeScale) { - const { min, interval } = this.handler.data.get('ordered'); - let intervalWidth = xScale(min + interval) - xScale(min); - intervalWidth = Math.abs(intervalWidth); - - gutterWidth = intervalWidth * gutterSpacingPercentage; - barWidth = (intervalWidth - gutterWidth) / groupCount; - } - - function x(d, i) { - const groupNum = getGroupedNum(d.seriesId); - if (isTimeScale) { - return ( - xScale(d.x) + - datumWidth(barWidth, d, bars.data()[i + 1], xScale, gutterWidth, groupCount) * groupNum - ); - } - return xScale(d.x) + (xScale.rangeBand() / groupCount) * groupNum; - } - - function y(d) { - if ((isHorizontal && d.y < 0) || (!isHorizontal && d.y > 0)) { - return yScale(0); - } - return yScale(d.y); - } - - function labelX(d, i) { - return x(d, i) + widthFunc(d, i) / 2; - } - - function labelY(d) { - if (isHorizontal) { - return d.y >= 0 ? y(d) - 4 : y(d) + heightFunc(d) + this.getBBox().height; - } - return d.y >= 0 ? y(d) + heightFunc(d) + 4 : y(d) - this.getBBox().width - 4; - } - - function labelDisplay(d, i) { - if (isHorizontal && this.getBBox().width > widthFunc(d, i)) { - return 'none'; - } - if (!isHorizontal && this.getBBox().height > widthFunc(d)) { - return 'none'; - } - return 'block'; - } - function widthFunc(d, i) { - if (isTimeScale) { - return datumWidth(barWidth, d, bars.data()[i + 1], xScale, gutterWidth, groupCount); - } - return xScale.rangeBand() / groupCount; - } - - function heightFunc(d) { - const baseValue = isLogScale ? 1 : 0; - return Math.abs(yScale(baseValue) - yScale(d.y)); - } - - function formatValue(d) { - return chartData.yAxisFormatter(d.y); - } - - // update - bars - .attr('x', isHorizontal ? x : y) - .attr('width', isHorizontal ? widthFunc : heightFunc) - .attr('y', isHorizontal ? y : x) - .attr('height', isHorizontal ? heightFunc : widthFunc); - - const layer = d3.select(bars[0].parentNode); - const barLabels = layer.selectAll('text').data( - chartData.values.filter(function (d) { - return !_.isNull(d.y); - }) - ); - - barLabels.exit().remove(); - - if (isLabels) { - const labelColor = this.handler.data.getColorFunc()(chartData.label); - - barLabels - .enter() - .append('text') - .text(formatValue) - .attr('class', 'visColumnChart__barLabel') - .attr('x', isHorizontal ? labelX : labelY) - .attr('y', isHorizontal ? labelY : labelX) - .attr('dominant-baseline', isHorizontal ? 'auto' : 'central') - .attr('text-anchor', isHorizontal ? 'middle' : 'start') - .attr('fill', labelColor) - - // display must apply last, because labelDisplay decision it based - // on text bounding box which depends on actual applied style. - .attr('display', labelDisplay); - } - return bars; - } - - /** - * Renders d3 visualization - * - * @method draw - * @returns {Function} Creates the vertical bar chart - */ - draw() { - const self = this; - - return function (selection) { - selection.each(function () { - const svg = self.chartEl.append('g'); - svg.data([self.chartData]); - - const bars = self.addBars(svg, self.chartData); - self.addCircleEvents(bars); - - if (self.thresholdLineOptions.show) { - self.addThresholdLine(self.chartEl); - } - - self.events.emit('rendered', { - chart: self.chartData, - }); - - return svg; - }); - }; - } -} diff --git a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/column_chart.test.js b/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/column_chart.test.js deleted file mode 100644 index 8f0db3ab18393..0000000000000 --- a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/column_chart.test.js +++ /dev/null @@ -1,401 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import _ from 'lodash'; -import d3 from 'd3'; -import $ from 'jquery'; -import { - setHTMLElementClientSizes, - setSVGElementGetBBox, - setSVGElementGetComputedTextLength, -} from '@kbn/test/jest'; - -// Data -import series from '../../../fixtures/mock_data/date_histogram/_series'; -import seriesPosNeg from '../../../fixtures/mock_data/date_histogram/_series_pos_neg'; -import seriesNeg from '../../../fixtures/mock_data/date_histogram/_series_neg'; -import termsColumns from '../../../fixtures/mock_data/terms/_columns'; -import histogramRows from '../../../fixtures/mock_data/histogram/_rows'; -import stackedSeries from '../../../fixtures/mock_data/date_histogram/_stacked_series'; - -import { seriesMonthlyInterval } from '../../../fixtures/mock_data/date_histogram/_series_monthly_interval'; -import { rowsSeriesWithHoles } from '../../../fixtures/mock_data/date_histogram/_rows_series_with_holes'; -import rowsWithZeros from '../../../fixtures/mock_data/date_histogram/_rows'; -import { getMockUiState } from '../../../fixtures/mocks'; -import { getVis } from '../_vis_fixture'; - -// tuple, with the format [description, mode, data] -const dataTypesArray = [ - ['series', 'stacked', series], - ['series with positive and negative values', 'stacked', seriesPosNeg], - ['series with negative values', 'stacked', seriesNeg], - ['terms columns', 'grouped', termsColumns], - ['histogram rows', 'percentage', histogramRows], - ['stackedSeries', 'stacked', stackedSeries], -]; - -let mockedHTMLElementClientSizes; -let mockedSVGElementGetBBox; -let mockedSVGElementGetComputedTextLength; - -dataTypesArray.forEach(function (dataType) { - const name = dataType[0]; - const mode = dataType[1]; - const data = dataType[2]; - - describe('Vislib Column Chart Test Suite for ' + name + ' Data', function () { - let vis; - let mockUiState; - const vislibParams = { - type: 'histogram', - addLegend: true, - addTooltip: true, - mode: mode, - zeroFill: true, - grid: { - categoryLines: true, - valueAxis: 'ValueAxis-1', - }, - }; - - beforeAll(() => { - mockedHTMLElementClientSizes = setHTMLElementClientSizes(512, 512); - mockedSVGElementGetBBox = setSVGElementGetBBox(100); - mockedSVGElementGetComputedTextLength = setSVGElementGetComputedTextLength(100); - }); - - beforeEach(() => { - vis = getVis(vislibParams); - mockUiState = getMockUiState(); - vis.on('brush', _.noop); - vis.render(data, mockUiState); - }); - - afterEach(function () { - vis.destroy(); - }); - - afterAll(() => { - mockedHTMLElementClientSizes.mockRestore(); - mockedSVGElementGetBBox.mockRestore(); - mockedSVGElementGetComputedTextLength.mockRestore(); - }); - - describe('stackData method', function () { - let stackedData; - let isStacked; - - beforeEach(function () { - vis.handler.charts.forEach(function (chart) { - stackedData = chart.chartData; - - isStacked = stackedData.series.every(function (arr) { - return arr.values.every(function (d) { - return _.isNumber(d.y0); - }); - }); - }); - }); - - test('should stack values when mode is stacked', function () { - if (mode === 'stacked') { - expect(isStacked).toBe(true); - } - }); - - test('should stack values when mode is percentage', function () { - if (mode === 'percentage') { - expect(isStacked).toBe(true); - } - }); - }); - - describe('addBars method', function () { - test('should append rects', function () { - let numOfSeries; - let numOfValues; - let product; - - vis.handler.charts.forEach(function (chart) { - numOfSeries = chart.chartData.series.length; - numOfValues = chart.chartData.series[0].values.length; - product = numOfSeries * numOfValues; - expect($(chart.chartEl).find('.series rect')).toHaveLength(product); - }); - }); - }); - - describe('addBarEvents method', function () { - function checkChart(chart) { - const rect = $(chart.chartEl).find('.series rect').get(0); - - // check for existence of stuff and things - return { - click: !!rect.__onclick, - mouseOver: !!rect.__onmouseover, - // D3 brushing requires that a g element is appended that - // listens for mousedown events. This g element includes - // listeners, however, I was not able to test for the listener - // function being present. I will need to update this test - // in the future. - brush: !!d3.select('.brush')[0][0], - }; - } - - test('should attach the brush if data is a set is ordered', function () { - vis.handler.charts.forEach(function (chart) { - const has = checkChart(chart); - const ordered = vis.handler.data.get('ordered'); - const allowBrushing = Boolean(ordered); - expect(has.brush).toBe(allowBrushing); - }); - }); - - test('should attach a click event', function () { - vis.handler.charts.forEach(function (chart) { - const has = checkChart(chart); - expect(has.click).toBe(true); - }); - }); - - test('should attach a hover event', function () { - vis.handler.charts.forEach(function (chart) { - const has = checkChart(chart); - expect(has.mouseOver).toBe(true); - }); - }); - }); - - describe('draw method', function () { - test('should return a function', function () { - vis.handler.charts.forEach(function (chart) { - expect(_.isFunction(chart.draw())).toBe(true); - }); - }); - - test('should return a yMin and yMax', function () { - vis.handler.charts.forEach(function (chart) { - const yAxis = chart.handler.valueAxes[0]; - const domain = yAxis.getScale().domain(); - - expect(domain[0]).not.toBe(undefined); - expect(domain[1]).not.toBe(undefined); - }); - }); - - test('should render a zero axis line', function () { - vis.handler.charts.forEach(function (chart) { - const yAxis = chart.handler.valueAxes[0]; - - if (yAxis.yMin < 0 && yAxis.yMax > 0) { - expect($(chart.chartEl).find('line.zero-line').length).toBe(1); - } - }); - }); - }); - - describe('defaultYExtents is true', function () { - beforeEach(function () { - vis.visConfigArgs.defaultYExtents = true; - vis.render(data, mockUiState); - }); - - test('should return yAxis extents equal to data extents', function () { - vis.handler.charts.forEach(function (chart) { - const yAxis = chart.handler.valueAxes[0]; - const min = vis.handler.valueAxes[0].axisScale.getYMin(); - const max = vis.handler.valueAxes[0].axisScale.getYMax(); - const domain = yAxis.getScale().domain(); - expect(domain[0]).toEqual(min); - expect(domain[1]).toEqual(max); - }); - }); - }); - [0, 2, 4, 8].forEach(function (boundsMarginValue) { - describe('defaultYExtents is true and boundsMargin is defined', function () { - beforeEach(function () { - vis.visConfigArgs.defaultYExtents = true; - vis.visConfigArgs.boundsMargin = boundsMarginValue; - vis.render(data, mockUiState); - }); - - test('should return yAxis extents equal to data extents with boundsMargin', function () { - vis.handler.charts.forEach(function (chart) { - const yAxis = chart.handler.valueAxes[0]; - const min = vis.handler.valueAxes[0].axisScale.getYMin(); - const max = vis.handler.valueAxes[0].axisScale.getYMax(); - const domain = yAxis.getScale().domain(); - if (min < 0 && max < 0) { - expect(domain[0]).toEqual(min); - expect(domain[1] - boundsMarginValue).toEqual(max); - } else if (min > 0 && max > 0) { - expect(domain[0] + boundsMarginValue).toEqual(min); - expect(domain[1]).toEqual(max); - } else { - expect(domain[0]).toEqual(min); - expect(domain[1]).toEqual(max); - } - }); - }); - }); - }); - }); -}); - -describe('stackData method - data set with zeros in percentage mode', function () { - let vis; - let mockUiState; - const vislibParams = { - type: 'histogram', - addLegend: true, - addTooltip: true, - mode: 'percentage', - zeroFill: true, - }; - - beforeAll(() => { - mockedHTMLElementClientSizes = setHTMLElementClientSizes(512, 512); - mockedSVGElementGetBBox = setSVGElementGetBBox(100); - mockedSVGElementGetComputedTextLength = setSVGElementGetComputedTextLength(100); - }); - - beforeEach(() => { - vis = getVis(vislibParams); - mockUiState = getMockUiState(); - vis.on('brush', _.noop); - }); - - afterEach(function () { - vis.destroy(); - }); - - afterAll(() => { - mockedHTMLElementClientSizes.mockRestore(); - mockedSVGElementGetBBox.mockRestore(); - mockedSVGElementGetComputedTextLength.mockRestore(); - }); - - test('should not mutate the injected zeros', function () { - vis.render(seriesMonthlyInterval, mockUiState); - - expect(vis.handler.charts).toHaveLength(1); - const chart = vis.handler.charts[0]; - expect(chart.chartData.series).toHaveLength(1); - const series = chart.chartData.series[0].values; - // with the interval set in seriesMonthlyInterval data, the point at x=1454309600000 does not exist - const point = _.find(series, ['x', 1454309600000]); - expect(point).not.toBe(undefined); - expect(point.y).toBe(0); - }); - - test('should not mutate zeros that exist in the data', function () { - vis.render(rowsWithZeros, mockUiState); - - expect(vis.handler.charts).toHaveLength(2); - const chart = vis.handler.charts[0]; - expect(chart.chartData.series).toHaveLength(5); - const series = chart.chartData.series[0].values; - const point = _.find(series, ['x', 1415826240000]); - expect(point).not.toBe(undefined); - expect(point.y).toBe(0); - }); -}); - -describe('datumWidth - split chart data set with holes', function () { - let vis; - let mockUiState; - const vislibParams = { - type: 'histogram', - addLegend: true, - addTooltip: true, - mode: 'stacked', - zeroFill: true, - }; - - beforeAll(() => { - mockedHTMLElementClientSizes = setHTMLElementClientSizes(512, 512); - mockedSVGElementGetBBox = setSVGElementGetBBox(100); - mockedSVGElementGetComputedTextLength = setSVGElementGetComputedTextLength(100); - }); - - beforeEach(() => { - vis = getVis(vislibParams); - mockUiState = getMockUiState(); - vis.on('brush', _.noop); - vis.render(rowsSeriesWithHoles, mockUiState); - }); - - afterEach(function () { - vis.destroy(); - }); - - afterAll(() => { - mockedHTMLElementClientSizes.mockRestore(); - mockedSVGElementGetBBox.mockRestore(); - mockedSVGElementGetComputedTextLength.mockRestore(); - }); - - test('should not have bar widths that span multiple time bins', function () { - expect(vis.handler.charts.length).toEqual(1); - const chart = vis.handler.charts[0]; - const rects = $(chart.chartEl).find('.series rect'); - const MAX_WIDTH_IN_PIXELS = 27; - rects.each(function () { - const width = parseInt($(this).attr('width'), 10); - expect(width).toBeLessThan(MAX_WIDTH_IN_PIXELS); - }); - }); -}); - -describe('datumWidth - monthly interval', function () { - let vis; - let mockUiState; - const vislibParams = { - type: 'histogram', - addLegend: true, - addTooltip: true, - mode: 'stacked', - zeroFill: true, - }; - - let mockWidth; - - beforeAll(() => { - mockedHTMLElementClientSizes = setHTMLElementClientSizes(512, 512); - mockedSVGElementGetBBox = setSVGElementGetBBox(100); - mockedSVGElementGetComputedTextLength = setSVGElementGetComputedTextLength(100); - mockWidth = jest.spyOn($.prototype, 'width').mockReturnValue(900); - }); - - beforeEach(() => { - vis = getVis(vislibParams); - mockUiState = getMockUiState(); - vis.on('brush', _.noop); - vis.render(seriesMonthlyInterval, mockUiState); - }); - - afterEach(function () { - vis.destroy(); - }); - - afterAll(() => { - mockedHTMLElementClientSizes.mockRestore(); - mockedSVGElementGetBBox.mockRestore(); - mockedSVGElementGetComputedTextLength.mockRestore(); - mockWidth.mockRestore(); - }); - - test('should vary bar width when date histogram intervals are not equal', function () { - expect(vis.handler.charts.length).toEqual(1); - const chart = vis.handler.charts[0]; - const rects = $(chart.chartEl).find('.series rect'); - const januaryBarWidth = parseInt($(rects.get(0)).attr('width'), 10); - const februaryBarWidth = parseInt($(rects.get(1)).attr('width'), 10); - expect(februaryBarWidth).toBeLessThan(januaryBarWidth); - }); -}); diff --git a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/line_chart.js b/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/line_chart.js deleted file mode 100644 index 4476574c940bc..0000000000000 --- a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/line_chart.js +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import d3 from 'd3'; -import _ from 'lodash'; -import { PointSeries } from './_point_series'; - -const defaults = { - mode: 'normal', - showCircles: true, - radiusRatio: 9, - showLines: true, - interpolate: 'linear', - lineWidth: 2, - color: undefined, - fillColor: undefined, -}; -/** - * Line Chart Visualization - * - * @class LineChart - * @constructor - * @extends Chart - * @param handler {Object} Reference to the Handler Class Constructor - * @param el {HTMLElement} HTML element to which the chart will be appended - * @param chartData {Object} Elasticsearch query results for this specific chart - */ -export class LineChart extends PointSeries { - constructor(handler, chartEl, chartData, seriesConfigArgs, uiSettings) { - super(handler, chartEl, chartData, seriesConfigArgs, uiSettings); - this.seriesConfig = _.defaults(seriesConfigArgs || {}, defaults); - } - - addCircles(svg, data) { - const self = this; - const showCircles = this.seriesConfig.showCircles; - const color = this.handler.data.getColorFunc(); - const xScale = this.getCategoryAxis().getScale(); - const yScale = this.getValueAxis().getScale(); - const ordered = this.handler.data.get('ordered'); - const tooltip = this.baseChart.tooltip; - const isTooltip = this.handler.visConfig.get('tooltip.show'); - const isHorizontal = this.getCategoryAxis().axisConfig.isHorizontal(); - const lineWidth = this.seriesConfig.lineWidth; - - const radii = this.baseChart.radii; - - const radiusStep = - (radii.max - radii.min || radii.max * 100) / Math.pow(this.seriesConfig.radiusRatio, 2); - - const layer = svg - .append('g') - .attr('class', 'points line') - .attr('clip-path', 'url(#' + this.baseChart.clipPathId + ')'); - - const circles = layer.selectAll('circle').data(function appendData() { - return data.values.filter(function (d) { - return !_.isNull(d.y) && (d.y || !d.y0); - }); - }); - - circles.exit().remove(); - - function cx(d) { - if (ordered && ordered.date) { - return xScale(d.x); - } - return xScale(d.x) + xScale.rangeBand() / 2; - } - - function cy(d) { - const y0 = d.y0 || 0; - const y = d.y || 0; - return yScale(y0 + y); - } - - function cColor() { - return color(data.label); - } - - function colorCircle() { - const parent = d3.select(this).node().parentNode; - const lengthOfParent = d3.select(parent).data()[0].length; - const isVisible = lengthOfParent === 1; - - // If only 1 point exists, show circle - if (!showCircles && !isVisible) return 'none'; - return cColor(); - } - - function getCircleRadiusFn(modifier) { - return function getCircleRadius(d) { - const width = self.baseChart.chartConfig.width; - const height = self.baseChart.chartConfig.height; - const circleRadius = (d.z - radii.min) / radiusStep; - const baseMagicNumber = 2; - - const base = circleRadius - ? Math.sqrt(circleRadius + baseMagicNumber) + lineWidth - : lineWidth; - return _.min([base, width, height]) + (modifier || 0); - }; - } - - circles - .enter() - .append('circle') - .attr('r', getCircleRadiusFn()) - .attr('fill-opacity', this.seriesConfig.drawLinesBetweenPoints ? 1 : 0.7) - .attr('cx', isHorizontal ? cx : cy) - .attr('cy', isHorizontal ? cy : cx) - .attr('class', 'circle-decoration') - .attr('data-label', data.label) - .attr('fill', colorCircle); - - circles - .enter() - .append('circle') - .attr('r', getCircleRadiusFn(10)) - .attr('cx', isHorizontal ? cx : cy) - .attr('cy', isHorizontal ? cy : cx) - .attr('fill', 'transparent') - .attr('class', 'circle') - .attr('data-label', data.label) - .attr('stroke', cColor) - .attr('stroke-width', 0); - - if (isTooltip) { - circles.call(tooltip.render()); - } - - return circles; - } - - /** - * Adds path to SVG - * - * @method addLines - * @param svg {HTMLElement} SVG to which path are appended - * @param data {Array} Array of object data points - * @returns {D3.UpdateSelection} SVG with paths added - */ - addLine(svg, data) { - const xScale = this.getCategoryAxis().getScale(); - const yScale = this.getValueAxis().getScale(); - const color = this.handler.data.getColorFunc(); - const ordered = this.handler.data.get('ordered'); - const lineWidth = this.seriesConfig.lineWidth; - const interpolate = this.seriesConfig.interpolate; - const isHorizontal = this.getCategoryAxis().axisConfig.isHorizontal(); - - const line = svg - .append('g') - .attr('class', 'pathgroup lines') - .attr('clip-path', 'url(#' + this.baseChart.clipPathId + ')'); - - function cx(d) { - if (ordered && ordered.date) { - return xScale(d.x); - } - return xScale(d.x) + xScale.rangeBand() / 2; - } - - function cy(d) { - const y = d.y || 0; - const y0 = d.y0 || 0; - return yScale(y0 + y); - } - - line - .append('path') - .attr('data-label', data.label) - .attr('d', () => { - const d3Line = d3.svg - .line() - .defined(function (d) { - return !_.isNull(d.y); - }) - .interpolate(interpolate) - .x(isHorizontal ? cx : cy) - .y(isHorizontal ? cy : cx); - return d3Line(data.values); - }) - .attr('fill', 'none') - .attr('stroke', () => { - return color(data.label); - }) - .attr('stroke-width', lineWidth); - - return line; - } - - /** - * Renders d3 visualization - * - * @method draw - * @returns {Function} Creates the line chart - */ - draw() { - const self = this; - - return function (selection) { - selection.each(function () { - const svg = self.chartEl.append('g'); - svg.data([self.chartData]); - - if (self.seriesConfig.drawLinesBetweenPoints) { - self.addLine(svg, self.chartData); - } - const circles = self.addCircles(svg, self.chartData); - self.addCircleEvents(circles); - - if (self.thresholdLineOptions.show) { - self.addThresholdLine(self.chartEl); - } - - self.events.emit('rendered', { - chart: self.chartData, - }); - - return svg; - }); - }; - } -} diff --git a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/line_chart.test.js b/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/line_chart.test.js deleted file mode 100644 index f9843f1bc83a9..0000000000000 --- a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/line_chart.test.js +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import d3 from 'd3'; -import $ from 'jquery'; -import _ from 'lodash'; -import { - setHTMLElementClientSizes, - setSVGElementGetBBox, - setSVGElementGetComputedTextLength, -} from '@kbn/test/jest'; - -// Data -import seriesPos from '../../../fixtures/mock_data/date_histogram/_series'; -import seriesPosNeg from '../../../fixtures/mock_data/date_histogram/_series_pos_neg'; -import seriesNeg from '../../../fixtures/mock_data/date_histogram/_series_neg'; -import histogramColumns from '../../../fixtures/mock_data/histogram/_columns'; -import rangeRows from '../../../fixtures/mock_data/range/_rows'; -import termSeries from '../../../fixtures/mock_data/terms/_series'; -import { getMockUiState } from '../../../fixtures/mocks'; -import { getVis } from '../_vis_fixture'; - -const dataTypes = [ - ['series pos', seriesPos], - ['series pos neg', seriesPosNeg], - ['series neg', seriesNeg], - ['histogram columns', histogramColumns], - ['range rows', rangeRows], - ['term series', termSeries], -]; - -let mockedHTMLElementClientSizes; -let mockedSVGElementGetBBox; -let mockedSVGElementGetComputedTextLength; - -describe('Vislib Line Chart', function () { - beforeAll(() => { - mockedHTMLElementClientSizes = setHTMLElementClientSizes(512, 512); - mockedSVGElementGetBBox = setSVGElementGetBBox(100); - mockedSVGElementGetComputedTextLength = setSVGElementGetComputedTextLength(100); - }); - - afterAll(() => { - mockedHTMLElementClientSizes.mockRestore(); - mockedSVGElementGetBBox.mockRestore(); - mockedSVGElementGetComputedTextLength.mockRestore(); - }); - - dataTypes.forEach(function (type) { - const name = type[0]; - const data = type[1]; - - describe(name + ' Data', function () { - let vis; - let mockUiState; - - beforeEach(() => { - const vislibParams = { - type: 'line', - addLegend: true, - addTooltip: true, - drawLinesBetweenPoints: true, - }; - - vis = getVis(vislibParams); - mockUiState = getMockUiState(); - vis.render(data, mockUiState); - vis.on('brush', _.noop); - }); - - afterEach(function () { - vis.destroy(); - }); - - describe('addCircleEvents method', function () { - let circle; - let brush; - let d3selectedCircle; - let onBrush; - let onClick; - let onMouseOver; - - beforeEach(function () { - vis.handler.charts.forEach(function (chart) { - circle = $(chart.chartEl).find('.circle')[0]; - brush = $(chart.chartEl).find('.brush'); - d3selectedCircle = d3.select(circle)[0][0]; - - // d3 instance of click and hover - onBrush = !!brush; - onClick = !!d3selectedCircle.__onclick; - onMouseOver = !!d3selectedCircle.__onmouseover; - }); - }); - - // D3 brushing requires that a g element is appended that - // listens for mousedown events. This g element includes - // listeners, however, I was not able to test for the listener - // function being present. I will need to update this test - // in the future. - test('should attach a brush g element', function () { - vis.handler.charts.forEach(function () { - expect(onBrush).toBe(true); - }); - }); - - test('should attach a click event', function () { - vis.handler.charts.forEach(function () { - expect(onClick).toBe(true); - }); - }); - - test('should attach a hover event', function () { - vis.handler.charts.forEach(function () { - expect(onMouseOver).toBe(true); - }); - }); - }); - - describe('addCircles method', function () { - test('should append circles', function () { - vis.handler.charts.forEach(function (chart) { - expect($(chart.chartEl).find('circle').length).toBeGreaterThan(0); - }); - }); - }); - - describe('addLines method', function () { - test('should append a paths', function () { - vis.handler.charts.forEach(function (chart) { - expect($(chart.chartEl).find('path').length).toBeGreaterThan(0); - }); - }); - }); - - // Cannot seem to get these tests to work on the box - // They however pass in the browsers - //describe('addClipPath method', function () { - // test('should append a clipPath', function () { - // vis.handler.charts.forEach(function (chart) { - // expect($(chart.chartEl).find('clipPath').length).to.be(1); - // }); - // }); - //}); - - describe('draw method', function () { - test('should return a function', function () { - vis.handler.charts.forEach(function (chart) { - expect(chart.draw()).toBeInstanceOf(Function); - }); - }); - - test('should return a yMin and yMax', function () { - vis.handler.charts.forEach(function (chart) { - const yAxis = chart.handler.valueAxes[0]; - const domain = yAxis.getScale().domain(); - expect(domain[0]).not.toBe(undefined); - expect(domain[1]).not.toBe(undefined); - }); - }); - - test('should render a zero axis line', function () { - vis.handler.charts.forEach(function (chart) { - const yAxis = chart.handler.valueAxes[0]; - - if (yAxis.yMin < 0 && yAxis.yMax > 0) { - expect($(chart.chartEl).find('line.zero-line').length).toBe(1); - } - }); - }); - }); - - describe('defaultYExtents is true', function () { - beforeEach(function () { - vis.visConfigArgs.defaultYExtents = true; - vis.render(data, mockUiState); - }); - - test('should return yAxis extents equal to data extents', function () { - vis.handler.charts.forEach(function (chart) { - const yAxis = chart.handler.valueAxes[0]; - const min = vis.handler.valueAxes[0].axisScale.getYMin(); - const max = vis.handler.valueAxes[0].axisScale.getYMax(); - const domain = yAxis.getScale().domain(); - expect(domain[0]).toEqual(min); - expect(domain[1]).toEqual(max); - }); - }); - }); - [0, 2, 4, 8].forEach(function (boundsMarginValue) { - describe('defaultYExtents is true and boundsMargin is defined', function () { - beforeEach(function () { - vis.visConfigArgs.defaultYExtents = true; - vis.visConfigArgs.boundsMargin = boundsMarginValue; - vis.render(data, mockUiState); - }); - - test('should return yAxis extents equal to data extents with boundsMargin', function () { - vis.handler.charts.forEach(function (chart) { - const yAxis = chart.handler.valueAxes[0]; - const min = vis.handler.valueAxes[0].axisScale.getYMin(); - const max = vis.handler.valueAxes[0].axisScale.getYMax(); - const domain = yAxis.getScale().domain(); - if (min < 0 && max < 0) { - expect(domain[0]).toEqual(min); - expect(domain[1] - boundsMarginValue).toEqual(max); - } else if (min > 0 && max > 0) { - expect(domain[0] + boundsMarginValue).toEqual(min); - expect(domain[1]).toEqual(max); - } else { - expect(domain[0]).toEqual(min); - expect(domain[1]).toEqual(max); - } - }); - }); - }); - }); - }); - }); -}); diff --git a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/series_types.js b/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/series_types.js deleted file mode 100644 index 6a87f7e32758a..0000000000000 --- a/src/plugins/vis_types/vislib/public/vislib/visualizations/point_series/series_types.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. - */ - -import { ColumnChart } from './column_chart'; -import { LineChart } from './line_chart'; -import { AreaChart } from './area_chart'; -import { HeatmapChart } from './heatmap_chart'; - -export const seriesTypes = { - histogram: ColumnChart, - line: LineChart, - area: AreaChart, - heatmap: HeatmapChart, -}; diff --git a/src/plugins/vis_types/vislib/server/ui_settings.ts b/src/plugins/vis_types/vislib/server/ui_settings.ts index bd4615e47fb6e..1c7a7cdedc4e0 100644 --- a/src/plugins/vis_types/vislib/server/ui_settings.ts +++ b/src/plugins/vis_types/vislib/server/ui_settings.ts @@ -10,26 +10,9 @@ import { i18n } from '@kbn/i18n'; import { schema } from '@kbn/config-schema'; import { UiSettingsParams } from 'kibana/server'; -import { DIMMING_OPACITY_SETTING, HEATMAP_MAX_BUCKETS_SETTING } from '../common'; +import { HEATMAP_MAX_BUCKETS_SETTING } from '../common'; export const getUiSettings: () => Record = () => ({ - // TODO: move this to vis_type_xy when vislib is removed - // https://github.com/elastic/kibana/issues/56143 - [DIMMING_OPACITY_SETTING]: { - name: i18n.translate('visTypeVislib.advancedSettings.visualization.dimmingOpacityTitle', { - defaultMessage: 'Dimming opacity', - }), - value: 0.5, - type: 'number', - description: i18n.translate('visTypeVislib.advancedSettings.visualization.dimmingOpacityText', { - defaultMessage: - 'The opacity of the chart items that are dimmed when highlighting another element of the chart. ' + - 'The lower this number, the more the highlighted element will stand out. ' + - 'This must be a number between 0 and 1.', - }), - category: ['visualization'], - schema: schema.number(), - }, [HEATMAP_MAX_BUCKETS_SETTING]: { name: i18n.translate('visTypeVislib.advancedSettings.visualization.heatmap.maxBucketsTitle', { defaultMessage: 'Heatmap maximum buckets', diff --git a/src/plugins/vis_types/xy/common/index.ts b/src/plugins/vis_types/xy/common/index.ts index a80946f7c62fa..f17bc8476d9a6 100644 --- a/src/plugins/vis_types/xy/common/index.ts +++ b/src/plugins/vis_types/xy/common/index.ts @@ -19,5 +19,3 @@ export enum ChartType { * Type of xy visualizations */ export type XyVisType = ChartType | 'horizontal_bar'; - -export const LEGACY_CHARTS_LIBRARY = 'visualization:visualize:legacyChartsLibrary'; diff --git a/src/plugins/vis_types/xy/jest.config.js b/src/plugins/vis_types/xy/jest.config.js index 57b041b575e3f..4cdb8f44012c7 100644 --- a/src/plugins/vis_types/xy/jest.config.js +++ b/src/plugins/vis_types/xy/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../../..', roots: ['/src/plugins/vis_types/xy'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/vis_types/xy', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/vis_types/xy/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/vis_types/xy/kibana.json b/src/plugins/vis_types/xy/kibana.json index 1606af5944ad3..1666a346e3482 100644 --- a/src/plugins/vis_types/xy/kibana.json +++ b/src/plugins/vis_types/xy/kibana.json @@ -2,7 +2,7 @@ "id": "visTypeXy", "version": "kibana", "ui": true, - "server": true, + "server": false, "requiredPlugins": ["charts", "data", "expressions", "visualizations", "usageCollection"], "requiredBundles": ["kibanaUtils", "visDefaultEditor"], "extraPublicDirs": ["common/index"], diff --git a/src/plugins/vis_types/xy/public/components/xy_settings.tsx b/src/plugins/vis_types/xy/public/components/xy_settings.tsx index 92b47edccfd92..5e02b65822d6c 100644 --- a/src/plugins/vis_types/xy/public/components/xy_settings.tsx +++ b/src/plugins/vis_types/xy/public/components/xy_settings.tsx @@ -28,7 +28,7 @@ import { import { renderEndzoneTooltip } from '../../../../charts/public'; -import { getThemeService, getUISettings } from '../services'; +import { getThemeService } from '../services'; import { VisConfig } from '../types'; declare global { @@ -101,16 +101,10 @@ export const XYSettings: FC = ({ const themeService = getThemeService(); const theme = themeService.useChartsTheme(); const baseTheme = themeService.useChartsBaseTheme(); - const dimmingOpacity = getUISettings().get('visualization:dimmingOpacity'); const valueLabelsStyling = getValueLabelsStyling(); const themeOverrides: PartialTheme = { markSizeRatio, - sharedStyle: { - unhighlighted: { - opacity: dimmingOpacity, - }, - }, barSeriesStyle: { ...valueLabelsStyling, }, diff --git a/src/plugins/vis_types/xy/public/editor/common_config.tsx b/src/plugins/vis_types/xy/public/editor/common_config.tsx index bd9882a15c124..6c071969f0cd8 100644 --- a/src/plugins/vis_types/xy/public/editor/common_config.tsx +++ b/src/plugins/vis_types/xy/public/editor/common_config.tsx @@ -15,37 +15,23 @@ import type { VisParams } from '../types'; import { MetricsAxisOptions, PointSeriesOptions } from './components/options'; import { ValidationWrapper } from './components/common/validation_wrapper'; -export function getOptionTabs(showElasticChartsOptions = false) { - return [ - { - name: 'advanced', - title: i18n.translate('visTypeXy.area.tabs.metricsAxesTitle', { - defaultMessage: 'Metrics & axes', - }), - editor: (props: VisEditorOptionsProps) => ( - - ), - }, - { - name: 'options', - title: i18n.translate('visTypeXy.area.tabs.panelSettingsTitle', { - defaultMessage: 'Panel settings', - }), - editor: (props: VisEditorOptionsProps) => ( - - ), - }, - ]; -} +export const optionTabs = [ + { + name: 'advanced', + title: i18n.translate('visTypeXy.area.tabs.metricsAxesTitle', { + defaultMessage: 'Metrics & axes', + }), + editor: (props: VisEditorOptionsProps) => ( + + ), + }, + { + name: 'options', + title: i18n.translate('visTypeXy.area.tabs.panelSettingsTitle', { + defaultMessage: 'Panel settings', + }), + editor: (props: VisEditorOptionsProps) => ( + + ), + }, +]; diff --git a/src/plugins/vis_types/xy/public/editor/components/common/validation_wrapper.tsx b/src/plugins/vis_types/xy/public/editor/components/common/validation_wrapper.tsx index 2088878f963ae..4d50dcd20228f 100644 --- a/src/plugins/vis_types/xy/public/editor/components/common/validation_wrapper.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/common/validation_wrapper.tsx @@ -10,24 +10,22 @@ import React, { useEffect, useState, useCallback } from 'react'; import { VisEditorOptionsProps } from '../../../../../../visualizations/public'; -export interface ValidationVisOptionsProps extends VisEditorOptionsProps { +export interface ValidationVisOptionsProps extends VisEditorOptionsProps { setMultipleValidity(paramName: string, isValid: boolean): void; - extraProps?: E; } -interface ValidationWrapperProps extends VisEditorOptionsProps { - component: React.ComponentType>; - extraProps?: E; +interface ValidationWrapperProps extends VisEditorOptionsProps { + component: React.ComponentType>; } interface Item { isValid: boolean; } -function ValidationWrapper({ +function ValidationWrapper({ component: Component, ...rest -}: ValidationWrapperProps) { +}: ValidationWrapperProps) { const [panelState, setPanelState] = useState({} as { [key: string]: Item }); const isPanelValid = Object.values(panelState).every((item) => item.isValid); const { setValidity } = rest; diff --git a/src/plugins/vis_types/xy/public/editor/components/options/index.tsx b/src/plugins/vis_types/xy/public/editor/components/options/index.tsx index a3e20dd22dd5a..4e7d0e6412cb2 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/index.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/index.tsx @@ -14,20 +14,10 @@ import { ValidationVisOptionsProps } from '../common'; const PointSeriesOptionsLazy = lazy(() => import('./point_series')); const MetricsAxisOptionsLazy = lazy(() => import('./metrics_axes')); -export const PointSeriesOptions = ( - props: ValidationVisOptionsProps< - VisParams, - { - showElasticChartsOptions: boolean; - } - > -) => ; +export const PointSeriesOptions = (props: ValidationVisOptionsProps) => ( + +); -export const MetricsAxisOptions = ( - props: ValidationVisOptionsProps< - VisParams, - { - showElasticChartsOptions: boolean; - } - > -) => ; +export const MetricsAxisOptions = (props: ValidationVisOptionsProps) => ( + +); diff --git a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/__snapshots__/index.test.tsx.snap b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/__snapshots__/index.test.tsx.snap index fa049199a55b6..05e2532073eaf 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/__snapshots__/index.test.tsx.snap +++ b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/__snapshots__/index.test.tsx.snap @@ -75,7 +75,6 @@ exports[`MetricsAxisOptions component should init with the default set of props /> @@ -70,6 +72,7 @@ exports[`ValueAxesPanel component should init with the default set of props 1`] @@ -179,6 +182,7 @@ exports[`ValueAxesPanel component should init with the default set of props 1`] ({ describe('MetricsAxisOptions component', () => { let setValue: jest.Mock; - let defaultProps: ValidationVisOptionsProps< - VisParams, - { - showElasticChartsOptions: boolean; - } - >; + let defaultProps: ValidationVisOptionsProps; let axis: ValueAxis; let axisRight: ValueAxis; let chart: SeriesParam; @@ -86,9 +81,6 @@ describe('MetricsAxisOptions component', () => { defaultProps = { aggs: createAggs([aggCount]), isTabSelected: true, - extraProps: { - showElasticChartsOptions: false, - }, vis: { type: { type: ChartType.Area, @@ -244,12 +236,7 @@ describe('MetricsAxisOptions component', () => { const getProps = ( valuePosition1: Position = Position.Right, valuePosition2: Position = Position.Left - ): ValidationVisOptionsProps< - VisParams, - { - showElasticChartsOptions: boolean; - } - > => ({ + ): ValidationVisOptionsProps => ({ ...defaultProps, stateParams: { ...defaultProps.stateParams, @@ -387,12 +374,7 @@ describe('MetricsAxisOptions component', () => { describe('onCategoryAxisPositionChanged', () => { const getProps = ( position: Position = Position.Bottom - ): ValidationVisOptionsProps< - VisParams, - { - showElasticChartsOptions: boolean; - } - > => ({ + ): ValidationVisOptionsProps => ({ ...defaultProps, stateParams: { ...defaultProps.stateParams, diff --git a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/index.tsx b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/index.tsx index 9b4e1c61a201f..c3eb659435b2d 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/index.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/index.tsx @@ -43,17 +43,8 @@ export type ChangeValueAxis = ( const VALUE_AXIS_PREFIX = 'ValueAxis-'; -function MetricsAxisOptions( - props: ValidationVisOptionsProps< - VisParams, - { - // TODO: Remove when vis_type_vislib is removed - // https://github.com/elastic/kibana/issues/56143 - showElasticChartsOptions: boolean; - } - > -) { - const { stateParams, setValue, aggs, vis, isTabSelected, extraProps } = props; +function MetricsAxisOptions(props: ValidationVisOptionsProps) { + const { stateParams, setValue, aggs, vis, isTabSelected } = props; const setParamByIndex: SetParamByIndex = useCallback( (axesName, index, paramName, value) => { @@ -335,7 +326,6 @@ function MetricsAxisOptions( setMultipleValidity={props.setMultipleValidity} seriesParams={stateParams.seriesParams} valueAxes={stateParams.valueAxes} - isNewLibrary={extraProps?.showElasticChartsOptions} /> void; - isNewLibrary?: boolean; } function ValueAxesPanel(props: ValueAxesPanelProps) { @@ -150,7 +149,6 @@ function ValueAxesPanel(props: ValueAxesPanelProps) { onValueAxisPositionChanged={props.onValueAxisPositionChanged} setParamByIndex={props.setParamByIndex} setMultipleValidity={props.setMultipleValidity} - isNewLibrary={props.isNewLibrary ?? false} /> diff --git a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/value_axis_options.tsx b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/value_axis_options.tsx index 751c61f3b1531..aa20eb84222bd 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/value_axis_options.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/value_axis_options.tsx @@ -36,7 +36,6 @@ export interface ValueAxisOptionsParams { setParamByIndex: SetParamByIndex; valueAxis: ValueAxis; setMultipleValidity: (paramName: string, isValid: boolean) => void; - isNewLibrary?: boolean; } export function ValueAxisOptions({ @@ -46,7 +45,6 @@ export function ValueAxisOptions({ onValueAxisPositionChanged, setParamByIndex, setMultipleValidity, - isNewLibrary = false, }: ValueAxisOptionsParams) { const setValueAxis = useCallback( (paramName: T, value: ValueAxis[T]) => @@ -193,7 +191,7 @@ export function ValueAxisOptions({ setMultipleValidity={setMultipleValidity} setValueAxisScale={setValueAxisScale} setValueAxis={setValueAxis} - disableAxisExtents={isNewLibrary && axis.scale.mode === 'percentage'} + disableAxisExtents={axis.scale.mode === 'percentage'} /> diff --git a/src/plugins/vis_types/xy/public/editor/components/options/point_series/grid_panel.tsx b/src/plugins/vis_types/xy/public/editor/components/options/point_series/grid_panel.tsx index 0bf5344ac7f26..c536d2866b8da 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/point_series/grid_panel.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/point_series/grid_panel.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import React, { useMemo, useEffect, useCallback } from 'react'; +import React, { useMemo, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; @@ -16,25 +16,15 @@ import { SelectOption, SwitchOption } from '../../../../../../../vis_default_edi import { VisParams, ValueAxis } from '../../../../types'; import { ValidationVisOptionsProps } from '../../common'; -type GridPanelOptions = ValidationVisOptionsProps< - VisParams, - { - showElasticChartsOptions: boolean; - } ->; +type GridPanelOptions = ValidationVisOptionsProps; -function GridPanel({ stateParams, setValue, hasHistogramAgg, extraProps }: GridPanelOptions) { +function GridPanel({ stateParams, setValue }: GridPanelOptions) { const setGrid = useCallback( (paramName: T, value: VisParams['grid'][T]) => setValue('grid', { ...stateParams.grid, [paramName]: value }), [stateParams.grid, setValue] ); - const disableCategoryGridLines = useMemo( - () => !extraProps?.showElasticChartsOptions && hasHistogramAgg, - [extraProps?.showElasticChartsOptions, hasHistogramAgg] - ); - const options = useMemo( () => [ ...stateParams.valueAxes.map(({ id, name }: ValueAxis) => ({ @@ -51,12 +41,6 @@ function GridPanel({ stateParams, setValue, hasHistogramAgg, extraProps }: GridP [stateParams.valueAxes] ); - useEffect(() => { - if (disableCategoryGridLines) { - setGrid('categoryLines', false); - } - }, [disableCategoryGridLines, setGrid]); - return ( @@ -71,18 +55,10 @@ function GridPanel({ stateParams, setValue, hasHistogramAgg, extraProps }: GridP { + it('renders the detailedTooltip option', async () => { component = mountWithIntl(); - await act(async () => { - expect(findTestSubject(component, 'detailedTooltip').length).toBe(0); - }); - }); - - it('renders the editor options that are specific for the es charts implementation if showElasticChartsOptions is true', async () => { - const newVisProps = ({ - ...props, - extraProps: { - showElasticChartsOptions: true, - }, - } as unknown) as PointSeriesOptionsProps; - component = mountWithIntl(); await act(async () => { expect(findTestSubject(component, 'detailedTooltip').length).toBe(1); }); }); - it('not renders the long legend options if showElasticChartsOptions is false', async () => { + it('renders the long legend options', async () => { component = mountWithIntl(); - await act(async () => { - expect(findTestSubject(component, 'xyLongLegendsOptions').length).toBe(0); - }); - }); - - it('renders the long legend options if showElasticChartsOptions is true', async () => { - const newVisProps = ({ - ...props, - extraProps: { - showElasticChartsOptions: true, - }, - } as unknown) as PointSeriesOptionsProps; - component = mountWithIntl(); await act(async () => { expect(findTestSubject(component, 'xyLongLegendsOptions').length).toBe(1); }); }); it('not renders the fitting function for a bar chart', async () => { - const newVisProps = ({ - ...props, - extraProps: { - showElasticChartsOptions: true, - }, - } as unknown) as PointSeriesOptionsProps; - component = mountWithIntl(); + component = mountWithIntl(); await act(async () => { expect(findTestSubject(component, 'fittingFunction').length).toBe(0); }); @@ -142,9 +107,6 @@ describe('PointSeries Editor', function () { const newVisProps = ({ ...props, stateParams: getStateParams(ChartType.Line, false), - extraProps: { - showElasticChartsOptions: true, - }, } as unknown) as PointSeriesOptionsProps; component = mountWithIntl(); await act(async () => { @@ -153,13 +115,7 @@ describe('PointSeries Editor', function () { }); it('renders the showCategoryLines switch', async () => { - const newVisProps = ({ - ...props, - extraProps: { - showElasticChartsOptions: true, - }, - } as unknown) as PointSeriesOptionsProps; - component = mountWithIntl(); + component = mountWithIntl(); await act(async () => { expect(findTestSubject(component, 'showValuesOnChart').length).toBe(1); }); diff --git a/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.tsx b/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.tsx index da7bdfb0d7986..62dbd94c516d7 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.tsx @@ -28,16 +28,7 @@ import { getPositions } from '../../../collections'; const legendPositions = getPositions(); -export function PointSeriesOptions( - props: ValidationVisOptionsProps< - VisParams, - { - // TODO: Remove when vis_type_vislib is removed - // https://github.com/elastic/kibana/issues/56143 - showElasticChartsOptions: boolean; - } - > -) { +export function PointSeriesOptions(props: ValidationVisOptionsProps) { const { stateParams, setValue, vis, aggs } = props; const hasBarChart = useMemo( () => @@ -62,14 +53,12 @@ export function PointSeriesOptions( - {props.extraProps?.showElasticChartsOptions && ( - - )} + {vis.data.aggs!.aggs.some( (agg) => agg.schema === 'segment' && agg.type.name === BUCKET_TYPES.DATE_HISTOGRAM @@ -109,7 +98,7 @@ export function PointSeriesOptions( /> )} - {props.extraProps?.showElasticChartsOptions && } + diff --git a/src/plugins/vis_types/xy/public/index.ts b/src/plugins/vis_types/xy/public/index.ts index 0953183fa1093..1ee96fab35253 100644 --- a/src/plugins/vis_types/xy/public/index.ts +++ b/src/plugins/vis_types/xy/public/index.ts @@ -30,7 +30,6 @@ export type { ValidationVisOptionsProps } from './editor/components/common/valid export { TruncateLabelsOption } from './editor/components/common/truncate_labels'; export { getPositions } from './editor/positions'; export { getScaleTypes } from './editor/scale_types'; -export { xyVisTypes } from './vis_types'; export { getAggId } from './config/get_agg_id'; // Export common types diff --git a/src/plugins/vis_types/xy/public/plugin.ts b/src/plugins/vis_types/xy/public/plugin.ts index 57736444f49fe..600e78b5b3949 100644 --- a/src/plugins/vis_types/xy/public/plugin.ts +++ b/src/plugins/vis_types/xy/public/plugin.ts @@ -24,7 +24,6 @@ import { } from './services'; import { visTypesDefinitions } from './vis_types'; -import { LEGACY_CHARTS_LIBRARY } from '../common/'; import { xyVisRenderer } from './vis_renderer'; import * as expressionFunctions from './expression_functions'; @@ -65,23 +64,21 @@ export class VisTypeXyPlugin core: VisTypeXyCoreSetup, { expressions, visualizations, charts, usageCollection }: VisTypeXyPluginSetupDependencies ) { - if (!core.uiSettings.get(LEGACY_CHARTS_LIBRARY, false)) { - setUISettings(core.uiSettings); - setThemeService(charts.theme); - setPalettesService(charts.palettes); + setUISettings(core.uiSettings); + setThemeService(charts.theme); + setPalettesService(charts.palettes); - expressions.registerRenderer(xyVisRenderer); - expressions.registerFunction(expressionFunctions.visTypeXyVisFn); - expressions.registerFunction(expressionFunctions.categoryAxis); - expressions.registerFunction(expressionFunctions.timeMarker); - expressions.registerFunction(expressionFunctions.valueAxis); - expressions.registerFunction(expressionFunctions.seriesParam); - expressions.registerFunction(expressionFunctions.thresholdLine); - expressions.registerFunction(expressionFunctions.label); - expressions.registerFunction(expressionFunctions.visScale); + expressions.registerRenderer(xyVisRenderer); + expressions.registerFunction(expressionFunctions.visTypeXyVisFn); + expressions.registerFunction(expressionFunctions.categoryAxis); + expressions.registerFunction(expressionFunctions.timeMarker); + expressions.registerFunction(expressionFunctions.valueAxis); + expressions.registerFunction(expressionFunctions.seriesParam); + expressions.registerFunction(expressionFunctions.thresholdLine); + expressions.registerFunction(expressionFunctions.label); + expressions.registerFunction(expressionFunctions.visScale); - visTypesDefinitions.forEach(visualizations.createBaseVisualization); - } + visTypesDefinitions.forEach(visualizations.createBaseVisualization); setTrackUiMetric(usageCollection?.reportUiCounter.bind(usageCollection, 'vis_type_xy')); diff --git a/src/plugins/vis_types/xy/public/utils/accessors.tsx b/src/plugins/vis_types/xy/public/utils/accessors.tsx index 0356e921a9d5c..748430e3b16a6 100644 --- a/src/plugins/vis_types/xy/public/utils/accessors.tsx +++ b/src/plugins/vis_types/xy/public/utils/accessors.tsx @@ -13,6 +13,7 @@ import { Aspect } from '../types'; export const COMPLEX_X_ACCESSOR = '__customXAccessor__'; export const COMPLEX_SPLIT_ACCESSOR = '__complexSplitAccessor__'; +const SHARD_DELAY = 'shard_delay'; export const getXAccessor = (aspect: Aspect): Accessor | AccessorFn => { return ( @@ -39,7 +40,7 @@ export const getComplexAccessor = (fieldName: string, isComplex: boolean = false aspect: Aspect, index?: number ): Accessor | AccessorFn | undefined => { - if (!aspect.accessor) { + if (!aspect.accessor || aspect.aggType === SHARD_DELAY) { return; } diff --git a/src/plugins/vis_types/xy/public/vis_types/area.ts b/src/plugins/vis_types/xy/public/vis_types/area.ts index b377fd54753da..6ba197ceb9424 100644 --- a/src/plugins/vis_types/xy/public/vis_types/area.ts +++ b/src/plugins/vis_types/xy/public/vis_types/area.ts @@ -22,15 +22,12 @@ import { AxisMode, ThresholdLineStyle, InterpolationMode, - XyVisTypeDefinition, } from '../types'; import { toExpressionAst } from '../to_ast'; import { ChartType } from '../../common'; -import { getOptionTabs } from '../editor/common_config'; +import { optionTabs } from '../editor/common_config'; -export const getAreaVisTypeDefinition = ( - showElasticChartsOptions = false -): XyVisTypeDefinition => ({ +export const areaVisTypeDefinition = { name: 'area', title: i18n.translate('visTypeXy.area.areaTitle', { defaultMessage: 'Area' }), icon: 'visArea', @@ -128,7 +125,7 @@ export const getAreaVisTypeDefinition = ( }, }, editorConfig: { - optionTabs: getOptionTabs(showElasticChartsOptions), + optionTabs, schemas: [ { group: AggGroupNames.Metrics, @@ -183,4 +180,4 @@ export const getAreaVisTypeDefinition = ( ], }, requiresSearch: true, -}); +}; diff --git a/src/plugins/vis_types/xy/public/vis_types/histogram.ts b/src/plugins/vis_types/xy/public/vis_types/histogram.ts index 2d22b7566175c..bd549615fe7fd 100644 --- a/src/plugins/vis_types/xy/public/vis_types/histogram.ts +++ b/src/plugins/vis_types/xy/public/vis_types/histogram.ts @@ -20,17 +20,14 @@ import { ScaleType, AxisMode, ThresholdLineStyle, - XyVisTypeDefinition, InterpolationMode, } from '../types'; import { toExpressionAst } from '../to_ast'; import { ChartType } from '../../common'; -import { getOptionTabs } from '../editor/common_config'; +import { optionTabs } from '../editor/common_config'; import { defaultCountLabel, LabelRotation } from '../../../../charts/public'; -export const getHistogramVisTypeDefinition = ( - showElasticChartsOptions = false -): XyVisTypeDefinition => ({ +export const histogramVisTypeDefinition = { name: 'histogram', title: i18n.translate('visTypeXy.histogram.histogramTitle', { defaultMessage: 'Vertical bar', @@ -131,7 +128,7 @@ export const getHistogramVisTypeDefinition = ( }, }, editorConfig: { - optionTabs: getOptionTabs(showElasticChartsOptions), + optionTabs, schemas: [ { group: AggGroupNames.Metrics, @@ -186,4 +183,4 @@ export const getHistogramVisTypeDefinition = ( ], }, requiresSearch: true, -}); +}; diff --git a/src/plugins/vis_types/xy/public/vis_types/horizontal_bar.ts b/src/plugins/vis_types/xy/public/vis_types/horizontal_bar.ts index 8916f3f94f6ff..5bd45fc2eb7a8 100644 --- a/src/plugins/vis_types/xy/public/vis_types/horizontal_bar.ts +++ b/src/plugins/vis_types/xy/public/vis_types/horizontal_bar.ts @@ -20,17 +20,14 @@ import { ScaleType, AxisMode, ThresholdLineStyle, - XyVisTypeDefinition, InterpolationMode, } from '../types'; import { toExpressionAst } from '../to_ast'; import { ChartType } from '../../common'; -import { getOptionTabs } from '../editor/common_config'; +import { optionTabs } from '../editor/common_config'; import { defaultCountLabel, LabelRotation } from '../../../../charts/public'; -export const getHorizontalBarVisTypeDefinition = ( - showElasticChartsOptions = false -): XyVisTypeDefinition => ({ +export const horizontalBarVisTypeDefinition = { name: 'horizontal_bar', title: i18n.translate('visTypeXy.horizontalBar.horizontalBarTitle', { defaultMessage: 'Horizontal bar', @@ -130,7 +127,7 @@ export const getHorizontalBarVisTypeDefinition = ( }, }, editorConfig: { - optionTabs: getOptionTabs(showElasticChartsOptions), + optionTabs, schemas: [ { group: AggGroupNames.Metrics, @@ -185,4 +182,4 @@ export const getHorizontalBarVisTypeDefinition = ( ], }, requiresSearch: true, -}); +}; diff --git a/src/plugins/vis_types/xy/public/vis_types/index.ts b/src/plugins/vis_types/xy/public/vis_types/index.ts index a8dae74eb110c..93c973b5316c9 100644 --- a/src/plugins/vis_types/xy/public/vis_types/index.ts +++ b/src/plugins/vis_types/xy/public/vis_types/index.ts @@ -6,27 +6,14 @@ * Side Public License, v 1. */ -import { getAreaVisTypeDefinition } from './area'; -import { getLineVisTypeDefinition } from './line'; -import { getHistogramVisTypeDefinition } from './histogram'; -import { getHorizontalBarVisTypeDefinition } from './horizontal_bar'; -import { XyVisTypeDefinition } from '../types'; +import { areaVisTypeDefinition } from './area'; +import { lineVisTypeDefinition } from './line'; +import { histogramVisTypeDefinition } from './histogram'; +import { horizontalBarVisTypeDefinition } from './horizontal_bar'; export const visTypesDefinitions = [ - getAreaVisTypeDefinition(true), - getLineVisTypeDefinition(true), - getHistogramVisTypeDefinition(true), - getHorizontalBarVisTypeDefinition(true), + areaVisTypeDefinition, + lineVisTypeDefinition, + histogramVisTypeDefinition, + horizontalBarVisTypeDefinition, ]; - -// TODO: Remove when vis_type_vislib is removed -// https://github.com/elastic/kibana/issues/56143 -export const xyVisTypes: Record< - string, - (showElasticChartsOptions?: boolean) => XyVisTypeDefinition -> = { - area: getAreaVisTypeDefinition, - line: getLineVisTypeDefinition, - histogram: getHistogramVisTypeDefinition, - horizontalBar: getHorizontalBarVisTypeDefinition, -}; diff --git a/src/plugins/vis_types/xy/public/vis_types/line.ts b/src/plugins/vis_types/xy/public/vis_types/line.ts index af75c38d627df..747de1679c7c5 100644 --- a/src/plugins/vis_types/xy/public/vis_types/line.ts +++ b/src/plugins/vis_types/xy/public/vis_types/line.ts @@ -22,15 +22,12 @@ import { AxisMode, ThresholdLineStyle, InterpolationMode, - XyVisTypeDefinition, } from '../types'; import { toExpressionAst } from '../to_ast'; import { ChartType } from '../../common'; -import { getOptionTabs } from '../editor/common_config'; +import { optionTabs } from '../editor/common_config'; -export const getLineVisTypeDefinition = ( - showElasticChartsOptions = false -): XyVisTypeDefinition => ({ +export const lineVisTypeDefinition = { name: 'line', title: i18n.translate('visTypeXy.line.lineTitle', { defaultMessage: 'Line' }), icon: 'visLine', @@ -128,7 +125,7 @@ export const getLineVisTypeDefinition = ( }, }, editorConfig: { - optionTabs: getOptionTabs(showElasticChartsOptions), + optionTabs, schemas: [ { group: AggGroupNames.Metrics, @@ -177,4 +174,4 @@ export const getLineVisTypeDefinition = ( ], }, requiresSearch: true, -}); +}; diff --git a/src/plugins/vis_types/xy/server/index.ts b/src/plugins/vis_types/xy/server/index.ts deleted file mode 100644 index a27ac49c0ea49..0000000000000 --- a/src/plugins/vis_types/xy/server/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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -import { VisTypeXyServerPlugin } from './plugin'; - -export const plugin = () => new VisTypeXyServerPlugin(); diff --git a/src/plugins/vis_types/xy/server/plugin.ts b/src/plugins/vis_types/xy/server/plugin.ts deleted file mode 100644 index 46d6531204c24..0000000000000 --- a/src/plugins/vis_types/xy/server/plugin.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { i18n } from '@kbn/i18n'; -import { schema } from '@kbn/config-schema'; - -import { CoreSetup, Plugin, UiSettingsParams } from 'kibana/server'; - -import { LEGACY_CHARTS_LIBRARY } from '../common'; - -export const getUiSettingsConfig: () => Record> = () => ({ - // TODO: Remove this when vis_type_vislib is removed - // https://github.com/elastic/kibana/issues/56143 - [LEGACY_CHARTS_LIBRARY]: { - name: i18n.translate('visTypeXy.advancedSettings.visualization.legacyChartsLibrary.name', { - defaultMessage: 'XY axis legacy charts library', - }), - requiresPageReload: true, - value: false, - description: i18n.translate( - 'visTypeXy.advancedSettings.visualization.legacyChartsLibrary.description', - { - defaultMessage: 'Enables legacy charts library for area, line and bar charts in visualize.', - } - ), - deprecation: { - message: i18n.translate( - 'visTypeXy.advancedSettings.visualization.legacyChartsLibrary.deprecation', - { - defaultMessage: - 'The legacy charts library for area, line and bar charts in visualize is deprecated and will not be supported as of 7.16.', - } - ), - docLinksKey: 'visualizationSettings', - }, - category: ['visualization'], - schema: schema.boolean(), - }, -}); - -export class VisTypeXyServerPlugin implements Plugin { - public setup(core: CoreSetup) { - core.uiSettings.register(getUiSettingsConfig()); - - return {}; - } - - public start() { - return {}; - } -} diff --git a/src/plugins/visualizations/common/expression_functions/vis_dimension.test.ts b/src/plugins/visualizations/common/expression_functions/vis_dimension.test.ts new file mode 100644 index 0000000000000..249c796afeac3 --- /dev/null +++ b/src/plugins/visualizations/common/expression_functions/vis_dimension.test.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Arguments, visDimension } from './vis_dimension'; +import { functionWrapper } from '../../../expressions/common/expression_functions/specs/tests/utils'; +import { Datatable } from '../../../expressions/common'; +import moment from 'moment'; + +describe('interpreter/functions#vis_dimension', () => { + const fn = functionWrapper(visDimension()); + const column1 = 'username'; + const column2 = '@timestamp'; + + const input: Datatable = { + type: 'datatable', + columns: [ + { id: column1, name: column1, meta: { type: 'string' } }, + { id: column2, name: column2, meta: { type: 'date' } }, + ], + rows: [ + { [column1]: 'user1', [column2]: moment().toISOString() }, + { [column1]: 'user2', [column2]: moment().toISOString() }, + ], + }; + + it('should return vis_dimension accessor in number format when type of the passed accessor is number', () => { + const accessor = 0; + const args: Arguments = { accessor }; + + const result = fn(input, args); + expect(result).toHaveProperty('type', 'vis_dimension'); + expect(result).toHaveProperty('accessor', accessor); + expect(result).toHaveProperty('format'); + expect(result.format).toBeDefined(); + expect(typeof result.format === 'object').toBeTruthy(); + }); + + it('should return vis_dimension accessor in DatatableColumn format when type of the passed accessor is string', () => { + const accessor = column2; + const args: Arguments = { accessor }; + const searchingObject = input.columns.filter(({ id }) => id === accessor)[0]; + + const result = fn(input, args); + expect(result).toHaveProperty('type', 'vis_dimension'); + expect(result).toHaveProperty('accessor'); + expect(result.accessor).toMatchObject(searchingObject); + expect(result).toHaveProperty('format'); + expect(result.format).toBeDefined(); + expect(typeof result.format === 'object').toBeTruthy(); + }); + + it('should throw error when the passed number accessor is out of columns array boundary', () => { + const accessor = input.columns.length; + const args: Arguments = { accessor }; + + expect(() => fn(input, args)).toThrowError('Column name or index provided is invalid'); + }); + + it("should throw error when the passed column doesn't exist in columns", () => { + const accessor = column1 + '_modified'; + const args: Arguments = { accessor }; + + expect(() => fn(input, args)).toThrowError('Column name or index provided is invalid'); + }); +}); diff --git a/src/plugins/visualizations/common/expression_functions/vis_dimension.ts b/src/plugins/visualizations/common/expression_functions/vis_dimension.ts index 6886fa94f878e..60d3fc78ac553 100644 --- a/src/plugins/visualizations/common/expression_functions/vis_dimension.ts +++ b/src/plugins/visualizations/common/expression_functions/vis_dimension.ts @@ -14,7 +14,7 @@ import { DatatableColumn, } from '../../../expressions/common'; -interface Arguments { +export interface Arguments { accessor: string | number; format?: string; formatParams?: string; @@ -31,6 +31,12 @@ export type ExpressionValueVisDimension = ExpressionValueBoxed< } >; +const getAccessorByIndex = (accessor: number, columns: Datatable['columns']) => + columns.length > accessor ? accessor : undefined; + +const getAccessorById = (accessor: DatatableColumn['id'], columns: Datatable['columns']) => + columns.find((c) => c.id === accessor); + export const visDimension = (): ExpressionFunctionDefinition< 'visdimension', Datatable, @@ -69,13 +75,13 @@ export const visDimension = (): ExpressionFunctionDefinition< fn: (input, args) => { const accessor = typeof args.accessor === 'number' - ? args.accessor - : input.columns.find((c) => c.id === args.accessor); + ? getAccessorByIndex(args.accessor, input.columns) + : getAccessorById(args.accessor, input.columns); if (accessor === undefined) { throw new Error( i18n.translate('visualizations.function.visDimension.error.accessor', { - defaultMessage: 'Column name provided is invalid', + defaultMessage: 'Column name or index provided is invalid', }) ); } diff --git a/src/plugins/visualizations/common/prepare_log_table.test.ts b/src/plugins/visualizations/common/prepare_log_table.test.ts index dc02adbd458ee..7176ba46c40ec 100644 --- a/src/plugins/visualizations/common/prepare_log_table.test.ts +++ b/src/plugins/visualizations/common/prepare_log_table.test.ts @@ -19,13 +19,14 @@ describe('prepareLogTable', () => { meta: {}, }, { + id: 'd3', meta: {}, }, ], }; const logTable = prepareLogTable(datatable as any, [ [[{ accessor: 0 } as any], 'dimension1'], - [[{ accessor: 2 } as any], 'dimension3'], + [[{ accessor: { id: 'd3' } } as any], 'dimension3'], [[{ accessor: 1 } as any], 'dimension2'], ]); expect(logTable).toMatchInlineSnapshot( @@ -42,6 +43,7 @@ describe('prepareLogTable', () => { }, }, { + id: 'd3', meta: { dimensionName: 'dimension3', }, @@ -62,6 +64,7 @@ describe('prepareLogTable', () => { }, }, Object { + "id": "d3", "meta": Object { "dimensionName": "dimension3", }, diff --git a/src/plugins/visualizations/common/prepare_log_table.ts b/src/plugins/visualizations/common/prepare_log_table.ts index 0018a18ce7f10..b3f74c8611af5 100644 --- a/src/plugins/visualizations/common/prepare_log_table.ts +++ b/src/plugins/visualizations/common/prepare_log_table.ts @@ -8,16 +8,31 @@ import { ExpressionValueVisDimension } from './expression_functions/vis_dimension'; import { ExpressionValueXYDimension } from './expression_functions/xy_dimension'; -import { Datatable } from '../../expressions/common/expression_types/specs'; +import { Datatable, DatatableColumn } from '../../expressions/common/expression_types/specs'; export type Dimension = [ Array | undefined, string ]; -const getDimensionName = (columnIndex: number, dimensions: Dimension[]) => { +const isColumnEqualToAccessor = ( + column: DatatableColumn, + columnIndex: number, + accessor: ExpressionValueVisDimension['accessor'] | ExpressionValueXYDimension['accessor'] +) => { + if (typeof accessor === 'number') { + return accessor === columnIndex; + } + return accessor.id === column.id; +}; + +const getDimensionName = ( + column: DatatableColumn, + columnIndex: number, + dimensions: Dimension[] +) => { for (const dimension of dimensions) { - if (dimension[0]?.find((d) => d.accessor === columnIndex)) { + if (dimension[0]?.find((d) => isColumnEqualToAccessor(column, columnIndex, d.accessor))) { return dimension[1]; } } @@ -31,7 +46,7 @@ export const prepareLogTable = (datatable: Datatable, dimensions: Dimension[]) = ...column, meta: { ...column.meta, - dimensionName: getDimensionName(columnIndex, dimensions), + dimensionName: getDimensionName(column, columnIndex, dimensions), }, }; }), diff --git a/src/plugins/visualizations/common/types.ts b/src/plugins/visualizations/common/types.ts index 0bdae26f01f93..187e55566c9d9 100644 --- a/src/plugins/visualizations/common/types.ts +++ b/src/plugins/visualizations/common/types.ts @@ -7,18 +7,20 @@ */ import { SavedObjectAttributes } from 'kibana/server'; -import { AggConfigOptions } from 'src/plugins/data/common'; +import type { SerializableRecord } from '@kbn/utility-types'; +import { AggConfigSerialized } from 'src/plugins/data/common'; export interface VisParams { [key: string]: any; } -export interface SavedVisState { +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions +export type SavedVisState = { title: string; type: string; params: TVisParams; - aggs: AggConfigOptions[]; -} + aggs: AggConfigSerialized[]; +}; export interface VisualizationSavedObjectAttributes extends SavedObjectAttributes { description: string; diff --git a/src/plugins/visualizations/jest.config.js b/src/plugins/visualizations/jest.config.js index 250bdc44e4de5..450e30a1de24d 100644 --- a/src/plugins/visualizations/jest.config.js +++ b/src/plugins/visualizations/jest.config.js @@ -10,4 +10,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/visualizations'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/visualizations', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/visualizations/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts b/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts index b71542a8beeea..637334067b513 100644 --- a/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts +++ b/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts @@ -340,14 +340,6 @@ export class VisualizeEmbeddable data: { timeFieldName: this.vis.data.indexPattern?.timeFieldName!, ...event.data }, }; } - // do not trigger the filter click event if the filter bar is not visible - if ( - triggerId === VIS_EVENT_TO_TRIGGER.filter && - !this.input.id && - !this.vis.type.options.showFilterBar - ) { - return; - } getUiActions().getTrigger(triggerId).exec(context); } @@ -402,6 +394,7 @@ export class VisualizeEmbeddable searchSessionId: this.input.searchSessionId, syncColors: this.input.syncColors, uiState: this.vis.uiState, + interactive: !this.input.disableTriggers, inspectorAdapters: this.inspectorAdapters, executionContext: context, }; diff --git a/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/saved_visualization_references.test.ts b/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/saved_visualization_references.test.ts index 867febd2544b0..9c832414e7f00 100644 --- a/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/saved_visualization_references.test.ts +++ b/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references/saved_visualization_references.test.ts @@ -115,7 +115,7 @@ describe('injectReferences', () => { }); test('injects references into context', () => { - const context = { + const context = ({ id: '1', title: 'test', savedSearchRefName: 'search_0', @@ -133,7 +133,7 @@ describe('injectReferences', () => { ], }, } as unknown) as SavedVisState, - } as VisSavedObject; + } as unknown) as VisSavedObject; const references = [ { name: 'search_0', @@ -182,7 +182,7 @@ describe('injectReferences', () => { }); test(`fails when it can't find the index pattern reference in the array`, () => { - const context = { + const context = ({ id: '1', title: 'test', visState: ({ @@ -196,7 +196,7 @@ describe('injectReferences', () => { ], }, } as unknown) as SavedVisState, - } as VisSavedObject; + } as unknown) as VisSavedObject; expect(() => injectReferences(context, [])).toThrowErrorMatchingInlineSnapshot( `"Could not find index pattern reference \\"control_0_index_pattern\\""` ); diff --git a/src/plugins/visualizations/public/types.ts b/src/plugins/visualizations/public/types.ts index c6eceb86b3450..d68599c0724f6 100644 --- a/src/plugins/visualizations/public/types.ts +++ b/src/plugins/visualizations/public/types.ts @@ -8,10 +8,10 @@ import { SavedObject } from '../../../plugins/saved_objects/public'; import { - AggConfigOptions, IAggConfigs, SearchSourceFields, TimefilterContract, + AggConfigSerialized, } from '../../../plugins/data/public'; import { ExpressionAstExpression } from '../../expressions/public'; @@ -24,7 +24,7 @@ export interface SavedVisState { title: string; type: string; params: VisParams; - aggs: AggConfigOptions[]; + aggs: AggConfigSerialized[]; } export interface ISavedVis { diff --git a/src/plugins/visualizations/public/vis.ts b/src/plugins/visualizations/public/vis.ts index ff4e8a3794e0d..dfab4ecfc3cd8 100644 --- a/src/plugins/visualizations/public/vis.ts +++ b/src/plugins/visualizations/public/vis.ts @@ -26,7 +26,7 @@ import { IAggConfigs, IndexPattern, ISearchSource, - AggConfigOptions, + AggConfigSerialized, SearchSourceFields, } from '../../../plugins/data/public'; import { BaseVisType } from './vis_types'; @@ -34,7 +34,7 @@ import { VisParams } from '../common/types'; export interface SerializedVisData { expression?: string; - aggs: AggConfigOptions[]; + aggs: AggConfigSerialized[]; searchSource: SearchSourceFields; savedSearchId?: string; } @@ -194,7 +194,7 @@ export class Vis { } } - private initializeDefaultsFromSchemas(configStates: AggConfigOptions[], schemas: any) { + private initializeDefaultsFromSchemas(configStates: AggConfigSerialized[], schemas: any) { // Set the defaults for any schema which has them. If the defaults // for some reason has more then the max only set the max number // of defaults (not sure why a someone define more... diff --git a/src/plugins/visualize/common/constants.ts b/src/plugins/visualize/common/constants.ts index 5fe8ed7e095a2..10a4498193e3d 100644 --- a/src/plugins/visualize/common/constants.ts +++ b/src/plugins/visualize/common/constants.ts @@ -8,3 +8,16 @@ export const STATE_STORAGE_KEY = '_a'; export const GLOBAL_STATE_STORAGE_KEY = '_g'; + +export const APP_NAME = 'visualize'; + +export const VisualizeConstants = { + VISUALIZE_BASE_PATH: '/app/visualize', + LANDING_PAGE_PATH: '/', + WIZARD_STEP_1_PAGE_PATH: '/new', + WIZARD_STEP_2_PAGE_PATH: '/new/configure', + CREATE_PATH: '/create', + EDIT_PATH: '/edit', + EDIT_BY_VALUE_PATH: '/edit_by_value', + APP_ID: 'visualize', +}; diff --git a/src/plugins/visualize/common/locator.test.ts b/src/plugins/visualize/common/locator.test.ts new file mode 100644 index 0000000000000..c08c6a910327e --- /dev/null +++ b/src/plugins/visualize/common/locator.test.ts @@ -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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { VisualizeLocatorDefinition } from './locator'; +import { FilterStateStore } from '../../data/common'; + +describe('visualize locator', () => { + let definition: VisualizeLocatorDefinition; + + beforeEach(() => { + definition = new VisualizeLocatorDefinition(); + }); + + it('returns a location for "create" path', async () => { + const location = await definition.getLocation({}); + + expect(location.app).toMatchInlineSnapshot(`"visualize"`); + expect(location.path).toMatchInlineSnapshot(`"#/create?_g=()&_a=()"`); + expect(location.state).toMatchInlineSnapshot(`Object {}`); + }); + + it('returns a location for "edit" path', async () => { + const location = await definition.getLocation({ + visId: 'test', + vis: { + title: 'test', + type: 'test', + aggs: [], + params: {}, + }, + }); + + expect(location.app).toMatchInlineSnapshot(`"visualize"`); + expect(location.path).toMatchInlineSnapshot( + `"#/edit/test?_g=()&_a=(vis:(aggs:!(),params:(),title:test,type:test))&type=test"` + ); + expect(location.state).toMatchInlineSnapshot(`Object {}`); + }); + + it('creates a location with query, filters (global and app), refresh interval and time range', async () => { + const location = await definition.getLocation({ + visId: '123', + vis: { + title: 'test', + type: 'test', + aggs: [], + params: {}, + }, + timeRange: { to: 'now', from: 'now-15m', mode: 'relative' }, + refreshInterval: { pause: false, value: 300 }, + filters: [ + { + meta: { + alias: null, + disabled: false, + negate: false, + }, + query: { query: 'hi' }, + }, + { + meta: { + alias: null, + disabled: false, + negate: false, + }, + query: { query: 'hi' }, + $state: { + store: FilterStateStore.GLOBAL_STATE, + }, + }, + ], + query: { query: 'bye', language: 'kuery' }, + }); + + expect(location.app).toMatchInlineSnapshot(`"visualize"`); + + expect(location.path.match(/filters:/g)?.length).toBe(2); + expect(location.path.match(/refreshInterval:/g)?.length).toBe(1); + expect(location.path.match(/time:/g)?.length).toBe(1); + expect(location.path).toMatchInlineSnapshot( + `"#/edit/123?_g=(filters:!(('$state':(store:globalState),meta:(alias:!n,disabled:!f,negate:!f),query:(query:hi))),refreshInterval:(pause:!f,value:300),time:(from:now-15m,mode:relative,to:now))&_a=(filters:!((meta:(alias:!n,disabled:!f,negate:!f),query:(query:hi))),query:(language:kuery,query:bye),vis:(aggs:!(),params:(),title:test,type:test))&type=test"` + ); + + expect(location.state).toMatchInlineSnapshot(`Object {}`); + }); + + it('creates a location with all values provided', async () => { + const indexPattern = 'indexPatternTest'; + const savedSearchId = 'savedSearchIdTest'; + const location = await definition.getLocation({ + visId: '123', + vis: { + title: 'test', + type: 'test', + aggs: [], + params: {}, + }, + timeRange: { to: 'now', from: 'now-15m', mode: 'relative' }, + refreshInterval: { pause: false, value: 300 }, + filters: [ + { + meta: { + alias: null, + disabled: false, + negate: false, + }, + query: { query: 'hi' }, + }, + ], + query: { query: 'bye', language: 'kuery' }, + linked: true, + uiState: { + fakeUIState: 'fakeUIState', + this: 'value contains a spaces that should be encoded', + }, + indexPattern, + savedSearchId, + }); + + expect(location.app).toMatchInlineSnapshot(`"visualize"`); + expect(location.path).toContain(indexPattern); + expect(location.path).toContain(savedSearchId); + expect(location.path).toMatchInlineSnapshot( + `"#/edit/123?_g=(filters:!(),refreshInterval:(pause:!f,value:300),time:(from:now-15m,mode:relative,to:now))&_a=(filters:!((meta:(alias:!n,disabled:!f,negate:!f),query:(query:hi))),linked:!t,query:(language:kuery,query:bye),uiState:(fakeUIState:fakeUIState,this:'value%20contains%20a%20spaces%20that%20should%20be%20encoded'),vis:(aggs:!(),params:(),title:test,type:test))&indexPattern=indexPatternTest&savedSearchId=savedSearchIdTest&type=test"` + ); + expect(location.state).toMatchInlineSnapshot(`Object {}`); + }); +}); diff --git a/src/plugins/visualize/common/locator.ts b/src/plugins/visualize/common/locator.ts new file mode 100644 index 0000000000000..23fde918780f2 --- /dev/null +++ b/src/plugins/visualize/common/locator.ts @@ -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 and the Server Side Public License, v 1; you may not 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, Serializable } from '@kbn/utility-types'; +import { omitBy } from 'lodash'; +import type { ParsedQuery } from 'query-string'; +import { stringify } from 'query-string'; +import rison from 'rison-node'; +import type { Filter, Query, RefreshInterval, TimeRange } from 'src/plugins/data/common'; +import type { LocatorDefinition, LocatorPublic } from 'src/plugins/share/common'; +import { isFilterPinned } from '../../data/common'; +import { url } from '../../kibana_utils/common'; +import { GLOBAL_STATE_STORAGE_KEY, STATE_STORAGE_KEY, VisualizeConstants } from './constants'; +import { PureVisState } from './types'; + +const removeEmptyKeys = (o: Record): Record => + omitBy(o, (v) => v == null); + +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions +export type VisualizeLocatorParams = { + /** + * The ID of the saved visualization to load. + */ + visId?: string; + + /** + * Global- and app-level filters to apply to data loaded by visualize. + */ + filters?: Filter[]; + + /** + * Time range to apply to data loaded by visualize. + */ + timeRange?: TimeRange; + + /** + * How frequently to poll for data. + */ + refreshInterval?: RefreshInterval; + + /** + * The query to use in to load data in visualize. + */ + query?: Query; + + /** + * UI state to be passed on to the current visualization. This value is opaque from the perspective of visualize. + */ + uiState?: SerializableRecord; + + /** + * Serialized visualization. + * + * @note This is required to navigate to "create" page (i.e., when no `visId` has been provided). + */ + vis?: PureVisState; + + /** + * Whether this visualization is linked a saved search. + */ + linked?: boolean; + + /** + * The saved search used as the source of the visualization. + */ + savedSearchId?: string; + + /** + * The saved search used as the source of the visualization. + */ + indexPattern?: string; +}; + +export type VisualizeAppLocator = LocatorPublic; + +export const VISUALIZE_APP_LOCATOR = 'VISUALIZE_APP_LOCATOR'; + +export class VisualizeLocatorDefinition implements LocatorDefinition { + id = VISUALIZE_APP_LOCATOR; + + public async getLocation({ + visId, + timeRange, + filters, + refreshInterval, + linked, + uiState, + query, + vis, + savedSearchId, + indexPattern, + }: VisualizeLocatorParams) { + let path = visId + ? `#${VisualizeConstants.EDIT_PATH}/${visId}` + : `#${VisualizeConstants.CREATE_PATH}`; + + const urlState: ParsedQuery = { + [GLOBAL_STATE_STORAGE_KEY]: rison.encode( + removeEmptyKeys({ + time: timeRange, + filters: filters?.filter((f) => isFilterPinned(f)), + refreshInterval, + }) + ), + [STATE_STORAGE_KEY]: rison.encode( + removeEmptyKeys({ + linked, + filters: filters?.filter((f) => !isFilterPinned(f)), + uiState, + query, + vis, + }) + ), + }; + + path += `?${stringify(url.encodeQuery(urlState), { encode: false, sort: false })}`; + + const otherParams = stringify({ type: vis?.type, savedSearchId, indexPattern }); + + if (otherParams) path += `&${otherParams}`; + + return { + app: VisualizeConstants.APP_ID, + path, + state: {}, + }; + } +} diff --git a/src/plugins/visualize/common/types.ts b/src/plugins/visualize/common/types.ts new file mode 100644 index 0000000000000..189c44ba15cc8 --- /dev/null +++ b/src/plugins/visualize/common/types.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not 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 { SavedVisState } from 'src/plugins/visualizations/common/types'; + +export type PureVisState = SavedVisState; diff --git a/src/plugins/visualize/jest.config.js b/src/plugins/visualize/jest.config.js index 22a9ffa161253..11ea368f57d25 100644 --- a/src/plugins/visualize/jest.config.js +++ b/src/plugins/visualize/jest.config.js @@ -10,4 +10,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/src/plugins/visualize'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/visualize', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/src/plugins/visualize/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/visualize/public/application/components/deprecation_vis_warning.tsx b/src/plugins/visualize/public/application/components/deprecation_vis_warning.tsx deleted file mode 100644 index 6389f52996926..0000000000000 --- a/src/plugins/visualize/public/application/components/deprecation_vis_warning.tsx +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 { FormattedMessage } from '@kbn/i18n/react'; -import { EuiCallOut, EuiLink } from '@elastic/eui'; -import { useKibana } from '../../../../kibana_react/public'; -import { VisualizeServices } from '../types'; - -export const LEGACY_CHARTS_LIBRARY = 'visualization:visualize:legacyChartsLibrary'; - -export const DeprecationWarning = () => { - const { services } = useKibana(); - const canEditAdvancedSettings = services.application.capabilities.advancedSettings.save; - const advancedSettingsLink = services.application.getUrlForApp('management', { - path: `/kibana/settings?query=${LEGACY_CHARTS_LIBRARY}`, - }); - - return ( - - {canEditAdvancedSettings && ( - - - - ), - }} - /> - )} - {!canEditAdvancedSettings && ( - - )} - - ), - }} - /> - } - iconType="alert" - color="warning" - size="s" - /> - ); -}; diff --git a/src/plugins/visualize/public/application/components/visualize_editor_common.tsx b/src/plugins/visualize/public/application/components/visualize_editor_common.tsx index 22f635460c353..a03073e61f59c 100644 --- a/src/plugins/visualize/public/application/components/visualize_editor_common.tsx +++ b/src/plugins/visualize/public/application/components/visualize_editor_common.tsx @@ -13,14 +13,12 @@ import { EuiScreenReaderOnly } from '@elastic/eui'; import { AppMountParameters } from 'kibana/public'; import { VisualizeTopNav } from './visualize_top_nav'; import { ExperimentalVisInfo } from './experimental_vis_info'; -import { DeprecationWarning, LEGACY_CHARTS_LIBRARY } from './deprecation_vis_warning'; import { SavedVisInstance, VisualizeAppState, VisualizeAppStateContainer, VisualizeEditorVisInstance, } from '../types'; -import { getUISettings } from '../../services'; interface VisualizeEditorCommonProps { visInstance?: VisualizeEditorVisInstance; @@ -39,13 +37,6 @@ interface VisualizeEditorCommonProps { embeddableId?: string; } -const isXYAxis = (visType: string | undefined): boolean => { - if (!visType) { - return false; - } - return ['area', 'line', 'histogram', 'horizontal_bar', 'point_series'].includes(visType); -}; - export const VisualizeEditorCommon = ({ visInstance, appState, @@ -62,7 +53,6 @@ export const VisualizeEditorCommon = ({ embeddableId, visEditorRef, }: VisualizeEditorCommonProps) => { - const hasXYLegacyChartsEnabled = getUISettings().get(LEGACY_CHARTS_LIBRARY); return (
{visInstance && appState && currentAppState && ( @@ -83,9 +73,6 @@ export const VisualizeEditorCommon = ({ /> )} {visInstance?.vis?.type?.stage === 'experimental' && } - {/* Adds a deprecation warning for vislib xy axis charts */} - {/* Should be removed when this issue is closed https://github.com/elastic/kibana/issues/103209 */} - {isXYAxis(visInstance?.vis.type.name) && hasXYLegacyChartsEnabled && } {visInstance?.vis?.type?.getInfoMessage?.(visInstance.vis)} {visInstance && ( diff --git a/src/plugins/visualize/public/application/types.ts b/src/plugins/visualize/public/application/types.ts index f850aedc33366..7e9f69163f5a6 100644 --- a/src/plugins/visualize/public/application/types.ts +++ b/src/plugins/visualize/public/application/types.ts @@ -9,6 +9,8 @@ import type { EventEmitter } from 'events'; import type { History } from 'history'; +import type { SerializableRecord } from '@kbn/utility-types'; + import type { CoreStart, PluginInitializerContext, @@ -19,7 +21,6 @@ import type { } from 'kibana/public'; import type { - SavedVisState, VisualizationsStart, Vis, VisualizeEmbeddableContract, @@ -45,11 +46,11 @@ import type { DashboardStart } from '../../../dashboard/public'; import type { SavedObjectsTaggingApi } from '../../../saved_objects_tagging_oss/public'; import type { UsageCollectionStart } from '../../../usage_collection/public'; -export type PureVisState = SavedVisState; +import { PureVisState } from '../../common/types'; export interface VisualizeAppState { filters: Filter[]; - uiState: Record; + uiState: SerializableRecord; vis: PureVisState; query: Query; savedQuery?: string; @@ -103,6 +104,7 @@ export interface VisualizeServices extends CoreStart { savedObjectsTagging?: SavedObjectsTaggingApi; presentationUtil: PresentationUtilPluginStart; usageCollection?: UsageCollectionStart; + getKibanaVersion: () => string; } export interface SavedVisInstance { @@ -146,3 +148,5 @@ export interface EditorRenderProps { */ linked: boolean; } + +export { PureVisState }; diff --git a/src/plugins/visualize/public/application/utils/create_visualize_app_state.ts b/src/plugins/visualize/public/application/utils/create_visualize_app_state.ts index e288996fa6f3d..10c573090da34 100644 --- a/src/plugins/visualize/public/application/utils/create_visualize_app_state.ts +++ b/src/plugins/visualize/public/application/utils/create_visualize_app_state.ts @@ -63,7 +63,6 @@ const pureTransitions = { function createVisualizeByValueAppState(stateDefaults: VisualizeAppState) { const initialState = migrateAppState({ ...stateDefaults, - ...stateDefaults, }); const stateContainer = createStateContainer( initialState, diff --git a/src/plugins/visualize/public/application/utils/get_top_nav_config.tsx b/src/plugins/visualize/public/application/utils/get_top_nav_config.tsx index ed361bbdb104d..a4421d9535c71 100644 --- a/src/plugins/visualize/public/application/utils/get_top_nav_config.tsx +++ b/src/plugins/visualize/public/application/utils/get_top_nav_config.tsx @@ -7,8 +7,10 @@ */ import React from 'react'; +import moment from 'moment'; import { i18n } from '@kbn/i18n'; import { METRIC_TYPE } from '@kbn/analytics'; +import { parse } from 'query-string'; import { Capabilities } from 'src/core/public'; import { TopNavMenuData } from 'src/plugins/navigation/public'; @@ -33,6 +35,7 @@ import { import { APP_NAME, VisualizeConstants } from '../visualize_constants'; import { getEditBreadcrumbs } from './breadcrumbs'; import { EmbeddableStateTransfer } from '../../../../embeddable/public'; +import { VISUALIZE_APP_LOCATOR, VisualizeLocatorParams } from '../../../common/locator'; interface VisualizeCapabilities { createShortUrl: boolean; @@ -95,6 +98,7 @@ export const getTopNavConfig = ( savedObjectsTagging, presentationUtil, usageCollection, + getKibanaVersion, }: VisualizeServices ) => { const { vis, embeddableHandler } = visInstance; @@ -279,6 +283,22 @@ export const getTopNavConfig = ( testId: 'shareTopNavButton', run: (anchorElement) => { if (share && !embeddableId) { + const currentState = stateContainer.getState(); + const searchParams = parse(history.location.search); + const params: VisualizeLocatorParams = { + visId: savedVis?.id, + filters: currentState.filters, + refreshInterval: undefined, + timeRange: data.query.timefilter.timefilter.getTime(), + uiState: currentState.uiState, + query: currentState.query, + vis: currentState.vis, + linked: currentState.linked, + indexPattern: + visInstance.savedSearch?.searchSource?.getField('index')?.id ?? + (searchParams.indexPattern as string), + savedSearchId: visInstance.savedSearch?.id ?? (searchParams.savedSearchId as string), + }; // TODO: support sharing in by-value mode share.toggleShareContextMenu({ anchorElement, @@ -288,7 +308,17 @@ export const getTopNavConfig = ( objectId: savedVis?.id, objectType: 'visualization', sharingData: { - title: savedVis?.title, + title: + savedVis?.title || + i18n.translate('visualize.reporting.defaultReportTitle', { + defaultMessage: 'Visualization [{date}]', + values: { date: moment().toISOString(true) }, + }), + locatorParams: { + id: VISUALIZE_APP_LOCATOR, + version: getKibanaVersion(), + params, + }, }, isDirty: hasUnappliedChanges || hasUnsavedChanges, showPublicUrlSwitch, diff --git a/src/plugins/visualize/public/application/utils/stubs.ts b/src/plugins/visualize/public/application/utils/stubs.ts index 41a017306dc0a..086811df02baa 100644 --- a/src/plugins/visualize/public/application/utils/stubs.ts +++ b/src/plugins/visualize/public/application/utils/stubs.ts @@ -27,7 +27,6 @@ export const visualizeAppStateStub: VisualizeAppState = { { id: '1', enabled: true, - // @ts-expect-error type: 'avg', schema: 'metric', params: { field: 'total_quantity', customLabel: 'average items' }, diff --git a/src/plugins/visualize/public/application/utils/use/use_visualize_app_state.test.ts b/src/plugins/visualize/public/application/utils/use/use_visualize_app_state.test.ts index b101a3c2feae9..26f866d22ce4e 100644 --- a/src/plugins/visualize/public/application/utils/use/use_visualize_app_state.test.ts +++ b/src/plugins/visualize/public/application/utils/use/use_visualize_app_state.test.ts @@ -157,7 +157,6 @@ describe('useVisualizeAppState', () => { }; it('should successfully update vis state and set up app state container', async () => { - // @ts-expect-error stateContainerGetStateMock.mockImplementation(() => state); const { result, waitForNextUpdate } = renderHook(() => useVisualizeAppState(mockServices, eventEmitter, savedVisInstance) @@ -204,7 +203,6 @@ describe('useVisualizeAppState', () => { it(`should add warning toast and redirect to the landing page if setting new vis state was not successful, e.x. invalid query params`, async () => { - // @ts-expect-error stateContainerGetStateMock.mockImplementation(() => state); // @ts-expect-error savedVisInstance.vis.setState.mockRejectedValue({ diff --git a/src/plugins/visualize/public/application/visualize_constants.ts b/src/plugins/visualize/public/application/visualize_constants.ts index 6e901882a9365..19327ac940e9d 100644 --- a/src/plugins/visualize/public/application/visualize_constants.ts +++ b/src/plugins/visualize/public/application/visualize_constants.ts @@ -6,15 +6,4 @@ * Side Public License, v 1. */ -export const APP_NAME = 'visualize'; - -export const VisualizeConstants = { - VISUALIZE_BASE_PATH: '/app/visualize', - LANDING_PAGE_PATH: '/', - WIZARD_STEP_1_PAGE_PATH: '/new', - WIZARD_STEP_2_PAGE_PATH: '/new/configure', - CREATE_PATH: '/create', - EDIT_PATH: '/edit', - EDIT_BY_VALUE_PATH: '/edit_by_value', - APP_ID: 'visualize', -}; +export { VisualizeConstants, APP_NAME } from '../../common/constants'; diff --git a/src/plugins/visualize/public/plugin.ts b/src/plugins/visualize/public/plugin.ts index 00c3545034b32..d71e7fd81f1d9 100644 --- a/src/plugins/visualize/public/plugin.ts +++ b/src/plugins/visualize/public/plugin.ts @@ -47,6 +47,7 @@ import type { UsageCollectionStart } from '../../usage_collection/public'; import { setVisEditorsRegistry, setUISettings, setUsageCollector } from './services'; import { createVisEditorsRegistry, VisEditorsRegistry } from './vis_editors_registry'; +import { VisualizeLocatorDefinition } from '../common/locator'; export interface VisualizePluginStartDependencies { data: DataPublicPluginStart; @@ -92,7 +93,7 @@ export class VisualizePlugin public setup( core: CoreSetup, - { home, urlForwarding, data }: VisualizePluginSetupDependencies + { home, urlForwarding, data, share }: VisualizePluginSetupDependencies ) { const { appMounted, @@ -209,6 +210,7 @@ export class VisualizePlugin savedObjectsTagging: pluginsStart.savedObjectsTaggingOss?.getTaggingApi(), presentationUtil: pluginsStart.presentationUtil, usageCollection: pluginsStart.usageCollection, + getKibanaVersion: () => this.initializerContext.env.packageInfo.version, }; params.element.classList.add('visAppWrapper'); @@ -241,6 +243,10 @@ export class VisualizePlugin }); } + if (share) { + share.url.locators.create(new VisualizeLocatorDefinition()); + } + return { visEditorsRegistry: this.visEditorsRegistry, } as VisualizePluginSetup; diff --git a/src/plugins/visualize/tsconfig.json b/src/plugins/visualize/tsconfig.json index 4dcf43dadf8ba..3f1f7487085bf 100644 --- a/src/plugins/visualize/tsconfig.json +++ b/src/plugins/visualize/tsconfig.json @@ -6,11 +6,7 @@ "declaration": true, "declarationMap": true }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*" - ], + "include": ["common/**/*", "public/**/*", "server/**/*", "../../../typings/**/*"], "references": [ { "path": "../../core/tsconfig.json" }, { "path": "../data/tsconfig.json" }, @@ -28,6 +24,6 @@ { "path": "../kibana_react/tsconfig.json" }, { "path": "../home/tsconfig.json" }, { "path": "../presentation_util/tsconfig.json" }, - { "path": "../discover/tsconfig.json" }, + { "path": "../discover/tsconfig.json" } ] } diff --git a/tasks/config/peg.js b/tasks/config/peg.js index 0c299ae5748dd..906767d6db285 100644 --- a/tasks/config/peg.js +++ b/tasks/config/peg.js @@ -6,9 +6,4 @@ * Side Public License, v 1. */ -module.exports = { - timelion_chain: { - src: 'src/plugins/vis_type_timelion/common/chain.peg', - dest: 'src/plugins/vis_type_timelion/common/_generated_/chain.js', - }, -}; +module.exports = {}; diff --git a/test/api_integration/apis/index_patterns/es_errors/errors.js b/test/api_integration/apis/index_patterns/es_errors/errors.js index 1a48b391ae87d..ac656e487323d 100644 --- a/test/api_integration/apis/index_patterns/es_errors/errors.js +++ b/test/api_integration/apis/index_patterns/es_errors/errors.js @@ -15,7 +15,7 @@ import { createNoMatchingIndicesError, isNoMatchingIndicesError, convertEsError, -} from '../../../../../src/plugins/data/server/index_patterns/fetcher/lib/errors'; +} from '../../../../../src/plugins/data/server/data_views/fetcher/lib/errors'; import { getIndexNotFoundError, getDocNotFoundError } from './lib'; diff --git a/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/pattern.js b/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/pattern.js index 8d72cbd2fb37f..da04e7c9f4b75 100644 --- a/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/pattern.js +++ b/test/api_integration/apis/index_patterns/fields_for_time_pattern_route/pattern.js @@ -38,6 +38,7 @@ export default function ({ getService }) { aggregatable: true, searchable: true, readFromDocValues: true, + metadata_field: false, }, { name: 'Jan01', @@ -46,6 +47,7 @@ export default function ({ getService }) { aggregatable: true, searchable: true, readFromDocValues: true, + metadata_field: false, }, { name: 'Jan02', @@ -54,6 +56,7 @@ export default function ({ getService }) { aggregatable: true, searchable: true, readFromDocValues: true, + metadata_field: false, }, ], }); @@ -77,6 +80,7 @@ export default function ({ getService }) { aggregatable: true, searchable: true, readFromDocValues: true, + metadata_field: false, }, { name: 'Jan02', @@ -85,6 +89,7 @@ export default function ({ getService }) { aggregatable: true, searchable: true, readFromDocValues: true, + metadata_field: false, }, ], }); @@ -109,6 +114,7 @@ export default function ({ getService }) { aggregatable: true, searchable: true, readFromDocValues: true, + metadata_field: false, }, { name: 'Jan02', @@ -117,6 +123,7 @@ export default function ({ getService }) { aggregatable: true, searchable: true, readFromDocValues: true, + metadata_field: false, }, { name: 'meta1', @@ -124,6 +131,7 @@ export default function ({ getService }) { aggregatable: false, searchable: false, readFromDocValues: false, + metadata_field: true, }, { name: 'meta2', @@ -131,6 +139,7 @@ export default function ({ getService }) { aggregatable: false, searchable: false, readFromDocValues: false, + metadata_field: true, }, ], }); diff --git a/test/api_integration/apis/index_patterns/fields_for_wildcard_route/conflicts.js b/test/api_integration/apis/index_patterns/fields_for_wildcard_route/conflicts.js index f050e2a0626d3..2e7cc4a76340e 100644 --- a/test/api_integration/apis/index_patterns/fields_for_wildcard_route/conflicts.js +++ b/test/api_integration/apis/index_patterns/fields_for_wildcard_route/conflicts.js @@ -35,6 +35,7 @@ export default function ({ getService }) { aggregatable: true, searchable: true, readFromDocValues: true, + metadata_field: false, }, { name: 'number_conflict', @@ -43,6 +44,7 @@ export default function ({ getService }) { aggregatable: true, searchable: true, readFromDocValues: true, + metadata_field: false, }, { name: 'string_conflict', @@ -51,6 +53,7 @@ export default function ({ getService }) { aggregatable: true, searchable: true, readFromDocValues: false, + metadata_field: false, }, { name: 'success', @@ -63,6 +66,7 @@ export default function ({ getService }) { boolean: ['logs-2017.01.02'], keyword: ['logs-2017.01.01'], }, + metadata_field: false, }, ], }); diff --git a/test/api_integration/apis/index_patterns/fields_for_wildcard_route/response.js b/test/api_integration/apis/index_patterns/fields_for_wildcard_route/response.js index 913db9aee9c0f..07603be1de9ac 100644 --- a/test/api_integration/apis/index_patterns/fields_for_wildcard_route/response.js +++ b/test/api_integration/apis/index_patterns/fields_for_wildcard_route/response.js @@ -25,6 +25,7 @@ export default function ({ getService }) { aggregatable: true, name: 'bar', readFromDocValues: true, + metadata_field: false, }, { type: 'string', @@ -33,6 +34,7 @@ export default function ({ getService }) { aggregatable: false, name: 'baz', readFromDocValues: false, + metadata_field: false, }, { type: 'string', @@ -42,6 +44,7 @@ export default function ({ getService }) { name: 'baz.keyword', readFromDocValues: true, subType: { multi: { parent: 'baz' } }, + metadata_field: false, }, { type: 'number', @@ -50,6 +53,7 @@ export default function ({ getService }) { aggregatable: true, name: 'foo', readFromDocValues: true, + metadata_field: false, }, { aggregatable: true, @@ -63,6 +67,7 @@ export default function ({ getService }) { }, }, type: 'string', + metadata_field: false, }, ]; @@ -84,8 +89,7 @@ export default function ({ getService }) { .then(ensureFieldsAreSorted); }); - // https://github.com/elastic/kibana/issues/79813 - it.skip('always returns a field for all passed meta fields', async () => { + it('always returns a field for all passed meta fields', async () => { await supertest .get('/api/index_patterns/_fields_for_wildcard') .query({ @@ -95,12 +99,13 @@ export default function ({ getService }) { .expect(200, { fields: [ { - aggregatable: true, + aggregatable: false, name: '_id', esTypes: ['_id'], readFromDocValues: false, searchable: true, type: 'string', + metadata_field: true, }, { aggregatable: false, @@ -109,6 +114,7 @@ export default function ({ getService }) { readFromDocValues: false, searchable: false, type: '_source', + metadata_field: true, }, { type: 'boolean', @@ -117,6 +123,7 @@ export default function ({ getService }) { aggregatable: true, name: 'bar', readFromDocValues: true, + metadata_field: false, }, { aggregatable: false, @@ -125,6 +132,7 @@ export default function ({ getService }) { readFromDocValues: false, searchable: true, type: 'string', + metadata_field: false, }, { type: 'string', @@ -134,6 +142,7 @@ export default function ({ getService }) { name: 'baz.keyword', readFromDocValues: true, subType: { multi: { parent: 'baz' } }, + metadata_field: false, }, { aggregatable: false, @@ -141,6 +150,7 @@ export default function ({ getService }) { readFromDocValues: false, searchable: false, type: 'string', + metadata_field: true, }, { type: 'number', @@ -149,6 +159,7 @@ export default function ({ getService }) { aggregatable: true, name: 'foo', readFromDocValues: true, + metadata_field: false, }, { aggregatable: true, @@ -162,6 +173,7 @@ export default function ({ getService }) { }, }, type: 'string', + metadata_field: false, }, ], }) diff --git a/test/api_integration/apis/saved_objects/delete_unknown_types.ts b/test/api_integration/apis/saved_objects/delete_unknown_types.ts new file mode 100644 index 0000000000000..42caa753683e1 --- /dev/null +++ b/test/api_integration/apis/saved_objects/delete_unknown_types.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../ftr_provider_context'; + +const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + +export default function ({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + const esArchiver = getService('esArchiver'); + const es = getService('es'); + + describe('/deprecations/_delete_unknown_types', () => { + before(async () => { + await esArchiver.emptyKibanaIndex(); + await esArchiver.load( + 'test/api_integration/fixtures/es_archiver/saved_objects/delete_unknown_types' + ); + }); + + after(async () => { + await esArchiver.unload( + 'test/api_integration/fixtures/es_archiver/saved_objects/delete_unknown_types' + ); + }); + + const fetchIndexContent = async () => { + const { body } = await es.search<{ type: string }>({ + index: '.kibana', + body: { + size: 100, + }, + }); + return body.hits.hits + .map((hit) => ({ + type: hit._source!.type, + id: hit._id, + })) + .sort((a, b) => { + return a.id > b.id ? 1 : -1; + }); + }; + + it('should return 200 with individual responses', async () => { + const beforeDelete = await fetchIndexContent(); + expect(beforeDelete).to.eql([ + { + id: 'dashboard:b70c7ae0-3224-11e8-a572-ffca06da1357', + type: 'dashboard', + }, + { + id: 'index-pattern:8963ca30-3224-11e8-a572-ffca06da1357', + type: 'index-pattern', + }, + { + id: 'search:960372e0-3224-11e8-a572-ffca06da1357', + type: 'search', + }, + { + id: 'space:default', + type: 'space', + }, + { + id: 'unknown-shareable-doc', + type: 'unknown-shareable-type', + }, + { + id: 'unknown-type:unknown-doc', + type: 'unknown-type', + }, + { + id: 'visualization:a42c0580-3224-11e8-a572-ffca06da1357', + type: 'visualization', + }, + ]); + + await supertest + .post(`/internal/saved_objects/deprecations/_delete_unknown_types`) + .send({}) + .expect(200) + .then((resp) => { + expect(resp.body).to.eql({ success: true }); + }); + + for (let i = 0; i < 10; i++) { + const afterDelete = await fetchIndexContent(); + // we're deleting with `wait_for_completion: false` and we don't surface + // the task ID in the API, so we're forced to use pooling for the FTR tests + if (afterDelete.map((obj) => obj.type).includes('unknown-type') && i < 10) { + await delay(1000); + continue; + } + expect(afterDelete).to.eql([ + { + id: 'dashboard:b70c7ae0-3224-11e8-a572-ffca06da1357', + type: 'dashboard', + }, + { + id: 'index-pattern:8963ca30-3224-11e8-a572-ffca06da1357', + type: 'index-pattern', + }, + { + id: 'search:960372e0-3224-11e8-a572-ffca06da1357', + type: 'search', + }, + { + id: 'space:default', + type: 'space', + }, + { + id: 'visualization:a42c0580-3224-11e8-a572-ffca06da1357', + type: 'visualization', + }, + ]); + break; + } + }); + }); +} diff --git a/test/api_integration/apis/saved_objects/index.ts b/test/api_integration/apis/saved_objects/index.ts index 2af1df01c0f92..12189bce302b8 100644 --- a/test/api_integration/apis/saved_objects/index.ts +++ b/test/api_integration/apis/saved_objects/index.ts @@ -23,5 +23,6 @@ export default function ({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./resolve')); loadTestFile(require.resolve('./resolve_import_errors')); loadTestFile(require.resolve('./update')); + loadTestFile(require.resolve('./delete_unknown_types')); }); } diff --git a/test/api_integration/apis/status/status.js b/test/api_integration/apis/status/status.js index 22076b2cddbc5..e1545c448fce8 100644 --- a/test/api_integration/apis/status/status.js +++ b/test/api_integration/apis/status/status.js @@ -25,9 +25,10 @@ export default function ({ getService }) { expect(body.version.build_number).to.be.a('number'); expect(body.status.overall).to.be.an('object'); - expect(body.status.overall.state).to.be('green'); + expect(body.status.overall.level).to.be('available'); - expect(body.status.statuses).to.be.an('array'); + expect(body.status.core).to.be.an('object'); + expect(body.status.plugins).to.be.an('object'); expect(body.metrics.collection_interval_in_millis).to.be.a('number'); diff --git a/test/api_integration/fixtures/es_archiver/management/saved_objects/scroll_count/mappings.json b/test/api_integration/fixtures/es_archiver/management/saved_objects/scroll_count/mappings.json index f44bb7463e9eb..619e300016043 100644 --- a/test/api_integration/fixtures/es_archiver/management/saved_objects/scroll_count/mappings.json +++ b/test/api_integration/fixtures/es_archiver/management/saved_objects/scroll_count/mappings.json @@ -29,7 +29,6 @@ "search": "db2c00e39b36f40930a3b9fc71c823e1", "search-telemetry": "3d1b76c39bfb2cc8296b024d73854724", "telemetry": "36a616f7026dfa617d6655df850fe16d", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", "type": "2f4316de49999235636386fe51dc06c1", "ui-counter": "0d409297dc5ebe1e3a1da691c6ee32e3", "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", @@ -373,47 +372,6 @@ } } }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/api_integration/fixtures/es_archiver/management/saved_objects/search/data.json b/test/api_integration/fixtures/es_archiver/management/saved_objects/search/data.json index 6402a255afd37..05116741dbe5c 100644 --- a/test/api_integration/fixtures/es_archiver/management/saved_objects/search/data.json +++ b/test/api_integration/fixtures/es_archiver/management/saved_objects/search/data.json @@ -1,32 +1,3 @@ -{ - "type": "doc", - "value": { - "id": "timelion-sheet:190f3e90-2ec3-11e8-ba48-69fc4e41e1f6", - "index": ".kibana", - "source": { - "coreMigrationVersion": "7.14.0", - "references": [ - ], - "timelion-sheet": { - "description": "", - "hits": 0, - "timelion_chart_height": 275, - "timelion_columns": 2, - "timelion_interval": "auto", - "timelion_rows": 2, - "timelion_sheet": [ - ".es(*)" - ], - "title": "New TimeLion Sheet", - "version": 1 - }, - "type": "timelion-sheet", - "updated_at": "2018-03-23T17:53:30.872Z" - }, - "type": "_doc" - } -} - { "type": "doc", "value": { diff --git a/test/api_integration/fixtures/es_archiver/management/saved_objects/search/mappings.json b/test/api_integration/fixtures/es_archiver/management/saved_objects/search/mappings.json index 7699a72ff7120..e9ec4e680d74e 100644 --- a/test/api_integration/fixtures/es_archiver/management/saved_objects/search/mappings.json +++ b/test/api_integration/fixtures/es_archiver/management/saved_objects/search/mappings.json @@ -29,7 +29,6 @@ "search": "db2c00e39b36f40930a3b9fc71c823e1", "search-telemetry": "3d1b76c39bfb2cc8296b024d73854724", "telemetry": "36a616f7026dfa617d6655df850fe16d", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", "type": "2f4316de49999235636386fe51dc06c1", "ui-counter": "0d409297dc5ebe1e3a1da691c6ee32e3", "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", @@ -377,47 +376,6 @@ } } }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/api_integration/fixtures/es_archiver/saved_objects/delete_unknown_types/data.json b/test/api_integration/fixtures/es_archiver/saved_objects/delete_unknown_types/data.json new file mode 100644 index 0000000000000..3d6ecd160db00 --- /dev/null +++ b/test/api_integration/fixtures/es_archiver/saved_objects/delete_unknown_types/data.json @@ -0,0 +1,182 @@ +{ + "type": "doc", + "value": { + "id": "index-pattern:8963ca30-3224-11e8-a572-ffca06da1357", + "index": ".kibana", + "source": { + "coreMigrationVersion": "7.14.0", + "index-pattern": { + "fields": "[{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"id\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true}]", + "title": "saved_objects*" + }, + "migrationVersion": { + "index-pattern": "7.11.0" + }, + "references": [ + ], + "type": "index-pattern", + "updated_at": "2018-03-28T01:08:34.290Z" + }, + "type": "_doc" + } +} + +{ + "type": "doc", + "value": { + "id": "search:960372e0-3224-11e8-a572-ffca06da1357", + "index": ".kibana", + "source": { + "coreMigrationVersion": "7.14.0", + "migrationVersion": { + "search": "7.9.3" + }, + "references": [ + { + "id": "8963ca30-3224-11e8-a572-ffca06da1357", + "name": "kibanaSavedObjectMeta.searchSourceJSON.index", + "type": "index-pattern" + } + ], + "search": { + "columns": [ + "_source" + ], + "description": "", + "hits": 0, + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"highlightAll\":true,\"version\":true,\"query\":{\"query\":\"id:3\",\"language\":\"lucene\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" + }, + "sort": [ + [ + "_score", + "desc" + ] + ], + "title": "OneRecord", + "version": 1 + }, + "type": "search", + "updated_at": "2018-03-28T01:08:55.182Z" + }, + "type": "_doc" + } +} + +{ + "type": "doc", + "value": { + "id": "visualization:a42c0580-3224-11e8-a572-ffca06da1357", + "index": ".kibana", + "source": { + "coreMigrationVersion": "7.14.0", + "migrationVersion": { + "visualization": "7.14.0" + }, + "references": [ + { + "id": "960372e0-3224-11e8-a572-ffca06da1357", + "name": "search_0", + "type": "search" + } + ], + "type": "visualization", + "updated_at": "2018-03-28T01:09:18.936Z", + "visualization": { + "description": "", + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}" + }, + "savedSearchRefName": "search_0", + "title": "VisualizationFromSavedSearch", + "uiStateJSON": "{\"vis\":{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null}}}}", + "version": 1, + "visState": "{\"title\":\"VisualizationFromSavedSearch\",\"type\":\"table\",\"params\":{\"perPage\":10,\"showPartialRows\":false,\"showMeticsAtAllLevels\":false,\"sort\":{\"columnIndex\":null,\"direction\":null},\"showTotal\":false,\"totalFunc\":\"sum\",\"showToolbar\":true},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}}]}" + } + }, + "type": "_doc" + } +} + +{ + "type": "doc", + "value": { + "id": "dashboard:b70c7ae0-3224-11e8-a572-ffca06da1357", + "index": ".kibana", + "source": { + "coreMigrationVersion": "7.14.0", + "dashboard": { + "description": "", + "hits": 0, + "kibanaSavedObjectMeta": { + "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[],\"highlightAll\":true,\"version\":true}" + }, + "optionsJSON": "{\"darkTheme\":false,\"useMargins\":true,\"hidePanelTitles\":false}", + "panelsJSON": "[{\"version\":\"7.0.0-alpha1\",\"gridData\":{\"w\":24,\"h\":15,\"x\":0,\"y\":0,\"i\":\"1\"},\"panelIndex\":\"1\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_0\"},{\"version\":\"7.0.0-alpha1\",\"gridData\":{\"w\":24,\"h\":15,\"x\":24,\"y\":0,\"i\":\"2\"},\"panelIndex\":\"2\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_1\"}]", + "timeRestore": false, + "title": "Dashboard", + "version": 1 + }, + "migrationVersion": { + "dashboard": "7.14.0" + }, + "references": [ + { + "id": "add810b0-3224-11e8-a572-ffca06da1357", + "name": "panel_0", + "type": "visualization" + }, + { + "id": "a42c0580-3224-11e8-a572-ffca06da1357", + "name": "panel_1", + "type": "visualization" + } + ], + "type": "dashboard", + "updated_at": "2018-03-28T01:09:50.606Z" + }, + "type": "_doc" + } +} + + +{ + "type": "doc", + "value": { + "id": "unknown-type:unknown-doc", + "index": ".kibana", + "source": { + "coreMigrationVersion": "7.14.0", + "unknown-type": { + "foo": "bar" + }, + "migrationVersion": {}, + "references": [ + ], + "type": "unknown-type", + "updated_at": "2018-03-28T01:08:34.290Z" + }, + "type": "_doc" + } +} + + +{ + "type": "doc", + "value": { + "id": "unknown-shareable-doc", + "index": ".kibana", + "source": { + "coreMigrationVersion": "7.14.0", + "unknown-shareable-type": { + "foo": "bar" + }, + "migrationVersion": {}, + "references": [ + ], + "type": "unknown-shareable-type", + "updated_at": "2018-03-28T01:08:34.290Z" + }, + "type": "_doc" + } +} 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 new file mode 100644 index 0000000000000..f745e0f69c5d3 --- /dev/null +++ b/test/api_integration/fixtures/es_archiver/saved_objects/delete_unknown_types/mappings.json @@ -0,0 +1,530 @@ +{ + "type": "index", + "value": { + "aliases": { + ".kibana_$KIBANA_PACKAGE_VERSION": {}, + ".kibana": {} + }, + "index": ".kibana_$KIBANA_PACKAGE_VERSION_001", + "mappings": { + "_meta": { + "migrationMappingPropertyHashes": { + "application_usage_daily": "43b8830d5d0df85a6823d290885fc9fd", + "application_usage_totals": "3d1b76c39bfb2cc8296b024d73854724", + "application_usage_transactional": "3d1b76c39bfb2cc8296b024d73854724", + "config": "c63748b75f39d0c54de12d12c1ccbc20", + "core-usage-stats": "3d1b76c39bfb2cc8296b024d73854724", + "coreMigrationVersion": "2f4316de49999235636386fe51dc06c1", + "dashboard": "40554caf09725935e2c02e02563a2d07", + "index-pattern": "45915a1ad866812242df474eb0479052", + "kql-telemetry": "d12a98a6f19a2d273696597547e064ee", + "legacy-url-alias": "6155300fd11a00e23d5cbaa39f0fce0a", + "migrationVersion": "4a1746014a75ade3a714e1db5763276f", + "namespace": "2f4316de49999235636386fe51dc06c1", + "namespaces": "2f4316de49999235636386fe51dc06c1", + "originId": "2f4316de49999235636386fe51dc06c1", + "query": "11aaeb7f5f7fa5bb43f25e18ce26e7d9", + "references": "7997cf5a56cc02bdc9c93361bde732b0", + "sample-data-telemetry": "7d3cfeb915303c9641c59681967ffeb4", + "search": "db2c00e39b36f40930a3b9fc71c823e1", + "search-telemetry": "3d1b76c39bfb2cc8296b024d73854724", + "telemetry": "36a616f7026dfa617d6655df850fe16d", + "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", + "type": "2f4316de49999235636386fe51dc06c1", + "ui-counter": "0d409297dc5ebe1e3a1da691c6ee32e3", + "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", + "updated_at": "00da57df13e94e9d98437d13ace4bfe0", + "url": "c7f66a0df8b1b52f17c28c4adb111105", + "usage-counters": "8cc260bdceffec4ffc3ad165c97dc1b4", + "visualization": "f819cf6636b75c9e76ba733a0c6ef355" + } + }, + "dynamic": "strict", + "properties": { + "application_usage_daily": { + "dynamic": "false", + "properties": { + "timestamp": { + "type": "date" + } + } + }, + "application_usage_totals": { + "dynamic": "false", + "type": "object" + }, + "application_usage_transactional": { + "dynamic": "false", + "type": "object" + }, + "config": { + "dynamic": "false", + "properties": { + "buildNum": { + "type": "keyword" + } + } + }, + "unknown-type": { + "dynamic": "false", + "properties": { + "foo": { + "type": "keyword" + } + } + }, + "unknown-shareable-type": { + "dynamic": "false", + "properties": { + "foo": { + "type": "keyword" + } + } + }, + "core-usage-stats": { + "dynamic": "false", + "type": "object" + }, + "coreMigrationVersion": { + "type": "keyword" + }, + "dashboard": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "doc_values": false, + "index": false, + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "index": false, + "type": "text" + } + } + }, + "optionsJSON": { + "index": false, + "type": "text" + }, + "panelsJSON": { + "index": false, + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "doc_values": false, + "index": false, + "type": "keyword" + }, + "pause": { + "doc_values": false, + "index": false, + "type": "boolean" + }, + "section": { + "doc_values": false, + "index": false, + "type": "integer" + }, + "value": { + "doc_values": false, + "index": false, + "type": "integer" + } + } + }, + "timeFrom": { + "doc_values": false, + "index": false, + "type": "keyword" + }, + "timeRestore": { + "doc_values": false, + "index": false, + "type": "boolean" + }, + "timeTo": { + "doc_values": false, + "index": false, + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" + } + } + }, + "index-pattern": { + "dynamic": "false", + "properties": { + "title": { + "type": "text" + }, + "type": { + "type": "keyword" + } + } + }, + "kql-telemetry": { + "properties": { + "optInCount": { + "type": "long" + }, + "optOutCount": { + "type": "long" + } + } + }, + "legacy-url-alias": { + "dynamic": "false", + "properties": { + "disabled": { + "type": "boolean" + }, + "sourceId": { + "type": "keyword" + }, + "targetType": { + "type": "keyword" + } + } + }, + "migrationVersion": { + "dynamic": "true", + "properties": { + "config": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "dashboard": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "index-pattern": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "search": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "visualization": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "namespace": { + "type": "keyword" + }, + "namespaces": { + "type": "keyword" + }, + "originId": { + "type": "keyword" + }, + "query": { + "properties": { + "description": { + "type": "text" + }, + "filters": { + "enabled": false, + "type": "object" + }, + "query": { + "properties": { + "language": { + "type": "keyword" + }, + "query": { + "index": false, + "type": "keyword" + } + } + }, + "timefilter": { + "enabled": false, + "type": "object" + }, + "title": { + "type": "text" + } + } + }, + "references": { + "properties": { + "id": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "type": { + "type": "keyword" + } + }, + "type": "nested" + }, + "sample-data-telemetry": { + "properties": { + "installCount": { + "type": "long" + }, + "unInstallCount": { + "type": "long" + } + } + }, + "search": { + "properties": { + "columns": { + "doc_values": false, + "index": false, + "type": "keyword" + }, + "description": { + "type": "text" + }, + "grid": { + "enabled": false, + "type": "object" + }, + "hideChart": { + "doc_values": false, + "index": false, + "type": "boolean" + }, + "hits": { + "doc_values": false, + "index": false, + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "index": false, + "type": "text" + } + } + }, + "sort": { + "doc_values": false, + "index": false, + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" + } + } + }, + "search-telemetry": { + "dynamic": "false", + "type": "object" + }, + "server": { + "dynamic": "false", + "type": "object" + }, + "telemetry": { + "properties": { + "allowChangingOptInStatus": { + "type": "boolean" + }, + "enabled": { + "type": "boolean" + }, + "lastReported": { + "type": "date" + }, + "lastVersionChecked": { + "type": "keyword" + }, + "reportFailureCount": { + "type": "integer" + }, + "reportFailureVersion": { + "type": "keyword" + }, + "sendUsageFrom": { + "type": "keyword" + }, + "userHasSeenNotice": { + "type": "boolean" + } + } + }, + "timelion-sheet": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" + } + } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" + } + } + }, + "type": { + "type": "keyword" + }, + "ui-counter": { + "properties": { + "count": { + "type": "integer" + } + } + }, + "ui-metric": { + "properties": { + "count": { + "type": "integer" + } + } + }, + "updated_at": { + "type": "date" + }, + "url": { + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "fields": { + "keyword": { + "ignore_above": 2048, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "usage-counters": { + "dynamic": "false", + "properties": { + "domainId": { + "type": "keyword" + } + } + }, + "visualization": { + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "index": false, + "type": "text" + } + } + }, + "savedSearchRefName": { + "doc_values": false, + "index": false, + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "index": false, + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "index": false, + "type": "text" + } + } + } + } + }, + "settings": { + "index": { + "auto_expand_replicas": "0-1", + "number_of_replicas": "0", + "number_of_shards": "1", + "priority": "10", + "refresh_interval": "1s", + "routing_partition_size": "1" + } + } + } +} diff --git a/test/api_integration/fixtures/es_archiver/saved_objects/ui_counters/mappings.json b/test/api_integration/fixtures/es_archiver/saved_objects/ui_counters/mappings.json index 99f2f999db988..34b4ba98b3ee8 100644 --- a/test/api_integration/fixtures/es_archiver/saved_objects/ui_counters/mappings.json +++ b/test/api_integration/fixtures/es_archiver/saved_objects/ui_counters/mappings.json @@ -165,47 +165,6 @@ } } }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "namespace": { "type": "keyword" }, diff --git a/test/api_integration/fixtures/es_archiver/saved_objects/usage_counters/mappings.json b/test/api_integration/fixtures/es_archiver/saved_objects/usage_counters/mappings.json index c2ec5c8881087..e818c2f8cbe20 100644 --- a/test/api_integration/fixtures/es_archiver/saved_objects/usage_counters/mappings.json +++ b/test/api_integration/fixtures/es_archiver/saved_objects/usage_counters/mappings.json @@ -158,47 +158,6 @@ } } }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "namespace": { "type": "keyword" }, diff --git a/test/api_integration/fixtures/es_archiver/search/count/mappings.json b/test/api_integration/fixtures/es_archiver/search/count/mappings.json index 41d5c07e93239..8a46d3fc66c85 100644 --- a/test/api_integration/fixtures/es_archiver/search/count/mappings.json +++ b/test/api_integration/fixtures/es_archiver/search/count/mappings.json @@ -39,48 +39,6 @@ } } }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "visualization": { "dynamic": "strict", "properties": { diff --git a/test/api_integration/fixtures/kbn_archiver/management/saved_objects/relationships.json b/test/api_integration/fixtures/kbn_archiver/management/saved_objects/relationships.json index da2241952ca37..5152303854b75 100644 --- a/test/api_integration/fixtures/kbn_archiver/management/saved_objects/relationships.json +++ b/test/api_integration/fixtures/kbn_archiver/management/saved_objects/relationships.json @@ -1,25 +1,3 @@ -{ - "attributes": { - "description": "", - "hits": 0, - "timelion_chart_height": 275, - "timelion_columns": 2, - "timelion_interval": "auto", - "timelion_rows": 2, - "timelion_sheet": [ - ".es(*)" - ], - "title": "New TimeLion Sheet", - "version": 1 - }, - "coreMigrationVersion": "8.0.0", - "id": "190f3e90-2ec3-11e8-ba48-69fc4e41e1f6", - "references": [], - "type": "timelion-sheet", - "updated_at": "2018-03-23T17:53:30.872Z", - "version": "WzgsMl0=" -} - { "attributes": { "fields": "[{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"id\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true}]", diff --git a/test/common/services/es_archiver.ts b/test/common/services/es_archiver.ts index d99a2e8d10236..2ea4b6ce3a434 100644 --- a/test/common/services/es_archiver.ts +++ b/test/common/services/es_archiver.ts @@ -8,8 +8,6 @@ import { EsArchiver } from '@kbn/es-archiver'; import { FtrProviderContext } from '../ftr_provider_context'; - -// @ts-ignore not TS yet import * as KibanaServer from './kibana_server'; export function EsArchiverProvider({ getService }: FtrProviderContext): EsArchiver { diff --git a/test/common/services/saved_object_info/README.md b/test/common/services/saved_object_info/README.md new file mode 100644 index 0000000000000..5f081e48e2639 --- /dev/null +++ b/test/common/services/saved_object_info/README.md @@ -0,0 +1,88 @@ +# Tips for using the SO INFO SVC CLI with JQ + +## Myriad ways to use jq to discern discrete info from the svc +Below, I will leave out the so types call, which is: +`node scripts/saved_objs_info.js --esUrl http://elastic:changeme@localhost:9220 --soTypes --json` + +#### At time of this writing, without `jq`, the svc call result was: +`node scripts/saved_objs_info.js --esUrl http://elastic:changeme@localhost:9220 --soTypes` + +``` +### Saved Object Types Count: 5 +[ + { + doc_count: 5, + key: 'canvas-workpad-template' + }, + { + doc_count: 1, + key: 'apm-telemetry' + }, + { + doc_count: 1, + key: 'config' + }, + { + doc_count: 1, + key: 'event_loop_delays_daily' + }, + { + doc_count: 1, + key: 'space' + } +] +``` + +### Show the keys only +`jq '.[] | (.key)'` || `jq '.[] | .key'` + +``` +"canvas-workpad-template" +"apm-telemetry" +"config" +"event_loop_delays_daily" +"space" +``` + + +### Show the count of a specific Saved Object type +Eg. Count of spaces +`jq '.[] | select(.key =="space")'` + +``` +{ + "key": "space", + "doc_count": 1 +} +``` + +### Show the saved objects with a count greater than 2 +`jq '.[] | select(.doc_count > 2)'` + +``` +{ + "key": "canvas-workpad-template", + "doc_count": 5 +} +``` + +### Show the TOTAL count of ALL Saved Object types +`jq 'reduce .[].doc_count as $item (0; . + $item)'` + +``` +9 +``` + +#### Diffing +You could add a log file to your git index +and then write to the file again and simply use +`git diff` to see the difference. + +Similarly, you could write out two different files +and use your OS's default diff-ing program. +On OSX, I use `diff before.txt after.txt` + +Lastly, you could have two separate terminal +windows and use your eyes to spot differences, +that is if you expect differences. + diff --git a/test/common/services/saved_object_info/index.ts b/test/common/services/saved_object_info/index.ts index a8e777e4e3bb8..41367694373f3 100644 --- a/test/common/services/saved_object_info/index.ts +++ b/test/common/services/saved_object_info/index.ts @@ -8,7 +8,7 @@ import { run } from '@kbn/dev-utils'; import { pipe } from 'fp-ts/function'; -import { payload, noop, areValid, print, expectedFlags } from './utils'; +import { payload, noop, areValid, print, expectedFlags, format } from './utils'; import { types } from './saved_object_info'; export { SavedObjectInfoService } from './saved_object_info'; @@ -16,12 +16,15 @@ export { SavedObjectInfoService } from './saved_object_info'; export const runSavedObjInfoSvc = () => run( async ({ flags, log }) => { - const printWith = print(log); + const justJson: boolean = !!flags.json; - const getAndFormatAndPrint = async () => - pipe(await types(flags.esUrl as string)(), payload, printWith()); + const resolveDotKibana = async () => await types(flags.esUrl as string)(); - return areValid(flags) ? getAndFormatAndPrint() : noop(); + return areValid(flags) + ? justJson + ? pipe(await resolveDotKibana(), JSON.stringify.bind(null), log.write.bind(log)) + : pipe(await resolveDotKibana(), format, payload, print(log)()) + : noop(); }, { description: ` diff --git a/test/common/services/saved_object_info/utils.ts b/test/common/services/saved_object_info/utils.ts index 43ec565051744..658803560eb6d 100644 --- a/test/common/services/saved_object_info/utils.ts +++ b/test/common/services/saved_object_info/utils.ts @@ -9,13 +9,22 @@ import { inspect } from 'util'; import { createFlagError, ToolingLog } from '@kbn/dev-utils'; -export const format = (obj: unknown) => - inspect(obj, { - compact: false, - depth: 99, - breakLength: 80, - sorted: true, - }); +interface ResolvedPayload { + xs: any; + count: number; +} + +export const format = (obj: any): ResolvedPayload => { + return { + xs: inspect(obj, { + compact: false, + depth: 99, + breakLength: 80, + sorted: true, + }), + count: obj.length, + }; +}; export const noop = () => {}; @@ -24,20 +33,22 @@ export const areValid = (flags: any) => { return true; }; -// @ts-ignore -export const print = (log: ToolingLog) => (msg: string | null = null) => ({ xs, count }) => - log.success(`\n### Saved Object Types ${msg || 'Count: ' + count}\n${xs}`); +export const print = (log: ToolingLog) => (msg: string | null = null) => ({ + xs, + count, +}: ResolvedPayload) => log.write(`\n### Saved Object Types ${msg || 'Count: ' + count}\n${xs}`); export const expectedFlags = () => ({ string: ['esUrl'], - boolean: ['soTypes'], + boolean: ['soTypes', 'json'], help: ` --esUrl Required, tells the app which url to point to --soTypes Not Required, tells the svc to show the types within the .kibana index +--json Not Required, tells the svc to show the types, with only json output. Useful for piping into jq `, }); -export const payload = (xs: any) => ({ - xs: format(xs), - count: xs.length, +export const payload = ({ xs, count }: ResolvedPayload) => ({ + xs, + count, }); diff --git a/test/functional/apps/context/_size.ts b/test/functional/apps/context/_size.ts index b11af7cd5c72f..52b16d2b9abe5 100644 --- a/test/functional/apps/context/_size.ts +++ b/test/functional/apps/context/_size.ts @@ -15,6 +15,7 @@ const TEST_STEP_SIZE = 2; export default function ({ getService, getPageObjects }: FtrProviderContext) { const kibanaServer = getService('kibanaServer'); + const security = getService('security'); const retry = getService('retry'); const docTable = getService('docTable'); const browser = getService('browser'); @@ -23,6 +24,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('context size', function contextSize() { before(async function () { + await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']); await kibanaServer.uiSettings.update({ 'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`, 'context:step': `${TEST_STEP_SIZE}`, diff --git a/test/functional/apps/dashboard/bwc_import.ts b/test/functional/apps/dashboard/bwc_import.ts index 03f1f126338fa..ebb9d2b99ffa7 100644 --- a/test/functional/apps/dashboard/bwc_import.ts +++ b/test/functional/apps/dashboard/bwc_import.ts @@ -12,8 +12,8 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['dashboard', 'header', 'settings', 'savedObjects', 'common']); const dashboardExpect = getService('dashboardExpect'); - - describe('bwc import', function describeIndexTests() { + // Legacy imports are no longer supported https://github.com/elastic/kibana/issues/103921 + describe.skip('bwc import', function describeIndexTests() { before(async function () { await PageObjects.dashboard.initTests(); await PageObjects.settings.navigateTo(); diff --git a/test/functional/apps/dashboard/dashboard_back_button.ts b/test/functional/apps/dashboard/dashboard_back_button.ts index 1e901cdbd48be..3b03ea525b903 100644 --- a/test/functional/apps/dashboard/dashboard_back_button.ts +++ b/test/functional/apps/dashboard/dashboard_back_button.ts @@ -14,12 +14,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const kibanaServer = getService('kibanaServer'); const PageObjects = getPageObjects(['dashboard', 'header', 'common', 'visualize', 'timePicker']); const browser = getService('browser'); + const security = getService('security'); describe('dashboard back button', () => { before(async () => { await esArchiver.loadIfNeeded( 'test/functional/fixtures/es_archiver/dashboard/current/kibana' ); + await security.testUser.setRoles(['kibana_admin', 'animals', 'test_logstash_reader']); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); @@ -27,6 +29,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.dashboard.preserveCrossAppState(); }); + after(async () => { + await security.testUser.restoreDefaults(); + }); + it('after navigation from listing page to dashboard back button works', async () => { await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.loadSavedDashboard('dashboard with everything'); diff --git a/test/functional/apps/dashboard/dashboard_filter_bar.ts b/test/functional/apps/dashboard/dashboard_filter_bar.ts index e1a15009afe51..2f561f3220158 100644 --- a/test/functional/apps/dashboard/dashboard_filter_bar.ts +++ b/test/functional/apps/dashboard/dashboard_filter_bar.ts @@ -20,6 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const browser = getService('browser'); + const security = getService('security'); const PageObjects = getPageObjects([ 'common', 'dashboard', @@ -32,12 +33,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('dashboard filter bar', () => { before(async () => { await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); + await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader', 'animals']); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); await PageObjects.common.navigateToApp('dashboard'); }); + after(async () => { + await security.testUser.restoreDefaults(); + }); + describe('Add a filter bar', function () { before(async () => { await PageObjects.dashboard.gotoDashboardLandingPage(); @@ -181,7 +187,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('are added when a cell magnifying glass is clicked', async function () { await dashboardAddPanel.addSavedSearch('Rendering-Test:-saved-search'); await PageObjects.dashboard.waitForRenderComplete(); - const isLegacyDefault = PageObjects.discover.useLegacyTable(); + const isLegacyDefault = await PageObjects.discover.useLegacyTable(); if (isLegacyDefault) { await testSubjects.click('docTableCellFilter'); } else { diff --git a/test/functional/apps/dashboard/dashboard_state.ts b/test/functional/apps/dashboard/dashboard_state.ts index 1a9cf3b7593a0..45ba62749dd77 100644 --- a/test/functional/apps/dashboard/dashboard_state.ts +++ b/test/functional/apps/dashboard/dashboard_state.ts @@ -30,9 +30,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const elasticChart = getService('elasticChart'); const kibanaServer = getService('kibanaServer'); const dashboardAddPanel = getService('dashboardAddPanel'); + const xyChartSelector = 'visTypeXyChart'; - const enableNewChartLibraryDebug = async () => { - if (await PageObjects.visChart.isNewChartsLibraryEnabled()) { + const enableNewChartLibraryDebug = async (force = false) => { + if ((await PageObjects.visChart.isNewChartsLibraryEnabled()) || force) { await elasticChart.setNewChartUiDebugFlag(); await queryBar.submitQuery(); } @@ -49,7 +50,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { if (isNewChartsLibraryEnabled) { await kibanaServer.uiSettings.update({ - 'visualization:visualize:legacyChartsLibrary': false, 'visualization:visualize:legacyPieChartsLibrary': false, }); await browser.refresh(); @@ -66,33 +66,28 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.dashboard.clickNewDashboard(); await PageObjects.timePicker.setHistoricalDataRange(); - const visName = await PageObjects.visChart.getExpectedValue( - AREA_CHART_VIS_NAME, - `${AREA_CHART_VIS_NAME} - new charts library` - ); + const visName = AREA_CHART_VIS_NAME; await dashboardAddPanel.addVisualization(visName); - const dashboarName = await PageObjects.visChart.getExpectedValue( - 'Overridden colors', - 'Overridden colors - new charts library' - ); - await PageObjects.dashboard.saveDashboard(dashboarName); + const dashboardName = 'Overridden colors - new charts library'; + await PageObjects.dashboard.saveDashboard(dashboardName); await PageObjects.dashboard.switchToEditMode(); await queryBar.clickQuerySubmitButton(); - await PageObjects.visChart.openLegendOptionColors('Count', `[data-title="${visName}"]`); - const overwriteColor = isNewChartsLibraryEnabled ? '#d36086' : '#EA6460'; + await PageObjects.visChart.openLegendOptionColorsForXY('Count', `[data-title="${visName}"]`); + const overwriteColor = '#d36086'; await PageObjects.visChart.selectNewLegendColorChoice(overwriteColor); - await PageObjects.dashboard.saveDashboard(dashboarName); + await PageObjects.dashboard.saveDashboard(dashboardName); await PageObjects.dashboard.gotoDashboardLandingPage(); - await PageObjects.dashboard.loadSavedDashboard(dashboarName); + await PageObjects.dashboard.loadSavedDashboard(dashboardName); - await enableNewChartLibraryDebug(); + await enableNewChartLibraryDebug(true); - const colorChoiceRetained = await PageObjects.visChart.doesSelectedLegendColorExist( - overwriteColor + const colorChoiceRetained = await PageObjects.visChart.doesSelectedLegendColorExistForXY( + overwriteColor, + xyChartSelector ); expect(colorChoiceRetained).to.be(true); @@ -171,11 +166,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }; const hardRefresh = async (newUrl: string) => { - // We need to add a timestamp to the URL because URL changes now only work with a hard refresh. + // We add a timestamp here to force a hard refresh await browser.get(newUrl.toString()); const alert = await browser.getAlert(); await alert?.accept(); - await enableNewChartLibraryDebug(); + await enableNewChartLibraryDebug(true); await PageObjects.dashboard.waitForRenderComplete(); }; @@ -186,16 +181,23 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.timePicker.setHistoricalDataRange(); }); - it('for query parameter', async function () { - const currentQuery = await queryBar.getQueryString(); - expect(currentQuery).to.equal(''); + const changeQuery = async (useHardRefresh: boolean, newQuery: string) => { + await queryBar.clickQuerySubmitButton(); + const oldQuery = await queryBar.getQueryString(); const currentUrl = await getUrlFromShare(); - const newUrl = currentUrl.replace(`query:''`, `query:'hi:hello'`); + const newUrl = currentUrl.replace(`query:'${oldQuery}'`, `query:'${newQuery}'`); + + await browser.get(newUrl.toString(), !useHardRefresh); + const queryBarContentsAfterRefresh = await queryBar.getQueryString(); + expect(queryBarContentsAfterRefresh).to.equal(newQuery); + }; + + it('for query parameter with soft refresh', async function () { + await changeQuery(false, 'hi:goodbye'); + }); - // We need to add a timestamp to the URL because URL changes now only work with a hard refresh. - await browser.get(newUrl.toString()); - const newQuery = await queryBar.getQueryString(); - expect(newQuery).to.equal('hi:hello'); + it('for query parameter with hard refresh', async function () { + await changeQuery(true, 'hi:hello'); await queryBar.clearQuery(); await queryBar.clickQuerySubmitButton(); }); @@ -251,7 +253,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('updates a pie slice color on a hard refresh', async function () { - await PageObjects.visChart.openLegendOptionColors( + await PageObjects.visChart.openLegendOptionColorsForPie( '80,000', `[data-title="${PIE_CHART_VIS_NAME}"]` ); @@ -276,7 +278,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('and updates the pie slice legend color', async function () { await retry.try(async () => { - const colorExists = await PageObjects.visChart.doesSelectedLegendColorExist('#FFFFFF'); + const colorExists = await PageObjects.visChart.doesSelectedLegendColorExistForPie( + '#FFFFFF' + ); expect(colorExists).to.be(true); }); }); @@ -300,7 +304,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('resets the legend color as well', async function () { await retry.try(async () => { - const colorExists = await PageObjects.visChart.doesSelectedLegendColorExist('#57c17b'); + const colorExists = await PageObjects.visChart.doesSelectedLegendColorExistForPie( + '#57c17b' + ); expect(colorExists).to.be(true); }); }); diff --git a/test/functional/apps/dashboard/data_shared_attributes.ts b/test/functional/apps/dashboard/data_shared_attributes.ts index 34fd4ddb346ed..4b993287ffe42 100644 --- a/test/functional/apps/dashboard/data_shared_attributes.ts +++ b/test/functional/apps/dashboard/data_shared_attributes.ts @@ -15,6 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const dashboardPanelActions = getService('dashboardPanelActions'); + const security = getService('security'); const PageObjects = getPageObjects(['common', 'dashboard', 'timePicker']); describe('dashboard data-shared attributes', function describeIndexTests() { @@ -22,6 +23,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async () => { await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); + await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader', 'animals']); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); @@ -31,6 +33,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.dashboard.waitForRenderComplete(); }); + after(async () => { + await security.testUser.restoreDefaults(); + }); + it('should have time picker with data-shared-timefilter-duration', async () => { await retry.try(async () => { const sharedData = await PageObjects.timePicker.getTimeDurationForSharing(); diff --git a/test/functional/apps/dashboard/index.ts b/test/functional/apps/dashboard/index.ts index e4dc04282e4ac..8627a258869bb 100644 --- a/test/functional/apps/dashboard/index.ts +++ b/test/functional/apps/dashboard/index.ts @@ -122,7 +122,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { before(async () => { await loadLogstash(); await kibanaServer.uiSettings.update({ - 'visualization:visualize:legacyChartsLibrary': false, 'visualization:visualize:legacyPieChartsLibrary': false, }); await browser.refresh(); @@ -131,7 +130,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { after(async () => { await unloadLogstash(); await kibanaServer.uiSettings.update({ - 'visualization:visualize:legacyChartsLibrary': true, 'visualization:visualize:legacyPieChartsLibrary': true, }); await browser.refresh(); diff --git a/test/functional/apps/dashboard/legacy_urls.ts b/test/functional/apps/dashboard/legacy_urls.ts index 96c7a5aac3f4b..b449c0f6728a5 100644 --- a/test/functional/apps/dashboard/legacy_urls.ts +++ b/test/functional/apps/dashboard/legacy_urls.ts @@ -32,7 +32,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('legacy urls', function describeIndexTests() { before(async function () { - await security.testUser.setRoles(['kibana_admin', 'animals']); + await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader', 'animals']); await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); await PageObjects.common.navigateToApp('dashboard'); await PageObjects.dashboard.clickNewDashboard(); diff --git a/test/functional/apps/dashboard/time_zones.ts b/test/functional/apps/dashboard/time_zones.ts index e5c532537b6f0..f60792b3f292a 100644 --- a/test/functional/apps/dashboard/time_zones.ts +++ b/test/functional/apps/dashboard/time_zones.ts @@ -22,8 +22,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'common', 'savedObjects', ]); - - describe('dashboard time zones', function () { + // Legacy imports are no longer supported https://github.com/elastic/kibana/issues/103921 + describe.skip('dashboard time zones', function () { this.tags('includeFirefox'); before(async () => { diff --git a/test/functional/apps/dashboard/view_edit.ts b/test/functional/apps/dashboard/view_edit.ts index b29b07f9df4e4..f0ee5aad7a7cf 100644 --- a/test/functional/apps/dashboard/view_edit.ts +++ b/test/functional/apps/dashboard/view_edit.ts @@ -18,10 +18,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['dashboard', 'header', 'common', 'visualize', 'timePicker']); const dashboardName = 'dashboard with filter'; const filterBar = getService('filterBar'); + const security = getService('security'); describe('dashboard view edit mode', function viewEditModeTests() { before(async () => { await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana'); + await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader', 'animals']); await kibanaServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); @@ -29,6 +31,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.dashboard.preserveCrossAppState(); }); + after(async () => { + await security.testUser.restoreDefaults(); + }); + it('create new dashboard opens in edit mode', async function () { await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.clickNewDashboard(); diff --git a/test/functional/apps/visualize/_markdown_vis.ts b/test/functional/apps/dashboard_elements/_markdown_vis.ts similarity index 100% rename from test/functional/apps/visualize/_markdown_vis.ts rename to test/functional/apps/dashboard_elements/_markdown_vis.ts diff --git a/test/functional/apps/dashboard_elements/index.ts b/test/functional/apps/dashboard_elements/index.ts new file mode 100644 index 0000000000000..4866754c3907b --- /dev/null +++ b/test/functional/apps/dashboard_elements/index.ts @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { FtrProviderContext } from '../../ftr_provider_context'; + +export default function ({ getService, loadTestFile }: FtrProviderContext) { + const browser = getService('browser'); + const log = getService('log'); + const esArchiver = getService('esArchiver'); + + describe('dashboard elements', () => { + before(async () => { + log.debug('Starting before method'); + await browser.setWindowSize(1280, 800); + await esArchiver.load('test/functional/fixtures/es_archiver/empty_kibana'); + + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/long_window_logstash'); + }); + + describe('dashboard elements ciGroup10', function () { + this.tags('ciGroup10'); + + loadTestFile(require.resolve('./input_control_vis')); + loadTestFile(require.resolve('./_markdown_vis')); + }); + }); +} diff --git a/test/functional/apps/visualize/input_control_vis/chained_controls.ts b/test/functional/apps/dashboard_elements/input_control_vis/chained_controls.ts similarity index 100% rename from test/functional/apps/visualize/input_control_vis/chained_controls.ts rename to test/functional/apps/dashboard_elements/input_control_vis/chained_controls.ts diff --git a/test/functional/apps/visualize/input_control_vis/dynamic_options.ts b/test/functional/apps/dashboard_elements/input_control_vis/dynamic_options.ts similarity index 100% rename from test/functional/apps/visualize/input_control_vis/dynamic_options.ts rename to test/functional/apps/dashboard_elements/input_control_vis/dynamic_options.ts diff --git a/test/functional/apps/visualize/input_control_vis/index.ts b/test/functional/apps/dashboard_elements/input_control_vis/index.ts similarity index 100% rename from test/functional/apps/visualize/input_control_vis/index.ts rename to test/functional/apps/dashboard_elements/input_control_vis/index.ts diff --git a/test/functional/apps/visualize/input_control_vis/input_control_options.ts b/test/functional/apps/dashboard_elements/input_control_vis/input_control_options.ts similarity index 100% rename from test/functional/apps/visualize/input_control_vis/input_control_options.ts rename to test/functional/apps/dashboard_elements/input_control_vis/input_control_options.ts diff --git a/test/functional/apps/visualize/input_control_vis/input_control_range.ts b/test/functional/apps/dashboard_elements/input_control_vis/input_control_range.ts similarity index 100% rename from test/functional/apps/visualize/input_control_vis/input_control_range.ts rename to test/functional/apps/dashboard_elements/input_control_vis/input_control_range.ts diff --git a/test/functional/apps/discover/_data_grid_doc_navigation.ts b/test/functional/apps/discover/_data_grid_doc_navigation.ts index cf5532aa6d762..73077dcc9749a 100644 --- a/test/functional/apps/discover/_data_grid_doc_navigation.ts +++ b/test/functional/apps/discover/_data_grid_doc_navigation.ts @@ -20,9 +20,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const defaultSettings = { defaultIndex: 'logstash-*', 'doc_table:legacy': false }; describe('discover data grid doc link', function () { - beforeEach(async function () { + before(async () => { await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); + }); + + after(async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); + }); + + beforeEach(async function () { await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await kibanaServer.uiSettings.update(defaultSettings); await PageObjects.common.navigateToApp('discover'); diff --git a/test/functional/apps/discover/_data_grid_doc_table.ts b/test/functional/apps/discover/_data_grid_doc_table.ts index 2efb1ba51811f..be569a2ffa25f 100644 --- a/test/functional/apps/discover/_data_grid_doc_table.ts +++ b/test/functional/apps/discover/_data_grid_doc_table.ts @@ -105,6 +105,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); + it('should allow paginating docs in the flyout by clicking in the doc table', async function () { + await retry.try(async function () { + await dataGrid.clickRowToggle({ rowIndex: rowToInspect - 1 }); + await testSubjects.exists(`dscDocNavigationPage0`); + await dataGrid.clickRowToggle({ rowIndex: rowToInspect }); + await testSubjects.exists(`dscDocNavigationPage1`); + await dataGrid.closeFlyout(); + }); + }); + it('should show allow adding columns from the detail panel', async function () { await retry.try(async function () { await dataGrid.clickRowToggle({ isAnchorRow: false, rowIndex: rowToInspect - 1 }); diff --git a/test/functional/apps/discover/_doc_navigation.ts b/test/functional/apps/discover/_doc_navigation.ts index 8d156cb305586..19f61851ef961 100644 --- a/test/functional/apps/discover/_doc_navigation.ts +++ b/test/functional/apps/discover/_doc_navigation.ts @@ -22,7 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('doc link in discover', function contextSize() { before(async () => { await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await kibanaServer.uiSettings.update({ 'doc_table:legacy': true, @@ -30,6 +30,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); after(async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); await kibanaServer.uiSettings.replace({}); }); diff --git a/test/functional/apps/discover/_indexpattern_with_unmapped_fields.ts b/test/functional/apps/discover/_indexpattern_with_unmapped_fields.ts index 264885490cdfc..2a1e60db541e8 100644 --- a/test/functional/apps/discover/_indexpattern_with_unmapped_fields.ts +++ b/test/functional/apps/discover/_indexpattern_with_unmapped_fields.ts @@ -30,6 +30,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); await PageObjects.common.navigateToApp('discover'); + await PageObjects.discover.selectIndexPattern('test-index-unmapped-fields'); }); after(async () => { diff --git a/test/functional/apps/discover/_runtime_fields_editor.ts b/test/functional/apps/discover/_runtime_fields_editor.ts index a77bc4c77568a..642743d3a0377 100644 --- a/test/functional/apps/discover/_runtime_fields_editor.ts +++ b/test/functional/apps/discover/_runtime_fields_editor.ts @@ -15,6 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver'); const fieldEditor = getService('fieldEditor'); + const security = getService('security'); const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker']); const defaultSettings = { defaultIndex: 'logstash-*', @@ -32,13 +33,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('discover integration with runtime fields editor', function describeIndexTests() { before(async function () { - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); + await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']); await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); await kibanaServer.uiSettings.replace(defaultSettings); await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await PageObjects.common.navigateToApp('discover'); }); + after(async () => { + await security.testUser.restoreDefaults(); + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); + await kibanaServer.savedObjects.clean({ types: ['saved-search'] }); + }); + it('allows adding custom label to existing fields', async function () { const customLabel = 'megabytes'; await PageObjects.discover.editField('bytes'); diff --git a/test/functional/apps/discover/_sidebar.ts b/test/functional/apps/discover/_sidebar.ts index d8701261126c4..a74f4367e657b 100644 --- a/test/functional/apps/discover/_sidebar.ts +++ b/test/functional/apps/discover/_sidebar.ts @@ -17,7 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('discover sidebar', function describeIndexTests() { before(async function () { await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*', }); @@ -25,6 +25,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.common.navigateToApp('discover'); }); + after(async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); + }); + describe('field filtering', function () { it('should reveal and hide the filter form when the toggle is clicked', async function () { await PageObjects.discover.openSidebarFieldFilter(); diff --git a/test/functional/apps/getting_started/_shakespeare.ts b/test/functional/apps/getting_started/_shakespeare.ts index ae6841b85c98d..426713c912e88 100644 --- a/test/functional/apps/getting_started/_shakespeare.ts +++ b/test/functional/apps/getting_started/_shakespeare.ts @@ -28,6 +28,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'visChart', ]); + const xyChartSelector = 'visTypeXyChart'; + // https://www.elastic.co/guide/en/kibana/current/tutorial-load-dataset.html describe('Shakespeare', function describeIndexTests() { @@ -56,7 +58,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { if (isNewChartsLibraryEnabled) { await kibanaServer.uiSettings.update({ - 'visualization:visualize:legacyChartsLibrary': false, 'visualization:visualize:legacyPieChartsLibrary': false, }); await browser.refresh(); @@ -65,6 +66,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { after(async () => { await security.testUser.restoreDefaults(); + await esArchiver.unload('test/functional/fixtures/es_archiver/getting_started/shakespeare'); + await kibanaServer.uiSettings.replace({}); }); it('should create shakespeare index pattern', async function () { @@ -90,11 +93,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // Remove refresh click when vislib is removed // https://github.com/elastic/kibana/issues/56143 - await PageObjects.visualize.clickRefresh(); + await PageObjects.visualize.clickRefresh(true); const expectedChartValues = [111396]; await retry.try(async () => { - const data = await PageObjects.visChart.getBarChartData('Count'); + const data = await PageObjects.visChart.getBarChartData(xyChartSelector, 'Count'); log.debug('data=' + data); log.debug('data.length=' + data.length); expect(data[0] - expectedChartValues[0]).to.be.lessThan(5); @@ -121,12 +124,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.clickGo(); const expectedChartValues = [935]; await retry.try(async () => { - const data = await PageObjects.visChart.getBarChartData('Speaking Parts'); + const data = await PageObjects.visChart.getBarChartData(xyChartSelector, 'Speaking Parts'); log.debug('data=' + data); log.debug('data.length=' + data.length); expect(data).to.eql(expectedChartValues); }); - const title = await PageObjects.visChart.getYAxisTitle(); + const title = await PageObjects.visChart.getYAxisTitle(xyChartSelector); expect(title).to.be('Speaking Parts'); }); @@ -147,13 +150,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const expectedChartValues = [71, 65, 62, 55, 55]; await retry.try(async () => { - const data = await PageObjects.visChart.getBarChartData('Speaking Parts'); + const data = await PageObjects.visChart.getBarChartData(xyChartSelector, 'Speaking Parts'); log.debug('data=' + data); log.debug('data.length=' + data.length); expect(data).to.eql(expectedChartValues); }); - const labels = await PageObjects.visChart.getXAxisLabels(); + const labels = await PageObjects.visChart.getXAxisLabels(xyChartSelector); expect(labels).to.eql([ 'Richard III', 'Henry VI Part 2', @@ -185,8 +188,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const expectedChartValues = [71, 65, 62, 55, 55]; const expectedChartValues2 = [177, 106, 153, 132, 162]; await retry.try(async () => { - const data = await PageObjects.visChart.getBarChartData('Speaking Parts'); - const data2 = await PageObjects.visChart.getBarChartData('Max Speaking Parts'); + const data = await PageObjects.visChart.getBarChartData(xyChartSelector, 'Speaking Parts'); + const data2 = await PageObjects.visChart.getBarChartData( + xyChartSelector, + 'Max Speaking Parts' + ); log.debug('data=' + data); log.debug('data.length=' + data.length); log.debug('data2=' + data2); @@ -195,7 +201,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(data2).to.eql(expectedChartValues2); }); - const labels = await PageObjects.visChart.getXAxisLabels(); + const labels = await PageObjects.visChart.getXAxisLabels(xyChartSelector); expect(labels).to.eql([ 'Richard III', 'Henry VI Part 2', @@ -218,8 +224,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const expectedChartValues = [71, 65, 62, 55, 55]; const expectedChartValues2 = [177, 106, 153, 132, 162]; await retry.try(async () => { - const data = await PageObjects.visChart.getBarChartData('Speaking Parts'); - const data2 = await PageObjects.visChart.getBarChartData('Max Speaking Parts'); + const data = await PageObjects.visChart.getBarChartData(xyChartSelector, 'Speaking Parts'); + const data2 = await PageObjects.visChart.getBarChartData( + xyChartSelector, + 'Max Speaking Parts' + ); log.debug('data=' + data); log.debug('data.length=' + data.length); log.debug('data2=' + data2); @@ -241,17 +250,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.clickGo(); // same values as previous test except scaled down by the 50 for Y-Axis min - const expectedChartValues = await PageObjects.visChart.getExpectedValue( - [21, 15, 12, 5, 5], - [71, 65, 62, 55, 55] // no scaled values in elastic-charts - ); - const expectedChartValues2 = await PageObjects.visChart.getExpectedValue( - [127, 56, 103, 82, 112], - [177, 106, 153, 132, 162] // no scaled values in elastic-charts - ); + const expectedChartValues = [71, 65, 62, 55, 55]; + const expectedChartValues2 = [177, 106, 153, 132, 162]; await retry.try(async () => { - const data = await PageObjects.visChart.getBarChartData('Speaking Parts'); - const data2 = await PageObjects.visChart.getBarChartData('Max Speaking Parts'); + const data = await PageObjects.visChart.getBarChartData(xyChartSelector, 'Speaking Parts'); + const data2 = await PageObjects.visChart.getBarChartData( + xyChartSelector, + 'Max Speaking Parts' + ); log.debug('data=' + data); log.debug('data.length=' + data.length); log.debug('data2=' + data2); diff --git a/test/functional/apps/getting_started/index.ts b/test/functional/apps/getting_started/index.ts index 4c1c052ef15a2..ae7fdc3c1d4fa 100644 --- a/test/functional/apps/getting_started/index.ts +++ b/test/functional/apps/getting_started/index.ts @@ -23,7 +23,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { describe('new charts library', function () { before(async () => { await kibanaServer.uiSettings.update({ - 'visualization:visualize:legacyChartsLibrary': false, 'visualization:visualize:legacyPieChartsLibrary': false, }); await browser.refresh(); @@ -31,7 +30,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { after(async () => { await kibanaServer.uiSettings.update({ - 'visualization:visualize:legacyChartsLibrary': true, 'visualization:visualize:legacyPieChartsLibrary': true, }); await browser.refresh(); diff --git a/test/functional/apps/home/_home.js b/test/functional/apps/home/_home.js index 24e672463964d..e3ca3f6761113 100644 --- a/test/functional/apps/home/_home.js +++ b/test/functional/apps/home/_home.js @@ -26,7 +26,7 @@ export default function ({ getService, getPageObjects }) { }); it('clicking on console on homepage should take you to console app', async () => { - await PageObjects.common.navigateToUrl('home'); + await PageObjects.common.navigateToApp('home'); await testSubjects.click('homeDevTools'); const url = await browser.getCurrentUrl(); expect(url.includes('/app/dev_tools#/console')).to.be(true); diff --git a/test/functional/apps/home/_navigation.ts b/test/functional/apps/home/_navigation.ts index a57ce0596abac..016cead53f0c4 100644 --- a/test/functional/apps/home/_navigation.ts +++ b/test/functional/apps/home/_navigation.ts @@ -14,11 +14,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['common', 'header', 'home', 'timePicker']); const appsMenu = getService('appsMenu'); const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); describe('Kibana browser back navigation should work', function describeIndexTests() { before(async () => { - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover'); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await esArchiver.load('test/functional/fixtures/es_archiver/logstash_functional'); + await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*' }); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); + }); + + after(async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); + await kibanaServer.uiSettings.replace({}); }); it('detect navigate back issues', async () => { diff --git a/test/functional/apps/management/_field_formatter.ts b/test/functional/apps/management/_field_formatter.ts index 65b1f4d324fb1..e070b262af9ed 100644 --- a/test/functional/apps/management/_field_formatter.ts +++ b/test/functional/apps/management/_field_formatter.ts @@ -12,7 +12,6 @@ import { FIELD_FORMAT_IDS } from '../../../../src/plugins/field_formats/common'; import { WebElementWrapper } from '../../services/lib/web_element_wrapper'; export default function ({ getService, getPageObjects }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const browser = getService('browser'); const PageObjects = getPageObjects(['settings', 'common']); @@ -32,13 +31,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'test_field_formatters', 'test_logstash_reader', ]); - await esArchiver.load('test/functional/fixtures/es_archiver/discover'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); await kibanaServer.uiSettings.replace({}); }); after(async function afterAll() { - await PageObjects.settings.navigateTo(); - await esArchiver.emptyKibanaIndex(); + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); }); describe('set and change field formatter', function describeIndexTests() { diff --git a/test/functional/apps/management/_handle_version_conflict.js b/test/functional/apps/management/_handle_version_conflict.js index 82723ad7ce967..f73489a5185b5 100644 --- a/test/functional/apps/management/_handle_version_conflict.js +++ b/test/functional/apps/management/_handle_version_conflict.js @@ -19,7 +19,7 @@ import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { const testSubjects = getService('testSubjects'); - const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const browser = getService('browser'); const es = getService('es'); const retry = getService('retry'); @@ -30,7 +30,11 @@ export default function ({ getService, getPageObjects }) { describe('index version conflict', function describeIndexTests() { before(async function () { await browser.setWindowSize(1200, 800); - await esArchiver.load('test/functional/fixtures/es_archiver/discover'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); + }); + + after(async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); }); it('Should be able to surface version conflict notification while creating scripted field', async function () { diff --git a/test/functional/apps/management/_import_objects.ts b/test/functional/apps/management/_import_objects.ts index 6ef0bfd5a09e8..81350b3542c44 100644 --- a/test/functional/apps/management/_import_objects.ts +++ b/test/functional/apps/management/_import_objects.ts @@ -11,8 +11,6 @@ import path from 'path'; import { keyBy } from 'lodash'; import { FtrProviderContext } from '../../ftr_provider_context'; -const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); - function uniq(input: T[]): T[] { return [...new Set(input)]; } @@ -210,284 +208,5 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(isSavedObjectImported).to.be(true); }); }); - - describe('.json file', () => { - beforeEach(async function () { - await esArchiver.load('test/functional/fixtures/es_archiver/saved_objects_imports'); - await kibanaServer.uiSettings.replace({}); - await PageObjects.settings.navigateTo(); - await PageObjects.settings.clickKibanaSavedObjects(); - }); - - afterEach(async function () { - await esArchiver.unload('test/functional/fixtures/es_archiver/saved_objects_imports'); - }); - - it('should import saved objects', async function () { - await PageObjects.savedObjects.importFile( - path.join(__dirname, 'exports', '_import_objects.json') - ); - await PageObjects.savedObjects.checkImportSucceeded(); - await PageObjects.savedObjects.clickImportDone(); - const objects = await PageObjects.savedObjects.getRowTitles(); - const isSavedObjectImported = objects.includes('Log Agents'); - expect(isSavedObjectImported).to.be(true); - }); - - it('should provide dialog to allow the importing of saved objects with index pattern conflicts', async function () { - await PageObjects.savedObjects.importFile( - path.join(__dirname, 'exports', '_import_objects-conflicts.json') - ); - await PageObjects.savedObjects.checkImportLegacyWarning(); - await PageObjects.savedObjects.checkImportConflictsWarning(); - await PageObjects.settings.associateIndexPattern( - 'd1e4c910-a2e6-11e7-bb30-233be9be6a15', - 'logstash-*' - ); - await PageObjects.savedObjects.clickConfirmChanges(); - await PageObjects.header.waitUntilLoadingHasFinished(); - await PageObjects.savedObjects.clickImportDone(); - const objects = await PageObjects.savedObjects.getRowTitles(); - const isSavedObjectImported = objects.includes('saved object with index pattern conflict'); - expect(isSavedObjectImported).to.be(true); - }); - - it('should allow the user to override duplicate saved objects', async function () { - // This data has already been loaded by the "visualize" esArchive. We'll load it again - // so that we can override the existing visualization. - await PageObjects.savedObjects.importFile( - path.join(__dirname, 'exports', '_import_objects_exists.json'), - false - ); - - await PageObjects.savedObjects.checkImportLegacyWarning(); - await PageObjects.savedObjects.checkImportConflictsWarning(); - await PageObjects.settings.associateIndexPattern('logstash-*', 'logstash-*'); - await PageObjects.savedObjects.clickConfirmChanges(); - - // Override the visualization. - await PageObjects.common.clickConfirmOnModal(); - - const isSuccessful = await testSubjects.exists('importSavedObjectsSuccess'); - expect(isSuccessful).to.be(true); - }); - - it('should allow the user to cancel overriding duplicate saved objects', async function () { - // This data has already been loaded by the "visualize" esArchive. We'll load it again - // so that we can be prompted to override the existing visualization. - await PageObjects.savedObjects.importFile( - path.join(__dirname, 'exports', '_import_objects_exists.json'), - false - ); - - await PageObjects.savedObjects.checkImportLegacyWarning(); - await PageObjects.savedObjects.checkImportConflictsWarning(); - await PageObjects.settings.associateIndexPattern('logstash-*', 'logstash-*'); - await PageObjects.savedObjects.clickConfirmChanges(); - - // *Don't* override the visualization. - await PageObjects.common.clickCancelOnModal(); - - const isSuccessful = await testSubjects.exists('importSavedObjectsSuccessNoneImported'); - expect(isSuccessful).to.be(true); - }); - - it('should allow the user to confirm overriding multiple duplicate saved objects', async function () { - // This data has already been loaded by the "visualize" esArchive. We'll load it again - // so that we can override the existing visualization. - await PageObjects.savedObjects.importFile( - path.join(__dirname, 'exports', '_import_objects_multiple_exists.json'), - false - ); - - await PageObjects.savedObjects.checkImportLegacyWarning(); - await PageObjects.savedObjects.checkImportConflictsWarning(); - - await PageObjects.settings.associateIndexPattern('logstash-*', 'logstash-*'); - await PageObjects.savedObjects.clickConfirmChanges(); - - // Override the visualizations. - await PageObjects.common.clickConfirmOnModal(false); - // as the second confirm can pop instantly, we can't wait for it to be hidden - // with is why we call clickConfirmOnModal with ensureHidden: false in previous statement - // but as the initial popin can take a few ms before fading, we need to wait a little - // to avoid clicking twice on the same modal. - await delay(1000); - await PageObjects.common.clickConfirmOnModal(true); - - const isSuccessful = await testSubjects.exists('importSavedObjectsSuccess'); - expect(isSuccessful).to.be(true); - }); - - it('should allow the user to confirm overriding multiple duplicate index patterns', async function () { - // This data has already been loaded by the "visualize" esArchive. We'll load it again - // so that we can override the existing visualization. - await PageObjects.savedObjects.importFile( - path.join(__dirname, 'exports', '_import_index_patterns_multiple_exists.json'), - false - ); - - // Override the index patterns. - await PageObjects.common.clickConfirmOnModal(false); - // as the second confirm can pop instantly, we can't wait for it to be hidden - // with is why we call clickConfirmOnModal with ensureHidden: false in previous statement - // but as the initial popin can take a few ms before fading, we need to wait a little - // to avoid clicking twice on the same modal. - await delay(1000); - await PageObjects.common.clickConfirmOnModal(true); - - const isSuccessful = await testSubjects.exists('importSavedObjectsSuccess'); - expect(isSuccessful).to.be(true); - }); - - it('should import saved objects linked to saved searches', async function () { - await PageObjects.savedObjects.importFile( - path.join(__dirname, 'exports', '_import_objects_saved_search.json') - ); - await PageObjects.savedObjects.checkImportSucceeded(); - await PageObjects.savedObjects.clickImportDone(); - - await PageObjects.savedObjects.importFile( - path.join(__dirname, 'exports', '_import_objects_connected_to_saved_search.json') - ); - await PageObjects.savedObjects.checkImportSucceeded(); - await PageObjects.savedObjects.clickImportDone(); - - const objects = await PageObjects.savedObjects.getRowTitles(); - const isSavedObjectImported = objects.includes('saved object connected to saved search'); - expect(isSavedObjectImported).to.be(true); - }); - - it('should not import saved objects linked to saved searches when saved search does not exist', async function () { - await PageObjects.savedObjects.importFile( - path.join(__dirname, 'exports', '_import_objects_connected_to_saved_search.json') - ); - await PageObjects.savedObjects.checkImportFailedWarning(); - await PageObjects.savedObjects.clickImportDone(); - - const objects = await PageObjects.savedObjects.getRowTitles(); - const isSavedObjectImported = objects.includes('saved object connected to saved search'); - expect(isSavedObjectImported).to.be(false); - }); - - it('should not import saved objects linked to saved searches when saved search index pattern does not exist', async function () { - // First, import the saved search - await PageObjects.savedObjects.importFile( - path.join(__dirname, 'exports', '_import_objects_saved_search.json') - ); - // Wait for all the saves to happen - await PageObjects.savedObjects.checkImportSucceeded(); - await PageObjects.savedObjects.clickImportDone(); - - // Second, we need to delete the index pattern - await PageObjects.savedObjects.clickCheckboxByTitle('logstash-*'); - await PageObjects.savedObjects.clickDelete(); - - // Last, import a saved object connected to the saved search - // This should NOT show the conflicts - await PageObjects.savedObjects.importFile( - path.join(__dirname, 'exports', '_import_objects_connected_to_saved_search.json') - ); - // Wait for all the saves to happen - await PageObjects.savedObjects.checkNoneImported(); - await PageObjects.savedObjects.clickImportDone(); - - const objects = await PageObjects.savedObjects.getRowTitles(); - const isSavedObjectImported = objects.includes('saved object connected to saved search'); - expect(isSavedObjectImported).to.be(false); - }); - - it('should import saved objects with index patterns when index patterns already exists', async () => { - // First, import the objects - await PageObjects.savedObjects.importFile( - path.join(__dirname, 'exports', '_import_objects_with_index_patterns.json') - ); - await PageObjects.savedObjects.clickImportDone(); - - const objects = await PageObjects.savedObjects.getRowTitles(); - const isSavedObjectImported = objects.includes('saved object imported with index pattern'); - expect(isSavedObjectImported).to.be(true); - }); - - it('should preserve index patterns selection when switching between pages', async () => { - await PageObjects.savedObjects.importFile( - path.join(__dirname, 'exports', '_import_objects_missing_all_index_patterns.json') - ); - - await PageObjects.savedObjects.setOverriddenIndexPatternValue( - 'missing-index-pattern-1', - 'index-pattern-test-1' - ); - - const flyout = await testSubjects.find('importSavedObjectsFlyout'); - - await (await flyout.findByTestSubject('pagination-button-next')).click(); - - await PageObjects.savedObjects.setOverriddenIndexPatternValue( - 'missing-index-pattern-7', - 'index-pattern-test-2' - ); - - await (await flyout.findByTestSubject('pagination-button-previous')).click(); - - const selectedIdForMissingIndexPattern1 = await testSubjects.getAttribute( - 'managementChangeIndexSelection-missing-index-pattern-1', - 'value' - ); - - expect(selectedIdForMissingIndexPattern1).to.eql('f1e4c910-a2e6-11e7-bb30-233be9be6a20'); - - await (await flyout.findByTestSubject('pagination-button-next')).click(); - - const selectedIdForMissingIndexPattern7 = await testSubjects.getAttribute( - 'managementChangeIndexSelection-missing-index-pattern-7', - 'value' - ); - - expect(selectedIdForMissingIndexPattern7).to.eql('f1e4c910-a2e6-11e7-bb30-233be9be6a87'); - }); - - it('should display an explicit error message when importing object from a higher Kibana version', async () => { - await PageObjects.savedObjects.importFile( - path.join(__dirname, 'exports', '_import_higher_version.ndjson') - ); - - await PageObjects.savedObjects.checkImportError(); - - const errorText = await PageObjects.savedObjects.getImportErrorText(); - - expect(errorText).to.contain( - `has property "visualization" which belongs to a more recent version of Kibana [9.15.82]` - ); - }); - - describe('when bigger than savedObjects.maxImportPayloadBytes (not Cloud)', function () { - // see --savedObjects.maxImportPayloadBytes in config file - this.tags(['skipCloud']); - it('should display an explicit error message when importing a file bigger than allowed', async () => { - await PageObjects.savedObjects.importFile( - path.join(__dirname, 'exports', '_import_too_big.ndjson') - ); - - await PageObjects.savedObjects.checkImportError(); - - const errorText = await PageObjects.savedObjects.getImportErrorText(); - - expect(errorText).to.contain(`Payload content length greater than maximum allowed`); - }); - }); - - it('should display an explicit error message when importing an invalid file', async () => { - await PageObjects.savedObjects.importFile( - path.join(__dirname, 'exports', '_import_invalid_format.ndjson') - ); - - await PageObjects.savedObjects.checkImportError(); - - const errorText = await PageObjects.savedObjects.getImportErrorText(); - - expect(errorText).to.contain(`Unexpected token T in JSON at position 0`); - }); - }); }); } diff --git a/test/functional/apps/management/_index_patterns_empty.ts b/test/functional/apps/management/_index_patterns_empty.ts index 038039275b843..e086a6ca18213 100644 --- a/test/functional/apps/management/_index_patterns_empty.ts +++ b/test/functional/apps/management/_index_patterns_empty.ts @@ -32,6 +32,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { path: '/logstash-a', method: 'DELETE', }); + await kibanaServer.savedObjects.clean({ types: ['index-pattern'] }); }); // create index pattern and return to verify list diff --git a/test/functional/apps/management/_mgmt_import_saved_objects.js b/test/functional/apps/management/_mgmt_import_saved_objects.js index 84e57a798c006..cf30b6f4ccf0d 100644 --- a/test/functional/apps/management/_mgmt_import_saved_objects.js +++ b/test/functional/apps/management/_mgmt_import_saved_objects.js @@ -10,27 +10,27 @@ import expect from '@kbn/expect'; import path from 'path'; export default function ({ getService, getPageObjects }) { - const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const PageObjects = getPageObjects(['common', 'settings', 'header', 'savedObjects']); //in 6.4.0 bug the Saved Search conflict would be resolved and get imported but the visualization //that referenced the saved search was not imported.( https://github.com/elastic/kibana/issues/22238) describe('mgmt saved objects', function describeIndexTests() { - beforeEach(async function () { - await esArchiver.emptyKibanaIndex(); - await esArchiver.load('test/functional/fixtures/es_archiver/discover'); + before(async () => { + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); await PageObjects.settings.navigateTo(); }); - afterEach(async function () { - await esArchiver.unload('test/functional/fixtures/es_archiver/discover'); + after(async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); + await kibanaServer.savedObjects.clean({ types: ['search', 'visualization'] }); }); it('should import saved objects mgmt', async function () { await PageObjects.settings.clickKibanaSavedObjects(); await PageObjects.savedObjects.importFile( - path.join(__dirname, 'exports', 'mgmt_import_objects.json') + path.join(__dirname, 'exports', 'mgmt_import_objects.ndjson') ); await PageObjects.settings.associateIndexPattern( '4c3f3c30-ac94-11e8-a651-614b2788174a', diff --git a/test/functional/apps/management/_runtime_fields.js b/test/functional/apps/management/_runtime_fields.js index 745a3f9b079a4..09fa924b0b870 100644 --- a/test/functional/apps/management/_runtime_fields.js +++ b/test/functional/apps/management/_runtime_fields.js @@ -9,7 +9,6 @@ import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { - const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const log = getService('log'); const browser = getService('browser'); @@ -23,16 +22,12 @@ export default function ({ getService, getPageObjects }) { before(async function () { await browser.setWindowSize(1200, 800); - await esArchiver.load('test/functional/fixtures/es_archiver/discover'); - // delete .kibana index and then wait for Kibana to re-create it + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); await kibanaServer.uiSettings.replace({}); - await kibanaServer.uiSettings.update({}); }); after(async function afterAll() { - await PageObjects.settings.navigateTo(); - await PageObjects.settings.clickKibanaIndexPatterns(); - await PageObjects.settings.removeLogstashIndexPatternIfExist(); + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); }); describe('create runtime field', function describeIndexTests() { diff --git a/test/functional/apps/management/_scripted_fields.js b/test/functional/apps/management/_scripted_fields.js index 2ff9e55c59ebb..4aa06f4cd9ad7 100644 --- a/test/functional/apps/management/_scripted_fields.js +++ b/test/functional/apps/management/_scripted_fields.js @@ -25,7 +25,6 @@ import expect from '@kbn/expect'; export default function ({ getService, getPageObjects }) { - const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const log = getService('log'); const browser = getService('browser'); @@ -46,16 +45,14 @@ export default function ({ getService, getPageObjects }) { before(async function () { await browser.setWindowSize(1200, 800); - await esArchiver.load('test/functional/fixtures/es_archiver/discover'); - // delete .kibana index and then wait for Kibana to re-create it + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); await kibanaServer.uiSettings.replace({}); await kibanaServer.uiSettings.update({ 'doc_table:legacy': true }); }); after(async function afterAll() { - await PageObjects.settings.navigateTo(); - await PageObjects.settings.clickKibanaIndexPatterns(); - await PageObjects.settings.removeLogstashIndexPatternIfExist(); + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); + await kibanaServer.uiSettings.replace({}); }); it('should not allow saving of invalid scripts', async function () { @@ -125,7 +122,7 @@ export default function ({ getService, getPageObjects }) { 'painless', 'number', null, - '1', + '100', script ); await retry.try(async function () { diff --git a/test/functional/apps/management/exports/_import_index_patterns_multiple_exists.json b/test/functional/apps/management/exports/_import_index_patterns_multiple_exists.json deleted file mode 100644 index 2eb64b1c7ca9f..0000000000000 --- a/test/functional/apps/management/exports/_import_index_patterns_multiple_exists.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "_id": "f1e4c910-a2e6-11e7-bb30-233be9be6a20", - "_type": "index-pattern", - "_source": { - "title": "index-pattern-test-1", - "timeFieldName": "@timestamp", - "fields": "[{\"name\":\"referer\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"agent\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:image:width\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"xss.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"headings.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:description\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.user.lastname\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:tag.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"geo.dest\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:image\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:section.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"utc_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:card\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.char\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"clientip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image:height\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"host\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"machine.ram\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"links\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"id\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@tags.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"phpmemory\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:card.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"ip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:modified_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:site_name.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"request.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:tag\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"agent.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"spaces\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:site.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"headings\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"relatedContent.og:image.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"request\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"index.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"extension\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"memory\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"relatedContent.twitter:site\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:description\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"geo.coordinates\",\"type\":\"geo_point\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"meta.related\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:title.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:title.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"response.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@message.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"machine.os\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:section\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"xss\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"links.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:title\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"geo.srcdest\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"extension.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"machine.os.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@tags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"host.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:type.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"geo.src\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"spaces.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image:height.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:description.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:site_name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:title\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"@message\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:image.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@timestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"response\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.user.firstname\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:image:width.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:description.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:published_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"expression script\",\"type\":\"number\",\"count\":0,\"scripted\":true,\"script\":\"doc['bytes'].value\",\"lang\":\"expression\",\"indexed\":true,\"analyzed\":false,\"doc_values\":false}]" - }, - "_meta": { - "savedObjectVersion": 1 - } - }, - { - "_id": "f1e4c910-a2e6-11e7-bb30-233be9be6a87", - "_type": "index-pattern", - "_source": { - "title": "index-pattern-test-2", - "timeFieldName": "@timestamp", - "fields": "[{\"name\":\"referer\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"agent\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:image:width\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"xss.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"headings.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:description\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.user.lastname\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:tag.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"geo.dest\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:image\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:section.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"utc_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:card\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.char\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"clientip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image:height\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"host\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"machine.ram\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"links\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"id\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@tags.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"phpmemory\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:card.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"ip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:modified_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:site_name.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"request.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:tag\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"agent.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"spaces\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:site.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"headings\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"relatedContent.og:image.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"request\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"index.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"extension\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"memory\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"relatedContent.twitter:site\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:description\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"geo.coordinates\",\"type\":\"geo_point\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"meta.related\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:title.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:title.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"response.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@message.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"machine.os\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:section\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"xss\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"links.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:title\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"geo.srcdest\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"extension.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"machine.os.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@tags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"host.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:type.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"geo.src\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"spaces.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image:height.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:description.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:site_name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:title\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"@message\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:image.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@timestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"response\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.user.firstname\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:image:width.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:description.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:published_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"expression script\",\"type\":\"number\",\"count\":0,\"scripted\":true,\"script\":\"doc['bytes'].value\",\"lang\":\"expression\",\"indexed\":true,\"analyzed\":false,\"doc_values\":false}]" - }, - "_meta": { - "savedObjectVersion": 1 - } - } -] diff --git a/test/functional/apps/management/exports/_import_objects.json b/test/functional/apps/management/exports/_import_objects.json deleted file mode 100644 index 48015d64133fb..0000000000000 --- a/test/functional/apps/management/exports/_import_objects.json +++ /dev/null @@ -1,19 +0,0 @@ -[ - { - "_id": "082f1d60-a2e7-11e7-bb30-233be9be6a15", - "_type": "visualization", - "_source": { - "title": "Log Agents", - "visState": "{\"title\":\"Log Agents\",\"type\":\"area\",\"params\":{\"type\":\"area\",\"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},\"title\":{\"text\":\"agent.raw: Descending\"}}],\"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\":\"area\",\"mode\":\"stacked\",\"data\":{\"label\":\"Count\",\"id\":\"1\"},\"drawLinesBetweenPoints\":true,\"showCircles\":true,\"interpolate\":\"linear\",\"valueAxis\":\"ValueAxis-1\"}],\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"times\":[],\"addTimeMarker\":false},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"agent.raw\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\"}}]}", - "uiStateJSON": "{}", - "description": "", - "version": 1, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"index\":\"f1e4c910-a2e6-11e7-bb30-233be9be6a15\",\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}" - } - }, - "_meta": { - "savedObjectVersion": 2 - } - } -] diff --git a/test/functional/apps/management/exports/_import_objects_connected_to_saved_search.json b/test/functional/apps/management/exports/_import_objects_connected_to_saved_search.json deleted file mode 100644 index 7088e1ab34b64..0000000000000 --- a/test/functional/apps/management/exports/_import_objects_connected_to_saved_search.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - { - "_id": "saved_object_connected_to_saved_search", - "_type": "visualization", - "_source": { - "title": "saved object connected to saved search", - "visState": "{\"title\":\"PHP Viz\",\"type\":\"horizontal_bar\",\"params\":{\"type\":\"histogram\",\"grid\":{\"categoryLines\":false,\"style\":{\"color\":\"#eee\"}},\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"type\":\"category\",\"position\":\"left\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\"},\"labels\":{\"show\":true,\"rotate\":0,\"filter\":false,\"truncate\":200},\"title\":{}}],\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"name\":\"LeftAxis-1\",\"type\":\"value\",\"position\":\"bottom\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\",\"mode\":\"normal\"},\"labels\":{\"show\":true,\"rotate\":75,\"filter\":true,\"truncate\":100},\"title\":{\"text\":\"Count\"}}],\"seriesParams\":[{\"show\":true,\"type\":\"histogram\",\"mode\":\"normal\",\"data\":{\"label\":\"Count\",\"id\":\"1\"},\"valueAxis\":\"ValueAxis-1\",\"drawLinesBetweenPoints\":true,\"showCircles\":true}],\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"times\":[],\"addTimeMarker\":false},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}}]}", - "uiStateJSON": "{}", - "description": "", - "savedSearchId": "c45e6c50-ba72-11e7-a8f9-ad70f02e633d", - "version": 1, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}" - } - }, - "_meta": { - "savedObjectVersion": 2 - } - } -] diff --git a/test/functional/apps/management/exports/_import_objects_exists.json b/test/functional/apps/management/exports/_import_objects_exists.json deleted file mode 100644 index 5356d1fdf6477..0000000000000 --- a/test/functional/apps/management/exports/_import_objects_exists.json +++ /dev/null @@ -1,19 +0,0 @@ -[ - { - "_id": "Shared-Item-Visualization-AreaChart", - "_type": "visualization", - "_source": { - "title": "Shared-Item Visualization AreaChart", - "visState": "{\"title\":\"New Visualization\",\"type\":\"area\",\"params\":{\"shareYAxis\":true,\"addTooltip\":true,\"addLegend\":true,\"smoothLines\":false,\"scale\":\"linear\",\"interpolate\":\"linear\",\"mode\":\"stacked\",\"times\":[],\"addTimeMarker\":false,\"defaultYExtents\":false,\"setYExtents\":false,\"yAxis\":{}},\"aggs\":[{\"id\":\"1\",\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"type\":\"date_histogram\",\"schema\":\"segment\",\"params\":{\"field\":\"@timestamp\",\"interval\":\"auto\",\"customInterval\":\"2h\",\"min_doc_count\":1,\"extended_bounds\":{}}}],\"listeners\":{}}", - "uiStateJSON": "{}", - "description": "AreaChart", - "version": 1, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"index\":\"logstash-*\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}" - } - }, - "_meta": { - "savedObjectVersion": 2 - } - } -] diff --git a/test/functional/apps/management/exports/_import_objects_missing_all_index_patterns.json b/test/functional/apps/management/exports/_import_objects_missing_all_index_patterns.json deleted file mode 100644 index 45572b0bf34fe..0000000000000 --- a/test/functional/apps/management/exports/_import_objects_missing_all_index_patterns.json +++ /dev/null @@ -1,121 +0,0 @@ -[ - { - "_id": "test-vis-1", - "_type": "visualization", - "_source": { - "title": "Test VIS 1", - "visState": "{\"title\":\"test vis 1\",\"type\":\"histogram\"}", - "uiStateJSON": "{}", - "description": "", - "version": 1, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"index\":\"missing-index-pattern-1\",\"query\":{}}" - } - }, - "_meta": { - "savedObjectVersion": 2 - } - }, - { - "_id": "test-vis-2", - "_type": "visualization", - "_source": { - "title": "Test VIS 2", - "visState": "{\"title\":\"test vis 2\",\"type\":\"histogram\"}", - "uiStateJSON": "{}", - "description": "", - "version": 1, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"index\":\"missing-index-pattern-2\",\"query\":{}}" - } - }, - "_meta": { - "savedObjectVersion": 2 - } - }, - { - "_id": "test-vis-3", - "_type": "visualization", - "_source": { - "title": "Test VIS 3", - "visState": "{\"title\":\"test vis 3\",\"type\":\"histogram\"}", - "uiStateJSON": "{}", - "description": "", - "version": 1, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"index\":\"missing-index-pattern-3\",\"query\":{}}" - } - }, - "_meta": { - "savedObjectVersion": 2 - } - }, - { - "_id": "test-vis-4", - "_type": "visualization", - "_source": { - "title": "Test VIS 4", - "visState": "{\"title\":\"test vis 4\",\"type\":\"histogram\"}", - "uiStateJSON": "{}", - "description": "", - "version": 1, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"index\":\"missing-index-pattern-4\",\"query\":{}}" - } - }, - "_meta": { - "savedObjectVersion": 2 - } - }, - { - "_id": "test-vis-5", - "_type": "visualization", - "_source": { - "title": "Test VIS 5", - "visState": "{\"title\":\"test vis 5\",\"type\":\"histogram\"}", - "uiStateJSON": "{}", - "description": "", - "version": 1, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"index\":\"missing-index-pattern-5\",\"query\":{}}" - } - }, - "_meta": { - "savedObjectVersion": 2 - } - }, - { - "_id": "test-vis-6", - "_type": "visualization", - "_source": { - "title": "Test VIS 6", - "visState": "{\"title\":\"test vis 6\",\"type\":\"histogram\"}", - "uiStateJSON": "{}", - "description": "", - "version": 1, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"index\":\"missing-index-pattern-6\",\"query\":{}}" - } - }, - "_meta": { - "savedObjectVersion": 2 - } - }, - { - "_id": "test-vis-7", - "_type": "visualization", - "_source": { - "title": "Test VIS 7", - "visState": "{\"title\":\"test vis 7\",\"type\":\"histogram\"}", - "uiStateJSON": "{}", - "description": "", - "version": 1, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"index\":\"missing-index-pattern-7\",\"query\":{}}" - } - }, - "_meta": { - "savedObjectVersion": 2 - } - } -] diff --git a/test/functional/apps/management/exports/_import_objects_multiple_exists.json b/test/functional/apps/management/exports/_import_objects_multiple_exists.json deleted file mode 100644 index 9e554aecd9f7a..0000000000000 --- a/test/functional/apps/management/exports/_import_objects_multiple_exists.json +++ /dev/null @@ -1,36 +0,0 @@ -[ - { - "_id": "test-1", - "_type": "visualization", - "_source": { - "title": "Visualization test 1", - "visState": "{\"title\":\"New Visualization\",\"type\":\"area\",\"params\":{\"shareYAxis\":true,\"addTooltip\":true,\"addLegend\":true,\"smoothLines\":false,\"scale\":\"linear\",\"interpolate\":\"linear\",\"mode\":\"stacked\",\"times\":[],\"addTimeMarker\":false,\"defaultYExtents\":false,\"setYExtents\":false,\"yAxis\":{}},\"aggs\":[{\"id\":\"1\",\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"type\":\"date_histogram\",\"schema\":\"segment\",\"params\":{\"field\":\"@timestamp\",\"interval\":\"auto\",\"customInterval\":\"2h\",\"min_doc_count\":1,\"extended_bounds\":{}}}],\"listeners\":{}}", - "uiStateJSON": "{}", - "description": "AreaChart", - "version": 1, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"index\":\"logstash-*\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}" - } - }, - "_meta": { - "savedObjectVersion": 2 - } - }, - { - "_id": "test-2", - "_type": "visualization", - "_source": { - "title": "Visualization test 2", - "visState": "{\"title\":\"New Visualization\",\"type\":\"area\",\"params\":{\"shareYAxis\":true,\"addTooltip\":true,\"addLegend\":true,\"smoothLines\":false,\"scale\":\"linear\",\"interpolate\":\"linear\",\"mode\":\"stacked\",\"times\":[],\"addTimeMarker\":false,\"defaultYExtents\":false,\"setYExtents\":false,\"yAxis\":{}},\"aggs\":[{\"id\":\"1\",\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"type\":\"date_histogram\",\"schema\":\"segment\",\"params\":{\"field\":\"@timestamp\",\"interval\":\"auto\",\"customInterval\":\"2h\",\"min_doc_count\":1,\"extended_bounds\":{}}}],\"listeners\":{}}", - "uiStateJSON": "{}", - "description": "AreaChart", - "version": 1, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"index\":\"logstash-*\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}" - } - }, - "_meta": { - "savedObjectVersion": 2 - } - } -] diff --git a/test/functional/apps/management/exports/_import_objects_saved_search.json b/test/functional/apps/management/exports/_import_objects_saved_search.json deleted file mode 100644 index bfd034a7086d2..0000000000000 --- a/test/functional/apps/management/exports/_import_objects_saved_search.json +++ /dev/null @@ -1,25 +0,0 @@ -[ - { - "_id": "c45e6c50-ba72-11e7-a8f9-ad70f02e633d", - "_type": "search", - "_source": { - "title": "PHP saved search", - "description": "", - "hits": 0, - "columns": [ - "_source" - ], - "sort": [ - "@timestamp", - "desc" - ], - "version": 1, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"index\":\"f1e4c910-a2e6-11e7-bb30-233be9be6a15\",\"highlightAll\":true,\"version\":true,\"query\":{\"language\":\"lucene\",\"query\":\"php\"},\"filter\":[]}" - } - }, - "_meta": { - "savedObjectVersion": 2 - } - } -] diff --git a/test/functional/apps/management/exports/_import_objects_with_index_patterns.json b/test/functional/apps/management/exports/_import_objects_with_index_patterns.json deleted file mode 100644 index a0288652dddac..0000000000000 --- a/test/functional/apps/management/exports/_import_objects_with_index_patterns.json +++ /dev/null @@ -1,31 +0,0 @@ -[ - { - "_id": "f1e4c910-a2e6-11e7-bb30-233be9be6a15", - "_type": "index-pattern", - "_source": { - "title": "logstash-*", - "timeFieldName": "@timestamp", - "fields": "[{\"name\":\"referer\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"agent\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:image:width\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"xss.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"headings.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:description\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.user.lastname\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:tag.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"geo.dest\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:image\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:section.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"utc_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:card\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.char\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"clientip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image:height\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"host\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"machine.ram\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"links\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"id\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@tags.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"phpmemory\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.twitter:card.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"ip\",\"type\":\"ip\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:modified_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:site_name.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"request.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:tag\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"agent.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"spaces\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:site.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"headings\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"relatedContent.og:image.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"request\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"index.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"extension\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"memory\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"relatedContent.twitter:site\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:description\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"geo.coordinates\",\"type\":\"geo_point\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"meta.related\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:title.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:title.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"response.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@message.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"machine.os\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.article:section\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"xss\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"links.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:title\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"geo.srcdest\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"url.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"extension.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"machine.os.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@tags\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"host.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:type.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"geo.src\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"spaces.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:image:height.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"url\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:description.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:site_name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:title\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"@message\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.twitter:image.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"@timestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"bytes\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"response\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"meta.user.firstname\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":true,\"doc_values\":false},{\"name\":\"relatedContent.og:image:width.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.og:description.raw\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"relatedContent.article:published_time\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"indexed\":true,\"analyzed\":false,\"doc_values\":true},{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"indexed\":false,\"analyzed\":false,\"doc_values\":false},{\"name\":\"expression script\",\"type\":\"number\",\"count\":0,\"scripted\":true,\"script\":\"doc['bytes'].value\",\"lang\":\"expression\",\"indexed\":true,\"analyzed\":false,\"doc_values\":false}]" - }, - "_meta": { - "savedObjectVersion": 2 - } - }, - { - "_id": "saved_object_imported_with_index_pattern", - "_type": "visualization", - "_source": { - "title": "saved object imported with index pattern", - "visState": "{\"title\":\"New Visualization\",\"type\":\"area\",\"params\":{\"shareYAxis\":true,\"addTooltip\":true,\"addLegend\":true,\"smoothLines\":false,\"scale\":\"linear\",\"interpolate\":\"linear\",\"mode\":\"stacked\",\"times\":[],\"addTimeMarker\":false,\"defaultYExtents\":false,\"setYExtents\":false,\"yAxis\":{}},\"aggs\":[{\"id\":\"1\",\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"type\":\"date_histogram\",\"schema\":\"segment\",\"params\":{\"field\":\"@timestamp\",\"interval\":\"auto\",\"customInterval\":\"2h\",\"min_doc_count\":1,\"extended_bounds\":{}}}],\"listeners\":{}}", - "uiStateJSON": "{}", - "description": "AreaChart", - "version": 1, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"index\":\"f1e4c910-a2e6-11e7-bb30-233be9be6a15\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}" - } - }, - "_meta": { - "savedObjectVersion": 2 - } - } -] diff --git a/test/functional/apps/management/exports/mgmt_import_objects.json b/test/functional/apps/management/exports/mgmt_import_objects.json deleted file mode 100644 index 88e03585bf1ee..0000000000000 --- a/test/functional/apps/management/exports/mgmt_import_objects.json +++ /dev/null @@ -1,37 +0,0 @@ -[ - { - "_id": "6aea5700-ac94-11e8-a651-614b2788174a", - "_type": "search", - "_source": { - "title": "mysavedsearch", - "description": "", - "hits": 0, - "columns": [ - "_source" - ], - "sort": [ - "@timestamp", - "desc" - ], - "version": 1, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"index\":\"4c3f3c30-ac94-11e8-a651-614b2788174a\",\"highlightAll\":true,\"version\":true,\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[]}" - } - } - }, - { - "_id": "8411daa0-ac94-11e8-a651-614b2788174a", - "_type": "visualization", - "_source": { - "title": "mysavedviz", - "visState": "{\"title\":\"mysavedviz\",\"type\":\"pie\",\"params\":{\"type\":\"pie\",\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"isDonut\":true,\"labels\":{\"show\":false,\"values\":true,\"last_level\":true,\"truncate\":100}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}}]}", - "uiStateJSON": "{}", - "description": "", - "savedSearchId": "6aea5700-ac94-11e8-a651-614b2788174a", - "version": 1, - "kibanaSavedObjectMeta": { - "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[]}" - } - } - } -] diff --git a/test/functional/apps/timelion/_expression_typeahead.js b/test/functional/apps/timelion/_expression_typeahead.js deleted file mode 100644 index 3b29e9a44a77b..0000000000000 --- a/test/functional/apps/timelion/_expression_typeahead.js +++ /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 expect from '@kbn/expect'; - -export default function ({ getPageObjects }) { - const PageObjects = getPageObjects(['common', 'timelion', 'settings', 'timePicker']); - - describe('expression typeahead', () => { - before(async () => { - await PageObjects.timelion.initTests(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - }); - - it('should show argument suggestions when function suggestion is selected', async () => { - await PageObjects.timelion.setExpression('.es'); - await PageObjects.timelion.clickSuggestion(); - const suggestions = await PageObjects.timelion.getSuggestionItemsText(); - expect(suggestions.length).to.eql(9); - expect(suggestions[0].includes('fit=')).to.eql(true); - }); - - it('should show argument value suggestions when argument is selected', async () => { - await PageObjects.timelion.setExpression('.legend'); - await PageObjects.timelion.clickSuggestion(); - const argumentSuggestions = await PageObjects.timelion.getSuggestionItemsText(); - expect(argumentSuggestions.length).to.eql(4); - expect(argumentSuggestions[1].includes('position=')).to.eql(true); - await PageObjects.timelion.clickSuggestion(1); - const valueSuggestions = await PageObjects.timelion.getSuggestionItemsText(); - expect(valueSuggestions.length).to.eql(5); - expect(valueSuggestions[0].includes('disable legend')).to.eql(true); - expect(valueSuggestions[1].includes('place legend in north east corner')).to.eql(true); - }); - - it('should display function suggestions filtered by function name', async () => { - await PageObjects.timelion.setExpression('.e'); - const suggestions = await PageObjects.timelion.getSuggestionItemsText(); - expect(suggestions.length).to.eql(2); - expect(suggestions[0].includes('.elasticsearch()')).to.eql(true); - expect(suggestions[1].includes('.es()')).to.eql(true); - }); - - describe('dynamic suggestions for argument values', () => { - describe('.es()', () => { - before(async () => { - await PageObjects.timelion.setExpression('.es'); - await PageObjects.timelion.clickSuggestion(); - }); - - it('should show index pattern suggestions for index argument', async () => { - await PageObjects.timelion.updateExpression('index='); - const suggestions = await PageObjects.timelion.getSuggestionItemsText(); - expect(suggestions.length).to.eql(1); - expect(suggestions[0].includes('logstash-*')).to.eql(true); - await PageObjects.timelion.clickSuggestion(); - }); - - it('should show field suggestions for timefield argument when index pattern set', async () => { - await PageObjects.timelion.updateExpression(',timefield='); - const suggestions = await PageObjects.timelion.getSuggestionItemsText(); - expect(suggestions.length).to.eql(4); - expect(suggestions[0].includes('@timestamp')).to.eql(true); - await PageObjects.timelion.clickSuggestion(); - }); - - it('should show field suggestions for split argument when index pattern set', async () => { - await PageObjects.timelion.updateExpression(',split='); - const suggestions = await PageObjects.timelion.getSuggestionItemsText(); - expect(suggestions.length).not.to.eql(0); - expect(suggestions[0].includes('@message.raw')).to.eql(true); - await PageObjects.timelion.clickSuggestion(10); - }); - - it('should show field suggestions for metric argument when index pattern set', async () => { - await PageObjects.timelion.updateExpression(',metric='); - await PageObjects.timelion.updateExpression('avg:'); - await PageObjects.timelion.clickSuggestion(0); - const suggestions = await PageObjects.timelion.getSuggestionItemsText(); - expect(suggestions.length).not.to.eql(0); - expect(suggestions[0].includes('avg:bytes')).to.eql(true); - }); - }); - }); - }); -} diff --git a/test/functional/apps/timelion/index.js b/test/functional/apps/timelion/index.js deleted file mode 100644 index b81a0e70d8a6d..0000000000000 --- a/test/functional/apps/timelion/index.js +++ /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. - */ - -export default function ({ getService, loadTestFile }) { - const browser = getService('browser'); - const log = getService('log'); - const esArchiver = getService('esArchiver'); - const kibanaServer = getService('kibanaServer'); - - describe('timelion app', function () { - this.tags('ciGroup1'); - - before(async function () { - log.debug('Starting timelion before method'); - await browser.setWindowSize(1280, 800); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*' }); - }); - - loadTestFile(require.resolve('./_expression_typeahead')); - }); -} diff --git a/test/functional/apps/visualize/_area_chart.ts b/test/functional/apps/visualize/_area_chart.ts index e88754823f6cb..4e4fe5e2902b9 100644 --- a/test/functional/apps/visualize/_area_chart.ts +++ b/test/functional/apps/visualize/_area_chart.ts @@ -26,18 +26,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'header', 'timePicker', ]); + const xyChartSelector = 'visTypeXyChart'; - const getVizName = async () => - await PageObjects.visChart.getExpectedValue( - 'Visualization AreaChart Name Test', - 'Visualization AreaChart Name Test - Charts library' - ); + const vizName = 'Visualization AreaChart Name Test - Charts library'; describe('area charts', function indexPatternCreation() { - let isNewChartsLibraryEnabled = false; before(async () => { - isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); - await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); + await PageObjects.visualize.initTests(); }); const initAreaChart = async () => { log.debug('navigateToApp visualize'); @@ -58,7 +53,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const intervalValue = await PageObjects.visEditor.getInterval(); log.debug('intervalValue = ' + intervalValue); expect(intervalValue[0]).to.be('Auto'); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); }; before(async function () { @@ -75,49 +70,38 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should save and load with special characters', async function () { - const vizNamewithSpecialChars = (await getVizName()) + '/?&=%'; + const vizNamewithSpecialChars = vizName + '/?&=%'; await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb( vizNamewithSpecialChars ); }); it('should save and load with non-ascii characters', async function () { - const vizNamewithSpecialChars = `${await getVizName()} with Umlaut ä`; + const vizNamewithSpecialChars = `${vizName} with Umlaut ä`; await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb( vizNamewithSpecialChars ); }); it('should save and load', async function () { - await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(await getVizName()); - await PageObjects.visualize.loadSavedVisualization(await getVizName()); + await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(vizName); + await PageObjects.visualize.loadSavedVisualization(vizName); await PageObjects.visChart.waitForVisualization(); }); - // Should be removed when this issue is closed https://github.com/elastic/kibana/issues/103209 - it('should show/hide a deprecation warning depending on the library selected', async () => { - await PageObjects.visualize.getDeprecationWarningStatus(); - }); - it('should have inspector enabled', async function () { await inspector.expectIsEnabled(); }); it('should show correct chart', async function () { - const xAxisLabels = await PageObjects.visChart.getExpectedValue( - ['2015-09-20 00:00', '2015-09-21 00:00', '2015-09-22 00:00', '2015-09-23 00:00'], - [ - '2015-09-19 12:00', - '2015-09-20 12:00', - '2015-09-21 12:00', - '2015-09-22 12:00', - '2015-09-23 12:00', - ] - ); - const yAxisLabels = await PageObjects.visChart.getExpectedValue( - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400', '1,600'], - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400'] - ); + const xAxisLabels = [ + '2015-09-19 12:00', + '2015-09-20 12:00', + '2015-09-21 12:00', + '2015-09-22 12:00', + '2015-09-23 12:00', + ]; + const yAxisLabels = ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400']; const expectedAreaChartData = [ 37, 202, @@ -146,14 +130,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ]; await retry.try(async function tryingForTime() { - const labels = await PageObjects.visChart.getXAxisLabels(); + const labels = await PageObjects.visChart.getXAxisLabels(xyChartSelector); log.debug('X-Axis labels = ' + labels); expect(labels).to.eql(xAxisLabels); }); - const labels = await PageObjects.visChart.getYAxisLabels(); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); log.debug('Y-Axis labels = ' + labels); expect(labels).to.eql(yAxisLabels); - const paths = await PageObjects.visChart.getAreaChartData('Count'); + const paths = await PageObjects.visChart.getAreaChartData('Count', xyChartSelector); log.debug('expectedAreaChartData = ' + expectedAreaChartData); log.debug('actual chart data = ' + paths); expect(paths).to.eql(expectedAreaChartData); @@ -220,7 +204,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.toggleOpenEditor(2); await PageObjects.visEditor.setInterval('Second'); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); await inspector.open(); await inspector.expectTableData(expectedTableData); await inspector.close(); @@ -252,7 +236,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.toggleAdvancedParams('2'); await PageObjects.visEditor.toggleScaleMetrics(); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); await inspector.open(); await inspector.expectTableData(expectedTableData); await inspector.close(); @@ -286,7 +270,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.selectAggregation('Top Hit', 'metrics'); await PageObjects.visEditor.selectField('bytes', 'metrics'); await PageObjects.visEditor.selectAggregateWith('average'); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); await inspector.open(); await inspector.expectTableData(expectedTableData); await inspector.close(); @@ -320,10 +304,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.clickYAxisOptions(axisId); await PageObjects.visEditor.selectYAxisScaleType(axisId, 'log'); await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(); - const minLabel = await PageObjects.visChart.getExpectedValue(2, 1); - const maxLabel = await PageObjects.visChart.getExpectedValue(5000, 900); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(xyChartSelector); + const minLabel = 1; + const maxLabel = 900; const numberOfLabels = 10; expect(labels.length).to.be.greaterThan(numberOfLabels); expect(labels[0]).to.eql(minLabel); @@ -332,10 +316,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should show filtered ticks on selecting log scale', async () => { await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(); - const minLabel = await PageObjects.visChart.getExpectedValue(2, 1); - const maxLabel = await PageObjects.visChart.getExpectedValue(5000, 900); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(xyChartSelector); + const minLabel = 1; + const maxLabel = 900; const numberOfLabels = 10; expect(labels.length).to.be.greaterThan(numberOfLabels); expect(labels[0]).to.eql(minLabel); @@ -345,47 +329,35 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should show ticks on selecting square root scale', async () => { await PageObjects.visEditor.selectYAxisScaleType(axisId, 'square root'); await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400', '1,600'], - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400'] - ); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); + const expectedLabels = ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400']; expect(labels).to.eql(expectedLabels); }); it('should show filtered ticks on selecting square root scale', async () => { await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['200', '400', '600', '800', '1,000', '1,200', '1,400'], - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400'] - ); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); + const expectedLabels = ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400']; expect(labels).to.eql(expectedLabels); }); it('should show ticks on selecting linear scale', async () => { await PageObjects.visEditor.selectYAxisScaleType(axisId, 'linear'); await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); log.debug(labels); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400', '1,600'], - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400'] - ); + const expectedLabels = ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400']; expect(labels).to.eql(expectedLabels); }); it('should show filtered ticks on selecting linear scale', async () => { await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['200', '400', '600', '800', '1,000', '1,200', '1,400'], - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400'] - ); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); + const expectedLabels = ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400']; expect(labels).to.eql(expectedLabels); }); }); @@ -408,11 +380,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.selectAggregation('Date Histogram'); await PageObjects.visEditor.selectField('@timestamp'); await PageObjects.visEditor.setInterval('Year'); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); // This svg area is composed by 7 years (2013 - 2019). // 7 points are used to draw the upper line (usually called y1) // 7 points compose the lower line (usually called y0) - const paths = await PageObjects.visChart.getAreaChartPaths('Count'); + const paths = await PageObjects.visChart.getAreaChartPaths('Count', xyChartSelector); log.debug('actual chart data = ' + paths); const numberOfSegments = 7 * 2; expect(paths.length).to.eql(numberOfSegments); @@ -431,12 +403,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.selectAggregation('Date Histogram'); await PageObjects.visEditor.selectField('@timestamp'); await PageObjects.visEditor.setInterval('Month'); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); // This svg area is composed by 67 months 3 (2013) + 5 * 12 + 4 (2019) // 67 points are used to draw the upper line (usually called y1) // 67 points compose the lower line (usually called y0) const numberOfSegments = 67 * 2; - const paths = await PageObjects.visChart.getAreaChartPaths('Count'); + const paths = await PageObjects.visChart.getAreaChartPaths('Count', xyChartSelector); log.debug('actual chart data = ' + paths); expect(paths.length).to.eql(numberOfSegments); }); diff --git a/test/functional/apps/visualize/_line_chart_split_chart.ts b/test/functional/apps/visualize/_line_chart_split_chart.ts index 9b1c12de9666e..0e44c30499ed3 100644 --- a/test/functional/apps/visualize/_line_chart_split_chart.ts +++ b/test/functional/apps/visualize/_line_chart_split_chart.ts @@ -23,9 +23,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'visChart', 'timePicker', ]); + const xyChartSelector = 'visTypeXyChart'; describe('line charts - split chart', function () { - let isNewChartsLibraryEnabled = false; const initLineChart = async function () { log.debug('navigateToApp visualize'); await PageObjects.visualize.navigateToNewAggBasedVisualization(); @@ -41,12 +41,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.selectField('extension.raw'); log.debug('switch from Rows to Columns'); await PageObjects.visEditor.clickSplitDirection('Columns'); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); }; before(async () => { - isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); - await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); + await PageObjects.visualize.initTests(); await initLineChart(); }); @@ -61,7 +60,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // sleep a bit before trying to get the chart data await PageObjects.common.sleep(3000); - const data = await PageObjects.visChart.getLineChartData(); + const data = await PageObjects.visChart.getLineChartData(xyChartSelector); log.debug('data=' + data); const tolerance = 10; // the y-axis scale is 10000 so 10 is 0.1% for (let x = 0; x < data.length; x++) { @@ -92,9 +91,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('Order By = Term'); await PageObjects.visEditor.selectOrderByMetric(2, '_key'); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); await retry.try(async function () { - const data = await PageObjects.visChart.getLineChartData(); + const data = await PageObjects.visChart.getLineChartData(xyChartSelector); log.debug('data=' + data); const tolerance = 10; // the y-axis scale is 10000 so 10 is 0.1% for (let x = 0; x < data.length; x++) { @@ -161,10 +160,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should be able to save and load', async function () { - const vizName = await PageObjects.visChart.getExpectedValue( - 'Visualization Line split chart', - 'Visualization Line split chart - chart library' - ); + const vizName = 'Visualization Line split chart - chart library'; await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(vizName); await PageObjects.visualize.loadSavedVisualization(vizName); @@ -180,10 +176,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.clickYAxisOptions(axisId); await PageObjects.visEditor.selectYAxisScaleType(axisId, 'log'); await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(); - const minLabel = await PageObjects.visChart.getExpectedValue(2, 1); - const maxLabel = await PageObjects.visChart.getExpectedValue(5000, 7000); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(xyChartSelector); + const minLabel = 1; + const maxLabel = 7000; const numberOfLabels = 10; expect(labels.length).to.be.greaterThan(numberOfLabels); expect(labels[0]).to.eql(minLabel); @@ -192,10 +188,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should show filtered ticks on selecting log scale', async () => { await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(); - const minLabel = await PageObjects.visChart.getExpectedValue(2, 1); - const maxLabel = await PageObjects.visChart.getExpectedValue(5000, 7000); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(xyChartSelector); + const minLabel = 1; + const maxLabel = 7000; const numberOfLabels = 10; expect(labels.length).to.be.greaterThan(numberOfLabels); expect(labels[0]).to.eql(minLabel); @@ -205,48 +201,80 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should show ticks on selecting square root scale', async () => { await PageObjects.visEditor.selectYAxisScaleType(axisId, 'square root'); await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['0', '2,000', '4,000', '6,000', '8,000', '10,000'], - ['0', '1,000', '2,000', '3,000', '4,000', '5,000', '6,000', '7,000', '8,000', '9,000'] - ); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); + const expectedLabels = [ + '0', + '1,000', + '2,000', + '3,000', + '4,000', + '5,000', + '6,000', + '7,000', + '8,000', + '9,000', + ]; expect(labels).to.eql(expectedLabels); }); it('should show filtered ticks on selecting square root scale', async () => { await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['2,000', '4,000', '6,000', '8,000'], - ['0', '1,000', '2,000', '3,000', '4,000', '5,000', '6,000', '7,000', '8,000', '9,000'] - ); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); + const expectedLabels = [ + '0', + '1,000', + '2,000', + '3,000', + '4,000', + '5,000', + '6,000', + '7,000', + '8,000', + '9,000', + ]; expect(labels).to.eql(expectedLabels); }); it('should show ticks on selecting linear scale', async () => { await PageObjects.visEditor.selectYAxisScaleType(axisId, 'linear'); await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); log.debug(labels); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['0', '2,000', '4,000', '6,000', '8,000', '10,000'], - ['0', '1,000', '2,000', '3,000', '4,000', '5,000', '6,000', '7,000', '8,000', '9,000'] - ); + const expectedLabels = [ + '0', + '1,000', + '2,000', + '3,000', + '4,000', + '5,000', + '6,000', + '7,000', + '8,000', + '9,000', + ]; expect(labels).to.eql(expectedLabels); }); it('should show filtered ticks on selecting linear scale', async () => { await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['2,000', '4,000', '6,000', '8,000'], - ['0', '1,000', '2,000', '3,000', '4,000', '5,000', '6,000', '7,000', '8,000', '9,000'] - ); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); + const expectedLabels = [ + '0', + '1,000', + '2,000', + '3,000', + '4,000', + '5,000', + '6,000', + '7,000', + '8,000', + '9,000', + ]; expect(labels).to.eql(expectedLabels); }); }); @@ -274,16 +302,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.clickBucket('X-axis'); log.debug('Aggregation = Date Histogram'); await PageObjects.visEditor.selectAggregation('Date Histogram'); - await PageObjects.visEditor.clickGo(); - const title = await PageObjects.visChart.getYAxisTitle(); + await PageObjects.visEditor.clickGo(true); + const title = await PageObjects.visChart.getYAxisTitle(xyChartSelector); expect(title).to.be('Serial Diff of Count'); }); it('should change y-axis label to custom', async () => { log.debug('set custom label of y-axis to "Custom"'); await PageObjects.visEditor.setCustomLabel('Custom', 1); - await PageObjects.visEditor.clickGo(); - const title = await PageObjects.visChart.getYAxisTitle(); + await PageObjects.visEditor.clickGo(true); + const title = await PageObjects.visChart.getYAxisTitle(xyChartSelector); expect(title).to.be('Custom'); }); @@ -297,24 +325,24 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should apply with selected bucket', async () => { log.debug('Metrics agg = Average Bucket'); await PageObjects.visEditor.selectAggregation('Average Bucket', 'metrics'); - await PageObjects.visEditor.clickGo(); - const title = await PageObjects.visChart.getYAxisTitle(); + await PageObjects.visEditor.clickGo(true); + const title = await PageObjects.visChart.getYAxisTitle(xyChartSelector); expect(title).to.be('Overall Average of Count'); }); it('should change sub metric custom label and calculate y-axis title', async () => { log.debug('set custom label of sub metric to "Cats"'); await PageObjects.visEditor.setCustomLabel('Cats', '1-metric'); - await PageObjects.visEditor.clickGo(); - const title = await PageObjects.visChart.getYAxisTitle(); + await PageObjects.visEditor.clickGo(true); + const title = await PageObjects.visChart.getYAxisTitle(xyChartSelector); expect(title).to.be('Overall Average of Cats'); }); it('should outer custom label', async () => { log.debug('set custom label to "Custom"'); await PageObjects.visEditor.setCustomLabel('Custom', 1); - await PageObjects.visEditor.clickGo(); - const title = await PageObjects.visChart.getYAxisTitle(); + await PageObjects.visEditor.clickGo(true); + const title = await PageObjects.visChart.getYAxisTitle(xyChartSelector); expect(title).to.be('Custom'); }); diff --git a/test/functional/apps/visualize/_line_chart_split_series.ts b/test/functional/apps/visualize/_line_chart_split_series.ts index 91d44a6fc40da..d10b4ebd9b312 100644 --- a/test/functional/apps/visualize/_line_chart_split_series.ts +++ b/test/functional/apps/visualize/_line_chart_split_series.ts @@ -23,9 +23,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'visChart', 'timePicker', ]); + const xyChartSelector = 'visTypeXyChart'; describe('line charts - split series', function () { - let isNewChartsLibraryEnabled = false; const initLineChart = async function () { log.debug('navigateToApp visualize'); await PageObjects.visualize.navigateToNewAggBasedVisualization(); @@ -39,12 +39,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.selectAggregation('Terms'); log.debug('Field = extension'); await PageObjects.visEditor.selectField('extension.raw'); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); }; before(async () => { - isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); - await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); + await PageObjects.visualize.initTests(); await initLineChart(); }); @@ -59,7 +58,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // sleep a bit before trying to get the chart data await PageObjects.common.sleep(3000); - const data = await PageObjects.visChart.getLineChartData(); + const data = await PageObjects.visChart.getLineChartData(xyChartSelector); log.debug('data=' + data); const tolerance = 10; // the y-axis scale is 10000 so 10 is 0.1% for (let x = 0; x < data.length; x++) { @@ -90,9 +89,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('Order By = Term'); await PageObjects.visEditor.selectOrderByMetric(2, '_key'); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); await retry.try(async function () { - const data = await PageObjects.visChart.getLineChartData(); + const data = await PageObjects.visChart.getLineChartData(xyChartSelector); log.debug('data=' + data); const tolerance = 10; // the y-axis scale is 10000 so 10 is 0.1% for (let x = 0; x < data.length; x++) { @@ -159,10 +158,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should be able to save and load', async function () { - const vizName = await PageObjects.visChart.getExpectedValue( - 'Visualization Line split series', - 'Visualization Line split series - chart library' - ); + const vizName = 'Visualization Line split series'; await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(vizName); @@ -179,10 +175,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.clickYAxisOptions(axisId); await PageObjects.visEditor.selectYAxisScaleType(axisId, 'log'); await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(); - const minLabel = await PageObjects.visChart.getExpectedValue(2, 1); - const maxLabel = await PageObjects.visChart.getExpectedValue(5000, 900); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(xyChartSelector); + const minLabel = 1; + const maxLabel = 900; const numberOfLabels = 10; expect(labels.length).to.be.greaterThan(numberOfLabels); expect(labels[0]).to.eql(minLabel); @@ -191,10 +187,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should show filtered ticks on selecting log scale', async () => { await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(); - const minLabel = await PageObjects.visChart.getExpectedValue(2, 1); - const maxLabel = await PageObjects.visChart.getExpectedValue(5000, 900); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(xyChartSelector); + const minLabel = 1; + const maxLabel = 900; const numberOfLabels = 10; expect(labels.length).to.be.greaterThan(numberOfLabels); expect(labels[0]).to.eql(minLabel); @@ -204,47 +200,79 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should show ticks on selecting square root scale', async () => { await PageObjects.visEditor.selectYAxisScaleType(axisId, 'square root'); await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['0', '2,000', '4,000', '6,000', '8,000', '10,000'], - ['0', '1,000', '2,000', '3,000', '4,000', '5,000', '6,000', '7,000', '8,000', '9,000'] - ); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); + const expectedLabels = [ + '0', + '1,000', + '2,000', + '3,000', + '4,000', + '5,000', + '6,000', + '7,000', + '8,000', + '9,000', + ]; expect(labels).to.eql(expectedLabels); }); it('should show filtered ticks on selecting square root scale', async () => { await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['2,000', '4,000', '6,000', '8,000'], - ['0', '1,000', '2,000', '3,000', '4,000', '5,000', '6,000', '7,000', '8,000', '9,000'] - ); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); + const expectedLabels = [ + '0', + '1,000', + '2,000', + '3,000', + '4,000', + '5,000', + '6,000', + '7,000', + '8,000', + '9,000', + ]; expect(labels).to.eql(expectedLabels); }); it('should show ticks on selecting linear scale', async () => { await PageObjects.visEditor.selectYAxisScaleType(axisId, 'linear'); await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); log.debug(labels); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['0', '2,000', '4,000', '6,000', '8,000', '10,000'], - ['0', '1,000', '2,000', '3,000', '4,000', '5,000', '6,000', '7,000', '8,000', '9,000'] - ); + const expectedLabels = [ + '0', + '1,000', + '2,000', + '3,000', + '4,000', + '5,000', + '6,000', + '7,000', + '8,000', + '9,000', + ]; expect(labels).to.eql(expectedLabels); }); it('should show filtered ticks on selecting linear scale', async () => { await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['2,000', '4,000', '6,000', '8,000'], - ['0', '1,000', '2,000', '3,000', '4,000', '5,000', '6,000', '7,000', '8,000', '9,000'] - ); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); + const expectedLabels = [ + '0', + '1,000', + '2,000', + '3,000', + '4,000', + '5,000', + '6,000', + '7,000', + '8,000', + '9,000', + ]; expect(labels).to.eql(expectedLabels); }); }); @@ -272,16 +300,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.clickBucket('X-axis'); log.debug('Aggregation = Date Histogram'); await PageObjects.visEditor.selectAggregation('Date Histogram'); - await PageObjects.visEditor.clickGo(); - const title = await PageObjects.visChart.getYAxisTitle(); + await PageObjects.visEditor.clickGo(true); + const title = await PageObjects.visChart.getYAxisTitle(xyChartSelector); expect(title).to.be('Serial Diff of Count'); }); it('should change y-axis label to custom', async () => { log.debug('set custom label of y-axis to "Custom"'); await PageObjects.visEditor.setCustomLabel('Custom', 1); - await PageObjects.visEditor.clickGo(); - const title = await PageObjects.visChart.getYAxisTitle(); + await PageObjects.visEditor.clickGo(true); + const title = await PageObjects.visChart.getYAxisTitle(xyChartSelector); expect(title).to.be('Custom'); }); @@ -295,24 +323,24 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should apply with selected bucket', async () => { log.debug('Metrics agg = Average Bucket'); await PageObjects.visEditor.selectAggregation('Average Bucket', 'metrics'); - await PageObjects.visEditor.clickGo(); - const title = await PageObjects.visChart.getYAxisTitle(); + await PageObjects.visEditor.clickGo(true); + const title = await PageObjects.visChart.getYAxisTitle(xyChartSelector); expect(title).to.be('Overall Average of Count'); }); it('should change sub metric custom label and calculate y-axis title', async () => { log.debug('set custom label of sub metric to "Cats"'); await PageObjects.visEditor.setCustomLabel('Cats', '1-metric'); - await PageObjects.visEditor.clickGo(); - const title = await PageObjects.visChart.getYAxisTitle(); + await PageObjects.visEditor.clickGo(true); + const title = await PageObjects.visChart.getYAxisTitle(xyChartSelector); expect(title).to.be('Overall Average of Cats'); }); it('should outer custom label', async () => { log.debug('set custom label to "Custom"'); await PageObjects.visEditor.setCustomLabel('Custom', 1); - await PageObjects.visEditor.clickGo(); - const title = await PageObjects.visChart.getYAxisTitle(); + await PageObjects.visEditor.clickGo(true); + const title = await PageObjects.visChart.getYAxisTitle(xyChartSelector); expect(title).to.be('Custom'); }); diff --git a/test/functional/apps/visualize/_point_series_options.ts b/test/functional/apps/visualize/_point_series_options.ts index 08c26b1f3ee95..0d68ea4984ec2 100644 --- a/test/functional/apps/visualize/_point_series_options.ts +++ b/test/functional/apps/visualize/_point_series_options.ts @@ -25,6 +25,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'common', ]); const inspector = getService('inspector'); + const xyChartSelector = 'visTypeXyChart'; async function initChart() { log.debug('navigateToApp visualize'); @@ -57,14 +58,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('Average memory value axis - ValueAxis-2'); await PageObjects.visEditor.setSeriesAxis(1, 'ValueAxis-2'); await PageObjects.visChart.waitForVisualizationRenderingStabilized(); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); } describe('point series', function describeIndexTests() { - let isNewChartsLibraryEnabled = false; before(async () => { - isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); - await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); + await PageObjects.visualize.initTests(); await initChart(); }); @@ -126,7 +125,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ]; await retry.try(async () => { - const data = await PageObjects.visChart.getLineChartData('Count'); + const data = await PageObjects.visChart.getLineChartData(xyChartSelector, 'Count'); log.debug('count data=' + data); log.debug('data.length=' + data.length); expect(data).to.eql(expectedChartValues[0]); @@ -134,8 +133,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await retry.try(async () => { const avgMemoryData = await PageObjects.visChart.getLineChartData( - 'Average machine.ram', - 'ValueAxis-2' + xyChartSelector, + 'Average machine.ram' ); log.debug('average memory data=' + avgMemoryData); log.debug('data.length=' + avgMemoryData.length); @@ -151,7 +150,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should put secondary axis on the right', async function () { - const length = await PageObjects.visChart.getAxesCountByPosition('right'); + const length = await PageObjects.visChart.getAxesCountByPosition('right', xyChartSelector); expect(length).to.be(1); }); }); @@ -159,8 +158,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('multiple chart types', function () { it('should change average series type to histogram', async function () { await PageObjects.visEditor.setSeriesType(1, 'histogram'); - await PageObjects.visEditor.clickGo(); - const length = await PageObjects.visChart.getHistogramSeriesCount(); + await PageObjects.visEditor.clickGo(true); + const length = await PageObjects.visChart.getHistogramSeriesCount(xyChartSelector); expect(length).to.be(1); }); }); @@ -172,8 +171,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should show category grid lines', async function () { await PageObjects.visEditor.toggleGridCategoryLines(); - await PageObjects.visEditor.clickGo(); - const gridLines = await PageObjects.visChart.getGridLines(); + await PageObjects.visEditor.clickGo(true); + const gridLines = await PageObjects.visChart.getGridLines(xyChartSelector); // FLAKY relaxing as depends on chart size/browser size and produce differences between local and CI // The objective here is to check whenever the grid lines are rendered, not the exact quantity expect(gridLines.length).to.be.greaterThan(0); @@ -185,8 +184,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should show value axis grid lines', async function () { await PageObjects.visEditor.setGridValueAxis('ValueAxis-2'); await PageObjects.visEditor.toggleGridCategoryLines(); - await PageObjects.visEditor.clickGo(); - const gridLines = await PageObjects.visChart.getGridLines(); + await PageObjects.visEditor.clickGo(true); + const gridLines = await PageObjects.visChart.getGridLines(xyChartSelector); // FLAKY relaxing as depends on chart size/browser size and produce differences between local and CI // The objective here is to check whenever the grid lines are rendered, not the exact quantity expect(gridLines.length).to.be.greaterThan(0); @@ -208,22 +207,22 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.selectAggregation('Terms'); log.debug('Field = geo.src'); await PageObjects.visEditor.selectField('geo.src'); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); log.debug('Open Options tab'); await PageObjects.visEditor.clickOptionsTab(); }); it('should show values on bar chart', async () => { await PageObjects.visEditor.toggleValuesOnChart(); - await PageObjects.visEditor.clickGo(); - const values = await PageObjects.visChart.getChartValues(); + await PageObjects.visEditor.clickGo(true); + const values = await PageObjects.visChart.getChartValues(xyChartSelector); expect(values).to.eql(['2,592', '2,373', '1,194', '489', '415']); }); it('should hide values on bar chart', async () => { await PageObjects.visEditor.toggleValuesOnChart(); - await PageObjects.visEditor.clickGo(); - const values = await PageObjects.visChart.getChartValues(); + await PageObjects.visEditor.clickGo(true); + const values = await PageObjects.visChart.getChartValues(xyChartSelector); expect(values.length).to.be(0); }); }); @@ -237,20 +236,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.clickLineChart(); await PageObjects.visualize.clickNewSearch(); await PageObjects.visEditor.selectYAxisAggregation('Average', 'bytes', customLabel, 1); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); await PageObjects.visEditor.clickMetricsAndAxes(); await PageObjects.visEditor.clickYAxisOptions('ValueAxis-1'); }); it('should render a custom label when one is set', async function () { - const title = await PageObjects.visChart.getYAxisTitle(); + const title = await PageObjects.visChart.getYAxisTitle(xyChartSelector); expect(title).to.be(customLabel); }); it('should render a custom axis title when one is set, overriding the custom label', async function () { await PageObjects.visEditor.setAxisTitle(axisTitle); - await PageObjects.visEditor.clickGo(); - const title = await PageObjects.visChart.getYAxisTitle(); + await PageObjects.visEditor.clickGo(true); + const title = await PageObjects.visChart.getYAxisTitle(xyChartSelector); expect(title).to.be(axisTitle); }); @@ -262,43 +261,42 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.clickDataTab(); await PageObjects.visEditor.toggleOpenEditor(1); await PageObjects.visEditor.setCustomLabel('test', 1); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); await PageObjects.visEditor.clickMetricsAndAxes(); await PageObjects.visEditor.clickYAxisOptions('ValueAxis-1'); - const title = await PageObjects.visChart.getYAxisTitle(); + const title = await PageObjects.visChart.getYAxisTitle(xyChartSelector); expect(title).to.be(axisTitle); }); }); describe('timezones', async function () { it('should show round labels in default timezone', async function () { - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['2015-09-20 00:00', '2015-09-21 00:00', '2015-09-22 00:00'], - ['2015-09-19 12:00', '2015-09-20 12:00', '2015-09-21 12:00', '2015-09-22 12:00'] - ); + const expectedLabels = [ + '2015-09-19 12:00', + '2015-09-20 12:00', + '2015-09-21 12:00', + '2015-09-22 12:00', + ]; await initChart(); - const labels = await PageObjects.visChart.getXAxisLabels(); + const labels = await PageObjects.visChart.getXAxisLabels(xyChartSelector); expect(labels.join()).to.contain(expectedLabels.join()); }); it('should show round labels in different timezone', async function () { - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['2015-09-20 00:00', '2015-09-21 00:00', '2015-09-22 00:00'], - [ - '2015-09-19 12:00', - '2015-09-20 12:00', - '2015-09-21 12:00', - '2015-09-22 12:00', - '2015-09-23 12:00', - ] - ); + const expectedLabels = [ + '2015-09-19 12:00', + '2015-09-20 12:00', + '2015-09-21 12:00', + '2015-09-22 12:00', + '2015-09-23 12:00', + ]; await kibanaServer.uiSettings.update({ 'dateFormat:tz': 'America/Phoenix' }); await browser.refresh(); await PageObjects.header.awaitKibanaChrome(); await initChart(); - const labels = await PageObjects.visChart.getXAxisLabels(); + const labels = await PageObjects.visChart.getXAxisLabels(xyChartSelector); expect(labels.join()).to.contain(expectedLabels.join()); }); @@ -314,28 +312,25 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'wait for x-axis labels to match expected for Phoenix', 5000, async () => { - const labels = (await PageObjects.visChart.getXAxisLabels()) ?? ''; + const labels = (await PageObjects.visChart.getXAxisLabels(xyChartSelector)) ?? ''; log.debug(`Labels: ${labels}`); - const xLabels = await PageObjects.visChart.getExpectedValue( - ['10:00', '11:00', '12:00', '13:00', '14:00', '15:00'], - [ - '09:30', - '10:00', - '10:30', - '11:00', - '11:30', - '12:00', - '12:30', - '13:00', - '13:30', - '14:00', - '14:30', - '15:00', - '15:30', - '16:00', - ] - ); + const xLabels = [ + '09:30', + '10:00', + '10:30', + '11:00', + '11:30', + '12:00', + '12:30', + '13:00', + '13:30', + '14:00', + '14:30', + '15:00', + '15:30', + '16:00', + ]; return labels.toString() === xLabels.toString(); } ); @@ -375,7 +370,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await browser.refresh(); // wait some time before trying to check for rendering count await PageObjects.header.awaitKibanaChrome(); - await PageObjects.visualize.clickRefresh(); + await PageObjects.visualize.clickRefresh(true); await PageObjects.visChart.waitForRenderingCount(); log.debug('getXAxisLabels'); @@ -383,28 +378,25 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'wait for x-axis labels to match expected for UTC', 5000, async () => { - const labels2 = (await PageObjects.visChart.getXAxisLabels()) ?? ''; + const labels2 = (await PageObjects.visChart.getXAxisLabels(xyChartSelector)) ?? ''; log.debug(`Labels: ${labels2}`); - const xLabels2 = await PageObjects.visChart.getExpectedValue( - ['17:00', '18:00', '19:00', '20:00', '21:00', '22:00'], - [ - '16:30', - '17:00', - '17:30', - '18:00', - '18:30', - '19:00', - '19:30', - '20:00', - '20:30', - '21:00', - '21:30', - '22:00', - '22:30', - '23:00', - ] - ); + const xLabels2 = [ + '16:30', + '17:00', + '17:30', + '18:00', + '18:30', + '19:00', + '19:30', + '20:00', + '20:30', + '21:00', + '21:30', + '22:00', + '22:30', + '23:00', + ]; return labels2.toString() === xLabels2.toString(); } ); diff --git a/test/functional/apps/visualize/_timelion.ts b/test/functional/apps/visualize/_timelion.ts index 589559c717842..ea8cb8b13ba49 100644 --- a/test/functional/apps/visualize/_timelion.ts +++ b/test/functional/apps/visualize/_timelion.ts @@ -10,16 +10,19 @@ import expect from '@kbn/expect'; import type { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getPageObjects, getService }: FtrProviderContext) { - const { timePicker, visChart, visEditor, visualize } = getPageObjects([ + const { timePicker, visChart, visEditor, visualize, timelion, common } = getPageObjects([ 'timePicker', 'visChart', 'visEditor', 'visualize', + 'timelion', + 'common', ]); const monacoEditor = getService('monacoEditor'); const kibanaServer = getService('kibanaServer'); const elasticChart = getService('elasticChart'); const find = getService('find'); + const timelionChartSelector = 'timelionChart'; describe('Timelion visualization', () => { before(async () => { @@ -35,13 +38,13 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const initVisualization = async (expression: string, interval: string = '12h') => { await visEditor.setTimelionInterval(interval); await monacoEditor.setCodeEditorValue(expression); - await visEditor.clickGo(); + await visEditor.clickGo(true); }; it('should display correct data for specified index pattern and timefield', async () => { await initVisualization('.es(index=long-window-logstash-*,timefield=@timestamp)'); - const chartData = await visChart.getAreaChartData('q:* > count'); + const chartData = await visChart.getAreaChartData('q:* > count', timelionChartSelector); expect(chartData).to.eql([3, 5, 2, 6, 1, 6, 1, 7, 0, 0]); }); @@ -62,10 +65,22 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { '36h' ); - const firstAreaChartData = await visChart.getAreaChartData('q:* > avg(bytes)'); - const secondAreaChartData = await visChart.getAreaChartData('q:* > min(bytes)'); - const thirdAreaChartData = await visChart.getAreaChartData('q:* > max(bytes)'); - const forthAreaChartData = await visChart.getAreaChartData('q:* > cardinality(bytes)'); + const firstAreaChartData = await visChart.getAreaChartData( + 'q:* > avg(bytes)', + timelionChartSelector + ); + const secondAreaChartData = await visChart.getAreaChartData( + 'q:* > min(bytes)', + timelionChartSelector + ); + const thirdAreaChartData = await visChart.getAreaChartData( + 'q:* > max(bytes)', + timelionChartSelector + ); + const forthAreaChartData = await visChart.getAreaChartData( + 'q:* > cardinality(bytes)', + timelionChartSelector + ); expect(firstAreaChartData).to.eql([5732.783676366217, 5721.775973559419]); expect(secondAreaChartData).to.eql([0, 0]); @@ -84,10 +99,19 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { '.es(*).if(operator=gt,if=200,then=50,else=150).label("condition")' ); - const firstAreaChartData = await visChart.getAreaChartData('initial'); - const secondAreaChartData = await visChart.getAreaChartData('add multiply abs divide'); - const thirdAreaChartData = await visChart.getAreaChartData('query derivative min sum'); - const forthAreaChartData = await visChart.getAreaChartData('condition'); + const firstAreaChartData = await visChart.getAreaChartData('initial', timelionChartSelector); + const secondAreaChartData = await visChart.getAreaChartData( + 'add multiply abs divide', + timelionChartSelector + ); + const thirdAreaChartData = await visChart.getAreaChartData( + 'query derivative min sum', + timelionChartSelector + ); + const forthAreaChartData = await visChart.getAreaChartData( + 'condition', + timelionChartSelector + ); expect(firstAreaChartData).to.eql(firstAreaExpectedChartData); expect(secondAreaChartData).to.eql(firstAreaExpectedChartData); @@ -112,20 +136,23 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { '36h' ); - const leftAxesCount = await visChart.getAxesCountByPosition('left'); - const rightAxesCount = await visChart.getAxesCountByPosition('right'); - const firstAxesLabels = await visChart.getYAxisLabels(); - const secondAxesLabels = await visChart.getYAxisLabels(1); - const thirdAxesLabels = await visChart.getYAxisLabels(2); - const firstAreaChartData = await visChart.getAreaChartData('Average Machine RAM amount'); + const leftAxesCount = await visChart.getAxesCountByPosition('left', timelionChartSelector); + const rightAxesCount = await visChart.getAxesCountByPosition('right', timelionChartSelector); + const firstAxesLabels = await visChart.getYAxisLabels(timelionChartSelector); + const secondAxesLabels = await visChart.getYAxisLabels(timelionChartSelector, 1); + const thirdAxesLabels = await visChart.getYAxisLabels(timelionChartSelector, 2); + const firstAreaChartData = await visChart.getAreaChartData( + 'Average Machine RAM amount', + timelionChartSelector + ); const secondAreaChartData = await visChart.getAreaChartData( 'Average Bytes for request', - undefined, + timelionChartSelector, true ); const thirdAreaChartData = await visChart.getAreaChartData( 'Average Bytes for request with offset', - undefined, + timelionChartSelector, true ); @@ -144,9 +171,18 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('should display correct chart data for split expression', async () => { await initVisualization('.es(index=logstash-*, split=geo.dest:3)', '1 day'); - const firstAreaChartData = await visChart.getAreaChartData('q:* > geo.dest:CN > count'); - const secondAreaChartData = await visChart.getAreaChartData('q:* > geo.dest:IN > count'); - const thirdAreaChartData = await visChart.getAreaChartData('q:* > geo.dest:US > count'); + const firstAreaChartData = await visChart.getAreaChartData( + 'q:* > geo.dest:CN > count', + timelionChartSelector + ); + const secondAreaChartData = await visChart.getAreaChartData( + 'q:* > geo.dest:IN > count', + timelionChartSelector + ); + const thirdAreaChartData = await visChart.getAreaChartData( + 'q:* > geo.dest:US > count', + timelionChartSelector + ); expect(firstAreaChartData).to.eql([0, 905, 910, 850, 0]); expect(secondAreaChartData).to.eql([0, 763, 699, 825, 0]); @@ -156,8 +192,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('should display two areas and one bar chart items', async () => { await initVisualization('.es(*), .es(*), .es(*).bars(stack=true)'); - const areasChartsCount = await visChart.getAreaSeriesCount(); - const barsChartsCount = await visChart.getHistogramSeriesCount(); + const areasChartsCount = await visChart.getAreaSeriesCount(timelionChartSelector); + const barsChartsCount = await visChart.getHistogramSeriesCount(timelionChartSelector); expect(areasChartsCount).to.be(2); expect(barsChartsCount).to.be(1); @@ -167,7 +203,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('should correctly display the legend items names and position', async () => { await initVisualization('.es(*).label("first series"), .es(*).label("second series")'); - const legendNames = await visChart.getLegendEntries(); + const legendNames = await visChart.getLegendEntriesXYCharts(timelionChartSelector); const legendElement = await find.byClassName('echLegend'); const isLegendTopPositioned = await legendElement.elementHasClass('echLegend--top'); const isLegendLeftPositioned = await legendElement.elementHasClass('echLegend--left'); @@ -196,6 +232,72 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); }); + describe('expression typeahead', () => { + it('should display function suggestions', async () => { + await monacoEditor.setCodeEditorValue(''); + await monacoEditor.typeCodeEditorValue('.e', 'timelionCodeEditor'); + // wait for monaco editor model will be updated with new value + await common.sleep(300); + let value = await monacoEditor.getCodeEditorValue(0); + expect(value).to.eql('.e'); + const suggestions = await timelion.getSuggestionItemsText(); + expect(suggestions.length).to.eql(2); + expect(suggestions[0].includes('es')).to.eql(true); + expect(suggestions[1].includes('elasticsearch')).to.eql(true); + await timelion.clickSuggestion(0); + // wait for monaco editor model will be updated with new value + await common.sleep(300); + value = await monacoEditor.getCodeEditorValue(0); + expect(value).to.eql('.es()'); + }); + + describe('dynamic suggestions for argument values', () => { + describe('.es()', () => { + it('should show index pattern suggestions for index argument', async () => { + await monacoEditor.setCodeEditorValue(''); + await monacoEditor.typeCodeEditorValue('.es(index=', 'timelionCodeEditor'); + // wait for index patterns will be loaded + await common.sleep(500); + const suggestions = await timelion.getSuggestionItemsText(); + expect(suggestions.length).not.to.eql(0); + expect(suggestions[0].includes('log')).to.eql(true); + }); + + it('should show field suggestions for timefield argument when index pattern set', async () => { + await monacoEditor.setCodeEditorValue(''); + await monacoEditor.typeCodeEditorValue( + '.es(index=logstash-*, timefield=', + 'timelionCodeEditor' + ); + const suggestions = await timelion.getSuggestionItemsText(); + expect(suggestions.length).to.eql(4); + expect(suggestions[0].includes('@timestamp')).to.eql(true); + }); + + it('should show field suggestions for split argument when index pattern set', async () => { + await monacoEditor.setCodeEditorValue(''); + await monacoEditor.typeCodeEditorValue( + '.es(index=logstash-*, timefield=@timestamp ,split=', + 'timelionCodeEditor' + ); + const suggestions = await timelion.getSuggestionItemsText(); + expect(suggestions.length).not.to.eql(0); + expect(suggestions[0].includes('@message.raw')).to.eql(true); + }); + + it('should show field suggestions for metric argument when index pattern set', async () => { + await monacoEditor.typeCodeEditorValue( + '.es(index=logstash-*, timefield=@timestamp ,metric=avg:', + 'timelionCodeEditor' + ); + const suggestions = await timelion.getSuggestionItemsText(); + expect(suggestions.length).not.to.eql(0); + expect(suggestions[0].includes('avg:bytes')).to.eql(true); + }); + }); + }); + }); + after( async () => await kibanaServer.uiSettings.update({ diff --git a/test/functional/apps/visualize/_tsvb_chart.ts b/test/functional/apps/visualize/_tsvb_chart.ts index d6862487196f0..6a5c062268c25 100644 --- a/test/functional/apps/visualize/_tsvb_chart.ts +++ b/test/functional/apps/visualize/_tsvb_chart.ts @@ -17,11 +17,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const retry = getService('retry'); const security = getService('security'); - const { timePicker, visChart, visualBuilder, visualize } = getPageObjects([ + const { timePicker, visChart, visualBuilder, visualize, settings } = getPageObjects([ 'timePicker', 'visChart', 'visualBuilder', 'visualize', + 'settings', ]); describe('visual builder', function describeIndexTests() { @@ -102,6 +103,28 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(kibanaIndexPatternModeValue).to.eql('32,212,254,720'); }); + it('should show error if we use parent pipeline aggregations in entire time range mode', async () => { + await visualBuilder.selectAggType('Max'); + await visualBuilder.setFieldForAggregation('machine.ram'); + await visualBuilder.createNewAgg(); + await visualBuilder.selectAggType('derivative', 1); + await visualBuilder.setFieldForAggregation('Max of machine.ram', 1); + + const value = await visualBuilder.getMetricValue(); + + expect(value).to.eql('0'); + + await visualBuilder.clickPanelOptions('metric'); + await visualBuilder.setMetricsDataTimerangeMode('Entire time range'); + await visualBuilder.clickDataTab('metric'); + await visualBuilder.checkInvalidAggComponentIsPresent(); + const error = await visualBuilder.getVisualizeError(); + + expect(error).to.eql( + 'The aggregation derivative is not supported in entire_time_range mode' + ); + }); + describe('Color rules', () => { beforeEach(async () => { await visualBuilder.selectAggType('Min'); @@ -163,6 +186,31 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await visualBuilder.clickDataTab('gauge'); }); + it('should show error if we use parent pipeline aggregations in entire time range mode', async () => { + await visualBuilder.clickPanelOptions('gauge'); + await visualBuilder.setMetricsDataTimerangeMode('Last value'); + await visualBuilder.clickDataTab('gauge'); + await visualBuilder.selectAggType('Max'); + await visualBuilder.setFieldForAggregation('machine.ram'); + await visualBuilder.createNewAgg(); + await visualBuilder.selectAggType('derivative', 1); + await visualBuilder.setFieldForAggregation('Max of machine.ram', 1); + + const value = await visualBuilder.getGaugeCount(); + + expect(value).to.eql('0'); + + await visualBuilder.clickPanelOptions('gauge'); + await visualBuilder.setMetricsDataTimerangeMode('Entire time range'); + await visualBuilder.clickDataTab('gauge'); + await visualBuilder.checkInvalidAggComponentIsPresent(); + const error = await visualBuilder.getVisualizeError(); + + expect(error).to.eql( + 'The aggregation derivative is not supported in entire_time_range mode' + ); + }); + it('should verify gauge label and count display', async () => { await visChart.waitForVisualizationRenderingStabilized(); const gaugeLabel = await visualBuilder.getGaugeLabel(); @@ -174,6 +222,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should display correct data for max aggregation with entire time range mode', async () => { await visualBuilder.selectAggType('Max'); await visualBuilder.setFieldForAggregation('bytes'); + await visualBuilder.clickSeriesOption(); + await visualBuilder.changeDataFormatter('number'); const gaugeLabel = await visualBuilder.getGaugeLabel(); const gaugeCount = await visualBuilder.getGaugeCount(); @@ -269,6 +319,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should display correct data for sum of squares aggregation with entire time range mode', async () => { await visualBuilder.selectAggType('Sum of squares'); await visualBuilder.setFieldForAggregation('bytes'); + await visualBuilder.clickSeriesOption(); + await visualBuilder.changeDataFormatter('number'); await visualBuilder.clickPanelOptions('topN'); await visualBuilder.setMetricsDataTimerangeMode('Entire time range'); @@ -291,6 +343,28 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(secondTopNBarStyle).to.contain('background-color: rgb(128, 224, 138);'); }); + it('should show error if we use parent pipeline aggregations in entire time range mode', async () => { + await visualBuilder.selectAggType('Max'); + await visualBuilder.setFieldForAggregation('machine.ram'); + await visualBuilder.createNewAgg(); + await visualBuilder.selectAggType('derivative', 1); + await visualBuilder.setFieldForAggregation('Max of machine.ram', 1); + + const value = await visualBuilder.getTopNCount(); + + expect(value).to.eql('0'); + + await visualBuilder.clickPanelOptions('topN'); + await visualBuilder.setMetricsDataTimerangeMode('Entire time range'); + await visualBuilder.clickDataTab('topN'); + await visualBuilder.checkInvalidAggComponentIsPresent(); + const error = await visualBuilder.getVisualizeError(); + + expect(error).to.eql( + 'The aggregation derivative is not supported in entire_time_range mode' + ); + }); + describe('Color rules', () => { it('should apply color rules to visualization background and bar', async () => { await visualBuilder.selectAggType('Value Count'); @@ -452,5 +526,118 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(legendItems3).to.eql(finalLegendItems); }); }); + + describe('applying field formats from Advanced Settings', () => { + const toggleSetFormatForMachineOsRaw = async () => { + log.debug( + 'Navigate to Advanced Settings Index Patterns and toggle Set Format for machine.os.raw' + ); + await settings.navigateTo(); + await settings.clickKibanaIndexPatterns(); + await settings.clickIndexPatternLogstash(); + await settings.openControlsByName('machine.os.raw'); + await settings.toggleRow('formatRow'); + }; + + before(async () => { + log.debug('Toggle on Set Format for machine.os.raw and set it to the title case'); + await toggleSetFormatForMachineOsRaw(); + await settings.setFieldFormat('string'); + await settings.setScriptedFieldStringTransform('title'); + await settings.controlChangeSave(); + }); + + beforeEach(async () => { + await visualBuilder.resetPage(); + await visualBuilder.selectAggType('Average'); + await visualBuilder.setFieldForAggregation('bytes'); + await visualBuilder.setMetricsGroupByTerms('machine.os.raw'); + await visChart.waitForVisualizationRenderingStabilized(); + }); + + it('should display title field formatted labels with byte field formatted values by default', async () => { + const expectedLegendItems = [ + 'Win 8: 4.968KB', + 'Win Xp: 4.23KB', + 'Win 7: 6.181KB', + 'Ios: 5.84KB', + 'Osx: 5.928KB', + ]; + + const legendItems = await visualBuilder.getLegendItemsContent(); + expect(legendItems).to.eql(expectedLegendItems); + }); + + it('should display title field formatted labels with raw values', async () => { + const expectedLegendItems = [ + 'Win 8: 5,087.5', + 'Win Xp: 4,332', + 'Win 7: 6,328.938', + 'Ios: 5,980', + 'Osx: 6,070', + ]; + await visualBuilder.clickSeriesOption(); + await visualBuilder.changeDataFormatter('number'); + const legendItems = await visualBuilder.getLegendItemsContent(); + + expect(legendItems).to.eql(expectedLegendItems); + }); + + it('should display title field formatted labels with TSVB formatted values', async () => { + const expectedLegendItems = [ + 'Win 8: 5,087.5 format', + 'Win Xp: 4,332 format', + 'Win 7: 6,328.938 format', + 'Ios: 5,980 format', + 'Osx: 6,070 format', + ]; + + await visualBuilder.clickSeriesOption(); + await visualBuilder.changeDataFormatter('number'); + await visualBuilder.enterSeriesTemplate('{{value}} format'); + await visChart.waitForVisualizationRenderingStabilized(); + + const legendItems = await visualBuilder.getLegendItemsContent(); + expect(legendItems).to.eql(expectedLegendItems); + }); + + describe('formatting values for Metric, TopN and Gauge', () => { + it('should display field formatted value for Metric', async () => { + await visualBuilder.clickMetric(); + await visualBuilder.checkMetricTabIsPresent(); + + const metricValue = await visualBuilder.getMetricValue(); + expect(metricValue).to.eql('5.514KB'); + }); + + it('should display field formatted label and value for TopN', async () => { + await visualBuilder.clickTopN(); + await visualBuilder.checkTopNTabIsPresent(); + + const topNLabel = await visualBuilder.getTopNLabel(); + const topNCount = await visualBuilder.getTopNCount(); + + expect(topNLabel).to.eql('Win 7'); + expect(topNCount).to.eql('5.664KB'); + }); + + it('should display field formatted label and value for Gauge', async () => { + await visualBuilder.clickGauge(); + await visualBuilder.checkGaugeTabIsPresent(); + + const gaugeLabel = await visualBuilder.getGaugeLabel(); + const gaugeCount = await visualBuilder.getGaugeCount(); + + expect(gaugeLabel).to.eql('Average of bytes'); + expect(gaugeCount).to.eql('5.514KB'); + }); + }); + + after(async () => { + log.debug('Toggle off Set Format for machine.os.raw'); + await toggleSetFormatForMachineOsRaw(); + await settings.controlChangeSave(); + }); + }); }); } diff --git a/test/functional/apps/visualize/_tsvb_markdown.ts b/test/functional/apps/visualize/_tsvb_markdown.ts index b8b74d5cd7bf3..98ed05d854f0c 100644 --- a/test/functional/apps/visualize/_tsvb_markdown.ts +++ b/test/functional/apps/visualize/_tsvb_markdown.ts @@ -146,6 +146,31 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(aggregationLength).to.be.equal(2); }); }); + + describe('applying field formats from Advanced Settings for values', () => { + before(async () => { + await visualBuilder.resetPage(); + await visualBuilder.clickMarkdown(); + await visualBuilder.markdownSwitchSubTab('markdown'); + await visualBuilder.enterMarkdown('{{ average_of_bytes.last.formatted }}'); + await visualBuilder.markdownSwitchSubTab('data'); + await visualBuilder.selectAggType('Average'); + await visualBuilder.setFieldForAggregation('bytes'); + await visualBuilder.clickSeriesOption(); + }); + + it('should apply field formatting by default', async () => { + const text = await visualBuilder.getMarkdownText(); + expect(text).to.be('5.588KB'); + }); + + it('should apply TSVB formatting', async () => { + await visualBuilder.changeDataFormatter('percent'); + + const text = await visualBuilder.getMarkdownText(); + expect(text).to.be('572,241.265%'); + }); + }); }); }); } diff --git a/test/functional/apps/visualize/_tsvb_table.ts b/test/functional/apps/visualize/_tsvb_table.ts index 7c093b5a9640a..ed668e4bca8e5 100644 --- a/test/functional/apps/visualize/_tsvb_table.ts +++ b/test/functional/apps/visualize/_tsvb_table.ts @@ -11,10 +11,11 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getPageObjects, getService }: FtrProviderContext) { - const { visualBuilder, visualize, visChart } = getPageObjects([ + const { visualBuilder, visualize, visChart, settings } = getPageObjects([ 'visualBuilder', 'visualize', 'visChart', + 'settings', ]); const findService = getService('find'); const retry = getService('retry'); @@ -45,6 +46,19 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(tableData).to.be(EXPECTED); }); + it('should display drilldown urls', async () => { + const baseURL = 'http://elastic.co/foo/'; + + await visualBuilder.clickPanelOptions('table'); + await visualBuilder.setDrilldownUrl(`${baseURL}{{key}}`); + + await retry.try(async () => { + const links = await findService.allByCssSelector(`a[href="${baseURL}ios"]`); + + expect(links.length).to.be(1); + }); + }); + it('should display correct values on changing metrics aggregation', async () => { const EXPECTED = 'OS Cardinality\nwin 8 12\nwin xp 9\nwin 7 8\nios 5\nosx 3'; @@ -71,6 +85,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { 'OS Variance of bytes\nwin 8 2,707,941.822\nwin xp 2,595,612.24\nwin 7 16,055,541.306\nios 6,505,206.56\nosx 1,016,620.667'; await visualBuilder.selectAggType('Variance'); await visualBuilder.setFieldForAggregation('bytes'); + await visualBuilder.clickSeriesOption(); + await visualBuilder.changeDataFormatter('number'); const tableData = await visualBuilder.getViewTable(); expect(tableData).to.be(EXPECTED); @@ -122,6 +138,63 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(tableData).to.be(EXPECTED); }); + describe('applying field formats from Advanced Settings', () => { + const toggleSetFormatForMachineOsRaw = async () => { + await settings.navigateTo(); + await settings.clickKibanaIndexPatterns(); + await settings.clickIndexPatternLogstash(); + await settings.openControlsByName('machine.os.raw'); + await settings.toggleRow('formatRow'); + }; + + before(async () => { + await toggleSetFormatForMachineOsRaw(); + await settings.setFieldFormat('string'); + await settings.setScriptedFieldStringTransform('upper'); + await settings.controlChangeSave(); + }); + + beforeEach(async () => { + await visualBuilder.selectAggType('Average'); + await visualBuilder.setFieldForAggregation('bytes'); + }); + + it('should display field formatted row labels with field formatted data by default', async () => { + const expected = + 'OS Average of bytes\nWIN 8 6.786KB\nWIN XP 3.804KB\nWIN 7 6.596KB\nIOS 4.844KB\nOSX 3.06KB'; + + const tableData = await visualBuilder.getViewTable(); + expect(tableData).to.be(expected); + }); + + it('should display field formatted row labels with raw data', async () => { + const expected = + 'OS Average of bytes\nWIN 8 6,948.846\nWIN XP 3,895.6\nWIN 7 6,753.833\nIOS 4,960.2\nOSX 3,133'; + + await visualBuilder.clickSeriesOption(); + await visualBuilder.changeDataFormatter('number'); + + const tableData = await visualBuilder.getViewTable(); + expect(tableData).to.be(expected); + }); + + it('should display field formatted row labels with TSVB formatted data', async () => { + const expected = + 'OS Average of bytes\nWIN 8 694,884.615%\nWIN XP 389,560%\nWIN 7 675,383.333%\nIOS 496,020%\nOSX 313,300%'; + + await visualBuilder.clickSeriesOption(); + await visualBuilder.changeDataFormatter('percent'); + + const tableData = await visualBuilder.getViewTable(); + expect(tableData).to.be(expected); + }); + + after(async () => { + await toggleSetFormatForMachineOsRaw(); + await settings.controlChangeSave(); + }); + }); + it('should display drilldown urls', async () => { const baseURL = 'http://elastic.co/foo/'; diff --git a/test/functional/apps/visualize/_tsvb_time_series.ts b/test/functional/apps/visualize/_tsvb_time_series.ts index 4733efade69e1..21bee2d16442f 100644 --- a/test/functional/apps/visualize/_tsvb_time_series.ts +++ b/test/functional/apps/visualize/_tsvb_time_series.ts @@ -89,6 +89,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const expectedLegendValue = '$ 156'; await visualBuilder.clickSeriesOption(); + await visualBuilder.changeDataFormatter('number'); await visualBuilder.enterSeriesTemplate('$ {{value}}'); await retry.try(async () => { const actualCount = await visualBuilder.getRhythmChartLegendValue(); @@ -100,7 +101,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const expectedLegendValue = '15,600%'; await visualBuilder.clickSeriesOption(); - await visualBuilder.changeDataFormatter('Percent'); + await visualBuilder.changeDataFormatter('percent'); const actualCount = await visualBuilder.getRhythmChartLegendValue(); expect(actualCount).to.be(expectedLegendValue); }); @@ -109,14 +110,14 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const expectedLegendValue = '156B'; await visualBuilder.clickSeriesOption(); - await visualBuilder.changeDataFormatter('Bytes'); + await visualBuilder.changeDataFormatter('bytes'); const actualCount = await visualBuilder.getRhythmChartLegendValue(); expect(actualCount).to.be(expectedLegendValue); }); it('should show the correct count in the legend with "Human readable" duration formatter', async () => { await visualBuilder.clickSeriesOption(); - await visualBuilder.changeDataFormatter('Duration'); + await visualBuilder.changeDataFormatter('duration'); await visualBuilder.setDurationFormatterSettings({ to: 'Human readable' }); const actualCountDefault = await visualBuilder.getRhythmChartLegendValue(); expect(actualCountDefault).to.be('a few seconds'); diff --git a/test/functional/apps/visualize/_vertical_bar_chart.ts b/test/functional/apps/visualize/_vertical_bar_chart.ts index a728757a485e1..93022b5d2f0e8 100644 --- a/test/functional/apps/visualize/_vertical_bar_chart.ts +++ b/test/functional/apps/visualize/_vertical_bar_chart.ts @@ -18,11 +18,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const filterBar = getService('filterBar'); const PageObjects = getPageObjects(['visualize', 'visEditor', 'visChart', 'timePicker']); + const xyChartSelector = 'visTypeXyChart'; + describe('vertical bar chart', function () { - let isNewChartsLibraryEnabled = false; before(async () => { - isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); - await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); + await PageObjects.visualize.initTests(); }); const vizName1 = 'Visualization VerticalBarChart'; @@ -41,21 +41,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { log.debug('Field = @timestamp'); await PageObjects.visEditor.selectField('@timestamp'); // leaving Interval set to Auto - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); }; describe('bar charts x axis tick labels', () => { it('should show tick labels also after rotation of the chart', async function () { await initBarChart(); - const bottomLabels = await PageObjects.visChart.getXAxisLabels(); + const bottomLabels = await PageObjects.visChart.getXAxisLabels(xyChartSelector); log.debug(`${bottomLabels.length} tick labels on bottom x axis`); await PageObjects.visEditor.clickMetricsAndAxes(); await PageObjects.visEditor.selectXAxisPosition('left'); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); // the getYAxisLabels helper always returns the labels on the left axis - const leftLabels = await PageObjects.visChart.getYAxisLabels(); + const leftLabels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); log.debug(`${leftLabels.length} tick labels on left x axis`); expect(leftLabels.length).to.be.greaterThan(bottomLabels.length * (2 / 3)); }); @@ -69,16 +69,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.selectAggregation('Date Range'); await PageObjects.visEditor.selectField('@timestamp'); - await PageObjects.visEditor.clickGo(); - const bottomLabels = await PageObjects.visChart.getXAxisLabels(); + await PageObjects.visEditor.clickGo(true); + const bottomLabels = await PageObjects.visChart.getXAxisLabels(xyChartSelector); expect(bottomLabels.length).to.be(1); await PageObjects.visEditor.clickMetricsAndAxes(); await PageObjects.visEditor.selectXAxisPosition('left'); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); // the getYAxisLabels helper always returns the labels on the left axis - const leftLabels = await PageObjects.visChart.getYAxisLabels(); + const leftLabels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); expect(leftLabels.length).to.be(1); }); }); @@ -96,8 +96,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.selectField('@timestamp'); await PageObjects.visEditor.clickAddDateRange(); await PageObjects.visEditor.setDateRangeByIndex('1', 'now-2w/w', 'now-1w/w'); - await PageObjects.visEditor.clickGo(); - const bottomLabels = await PageObjects.visChart.getXAxisLabels(); + await PageObjects.visEditor.clickGo(true); + const bottomLabels = await PageObjects.visChart.getXAxisLabels(xyChartSelector); expect(bottomLabels.length).to.be(2); }); }); @@ -146,7 +146,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // return arguments[0].getAttribute(arguments[1]);","args":[{"ELEMENT":"592"},"fill"]}] arguments[0].getAttribute is not a function // try sleeping a bit before getting that data await retry.try(async () => { - const data = await PageObjects.visChart.getBarChartData(); + const data = await PageObjects.visChart.getBarChartData(xyChartSelector); log.debug('data=' + data); log.debug('data.length=' + data.length); expect(data).to.eql(expectedChartValues); @@ -257,7 +257,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // return arguments[0].getAttribute(arguments[1]);","args":[{"ELEMENT":"592"},"fill"]}] arguments[0].getAttribute is not a function // try sleeping a bit before getting that data await retry.try(async () => { - const data = await PageObjects.visChart.getBarChartData(); + const data = await PageObjects.visChart.getBarChartData(xyChartSelector); log.debug('data=' + data); log.debug('data.length=' + data.length); expect(data).to.eql(expectedChartValues); @@ -265,7 +265,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.toggleOpenEditor(2); await PageObjects.visEditor.clickDropPartialBuckets(); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); expectedChartValues = [ 218, @@ -333,7 +333,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // return arguments[0].getAttribute(arguments[1]);","args":[{"ELEMENT":"592"},"fill"]}] arguments[0].getAttribute is not a function // try sleeping a bit before getting that data await retry.try(async () => { - const data = await PageObjects.visChart.getBarChartData(); + const data = await PageObjects.visChart.getBarChartData(xyChartSelector); log.debug('data=' + data); log.debug('data.length=' + data.length); expect(data).to.eql(expectedChartValues); @@ -349,11 +349,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.clickYAxisOptions(axisId); await PageObjects.visEditor.selectYAxisScaleType(axisId, 'log'); await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(xyChartSelector); - const minLabel = await PageObjects.visChart.getExpectedValue(2, 1); - const maxLabel = await PageObjects.visChart.getExpectedValue(5000, 900); + const minLabel = 1; + const maxLabel = 900; const numberOfLabels = 10; expect(labels.length).to.be.greaterThan(numberOfLabels); expect(labels[0]).to.eql(minLabel); @@ -362,11 +362,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should show filtered ticks on selecting log scale', async () => { await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(xyChartSelector); - const minLabel = await PageObjects.visChart.getExpectedValue(2, 1); - const maxLabel = await PageObjects.visChart.getExpectedValue(5000, 900); + const minLabel = 1; + const maxLabel = 900; const numberOfLabels = 10; expect(labels.length).to.be.greaterThan(numberOfLabels); expect(labels[0]).to.eql(minLabel); @@ -376,47 +376,35 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should show ticks on selecting square root scale', async () => { await PageObjects.visEditor.selectYAxisScaleType(axisId, 'square root'); await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400', '1,600'], - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400'] - ); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); + const expectedLabels = ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400']; expect(labels).to.eql(expectedLabels); }); it('should show filtered ticks on selecting square root scale', async () => { await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['200', '400', '600', '800', '1,000', '1,200', '1,400'], - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400'] - ); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); + const expectedLabels = ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400']; expect(labels).to.eql(expectedLabels); }); it('should show ticks on selecting linear scale', async () => { await PageObjects.visEditor.selectYAxisScaleType(axisId, 'linear'); await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); log.debug(labels); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400', '1,600'], - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400'] - ); + const expectedLabels = ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400']; expect(labels).to.eql(expectedLabels); }); it('should show filtered ticks on selecting linear scale', async () => { await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['200', '400', '600', '800', '1,000', '1,200', '1,400'], - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400'] - ); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); + const expectedLabels = ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400']; expect(labels).to.eql(expectedLabels); }); }); @@ -429,8 +417,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.selectYAxisMode('percentage'); await PageObjects.visEditor.changeYAxisShowCheckbox(axisId, true); await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); expect(labels[0]).to.eql('0%'); expect(labels[labels.length - 1]).to.eql('100%'); }); @@ -445,33 +433,27 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.selectAggregation('Terms'); await PageObjects.visEditor.selectField('response.raw'); await PageObjects.visChart.waitForVisualizationRenderingStabilized(); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); - const expectedEntries = await PageObjects.visChart.getExpectedValue( - ['200', '404', '503'], - ['503', '404', '200'] // sorting aligned with rendered geometries - ); - const legendEntries = await PageObjects.visChart.getLegendEntries(); + const expectedEntries = ['503', '404', '200']; // sorting aligned with rendered geometries + const legendEntries = await PageObjects.visChart.getLegendEntriesXYCharts(xyChartSelector); expect(legendEntries).to.eql(expectedEntries); }); it('should allow custom sorting of series', async () => { await PageObjects.visEditor.toggleOpenEditor(1, 'false'); await PageObjects.visEditor.selectCustomSortMetric(3, 'Min', 'bytes'); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); - const expectedEntries = await PageObjects.visChart.getExpectedValue( - ['404', '200', '503'], - ['503', '200', '404'] // sorting aligned with rendered geometries - ); - const legendEntries = await PageObjects.visChart.getLegendEntries(); + const expectedEntries = ['503', '200', '404']; + const legendEntries = await PageObjects.visChart.getLegendEntriesXYCharts(xyChartSelector); expect(legendEntries).to.eql(expectedEntries); }); it('should correctly filter by legend', async () => { - await PageObjects.visChart.filterLegend('200'); + await PageObjects.visChart.filterLegend('200', true); await PageObjects.visChart.waitForVisualization(); - const legendEntries = await PageObjects.visChart.getLegendEntries(); + const legendEntries = await PageObjects.visChart.getLegendEntriesXYCharts(xyChartSelector); const expectedEntries = ['200']; expect(legendEntries).to.eql(expectedEntries); await filterBar.removeFilter('response.raw'); @@ -494,45 +476,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.selectAggregation('Terms'); await PageObjects.visEditor.selectField('machine.os'); await PageObjects.visChart.waitForVisualizationRenderingStabilized(); - await PageObjects.visEditor.clickGo(); - - const expectedEntries = await PageObjects.visChart.getExpectedValue( - [ - '200 - win 8', - '200 - win xp', - '200 - ios', - '200 - osx', - '200 - win 7', - '404 - ios', - '503 - ios', - '503 - osx', - '503 - win 7', - '503 - win 8', - '503 - win xp', - '404 - osx', - '404 - win 7', - '404 - win 8', - '404 - win xp', - ], - [ - '404 - win xp', - '404 - win 8', - '404 - win 7', - '404 - osx', - '503 - win xp', - '503 - win 8', - '503 - win 7', - '503 - osx', - '503 - ios', - '404 - ios', - '200 - win 7', - '200 - osx', - '200 - ios', - '200 - win xp', - '200 - win 8', - ] - ); - const legendEntries = await PageObjects.visChart.getLegendEntries(); + await PageObjects.visEditor.clickGo(true); + + const expectedEntries = [ + '404 - win xp', + '404 - win 8', + '404 - win 7', + '404 - osx', + '503 - win xp', + '503 - win 8', + '503 - win 7', + '503 - osx', + '503 - ios', + '404 - ios', + '200 - win 7', + '200 - osx', + '200 - ios', + '200 - win xp', + '200 - win 8', + ]; + const legendEntries = await PageObjects.visChart.getLegendEntriesXYCharts(xyChartSelector); expect(legendEntries).to.eql(expectedEntries); }); @@ -540,13 +503,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // this will avoid issues with the play tooltip covering the disable agg button await testSubjects.scrollIntoView('metricsAggGroup'); await PageObjects.visEditor.toggleDisabledAgg(3); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); - const expectedEntries = await PageObjects.visChart.getExpectedValue( - ['win 8', 'win xp', 'ios', 'osx', 'win 7'], - ['win 7', 'osx', 'ios', 'win xp', 'win 8'] - ); - const legendEntries = await PageObjects.visChart.getLegendEntries(); + const expectedEntries = ['win 7', 'osx', 'ios', 'win xp', 'win 8']; + const legendEntries = await PageObjects.visChart.getLegendEntriesXYCharts(xyChartSelector); expect(legendEntries).to.eql(expectedEntries); }); }); @@ -559,10 +519,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.toggleOpenEditor(1); await PageObjects.visEditor.selectAggregation('Derivative', 'metrics'); await PageObjects.visChart.waitForVisualizationRenderingStabilized(); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); const expectedEntries = ['Derivative of Count']; - const legendEntries = await PageObjects.visChart.getLegendEntries(); + const legendEntries = await PageObjects.visChart.getLegendEntriesXYCharts(xyChartSelector); expect(legendEntries).to.eql(expectedEntries); }); diff --git a/test/functional/apps/visualize/_vertical_bar_chart_nontimeindex.ts b/test/functional/apps/visualize/_vertical_bar_chart_nontimeindex.ts index 97817315b5801..e9f39a45d7892 100644 --- a/test/functional/apps/visualize/_vertical_bar_chart_nontimeindex.ts +++ b/test/functional/apps/visualize/_vertical_bar_chart_nontimeindex.ts @@ -16,9 +16,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const inspector = getService('inspector'); const PageObjects = getPageObjects(['common', 'visualize', 'header', 'visEditor', 'visChart']); + const xyChartSelector = 'visTypeXyChart'; + describe('vertical bar chart with index without time filter', function () { const vizName1 = 'Visualization VerticalBarChart without time filter'; - let isNewChartsLibraryEnabled = false; const initBarChart = async () => { log.debug('navigateToApp visualize'); @@ -37,12 +38,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.selectField('@timestamp'); await PageObjects.visEditor.setInterval('3h', { type: 'custom' }); await PageObjects.visChart.waitForVisualizationRenderingStabilized(); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); }; before(async () => { - isNewChartsLibraryEnabled = await PageObjects.visChart.isNewChartsLibraryEnabled(); - await PageObjects.visualize.initTests(isNewChartsLibraryEnabled); + await PageObjects.visualize.initTests(); await initBarChart(); }); @@ -89,7 +89,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // return arguments[0].getAttribute(arguments[1]);","args":[{"ELEMENT":"592"},"fill"]}] arguments[0].getAttribute is not a function // try sleeping a bit before getting that data await retry.try(async () => { - const data = await PageObjects.visChart.getBarChartData(); + const data = await PageObjects.visChart.getBarChartData(xyChartSelector); log.debug('data=' + data); log.debug('data.length=' + data.length); expect(data).to.eql(expectedChartValues); @@ -134,10 +134,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visEditor.clickYAxisOptions(axisId); await PageObjects.visEditor.selectYAxisScaleType(axisId, 'log'); await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(); - const minLabel = await PageObjects.visChart.getExpectedValue(2, 1); - const maxLabel = await PageObjects.visChart.getExpectedValue(5000, 900); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(xyChartSelector); + const minLabel = 1; + const maxLabel = 900; const numberOfLabels = 10; expect(labels.length).to.be.greaterThan(numberOfLabels); expect(labels[0]).to.eql(minLabel); @@ -146,10 +146,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should show filtered ticks on selecting log scale', async () => { await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(); - const minLabel = await PageObjects.visChart.getExpectedValue(2, 1); - const maxLabel = await PageObjects.visChart.getExpectedValue(5000, 900); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabelsAsNumbers(xyChartSelector); + const minLabel = 1; + const maxLabel = 900; const numberOfLabels = 10; expect(labels.length).to.be.greaterThan(numberOfLabels); expect(labels[0]).to.eql(minLabel); @@ -159,47 +159,35 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should show ticks on selecting square root scale', async () => { await PageObjects.visEditor.selectYAxisScaleType(axisId, 'square root'); await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400', '1,600'], - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400'] - ); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); + const expectedLabels = ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400']; expect(labels).to.eql(expectedLabels); }); it('should show filtered ticks on selecting square root scale', async () => { await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['200', '400', '600', '800', '1,000', '1,200', '1,400'], - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400'] - ); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); + const expectedLabels = ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400']; expect(labels).to.eql(expectedLabels); }); it('should show ticks on selecting linear scale', async () => { await PageObjects.visEditor.selectYAxisScaleType(axisId, 'linear'); await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, false); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); log.debug(labels); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400', '1,600'], - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400'] - ); + const expectedLabels = ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400']; expect(labels).to.eql(expectedLabels); }); it('should show filtered ticks on selecting linear scale', async () => { await PageObjects.visEditor.changeYAxisFilterLabelsCheckbox(axisId, true); - await PageObjects.visEditor.clickGo(); - const labels = await PageObjects.visChart.getYAxisLabels(); - const expectedLabels = await PageObjects.visChart.getExpectedValue( - ['200', '400', '600', '800', '1,000', '1,200', '1,400'], - ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400'] - ); + await PageObjects.visEditor.clickGo(true); + const labels = await PageObjects.visChart.getYAxisLabels(xyChartSelector); + const expectedLabels = ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400']; expect(labels).to.eql(expectedLabels); }); }); @@ -215,15 +203,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.common.sleep(1003); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); await PageObjects.header.waitUntilLoadingHasFinished(); - const expectedEntries = await PageObjects.visChart.getExpectedValue( - ['200', '404', '503'], - ['503', '404', '200'] // sorting aligned with rendered geometries - ); + const expectedEntries = ['503', '404', '200']; // sorting aligned with rendered geometries - const legendEntries = await PageObjects.visChart.getLegendEntries(); + const legendEntries = await PageObjects.visChart.getLegendEntriesXYCharts(xyChartSelector); expect(legendEntries).to.eql(expectedEntries); }); }); @@ -245,59 +230,37 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.common.sleep(1003); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); await PageObjects.header.waitUntilLoadingHasFinished(); - const expectedEntries = await PageObjects.visChart.getExpectedValue( - [ - '200 - win 8', - '200 - win xp', - '200 - ios', - '200 - osx', - '200 - win 7', - '404 - ios', - '503 - ios', - '503 - osx', - '503 - win 7', - '503 - win 8', - '503 - win xp', - '404 - osx', - '404 - win 7', - '404 - win 8', - '404 - win xp', - ], - [ - '404 - win xp', - '404 - win 8', - '404 - win 7', - '404 - osx', - '503 - win xp', - '503 - win 8', - '503 - win 7', - '503 - osx', - '503 - ios', - '404 - ios', - '200 - win 7', - '200 - osx', - '200 - ios', - '200 - win xp', - '200 - win 8', - ] - ); - const legendEntries = await PageObjects.visChart.getLegendEntries(); + const expectedEntries = [ + '404 - win xp', + '404 - win 8', + '404 - win 7', + '404 - osx', + '503 - win xp', + '503 - win 8', + '503 - win 7', + '503 - osx', + '503 - ios', + '404 - ios', + '200 - win 7', + '200 - osx', + '200 - ios', + '200 - win xp', + '200 - win 8', + ]; + const legendEntries = await PageObjects.visChart.getLegendEntriesXYCharts(xyChartSelector); expect(legendEntries).to.eql(expectedEntries); }); it('should show correct series when disabling first agg', async function () { await PageObjects.visEditor.toggleDisabledAgg(3); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); await PageObjects.header.waitUntilLoadingHasFinished(); - const expectedEntries = await PageObjects.visChart.getExpectedValue( - ['win 8', 'win xp', 'ios', 'osx', 'win 7'], - ['win 7', 'osx', 'ios', 'win xp', 'win 8'] - ); - const legendEntries = await PageObjects.visChart.getLegendEntries(); + const expectedEntries = ['win 7', 'osx', 'ios', 'win xp', 'win 8']; + const legendEntries = await PageObjects.visChart.getLegendEntriesXYCharts(xyChartSelector); expect(legendEntries).to.eql(expectedEntries); }); }); @@ -312,11 +275,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.common.sleep(1003); - await PageObjects.visEditor.clickGo(); + await PageObjects.visEditor.clickGo(true); await PageObjects.header.waitUntilLoadingHasFinished(); const expectedEntries = ['Derivative of Count']; - const legendEntries = await PageObjects.visChart.getLegendEntries(); + const legendEntries = await PageObjects.visChart.getLegendEntriesXYCharts(xyChartSelector); expect(legendEntries).to.eql(expectedEntries); }); }); diff --git a/test/functional/apps/visualize/index.ts b/test/functional/apps/visualize/index.ts index 9004ecaf22d80..dff57e6b96265 100644 --- a/test/functional/apps/visualize/index.ts +++ b/test/functional/apps/visualize/index.ts @@ -30,7 +30,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { before(async () => { await kibanaServer.uiSettings.update({ - 'visualization:visualize:legacyChartsLibrary': false, 'visualization:visualize:legacyPieChartsLibrary': false, }); await browser.refresh(); @@ -38,7 +37,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { after(async () => { await kibanaServer.uiSettings.update({ - 'visualization:visualize:legacyChartsLibrary': true, 'visualization:visualize:legacyPieChartsLibrary': true, }); await browser.refresh(); @@ -59,7 +57,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { this.tags('ciGroup9'); loadTestFile(require.resolve('./_embedding_chart')); - loadTestFile(require.resolve('./_area_chart')); loadTestFile(require.resolve('./_data_table')); loadTestFile(require.resolve('./_data_table_nontimeindex')); loadTestFile(require.resolve('./_data_table_notimeindex_filters')); @@ -73,7 +70,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./_experimental_vis')); loadTestFile(require.resolve('./_gauge_chart')); loadTestFile(require.resolve('./_heatmap_chart')); - loadTestFile(require.resolve('./input_control_vis')); loadTestFile(require.resolve('./_histogram_request_start')); loadTestFile(require.resolve('./_metric_chart')); }); @@ -81,11 +77,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { describe('visualize ciGroup4', function () { this.tags('ciGroup4'); - loadTestFile(require.resolve('./_line_chart_split_series')); - loadTestFile(require.resolve('./_line_chart_split_chart')); loadTestFile(require.resolve('./_pie_chart')); - loadTestFile(require.resolve('./_point_series_options')); - loadTestFile(require.resolve('./_markdown_vis')); loadTestFile(require.resolve('./_shared_item')); loadTestFile(require.resolve('./_lab_mode')); loadTestFile(require.resolve('./_linked_saved_searches')); @@ -97,8 +89,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { this.tags('ciGroup12'); loadTestFile(require.resolve('./_tag_cloud')); - loadTestFile(require.resolve('./_vertical_bar_chart')); - loadTestFile(require.resolve('./_vertical_bar_chart_nontimeindex')); loadTestFile(require.resolve('./_tsvb_chart')); loadTestFile(require.resolve('./_tsvb_time_series')); loadTestFile(require.resolve('./_tsvb_markdown')); diff --git a/test/functional/apps/visualize/legacy/_data_table.ts b/test/functional/apps/visualize/legacy/_data_table.ts deleted file mode 100644 index 6613e3d13a31b..0000000000000 --- a/test/functional/apps/visualize/legacy/_data_table.ts +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not 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 'test/functional/ftr_provider_context'; - -export default function ({ getService, getPageObjects }: FtrProviderContext) { - const log = getService('log'); - const testSubjects = getService('testSubjects'); - const PageObjects = getPageObjects([ - 'visualize', - 'timePicker', - 'visEditor', - 'visChart', - 'legacyDataTableVis', - ]); - - describe('legacy data table visualization', function indexPatternCreation() { - before(async function () { - await PageObjects.visualize.initTests(); - log.debug('navigateToApp visualize'); - await PageObjects.visualize.navigateToNewAggBasedVisualization(); - log.debug('clickDataTable'); - await PageObjects.visualize.clickDataTable(); - log.debug('clickNewSearch'); - await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - log.debug('Bucket = Split rows'); - await PageObjects.visEditor.clickBucket('Split rows'); - log.debug('Aggregation = Histogram'); - await PageObjects.visEditor.selectAggregation('Histogram'); - log.debug('Field = bytes'); - await PageObjects.visEditor.selectField('bytes'); - log.debug('Interval = 2000'); - await PageObjects.visEditor.setInterval('2000', { type: 'numeric' }); - await PageObjects.visEditor.clickGo(); - }); - - it('should show percentage columns', async () => { - async function expectValidTableData() { - const data = await PageObjects.legacyDataTableVis.getTableVisContent(); - expect(data).to.be.eql([ - ['≥ 0B and < 1,000B', '1,351', '64.703%'], - ['≥ 1,000B and < 1.953KB', '737', '35.297%'], - ]); - } - - // load a plain table - await PageObjects.visualize.navigateToNewAggBasedVisualization(); - await PageObjects.visualize.clickDataTable(); - await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - await PageObjects.visEditor.clickBucket('Split rows'); - await PageObjects.visEditor.selectAggregation('Range'); - await PageObjects.visEditor.selectField('bytes'); - await PageObjects.visEditor.clickGo(); - await PageObjects.visEditor.clickOptionsTab(); - await PageObjects.visEditor.setSelectByOptionText( - 'datatableVisualizationPercentageCol', - 'Count' - ); - await PageObjects.visEditor.clickGo(); - - await expectValidTableData(); - - // check that it works after selecting a column that's deleted - await PageObjects.visEditor.clickDataTab(); - await PageObjects.visEditor.clickBucket('Metric', 'metrics'); - await PageObjects.visEditor.selectAggregation('Average', 'metrics'); - await PageObjects.visEditor.selectField('bytes', 'metrics'); - await PageObjects.visEditor.removeDimension(1); - await PageObjects.visEditor.clickGo(); - await PageObjects.visEditor.clickOptionsTab(); - - const data = await PageObjects.legacyDataTableVis.getTableVisContent(); - expect(data).to.be.eql([ - ['≥ 0B and < 1,000B', '344.094B'], - ['≥ 1,000B and < 1.953KB', '1.697KB'], - ]); - }); - - it('should show correct data for a data table with date histogram', async () => { - await PageObjects.visualize.navigateToNewAggBasedVisualization(); - await PageObjects.visualize.clickDataTable(); - await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - await PageObjects.visEditor.clickBucket('Split rows'); - await PageObjects.visEditor.selectAggregation('Date Histogram'); - await PageObjects.visEditor.selectField('@timestamp'); - await PageObjects.visEditor.setInterval('Day'); - await PageObjects.visEditor.clickGo(); - const data = await PageObjects.legacyDataTableVis.getTableVisContent(); - expect(data).to.be.eql([ - ['2015-09-20', '4,757'], - ['2015-09-21', '4,614'], - ['2015-09-22', '4,633'], - ]); - }); - - describe('otherBucket', () => { - before(async () => { - await PageObjects.visualize.navigateToNewAggBasedVisualization(); - await PageObjects.visualize.clickDataTable(); - await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - await PageObjects.visEditor.clickBucket('Split rows'); - await PageObjects.visEditor.selectAggregation('Terms'); - await PageObjects.visEditor.selectField('extension.raw'); - await PageObjects.visEditor.setSize(2); - await PageObjects.visEditor.clickGo(); - - await PageObjects.visEditor.toggleOtherBucket(); - await PageObjects.visEditor.toggleMissingBucket(); - await PageObjects.visEditor.clickGo(); - }); - - it('should show correct data', async () => { - const data = await PageObjects.legacyDataTableVis.getTableVisContent(); - expect(data).to.be.eql([ - ['jpg', '9,109'], - ['css', '2,159'], - ['Other', '2,736'], - ]); - }); - - it('should apply correct filter', async () => { - await PageObjects.legacyDataTableVis.filterOnTableCell(1, 3); - await PageObjects.visChart.waitForVisualizationRenderingStabilized(); - const data = await PageObjects.legacyDataTableVis.getTableVisContent(); - expect(data).to.be.eql([ - ['png', '1,373'], - ['gif', '918'], - ['Other', '445'], - ]); - }); - }); - - describe('metricsOnAllLevels', () => { - before(async () => { - await PageObjects.visualize.navigateToNewAggBasedVisualization(); - await PageObjects.visualize.clickDataTable(); - await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - await PageObjects.visEditor.clickBucket('Split rows'); - await PageObjects.visEditor.selectAggregation('Terms'); - await PageObjects.visEditor.selectField('extension.raw'); - await PageObjects.visEditor.setSize(2); - await PageObjects.visEditor.toggleOpenEditor(2, 'false'); - await PageObjects.visEditor.clickBucket('Split rows'); - await PageObjects.visEditor.selectAggregation('Terms'); - await PageObjects.visEditor.selectField('geo.dest'); - await PageObjects.visEditor.toggleOpenEditor(3, 'false'); - await PageObjects.visEditor.clickGo(); - }); - - it('should show correct data without showMetricsAtAllLevels', async () => { - const data = await PageObjects.legacyDataTableVis.getTableVisContent(); - expect(data).to.be.eql([ - ['jpg', 'CN', '1,718'], - ['jpg', 'IN', '1,511'], - ['jpg', 'US', '770'], - ['jpg', 'ID', '314'], - ['jpg', 'PK', '244'], - ['css', 'CN', '422'], - ['css', 'IN', '346'], - ['css', 'US', '189'], - ['css', 'ID', '68'], - ['css', 'BR', '58'], - ]); - }); - - it('should show correct data without showMetricsAtAllLevels even if showPartialRows is selected', async () => { - await PageObjects.visEditor.clickOptionsTab(); - await testSubjects.setCheckbox('showPartialRows', 'check'); - await PageObjects.visEditor.clickGo(); - const data = await PageObjects.legacyDataTableVis.getTableVisContent(); - expect(data).to.be.eql([ - ['jpg', 'CN', '1,718'], - ['jpg', 'IN', '1,511'], - ['jpg', 'US', '770'], - ['jpg', 'ID', '314'], - ['jpg', 'PK', '244'], - ['css', 'CN', '422'], - ['css', 'IN', '346'], - ['css', 'US', '189'], - ['css', 'ID', '68'], - ['css', 'BR', '58'], - ]); - }); - - it('should show metrics on each level', async () => { - await PageObjects.visEditor.clickOptionsTab(); - await testSubjects.setCheckbox('showMetricsAtAllLevels', 'check'); - await PageObjects.visEditor.clickGo(); - const data = await PageObjects.legacyDataTableVis.getTableVisContent(); - expect(data).to.be.eql([ - ['jpg', '9,109', 'CN', '1,718'], - ['jpg', '9,109', 'IN', '1,511'], - ['jpg', '9,109', 'US', '770'], - ['jpg', '9,109', 'ID', '314'], - ['jpg', '9,109', 'PK', '244'], - ['css', '2,159', 'CN', '422'], - ['css', '2,159', 'IN', '346'], - ['css', '2,159', 'US', '189'], - ['css', '2,159', 'ID', '68'], - ['css', '2,159', 'BR', '58'], - ]); - }); - - it('should show metrics other than count on each level', async () => { - await PageObjects.visEditor.clickDataTab(); - await PageObjects.visEditor.clickBucket('Metric', 'metrics'); - await PageObjects.visEditor.selectAggregation('Average', 'metrics'); - await PageObjects.visEditor.selectField('bytes', 'metrics'); - await PageObjects.visEditor.clickGo(); - const data = await PageObjects.legacyDataTableVis.getTableVisContent(); - expect(data).to.be.eql([ - ['jpg', '9,109', '5.469KB', 'CN', '1,718', '5.477KB'], - ['jpg', '9,109', '5.469KB', 'IN', '1,511', '5.456KB'], - ['jpg', '9,109', '5.469KB', 'US', '770', '5.371KB'], - ['jpg', '9,109', '5.469KB', 'ID', '314', '5.424KB'], - ['jpg', '9,109', '5.469KB', 'PK', '244', '5.41KB'], - ['css', '2,159', '5.566KB', 'CN', '422', '5.712KB'], - ['css', '2,159', '5.566KB', 'IN', '346', '5.754KB'], - ['css', '2,159', '5.566KB', 'US', '189', '5.333KB'], - ['css', '2,159', '5.566KB', 'ID', '68', '4.82KB'], - ['css', '2,159', '5.566KB', 'BR', '58', '5.915KB'], - ]); - }); - }); - - describe('split tables', () => { - before(async () => { - await PageObjects.visualize.navigateToNewAggBasedVisualization(); - await PageObjects.visualize.clickDataTable(); - await PageObjects.visualize.clickNewSearch(); - await PageObjects.timePicker.setDefaultAbsoluteRange(); - await PageObjects.visEditor.clickBucket('Split table'); - await PageObjects.visEditor.selectAggregation('Terms'); - await PageObjects.visEditor.selectField('extension.raw'); - await PageObjects.visEditor.setSize(2); - await PageObjects.visEditor.toggleOpenEditor(2, 'false'); - await PageObjects.visEditor.clickBucket('Split rows'); - await PageObjects.visEditor.selectAggregation('Terms'); - await PageObjects.visEditor.selectField('geo.dest'); - await PageObjects.visEditor.setSize(3, 3); - await PageObjects.visEditor.toggleOpenEditor(3, 'false'); - await PageObjects.visEditor.clickBucket('Split rows'); - await PageObjects.visEditor.selectAggregation('Terms'); - await PageObjects.visEditor.selectField('geo.src'); - await PageObjects.visEditor.setSize(3, 4); - await PageObjects.visEditor.toggleOpenEditor(4, 'false'); - await PageObjects.visEditor.clickGo(); - }); - - it('should have a splitted table', async () => { - const data = await PageObjects.legacyDataTableVis.getTableVisContent(); - expect(data).to.be.eql([ - [ - ['CN', 'CN', '330'], - ['CN', 'IN', '274'], - ['CN', 'US', '140'], - ['IN', 'CN', '286'], - ['IN', 'IN', '281'], - ['IN', 'US', '133'], - ['US', 'CN', '135'], - ['US', 'IN', '134'], - ['US', 'US', '52'], - ], - [ - ['CN', 'CN', '90'], - ['CN', 'IN', '84'], - ['CN', 'US', '27'], - ['IN', 'CN', '69'], - ['IN', 'IN', '58'], - ['IN', 'US', '34'], - ['US', 'IN', '36'], - ['US', 'CN', '29'], - ['US', 'US', '13'], - ], - ]); - }); - - it('should show metrics for split bucket when using showMetricsAtAllLevels', async () => { - await PageObjects.visEditor.clickOptionsTab(); - await testSubjects.setCheckbox('showMetricsAtAllLevels', 'check'); - await PageObjects.visEditor.clickGo(); - const data = await PageObjects.legacyDataTableVis.getTableVisContent(); - expect(data).to.be.eql([ - [ - ['CN', '1,718', 'CN', '330'], - ['CN', '1,718', 'IN', '274'], - ['CN', '1,718', 'US', '140'], - ['IN', '1,511', 'CN', '286'], - ['IN', '1,511', 'IN', '281'], - ['IN', '1,511', 'US', '133'], - ['US', '770', 'CN', '135'], - ['US', '770', 'IN', '134'], - ['US', '770', 'US', '52'], - ], - [ - ['CN', '422', 'CN', '90'], - ['CN', '422', 'IN', '84'], - ['CN', '422', 'US', '27'], - ['IN', '346', 'CN', '69'], - ['IN', '346', 'IN', '58'], - ['IN', '346', 'US', '34'], - ['US', '189', 'IN', '36'], - ['US', '189', 'CN', '29'], - ['US', '189', 'US', '13'], - ], - ]); - }); - }); - }); -} diff --git a/test/functional/apps/visualize/legacy/index.ts b/test/functional/apps/visualize/legacy/index.ts deleted file mode 100644 index 37cf8a5950592..0000000000000 --- a/test/functional/apps/visualize/legacy/index.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { FtrProviderContext } from '../../../ftr_provider_context'; -import { FORMATS_UI_SETTINGS } from '../../../../../src/plugins/field_formats/common'; - -export default function ({ getPageObjects, getService, loadTestFile }: FtrProviderContext) { - const browser = getService('browser'); - const log = getService('log'); - const esArchiver = getService('esArchiver'); - const kibanaServer = getService('kibanaServer'); - const PageObjects = getPageObjects(['visualize']); - - describe('visualize with legacy visualizations', () => { - before(async () => { - await PageObjects.visualize.initTests(); - log.debug('Starting visualize legacy before method'); - await browser.setWindowSize(1280, 800); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/long_window_logstash'); - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/visualize.json'); - await kibanaServer.uiSettings.replace({ - defaultIndex: 'logstash-*', - [FORMATS_UI_SETTINGS.FORMAT_BYTES_DEFAULT_PATTERN]: '0,0.[000]b', - }); - }); - - describe('legacy data table visualization', function () { - this.tags('ciGroup9'); - - loadTestFile(require.resolve('./_data_table')); - }); - }); -} diff --git a/test/functional/config.js b/test/functional/config.js index f477b25086431..97b3d85a8e243 100644 --- a/test/functional/config.js +++ b/test/functional/config.js @@ -19,12 +19,12 @@ export default async function ({ readConfigFile }) { require.resolve('./apps/console'), require.resolve('./apps/context'), require.resolve('./apps/dashboard'), + require.resolve('./apps/dashboard_elements'), require.resolve('./apps/discover'), require.resolve('./apps/getting_started'), require.resolve('./apps/home'), require.resolve('./apps/management'), require.resolve('./apps/saved_objects_management'), - require.resolve('./apps/timelion'), require.resolve('./apps/visualize'), ], pageObjects, @@ -56,7 +56,6 @@ export default async function ({ readConfigFile }) { defaults: { 'accessibility:disableAnimations': true, 'dateFormat:tz': 'UTC', - 'visualization:visualize:legacyChartsLibrary': true, 'visualization:visualize:legacyPieChartsLibrary': true, }, }, @@ -91,9 +90,6 @@ export default async function ({ readConfigFile }) { settings: { pathname: '/app/management', }, - timelion: { - pathname: '/app/timelion', - }, console: { pathname: '/app/dev_tools', hash: '/console', @@ -286,7 +282,7 @@ export default async function ({ readConfigFile }) { cluster: [], indices: [ { - names: ['message_with_newline'], + names: ['newline-test'], privileges: ['read', 'view_index_metadata'], field_security: { grant: ['*'], except: [] }, }, diff --git a/test/functional/config.legacy.ts b/test/functional/config.legacy.ts deleted file mode 100644 index d38f30a32ef61..0000000000000 --- a/test/functional/config.legacy.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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { FtrConfigProviderContext } from '@kbn/test'; - -// eslint-disable-next-line import/no-default-export -export default async function ({ readConfigFile }: FtrConfigProviderContext) { - const defaultConfig = await readConfigFile(require.resolve('./config')); - - return { - ...defaultConfig.getAll(), - - testFiles: [require.resolve('./apps/visualize/legacy')], - - kbnTestServer: { - ...defaultConfig.get('kbnTestServer'), - serverArgs: [ - ...defaultConfig.get('kbnTestServer.serverArgs'), - '--vis_type_table.legacyVisEnabled=true', - ], - }, - }; -} diff --git a/test/functional/fixtures/es_archiver/dashboard/current/kibana/mappings.json b/test/functional/fixtures/es_archiver/dashboard/current/kibana/mappings.json index b6e225951c545..161d733e868a8 100644 --- a/test/functional/fixtures/es_archiver/dashboard/current/kibana/mappings.json +++ b/test/functional/fixtures/es_archiver/dashboard/current/kibana/mappings.json @@ -29,7 +29,6 @@ "search": "db2c00e39b36f40930a3b9fc71c823e1", "search-telemetry": "3d1b76c39bfb2cc8296b024d73854724", "telemetry": "36a616f7026dfa617d6655df850fe16d", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", "type": "2f4316de49999235636386fe51dc06c1", "ui-counter": "0d409297dc5ebe1e3a1da691c6ee32e3", "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", @@ -373,47 +372,6 @@ } } }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "tsvb-validation-telemetry": { "dynamic": "false", "type": "object" diff --git a/test/functional/fixtures/es_archiver/dashboard/legacy/mappings.json b/test/functional/fixtures/es_archiver/dashboard/legacy/mappings.json index 45b2508d38033..451369d85acd8 100644 --- a/test/functional/fixtures/es_archiver/dashboard/legacy/mappings.json +++ b/test/functional/fixtures/es_archiver/dashboard/legacy/mappings.json @@ -137,48 +137,6 @@ } } }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/deprecations_service/mappings.json b/test/functional/fixtures/es_archiver/deprecations_service/mappings.json index 5159b946e082f..2d86b863d47dc 100644 --- a/test/functional/fixtures/es_archiver/deprecations_service/mappings.json +++ b/test/functional/fixtures/es_archiver/deprecations_service/mappings.json @@ -29,7 +29,6 @@ "search": "db2c00e39b36f40930a3b9fc71c823e1", "search-telemetry": "3d1b76c39bfb2cc8296b024d73854724", "telemetry": "36a616f7026dfa617d6655df850fe16d", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", "type": "2f4316de49999235636386fe51dc06c1", "ui-counter": "0d409297dc5ebe1e3a1da691c6ee32e3", "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", @@ -331,47 +330,6 @@ "dynamic": "false", "type": "object" }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/discover/mappings.json b/test/functional/fixtures/es_archiver/discover/mappings.json index 93d724aa55603..33bc746c84c8c 100644 --- a/test/functional/fixtures/es_archiver/discover/mappings.json +++ b/test/functional/fixtures/es_archiver/discover/mappings.json @@ -29,7 +29,6 @@ "search": "db2c00e39b36f40930a3b9fc71c823e1", "search-telemetry": "3d1b76c39bfb2cc8296b024d73854724", "telemetry": "36a616f7026dfa617d6655df850fe16d", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", "type": "2f4316de49999235636386fe51dc06c1", "ui-counter": "0d409297dc5ebe1e3a1da691c6ee32e3", "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", @@ -346,47 +345,6 @@ } } }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/empty_kibana/mappings.json b/test/functional/fixtures/es_archiver/empty_kibana/mappings.json index 264096beb11ee..7082f43f45e99 100644 --- a/test/functional/fixtures/es_archiver/empty_kibana/mappings.json +++ b/test/functional/fixtures/es_archiver/empty_kibana/mappings.json @@ -146,48 +146,6 @@ } } }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/invalid_scripted_field/mappings.json b/test/functional/fixtures/es_archiver/invalid_scripted_field/mappings.json index 63cc283f96d32..0d41e0ce86c14 100644 --- a/test/functional/fixtures/es_archiver/invalid_scripted_field/mappings.json +++ b/test/functional/fixtures/es_archiver/invalid_scripted_field/mappings.json @@ -143,47 +143,6 @@ } } }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/kibana_sample_data_flights_index_pattern/mappings.json b/test/functional/fixtures/es_archiver/kibana_sample_data_flights_index_pattern/mappings.json index caa1a9d8ddc11..f980596200b25 100644 --- a/test/functional/fixtures/es_archiver/kibana_sample_data_flights_index_pattern/mappings.json +++ b/test/functional/fixtures/es_archiver/kibana_sample_data_flights_index_pattern/mappings.json @@ -19,7 +19,6 @@ "sample-data-telemetry": "7d3cfeb915303c9641c59681967ffeb4", "search": "181661168bbadd1eff5902361e2a0d5c", "server": "ec97f1c5da1a19609a60874e5af1100c", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", "type": "2f4316de49999235636386fe51dc06c1", "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", "updated_at": "00da57df13e94e9d98437d13ace4bfe0", @@ -245,47 +244,6 @@ } } }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/management/mappings.json b/test/functional/fixtures/es_archiver/management/mappings.json index 45b2508d38033..451369d85acd8 100644 --- a/test/functional/fixtures/es_archiver/management/mappings.json +++ b/test/functional/fixtures/es_archiver/management/mappings.json @@ -137,48 +137,6 @@ } } }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/mgmt/mappings.json b/test/functional/fixtures/es_archiver/mgmt/mappings.json index aefbd9d0ccc8a..f4962f9c47668 100644 --- a/test/functional/fixtures/es_archiver/mgmt/mappings.json +++ b/test/functional/fixtures/es_archiver/mgmt/mappings.json @@ -172,47 +172,6 @@ } } }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/saved_objects_imports/mappings.json b/test/functional/fixtures/es_archiver/saved_objects_imports/mappings.json index 45b2508d38033..451369d85acd8 100644 --- a/test/functional/fixtures/es_archiver/saved_objects_imports/mappings.json +++ b/test/functional/fixtures/es_archiver/saved_objects_imports/mappings.json @@ -137,48 +137,6 @@ } } }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/saved_objects_management/edit_saved_object/mappings.json b/test/functional/fixtures/es_archiver/saved_objects_management/edit_saved_object/mappings.json index 05ca4d8e8307e..bb863dc24c585 100644 --- a/test/functional/fixtures/es_archiver/saved_objects_management/edit_saved_object/mappings.json +++ b/test/functional/fixtures/es_archiver/saved_objects_management/edit_saved_object/mappings.json @@ -358,47 +358,6 @@ } } }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/saved_objects_management/export_exclusion/mappings.json b/test/functional/fixtures/es_archiver/saved_objects_management/export_exclusion/mappings.json index abec2eeb77492..d0101f16f85d0 100644 --- a/test/functional/fixtures/es_archiver/saved_objects_management/export_exclusion/mappings.json +++ b/test/functional/fixtures/es_archiver/saved_objects_management/export_exclusion/mappings.json @@ -387,47 +387,6 @@ } } }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/saved_objects_management/export_transform/mappings.json b/test/functional/fixtures/es_archiver/saved_objects_management/export_transform/mappings.json index b2385a281dd23..9562b381a40f8 100644 --- a/test/functional/fixtures/es_archiver/saved_objects_management/export_transform/mappings.json +++ b/test/functional/fixtures/es_archiver/saved_objects_management/export_transform/mappings.json @@ -29,7 +29,6 @@ "search": "db2c00e39b36f40930a3b9fc71c823e1", "search-telemetry": "3d1b76c39bfb2cc8296b024d73854724", "telemetry": "36a616f7026dfa617d6655df850fe16d", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", "type": "2f4316de49999235636386fe51dc06c1", "ui-counter": "0d409297dc5ebe1e3a1da691c6ee32e3", "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", @@ -370,47 +369,6 @@ "dynamic": "false", "type": "object" }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/saved_objects_management/hidden_saved_objects/mappings.json b/test/functional/fixtures/es_archiver/saved_objects_management/hidden_saved_objects/mappings.json index d59f3b00d4818..780fdda5f7cbe 100644 --- a/test/functional/fixtures/es_archiver/saved_objects_management/hidden_saved_objects/mappings.json +++ b/test/functional/fixtures/es_archiver/saved_objects_management/hidden_saved_objects/mappings.json @@ -29,7 +29,6 @@ "search": "db2c00e39b36f40930a3b9fc71c823e1", "search-telemetry": "3d1b76c39bfb2cc8296b024d73854724", "telemetry": "36a616f7026dfa617d6655df850fe16d", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", "type": "2f4316de49999235636386fe51dc06c1", "ui-counter": "0d409297dc5ebe1e3a1da691c6ee32e3", "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", @@ -378,47 +377,6 @@ "dynamic": "false", "type": "object" }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/saved_objects_management/hidden_types/mappings.json b/test/functional/fixtures/es_archiver/saved_objects_management/hidden_types/mappings.json index 61763f55c1b6a..adcf4164668d6 100644 --- a/test/functional/fixtures/es_archiver/saved_objects_management/hidden_types/mappings.json +++ b/test/functional/fixtures/es_archiver/saved_objects_management/hidden_types/mappings.json @@ -389,47 +389,6 @@ } } }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/saved_objects_management/nested_export_transform/mappings.json b/test/functional/fixtures/es_archiver/saved_objects_management/nested_export_transform/mappings.json index b2385a281dd23..9562b381a40f8 100644 --- a/test/functional/fixtures/es_archiver/saved_objects_management/nested_export_transform/mappings.json +++ b/test/functional/fixtures/es_archiver/saved_objects_management/nested_export_transform/mappings.json @@ -29,7 +29,6 @@ "search": "db2c00e39b36f40930a3b9fc71c823e1", "search-telemetry": "3d1b76c39bfb2cc8296b024d73854724", "telemetry": "36a616f7026dfa617d6655df850fe16d", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", "type": "2f4316de49999235636386fe51dc06c1", "ui-counter": "0d409297dc5ebe1e3a1da691c6ee32e3", "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", @@ -370,47 +369,6 @@ "dynamic": "false", "type": "object" }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/saved_objects_management/show_relationships/mappings.json b/test/functional/fixtures/es_archiver/saved_objects_management/show_relationships/mappings.json index aba581867bb8a..0679717650af9 100644 --- a/test/functional/fixtures/es_archiver/saved_objects_management/show_relationships/mappings.json +++ b/test/functional/fixtures/es_archiver/saved_objects_management/show_relationships/mappings.json @@ -372,47 +372,6 @@ } } }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/timelion/mappings.json b/test/functional/fixtures/es_archiver/timelion/mappings.json index 45b2508d38033..451369d85acd8 100644 --- a/test/functional/fixtures/es_archiver/timelion/mappings.json +++ b/test/functional/fixtures/es_archiver/timelion/mappings.json @@ -137,48 +137,6 @@ } } }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/visualize_embedding/mappings.json b/test/functional/fixtures/es_archiver/visualize_embedding/mappings.json index 45b2508d38033..451369d85acd8 100644 --- a/test/functional/fixtures/es_archiver/visualize_embedding/mappings.json +++ b/test/functional/fixtures/es_archiver/visualize_embedding/mappings.json @@ -137,48 +137,6 @@ } } }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/visualize_source-filters/mappings.json b/test/functional/fixtures/es_archiver/visualize_source-filters/mappings.json index 45b2508d38033..451369d85acd8 100644 --- a/test/functional/fixtures/es_archiver/visualize_source-filters/mappings.json +++ b/test/functional/fixtures/es_archiver/visualize_source-filters/mappings.json @@ -137,48 +137,6 @@ } } }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/fixtures/es_archiver/visualize_source_filters/mappings.json b/test/functional/fixtures/es_archiver/visualize_source_filters/mappings.json index 5ac113e7e4b74..ec6a9ce7f13a1 100644 --- a/test/functional/fixtures/es_archiver/visualize_source_filters/mappings.json +++ b/test/functional/fixtures/es_archiver/visualize_source_filters/mappings.json @@ -155,48 +155,6 @@ } } }, - "timelion-sheet": { - "dynamic": "strict", - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "type": { "type": "keyword" }, diff --git a/test/functional/page_objects/dashboard_page.ts b/test/functional/page_objects/dashboard_page.ts index 210c8f61b2391..3d2ba53e7ba98 100644 --- a/test/functional/page_objects/dashboard_page.ts +++ b/test/functional/page_objects/dashboard_page.ts @@ -284,9 +284,11 @@ export class DashboardPageObject extends FtrService { } public async clickQuickSave() { - await this.expectQuickSaveButtonEnabled(); - this.log.debug('clickQuickSave'); - await this.testSubjects.click('dashboardQuickSaveMenuItem'); + await this.retry.try(async () => { + await this.expectQuickSaveButtonEnabled(); + this.log.debug('clickQuickSave'); + await this.testSubjects.click('dashboardQuickSaveMenuItem'); + }); } public async clickNewDashboard(continueEditing = false) { @@ -392,10 +394,11 @@ export class DashboardPageObject extends FtrService { */ public async saveDashboard( dashboardName: string, - saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true, exitFromEditMode: true } + saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true, exitFromEditMode: true }, + clickMenuItem = true ) { await this.retry.try(async () => { - await this.enterDashboardTitleAndClickSave(dashboardName, saveOptions); + await this.enterDashboardTitleAndClickSave(dashboardName, saveOptions, clickMenuItem); if (saveOptions.needsConfirm) { await this.ensureDuplicateTitleCallout(); @@ -435,9 +438,12 @@ export class DashboardPageObject extends FtrService { */ public async enterDashboardTitleAndClickSave( dashboardTitle: string, - saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true } + saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true }, + clickMenuItem = true ) { - await this.testSubjects.click('dashboardSaveMenuItem'); + if (clickMenuItem) { + await this.testSubjects.click('dashboardSaveMenuItem'); + } const modalDialog = await this.testSubjects.find('savedObjectSaveModal'); this.log.debug('entering new title'); diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index ae1b4fbf3179a..f230dae1d394a 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -479,7 +479,7 @@ export class DiscoverPageObject extends FtrService { * Check if Discover app is currently rendered on the screen. */ public async isDiscoverAppOnScreen(): Promise { - const result = await this.find.allByCssSelector('discover-app'); + const result = await this.find.allByCssSelector('.dscPage'); return result.length === 1; } diff --git a/test/functional/page_objects/timelion_page.ts b/test/functional/page_objects/timelion_page.ts index 65584d98022be..bdfde3c8145e5 100644 --- a/test/functional/page_objects/timelion_page.ts +++ b/test/functional/page_objects/timelion_page.ts @@ -10,71 +10,21 @@ import { FtrService } from '../ftr_provider_context'; export class TimelionPageObject extends FtrService { private readonly testSubjects = this.ctx.getService('testSubjects'); - private readonly log = this.ctx.getService('log'); - private readonly common = this.ctx.getPageObject('common'); - private readonly esArchiver = this.ctx.getService('esArchiver'); - private readonly kibanaServer = this.ctx.getService('kibanaServer'); - - public async initTests() { - await this.kibanaServer.uiSettings.replace({ - defaultIndex: 'logstash-*', - }); - - this.log.debug('load kibana index'); - await this.esArchiver.load('test/functional/fixtures/es_archiver/timelion'); - - await this.common.navigateToApp('timelion'); - } - - public async setExpression(expression: string) { - const input = await this.testSubjects.find('timelionExpressionTextArea'); - await input.clearValue(); - await input.type(expression); - } - - public async updateExpression(updates: string) { - const input = await this.testSubjects.find('timelionExpressionTextArea'); - await input.type(updates); - await this.common.sleep(1000); - } - - public async getExpression() { - const input = await this.testSubjects.find('timelionExpressionTextArea'); - return input.getVisibleText(); - } public async getSuggestionItemsText() { - const elements = await this.testSubjects.findAll('timelionSuggestionListItem'); - return await Promise.all(elements.map(async (element) => await element.getVisibleText())); + const timelionCodeEditor = await this.testSubjects.find('timelionCodeEditor'); + const lists = await timelionCodeEditor.findAllByClassName('monaco-list-row'); + return await Promise.all(lists.map(async (element) => await element.getVisibleText())); } - public async clickSuggestion(suggestionIndex = 0, waitTime = 1000) { - const elements = await this.testSubjects.findAll('timelionSuggestionListItem'); - if (suggestionIndex > elements.length) { + public async clickSuggestion(suggestionIndex = 0) { + const timelionCodeEditor = await this.testSubjects.find('timelionCodeEditor'); + const lists = await timelionCodeEditor.findAllByCssSelector('.monaco-list-row'); + if (suggestionIndex > lists.length) { throw new Error( - `Unable to select suggestion ${suggestionIndex}, only ${elements.length} suggestions available.` + `Unable to select suggestion ${suggestionIndex}, only ${lists.length} suggestions available.` ); } - await elements[suggestionIndex].click(); - // Wait for timelion expression to be updated after clicking suggestions - await this.common.sleep(waitTime); - } - - public async saveTimelionSheet() { - await this.testSubjects.click('timelionSaveButton'); - await this.testSubjects.click('timelionSaveAsSheetButton'); - await this.testSubjects.click('timelionFinishSaveButton'); - await this.testSubjects.existOrFail('timelionSaveSuccessToast'); - await this.testSubjects.waitForDeleted('timelionSaveSuccessToast'); - } - - public async expectWriteControls() { - await this.testSubjects.existOrFail('timelionSaveButton'); - await this.testSubjects.existOrFail('timelionDeleteButton'); - } - - public async expectMissingWriteControls() { - await this.testSubjects.missingOrFail('timelionSaveButton'); - await this.testSubjects.missingOrFail('timelionDeleteButton'); + await lists[suggestionIndex].click(); } } diff --git a/test/functional/page_objects/visual_builder_page.ts b/test/functional/page_objects/visual_builder_page.ts index 591cddd18a2b3..c324de1231b7d 100644 --- a/test/functional/page_objects/visual_builder_page.ts +++ b/test/functional/page_objects/visual_builder_page.ts @@ -30,7 +30,6 @@ export class VisualBuilderPageObject extends FtrService { private readonly testSubjects = this.ctx.getService('testSubjects'); private readonly comboBox = this.ctx.getService('comboBox'); private readonly elasticChart = this.ctx.getService('elasticChart'); - private readonly kibanaServer = this.ctx.getService('kibanaServer'); private readonly common = this.ctx.getPageObject('common'); private readonly header = this.ctx.getPageObject('header'); private readonly timePicker = this.ctx.getPageObject('timePicker'); @@ -271,13 +270,14 @@ export class VisualBuilderPageObject extends FtrService { /** * change the data formatter for template in an `options` label tab * - * @param formatter - typeof formatter which you can use for presenting data. By default kibana show `Number` formatter + * @param formatter - typeof formatter which you can use for presenting data. By default kibana show `Default` formatter */ public async changeDataFormatter( - formatter: 'Bytes' | 'Number' | 'Percent' | 'Duration' | 'Custom' + formatter: 'default' | 'bytes' | 'number' | 'percent' | 'duration' | 'custom' ) { - const formatterEl = await this.testSubjects.find('tsvbDataFormatPicker'); - await this.comboBox.setElement(formatterEl, formatter, { clickWithMouse: true }); + await this.testSubjects.click('tsvbDataFormatPicker'); + await this.testSubjects.click(`tsvbDataFormatPicker-${formatter}`); + await this.visChart.waitForVisualizationRenderingStabilized(); } public async setDrilldownUrl(value: string) { @@ -305,16 +305,16 @@ export class VisualBuilderPageObject extends FtrService { }) { if (from) { await this.retry.try(async () => { - const fromCombobox = await this.find.byCssSelector('[id$="from-row"] .euiComboBox'); - await this.comboBox.setElement(fromCombobox, from, { clickWithMouse: true }); + await this.comboBox.set('dataFormatPickerDurationFrom', from); }); } if (to) { - const toCombobox = await this.find.byCssSelector('[id$="to-row"] .euiComboBox'); - await this.comboBox.setElement(toCombobox, to, { clickWithMouse: true }); + await this.retry.try(async () => { + await this.comboBox.set('dataFormatPickerDurationTo', to); + }); } if (decimalPlaces) { - const decimalPlacesInput = await this.find.byCssSelector('[id$="decimal"]'); + const decimalPlacesInput = await this.testSubjects.find('dataFormatPickerDurationDecimal'); await decimalPlacesInput.type(decimalPlaces); } } @@ -843,9 +843,6 @@ export class VisualBuilderPageObject extends FtrService { } public async toggleNewChartsLibraryWithDebug(enabled: boolean) { - await this.kibanaServer.uiSettings.update({ - 'visualization:visualize:legacyChartsLibrary': !enabled, - }); await this.elasticChart.setNewChartUiDebugFlag(enabled); } @@ -876,4 +873,14 @@ export class VisualBuilderPageObject extends FtrService { const areas = (await this.getChartItems(chartData)) as DebugState['areas']; return areas?.[nth]?.lines.y1.points.map(({ x, y }) => [x, y]); } + + public async getVisualizeError() { + const visError = await this.testSubjects.find(`visualization-error`); + const errorSpans = await visError.findAllByClassName('euiText--extraSmall'); + return await errorSpans[0].getVisibleText(); + } + + public async checkInvalidAggComponentIsPresent() { + await this.testSubjects.existOrFail(`invalid_agg`); + } } diff --git a/test/functional/page_objects/visualize_chart_page.ts b/test/functional/page_objects/visualize_chart_page.ts index bcee77a21c0b0..c1056b58e22d4 100644 --- a/test/functional/page_objects/visualize_chart_page.ts +++ b/test/functional/page_objects/visualize_chart_page.ts @@ -11,7 +11,6 @@ import Color from 'color'; import { FtrService } from '../ftr_provider_context'; -const xyChartSelector = 'visTypeXyChart'; const pieChartSelector = 'visTypePieChart'; export class VisualizeChartPageObject extends FtrService { @@ -37,8 +36,7 @@ export class VisualizeChartPageObject extends FtrService { public async isNewChartsLibraryEnabled(): Promise { const legacyChartsLibrary = Boolean( - (await this.kibanaServer.uiSettings.get('visualization:visualize:legacyChartsLibrary')) && - (await this.kibanaServer.uiSettings.get('visualization:visualize:legacyPieChartsLibrary')) + await this.kibanaServer.uiSettings.get('visualization:visualize:legacyPieChartsLibrary') ) ?? true; const enabled = !legacyChartsLibrary; this.log.debug(`-- isNewChartsLibraryEnabled = ${enabled}`); @@ -78,143 +76,52 @@ export class VisualizeChartPageObject extends FtrService { return true; } - /** - * Helper method to get expected values that are slightly different - * between vislib and elastic-chart inplementations - * @param vislibValue value expected for vislib chart - * @param elasticChartsValue value expected for `@elastic/charts` chart - */ - public async getExpectedValue(vislibValue: T, elasticChartsValue: T): Promise { - if (await this.isNewLibraryChart(xyChartSelector)) { - return elasticChartsValue; - } - - return vislibValue; - } - - public async getYAxisTitle() { - if (await this.isNewLibraryChart(xyChartSelector)) { - const xAxis = (await this.getEsChartDebugState(xyChartSelector))?.axes?.y ?? []; - return xAxis[0]?.title; - } - - const title = await this.find.byCssSelector('.y-axis-div .y-axis-title text'); - return await title.getVisibleText(); + public async getYAxisTitle(selector: string) { + const xAxis = (await this.getEsChartDebugState(selector))?.axes?.y ?? []; + return xAxis[0]?.title; } - public async getXAxisLabels() { - if (await this.isNewLibraryChart(xyChartSelector)) { - const [xAxis] = (await this.getEsChartDebugState(xyChartSelector))?.axes?.x ?? []; - return xAxis?.labels; - } - - const xAxis = await this.find.byCssSelector('.visAxis--x.visAxis__column--bottom'); - const $ = await xAxis.parseDomContent(); - return $('.x > g > text') - .toArray() - .map((tick) => $(tick).text().trim()); + public async getXAxisLabels(selector: string) { + const [xAxis] = (await this.getEsChartDebugState(selector))?.axes?.x ?? []; + return xAxis?.labels; } - public async getYAxisLabels(nth = 0) { - if (await this.isNewLibraryChart(xyChartSelector)) { - const yAxis = (await this.getEsChartDebugState(xyChartSelector))?.axes?.y ?? []; - return yAxis[nth]?.labels; - } - - const yAxis = await this.find.byCssSelector('.visAxis__column--y.visAxis__column--left'); - const $ = await yAxis.parseDomContent(); - return $('.y > g > text') - .toArray() - .map((tick) => $(tick).text().trim()); + public async getYAxisLabels(selector: string, nth = 0) { + const yAxis = (await this.getEsChartDebugState(selector))?.axes?.y ?? []; + return yAxis[nth]?.labels; } - public async getYAxisLabelsAsNumbers() { - if (await this.isNewLibraryChart(xyChartSelector)) { - const [yAxis] = (await this.getEsChartDebugState(xyChartSelector))?.axes?.y ?? []; - return yAxis?.values; - } - - return (await this.getYAxisLabels()).map((label) => Number(label.replace(',', ''))); + public async getYAxisLabelsAsNumbers(selector: string) { + const [yAxis] = (await this.getEsChartDebugState(selector))?.axes?.y ?? []; + return yAxis?.values; } /** * Gets the chart data and scales it based on chart height and label. * @param dataLabel data-label value - * @param axis axis value, 'ValueAxis-1' by default + * @param selector chart selector * @param shouldContainXAxisData boolean value for mapping points, false by default * * Returns an array of height values */ public async getAreaChartData( dataLabel: string, - axis = 'ValueAxis-1', + selector: string, shouldContainXAxisData = false ) { - if (await this.isNewLibraryChart(xyChartSelector)) { - const areas = (await this.getEsChartDebugState(xyChartSelector))?.areas ?? []; - const points = areas.find(({ name }) => name === dataLabel)?.lines.y1.points ?? []; - return shouldContainXAxisData ? points.map(({ x, y }) => [x, y]) : points.map(({ y }) => y); - } - - const yAxisRatio = await this.getChartYAxisRatio(axis); - - const rectangle = await this.find.byCssSelector('rect.background'); - const yAxisHeight = Number(await rectangle.getAttribute('height')); - this.log.debug(`height --------- ${yAxisHeight}`); - - const path = await this.retry.try( - async () => - await this.find.byCssSelector( - `path[data-label="${dataLabel}"]`, - this.defaultFindTimeout * 2 - ) - ); - const data = await path.getAttribute('d'); - this.log.debug(data); - // This area chart data starts with a 'M'ove to a x,y location, followed - // by a bunch of 'L'ines from that point to the next. Those points are - // the values we're going to use to calculate the data values we're testing. - // So git rid of the one 'M' and split the rest on the 'L's. - const tempArray = data - .replace('M ', '') - .replace('M', '') - .replace(/ L /g, 'L') - .replace(/ /g, ',') - .split('L'); - const chartSections = tempArray.length / 2; - const chartData = []; - for (let i = 0; i < chartSections; i++) { - chartData[i] = Math.round((yAxisHeight - Number(tempArray[i].split(',')[1])) * yAxisRatio); - this.log.debug('chartData[i] =' + chartData[i]); - } - return chartData; + const areas = (await this.getEsChartDebugState(selector))?.areas ?? []; + const points = areas.find(({ name }) => name === dataLabel)?.lines.y1.points ?? []; + return shouldContainXAxisData ? points.map(({ x, y }) => [x, y]) : points.map(({ y }) => y); } /** * Returns the paths that compose an area chart. * @param dataLabel data-label value */ - public async getAreaChartPaths(dataLabel: string) { - if (await this.isNewLibraryChart(xyChartSelector)) { - const areas = (await this.getEsChartDebugState(xyChartSelector))?.areas ?? []; - const path = areas.find(({ name }) => name === dataLabel)?.path ?? ''; - return path.split('L'); - } - - const path = await this.retry.try( - async () => - await this.find.byCssSelector( - `path[data-label="${dataLabel}"]`, - this.defaultFindTimeout * 2 - ) - ); - const data = await path.getAttribute('d'); - this.log.debug(data); - // This area chart data starts with a 'M'ove to a x,y location, followed - // by a bunch of 'L'ines from that point to the next. Those points are - // the values we're going to use to calculate the data values we're testing. - // So git rid of the one 'M' and split the rest on the 'L's. - return data.split('L'); + public async getAreaChartPaths(dataLabel: string, selector: string) { + const areas = (await this.getEsChartDebugState(selector))?.areas ?? []; + const path = areas.find(({ name }) => name === dataLabel)?.path ?? ''; + return path.split('L'); } /** @@ -222,106 +129,38 @@ export class VisualizeChartPageObject extends FtrService { * @param dataLabel data-label value * @param axis axis value, 'ValueAxis-1' by default */ - public async getLineChartData(dataLabel = 'Count', axis = 'ValueAxis-1') { - if (await this.isNewLibraryChart(xyChartSelector)) { - // For now lines are rendered as areas to enable stacking - const areas = (await this.getEsChartDebugState(xyChartSelector))?.areas ?? []; - const lines = areas.map(({ lines: { y1 }, name, color }) => ({ ...y1, name, color })); - const points = lines.find(({ name }) => name === dataLabel)?.points ?? []; - return points.map(({ y }) => y); - } - - // 1). get the range/pixel ratio - const yAxisRatio = await this.getChartYAxisRatio(axis); - // 2). find and save the y-axis pixel size (the chart height) - const rectangle = await this.find.byCssSelector('clipPath rect'); - const yAxisHeight = Number(await rectangle.getAttribute('height')); - // 3). get the visWrapper__chart elements - const chartTypes = await this.retry.try( - async () => - await this.find.allByCssSelector( - `.visWrapper__chart circle[data-label="${dataLabel}"][fill-opacity="1"]`, - this.defaultFindTimeout * 2 - ) - ); - // 4). for each chart element, find the green circle, then the cy position - const chartData = await Promise.all( - chartTypes.map(async (chart) => { - const cy = Number(await chart.getAttribute('cy')); - // the point_series_options test has data in the billions range and - // getting 11 digits of precision with these calculations is very hard - return Math.round(Number(((yAxisHeight - cy) * yAxisRatio).toPrecision(6))); - }) - ); - - return chartData; + public async getLineChartData(selector: string, dataLabel = 'Count') { + // For now lines are rendered as areas to enable stacking + const areas = (await this.getEsChartDebugState(selector))?.areas ?? []; + const lines = areas.map(({ lines: { y1 }, name, color }) => ({ ...y1, name, color })); + const points = lines.find(({ name }) => name === dataLabel)?.points ?? []; + return points.map(({ y }) => y); } /** * Returns bar chart data in pixels * @param dataLabel data-label value - * @param axis axis value, 'ValueAxis-1' by default */ - public async getBarChartData(dataLabel = 'Count', axis = 'ValueAxis-1') { - if (await this.isNewLibraryChart(xyChartSelector)) { - const bars = (await this.getEsChartDebugState(xyChartSelector))?.bars ?? []; - const values = bars.find(({ name }) => name === dataLabel)?.bars ?? []; - return values.map(({ y }) => y); - } - - const yAxisRatio = await this.getChartYAxisRatio(axis); - const svg = await this.find.byCssSelector('div.chart'); - const $ = await svg.parseDomContent(); - const chartData = $(`g > g.series > rect[data-label="${dataLabel}"]`) - .toArray() - .map((chart) => { - const barHeight = Number($(chart).attr('height')); - return Math.round(barHeight * yAxisRatio); - }); - - return chartData; + public async getBarChartData(selector: string, dataLabel = 'Count') { + const bars = (await this.getEsChartDebugState(selector))?.bars ?? []; + const values = bars.find(({ name }) => name === dataLabel)?.bars ?? []; + return values.map(({ y }) => y); } - /** - * Returns the range/pixel ratio - * @param axis axis value, 'ValueAxis-1' by default - */ - private async getChartYAxisRatio(axis = 'ValueAxis-1') { - // 1). get the maximum chart Y-Axis marker value and Y position - const maxYAxisChartMarker = await this.retry.try( - async () => - await this.find.byCssSelector( - `div.visAxis__splitAxes--y > div > svg > g.${axis} > g:last-of-type.tick` - ) - ); - const maxYLabel = (await maxYAxisChartMarker.getVisibleText()).replace(/,/g, ''); - const maxYLabelYPosition = (await maxYAxisChartMarker.getPosition()).y; - this.log.debug(`maxYLabel = ${maxYLabel}, maxYLabelYPosition = ${maxYLabelYPosition}`); - - // 2). get the minimum chart Y-Axis marker value and Y position - const minYAxisChartMarker = await this.find.byCssSelector( - 'div.visAxis__column--y.visAxis__column--left > div > div > svg:nth-child(2) > g > g:nth-child(1).tick' - ); - const minYLabel = (await minYAxisChartMarker.getVisibleText()).replace(',', ''); - const minYLabelYPosition = (await minYAxisChartMarker.getPosition()).y; - return (Number(maxYLabel) - Number(minYLabel)) / (minYLabelYPosition - maxYLabelYPosition); - } - - public async toggleLegend(show = true) { - const isVisTypeXYChart = await this.isNewLibraryChart(xyChartSelector); + private async toggleLegend(force = false) { const isVisTypePieChart = await this.isNewLibraryChart(pieChartSelector); - const legendSelector = isVisTypeXYChart || isVisTypePieChart ? '.echLegend' : '.visLegend'; + const legendSelector = force || isVisTypePieChart ? '.echLegend' : '.visLegend'; await this.retry.try(async () => { const isVisible = await this.find.existsByCssSelector(legendSelector); - if ((show && !isVisible) || (!show && isVisible)) { + if (!isVisible) { await this.testSubjects.click('vislibToggleLegend'); } }); } - public async filterLegend(name: string) { - await this.toggleLegend(); + public async filterLegend(name: string, force = false) { + await this.toggleLegend(force); await this.testSubjects.click(`legend-${name}`); const filterIn = await this.testSubjects.find(`legend-${name}-filterIn`); await filterIn.click(); @@ -336,12 +175,12 @@ export class VisualizeChartPageObject extends FtrService { await this.testSubjects.click(`visColorPickerColor-${color}`); } - public async doesSelectedLegendColorExist(color: string) { - if (await this.isNewLibraryChart(xyChartSelector)) { - const items = (await this.getEsChartDebugState(xyChartSelector))?.legend?.items ?? []; - return items.some(({ color: c }) => c === color); - } + public async doesSelectedLegendColorExistForXY(color: string, selector: string) { + const items = (await this.getEsChartDebugState(selector))?.legend?.items ?? []; + return items.some(({ color: c }) => c === color); + } + public async doesSelectedLegendColorExistForPie(color: string) { if (await this.isNewLibraryChart(pieChartSelector)) { const slices = (await this.getEsChartDebugState(pieChartSelector))?.partition?.[0]?.partitions ?? []; @@ -355,7 +194,7 @@ export class VisualizeChartPageObject extends FtrService { } public async expectError() { - if (!this.isNewLibraryChart(xyChartSelector)) { + if (!this.isNewLibraryChart(pieChartSelector)) { await this.testSubjects.existOrFail('vislibVisualizeError'); } } @@ -395,19 +234,15 @@ export class VisualizeChartPageObject extends FtrService { public async waitForVisualization() { await this.waitForVisualizationRenderingStabilized(); + } - if (!(await this.isNewLibraryChart(xyChartSelector))) { - await this.find.byCssSelector('.visualization'); - } + public async getLegendEntriesXYCharts(selector: string) { + const items = (await this.getEsChartDebugState(selector))?.legend?.items ?? []; + return items.map(({ name }) => name); } public async getLegendEntries() { - const isVisTypeXYChart = await this.isNewLibraryChart(xyChartSelector); const isVisTypePieChart = await this.isNewLibraryChart(pieChartSelector); - if (isVisTypeXYChart) { - const items = (await this.getEsChartDebugState(xyChartSelector))?.legend?.items ?? []; - return items.map(({ name }) => name); - } if (isVisTypePieChart) { const slices = @@ -424,13 +259,29 @@ export class VisualizeChartPageObject extends FtrService { ); } - public async openLegendOptionColors(name: string, chartSelector: string) { + public async openLegendOptionColorsForXY(name: string, chartSelector: string) { + await this.waitForVisualizationRenderingStabilized(); + await this.retry.try(async () => { + const chart = await this.find.byCssSelector(chartSelector); + const legendItemColor = await chart.findByCssSelector( + `[data-ech-series-name="${name}"] .echLegendItem__color` + ); + legendItemColor.click(); + + await this.waitForVisualizationRenderingStabilized(); + // arbitrary color chosen, any available would do + const arbitraryColor = '#d36086'; + const isOpen = await this.doesLegendColorChoiceExist(arbitraryColor); + if (!isOpen) { + throw new Error('legend color selector not open'); + } + }); + } + + public async openLegendOptionColorsForPie(name: string, chartSelector: string) { await this.waitForVisualizationRenderingStabilized(); await this.retry.try(async () => { - if ( - (await this.isNewLibraryChart(xyChartSelector)) || - (await this.isNewLibraryChart(pieChartSelector)) - ) { + if (await this.isNewLibraryChart(pieChartSelector)) { const chart = await this.find.byCssSelector(chartSelector); const legendItemColor = await chart.findByCssSelector( `[data-ech-series-name="${name}"] .echLegendItem__color` @@ -444,9 +295,7 @@ export class VisualizeChartPageObject extends FtrService { await this.waitForVisualizationRenderingStabilized(); // arbitrary color chosen, any available would do - const arbitraryColor = (await this.isNewLibraryChart(xyChartSelector)) - ? '#d36086' - : '#EF843C'; + const arbitraryColor = '#EF843C'; const isOpen = await this.doesLegendColorChoiceExist(arbitraryColor); if (!isOpen) { throw new Error('legend color selector not open'); @@ -561,13 +410,12 @@ export class VisualizeChartPageObject extends FtrService { return values.filter((item) => item.length > 0); } - public async getAxesCountByPosition(axesPosition: typeof Position[keyof typeof Position]) { - if (await this.isNewLibraryChart(xyChartSelector)) { - const yAxes = (await this.getEsChartDebugState(xyChartSelector))?.axes?.y ?? []; - return yAxes.filter(({ position }) => position === axesPosition).length; - } - const axes = await this.find.allByCssSelector(`.visAxis__column--${axesPosition} g.axis`); - return axes.length; + public async getAxesCountByPosition( + axesPosition: typeof Position[keyof typeof Position], + selector: string + ) { + const yAxes = (await this.getEsChartDebugState(selector))?.axes?.y ?? []; + return yAxes.filter(({ position }) => position === axesPosition).length; } public async clickOnGaugeByLabel(label: string) { @@ -581,62 +429,26 @@ export class VisualizeChartPageObject extends FtrService { await gauge.clickMouseButton({ xOffset: 0, yOffset }); } - public async getAreaSeriesCount() { - if (await this.isNewLibraryChart(xyChartSelector)) { - const areas = (await this.getEsChartDebugState(xyChartSelector))?.areas ?? []; - return areas.filter((area) => area.lines.y1.visible).length; - } - - const series = await this.find.allByCssSelector('.points.area'); - return series.length; + public async getAreaSeriesCount(selector: string) { + const areas = (await this.getEsChartDebugState(selector))?.areas ?? []; + return areas.filter((area) => area.lines.y1.visible).length; } - public async getHistogramSeriesCount() { - if (await this.isNewLibraryChart(xyChartSelector)) { - const bars = (await this.getEsChartDebugState(xyChartSelector))?.bars ?? []; - return bars.filter(({ visible }) => visible).length; - } - - const series = await this.find.allByCssSelector('.series.histogram'); - return series.length; + public async getHistogramSeriesCount(selector: string) { + const bars = (await this.getEsChartDebugState(selector))?.bars ?? []; + return bars.filter(({ visible }) => visible).length; } - public async getGridLines(): Promise> { - if (await this.isNewLibraryChart(xyChartSelector)) { - const { x, y } = (await this.getEsChartDebugState(xyChartSelector))?.axes ?? { - x: [], - y: [], - }; - return [...x, ...y].flatMap(({ gridlines }) => gridlines); - } - - const grid = await this.find.byCssSelector('g.grid'); - const $ = await grid.parseDomContent(); - return $('path') - .toArray() - .map((line) => { - const dAttribute = $(line).attr('d'); - const firstPoint = dAttribute.split('L')[0].replace('M', '').split(','); - return { - x: parseFloat(firstPoint[0]), - y: parseFloat(firstPoint[1]), - }; - }); + public async getGridLines(selector: string): Promise> { + const { x, y } = (await this.getEsChartDebugState(selector))?.axes ?? { + x: [], + y: [], + }; + return [...x, ...y].flatMap(({ gridlines }) => gridlines); } - public async getChartValues() { - if (await this.isNewLibraryChart(xyChartSelector)) { - const barSeries = (await this.getEsChartDebugState(xyChartSelector))?.bars ?? []; - return barSeries.filter(({ visible }) => visible).flatMap((bars) => bars.labels); - } - - const elements = await this.find.allByCssSelector('.series.histogram text'); - const values = await Promise.all( - elements.map(async (element) => { - const text = await element.getVisibleText(); - return text; - }) - ); - return values; + public async getChartValues(selector: string) { + const barSeries = (await this.getEsChartDebugState(selector))?.bars ?? []; + return barSeries.filter(({ visible }) => visible).flatMap((bars) => bars.labels); } } diff --git a/test/functional/page_objects/visualize_editor_page.ts b/test/functional/page_objects/visualize_editor_page.ts index 90fc320da3cda..50b275d04eabb 100644 --- a/test/functional/page_objects/visualize_editor_page.ts +++ b/test/functional/page_objects/visualize_editor_page.ts @@ -63,8 +63,8 @@ export class VisualizeEditorPageObject extends FtrService { await this.visChart.waitForVisualizationRenderingStabilized(); } - public async clickGo() { - if (await this.visChart.isNewChartsLibraryEnabled()) { + public async clickGo(isNewChartLibrary = false) { + if ((await this.visChart.isNewChartsLibraryEnabled()) || isNewChartLibrary) { await this.elasticChart.setNewChartUiDebugFlag(); } diff --git a/test/functional/page_objects/visualize_page.ts b/test/functional/page_objects/visualize_page.ts index cf3a692d1622e..7356ea3fa44c3 100644 --- a/test/functional/page_objects/visualize_page.ts +++ b/test/functional/page_objects/visualize_page.ts @@ -56,7 +56,6 @@ export class VisualizePageObject extends FtrService { await this.kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*', [FORMATS_UI_SETTINGS.FORMAT_BYTES_DEFAULT_PATTERN]: '0,0.[000]b', - 'visualization:visualize:legacyChartsLibrary': !isNewLibrary, 'visualization:visualize:legacyPieChartsLibrary': !isNewLibrary, }); } @@ -113,8 +112,8 @@ export class VisualizePageObject extends FtrService { }); } - public async clickRefresh() { - if (await this.visChart.isNewChartsLibraryEnabled()) { + public async clickRefresh(isNewChartLibrary = false) { + if ((await this.visChart.isNewChartsLibraryEnabled()) || isNewChartLibrary) { await this.elasticChart.setNewChartUiDebugFlag(); } await this.queryBar.clickQuerySubmitButton(); diff --git a/test/functional/screenshots/baseline/area_chart.png b/test/functional/screenshots/baseline/area_chart.png index e32dbbaf8d1af..851f53499e94f 100644 Binary files a/test/functional/screenshots/baseline/area_chart.png and b/test/functional/screenshots/baseline/area_chart.png differ diff --git a/test/functional/screenshots/baseline/tsvb_dashboard.png b/test/functional/screenshots/baseline/tsvb_dashboard.png index a36cfffebf080..4b41887e27e24 100644 Binary files a/test/functional/screenshots/baseline/tsvb_dashboard.png and b/test/functional/screenshots/baseline/tsvb_dashboard.png differ diff --git a/test/functional/services/monaco_editor.ts b/test/functional/services/monaco_editor.ts index 90674e101fc4e..63a5a7105ddb8 100644 --- a/test/functional/services/monaco_editor.ts +++ b/test/functional/services/monaco_editor.ts @@ -11,6 +11,7 @@ import { FtrService } from '../ftr_provider_context'; export class MonacoEditorService extends FtrService { private readonly retry = this.ctx.getService('retry'); private readonly browser = this.ctx.getService('browser'); + private readonly testSubjects = this.ctx.getService('testSubjects'); public async getCodeEditorValue(nthIndex: number = 0) { let values: string[] = []; @@ -27,6 +28,12 @@ export class MonacoEditorService extends FtrService { return values[nthIndex] as string; } + public async typeCodeEditorValue(value: string, testSubjId: string) { + const editor = await this.testSubjects.find(testSubjId); + const textarea = await editor.findByCssSelector('textarea'); + textarea.type(value); + } + public async setCodeEditorValue(value: string, nthIndex = 0) { await this.retry.try(async () => { await this.browser.execute( diff --git a/test/interpreter_functional/screenshots/baseline/metric_all_data.png b/test/interpreter_functional/screenshots/baseline/metric_all_data.png index 54ee1f4da6684..66357a371a5be 100644 Binary files a/test/interpreter_functional/screenshots/baseline/metric_all_data.png and b/test/interpreter_functional/screenshots/baseline/metric_all_data.png differ diff --git a/test/interpreter_functional/screenshots/baseline/metric_empty_data.png b/test/interpreter_functional/screenshots/baseline/metric_empty_data.png new file mode 100644 index 0000000000000..06cd781415ab0 Binary files /dev/null and b/test/interpreter_functional/screenshots/baseline/metric_empty_data.png differ diff --git a/test/interpreter_functional/screenshots/baseline/metric_invalid_data.png b/test/interpreter_functional/screenshots/baseline/metric_invalid_data.png index b1448cd7cb2ef..b8ffa6e8576fe 100644 Binary files a/test/interpreter_functional/screenshots/baseline/metric_invalid_data.png and b/test/interpreter_functional/screenshots/baseline/metric_invalid_data.png differ diff --git a/test/interpreter_functional/screenshots/baseline/tagcloud_empty_data.png b/test/interpreter_functional/screenshots/baseline/tagcloud_empty_data.png new file mode 100644 index 0000000000000..fa4fc01398218 Binary files /dev/null and b/test/interpreter_functional/screenshots/baseline/tagcloud_empty_data.png differ diff --git a/test/interpreter_functional/snapshots/baseline/metric_empty_data.json b/test/interpreter_functional/snapshots/baseline/metric_empty_data.json new file mode 100644 index 0000000000000..c318121535c8f --- /dev/null +++ b/test/interpreter_functional/snapshots/baseline/metric_empty_data.json @@ -0,0 +1 @@ +{"as":"metric_vis","type":"render","value":{"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"},{"id":"col-2-1","meta":{"field":"bytes","index":"logstash-*","params":{"id":"bytes","params":null},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{"field":"bytes"},"schema":"metric","type":"max"},"type":"number"},"name":"Max bytes"}],"rows":[],"type":"datatable"},"visType":"metric"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/metric_invalid_data.json b/test/interpreter_functional/snapshots/baseline/metric_invalid_data.json index c7b4a0325dc91..f23b9b0915774 100644 --- a/test/interpreter_functional/snapshots/baseline/metric_invalid_data.json +++ b/test/interpreter_functional/snapshots/baseline/metric_invalid_data.json @@ -1 +1 @@ -{"as":"metric_vis","type":"render","value":{"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[],"meta":{},"rows":[],"type":"datatable"},"visType":"metric"}} \ No newline at end of file +"[metricVis] > [visdimension] > Column name or index provided is invalid" \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/tagcloud_empty_data.json b/test/interpreter_functional/snapshots/baseline/tagcloud_empty_data.json new file mode 100644 index 0000000000000..6dd90a4a6ca03 --- /dev/null +++ b/test/interpreter_functional/snapshots/baseline/tagcloud_empty_data.json @@ -0,0 +1 @@ +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[],"type":"datatable"},"visParams":{"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"default","type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/baseline/tagcloud_invalid_data.json b/test/interpreter_functional/snapshots/baseline/tagcloud_invalid_data.json index 3e594380588dc..b5ae1a2cb59fc 100644 --- a/test/interpreter_functional/snapshots/baseline/tagcloud_invalid_data.json +++ b/test/interpreter_functional/snapshots/baseline/tagcloud_invalid_data.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[],"meta":{},"rows":[],"type":"datatable"},"visParams":{"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"default","type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +"[tagcloud] > [visdimension] > Column name or index provided is invalid" \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/session/metric_single_metric_data.json b/test/interpreter_functional/snapshots/session/metric_single_metric_data.json deleted file mode 100644 index f4a8cd1f14e18..0000000000000 --- a/test/interpreter_functional/snapshots/session/metric_single_metric_data.json +++ /dev/null @@ -1 +0,0 @@ -{"as":"metric_vis","type":"render","value":{"visConfig":{"dimensions":{"metrics":[{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"}]},"metric":{"colorSchema":"Green to Red","colorsRange":[{"from":0,"to":10000,"type":"range"}],"invertColors":false,"labels":{"show":true},"metricColorMode":"None","percentageMode":false,"style":{"bgColor":false,"bgFill":"#000","fontSize":60,"labelColor":false,"subText":""},"useRanges":false}},"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"},{"id":"col-2-1","meta":{"field":"bytes","index":"logstash-*","params":{"id":"bytes","params":null},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{"field":"bytes"},"schema":"metric","type":"max"},"type":"number"},"name":"Max bytes"}],"rows":[{"col-0-2":"200","col-1-1":12891,"col-2-1":19986},{"col-0-2":"404","col-1-1":696,"col-2-1":19881},{"col-0-2":"503","col-1-1":417,"col-2-1":0}],"type":"datatable"},"visType":"metric"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/session/partial_test_1.json b/test/interpreter_functional/snapshots/session/partial_test_1.json deleted file mode 100644 index 082c7b934c17c..0000000000000 --- a/test/interpreter_functional/snapshots/session/partial_test_1.json +++ /dev/null @@ -1 +0,0 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[{"col-0-2":"200","col-1-1":12891},{"col-0-2":"404","col-1-1":696},{"col-0-2":"503","col-1-1":417}],"type":"datatable"},"visParams":{"bucket":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"maxFontSize":72,"metric":{"accessor":1,"format":{"id":"number","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"default","type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/session/tagcloud_empty_data.json b/test/interpreter_functional/snapshots/session/tagcloud_empty_data.json new file mode 100644 index 0000000000000..6dd90a4a6ca03 --- /dev/null +++ b/test/interpreter_functional/snapshots/session/tagcloud_empty_data.json @@ -0,0 +1 @@ +{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[{"id":"col-0-2","meta":{"field":"response.raw","index":"logstash-*","params":{"id":"terms","params":{"id":"string","missingBucketLabel":"Missing","otherBucketLabel":"Other"}},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"2","indexPatternId":"logstash-*","params":{"field":"response.raw","missingBucket":false,"missingBucketLabel":"Missing","order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","size":4},"schema":"segment","type":"terms"},"type":"string"},"name":"response.raw: Descending"},{"id":"col-1-1","meta":{"field":null,"index":"logstash-*","params":{"id":"number"},"source":"esaggs","sourceParams":{"appliedTimeRange":null,"enabled":true,"id":"1","indexPatternId":"logstash-*","params":{},"schema":"metric","type":"count"},"type":"number"},"name":"Count"}],"rows":[],"type":"datatable"},"visParams":{"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"default","type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file diff --git a/test/interpreter_functional/snapshots/session/tagcloud_invalid_data.json b/test/interpreter_functional/snapshots/session/tagcloud_invalid_data.json index 3e594380588dc..b5ae1a2cb59fc 100644 --- a/test/interpreter_functional/snapshots/session/tagcloud_invalid_data.json +++ b/test/interpreter_functional/snapshots/session/tagcloud_invalid_data.json @@ -1 +1 @@ -{"as":"tagcloud","type":"render","value":{"syncColors":false,"visData":{"columns":[],"meta":{},"rows":[],"type":"datatable"},"visParams":{"maxFontSize":72,"metric":{"accessor":0,"format":{"id":"string","params":{}},"type":"vis_dimension"},"minFontSize":18,"orientation":"single","palette":{"name":"default","type":"palette"},"scale":"linear","showLabel":true},"visType":"tagcloud"}} \ No newline at end of file +"[tagcloud] > [visdimension] > Column name or index provided is invalid" \ No newline at end of file diff --git a/test/interpreter_functional/test_suites/run_pipeline/metric.ts b/test/interpreter_functional/test_suites/run_pipeline/metric.ts index bbaf0486f4fbb..5483e09d6671b 100644 --- a/test/interpreter_functional/test_suites/run_pipeline/metric.ts +++ b/test/interpreter_functional/test_suites/run_pipeline/metric.ts @@ -30,10 +30,13 @@ export default function ({ dataContext = await expectExpression('partial_metric_test', expression).getResponse(); }); - it('with invalid data', async () => { + it('with empty data', async () => { const expression = 'metricVis metric={visdimension 0}'; await ( - await expectExpression('metric_invalid_data', expression).toMatchSnapshot() + await expectExpression('metric_empty_data', expression, { + ...dataContext, + rows: [], + }).toMatchSnapshot() ).toMatchScreenshot(); }); @@ -78,5 +81,14 @@ export default function ({ ).toMatchScreenshot(); }); }); + + describe('throws error at metric', () => { + it('with invalid data', async () => { + const expression = 'metricVis metric={visdimension 0}'; + await ( + await expectExpression('metric_invalid_data', expression).toMatchSnapshot() + ).toMatchScreenshot(); + }); + }); }); } diff --git a/test/interpreter_functional/test_suites/run_pipeline/tag_cloud.ts b/test/interpreter_functional/test_suites/run_pipeline/tag_cloud.ts index 05bbd33fedad7..3358e45dc02d4 100644 --- a/test/interpreter_functional/test_suites/run_pipeline/tag_cloud.ts +++ b/test/interpreter_functional/test_suites/run_pipeline/tag_cloud.ts @@ -15,24 +15,25 @@ export default function ({ }: FtrProviderContext & { updateBaselines: boolean }) { let expectExpression: ExpectExpression; describe('tag cloud pipeline expression tests', () => { - before(() => { + let dataContext: ExpressionResult; + before(async () => { expectExpression = expectExpressionProvider({ getService, updateBaselines }); + + const expression = `kibana | kibana_context | esaggs index={indexPatternLoad id='logstash-*'} + aggs={aggCount id="1" enabled=true schema="metric"} + aggs={aggTerms id="2" enabled=true schema="segment" field="response.raw" size=4 order="desc" orderBy="1"}`; + // we execute the part of expression that fetches the data and store its response + dataContext = await expectExpression('partial_tagcloud_test', expression).getResponse(); }); describe('correctly renders tagcloud', () => { - let dataContext: ExpressionResult; - before(async () => { - const expression = `kibana | kibana_context | esaggs index={indexPatternLoad id='logstash-*'} - aggs={aggCount id="1" enabled=true schema="metric"} - aggs={aggTerms id="2" enabled=true schema="segment" field="response.raw" size=4 order="desc" orderBy="1"}`; - // we execute the part of expression that fetches the data and store its response - dataContext = await expectExpression('partial_tagcloud_test', expression).getResponse(); - }); - - it('with invalid data', async () => { + it('with empty data', async () => { const expression = 'tagcloud metric={visdimension 0}'; await ( - await expectExpression('tagcloud_invalid_data', expression).toMatchSnapshot() + await expectExpression('tagcloud_empty_data', expression, { + ...dataContext, + rows: [], + }).toMatchSnapshot() ).toMatchScreenshot(); }); @@ -66,5 +67,14 @@ export default function ({ ).toMatchScreenshot(); }); }); + + describe('throws error at tagcloud', () => { + it('with invalid data', async () => { + const expression = 'tagcloud metric={visdimension 0}'; + await ( + await expectExpression('tagcloud_invalid_data', expression).toMatchSnapshot() + ).toMatchScreenshot(); + }); + }); }); } diff --git a/test/new_visualize_flow/fixtures/es_archiver/kibana/mappings.json b/test/new_visualize_flow/fixtures/es_archiver/kibana/mappings.json index 9f5edaad0fe76..f010fcea90b3f 100644 --- a/test/new_visualize_flow/fixtures/es_archiver/kibana/mappings.json +++ b/test/new_visualize_flow/fixtures/es_archiver/kibana/mappings.json @@ -23,7 +23,6 @@ "sample-data-telemetry": "7d3cfeb915303c9641c59681967ffeb4", "search": "181661168bbadd1eff5902361e2a0d5c", "telemetry": "36a616f7026dfa617d6655df850fe16d", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", "tsvb-validation-telemetry": "3a37ef6c8700ae6fc97d5c7da00e9215", "type": "2f4316de49999235636386fe51dc06c1", "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", @@ -366,47 +365,6 @@ } } }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, "tsvb-validation-telemetry": { "properties": { "failedRequests": { diff --git a/test/package/templates/kibana.yml b/test/package/templates/kibana.yml index a5e44b7acb018..6608ef8571db6 100644 --- a/test/package/templates/kibana.yml +++ b/test/package/templates/kibana.yml @@ -3,3 +3,16 @@ server.host: 0.0.0.0 elasticsearch.hosts: http://192.168.50.1:9200 elasticsearch.username: "{{ elasticsearch_username }}" elasticsearch.password: "{{ elasticsearch_password }}" + +pid.file: /run/kibana/kibana.pid +logging: + appenders: + file: + type: file + fileName: kibana.log + layout: + type: json + root: + appenders: + - default + - file diff --git a/test/plugin_functional/test_suites/core_plugins/status.ts b/test/plugin_functional/test_suites/core_plugins/status.ts index 2b0f15cb39273..10ca8c6722046 100644 --- a/test/plugin_functional/test_suites/core_plugins/status.ts +++ b/test/plugin_functional/test_suites/core_plugins/status.ts @@ -16,7 +16,7 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide const delay = (ms: number) => new Promise((r) => setTimeout(r, ms)); const getStatus = async (pluginName?: string) => { - const resp = await supertest.get('/api/status?v8format=true'); + const resp = await supertest.get('/api/status'); if (pluginName) { return resp.body.status.plugins[pluginName]; diff --git a/test/scripts/jenkins_storybook.sh b/test/scripts/jenkins_storybook.sh index 73ab43fd02eba..00cc0d78599dd 100755 --- a/test/scripts/jenkins_storybook.sh +++ b/test/scripts/jenkins_storybook.sh @@ -6,13 +6,20 @@ cd "$KIBANA_DIR" yarn storybook --site apm yarn storybook --site canvas +yarn storybook --site codeeditor yarn storybook --site ci_composite yarn storybook --site url_template_editor -yarn storybook --site codeeditor yarn storybook --site dashboard yarn storybook --site dashboard_enhanced yarn storybook --site data_enhanced yarn storybook --site embeddable +yarn storybook --site expression_error +yarn storybook --site expression_image +yarn storybook --site expression_metric +yarn storybook --site expression_repeat_image +yarn storybook --site expression_reveal_image +yarn storybook --site expression_shape +yarn storybook --site expression_tagcloud yarn storybook --site infra yarn storybook --site security_solution yarn storybook --site ui_actions_enhanced diff --git a/test/server_integration/http/platform/status.ts b/test/server_integration/http/platform/status.ts index 0dcf82c9bea9e..e443ce3f31cbf 100644 --- a/test/server_integration/http/platform/status.ts +++ b/test/server_integration/http/platform/status.ts @@ -18,7 +18,7 @@ export default function ({ getService }: FtrProviderContext) { const retry = getService('retry'); const getStatus = async (pluginName: string): Promise => { - const resp = await supertest.get('/api/status?v8format=true'); + const resp = await supertest.get('/api/status'); return resp.body.status.plugins[pluginName]; }; diff --git a/test/tsconfig.json b/test/tsconfig.json index c94d4445dd246..660850ffeb6ca 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -52,7 +52,6 @@ { "path": "../src/plugins/url_forwarding/tsconfig.json" }, { "path": "../src/plugins/usage_collection/tsconfig.json" }, { "path": "../src/plugins/index_pattern_management/tsconfig.json" }, - { "path": "../src/plugins/legacy_export/tsconfig.json" }, { "path": "../src/plugins/visualize/tsconfig.json" }, { "path": "plugin_functional/plugins/core_app_status/tsconfig.json" }, { "path": "plugin_functional/plugins/core_provider_plugin/tsconfig.json" }, diff --git a/vars/workers.groovy b/vars/workers.groovy index ca1c6b57c18bb..d95c3fdbb1b44 100644 --- a/vars/workers.groovy +++ b/vars/workers.groovy @@ -20,7 +20,7 @@ def label(size) { case 'xl-highmem': return 'docker && tests-xl-highmem' case 'xxl': - return 'docker && tests-xxl && gobld/machineType:custom-64-270336' + return 'docker && tests-xxl && gobld/machineType:custom-64-327680' case 'n2-standard-16': return 'docker && linux && immutable && gobld/machineType:n2-standard-16' } diff --git a/x-pack/plugins/actions/common/index.ts b/x-pack/plugins/actions/common/index.ts index 7825cbfb45f37..cff876b5995a1 100644 --- a/x-pack/plugins/actions/common/index.ts +++ b/x-pack/plugins/actions/common/index.ts @@ -13,3 +13,5 @@ export * from './alert_history_schema'; export * from './rewrite_request_case'; export const BASE_ACTION_API_PATH = '/api/actions'; +export const INTERNAL_BASE_ACTION_API_PATH = '/internal/actions'; +export const ACTIONS_FEATURE_ID = 'actions'; diff --git a/x-pack/plugins/actions/jest.config.js b/x-pack/plugins/actions/jest.config.js index 3a9fb5019494a..2d3372a91890a 100644 --- a/x-pack/plugins/actions/jest.config.js +++ b/x-pack/plugins/actions/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/actions'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/actions', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/actions/{common,server}/**/*.{js,ts,tsx}'], }; diff --git a/x-pack/plugins/actions/server/action_type_registry.ts b/x-pack/plugins/actions/server/action_type_registry.ts index e5846560a6c98..76b360ce8b17f 100644 --- a/x-pack/plugins/actions/server/action_type_registry.ts +++ b/x-pack/plugins/actions/server/action_type_registry.ts @@ -134,7 +134,8 @@ export class ActionTypeRegistry { // Don't retry other kinds of errors return false; }, - createTaskRunner: (context: RunContext) => this.taskRunnerFactory.create(context), + createTaskRunner: (context: RunContext) => + this.taskRunnerFactory.create(context, actionType.maxAttempts), }, }); // No need to notify usage on basic action types diff --git a/x-pack/plugins/actions/server/builtin_action_types/email.test.ts b/x-pack/plugins/actions/server/builtin_action_types/email.test.ts index 8e9ea1c5e4aa9..450bf1744150d 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/email.test.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/email.test.ts @@ -52,7 +52,7 @@ describe('actionTypeRegistry.get() works', () => { }); describe('config validation', () => { - test('config validation succeeds when config is valid', () => { + test('config validation succeeds when config is valid for nodemailer well known service', () => { const config: Record = { service: 'gmail', from: 'bob@example.com', @@ -64,14 +64,46 @@ describe('config validation', () => { port: null, secure: null, }); + }); + + test(`config validation succeeds when config is valid and defaults to 'other' when service is undefined`, () => { + const config: Record = { + from: 'bob@example.com', + host: 'elastic.co', + port: 8080, + hasAuth: true, + }; + expect(validateConfig(actionType, config)).toEqual({ + ...config, + service: 'other', + secure: null, + }); + }); + + test(`config validation succeeds when config is valid and service requires custom host/port value`, () => { + const config: Record = { + service: 'exchange_server', + from: 'bob@example.com', + host: 'elastic.co', + port: 8080, + hasAuth: true, + }; + expect(validateConfig(actionType, config)).toEqual({ + ...config, + secure: null, + }); + }); - delete config.service; - config.host = 'elastic.co'; - config.port = 8080; - config.hasAuth = true; + test(`config validation succeeds when config is valid and service is elastic_cloud`, () => { + const config: Record = { + service: 'elastic_cloud', + from: 'bob@example.com', + hasAuth: true, + }; expect(validateConfig(actionType, config)).toEqual({ ...config, - service: null, + host: null, + port: null, secure: null, }); }); @@ -325,7 +357,7 @@ describe('execute()', () => { ...executorOptions, config: { ...config, - service: null, + service: 'other', hasAuth: false, }, secrets: { @@ -381,12 +413,73 @@ describe('execute()', () => { `); }); + test('parameters are as expected when using elastic_cloud service', async () => { + const customExecutorOptions: EmailActionTypeExecutorOptions = { + ...executorOptions, + config: { + ...config, + service: 'elastic_cloud', + hasAuth: false, + }, + secrets: { + ...secrets, + user: null, + password: null, + }, + }; + + sendEmailMock.mockReset(); + await actionType.executor(customExecutorOptions); + expect(sendEmailMock.mock.calls[0][1]).toMatchInlineSnapshot(` + Object { + "configurationUtilities": Object { + "ensureActionTypeEnabled": [MockFunction], + "ensureHostnameAllowed": [MockFunction], + "ensureUriAllowed": [MockFunction], + "getCustomHostSettings": [MockFunction], + "getProxySettings": [MockFunction], + "getResponseSettings": [MockFunction], + "getSSLSettings": [MockFunction], + "isActionTypeEnabled": [MockFunction], + "isHostnameAllowed": [MockFunction], + "isUriAllowed": [MockFunction], + }, + "content": Object { + "message": "a message to you + + -- + + This message was sent by Kibana.", + "subject": "the subject", + }, + "hasAuth": false, + "routing": Object { + "bcc": Array [ + "jimmy@example.com", + ], + "cc": Array [ + "james@example.com", + ], + "from": "bob@example.com", + "to": Array [ + "jim@example.com", + ], + }, + "transport": Object { + "host": "dockerhost", + "port": 10025, + "secure": false, + }, + } + `); + }); + test('returns expected result when an error is thrown', async () => { const customExecutorOptions: EmailActionTypeExecutorOptions = { ...executorOptions, config: { ...config, - service: null, + service: 'other', hasAuth: false, }, secrets: { diff --git a/x-pack/plugins/actions/server/builtin_action_types/email.ts b/x-pack/plugins/actions/server/builtin_action_types/email.ts index 47748f0f13722..9b11aec6251f6 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/email.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/email.ts @@ -9,6 +9,7 @@ import { curry } from 'lodash'; import { i18n } from '@kbn/i18n'; import { schema, TypeOf } from '@kbn/config-schema'; import nodemailerGetService from 'nodemailer/lib/well-known'; +import SMTPConnection from 'nodemailer/lib/smtp-connection'; import { sendEmail, JSON_TRANSPORT_SERVICE, SendEmailOptions, Transport } from './lib/send_email'; import { portSchema } from './lib/schemas'; @@ -32,10 +33,29 @@ export type EmailActionTypeExecutorOptions = ActionTypeExecutorOptions< // config definition export type ActionTypeConfigType = TypeOf; +// supported values for `service` in addition to nodemailer's list of well-known services +export enum AdditionalEmailServices { + ELASTIC_CLOUD = 'elastic_cloud', + EXCHANGE = 'exchange_server', + OTHER = 'other', +} + +// these values for `service` require users to fill in host/port/secure +export const CUSTOM_CONFIG_SERVICES: string[] = [ + AdditionalEmailServices.EXCHANGE, + AdditionalEmailServices.OTHER, +]; + +export const ELASTIC_CLOUD_SERVICE: SMTPConnection.Options = { + host: 'dockerhost', + port: 10025, + secure: false, +}; + const EMAIL_FOOTER_DIVIDER = '\n\n--\n\n'; const ConfigSchemaProps = { - service: schema.nullable(schema.string()), + service: schema.string({ defaultValue: 'other' }), host: schema.nullable(schema.string()), port: schema.nullable(portSchema()), secure: schema.nullable(schema.boolean()), @@ -58,7 +78,8 @@ function validateConfig( // translate messages. if (config.service === JSON_TRANSPORT_SERVICE) { return; - } else if (config.service == null) { + } else if (CUSTOM_CONFIG_SERVICES.indexOf(config.service) >= 0) { + // If configured `service` requires custom host/port/secure settings, validate that they are set if (config.host == null && config.port == null) { return 'either [service] or [host]/[port] is required'; } @@ -75,6 +96,7 @@ function validateConfig( return `[host] value '${config.host}' is not in the allowedHosts configuration`; } } else { + // Check configured `service` against nodemailer list of well known services + any custom ones allowed by Kibana const host = getServiceNameHost(config.service); if (host == null) { return `[service] value '${config.service}' is not valid`; @@ -201,13 +223,20 @@ async function executor( transport.password = secrets.password; } - if (config.service !== null) { - transport.service = config.service; - } else { + if (CUSTOM_CONFIG_SERVICES.indexOf(config.service) >= 0) { + // use configured host/port/secure values // already validated service or host/port is not null ... transport.host = config.host!; transport.port = config.port!; transport.secure = getSecureValue(config.secure, config.port); + } else if (config.service === AdditionalEmailServices.ELASTIC_CLOUD) { + // use custom elastic cloud settings + transport.host = ELASTIC_CLOUD_SERVICE.host!; + transport.port = ELASTIC_CLOUD_SERVICE.port!; + transport.secure = ELASTIC_CLOUD_SERVICE.secure!; + } else { + // use nodemailer's well known service config + transport.service = config.service; } const footerMessage = getFooterMessage({ @@ -253,6 +282,10 @@ async function executor( // utilities function getServiceNameHost(service: string): string | null { + if (service === AdditionalEmailServices.ELASTIC_CLOUD) { + return ELASTIC_CLOUD_SERVICE.host!; + } + const serviceEntry = nodemailerGetService(service); if (serviceEntry === false) return null; 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 440de161490aa..ba7f750859d40 100644 --- a/x-pack/plugins/actions/server/lib/action_executor.test.ts +++ b/x-pack/plugins/actions/server/lib/action_executor.test.ts @@ -187,10 +187,12 @@ test('successfully executes as a task', async () => { const scheduleDelay = 10000; // milliseconds const scheduled = new Date(Date.now() - scheduleDelay); + const attempts = 1; await actionExecutor.execute({ ...executeParams, taskInfo: { scheduled, + attempts, }, }); diff --git a/x-pack/plugins/actions/server/lib/action_executor.ts b/x-pack/plugins/actions/server/lib/action_executor.ts index 5dfe56cff5016..d265bca237c3b 100644 --- a/x-pack/plugins/actions/server/lib/action_executor.ts +++ b/x-pack/plugins/actions/server/lib/action_executor.ts @@ -44,6 +44,7 @@ export interface ActionExecutorContext { export interface TaskInfo { scheduled: Date; + attempts: number; } export interface ExecuteOptions { @@ -210,6 +211,7 @@ export class ActionExecutor { config: validatedConfig, secrets: validatedSecrets, isEphemeral, + taskInfo, }); } catch (err) { rawResult = { 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 cff92f874e0ef..85d819ba09b8a 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 @@ -136,6 +136,7 @@ test('executes the task by calling the executor with proper parameters, using gi }), taskInfo: { scheduled: new Date(), + attempts: 0, }, }); @@ -191,6 +192,7 @@ test('executes the task by calling the executor with proper parameters, using st }), taskInfo: { scheduled: new Date(), + attempts: 0, }, }); @@ -341,6 +343,7 @@ test('uses API key when provided', async () => { }), taskInfo: { scheduled: new Date(), + attempts: 0, }, }); @@ -401,6 +404,7 @@ test('uses relatedSavedObjects merged with references when provided', async () = }), taskInfo: { scheduled: new Date(), + attempts: 0, }, }); }); @@ -451,6 +455,7 @@ test('uses relatedSavedObjects as is when references are empty', async () => { }), taskInfo: { scheduled: new Date(), + attempts: 0, }, }); }); @@ -499,6 +504,7 @@ test('sanitizes invalid relatedSavedObjects when provided', async () => { relatedSavedObjects: [], taskInfo: { scheduled: new Date(), + attempts: 0, }, }); }); @@ -538,6 +544,7 @@ test(`doesn't use API key when not provided`, async () => { }), taskInfo: { scheduled: new Date(), + attempts: 0, }, }); @@ -549,9 +556,15 @@ test(`doesn't use API key when not provided`, async () => { }); test(`throws an error when license doesn't support the action type`, async () => { - const taskRunner = taskRunnerFactory.create({ - taskInstance: mockedTaskInstance, - }); + const taskRunner = taskRunnerFactory.create( + { + taskInstance: { + ...mockedTaskInstance, + attempts: 1, + }, + }, + 2 + ); mockedEncryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce({ id: '3', @@ -579,6 +592,138 @@ test(`throws an error when license doesn't support the action type`, async () => } catch (e) { expect(e instanceof ExecutorError).toEqual(true); expect(e.data).toEqual({}); - expect(e.retry).toEqual(false); + expect(e.retry).toEqual(true); } }); + +test(`treats errors as errors if the task is retryable`, async () => { + const taskRunner = taskRunnerFactory.create({ + taskInstance: { + ...mockedTaskInstance, + attempts: 0, + }, + }); + + mockedEncryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce({ + id: '3', + type: 'action_task_params', + attributes: { + actionId: '2', + params: { baz: true }, + apiKey: Buffer.from('123:abc').toString('base64'), + }, + references: [ + { + id: '2', + name: 'actionRef', + type: 'action', + }, + ], + }); + mockedActionExecutor.execute.mockResolvedValueOnce({ + status: 'error', + actionId: '2', + message: 'Error message', + data: { foo: true }, + retry: false, + }); + + let err; + try { + await taskRunner.run(); + } catch (e) { + err = e; + } + expect(err).toBeDefined(); + expect(err instanceof ExecutorError).toEqual(true); + expect(err.data).toEqual({ foo: true }); + expect(err.retry).toEqual(false); + expect(taskRunnerFactoryInitializerParams.logger.error as jest.Mock).toHaveBeenCalledWith( + `Action '2' failed and will not retry: Error message` + ); +}); + +test(`treats errors as successes if the task is not retryable`, async () => { + const taskRunner = taskRunnerFactory.create({ + taskInstance: { + ...mockedTaskInstance, + attempts: 1, + }, + }); + + mockedEncryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce({ + id: '3', + type: 'action_task_params', + attributes: { + actionId: '2', + params: { baz: true }, + apiKey: Buffer.from('123:abc').toString('base64'), + }, + references: [ + { + id: '2', + name: 'actionRef', + type: 'action', + }, + ], + }); + mockedActionExecutor.execute.mockResolvedValueOnce({ + status: 'error', + actionId: '2', + message: 'Error message', + data: { foo: true }, + retry: false, + }); + + let err; + try { + await taskRunner.run(); + } catch (e) { + err = e; + } + expect(err).toBeUndefined(); + expect(taskRunnerFactoryInitializerParams.logger.error as jest.Mock).toHaveBeenCalledWith( + `Action '2' failed and will not retry: Error message` + ); +}); + +test('treats errors as errors if the error is thrown instead of returned', async () => { + const taskRunner = taskRunnerFactory.create({ + taskInstance: { + ...mockedTaskInstance, + attempts: 0, + }, + }); + + mockedEncryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce({ + id: '3', + type: 'action_task_params', + attributes: { + actionId: '2', + params: { baz: true }, + apiKey: Buffer.from('123:abc').toString('base64'), + }, + references: [ + { + id: '2', + name: 'actionRef', + type: 'action', + }, + ], + }); + mockedActionExecutor.execute.mockRejectedValueOnce({}); + + let err; + try { + await taskRunner.run(); + } catch (e) { + err = e; + } + expect(err).toBeDefined(); + expect(err instanceof ExecutorError).toEqual(true); + expect(err.data).toEqual({}); + expect(err.retry).toEqual(true); + expect(taskRunnerFactoryInitializerParams.logger.error as jest.Mock).toHaveBeenCalledWith( + `Action '2' failed and will retry: undefined` + ); +}); 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 45ae6c1d5fae9..9a3856bbf7cee 100644 --- a/x-pack/plugins/actions/server/lib/task_runner_factory.ts +++ b/x-pack/plugins/actions/server/lib/task_runner_factory.ts @@ -22,7 +22,6 @@ import { ActionExecutorContract } from './action_executor'; import { ExecutorError } from './executor_error'; import { RunContext } from '../../../task_manager/server'; import { EncryptedSavedObjectsClient } from '../../../encrypted_saved_objects/server'; -import { ActionTypeDisabledError } from './errors'; import { ActionTaskParams, ActionTypeRegistryContract, @@ -62,7 +61,7 @@ export class TaskRunnerFactory { this.taskRunnerContext = taskRunnerContext; } - public create({ taskInstance }: RunContext) { + public create({ taskInstance }: RunContext, maxAttempts: number = 1) { if (!this.isInitialized) { throw new Error('TaskRunnerFactory not initialized'); } @@ -78,6 +77,7 @@ export class TaskRunnerFactory { const taskInfo = { scheduled: taskInstance.runAt, + attempts: taskInstance.attempts, }; return { @@ -119,7 +119,14 @@ export class TaskRunnerFactory { basePathService.set(fakeRequest, path); - let executorResult: ActionTypeExecutorResult; + // Throwing an executor error means we will attempt to retry the task + // TM will treat a task as a failure if `attempts >= maxAttempts` + // so we need to handle that here to avoid TM persisting the failed task + const isRetryableBasedOnAttempts = taskInfo.attempts < (maxAttempts ?? 1); + const willRetryMessage = `and will retry`; + const willNotRetryMessage = `and will not retry`; + + let executorResult: ActionTypeExecutorResult | undefined; try { executorResult = await actionExecutor.execute({ params, @@ -131,20 +138,39 @@ export class TaskRunnerFactory { relatedSavedObjects: validatedRelatedSavedObjects(logger, relatedSavedObjects), }); } catch (e) { - if (e instanceof ActionTypeDisabledError) { - // We'll stop re-trying due to action being forbidden - throw new ExecutorError(e.message, {}, false); + logger.error( + `Action '${actionId}' failed ${ + isRetryableBasedOnAttempts ? willRetryMessage : willNotRetryMessage + }: ${e.message}` + ); + if (isRetryableBasedOnAttempts) { + // In order for retry to work, we need to indicate to task manager this task + // failed + throw new ExecutorError(e.message, {}, true); } - throw e; } - if (executorResult.status === 'error') { + if ( + executorResult && + executorResult?.status === 'error' && + executorResult?.retry !== undefined && + isRetryableBasedOnAttempts + ) { + logger.error( + `Action '${actionId}' failed ${ + !!executorResult.retry ? willRetryMessage : willNotRetryMessage + }: ${executorResult.message}` + ); // Task manager error handler only kicks in when an error thrown (at this time) // So what we have to do is throw when the return status is `error`. throw new ExecutorError( executorResult.message, executorResult.data, - executorResult.retry == null ? false : executorResult.retry + executorResult.retry as boolean | Date + ); + } else if (executorResult && executorResult?.status === 'error') { + logger.error( + `Action '${actionId}' failed ${willNotRetryMessage}: ${executorResult.message}` ); } diff --git a/x-pack/plugins/actions/server/lib/track_legacy_route_usage.test.ts b/x-pack/plugins/actions/server/lib/track_legacy_route_usage.test.ts new file mode 100644 index 0000000000000..f4a1ce07ab985 --- /dev/null +++ b/x-pack/plugins/actions/server/lib/track_legacy_route_usage.test.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 { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; +import { trackLegacyRouteUsage } from './track_legacy_route_usage'; + +describe('trackLegacyRouteUsage', () => { + it('should call `usageCounter.incrementCounter`', () => { + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + trackLegacyRouteUsage('test', mockUsageCounter); + expect(mockUsageCounter.incrementCounter).toHaveBeenCalledWith({ + counterName: `legacyRoute_test`, + counterType: 'legacyApiUsage', + incrementBy: 1, + }); + }); + + it('should do nothing if no usage counter is provided', () => { + let err; + try { + trackLegacyRouteUsage('test', undefined); + } catch (e) { + err = e; + } + expect(err).toBeUndefined(); + }); +}); diff --git a/x-pack/plugins/actions/server/lib/track_legacy_route_usage.ts b/x-pack/plugins/actions/server/lib/track_legacy_route_usage.ts new file mode 100644 index 0000000000000..528a75a0a18bd --- /dev/null +++ b/x-pack/plugins/actions/server/lib/track_legacy_route_usage.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 { UsageCounter } from 'src/plugins/usage_collection/server'; + +export function trackLegacyRouteUsage(route: string, usageCounter?: UsageCounter) { + if (usageCounter) { + usageCounter.incrementCounter({ + counterName: `legacyRoute_${route}`, + counterType: 'legacyApiUsage', + incrementBy: 1, + }); + } +} diff --git a/x-pack/plugins/actions/server/plugin.ts b/x-pack/plugins/actions/server/plugin.ts index c3dcdbb94753b..fe133ddb6f0ac 100644 --- a/x-pack/plugins/actions/server/plugin.ts +++ b/x-pack/plugins/actions/server/plugin.ts @@ -84,7 +84,7 @@ import { ensureSufficientLicense } from './lib/ensure_sufficient_license'; import { renderMustacheObject } from './lib/mustache_renderer'; import { getAlertHistoryEsIndex } from './preconfigured_connectors/alert_history_es_index/alert_history_es_index'; import { createAlertHistoryIndexTemplate } from './preconfigured_connectors/alert_history_es_index/create_alert_history_index_template'; -import { AlertHistoryEsIndexConnectorId } from '../common'; +import { ACTIONS_FEATURE_ID, AlertHistoryEsIndexConnectorId } from '../common'; import { EVENT_LOG_ACTIONS, EVENT_LOG_PROVIDER } from './constants/event_log'; export interface PluginSetupContract { @@ -263,8 +263,15 @@ export class ActionsPlugin implements Plugin(), this.licenseState); + defineRoutes( + core.http.createRouter(), + this.licenseState, + usageCounter + ); // Cleanup failed execution task definition if (this.actionsConfig.cleanupFailedExecutionsTask.enabled) { diff --git a/x-pack/plugins/actions/server/routes/get_well_known_email_service.test.ts b/x-pack/plugins/actions/server/routes/get_well_known_email_service.test.ts new file mode 100644 index 0000000000000..bbcedf18142ef --- /dev/null +++ b/x-pack/plugins/actions/server/routes/get_well_known_email_service.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 { getWellKnownEmailServiceRoute } from './get_well_known_email_service'; +import { httpServiceMock } from 'src/core/server/mocks'; +import { licenseStateMock } from '../lib/license_state.mock'; +import { mockHandlerArguments } from './legacy/_mock_handler_arguments'; +import { verifyAccessAndContext } from './verify_access_and_context'; + +jest.mock('./verify_access_and_context.ts', () => ({ + verifyAccessAndContext: jest.fn(), +})); + +beforeEach(() => { + jest.resetAllMocks(); + (verifyAccessAndContext as jest.Mock).mockImplementation((license, handler) => handler); +}); + +describe('getWellKnownEmailServiceRoute', () => { + it('returns config for well known email service', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + + getWellKnownEmailServiceRoute(router, licenseState); + + const [config, handler] = router.get.mock.calls[0]; + expect(config.path).toMatchInlineSnapshot( + `"/internal/actions/connector/_email_config/{service}"` + ); + + const [context, req, res] = mockHandlerArguments( + {}, + { + params: { service: 'gmail' }, + }, + ['ok'] + ); + + expect(await handler(context, req, res)).toMatchInlineSnapshot(` + Object { + "body": Object { + "host": "smtp.gmail.com", + "port": 465, + "secure": true, + }, + } + `); + + expect(res.ok).toHaveBeenCalledWith({ + body: { + host: 'smtp.gmail.com', + port: 465, + secure: true, + }, + }); + }); + + it('returns config for elastic cloud email service', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + + getWellKnownEmailServiceRoute(router, licenseState); + + const [config, handler] = router.get.mock.calls[0]; + expect(config.path).toMatchInlineSnapshot( + `"/internal/actions/connector/_email_config/{service}"` + ); + + const [context, req, res] = mockHandlerArguments( + {}, + { + params: { service: 'elastic_cloud' }, + }, + ['ok'] + ); + + expect(await handler(context, req, res)).toMatchInlineSnapshot(` + Object { + "body": Object { + "host": "dockerhost", + "port": 10025, + "secure": false, + }, + } + `); + + expect(res.ok).toHaveBeenCalledWith({ + body: { + host: 'dockerhost', + port: 10025, + secure: false, + }, + }); + }); + + it('returns empty for unknown service', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + + getWellKnownEmailServiceRoute(router, licenseState); + + const [config, handler] = router.get.mock.calls[0]; + expect(config.path).toMatchInlineSnapshot( + `"/internal/actions/connector/_email_config/{service}"` + ); + + const [context, req, res] = mockHandlerArguments( + {}, + { + params: { service: 'foo' }, + }, + ['ok'] + ); + + expect(await handler(context, req, res)).toMatchInlineSnapshot(` + Object { + "body": Object {}, + } + `); + + expect(res.ok).toHaveBeenCalledWith({ + body: {}, + }); + }); + + it('ensures the license allows getting well known email service config', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + + getWellKnownEmailServiceRoute(router, licenseState); + + const [, handler] = router.get.mock.calls[0]; + + const [context, req, res] = mockHandlerArguments( + {}, + { + params: { service: 'gmail' }, + }, + ['ok'] + ); + + await handler(context, req, res); + + expect(verifyAccessAndContext).toHaveBeenCalledWith(licenseState, expect.any(Function)); + }); + + it('ensures the license check prevents getting well known email service config', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + + (verifyAccessAndContext as jest.Mock).mockImplementation(() => async () => { + throw new Error('OMG'); + }); + + getWellKnownEmailServiceRoute(router, licenseState); + + const [, handler] = router.get.mock.calls[0]; + + const [context, req, res] = mockHandlerArguments( + {}, + { + params: { service: 'gmail' }, + }, + ['ok'] + ); + + expect(handler(context, req, res)).rejects.toMatchInlineSnapshot(`[Error: OMG]`); + + expect(verifyAccessAndContext).toHaveBeenCalledWith(licenseState, expect.any(Function)); + }); +}); diff --git a/x-pack/plugins/actions/server/routes/get_well_known_email_service.ts b/x-pack/plugins/actions/server/routes/get_well_known_email_service.ts new file mode 100644 index 0000000000000..837084f43b864 --- /dev/null +++ b/x-pack/plugins/actions/server/routes/get_well_known_email_service.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 { schema } from '@kbn/config-schema'; +import { IRouter } from 'kibana/server'; +import nodemailerGetService from 'nodemailer/lib/well-known'; +import SMTPConnection from 'nodemailer/lib/smtp-connection'; +import { ILicenseState } from '../lib'; +import { INTERNAL_BASE_ACTION_API_PATH } from '../../common'; +import { ActionsRequestHandlerContext } from '../types'; +import { verifyAccessAndContext } from './verify_access_and_context'; +import { AdditionalEmailServices, ELASTIC_CLOUD_SERVICE } from '../builtin_action_types/email'; + +const paramSchema = schema.object({ + service: schema.string(), +}); + +export const getWellKnownEmailServiceRoute = ( + router: IRouter, + licenseState: ILicenseState +) => { + router.get( + { + path: `${INTERNAL_BASE_ACTION_API_PATH}/connector/_email_config/{service}`, + validate: { + params: paramSchema, + }, + }, + router.handleLegacyErrors( + verifyAccessAndContext(licenseState, async function (context, req, res) { + const { service } = req.params; + + let response: SMTPConnection.Options = {}; + if (service === AdditionalEmailServices.ELASTIC_CLOUD) { + response = ELASTIC_CLOUD_SERVICE; + } else { + const serviceEntry = nodemailerGetService(service); + if (serviceEntry) { + response = { + host: serviceEntry.host, + port: serviceEntry.port, + secure: serviceEntry.secure, + }; + } + } + + return res.ok({ + body: response, + }); + }) + ) + ); +}; diff --git a/x-pack/plugins/actions/server/routes/index.ts b/x-pack/plugins/actions/server/routes/index.ts index a236e514ef78d..a6470d366c039 100644 --- a/x-pack/plugins/actions/server/routes/index.ts +++ b/x-pack/plugins/actions/server/routes/index.ts @@ -6,6 +6,7 @@ */ import { IRouter } from 'kibana/server'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import { ILicenseState } from '../lib'; import { ActionsRequestHandlerContext } from '../types'; import { createActionRoute } from './create'; @@ -15,13 +16,15 @@ import { getActionRoute } from './get'; import { getAllActionRoute } from './get_all'; import { connectorTypesRoute } from './connector_types'; import { updateActionRoute } from './update'; +import { getWellKnownEmailServiceRoute } from './get_well_known_email_service'; import { defineLegacyRoutes } from './legacy'; export function defineRoutes( router: IRouter, - licenseState: ILicenseState + licenseState: ILicenseState, + usageCounter?: UsageCounter ) { - defineLegacyRoutes(router, licenseState); + defineLegacyRoutes(router, licenseState, usageCounter); createActionRoute(router, licenseState); deleteActionRoute(router, licenseState); @@ -30,4 +33,6 @@ export function defineRoutes( updateActionRoute(router, licenseState); connectorTypesRoute(router, licenseState); executeActionRoute(router, licenseState); + + getWellKnownEmailServiceRoute(router, licenseState); } diff --git a/x-pack/plugins/actions/server/routes/legacy/create.test.ts b/x-pack/plugins/actions/server/routes/legacy/create.test.ts index 3993319d1471f..9e4ab8272dd6d 100644 --- a/x-pack/plugins/actions/server/routes/legacy/create.test.ts +++ b/x-pack/plugins/actions/server/routes/legacy/create.test.ts @@ -11,11 +11,20 @@ import { licenseStateMock } from '../../lib/license_state.mock'; import { mockHandlerArguments } from './_mock_handler_arguments'; import { actionsClientMock } from '../../actions_client.mock'; import { verifyAccessAndContext } from '../verify_access_and_context'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; jest.mock('../verify_access_and_context.ts', () => ({ verifyAccessAndContext: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + +const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); +const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + beforeEach(() => { jest.resetAllMocks(); (verifyAccessAndContext as jest.Mock).mockImplementation((license, handler) => handler); @@ -128,4 +137,16 @@ describe('createActionRoute', () => { expect(handler(context, req, res)).rejects.toMatchInlineSnapshot(`[Error: OMG]`); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const actionsClient = actionsClientMock.create(); + + createActionRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.post.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ actionsClient }, {}); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('create', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/actions/server/routes/legacy/create.ts b/x-pack/plugins/actions/server/routes/legacy/create.ts index caed699641673..9713c01905b7f 100644 --- a/x-pack/plugins/actions/server/routes/legacy/create.ts +++ b/x-pack/plugins/actions/server/routes/legacy/create.ts @@ -6,11 +6,13 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import { IRouter } from 'kibana/server'; import { ActionsRequestHandlerContext } from '../../types'; import { ILicenseState } from '../../lib'; import { BASE_ACTION_API_PATH } from '../../../common'; import { verifyAccessAndContext } from '../verify_access_and_context'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; export const bodySchema = schema.object({ name: schema.string(), @@ -21,7 +23,8 @@ export const bodySchema = schema.object({ export const createActionRoute = ( router: IRouter, - licenseState: ILicenseState + licenseState: ILicenseState, + usageCounter?: UsageCounter ) => { router.post( { @@ -34,6 +37,7 @@ export const createActionRoute = ( verifyAccessAndContext(licenseState, async function (context, req, res) { const actionsClient = context.actions.getActionsClient(); const action = req.body; + trackLegacyRouteUsage('create', usageCounter); return res.ok({ body: await actionsClient.create({ action }), }); diff --git a/x-pack/plugins/actions/server/routes/legacy/delete.test.ts b/x-pack/plugins/actions/server/routes/legacy/delete.test.ts index cee78d998d62a..7284d18919716 100644 --- a/x-pack/plugins/actions/server/routes/legacy/delete.test.ts +++ b/x-pack/plugins/actions/server/routes/legacy/delete.test.ts @@ -11,11 +11,20 @@ import { licenseStateMock } from '../../lib/license_state.mock'; import { verifyApiAccess } from '../../lib'; import { mockHandlerArguments } from './_mock_handler_arguments'; import { actionsClientMock } from '../../mocks'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; jest.mock('../../lib/verify_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + +const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); +const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + beforeEach(() => { jest.resetAllMocks(); }); @@ -107,4 +116,23 @@ describe('deleteActionRoute', () => { expect(verifyApiAccess).toHaveBeenCalledWith(licenseState); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const actionsClient = actionsClientMock.create(); + + deleteActionRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.delete.mock.calls[0]; + const [context, req, res] = mockHandlerArguments( + { actionsClient }, + { + params: { + id: '1', + }, + } + ); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('delete', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/actions/server/routes/legacy/delete.ts b/x-pack/plugins/actions/server/routes/legacy/delete.ts index 9b3c449607b4a..656ece6f1c6f5 100644 --- a/x-pack/plugins/actions/server/routes/legacy/delete.ts +++ b/x-pack/plugins/actions/server/routes/legacy/delete.ts @@ -6,10 +6,12 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import { IRouter } from 'kibana/server'; import { ILicenseState, verifyApiAccess, isErrorThatHandlesItsOwnResponse } from '../../lib'; import { BASE_ACTION_API_PATH } from '../../../common'; import { ActionsRequestHandlerContext } from '../../types'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const paramSchema = schema.object({ id: schema.string(), @@ -17,7 +19,8 @@ const paramSchema = schema.object({ export const deleteActionRoute = ( router: IRouter, - licenseState: ILicenseState + licenseState: ILicenseState, + usageCounter?: UsageCounter ) => { router.delete( { @@ -33,6 +36,7 @@ export const deleteActionRoute = ( } const actionsClient = context.actions.getActionsClient(); const { id } = req.params; + trackLegacyRouteUsage('delete', usageCounter); try { await actionsClient.delete({ id }); return res.noContent(); diff --git a/x-pack/plugins/actions/server/routes/legacy/execute.test.ts b/x-pack/plugins/actions/server/routes/legacy/execute.test.ts index 05b71819911a3..61716539f6e9d 100644 --- a/x-pack/plugins/actions/server/routes/legacy/execute.test.ts +++ b/x-pack/plugins/actions/server/routes/legacy/execute.test.ts @@ -12,11 +12,20 @@ import { mockHandlerArguments } from './_mock_handler_arguments'; import { verifyApiAccess, ActionTypeDisabledError, asHttpRequestExecutionSource } from '../../lib'; import { actionsClientMock } from '../../actions_client.mock'; import { ActionTypeExecutorResult } from '../../types'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; jest.mock('../../lib/verify_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + +const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); +const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + beforeEach(() => { jest.resetAllMocks(); }); @@ -192,4 +201,16 @@ describe('executeActionRoute', () => { expect(res.forbidden).toHaveBeenCalledWith({ body: { message: 'Fail' } }); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const actionsClient = actionsClientMock.create(); + + executeActionRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.post.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ actionsClient }, { body: {}, params: {} }); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('execute', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/actions/server/routes/legacy/execute.ts b/x-pack/plugins/actions/server/routes/legacy/execute.ts index d7ed8d2e15604..33174861122d4 100644 --- a/x-pack/plugins/actions/server/routes/legacy/execute.ts +++ b/x-pack/plugins/actions/server/routes/legacy/execute.ts @@ -6,12 +6,14 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import { IRouter } from 'kibana/server'; import { ILicenseState, verifyApiAccess, isErrorThatHandlesItsOwnResponse } from '../../lib'; import { ActionTypeExecutorResult, ActionsRequestHandlerContext } from '../../types'; import { BASE_ACTION_API_PATH } from '../../../common'; import { asHttpRequestExecutionSource } from '../../lib/action_execution_source'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const paramSchema = schema.object({ id: schema.string(), @@ -23,7 +25,8 @@ const bodySchema = schema.object({ export const executeActionRoute = ( router: IRouter, - licenseState: ILicenseState + licenseState: ILicenseState, + usageCounter?: UsageCounter ) => { router.post( { @@ -43,6 +46,7 @@ export const executeActionRoute = ( const actionsClient = context.actions.getActionsClient(); const { params } = req.body; const { id } = req.params; + trackLegacyRouteUsage('execute', usageCounter); try { const body: ActionTypeExecutorResult = await actionsClient.execute({ params, diff --git a/x-pack/plugins/actions/server/routes/legacy/get.test.ts b/x-pack/plugins/actions/server/routes/legacy/get.test.ts index 4d1265030141f..91b8e53b64e7d 100644 --- a/x-pack/plugins/actions/server/routes/legacy/get.test.ts +++ b/x-pack/plugins/actions/server/routes/legacy/get.test.ts @@ -11,11 +11,20 @@ import { licenseStateMock } from '../../lib/license_state.mock'; import { verifyApiAccess } from '../../lib'; import { mockHandlerArguments } from './_mock_handler_arguments'; import { actionsClientMock } from '../../actions_client.mock'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; jest.mock('../../lib/verify_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + +const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); +const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + beforeEach(() => { jest.resetAllMocks(); }); @@ -133,4 +142,16 @@ describe('getActionRoute', () => { expect(verifyApiAccess).toHaveBeenCalledWith(licenseState); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const actionsClient = actionsClientMock.create(); + + getActionRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.get.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ actionsClient }, { params: { id: '1' } }); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('get', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/actions/server/routes/legacy/get.ts b/x-pack/plugins/actions/server/routes/legacy/get.ts index 44780d4f8a14b..bd8c1096979e2 100644 --- a/x-pack/plugins/actions/server/routes/legacy/get.ts +++ b/x-pack/plugins/actions/server/routes/legacy/get.ts @@ -6,10 +6,12 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import { IRouter } from 'kibana/server'; import { ILicenseState, verifyApiAccess } from '../../lib'; import { BASE_ACTION_API_PATH } from '../../../common'; import { ActionsRequestHandlerContext } from '../../types'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const paramSchema = schema.object({ id: schema.string(), @@ -17,7 +19,8 @@ const paramSchema = schema.object({ export const getActionRoute = ( router: IRouter, - licenseState: ILicenseState + licenseState: ILicenseState, + usageCounter?: UsageCounter ) => { router.get( { @@ -33,6 +36,7 @@ export const getActionRoute = ( } const actionsClient = context.actions.getActionsClient(); const { id } = req.params; + trackLegacyRouteUsage('get', usageCounter); return res.ok({ body: await actionsClient.get({ id }), }); diff --git a/x-pack/plugins/actions/server/routes/legacy/get_all.test.ts b/x-pack/plugins/actions/server/routes/legacy/get_all.test.ts index 7f1003e564614..b4c6792f415ea 100644 --- a/x-pack/plugins/actions/server/routes/legacy/get_all.test.ts +++ b/x-pack/plugins/actions/server/routes/legacy/get_all.test.ts @@ -11,11 +11,20 @@ import { licenseStateMock } from '../../lib/license_state.mock'; import { verifyApiAccess } from '../../lib'; import { mockHandlerArguments } from './_mock_handler_arguments'; import { actionsClientMock } from '../../actions_client.mock'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; jest.mock('../../lib/verify_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + +const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); +const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + beforeEach(() => { jest.resetAllMocks(); }); @@ -92,4 +101,16 @@ describe('getAllActionRoute', () => { expect(verifyApiAccess).toHaveBeenCalledWith(licenseState); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const actionsClient = actionsClientMock.create(); + + getAllActionRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.get.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ actionsClient }, {}); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('getAll', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/actions/server/routes/legacy/get_all.ts b/x-pack/plugins/actions/server/routes/legacy/get_all.ts index 9ea5024d8672b..6c91c2466d70d 100644 --- a/x-pack/plugins/actions/server/routes/legacy/get_all.ts +++ b/x-pack/plugins/actions/server/routes/legacy/get_all.ts @@ -6,13 +6,16 @@ */ import { IRouter } from 'kibana/server'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import { ILicenseState, verifyApiAccess } from '../../lib'; import { BASE_ACTION_API_PATH } from '../../../common'; import { ActionsRequestHandlerContext } from '../../types'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; export const getAllActionRoute = ( router: IRouter, - licenseState: ILicenseState + licenseState: ILicenseState, + usageCounter?: UsageCounter ) => { router.get( { @@ -26,6 +29,7 @@ export const getAllActionRoute = ( } const actionsClient = context.actions.getActionsClient(); const result = await actionsClient.getAll(); + trackLegacyRouteUsage('getAll', usageCounter); return res.ok({ body: result, }); diff --git a/x-pack/plugins/actions/server/routes/legacy/index.ts b/x-pack/plugins/actions/server/routes/legacy/index.ts index 1a22cd9be5681..a974237f0a95d 100644 --- a/x-pack/plugins/actions/server/routes/legacy/index.ts +++ b/x-pack/plugins/actions/server/routes/legacy/index.ts @@ -6,6 +6,7 @@ */ import { IRouter } from 'kibana/server'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import { ILicenseState } from '../../lib'; import { ActionsRequestHandlerContext } from '../../types'; import { createActionRoute } from './create'; @@ -18,13 +19,14 @@ import { executeActionRoute } from './execute'; export function defineLegacyRoutes( router: IRouter, - licenseState: ILicenseState + licenseState: ILicenseState, + usageCounter?: UsageCounter ) { - createActionRoute(router, licenseState); - deleteActionRoute(router, licenseState); - getActionRoute(router, licenseState); - getAllActionRoute(router, licenseState); - updateActionRoute(router, licenseState); - listActionTypesRoute(router, licenseState); - executeActionRoute(router, licenseState); + createActionRoute(router, licenseState, usageCounter); + deleteActionRoute(router, licenseState, usageCounter); + getActionRoute(router, licenseState, usageCounter); + getAllActionRoute(router, licenseState, usageCounter); + updateActionRoute(router, licenseState, usageCounter); + listActionTypesRoute(router, licenseState, usageCounter); + executeActionRoute(router, licenseState, usageCounter); } diff --git a/x-pack/plugins/actions/server/routes/legacy/list_action_types.test.ts b/x-pack/plugins/actions/server/routes/legacy/list_action_types.test.ts index e49dd251136ad..a6536d42f7e8a 100644 --- a/x-pack/plugins/actions/server/routes/legacy/list_action_types.test.ts +++ b/x-pack/plugins/actions/server/routes/legacy/list_action_types.test.ts @@ -12,11 +12,20 @@ import { verifyApiAccess } from '../../lib'; import { mockHandlerArguments } from './_mock_handler_arguments'; import { LicenseType } from '../../../../../plugins/licensing/server'; import { actionsClientMock } from '../../mocks'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; jest.mock('../../lib/verify_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + +const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); +const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + beforeEach(() => { jest.resetAllMocks(); }); @@ -144,4 +153,16 @@ describe('listActionTypesRoute', () => { expect(verifyApiAccess).toHaveBeenCalledWith(licenseState); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const actionsClient = actionsClientMock.create(); + + listActionTypesRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.get.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ actionsClient }, {}); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('listActionTypes', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/actions/server/routes/legacy/list_action_types.ts b/x-pack/plugins/actions/server/routes/legacy/list_action_types.ts index 814f5fffd35ff..5ce25826ca5cc 100644 --- a/x-pack/plugins/actions/server/routes/legacy/list_action_types.ts +++ b/x-pack/plugins/actions/server/routes/legacy/list_action_types.ts @@ -6,13 +6,16 @@ */ import { IRouter } from 'kibana/server'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import { ILicenseState, verifyApiAccess } from '../../lib'; import { BASE_ACTION_API_PATH } from '../../../common'; import { ActionsRequestHandlerContext } from '../../types'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; export const listActionTypesRoute = ( router: IRouter, - licenseState: ILicenseState + licenseState: ILicenseState, + usageCounter?: UsageCounter ) => { router.get( { @@ -25,6 +28,7 @@ export const listActionTypesRoute = ( return res.badRequest({ body: 'RouteHandlerContext is not registered for actions' }); } const actionsClient = context.actions.getActionsClient(); + trackLegacyRouteUsage('listActionTypes', usageCounter); return res.ok({ body: await actionsClient.listTypes(), }); diff --git a/x-pack/plugins/actions/server/routes/legacy/update.test.ts b/x-pack/plugins/actions/server/routes/legacy/update.test.ts index 0ce49751753b2..d813b765150c6 100644 --- a/x-pack/plugins/actions/server/routes/legacy/update.test.ts +++ b/x-pack/plugins/actions/server/routes/legacy/update.test.ts @@ -11,11 +11,20 @@ import { licenseStateMock } from '../../lib/license_state.mock'; import { verifyApiAccess, ActionTypeDisabledError } from '../../lib'; import { mockHandlerArguments } from './_mock_handler_arguments'; import { actionsClientMock } from '../../actions_client.mock'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; jest.mock('../../lib/verify_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + +const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); +const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + beforeEach(() => { jest.resetAllMocks(); }); @@ -182,4 +191,19 @@ describe('updateActionRoute', () => { expect(res.forbidden).toHaveBeenCalledWith({ body: { message: 'Fail' } }); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const actionsClient = actionsClientMock.create(); + + updateActionRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.put.mock.calls[0]; + const [context, req, res] = mockHandlerArguments( + { actionsClient }, + { params: { id: '1' }, body: {} } + ); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('update', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/actions/server/routes/legacy/update.ts b/x-pack/plugins/actions/server/routes/legacy/update.ts index 6cbcd56af5048..7ddce9bc799c5 100644 --- a/x-pack/plugins/actions/server/routes/legacy/update.ts +++ b/x-pack/plugins/actions/server/routes/legacy/update.ts @@ -6,10 +6,12 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import { IRouter } from 'kibana/server'; import { ILicenseState, verifyApiAccess, isErrorThatHandlesItsOwnResponse } from '../../lib'; import { BASE_ACTION_API_PATH } from '../../../common'; import { ActionsRequestHandlerContext } from '../../types'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const paramSchema = schema.object({ id: schema.string(), @@ -23,7 +25,8 @@ const bodySchema = schema.object({ export const updateActionRoute = ( router: IRouter, - licenseState: ILicenseState + licenseState: ILicenseState, + usageCounter?: UsageCounter ) => { router.put( { @@ -41,6 +44,7 @@ export const updateActionRoute = ( const actionsClient = context.actions.getActionsClient(); const { id } = req.params; const { name, config, secrets } = req.body; + trackLegacyRouteUsage('update', usageCounter); try { return res.ok({ diff --git a/x-pack/plugins/actions/server/saved_objects/actions_migrations.test.ts b/x-pack/plugins/actions/server/saved_objects/actions_migrations.test.ts index 7dc1426c13a4b..c094109a43d97 100644 --- a/x-pack/plugins/actions/server/saved_objects/actions_migrations.test.ts +++ b/x-pack/plugins/actions/server/saved_objects/actions_migrations.test.ts @@ -119,6 +119,54 @@ describe('successful migrations', () => { }); }); + describe('7.16.0', () => { + test('set service config property for .email connectors if service is undefined', () => { + const migration716 = getActionsMigrations(encryptedSavedObjectsSetup)['7.16.0']; + const action = getMockDataForEmail({ config: { service: undefined } }); + const migratedAction = migration716(action, context); + expect(migratedAction.attributes.config).toEqual({ + service: 'other', + }); + expect(migratedAction).toEqual({ + ...action, + attributes: { + ...action.attributes, + config: { + service: 'other', + }, + }, + }); + }); + + test('set service config property for .email connectors if service is null', () => { + const migration716 = getActionsMigrations(encryptedSavedObjectsSetup)['7.16.0']; + const action = getMockDataForEmail({ config: { service: null } }); + const migratedAction = migration716(action, context); + expect(migratedAction.attributes.config).toEqual({ + service: 'other', + }); + expect(migratedAction).toEqual({ + ...action, + attributes: { + ...action.attributes, + config: { + service: 'other', + }, + }, + }); + }); + + test('skips migrating .email connectors if service is defined, even if value is nonsense', () => { + const migration716 = getActionsMigrations(encryptedSavedObjectsSetup)['7.16.0']; + const action = getMockDataForEmail({ config: { service: 'gobbledygook' } }); + const migratedAction = migration716(action, context); + expect(migratedAction.attributes.config).toEqual({ + service: 'gobbledygook', + }); + expect(migratedAction).toEqual(action); + }); + }); + describe('8.0.0', () => { test('no op migration for rules SO', () => { const migration800 = getActionsMigrations(encryptedSavedObjectsSetup)['8.0.0']; diff --git a/x-pack/plugins/actions/server/saved_objects/actions_migrations.ts b/x-pack/plugins/actions/server/saved_objects/actions_migrations.ts index 7857a9e1f833f..e75f3eb41f2df 100644 --- a/x-pack/plugins/actions/server/saved_objects/actions_migrations.ts +++ b/x-pack/plugins/actions/server/saved_objects/actions_migrations.ts @@ -62,6 +62,12 @@ export function getActionsMigrations( pipeMigrations(addisMissingSecretsField) ); + const migrationEmailActionsSixteen = createEsoMigration( + encryptedSavedObjects, + (doc): doc is SavedObjectUnsanitizedDoc => doc.attributes.actionTypeId === '.email', + pipeMigrations(setServiceConfigIfNotSet) + ); + const migrationActions800 = createEsoMigration( encryptedSavedObjects, (doc: SavedObjectUnsanitizedDoc): doc is SavedObjectUnsanitizedDoc => @@ -73,6 +79,7 @@ export function getActionsMigrations( '7.10.0': executeMigrationWithErrorHandling(migrationActionsTen, '7.10.0'), '7.11.0': executeMigrationWithErrorHandling(migrationActionsEleven, '7.11.0'), '7.14.0': executeMigrationWithErrorHandling(migrationActionsFourteen, '7.14.0'), + '7.16.0': executeMigrationWithErrorHandling(migrationEmailActionsSixteen, '7.16.0'), '8.0.0': executeMigrationWithErrorHandling(migrationActions800, '8.0.0'), }; } @@ -157,6 +164,24 @@ const addHasAuthConfigurationObject = ( }; }; +const setServiceConfigIfNotSet = ( + doc: SavedObjectUnsanitizedDoc +): SavedObjectUnsanitizedDoc => { + if (doc.attributes.actionTypeId !== '.email' || null != doc.attributes.config.service) { + return doc; + } + return { + ...doc, + attributes: { + ...doc.attributes, + config: { + ...doc.attributes.config, + service: 'other', + }, + }, + }; +}; + const addisMissingSecretsField = ( doc: SavedObjectUnsanitizedDoc ): SavedObjectUnsanitizedDoc => { diff --git a/x-pack/plugins/actions/server/types.ts b/x-pack/plugins/actions/server/types.ts index 14e9e120a853a..64250ca77fba4 100644 --- a/x-pack/plugins/actions/server/types.ts +++ b/x-pack/plugins/actions/server/types.ts @@ -19,6 +19,7 @@ import { SavedObjectReference, } from '../../../../src/core/server'; import { ActionTypeExecutorResult } from '../common'; +import { TaskInfo } from './lib/action_executor'; export { ActionTypeExecutorResult } from '../common'; export { GetFieldsByIssueTypeResponse as JiraGetFieldsResponse } from './builtin_action_types/jira/types'; export { GetCommonFieldsResponse as ServiceNowGetFieldsResponse } from './builtin_action_types/servicenow/types'; @@ -59,6 +60,7 @@ export interface ActionTypeExecutorOptions { secrets: Secrets; params: Params; isEphemeral?: boolean; + taskInfo?: TaskInfo; } export interface ActionResult { diff --git a/x-pack/plugins/alerting/jest.config.js b/x-pack/plugins/alerting/jest.config.js index 1f34005415cca..05db974299b40 100644 --- a/x-pack/plugins/alerting/jest.config.js +++ b/x-pack/plugins/alerting/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/alerting'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/alerting', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/alerting/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/alerting/server/lib/track_legacy_route_usage.test.ts b/x-pack/plugins/alerting/server/lib/track_legacy_route_usage.test.ts new file mode 100644 index 0000000000000..f4a1ce07ab985 --- /dev/null +++ b/x-pack/plugins/alerting/server/lib/track_legacy_route_usage.test.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 { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; +import { trackLegacyRouteUsage } from './track_legacy_route_usage'; + +describe('trackLegacyRouteUsage', () => { + it('should call `usageCounter.incrementCounter`', () => { + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + trackLegacyRouteUsage('test', mockUsageCounter); + expect(mockUsageCounter.incrementCounter).toHaveBeenCalledWith({ + counterName: `legacyRoute_test`, + counterType: 'legacyApiUsage', + incrementBy: 1, + }); + }); + + it('should do nothing if no usage counter is provided', () => { + let err; + try { + trackLegacyRouteUsage('test', undefined); + } catch (e) { + err = e; + } + expect(err).toBeUndefined(); + }); +}); diff --git a/x-pack/plugins/alerting/server/lib/track_legacy_route_usage.ts b/x-pack/plugins/alerting/server/lib/track_legacy_route_usage.ts new file mode 100644 index 0000000000000..528a75a0a18bd --- /dev/null +++ b/x-pack/plugins/alerting/server/lib/track_legacy_route_usage.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 { UsageCounter } from 'src/plugins/usage_collection/server'; + +export function trackLegacyRouteUsage(route: string, usageCounter?: UsageCounter) { + if (usageCounter) { + usageCounter.incrementCounter({ + counterName: `legacyRoute_${route}`, + counterType: 'legacyApiUsage', + incrementBy: 1, + }); + } +} diff --git a/x-pack/plugins/alerting/server/routes/legacy/aggregate.test.ts b/x-pack/plugins/alerting/server/routes/legacy/aggregate.test.ts index 22d7d5c4bc94f..d08e970eef69d 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/aggregate.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/aggregate.test.ts @@ -11,8 +11,16 @@ import { licenseStateMock } from '../../lib/license_state.mock'; import { verifyApiAccess } from '../../lib/license_api_access'; import { mockHandlerArguments } from './../_mock_handler_arguments'; import { rulesClientMock } from '../../rules_client.mock'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; const rulesClient = rulesClientMock.create(); +const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); +const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); jest.mock('../../lib/license_api_access.ts', () => ({ verifyApiAccess: jest.fn(), @@ -139,4 +147,23 @@ describe('aggregateAlertRoute', () => { expect(verifyApiAccess).toHaveBeenCalledWith(licenseState); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + + aggregateAlertRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.get.mock.calls[0]; + const [context, req, res] = mockHandlerArguments( + { rulesClient }, + { + query: { + default_search_operator: 'AND', + }, + }, + ['ok'] + ); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('aggregate', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/aggregate.ts b/x-pack/plugins/alerting/server/routes/legacy/aggregate.ts index 099b088abdf39..d1e8d98a95409 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/aggregate.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/aggregate.ts @@ -6,12 +6,14 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import type { AlertingRouter } from '../../types'; import { ILicenseState } from '../../lib/license_state'; import { verifyApiAccess } from '../../lib/license_api_access'; import { LEGACY_BASE_ALERT_API_PATH } from '../../../common'; import { renameKeys } from './../lib/rename_keys'; import { FindOptions } from '../../rules_client'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; // config definition const querySchema = schema.object({ @@ -33,7 +35,11 @@ const querySchema = schema.object({ filter: schema.maybe(schema.string()), }); -export const aggregateAlertRoute = (router: AlertingRouter, licenseState: ILicenseState) => { +export const aggregateAlertRoute = ( + router: AlertingRouter, + licenseState: ILicenseState, + usageCounter?: UsageCounter +) => { router.get( { path: `${LEGACY_BASE_ALERT_API_PATH}/_aggregate`, @@ -48,6 +54,8 @@ export const aggregateAlertRoute = (router: AlertingRouter, licenseState: ILicen } const rulesClient = context.alerting.getRulesClient(); + trackLegacyRouteUsage('aggregate', usageCounter); + const query = req.query; const renameMap = { default_search_operator: 'defaultSearchOperator', diff --git a/x-pack/plugins/alerting/server/routes/legacy/create.test.ts b/x-pack/plugins/alerting/server/routes/legacy/create.test.ts index 3f9443fbca355..cfbef73ea58db 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/create.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/create.test.ts @@ -7,6 +7,7 @@ import { createAlertRoute } from './create'; import { httpServiceMock } from 'src/core/server/mocks'; +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; import { licenseStateMock } from '../../lib/license_state.mock'; import { verifyApiAccess } from '../../lib/license_api_access'; import { mockHandlerArguments } from './../_mock_handler_arguments'; @@ -14,7 +15,7 @@ import { rulesClientMock } from '../../rules_client.mock'; import { Alert } from '../../../common/alert'; import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; import { encryptedSavedObjectsMock } from '../../../../encrypted_saved_objects/server/mocks'; -import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const rulesClient = rulesClientMock.create(); @@ -22,6 +23,10 @@ jest.mock('../../lib/license_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + beforeEach(() => { jest.resetAllMocks(); }); @@ -439,4 +444,23 @@ describe('createAlertRoute', () => { expect(res.forbidden).toHaveBeenCalledWith({ body: { message: 'Fail' } }); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const encryptedSavedObjects = encryptedSavedObjectsMock.createSetup({ canEncrypt: true }); + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + createAlertRoute({ + router, + licenseState, + encryptedSavedObjects, + usageCounter: mockUsageCounter, + }); + const [, handler] = router.post.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ rulesClient }, {}, ['ok']); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('create', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/create.ts b/x-pack/plugins/alerting/server/routes/legacy/create.ts index 34a5d0ff4d7fa..ec5db463f7abf 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/create.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/create.ts @@ -19,6 +19,7 @@ import { import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; import { RouteOptions } from '..'; import { countUsageOfPredefinedIds } from '../lib'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; export const bodySchema = schema.object({ name: schema.string(), @@ -68,6 +69,8 @@ export const createAlertRoute = ({ router, licenseState, usageCounter }: RouteOp const params = req.params; const notifyWhen = alert?.notifyWhen ? (alert.notifyWhen as AlertNotifyWhenType) : null; + trackLegacyRouteUsage('create', usageCounter); + countUsageOfPredefinedIds({ predefinedId: params?.id, spaceId: rulesClient.getSpaceId(), diff --git a/x-pack/plugins/alerting/server/routes/legacy/delete.test.ts b/x-pack/plugins/alerting/server/routes/legacy/delete.test.ts index a016205b78906..ae1c5327bd27c 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/delete.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/delete.test.ts @@ -5,12 +5,14 @@ * 2.0. */ +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; import { deleteAlertRoute } from './delete'; import { httpServiceMock } from 'src/core/server/mocks'; import { licenseStateMock } from '../../lib/license_state.mock'; import { verifyApiAccess } from '../../lib/license_api_access'; import { mockHandlerArguments } from './../_mock_handler_arguments'; import { rulesClientMock } from '../../rules_client.mock'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const rulesClient = rulesClientMock.create(); @@ -18,6 +20,10 @@ jest.mock('../../lib/license_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + beforeEach(() => { jest.resetAllMocks(); }); @@ -106,4 +112,19 @@ describe('deleteAlertRoute', () => { expect(verifyApiAccess).toHaveBeenCalledWith(licenseState); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + deleteAlertRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.delete.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ rulesClient }, { params: { id: '1' } }, [ + 'ok', + ]); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('delete', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/delete.ts b/x-pack/plugins/alerting/server/routes/legacy/delete.ts index b8800114ebe97..66d05e580a3a2 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/delete.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/delete.ts @@ -6,16 +6,22 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import type { AlertingRouter } from '../../types'; import { ILicenseState } from '../../lib/license_state'; import { verifyApiAccess } from '../../lib/license_api_access'; import { LEGACY_BASE_ALERT_API_PATH } from '../../../common'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const paramSchema = schema.object({ id: schema.string(), }); -export const deleteAlertRoute = (router: AlertingRouter, licenseState: ILicenseState) => { +export const deleteAlertRoute = ( + router: AlertingRouter, + licenseState: ILicenseState, + usageCounter?: UsageCounter +) => { router.delete( { path: `${LEGACY_BASE_ALERT_API_PATH}/alert/{id}`, @@ -28,6 +34,7 @@ export const deleteAlertRoute = (router: AlertingRouter, licenseState: ILicenseS if (!context.alerting) { return res.badRequest({ body: 'RouteHandlerContext is not registered for alerting' }); } + trackLegacyRouteUsage('delete', usageCounter); const rulesClient = context.alerting.getRulesClient(); const { id } = req.params; await rulesClient.delete({ id }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/disable.test.ts b/x-pack/plugins/alerting/server/routes/legacy/disable.test.ts index 3cabf6368b3a3..ac44ab37761bc 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/disable.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/disable.test.ts @@ -4,13 +4,14 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; import { disableAlertRoute } from './disable'; import { httpServiceMock } from 'src/core/server/mocks'; import { licenseStateMock } from '../../lib/license_state.mock'; import { mockHandlerArguments } from './../_mock_handler_arguments'; import { rulesClientMock } from '../../rules_client.mock'; import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const rulesClient = rulesClientMock.create(); @@ -18,6 +19,10 @@ jest.mock('../../lib/license_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + beforeEach(() => { jest.resetAllMocks(); }); @@ -78,4 +83,19 @@ describe('disableAlertRoute', () => { expect(res.forbidden).toHaveBeenCalledWith({ body: { message: 'Fail' } }); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + disableAlertRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.post.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ rulesClient }, { params: { id: '1' } }, [ + 'ok', + ]); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('disable', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/disable.ts b/x-pack/plugins/alerting/server/routes/legacy/disable.ts index 0ac64395235c1..1cba654e11a51 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/disable.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/disable.ts @@ -6,17 +6,23 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import type { AlertingRouter } from '../../types'; import { ILicenseState } from '../../lib/license_state'; import { verifyApiAccess } from '../../lib/license_api_access'; import { LEGACY_BASE_ALERT_API_PATH } from '../../../common'; import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const paramSchema = schema.object({ id: schema.string(), }); -export const disableAlertRoute = (router: AlertingRouter, licenseState: ILicenseState) => { +export const disableAlertRoute = ( + router: AlertingRouter, + licenseState: ILicenseState, + usageCounter?: UsageCounter +) => { router.post( { path: `${LEGACY_BASE_ALERT_API_PATH}/alert/{id}/_disable`, @@ -29,6 +35,7 @@ export const disableAlertRoute = (router: AlertingRouter, licenseState: ILicense if (!context.alerting) { return res.badRequest({ body: 'RouteHandlerContext is not registered for alerting' }); } + trackLegacyRouteUsage('disable', usageCounter); const rulesClient = context.alerting.getRulesClient(); const { id } = req.params; try { diff --git a/x-pack/plugins/alerting/server/routes/legacy/enable.test.ts b/x-pack/plugins/alerting/server/routes/legacy/enable.test.ts index 67a94ef2c1345..c35fb191fae6f 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/enable.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/enable.test.ts @@ -4,13 +4,14 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; import { enableAlertRoute } from './enable'; import { httpServiceMock } from 'src/core/server/mocks'; import { licenseStateMock } from '../../lib/license_state.mock'; import { mockHandlerArguments } from './../_mock_handler_arguments'; import { rulesClientMock } from '../../rules_client.mock'; import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const rulesClient = rulesClientMock.create(); @@ -18,6 +19,10 @@ jest.mock('../../lib/license_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + beforeEach(() => { jest.resetAllMocks(); }); @@ -78,4 +83,19 @@ describe('enableAlertRoute', () => { expect(res.forbidden).toHaveBeenCalledWith({ body: { message: 'Fail' } }); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + enableAlertRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.post.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ rulesClient }, { params: { id: '1' } }, [ + 'ok', + ]); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('enable', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/enable.ts b/x-pack/plugins/alerting/server/routes/legacy/enable.ts index 5a4763f00bd71..000d165ff169d 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/enable.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/enable.ts @@ -6,18 +6,24 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import type { AlertingRouter } from '../../types'; import { ILicenseState } from '../../lib/license_state'; import { verifyApiAccess } from '../../lib/license_api_access'; import { LEGACY_BASE_ALERT_API_PATH } from '../../../common'; import { handleDisabledApiKeysError } from './../lib/error_handler'; import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const paramSchema = schema.object({ id: schema.string(), }); -export const enableAlertRoute = (router: AlertingRouter, licenseState: ILicenseState) => { +export const enableAlertRoute = ( + router: AlertingRouter, + licenseState: ILicenseState, + usageCounter?: UsageCounter +) => { router.post( { path: `${LEGACY_BASE_ALERT_API_PATH}/alert/{id}/_enable`, @@ -31,6 +37,7 @@ export const enableAlertRoute = (router: AlertingRouter, licenseState: ILicenseS if (!context.alerting) { return res.badRequest({ body: 'RouteHandlerContext is not registered for alerting' }); } + trackLegacyRouteUsage('enable', usageCounter); const rulesClient = context.alerting.getRulesClient(); const { id } = req.params; try { diff --git a/x-pack/plugins/alerting/server/routes/legacy/find.test.ts b/x-pack/plugins/alerting/server/routes/legacy/find.test.ts index d6a74027e13d0..de12c62f1e4fd 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/find.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/find.test.ts @@ -4,13 +4,14 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; import { findAlertRoute } from './find'; import { httpServiceMock } from 'src/core/server/mocks'; import { licenseStateMock } from '../../lib/license_state.mock'; import { verifyApiAccess } from '../../lib/license_api_access'; import { mockHandlerArguments } from './../_mock_handler_arguments'; import { rulesClientMock } from '../../rules_client.mock'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const rulesClient = rulesClientMock.create(); @@ -18,6 +19,10 @@ jest.mock('../../lib/license_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + beforeEach(() => { jest.resetAllMocks(); }); @@ -140,4 +145,19 @@ describe('findAlertRoute', () => { expect(verifyApiAccess).toHaveBeenCalledWith(licenseState); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + findAlertRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.get.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ rulesClient }, { params: {}, query: {} }, [ + 'ok', + ]); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('find', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/find.ts b/x-pack/plugins/alerting/server/routes/legacy/find.ts index c12ef8b349e24..f915f0e15afb6 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/find.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/find.ts @@ -6,6 +6,7 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import type { AlertingRouter } from '../../types'; import { ILicenseState } from '../../lib/license_state'; @@ -13,6 +14,7 @@ import { verifyApiAccess } from '../../lib/license_api_access'; import { LEGACY_BASE_ALERT_API_PATH } from '../../../common'; import { renameKeys } from './../lib/rename_keys'; import { FindOptions } from '../../rules_client'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; // config definition const querySchema = schema.object({ @@ -39,7 +41,11 @@ const querySchema = schema.object({ filter: schema.maybe(schema.string()), }); -export const findAlertRoute = (router: AlertingRouter, licenseState: ILicenseState) => { +export const findAlertRoute = ( + router: AlertingRouter, + licenseState: ILicenseState, + usageCounter?: UsageCounter +) => { router.get( { path: `${LEGACY_BASE_ALERT_API_PATH}/_find`, @@ -52,6 +58,7 @@ export const findAlertRoute = (router: AlertingRouter, licenseState: ILicenseSta if (!context.alerting) { return res.badRequest({ body: 'RouteHandlerContext is not registered for alerting' }); } + trackLegacyRouteUsage('find', usageCounter); const rulesClient = context.alerting.getRulesClient(); const query = req.query; diff --git a/x-pack/plugins/alerting/server/routes/legacy/get.test.ts b/x-pack/plugins/alerting/server/routes/legacy/get.test.ts index 84d21ca6ea950..40c7b224c7150 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/get.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/get.test.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; import { getAlertRoute } from './get'; import { httpServiceMock } from 'src/core/server/mocks'; import { licenseStateMock } from '../../lib/license_state.mock'; @@ -12,12 +13,17 @@ import { verifyApiAccess } from '../../lib/license_api_access'; import { mockHandlerArguments } from './../_mock_handler_arguments'; import { rulesClientMock } from '../../rules_client.mock'; import { Alert } from '../../../common'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const rulesClient = rulesClientMock.create(); jest.mock('../../lib/license_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + beforeEach(() => { jest.resetAllMocks(); }); @@ -139,4 +145,19 @@ describe('getAlertRoute', () => { expect(verifyApiAccess).toHaveBeenCalledWith(licenseState); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + getAlertRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.get.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ rulesClient }, { params: { id: '1' } }, [ + 'ok', + ]); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('get', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/get.ts b/x-pack/plugins/alerting/server/routes/legacy/get.ts index 08d1308439aa8..8b4c3e4441514 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/get.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/get.ts @@ -6,16 +6,22 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import { ILicenseState } from '../../lib/license_state'; import { verifyApiAccess } from '../../lib/license_api_access'; import { LEGACY_BASE_ALERT_API_PATH } from '../../../common'; import type { AlertingRouter } from '../../types'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const paramSchema = schema.object({ id: schema.string(), }); -export const getAlertRoute = (router: AlertingRouter, licenseState: ILicenseState) => { +export const getAlertRoute = ( + router: AlertingRouter, + licenseState: ILicenseState, + usageCounter?: UsageCounter +) => { router.get( { path: `${LEGACY_BASE_ALERT_API_PATH}/alert/{id}`, @@ -28,6 +34,7 @@ export const getAlertRoute = (router: AlertingRouter, licenseState: ILicenseStat if (!context.alerting) { return res.badRequest({ body: 'RouteHandlerContext is not registered for alerting' }); } + trackLegacyRouteUsage('get', usageCounter); const rulesClient = context.alerting.getRulesClient(); const { id } = req.params; return res.ok({ diff --git a/x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.test.ts b/x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.test.ts index f3e7349ba55b9..d529aec4162d6 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.test.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; import { getAlertInstanceSummaryRoute } from './get_alert_instance_summary'; import { httpServiceMock } from 'src/core/server/mocks'; import { licenseStateMock } from '../../lib/license_state.mock'; @@ -12,12 +12,17 @@ import { mockHandlerArguments } from './../_mock_handler_arguments'; import { SavedObjectsErrorHelpers } from 'src/core/server'; import { rulesClientMock } from '../../rules_client.mock'; import { AlertInstanceSummary } from '../../types'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const rulesClient = rulesClientMock.create(); jest.mock('../../lib/license_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + beforeEach(() => { jest.resetAllMocks(); }); @@ -103,4 +108,21 @@ describe('getAlertInstanceSummaryRoute', () => { expect(await handler(context, req, res)).toEqual(undefined); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + getAlertInstanceSummaryRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.get.mock.calls[0]; + const [context, req, res] = mockHandlerArguments( + { rulesClient }, + { params: { id: '1' }, query: {} }, + ['ok'] + ); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('instanceSummary', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.ts b/x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.ts index ecbb1bf18fb26..2eed14a913a85 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.ts @@ -6,10 +6,12 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import type { AlertingRouter } from '../../types'; import { ILicenseState } from '../../lib/license_state'; import { verifyApiAccess } from '../../lib/license_api_access'; import { LEGACY_BASE_ALERT_API_PATH } from '../../../common'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const paramSchema = schema.object({ id: schema.string(), @@ -21,7 +23,8 @@ const querySchema = schema.object({ export const getAlertInstanceSummaryRoute = ( router: AlertingRouter, - licenseState: ILicenseState + licenseState: ILicenseState, + usageCounter?: UsageCounter ) => { router.get( { @@ -36,6 +39,7 @@ export const getAlertInstanceSummaryRoute = ( if (!context.alerting) { return res.badRequest({ body: 'RouteHandlerContext is not registered for alerting' }); } + trackLegacyRouteUsage('instanceSummary', usageCounter); const rulesClient = context.alerting.getRulesClient(); const { id } = req.params; const { dateStart } = req.query; diff --git a/x-pack/plugins/alerting/server/routes/legacy/get_alert_state.test.ts b/x-pack/plugins/alerting/server/routes/legacy/get_alert_state.test.ts index f07d9cc79c3ac..f164e0fa0bc81 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/get_alert_state.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/get_alert_state.test.ts @@ -4,19 +4,24 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; import { getAlertStateRoute } from './get_alert_state'; import { httpServiceMock } from 'src/core/server/mocks'; import { licenseStateMock } from '../../lib/license_state.mock'; import { mockHandlerArguments } from './../_mock_handler_arguments'; import { SavedObjectsErrorHelpers } from 'src/core/server'; import { rulesClientMock } from '../../rules_client.mock'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const rulesClient = rulesClientMock.create(); jest.mock('../../lib/license_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + beforeEach(() => { jest.resetAllMocks(); }); @@ -147,4 +152,19 @@ describe('getAlertStateRoute', () => { ] `); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + getAlertStateRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.get.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ rulesClient }, { params: { id: '1' } }, [ + 'ok', + ]); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('state', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/get_alert_state.ts b/x-pack/plugins/alerting/server/routes/legacy/get_alert_state.ts index a3156fc5ed42a..2bd2d343b98ba 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/get_alert_state.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/get_alert_state.ts @@ -6,16 +6,22 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import type { AlertingRouter } from '../../types'; import { ILicenseState } from '../../lib/license_state'; import { verifyApiAccess } from '../../lib/license_api_access'; import { LEGACY_BASE_ALERT_API_PATH } from '../../../common'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const paramSchema = schema.object({ id: schema.string(), }); -export const getAlertStateRoute = (router: AlertingRouter, licenseState: ILicenseState) => { +export const getAlertStateRoute = ( + router: AlertingRouter, + licenseState: ILicenseState, + usageCounter?: UsageCounter +) => { router.get( { path: `${LEGACY_BASE_ALERT_API_PATH}/alert/{id}/state`, @@ -28,6 +34,7 @@ export const getAlertStateRoute = (router: AlertingRouter, licenseState: ILicens if (!context.alerting) { return res.badRequest({ body: 'RouteHandlerContext is not registered for alerting' }); } + trackLegacyRouteUsage('state', usageCounter); const rulesClient = context.alerting.getRulesClient(); const { id } = req.params; const state = await rulesClient.getAlertState({ id }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/health.test.ts b/x-pack/plugins/alerting/server/routes/legacy/health.test.ts index ed8e6763d66b7..59ede356add00 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/health.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/health.test.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; import { healthRoute } from './health'; import { httpServiceMock } from 'src/core/server/mocks'; import { mockHandlerArguments } from './../_mock_handler_arguments'; @@ -13,12 +13,18 @@ import { encryptedSavedObjectsMock } from '../../../../encrypted_saved_objects/s import { rulesClientMock } from '../../rules_client.mock'; import { HealthStatus } from '../../types'; import { alertsMock } from '../../mocks'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; + const rulesClient = rulesClientMock.create(); jest.mock('../../lib/license_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + const alerting = alertsMock.createStart(); const currentDate = new Date().toISOString(); @@ -256,4 +262,20 @@ describe('healthRoute', () => { }, }); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const encryptedSavedObjects = encryptedSavedObjectsMock.createSetup({ canEncrypt: true }); + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + healthRoute(router, licenseState, encryptedSavedObjects, mockUsageCounter); + const [, handler] = router.get.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ rulesClient }, { params: { id: '1' } }, [ + 'ok', + ]); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('health', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/health.ts b/x-pack/plugins/alerting/server/routes/legacy/health.ts index 03a574ca62c33..8c654f103ea86 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/health.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/health.ts @@ -5,16 +5,19 @@ * 2.0. */ +import { UsageCounter } from 'src/plugins/usage_collection/server'; import type { AlertingRouter } from '../../types'; import { ILicenseState } from '../../lib/license_state'; import { verifyApiAccess } from '../../lib/license_api_access'; import { AlertingFrameworkHealth } from '../../types'; import { EncryptedSavedObjectsPluginSetup } from '../../../../encrypted_saved_objects/server'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; export function healthRoute( router: AlertingRouter, licenseState: ILicenseState, - encryptedSavedObjects: EncryptedSavedObjectsPluginSetup + encryptedSavedObjects: EncryptedSavedObjectsPluginSetup, + usageCounter?: UsageCounter ) { router.get( { @@ -26,6 +29,7 @@ export function healthRoute( if (!context.alerting) { return res.badRequest({ body: 'RouteHandlerContext is not registered for alerting' }); } + trackLegacyRouteUsage('health', usageCounter); try { const isEsSecurityEnabled: boolean | null = licenseState.getIsSecurityEnabled(); const alertingFrameworkHeath = await context.alerting.getFrameworkHealth(); diff --git a/x-pack/plugins/alerting/server/routes/legacy/index.ts b/x-pack/plugins/alerting/server/routes/legacy/index.ts index e53df8e5aa8b8..a89ccf0920b29 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/index.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/index.ts @@ -25,23 +25,23 @@ import { healthRoute } from './health'; import { RouteOptions } from '..'; export function defineLegacyRoutes(opts: RouteOptions) { - const { router, licenseState, encryptedSavedObjects } = opts; + const { router, licenseState, encryptedSavedObjects, usageCounter } = opts; createAlertRoute(opts); - aggregateAlertRoute(router, licenseState); - deleteAlertRoute(router, licenseState); - findAlertRoute(router, licenseState); - getAlertRoute(router, licenseState); - getAlertStateRoute(router, licenseState); - getAlertInstanceSummaryRoute(router, licenseState); - listAlertTypesRoute(router, licenseState); - updateAlertRoute(router, licenseState); - enableAlertRoute(router, licenseState); - disableAlertRoute(router, licenseState); - updateApiKeyRoute(router, licenseState); - muteAllAlertRoute(router, licenseState); - unmuteAllAlertRoute(router, licenseState); - muteAlertInstanceRoute(router, licenseState); - unmuteAlertInstanceRoute(router, licenseState); - healthRoute(router, licenseState, encryptedSavedObjects); + aggregateAlertRoute(router, licenseState, usageCounter); + deleteAlertRoute(router, licenseState, usageCounter); + findAlertRoute(router, licenseState, usageCounter); + getAlertRoute(router, licenseState, usageCounter); + getAlertStateRoute(router, licenseState, usageCounter); + getAlertInstanceSummaryRoute(router, licenseState, usageCounter); + listAlertTypesRoute(router, licenseState, usageCounter); + updateAlertRoute(router, licenseState, usageCounter); + enableAlertRoute(router, licenseState, usageCounter); + disableAlertRoute(router, licenseState, usageCounter); + updateApiKeyRoute(router, licenseState, usageCounter); + muteAllAlertRoute(router, licenseState, usageCounter); + unmuteAllAlertRoute(router, licenseState, usageCounter); + muteAlertInstanceRoute(router, licenseState, usageCounter); + unmuteAlertInstanceRoute(router, licenseState, usageCounter); + healthRoute(router, licenseState, encryptedSavedObjects, usageCounter); } diff --git a/x-pack/plugins/alerting/server/routes/legacy/list_alert_types.test.ts b/x-pack/plugins/alerting/server/routes/legacy/list_alert_types.test.ts index c047c78a8606e..45c5c62913996 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/list_alert_types.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/list_alert_types.test.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; import { listAlertTypesRoute } from './list_alert_types'; import { httpServiceMock } from 'src/core/server/mocks'; import { licenseStateMock } from '../../lib/license_state.mock'; @@ -13,6 +14,7 @@ import { mockHandlerArguments } from './../_mock_handler_arguments'; import { rulesClientMock } from '../../rules_client.mock'; import { RecoveredActionGroup } from '../../../common'; import { RegistryAlertTypeWithAuth } from '../../authorization'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const rulesClient = rulesClientMock.create(); @@ -20,6 +22,10 @@ jest.mock('../../lib/license_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + beforeEach(() => { jest.resetAllMocks(); }); @@ -201,4 +207,23 @@ describe('listAlertTypesRoute', () => { expect(verifyApiAccess).toHaveBeenCalledWith(licenseState); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + rulesClient.listAlertTypes.mockResolvedValueOnce(new Set([])); + + listAlertTypesRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.get.mock.calls[0]; + const [context, req, res] = mockHandlerArguments( + { rulesClient }, + { params: { id: '1' }, body: {} }, + ['ok'] + ); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('listAlertTypes', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/list_alert_types.ts b/x-pack/plugins/alerting/server/routes/legacy/list_alert_types.ts index 6d5ab21c0b0b0..250d3d1bdeedc 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/list_alert_types.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/list_alert_types.ts @@ -4,13 +4,18 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - +import { UsageCounter } from 'src/plugins/usage_collection/server'; import type { AlertingRouter } from '../../types'; import { ILicenseState } from '../../lib/license_state'; import { verifyApiAccess } from '../../lib/license_api_access'; import { LEGACY_BASE_ALERT_API_PATH } from '../../../common'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; -export const listAlertTypesRoute = (router: AlertingRouter, licenseState: ILicenseState) => { +export const listAlertTypesRoute = ( + router: AlertingRouter, + licenseState: ILicenseState, + usageCounter?: UsageCounter +) => { router.get( { path: `${LEGACY_BASE_ALERT_API_PATH}/list_alert_types`, @@ -21,6 +26,7 @@ export const listAlertTypesRoute = (router: AlertingRouter, licenseState: ILicen if (!context.alerting) { return res.badRequest({ body: 'RouteHandlerContext is not registered for alerting' }); } + trackLegacyRouteUsage('listAlertTypes', usageCounter); return res.ok({ body: Array.from(await context.alerting.getRulesClient().listAlertTypes()), }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/mute_all.test.ts b/x-pack/plugins/alerting/server/routes/legacy/mute_all.test.ts index 538e9d92c43da..131b5ed7960bd 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/mute_all.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/mute_all.test.ts @@ -5,18 +5,24 @@ * 2.0. */ +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; import { muteAllAlertRoute } from './mute_all'; import { httpServiceMock } from 'src/core/server/mocks'; import { licenseStateMock } from '../../lib/license_state.mock'; import { mockHandlerArguments } from './../_mock_handler_arguments'; import { rulesClientMock } from '../../rules_client.mock'; import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const rulesClient = rulesClientMock.create(); jest.mock('../../lib/license_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + beforeEach(() => { jest.resetAllMocks(); }); @@ -77,4 +83,19 @@ describe('muteAllAlertRoute', () => { expect(res.forbidden).toHaveBeenCalledWith({ body: { message: 'Fail' } }); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + muteAllAlertRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.post.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ rulesClient }, { params: {}, body: {} }, [ + 'ok', + ]); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('muteAll', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/mute_all.ts b/x-pack/plugins/alerting/server/routes/legacy/mute_all.ts index 506ffa0570b6a..222abc806ede2 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/mute_all.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/mute_all.ts @@ -6,17 +6,23 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import type { AlertingRouter } from '../../types'; import { ILicenseState } from '../../lib/license_state'; import { verifyApiAccess } from '../../lib/license_api_access'; import { LEGACY_BASE_ALERT_API_PATH } from '../../../common'; import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const paramSchema = schema.object({ id: schema.string(), }); -export const muteAllAlertRoute = (router: AlertingRouter, licenseState: ILicenseState) => { +export const muteAllAlertRoute = ( + router: AlertingRouter, + licenseState: ILicenseState, + usageCounter?: UsageCounter +) => { router.post( { path: `${LEGACY_BASE_ALERT_API_PATH}/alert/{id}/_mute_all`, @@ -29,6 +35,7 @@ export const muteAllAlertRoute = (router: AlertingRouter, licenseState: ILicense if (!context.alerting) { return res.badRequest({ body: 'RouteHandlerContext is not registered for alerting' }); } + trackLegacyRouteUsage('muteAll', usageCounter); const rulesClient = context.alerting.getRulesClient(); const { id } = req.params; try { diff --git a/x-pack/plugins/alerting/server/routes/legacy/mute_instance.test.ts b/x-pack/plugins/alerting/server/routes/legacy/mute_instance.test.ts index 05ecd3978493b..19ce9e1d2b107 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/mute_instance.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/mute_instance.test.ts @@ -5,18 +5,24 @@ * 2.0. */ +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; import { muteAlertInstanceRoute } from './mute_instance'; import { httpServiceMock } from 'src/core/server/mocks'; import { licenseStateMock } from '../../lib/license_state.mock'; import { mockHandlerArguments } from './../_mock_handler_arguments'; import { rulesClientMock } from '../../rules_client.mock'; import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const rulesClient = rulesClientMock.create(); jest.mock('../../lib/license_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + beforeEach(() => { jest.resetAllMocks(); }); @@ -83,4 +89,19 @@ describe('muteAlertInstanceRoute', () => { expect(res.forbidden).toHaveBeenCalledWith({ body: { message: 'Fail' } }); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + muteAlertInstanceRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.post.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ rulesClient }, { params: {}, body: {} }, [ + 'ok', + ]); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('muteInstance', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/mute_instance.ts b/x-pack/plugins/alerting/server/routes/legacy/mute_instance.ts index caf224006677f..be1c0876d5d2e 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/mute_instance.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/mute_instance.ts @@ -6,6 +6,7 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import type { AlertingRouter } from '../../types'; import { ILicenseState } from '../../lib/license_state'; import { verifyApiAccess } from '../../lib/license_api_access'; @@ -13,13 +14,18 @@ import { LEGACY_BASE_ALERT_API_PATH } from '../../../common'; import { renameKeys } from './../lib/rename_keys'; import { MuteOptions } from '../../rules_client'; import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const paramSchema = schema.object({ alert_id: schema.string(), alert_instance_id: schema.string(), }); -export const muteAlertInstanceRoute = (router: AlertingRouter, licenseState: ILicenseState) => { +export const muteAlertInstanceRoute = ( + router: AlertingRouter, + licenseState: ILicenseState, + usageCounter?: UsageCounter +) => { router.post( { path: `${LEGACY_BASE_ALERT_API_PATH}/alert/{alert_id}/alert_instance/{alert_instance_id}/_mute`, @@ -32,6 +38,9 @@ export const muteAlertInstanceRoute = (router: AlertingRouter, licenseState: ILi if (!context.alerting) { return res.badRequest({ body: 'RouteHandlerContext is not registered for alerting' }); } + + trackLegacyRouteUsage('muteInstance', usageCounter); + const rulesClient = context.alerting.getRulesClient(); const renameMap = { diff --git a/x-pack/plugins/alerting/server/routes/legacy/unmute_all.test.ts b/x-pack/plugins/alerting/server/routes/legacy/unmute_all.test.ts index 49bfb63efa80e..8259d2305b941 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/unmute_all.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/unmute_all.test.ts @@ -5,18 +5,24 @@ * 2.0. */ +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; import { unmuteAllAlertRoute } from './unmute_all'; import { httpServiceMock } from 'src/core/server/mocks'; import { licenseStateMock } from '../../lib/license_state.mock'; import { mockHandlerArguments } from './../_mock_handler_arguments'; import { rulesClientMock } from '../../rules_client.mock'; import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const rulesClient = rulesClientMock.create(); jest.mock('../../lib/license_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + beforeEach(() => { jest.resetAllMocks(); }); @@ -77,4 +83,19 @@ describe('unmuteAllAlertRoute', () => { expect(res.forbidden).toHaveBeenCalledWith({ body: { message: 'Fail' } }); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + unmuteAllAlertRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.post.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ rulesClient }, { params: {}, body: {} }, [ + 'ok', + ]); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('unmuteAll', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/unmute_all.ts b/x-pack/plugins/alerting/server/routes/legacy/unmute_all.ts index 4e01b20d8569e..40c303e5d7633 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/unmute_all.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/unmute_all.ts @@ -6,17 +6,23 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import type { AlertingRouter } from '../../types'; import { ILicenseState } from '../../lib/license_state'; import { verifyApiAccess } from '../../lib/license_api_access'; import { LEGACY_BASE_ALERT_API_PATH } from '../../../common'; import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const paramSchema = schema.object({ id: schema.string(), }); -export const unmuteAllAlertRoute = (router: AlertingRouter, licenseState: ILicenseState) => { +export const unmuteAllAlertRoute = ( + router: AlertingRouter, + licenseState: ILicenseState, + usageCounter?: UsageCounter +) => { router.post( { path: `${LEGACY_BASE_ALERT_API_PATH}/alert/{id}/_unmute_all`, @@ -29,6 +35,7 @@ export const unmuteAllAlertRoute = (router: AlertingRouter, licenseState: ILicen if (!context.alerting) { return res.badRequest({ body: 'RouteHandlerContext is not registered for alerting' }); } + trackLegacyRouteUsage('unmuteAll', usageCounter); const rulesClient = context.alerting.getRulesClient(); const { id } = req.params; try { diff --git a/x-pack/plugins/alerting/server/routes/legacy/unmute_instance.test.ts b/x-pack/plugins/alerting/server/routes/legacy/unmute_instance.test.ts index 602fb38eb9afc..bbe61d715a525 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/unmute_instance.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/unmute_instance.test.ts @@ -5,18 +5,24 @@ * 2.0. */ +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; import { unmuteAlertInstanceRoute } from './unmute_instance'; import { httpServiceMock } from 'src/core/server/mocks'; import { licenseStateMock } from '../../lib/license_state.mock'; import { mockHandlerArguments } from './../_mock_handler_arguments'; import { rulesClientMock } from '../../rules_client.mock'; import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const rulesClient = rulesClientMock.create(); jest.mock('../../lib/license_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + beforeEach(() => { jest.resetAllMocks(); }); @@ -83,4 +89,19 @@ describe('unmuteAlertInstanceRoute', () => { expect(res.forbidden).toHaveBeenCalledWith({ body: { message: 'Fail' } }); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + unmuteAlertInstanceRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.post.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ rulesClient }, { params: {}, body: {} }, [ + 'ok', + ]); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('unmuteInstance', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/unmute_instance.ts b/x-pack/plugins/alerting/server/routes/legacy/unmute_instance.ts index f188cfcbbf79b..1c65af9961adc 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/unmute_instance.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/unmute_instance.ts @@ -6,18 +6,24 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import type { AlertingRouter } from '../../types'; import { ILicenseState } from '../../lib/license_state'; import { verifyApiAccess } from '../../lib/license_api_access'; import { LEGACY_BASE_ALERT_API_PATH } from '../../../common'; import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const paramSchema = schema.object({ alertId: schema.string(), alertInstanceId: schema.string(), }); -export const unmuteAlertInstanceRoute = (router: AlertingRouter, licenseState: ILicenseState) => { +export const unmuteAlertInstanceRoute = ( + router: AlertingRouter, + licenseState: ILicenseState, + usageCounter?: UsageCounter +) => { router.post( { path: `${LEGACY_BASE_ALERT_API_PATH}/alert/{alertId}/alert_instance/{alertInstanceId}/_unmute`, @@ -30,6 +36,7 @@ export const unmuteAlertInstanceRoute = (router: AlertingRouter, licenseState: I if (!context.alerting) { return res.badRequest({ body: 'RouteHandlerContext is not registered for alerting' }); } + trackLegacyRouteUsage('unmuteInstance', usageCounter); const rulesClient = context.alerting.getRulesClient(); const { alertId, alertInstanceId } = req.params; try { diff --git a/x-pack/plugins/alerting/server/routes/legacy/update.test.ts b/x-pack/plugins/alerting/server/routes/legacy/update.test.ts index 7e9f6a23efc6a..799672c3cf432 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/update.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/update.test.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; import { updateAlertRoute } from './update'; import { httpServiceMock } from 'src/core/server/mocks'; import { licenseStateMock } from '../../lib/license_state.mock'; @@ -13,12 +14,17 @@ import { mockHandlerArguments } from './../_mock_handler_arguments'; import { rulesClientMock } from '../../rules_client.mock'; import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; import { AlertNotifyWhenType } from '../../../common'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const rulesClient = rulesClientMock.create(); jest.mock('../../lib/license_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + beforeEach(() => { jest.resetAllMocks(); }); @@ -234,4 +240,19 @@ describe('updateAlertRoute', () => { expect(res.forbidden).toHaveBeenCalledWith({ body: { message: 'Fail' } }); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + updateAlertRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.put.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ rulesClient }, { params: {}, body: {} }, [ + 'ok', + ]); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('update', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/update.ts b/x-pack/plugins/alerting/server/routes/legacy/update.ts index 40b88b4eab068..d6e6a2b3c4ae8 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/update.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/update.ts @@ -6,12 +6,14 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import type { AlertingRouter } from '../../types'; import { ILicenseState } from '../../lib/license_state'; import { verifyApiAccess } from '../../lib/license_api_access'; import { validateDurationSchema } from '../../lib'; import { handleDisabledApiKeysError } from './../lib/error_handler'; import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; import { AlertNotifyWhenType, LEGACY_BASE_ALERT_API_PATH, @@ -42,7 +44,11 @@ const bodySchema = schema.object({ notifyWhen: schema.nullable(schema.string({ validate: validateNotifyWhenType })), }); -export const updateAlertRoute = (router: AlertingRouter, licenseState: ILicenseState) => { +export const updateAlertRoute = ( + router: AlertingRouter, + licenseState: ILicenseState, + usageCounter?: UsageCounter +) => { router.put( { path: `${LEGACY_BASE_ALERT_API_PATH}/alert/{id}`, @@ -57,6 +63,7 @@ export const updateAlertRoute = (router: AlertingRouter, licenseState: ILicenseS if (!context.alerting) { return res.badRequest({ body: 'RouteHandlerContext is not registered for alerting' }); } + trackLegacyRouteUsage('update', usageCounter); const rulesClient = context.alerting.getRulesClient(); const { id } = req.params; const { name, actions, params, schedule, tags, throttle, notifyWhen } = req.body; diff --git a/x-pack/plugins/alerting/server/routes/legacy/update_api_key.test.ts b/x-pack/plugins/alerting/server/routes/legacy/update_api_key.test.ts index 6cef59834933e..7c48f5fff357d 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/update_api_key.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/update_api_key.test.ts @@ -5,18 +5,24 @@ * 2.0. */ +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; import { updateApiKeyRoute } from './update_api_key'; import { httpServiceMock } from 'src/core/server/mocks'; import { licenseStateMock } from '../../lib/license_state.mock'; import { mockHandlerArguments } from './../_mock_handler_arguments'; import { rulesClientMock } from '../../rules_client.mock'; import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const rulesClient = rulesClientMock.create(); jest.mock('../../lib/license_api_access.ts', () => ({ verifyApiAccess: jest.fn(), })); +jest.mock('../../lib/track_legacy_route_usage', () => ({ + trackLegacyRouteUsage: jest.fn(), +})); + beforeEach(() => { jest.resetAllMocks(); }); @@ -79,4 +85,19 @@ describe('updateApiKeyRoute', () => { expect(res.forbidden).toHaveBeenCalledWith({ body: { message: 'Fail' } }); }); + + it('should track every call', async () => { + const licenseState = licenseStateMock.create(); + const router = httpServiceMock.createRouter(); + const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); + const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + + updateApiKeyRoute(router, licenseState, mockUsageCounter); + const [, handler] = router.post.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({ rulesClient }, { params: {}, body: {} }, [ + 'ok', + ]); + await handler(context, req, res); + expect(trackLegacyRouteUsage).toHaveBeenCalledWith('updateApiKey', mockUsageCounter); + }); }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/update_api_key.ts b/x-pack/plugins/alerting/server/routes/legacy/update_api_key.ts index 82d322d2332b8..a45767851c5c1 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/update_api_key.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/update_api_key.ts @@ -6,18 +6,24 @@ */ import { schema } from '@kbn/config-schema'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import type { AlertingRouter } from '../../types'; import { ILicenseState } from '../../lib/license_state'; import { verifyApiAccess } from '../../lib/license_api_access'; import { LEGACY_BASE_ALERT_API_PATH } from '../../../common'; import { handleDisabledApiKeysError } from './../lib/error_handler'; import { AlertTypeDisabledError } from '../../lib/errors/alert_type_disabled'; +import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; const paramSchema = schema.object({ id: schema.string(), }); -export const updateApiKeyRoute = (router: AlertingRouter, licenseState: ILicenseState) => { +export const updateApiKeyRoute = ( + router: AlertingRouter, + licenseState: ILicenseState, + usageCounter?: UsageCounter +) => { router.post( { path: `${LEGACY_BASE_ALERT_API_PATH}/alert/{id}/_update_api_key`, @@ -31,6 +37,7 @@ export const updateApiKeyRoute = (router: AlertingRouter, licenseState: ILicense if (!context.alerting) { return res.badRequest({ body: 'RouteHandlerContext is not registered for alerting' }); } + trackLegacyRouteUsage('updateApiKey', usageCounter); const rulesClient = context.alerting.getRulesClient(); const { id } = req.params; try { 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 5a2a124f55abc..51f27916e015a 100644 --- a/x-pack/plugins/alerting/server/rules_client/rules_client.ts +++ b/x-pack/plugins/alerting/server/rules_client/rules_client.ts @@ -35,6 +35,9 @@ import { AlertNotifyWhenType, AlertTypeParams, ResolvedSanitizedRule, + AlertWithLegacyId, + SanitizedAlertWithLegacyId, + PartialAlertWithLegacyId, } from '../types'; import { validateAlertTypeParams, @@ -383,9 +386,11 @@ export class RulesClient { public async get({ id, + includeLegacyId = false, }: { id: string; - }): Promise> { + includeLegacyId?: boolean; + }): Promise | SanitizedAlertWithLegacyId> { const result = await this.unsecuredSavedObjectsClient.get('alert', id); try { await this.authorization.ensureAuthorized({ @@ -414,7 +419,8 @@ export class RulesClient { result.id, result.attributes.alertTypeId, result.attributes, - result.references + result.references, + includeLegacyId ); } @@ -486,7 +492,8 @@ export class RulesClient { dateStart, }: GetAlertInstanceSummaryParams): Promise { this.logger.debug(`getAlertInstanceSummary(): getting alert ${id}`); - const alert = await this.get({ id }); + const alert = (await this.get({ id, includeLegacyId: true })) as SanitizedAlertWithLegacyId; + await this.authorization.ensureAuthorized({ ruleTypeId: alert.alertTypeId, consumer: alert.consumer, @@ -505,13 +512,18 @@ export class RulesClient { this.logger.debug(`getAlertInstanceSummary(): search the event log for alert ${id}`); let events: IEvent[]; try { - const queryResults = await eventLogClient.findEventsBySavedObjectIds('alert', [id], { - page: 1, - per_page: 10000, - start: parsedDateStart.toISOString(), - end: dateNow.toISOString(), - sort_order: 'desc', - }); + const queryResults = await eventLogClient.findEventsBySavedObjectIds( + 'alert', + [id], + { + page: 1, + per_page: 10000, + start: parsedDateStart.toISOString(), + end: dateNow.toISOString(), + sort_order: 'desc', + }, + alert.legacyId !== null ? [alert.legacyId] : undefined + ); events = queryResults.data; } catch (err) { this.logger.debug( @@ -660,6 +672,14 @@ export class RulesClient { } public async delete({ id }: { id: string }) { + return await retryIfConflicts( + this.logger, + `rulesClient.delete('${id}')`, + async () => await this.deleteWithOCC({ id }) + ); + } + + private async deleteWithOCC({ id }: { id: string }) { let taskIdToRemove: string | undefined | null; let apiKeyToInvalidate: string | null = null; let attributes: RawAlert; @@ -1533,13 +1553,26 @@ export class RulesClient { id: string, ruleTypeId: string, rawAlert: RawAlert, - references: SavedObjectReference[] | undefined - ): Alert { + references: SavedObjectReference[] | undefined, + includeLegacyId: boolean = false + ): Alert | AlertWithLegacyId { const ruleType = this.ruleTypeRegistry.get(ruleTypeId); // In order to support the partial update API of Saved Objects we have to support // partial updates of an Alert, but when we receive an actual RawAlert, it is safe // to cast the result to an Alert - return this.getPartialAlertFromRaw(id, ruleType, rawAlert, references) as Alert; + const res = this.getPartialAlertFromRaw( + id, + ruleType, + rawAlert, + references, + includeLegacyId + ); + // include to result because it is for internal rules client usage + if (includeLegacyId) { + return res as AlertWithLegacyId; + } + // exclude from result because it is an internal variable + return omit(res, ['legacyId']) as Alert; } private getPartialAlertFromRaw( @@ -1550,17 +1583,18 @@ export class RulesClient { updatedAt, meta, notifyWhen, + legacyId, scheduledTaskId, params, - legacyId, // exclude from result because it is an internal variable executionStatus, schedule, actions, ...partialRawAlert }: Partial, - references: SavedObjectReference[] | undefined - ): PartialAlert { - return { + references: SavedObjectReference[] | undefined, + includeLegacyId: boolean = false + ): PartialAlert | PartialAlertWithLegacyId { + const rule = { id, notifyWhen, ...partialRawAlert, @@ -1576,6 +1610,9 @@ export class RulesClient { ? { executionStatus: alertExecutionStatusFromRaw(this.logger, id, executionStatus) } : {}), }; + return includeLegacyId + ? ({ ...rule, legacyId } as PartialAlertWithLegacyId) + : (rule as PartialAlert); } private async validateActions( diff --git a/x-pack/plugins/alerting/server/rules_client/tests/get_alert_instance_summary.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/get_alert_instance_summary.test.ts index f8414b08f191b..6b018fb342d99 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/get_alert_instance_summary.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/get_alert_instance_summary.test.ts @@ -212,6 +212,7 @@ describe('getAlertInstanceSummary()', () => { "sort_order": "desc", "start": "2019-02-12T21:00:22.479Z", }, + undefined, ] `); // calculate the expected start/end date for one test @@ -225,6 +226,38 @@ describe('getAlertInstanceSummary()', () => { expect(endMillis - startMillis).toBeLessThan(expectedDuration + 2); }); + test('calls event log client with legacy ids param', async () => { + unsecuredSavedObjectsClient.get.mockResolvedValueOnce( + getAlertInstanceSummarySavedObject({ legacyId: '99999' }) + ); + eventLogClient.findEventsBySavedObjectIds.mockResolvedValueOnce( + AlertInstanceSummaryFindEventsResult + ); + + await rulesClient.getAlertInstanceSummary({ id: '1' }); + + expect(unsecuredSavedObjectsClient.get).toHaveBeenCalledTimes(1); + expect(eventLogClient.findEventsBySavedObjectIds).toHaveBeenCalledTimes(1); + expect(eventLogClient.findEventsBySavedObjectIds.mock.calls[0]).toMatchInlineSnapshot(` + Array [ + "alert", + Array [ + "1", + ], + Object { + "end": "2019-02-12T21:01:22.479Z", + "page": 1, + "per_page": 10000, + "sort_order": "desc", + "start": "2019-02-12T21:00:22.479Z", + }, + Array [ + "99999", + ], + ] + `); + }); + test('calls event log client with start date', async () => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce(getAlertInstanceSummarySavedObject()); eventLogClient.findEventsBySavedObjectIds.mockResolvedValueOnce( diff --git a/x-pack/plugins/alerting/server/types.ts b/x-pack/plugins/alerting/server/types.ts index 67565271fedc8..ba35890efd781 100644 --- a/x-pack/plugins/alerting/server/types.ts +++ b/x-pack/plugins/alerting/server/types.ts @@ -192,6 +192,21 @@ export interface RawAlertExecutionStatus extends SavedObjectAttributes { export type PartialAlert = Pick, 'id'> & Partial, 'id'>>; +export interface AlertWithLegacyId extends Alert { + legacyId: string | null; +} + +export type SanitizedAlertWithLegacyId = Omit< + AlertWithLegacyId, + 'apiKey' +>; + +export type PartialAlertWithLegacyId = Pick< + AlertWithLegacyId, + 'id' +> & + Partial, 'id'>>; + export interface RawAlert extends SavedObjectAttributes { enabled: boolean; name: string; 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 141d94e2b168f..c4658ae2ac22c 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 @@ -304,7 +304,7 @@ exports[`Span ERROR_LOG_MESSAGE 1`] = `undefined`; exports[`Span ERROR_PAGE_URL 1`] = `undefined`; -exports[`Span EVENT_OUTCOME 1`] = `undefined`; +exports[`Span EVENT_OUTCOME 1`] = `"unknown"`; exports[`Span FCP_FIELD 1`] = `undefined`; @@ -541,7 +541,7 @@ exports[`Transaction ERROR_LOG_MESSAGE 1`] = `undefined`; exports[`Transaction ERROR_PAGE_URL 1`] = `undefined`; -exports[`Transaction EVENT_OUTCOME 1`] = `undefined`; +exports[`Transaction EVENT_OUTCOME 1`] = `"unknown"`; exports[`Transaction FCP_FIELD 1`] = `undefined`; diff --git a/x-pack/plugins/apm/common/elasticsearch_fieldnames.test.ts b/x-pack/plugins/apm/common/elasticsearch_fieldnames.test.ts index 6b24b43e9707d..debf75f79ec7e 100644 --- a/x-pack/plugins/apm/common/elasticsearch_fieldnames.test.ts +++ b/x-pack/plugins/apm/common/elasticsearch_fieldnames.test.ts @@ -30,6 +30,7 @@ describe('Transaction', () => { provider: 'gcp', region: 'europe-west1', }, + event: { outcome: 'unknown' }, http: { request: { method: 'GET' }, response: { status_code: 200 }, @@ -87,6 +88,7 @@ describe('Span', () => { provider: 'gcp', region: 'europe-west1', }, + event: { outcome: 'unknown' }, processor: { name: 'transaction', event: 'span', diff --git a/x-pack/plugins/apm/common/search_strategies/constants.ts b/x-pack/plugins/apm/common/search_strategies/constants.ts new file mode 100644 index 0000000000000..b1bd321e1c914 --- /dev/null +++ b/x-pack/plugins/apm/common/search_strategies/constants.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const APM_SEARCH_STRATEGIES = { + APM_FAILED_TRANSACTIONS_CORRELATIONS: 'apmFailedTransactionsCorrelations', + APM_LATENCY_CORRELATIONS: 'apmLatencyCorrelations', +} as const; +export type ApmSearchStrategies = typeof APM_SEARCH_STRATEGIES[keyof typeof APM_SEARCH_STRATEGIES]; + +export const DEFAULT_PERCENTILE_THRESHOLD = 95; diff --git a/x-pack/plugins/apm/common/search_strategies/correlations/types.ts b/x-pack/plugins/apm/common/search_strategies/correlations/types.ts deleted file mode 100644 index 886c5fd6161d8..0000000000000 --- a/x-pack/plugins/apm/common/search_strategies/correlations/types.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. - */ - -export interface HistogramItem { - key: number; - doc_count: number; -} - -export interface ResponseHitSource { - [s: string]: unknown; -} - -export interface ResponseHit { - _source: ResponseHitSource; -} - -export interface SearchServiceParams { - environment: string; - kuery: string; - serviceName?: string; - transactionName?: string; - transactionType?: string; - start?: string; - end?: string; - percentileThreshold?: number; - analyzeCorrelations?: boolean; -} - -export interface SearchServiceFetchParams extends SearchServiceParams { - index: string; - includeFrozen?: boolean; -} - -export interface SearchServiceValue { - histogram: HistogramItem[]; - value: string; - field: string; - correlation: number; - ksTest: number; - duplicatedFields?: string[]; -} - -export interface AsyncSearchProviderProgress { - started: number; - loadedHistogramStepsize: number; - loadedOverallHistogram: number; - loadedFieldCanditates: number; - loadedFieldValuePairs: number; - loadedHistograms: number; -} - -export interface SearchServiceRawResponse { - ccsWarning: boolean; - log: string[]; - overallHistogram?: HistogramItem[]; - percentileThresholdValue?: number; - took: number; - values: SearchServiceValue[]; -} diff --git a/x-pack/plugins/apm/common/search_strategies/failed_transactions_correlations/constants.ts b/x-pack/plugins/apm/common/search_strategies/failed_transactions_correlations/constants.ts new file mode 100644 index 0000000000000..09e3e22a1d352 --- /dev/null +++ b/x-pack/plugins/apm/common/search_strategies/failed_transactions_correlations/constants.ts @@ -0,0 +1,29 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const FAILED_TRANSACTIONS_IMPACT_THRESHOLD = { + HIGH: i18n.translate( + 'xpack.apm.correlations.failedTransactions.highImpactText', + { + defaultMessage: 'High', + } + ), + MEDIUM: i18n.translate( + 'xpack.apm.correlations.failedTransactions.mediumImpactText', + { + defaultMessage: 'Medium', + } + ), + LOW: i18n.translate( + 'xpack.apm.correlations.failedTransactions.lowImpactText', + { + defaultMessage: 'Low', + } + ), +} as const; diff --git a/x-pack/plugins/apm/common/search_strategies/failed_transactions_correlations/types.ts b/x-pack/plugins/apm/common/search_strategies/failed_transactions_correlations/types.ts new file mode 100644 index 0000000000000..de4c5c396961e --- /dev/null +++ b/x-pack/plugins/apm/common/search_strategies/failed_transactions_correlations/types.ts @@ -0,0 +1,44 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + FieldValuePair, + HistogramItem, + RawResponseBase, + SearchStrategyClientParams, +} from '../types'; + +import { FAILED_TRANSACTIONS_IMPACT_THRESHOLD } from './constants'; + +export interface FailedTransactionsCorrelation extends FieldValuePair { + doc_count: number; + bg_count: number; + score: number; + pValue: number | null; + normalizedScore: number; + failurePercentage: number; + successPercentage: number; + histogram: HistogramItem[]; +} + +export type FailedTransactionsCorrelationsImpactThreshold = typeof FAILED_TRANSACTIONS_IMPACT_THRESHOLD[keyof typeof FAILED_TRANSACTIONS_IMPACT_THRESHOLD]; + +export interface FailedTransactionsCorrelationsParams { + percentileThreshold: number; +} + +export type FailedTransactionsCorrelationsRequestParams = FailedTransactionsCorrelationsParams & + SearchStrategyClientParams; + +export interface FailedTransactionsCorrelationsRawResponse + extends RawResponseBase { + log: string[]; + failedTransactionsCorrelations?: FailedTransactionsCorrelation[]; + percentileThresholdValue?: number; + overallHistogram?: HistogramItem[]; + errorHistogram?: HistogramItem[]; +} diff --git a/x-pack/plugins/apm/common/search_strategies/failure_correlations/constants.ts b/x-pack/plugins/apm/common/search_strategies/failure_correlations/constants.ts deleted file mode 100644 index a80918f0e399e..0000000000000 --- a/x-pack/plugins/apm/common/search_strategies/failure_correlations/constants.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; - -export const FAILED_TRANSACTIONS_CORRELATION_SEARCH_STRATEGY = - 'apmFailedTransactionsCorrelationsSearchStrategy'; - -export const FAILED_TRANSACTIONS_IMPACT_THRESHOLD = { - HIGH: i18n.translate( - 'xpack.apm.correlations.failedTransactions.highImpactText', - { - defaultMessage: 'High', - } - ), - MEDIUM: i18n.translate( - 'xpack.apm.correlations.failedTransactions.mediumImpactText', - { - defaultMessage: 'Medium', - } - ), - LOW: i18n.translate( - 'xpack.apm.correlations.failedTransactions.lowImpactText', - { - defaultMessage: 'Low', - } - ), -} as const; diff --git a/x-pack/plugins/apm/common/search_strategies/failure_correlations/types.ts b/x-pack/plugins/apm/common/search_strategies/failure_correlations/types.ts deleted file mode 100644 index 2b0d2b5642e0c..0000000000000 --- a/x-pack/plugins/apm/common/search_strategies/failure_correlations/types.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 { FAILED_TRANSACTIONS_IMPACT_THRESHOLD } from './constants'; - -export interface FailedTransactionsCorrelationValue { - key: string; - doc_count: number; - bg_count: number; - score: number; - pValue: number | null; - fieldName: string; - fieldValue: string; - normalizedScore: number; - failurePercentage: number; - successPercentage: number; -} - -export type FailureCorrelationImpactThreshold = typeof FAILED_TRANSACTIONS_IMPACT_THRESHOLD[keyof typeof FAILED_TRANSACTIONS_IMPACT_THRESHOLD]; - -export interface CorrelationsTerm { - fieldName: string; - fieldValue: string; -} diff --git a/x-pack/plugins/apm/common/search_strategies/latency_correlations/types.ts b/x-pack/plugins/apm/common/search_strategies/latency_correlations/types.ts new file mode 100644 index 0000000000000..75d526202bb08 --- /dev/null +++ b/x-pack/plugins/apm/common/search_strategies/latency_correlations/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 { + FieldValuePair, + HistogramItem, + RawResponseBase, + SearchStrategyClientParams, +} from '../types'; + +export interface LatencyCorrelation extends FieldValuePair { + correlation: number; + histogram: HistogramItem[]; + ksTest: number; +} + +export interface LatencyCorrelationSearchServiceProgress { + started: number; + loadedHistogramStepsize: number; + loadedOverallHistogram: number; + loadedFieldCandidates: number; + loadedFieldValuePairs: number; + loadedHistograms: number; +} + +export interface LatencyCorrelationsParams { + percentileThreshold: number; + analyzeCorrelations: boolean; +} + +export type LatencyCorrelationsRequestParams = LatencyCorrelationsParams & + SearchStrategyClientParams; + +export interface LatencyCorrelationsRawResponse extends RawResponseBase { + log: string[]; + overallHistogram?: HistogramItem[]; + percentileThresholdValue?: number; + latencyCorrelations?: LatencyCorrelation[]; +} diff --git a/x-pack/plugins/apm/common/search_strategies/types.ts b/x-pack/plugins/apm/common/search_strategies/types.ts new file mode 100644 index 0000000000000..d7c6eab1f07c1 --- /dev/null +++ b/x-pack/plugins/apm/common/search_strategies/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export interface FieldValuePair { + fieldName: string; + // For dynamic fieldValues we only identify fields as `string`, + // but for example `http.response.status_code` which is part of + // of the list of predefined field candidates is of type long/number. + fieldValue: string | number; +} + +export interface HistogramItem { + key: number; + doc_count: number; +} + +export interface ResponseHitSource { + [s: string]: unknown; +} + +export interface ResponseHit { + _source: ResponseHitSource; +} + +export interface RawResponseBase { + ccsWarning: boolean; + took: number; +} + +export interface SearchStrategyClientParams { + environment: string; + kuery: string; + serviceName?: string; + transactionName?: string; + transactionType?: string; + start?: string; + end?: string; +} + +export interface SearchStrategyServerParams { + index: string; + includeFrozen?: boolean; +} + +export type SearchStrategyParams = SearchStrategyClientParams & + SearchStrategyServerParams; diff --git a/x-pack/plugins/apm/dev_docs/feature_flags.md b/x-pack/plugins/apm/dev_docs/feature_flags.md new file mode 100644 index 0000000000000..9f722dd5eac5a --- /dev/null +++ b/x-pack/plugins/apm/dev_docs/feature_flags.md @@ -0,0 +1,14 @@ +## Feature flags + +To set up a flagged feature, add the name of the feature key (`apm:myFeature`) to [commmon/ui_settings_keys.ts](./common/ui_settings_keys.ts) and the feature parameters to [server/ui_settings.ts](./server/ui_settings.ts). + +Test for the feature like: + +```js +import { myFeatureEnabled } from '../ui_settings_keys'; +if (core.uiSettings.get(myFeatureEnabled)) { + doStuff(); +} +``` + +Settings can be managed in Kibana under Stack Management > Advanced Settings > Observability. \ No newline at end of file diff --git a/x-pack/plugins/apm/dev_docs/linting.md b/x-pack/plugins/apm/dev_docs/linting.md new file mode 100644 index 0000000000000..a4fd3094f121c --- /dev/null +++ b/x-pack/plugins/apm/dev_docs/linting.md @@ -0,0 +1,22 @@ +## Linting + +_Note: Run the following commands from the root of Kibana._ + +### Typescript + +``` +node scripts/type_check.js --project x-pack/plugins/apm/tsconfig.json +``` + +### Prettier + +``` +yarn prettier "./x-pack/plugins/apm/**/*.{tsx,ts,js}" --write +``` + +### ESLint + +``` +node scripts/eslint.js x-pack/legacy/plugins/apm +``` +diff --git a/x-pack/plugins/apm/dev_docs/feature_flags.md b/x-pack/plugins/apm/dev_docs/feature_flags.md diff --git a/x-pack/plugins/apm/dev_docs/local_setup.md b/x-pack/plugins/apm/dev_docs/local_setup.md new file mode 100644 index 0000000000000..ea6741f572bad --- /dev/null +++ b/x-pack/plugins/apm/dev_docs/local_setup.md @@ -0,0 +1,50 @@ +## Local environment setup + +### Kibana + +``` +git clone git@github.com:elastic/kibana.git +cd kibana/ +yarn kbn bootstrap +yarn start --no-base-path +``` + +### APM Server, Elasticsearch and data + +To access an elasticsearch instance that has live data you have two options: + +#### A. Connect to Elasticsearch on Cloud (internal devs only) + +Find the credentials for the cluster [here](https://github.com/elastic/observability-dev/blob/master/docs/observability-clusters.md) + +#### B. Start Elastic Stack and APM data generators + +``` +git clone git@github.com:elastic/apm-integration-testing.git +cd apm-integration-testing/ +./scripts/compose.py start master --all --no-kibana +``` + +_Docker Compose is required_ + +### Setup default APM users + +APM behaves differently depending on which the role and permissions a logged in user has. To create the users run: + +```sh +node x-pack/plugins/apm/scripts/create-apm-users-and-roles.js --username admin --password changeme --kibana-url http://localhost:5601 --role-suffix +``` + +This will create: + +**apm_read_user**: Read only user + +**apm_power_user**: Read+write user. + +## Debugging Elasticsearch queries + +All APM api endpoints accept `_inspect=true` as a query param that will result in the underlying ES query being outputted in the Kibana backend process. + +Example: +`/api/apm/services/my_service?_inspect=true` +diff --git a/x-pack/plugins/apm/dev_docs/linting.md b/x-pack/plugins/apm/dev_docs/linting.md diff --git a/x-pack/plugins/apm/dev_docs/routing_and_linking.md b/x-pack/plugins/apm/dev_docs/routing_and_linking.md index 7c5a00f43fe4b..478de0081fca4 100644 --- a/x-pack/plugins/apm/dev_docs/routing_and_linking.md +++ b/x-pack/plugins/apm/dev_docs/routing_and_linking.md @@ -18,13 +18,13 @@ Routes (and their parameters) are defined in [public/components/routing/apm_conf #### Parameter handling -Path (like `serviceName` in '/services/:serviceName/transactions') and query parameters are defined in the route definitions. +Path (like `serviceName` in '/services/{serviceName}/transactions') and query parameters are defined in the route definitions. For each parameter, an io-ts runtime type needs to be present: ```tsx { - route: '/services/:serviceName', + route: '/services/{serviceName}', element: , params: t.intersection([ t.type({ diff --git a/x-pack/plugins/apm/dev_docs/testing.md b/x-pack/plugins/apm/dev_docs/testing.md new file mode 100644 index 0000000000000..4d0edc27fe644 --- /dev/null +++ b/x-pack/plugins/apm/dev_docs/testing.md @@ -0,0 +1,66 @@ +# Testing + +## Unit Tests (Jest) + +``` +node scripts/test/jest [--watch] [--updateSnapshot] +``` + +#### Coverage + +HTML coverage report can be found in target/coverage/jest after tests have run. + +``` +open target/coverage/jest/index.html +``` + +--- + +## API Tests + +API tests are separated in two suites: + +- a basic license test suite [default] +- a trial license test suite (the equivalent of gold+) + +``` +node scripts/test/api [--trial] [--help] +``` + +The API tests are located in `x-pack/test/apm_api_integration/`. + +**API Test tips** + +- For debugging access Elasticsearch on http://localhost:9220 (`elastic` / `changeme`) +- To update snapshots append `--updateSnapshots` to the functional_test_runner command + +--- + +## E2E Tests (Cypress) + +``` +node scripts/test/e2e [--trial] [--help] +``` + +The E2E tests are located [here](../ftr_e2e) + +--- + +## Functional tests (Security and Correlations tests) +TODO: We could try moving this tests to the new e2e tests located at `x-pack/plugins/apm/ftr_e2e`. + +**Start server** + +``` +node scripts/functional_tests_server --config x-pack/test/functional/config.js +``` + +**Run tests** + +``` +node scripts/functional_test_runner --config x-pack/test/functional/config.js --grep='APM specs' +``` + +APM tests are located in `x-pack/test/functional/apps/apm`. +For debugging access Elasticsearch on http://localhost:9220` (elastic/changeme) +diff --git a/x-pack/plugins/apm/scripts/test/README.md b/x-pack/plugins/apm/scripts/test/README.md diff --git a/x-pack/plugins/apm/e2e/.gitignore b/x-pack/plugins/apm/e2e/.gitignore deleted file mode 100644 index 5042f0bca0300..0000000000000 --- a/x-pack/plugins/apm/e2e/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -cypress/screenshots/* -cypress/test-results -cypress/videos/* -/snapshots.js -tmp diff --git a/x-pack/plugins/apm/e2e/README.md b/x-pack/plugins/apm/e2e/README.md deleted file mode 100644 index 3517c74e950c7..0000000000000 --- a/x-pack/plugins/apm/e2e/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# End-To-End (e2e) Test for APM UI - -**Run E2E tests** - - -```sh -# In one terminal -node ./scripts/kibana --no-base-path --dev --no-dev-config --config x-pack/plugins/apm/e2e/ci/kibana.e2e.yml -# In another terminal -x-pack/plugins/apm/e2e/run-e2e.sh -``` - -Starts kibana, APM Server, Elasticsearch (with sample data) and runs the tests. - -If you see errors about not all events being ingested correctly try running `cd kibana/x-pack/plugins/apm/e2e/tmp/apm-integration-testing && docker-compose down -v` diff --git a/x-pack/plugins/apm/e2e/ci/kibana.e2e.yml b/x-pack/plugins/apm/e2e/ci/kibana.e2e.yml deleted file mode 100644 index 19f3f7c8978fa..0000000000000 --- a/x-pack/plugins/apm/e2e/ci/kibana.e2e.yml +++ /dev/null @@ -1,31 +0,0 @@ -# Kibana -server.port: 5701 -xpack.security.encryptionKey: 'something_at_least_32_characters' -csp.strict: false -logging.verbose: true - -# Elasticsearch -# Started via apm-integration-testing -# ./scripts/compose.py start master --no-kibana --elasticsearch-port 9201 --apm-server-port 8201 -elasticsearch.hosts: http://localhost:9201 -elasticsearch.username: 'kibana_system_user' -elasticsearch.password: 'changeme' - -# APM index pattern -apm_oss.indexPattern: apm-* - -# APM Indices -apm_oss.errorIndices: apm-*-error* -apm_oss.sourcemapIndices: apm-*-sourcemap -apm_oss.transactionIndices: apm-*-transaction* -apm_oss.spanIndices: apm-*-span* -apm_oss.metricsIndices: apm-*-metric* -apm_oss.onboardingIndices: apm-*-onboarding* - -# APM options -xpack.apm.enabled: true -xpack.apm.serviceMapEnabled: false -xpack.apm.autocreateApmIndexPattern: true -xpack.apm.ui.enabled: true -xpack.apm.ui.transactionGroupBucketSize: 100 -xpack.apm.ui.maxTraceItems: 1000 diff --git a/x-pack/plugins/apm/e2e/ci/prepare-kibana.sh b/x-pack/plugins/apm/e2e/ci/prepare-kibana.sh deleted file mode 100755 index 9e6198bcc526d..0000000000000 --- a/x-pack/plugins/apm/e2e/ci/prepare-kibana.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -set -e - -E2E_DIR=x-pack/plugins/apm/e2e -echo "1/2 Install dependencies..." -# shellcheck disable=SC1091 -source src/dev/ci_setup/setup_env.sh true -yarn kbn bootstrap - -echo "2/2 Start Kibana..." -## Might help to avoid FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory -export NODE_OPTIONS="--max-old-space-size=4096" -nohup node ./scripts/kibana --no-base-path --no-watch --dev --no-dev-config --config ${E2E_DIR}/ci/kibana.e2e.yml > ${E2E_DIR}/kibana.log 2>&1 & diff --git a/x-pack/plugins/apm/e2e/ci/run-e2e.sh b/x-pack/plugins/apm/e2e/ci/run-e2e.sh deleted file mode 100755 index c40ab5d646477..0000000000000 --- a/x-pack/plugins/apm/e2e/ci/run-e2e.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -## -## This is a wrapper to configure the environment with the right tools in the CI -## and run the e2e steps. -## - -E2E_DIR="${0%/*}/.." -# shellcheck disable=SC1091 -source src/dev/ci_setup/setup_env.sh true -set -ex -"${E2E_DIR}"/run-e2e.sh diff --git a/x-pack/plugins/apm/e2e/cypress.json b/x-pack/plugins/apm/e2e/cypress.json deleted file mode 100644 index 19e09e6ad5bbf..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "nodeVersion": "system", - "baseUrl": "http://localhost:5701", - "trashAssetsBeforeRuns": false, - "fileServerFolder": "../", - "fixturesFolder": "./cypress/fixtures", - "integrationFolder": "./cypress/integration", - "pluginsFile": "./cypress/plugins/index.js", - "screenshotsFolder": "./cypress/screenshots", - "supportFile": "./cypress/support/index.ts", - "video": true, - "videoCompression": false, - "videosFolder": "./cypress/videos", - "useRelativeSnapshots": true, - "reporter": "junit", - "reporterOptions": { - "mochaFile": "./cypress/test-results/[hash]-e2e-tests.xml", - "toConsole": false - }, - "testFiles": "**/*.{feature,features}", - "env": { - "elasticsearch_username": "admin", - "elasticsearch_password": "changeme" - }, - "viewportWidth": 1920, - "viewportHeight": 1080 -} diff --git a/x-pack/plugins/apm/e2e/cypress/fixtures/example.json b/x-pack/plugins/apm/e2e/cypress/fixtures/example.json deleted file mode 100644 index da18d9352a17d..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/fixtures/example.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io", - "body": "Fixtures are a great way to mock data for responses to routes" -} \ No newline at end of file diff --git a/x-pack/plugins/apm/e2e/cypress/integration/csm_dashboard.feature b/x-pack/plugins/apm/e2e/cypress/integration/csm_dashboard.feature deleted file mode 100644 index 0028f40a68d90..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/integration/csm_dashboard.feature +++ /dev/null @@ -1,34 +0,0 @@ -Feature: CSM Dashboard - - Scenario: Client metrics - When a user browses the APM UI application for RUM Data - Then should have correct client metrics - - Scenario: JS Errors - When a user browses the APM UI application for RUM Data - Then it displays list of relevant js errors - - Scenario: Percentile select - When the user changes the selected percentile - Then it displays client metric related to that percentile - - Scenario Outline: CSM page filters - When the user filters by "" - Then it filters the client metrics "" - Examples: - | filterName | - | OS | - | Location | - - Scenario: Display CSM Data components - When a user browses the APM UI application for RUM Data - Then should display percentile for page load chart - And should display tooltip on hover - - Scenario: Search by url filter focus - When a user clicks inside url search field - Then it displays top pages in the suggestion popover - - Scenario: Search by url filter - When a user enters a query in url search field - Then it should filter results based on query diff --git a/x-pack/plugins/apm/e2e/cypress/integration/helpers.ts b/x-pack/plugins/apm/e2e/cypress/integration/helpers.ts deleted file mode 100644 index 333f047b72658..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/integration/helpers.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. - */ - -const BASE_URL = Cypress.config().baseUrl; - -/** The default time in ms to wait for a Cypress command to complete */ -export const DEFAULT_TIMEOUT = 60 * 1000; - -export function loginAndWaitForPage( - url: string, - dateRange: { to: string; from: string }, - selectedService?: string -) { - const username = Cypress.env('elasticsearch_username'); - const password = Cypress.env('elasticsearch_password'); - - cy.log(`Authenticating via ${username} / ${password}`); - - let fullUrl = `${BASE_URL}${url}?rangeFrom=${dateRange.from}&rangeTo=${dateRange.to}`; - - if (selectedService) { - fullUrl += `&serviceName=${selectedService}`; - } - cy.visit(fullUrl, { auth: { username, password } }); - - cy.viewport('macbook-15'); - - // wait for loading spinner to disappear - cy.get('#kbn_loading_message', { timeout: DEFAULT_TIMEOUT }).should( - 'not.exist' - ); -} diff --git a/x-pack/plugins/apm/e2e/cypress/integration/snapshots.js b/x-pack/plugins/apm/e2e/cypress/integration/snapshots.js deleted file mode 100644 index fc390a64de28c..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/integration/snapshots.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - "__version": "6.8.0" -} diff --git a/x-pack/plugins/apm/e2e/cypress/integration/snapshots.ts b/x-pack/plugins/apm/e2e/cypress/integration/snapshots.ts deleted file mode 100644 index 64946c113e777..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/integration/snapshots.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. - */ - -module.exports = { - __version: '4.9.0', -}; diff --git a/x-pack/plugins/apm/e2e/cypress/plugins/index.js b/x-pack/plugins/apm/e2e/cypress/plugins/index.js deleted file mode 100644 index bec342118ed5b..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/plugins/index.js +++ /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. - */ - -// *********************************************************** -// This example plugins/index.js can be used to load plugins -// -// You can change the location of this file or turn off loading -// the plugins file with the 'pluginsFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/plugins-guide -// *********************************************************** - -// This function is called when a project is opened or re-opened (e.g. due to -// the project's config changing) - -// eslint-disable-next-line import/no-extraneous-dependencies -const wp = require('@cypress/webpack-preprocessor'); -const fs = require('fs'); - -module.exports = (on) => { - const options = { - webpackOptions: require('../webpack.config.js'), - }; - on('file:preprocessor', wp(options)); - - // readFileMaybe - on('task', { - // ESLint thinks this is a react component for some reason. - // eslint-disable-next-line react/function-component-definition - readFileMaybe(filename) { - if (fs.existsSync(filename)) { - return fs.readFileSync(filename, 'utf8'); - } - - return null; - }, - }); -}; diff --git a/x-pack/plugins/apm/e2e/cypress/support/commands.js b/x-pack/plugins/apm/e2e/cypress/support/commands.js deleted file mode 100644 index 73895fbbec589..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/support/commands.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -// *********************************************** -// This example commands.js shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- -// Cypress.Commands.add("login", (email, password) => { ... }) -// -// -// -- This is a child command -- -// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This is will overwrite an existing command -- -// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) diff --git a/x-pack/plugins/apm/e2e/cypress/support/index.ts b/x-pack/plugins/apm/e2e/cypress/support/index.ts deleted file mode 100644 index 020156fb27915..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/support/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. - */ - -// *********************************************************** -// This example support/index.js is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -import './commands'; - -// @ts-expect-error -import { register } from '@cypress/snapshot'; - -register(); diff --git a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/breakdown_filter.ts b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/breakdown_filter.ts deleted file mode 100644 index 5b4934eac1f71..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/breakdown_filter.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 { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'; -import { DEFAULT_TIMEOUT } from './csm_dashboard'; -import { waitForLoadingToFinish } from './utils'; - -/** The default time in ms to wait for a Cypress command to complete */ - -Given(`a user clicks the page load breakdown filter`, () => { - waitForLoadingToFinish(); - cy.get('.euiStat__title-isLoading').should('not.exist'); - const breakDownBtn = cy.get( - '[data-test-subj=pldBreakdownFilter]', - DEFAULT_TIMEOUT - ); - breakDownBtn.click(); -}); - -When(`the user selected the breakdown`, () => { - cy.get('[id="user_agent.name"]', DEFAULT_TIMEOUT).click(); - // click outside popover to close it - cy.get('[data-cy=pageLoadDist]').click(); -}); - -Then(`breakdown series should appear in chart`, () => { - cy.get('.euiLoadingChart').should('not.exist'); - - cy.get('[data-cy=pageLoadDist]').within(() => { - cy.get('button.echLegendItem__label[title=Chrome] ', DEFAULT_TIMEOUT) - .invoke('text') - .should('eq', 'Chrome'); - - cy.get('button.echLegendItem__label', DEFAULT_TIMEOUT).should( - 'have.text', - 'ChromeChrome Mobile WebViewSafariFirefoxMobile SafariChrome MobileChrome Mobile iOSOverall' - ); - }); -}); diff --git a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/client_metrics_helper.ts b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/client_metrics_helper.ts deleted file mode 100644 index 1ff6ccd423070..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/client_metrics_helper.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 { DEFAULT_TIMEOUT } from './csm_dashboard'; -import { waitForLoadingToFinish } from './utils'; - -/** - * Verifies the behavior of the client metrics component - * @param metrics array of three elements - * @param checkTitleStatus if it's needed to check title elements - */ -export function verifyClientMetrics( - metrics: string[], - checkTitleStatus: boolean -) { - const clientMetricsSelector = '[data-cy=client-metrics] .euiStat__title'; - - waitForLoadingToFinish(); - - if (checkTitleStatus) { - cy.get('.euiStat__title', DEFAULT_TIMEOUT).should('be.visible'); - cy.get('.euiSelect-isLoading').should('not.exist'); - } - - cy.get('.euiStat__title-isLoading').should('not.exist'); - - cy.get(clientMetricsSelector).eq(0).should('have.text', metrics[0]); - - cy.get(clientMetricsSelector).eq(1).should('have.text', metrics[1]); - - cy.get(clientMetricsSelector).eq(2).should('have.text', metrics[2]); -} diff --git a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/csm_dashboard.ts b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/csm_dashboard.ts deleted file mode 100644 index 47154ee214dc4..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/csm_dashboard.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 { Given, Then } from 'cypress-cucumber-preprocessor/steps'; -import { loginAndWaitForPage } from '../../../integration/helpers'; -import { verifyClientMetrics } from './client_metrics_helper'; -import { waitForLoadingToFinish } from './utils'; - -/** The default time in ms to wait for a Cypress command to complete */ -export const DEFAULT_TIMEOUT = { timeout: 60 * 1000 }; - -Given(`a user browses the APM UI application for RUM Data`, () => { - // Open UX landing page - const RANGE_FROM = 'now-24h'; - const RANGE_TO = 'now'; - loginAndWaitForPage( - `/app/ux`, - { - from: RANGE_FROM, - to: RANGE_TO, - }, - 'client' - ); -}); - -Then(`should have correct client metrics`, () => { - const metrics = ['80 ms', '4 ms', '76 ms', '55']; - - verifyClientMetrics(metrics, true); -}); - -Then(`should display percentile for page load chart`, () => { - const pMarkers = '[data-cy=percentile-markers] span'; - - cy.get('.euiLoadingChart', DEFAULT_TIMEOUT).should('be.visible'); - - waitForLoadingToFinish(); - - cy.get('.euiStat__title-isLoading').should('not.exist'); - - cy.get(pMarkers).eq(0).should('have.text', '50th'); - - cy.get(pMarkers).eq(1).should('have.text', '75th'); - - cy.get(pMarkers).eq(2).should('have.text', '90th'); - - cy.get(pMarkers).eq(3).should('have.text', '95th'); -}); - -Then(`should display chart legend`, () => { - const chartLegend = 'button.echLegendItem__label'; - - waitForLoadingToFinish(); - cy.get('.euiLoadingChart').should('not.exist'); - - cy.get('[data-cy=pageLoadDist]').within(() => { - cy.get(chartLegend, DEFAULT_TIMEOUT).eq(0).should('have.text', 'Overall'); - }); -}); - -Then(`should display tooltip on hover`, () => { - cy.get('.euiLoadingChart').should('not.exist'); - - const pMarkers = '[data-cy=percentile-markers] span.euiToolTipAnchor'; - - waitForLoadingToFinish(); - cy.get('.euiLoadingChart').should('not.exist'); - - const marker = cy.get(pMarkers, DEFAULT_TIMEOUT).eq(0); - marker.invoke('show'); - marker.trigger('mouseover', { force: true }); - cy.get('span[data-cy=percentileTooltipTitle]').should('be.visible'); -}); diff --git a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/csm_filters.ts b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/csm_filters.ts deleted file mode 100644 index 168976d96ddc7..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/csm_filters.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { When, Then } from 'cypress-cucumber-preprocessor/steps'; -import { DEFAULT_TIMEOUT } from './csm_dashboard'; -import { verifyClientMetrics } from './client_metrics_helper'; -import { waitForLoadingToFinish } from './utils'; - -When(/^the user filters by "([^"]*)"$/, (filterName) => { - waitForLoadingToFinish(); - cy.get('.euiStat__title-isLoading').should('not.exist'); - - cy.get( - `button[aria-label="expands filter group for ${filterName} filter"]` - ).click(); - - cy.get(`.euiPopover__panel-isOpen`, DEFAULT_TIMEOUT).within(() => { - if (filterName === 'OS') { - const osItem = cy.get('li.euiSelectableListItem', DEFAULT_TIMEOUT).eq(2); - osItem.should('have.text', 'Mac OS X24 '); - osItem.click(); - - // sometimes click doesn't work as expected so we need to retry here - osItem.invoke('attr', 'aria-selected').then((val) => { - if (val === 'false') { - cy.get('li.euiSelectableListItem', DEFAULT_TIMEOUT).eq(2).click(); - } - }); - } else { - const deItem = cy.get('li.euiSelectableListItem', DEFAULT_TIMEOUT).eq(0); - deItem.should('have.text', 'DE84 '); - deItem.click(); - - // sometimes click doesn't work as expected so we need to retry here - deItem.invoke('attr', 'aria-selected').then((val) => { - if (val === 'false') { - cy.get('li.euiSelectableListItem', DEFAULT_TIMEOUT).eq(0).click(); - } - }); - } - cy.contains('Apply').click(); - }); - - cy.get(`.globalFilterLabel__value`, DEFAULT_TIMEOUT).contains( - filterName === 'OS' ? 'Mac OS X' : 'DE' - ); -}); - -Then(/^it filters the client metrics "([^"]*)"$/, (filterName) => { - waitForLoadingToFinish(); - cy.get('.euiStat__title-isLoading').should('not.exist'); - - const data = - filterName === 'OS' - ? ['82 ms', '5 ms', '77 ms', '8'] - : ['75 ms', '4 ms', '71 ms', '28']; - - verifyClientMetrics(data, true); - - cy.get('[data-cy=clearFilters]', DEFAULT_TIMEOUT).click(); -}); diff --git a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/js_errors.ts b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/js_errors.ts deleted file mode 100644 index 6bffb96be7f4a..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/js_errors.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 { Then } from 'cypress-cucumber-preprocessor/steps'; -import { DEFAULT_TIMEOUT } from './csm_dashboard'; -import { getDataTestSubj } from './utils'; - -Then(`it displays list of relevant js errors`, () => { - cy.get('.euiBasicTable-loading').should('not.exist'); - cy.get('.euiStat__title-isLoading').should('not.exist'); - - getDataTestSubj('uxJsErrorsTotal').should('have.text', 'Total errors112'); - - getDataTestSubj('uxJsErrorTable').within(() => { - cy.get('tr.euiTableRow', DEFAULT_TIMEOUT) - .eq(0) - .invoke('text') - .should('eq', 'Error messageTest CaptureErrorImpacted page loads100.0 %'); - }); -}); diff --git a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/percentile_select.ts b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/percentile_select.ts deleted file mode 100644 index 22e6210590192..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/percentile_select.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { When, Then } from 'cypress-cucumber-preprocessor/steps'; -import { verifyClientMetrics } from './client_metrics_helper'; -import { getDataTestSubj } from './utils'; - -When('the user changes the selected percentile', () => { - getDataTestSubj('uxPercentileSelect').select('95'); -}); - -Then(`it displays client metric related to that percentile`, () => { - const metrics = ['165 ms', '14 ms', '151 ms', '55']; - - verifyClientMetrics(metrics, false); - - getDataTestSubj('uxPercentileSelect').select('50'); -}); diff --git a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/service_name_filter.ts b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/service_name_filter.ts deleted file mode 100644 index 26c3fade5afaa..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/service_name_filter.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { When, Then } from 'cypress-cucumber-preprocessor/steps'; -import { verifyClientMetrics } from './client_metrics_helper'; -import { DEFAULT_TIMEOUT } from './csm_dashboard'; -import { waitForLoadingToFinish } from './utils'; - -When('the user changes the selected service name', () => { - waitForLoadingToFinish(); - cy.get(`[data-cy=serviceNameFilter]`, DEFAULT_TIMEOUT).select('client'); -}); - -Then(`it displays relevant client metrics`, () => { - const metrics = ['80 ms', '4 ms', '76 ms', '55']; - - verifyClientMetrics(metrics, false); -}); diff --git a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/url_search_filter.ts b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/url_search_filter.ts deleted file mode 100644 index a277ff5a9a136..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/url_search_filter.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 { When, Then } from 'cypress-cucumber-preprocessor/steps'; -import { DEFAULT_TIMEOUT } from './csm_dashboard'; -import { waitForLoadingToFinish } from './utils'; - -When(`a user clicks inside url search field`, () => { - waitForLoadingToFinish(); - cy.get('.euiStat__title-isLoading').should('not.exist'); - cy.get('span[data-cy=csmUrlFilter]', DEFAULT_TIMEOUT).within(() => { - cy.get('input.euiFieldSearch').click(); - }); -}); - -Then(`it displays top pages in the suggestion popover`, () => { - waitForLoadingToFinish(); - - cy.get('div.euiPopover__panel-isOpen', DEFAULT_TIMEOUT).within(() => { - const listOfUrls = cy.get('li.euiSelectableListItem'); - listOfUrls.should('have.length', 5); - - const actualUrlsText = [ - 'http://opbeans-node:3000/dashboardTotal page views: 17Page load duration: 109 ms (median)', - 'http://opbeans-node:3000/ordersTotal page views: 14Page load duration: 72 ms (median)', - ]; - - cy.get('li.euiSelectableListItem') - .eq(0) - .should('have.text', actualUrlsText[0]); - cy.get('li.euiSelectableListItem') - .eq(1) - .should('have.text', actualUrlsText[1]); - }); -}); - -When(`a user enters a query in url search field`, () => { - waitForLoadingToFinish(); - - cy.get('[data-cy=csmUrlFilter]').within(() => { - cy.get('input.euiSelectableSearch').type('cus'); - }); - - waitForLoadingToFinish(); -}); - -Then(`it should filter results based on query`, () => { - waitForLoadingToFinish(); - - cy.get('div.euiPopover__panel-isOpen', DEFAULT_TIMEOUT).within(() => { - const listOfUrls = cy.get('li.euiSelectableListItem'); - listOfUrls.should('have.length', 1); - - const actualUrlsText = [ - 'http://opbeans-node:3000/customersTotal page views: 10Page load duration: 76 ms (median)', - ]; - - cy.get('li.euiSelectableListItem') - .eq(0) - .should('have.text', actualUrlsText[0]); - }); -}); diff --git a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/utils.ts b/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/utils.ts deleted file mode 100644 index 962f36978d87b..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm/utils.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { DEFAULT_TIMEOUT } from './csm_dashboard'; - -export function waitForLoadingToFinish() { - cy.get('[data-test-subj=globalLoadingIndicator-hidden]', DEFAULT_TIMEOUT); -} - -export function getDataTestSubj(dataTestSubj: string) { - waitForLoadingToFinish(); - - return cy.get(`[data-test-subj=${dataTestSubj}]`, DEFAULT_TIMEOUT); -} diff --git a/x-pack/plugins/apm/e2e/cypress/typings/index.d.ts b/x-pack/plugins/apm/e2e/cypress/typings/index.d.ts deleted file mode 100644 index 256db47dc74fd..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/typings/index.d.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. - */ - -declare namespace Cypress { - interface Chainable { - snapshot: () => {}; - } -} diff --git a/x-pack/plugins/apm/e2e/cypress/webpack.config.js b/x-pack/plugins/apm/e2e/cypress/webpack.config.js deleted file mode 100644 index afeb527cd6b08..0000000000000 --- a/x-pack/plugins/apm/e2e/cypress/webpack.config.js +++ /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. - */ - -module.exports = { - resolve: { - extensions: ['.ts', '.js'], - symlinks: false, - }, - node: { fs: 'empty', child_process: 'empty', readline: 'empty' }, - module: { - rules: [ - { - test: /\.ts$/, - exclude: [/node_modules/], - include: [/e2e\/cypress/], - use: [ - { - loader: 'ts-loader', - }, - ], - }, - { - test: /\.feature$/, - use: [ - { - loader: 'cypress-cucumber-preprocessor/loader', - }, - ], - }, - { - test: /\.features$/, - use: [ - { - loader: 'cypress-cucumber-preprocessor/lib/featuresLoader', - }, - ], - }, - ], - }, -}; diff --git a/x-pack/plugins/apm/e2e/ingest-data/replay.js b/x-pack/plugins/apm/e2e/ingest-data/replay.js deleted file mode 100644 index 7cda2a8064f7f..0000000000000 --- a/x-pack/plugins/apm/e2e/ingest-data/replay.js +++ /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. - */ - -/* eslint-disable no-console */ - -/* eslint-disable import/no-extraneous-dependencies */ - -/** - * This script is useful for ingesting previously generated APM data into Elasticsearch via APM Server - * - * You can either: - * 1. Download a static test data file from: https://storage.googleapis.com/apm-ui-e2e-static-data/events.json - * 2. Or, generate the test data file yourself: - * git clone https://github.com/elastic/apm-integration-testing.git - * ./scripts/compose.py start master --no-kibana --with-opbeans-node --apm-server-record - * docker cp localtesting_8.0.0_apm-server-2:/app/events.json . && cat events.json | wc -l - * - * - * - * Run the script: - * - * node replay.js --server-url --secret-token --events ./events.json - * - ************/ - -const { promisify } = require('util'); -const fs = require('fs'); -const path = require('path'); -const axios = require('axios'); -const readFile = promisify(fs.readFile); -const pLimit = require('p-limit'); -const pRetry = require('p-retry'); -const { argv } = require('yargs'); -const ora = require('ora'); -const userAgents = require('./user_agents'); -const userIps = require('./rum_ips'); - -const APM_SERVER_URL = argv.serverUrl; -const SECRET_TOKEN = argv.secretToken; -const EVENTS_PATH = argv.events; - -if (!APM_SERVER_URL) { - console.log('`--server-url` is required'); - process.exit(1); -} - -if (!EVENTS_PATH) { - console.log('`--events` is required'); - process.exit(1); -} - -const requestProgress = { - succeeded: 0, - failed: 0, - total: 0, -}; - -const spinner = ora({ text: 'Warming up...', stream: process.stdout }); - -function incrementSpinnerCount({ success }) { - success ? requestProgress.succeeded++ : requestProgress.failed++; - const remaining = - requestProgress.total - - (requestProgress.succeeded + requestProgress.failed); - - spinner.text = `Remaining: ${remaining}. Succeeded: ${requestProgress.succeeded}. Failed: ${requestProgress.failed}.`; -} -let iterIndex = 0; - -function setItemMetaAndHeaders(item) { - const headers = { - 'content-type': 'application/x-ndjson', - }; - - if (SECRET_TOKEN) { - headers.Authorization = `Bearer ${SECRET_TOKEN}`; - } - - if (item.url === '/intake/v2/rum/events') { - if (iterIndex === userAgents.length) { - // set some event agent to opbean - setRumAgent(item); - iterIndex = 0; - } - headers['User-Agent'] = userAgents[iterIndex]; - headers['X-Forwarded-For'] = userIps[iterIndex]; - iterIndex++; - } - return headers; -} - -function setRumAgent(item) { - if (item.body) { - item.body = item.body.replace( - '"name":"client"', - '"name":"elastic-frontend"' - ); - } -} - -async function insertItem(item, headers) { - try { - const url = `${APM_SERVER_URL}${item.url}`; - - await axios({ - method: item.method, - url, - headers, - data: item.body, - }); - } catch (e) { - console.error( - `${e.response ? JSON.stringify(e.response.data) : e.message}` - ); - throw e; - } -} - -async function init() { - const content = await readFile(path.resolve(EVENTS_PATH)); - const items = content - .toString() - .split('\n') - .filter((item) => item) - .map((item) => JSON.parse(item)) - .filter((item) => { - return ( - item.url === '/intake/v2/events' || item.url === '/intake/v2/rum/events' - ); - }); - - spinner.start(); - requestProgress.total = items.length; - - const limit = pLimit(20); // number of concurrent requests - await Promise.all( - items.map(async (item) => { - try { - const headers = setItemMetaAndHeaders(item); - // retry 5 times with exponential backoff - await pRetry(() => limit(() => insertItem(item, headers)), { - retries: 5, - }); - incrementSpinnerCount({ success: true }); - } catch (e) { - incrementSpinnerCount({ success: false }); - } - }) - ); -} - -init() - .then(() => { - if (requestProgress.succeeded === requestProgress.total) { - spinner.succeed( - `Successfully ingested ${requestProgress.succeeded} of ${requestProgress.total} events` - ); - process.exit(0); - } else { - spinner.fail( - `Ingested ${requestProgress.succeeded} of ${requestProgress.total} events` - ); - process.exit(1); - } - }) - .catch((e) => { - console.log('An error occurred:', e); - process.exit(1); - }); diff --git a/x-pack/plugins/apm/e2e/ingest-data/rum_ips.js b/x-pack/plugins/apm/e2e/ingest-data/rum_ips.js deleted file mode 100644 index 43bb01a7a23f5..0000000000000 --- a/x-pack/plugins/apm/e2e/ingest-data/rum_ips.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -const IPS = [ - '89.191.86.214', // check24.de - '167.40.79.24', // canada.ca - '151.101.130.217', // elastic.co - '185.143.68.17', - '151.101.130.217', - '185.143.68.17', - '185.143.68.17', - '151.101.130.217', - '185.143.68.17', -]; - -module.exports = IPS; diff --git a/x-pack/plugins/apm/e2e/ingest-data/user_agents.js b/x-pack/plugins/apm/e2e/ingest-data/user_agents.js deleted file mode 100644 index f8829875bc79e..0000000000000 --- a/x-pack/plugins/apm/e2e/ingest-data/user_agents.js +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -/* eslint-disable no-console */ - -/* eslint-disable import/no-extraneous-dependencies */ - -const UserAgents = [ - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36', - 'Mozilla/5.0 (Linux; Android 8.0.0; SM-G960F Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36', - 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/69.0.3497.105 Mobile/15E148 Safari/605.1', - 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1', - 'Mozilla/5.0 (Linux; Android 7.0; Pixel C Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.98 Safari/537.36', - 'Mozilla/5.0 (X11; CrOS x86_64 8172.45.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.64 Safari/537.36', - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9', - 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1', - 'Mozilla/5.0 (CrKey armv7l 1.5.16041) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.0 Safari/537.36', -]; - -module.exports = UserAgents; diff --git a/x-pack/plugins/apm/e2e/run-e2e.sh b/x-pack/plugins/apm/e2e/run-e2e.sh deleted file mode 100755 index 1b3afb4823426..0000000000000 --- a/x-pack/plugins/apm/e2e/run-e2e.sh +++ /dev/null @@ -1,176 +0,0 @@ -#!/usr/bin/env bash - -# variables -KIBANA_PORT=5701 -ELASTICSEARCH_PORT=9201 -APM_SERVER_PORT=8201 - -# ensure Docker is running -docker ps &> /dev/null -if [ $? -ne 0 ]; then - echo "⚠️ Please start Docker" - exit 1 -fi - -# formatting -bold=$(tput bold) -normal=$(tput sgr0) - -# paths -E2E_DIR="${0%/*}" -TMP_DIR="tmp" -APM_IT_DIR="tmp/apm-integration-testing" -WAIT_ON_BIN="../../../../node_modules/.bin/wait-on" -CYPRESS_BIN="../../../../node_modules/.bin/cypress" - -cd ${E2E_DIR} - -KIBANA_VERSION=$(node -p "require('../../../package.json').version") - -# -# Ask user to start Kibana -################################################## -echo "" # newline -echo "${bold}To start Kibana please run the following command:${normal} -node ./scripts/kibana --no-base-path --dev --no-dev-config --config x-pack/plugins/apm/e2e/ci/kibana.e2e.yml" - -# -# Create tmp folder -################################################## -echo "" # newline -echo "${bold}Temporary folder${normal}" -echo "Temporary files will be stored in: ${E2E_DIR}${TMP_DIR}" -mkdir -p ${TMP_DIR} - -# -# apm-integration-testing -################################################## -echo "" # newline -echo "${bold}apm-integration-testing (logs: ${E2E_DIR}${TMP_DIR}/apm-it.log)${normal}" - -# pull if folder already exists -if [ -d ${APM_IT_DIR} ]; then - echo "Pulling from master..." - git -C ${APM_IT_DIR} pull &> ${TMP_DIR}/apm-it.log - -# clone if folder does not exists -else - echo "Cloning repository" - git clone "https://github.com/elastic/apm-integration-testing.git" ${APM_IT_DIR} &> ${TMP_DIR}/apm-it.log -fi - -# Stop if clone/pull failed -if [ $? -ne 0 ]; then - echo "⚠️ Initializing apm-integration-testing failed." - exit 1 -fi - -# Start apm-integration-testing -echo "Starting docker-compose" -echo "Using stack version: ${KIBANA_VERSION}" -${APM_IT_DIR}/scripts/compose.py start $KIBANA_VERSION \ - --no-kibana \ - --elasticsearch-port $ELASTICSEARCH_PORT \ - --apm-server-port=$APM_SERVER_PORT \ - --elasticsearch-heap 4g \ - --apm-server-opt queue.mem.events=8192 \ - --apm-server-opt output.elasticsearch.bulk_max_size=4096 \ - &> ${TMP_DIR}/apm-it.log - -# Stop if apm-integration-testing failed to start correctly -if [ $? -ne 0 ]; then - echo "⚠️ apm-integration-testing could not be started" - echo "" # newline - echo "As a last resort, reset docker with:" - echo "" # newline - echo "cd ${E2E_DIR}${APM_IT_DIR} && scripts/compose.py stop && docker system prune --all --force --volumes" - echo "" # newline - - # output logs for excited docker containers - cd ${APM_IT_DIR} && docker-compose ps --filter "status=exited" -q | xargs -L1 docker logs --tail=10 && cd - - - echo "" # newline - echo "Find the full logs in ${E2E_DIR}${TMP_DIR}/apm-it.log" - exit 1 -fi - -# -# Static mock data -################################################## -echo "" # newline -echo "${bold}Static mock data (logs: ${E2E_DIR}${TMP_DIR}/ingest-data.log)${normal}" - -STATIC_MOCK_FILENAME='2020-06-12.json' - -# Download static data if not already done -if [ ! -e "${TMP_DIR}/${STATIC_MOCK_FILENAME}" ]; then - echo "Downloading ${STATIC_MOCK_FILENAME}..." - curl --silent https://storage.googleapis.com/apm-ui-e2e-static-data/${STATIC_MOCK_FILENAME} --output ${TMP_DIR}/${STATIC_MOCK_FILENAME} -fi - -# echo "Deleting existing indices (apm* and .apm*)" -curl --silent --user admin:changeme -XDELETE "localhost:${ELASTICSEARCH_PORT}/.apm*" > /dev/null -curl --silent --user admin:changeme -XDELETE "localhost:${ELASTICSEARCH_PORT}/apm*" > /dev/null - -# Ingest data into APM Server -node ingest-data/replay.js --server-url http://localhost:$APM_SERVER_PORT --events ${TMP_DIR}/${STATIC_MOCK_FILENAME} 2>> ${TMP_DIR}/ingest-data.log - -# Abort if not all events were ingested correctly -if [ $? -ne 0 ]; then - echo "⚠️ Not all events were ingested correctly. This might affect test tests." - echo "Aborting. Please try again." - echo "" # newline - echo "Full logs in ${E2E_DIR}${TMP_DIR}/ingest-data.log:" - - # output logs for excited docker containers - cd ${APM_IT_DIR} && docker-compose ps --filter "status=exited" -q | xargs -L1 docker logs --tail=3 && cd - - - # stop docker containers - cd ${APM_IT_DIR} && ./scripts/compose.py stop > /dev/null && cd - - exit 1 -fi - -# create empty snapshot file if it doesn't exist -SNAPSHOTS_FILE=cypress/integration/snapshots.js -if [ ! -f ${SNAPSHOTS_FILE} ]; then - echo "{}" > ${SNAPSHOTS_FILE} -fi - -# -# Wait for Kibana to start -################################################## -echo "" # newline -echo "${bold}Waiting for Kibana to start...${normal}" -echo "Note: you need to start Kibana manually. Find the instructions at the top." -$WAIT_ON_BIN -i 500 -w 500 http-get://admin:changeme@localhost:$KIBANA_PORT/api/status > /dev/null - -## Workaround to wait for the http server running -## See: https://github.com/elastic/kibana/issues/66326 -if [ -e kibana.log ] ; then - grep -m 1 "Kibana is now available" <(tail -f -n +1 kibana.log) - echo "✅ Kibana server running..." - grep -m 1 "bundles compiled successfully" <(tail -f -n +1 kibana.log) - echo "✅ Kibana bundles have been compiled..." -fi - - -echo "✅ Setup completed successfully. Running tests..." - -# -# run cypress tests -################################################## -$CYPRESS_BIN run --config pageLoadTimeout=100000,watchForFileChanges=true -e2e_status=$? - -# -# Run interactively -################################################## -echo "${bold}If you want to run the test interactively, run:${normal}" -echo "" # newline -echo "cd ${E2E_DIR} && ${CYPRESS_BIN} open --config pageLoadTimeout=100000,watchForFileChanges=true" - -# Report the e2e status at the very end -if [ $e2e_status -ne 0 ]; then - echo "⚠️ Running tests failed." - exit 1 -fi diff --git a/x-pack/plugins/apm/e2e/tsconfig.json b/x-pack/plugins/apm/e2e/tsconfig.json deleted file mode 100644 index 2560a15df9224..0000000000000 --- a/x-pack/plugins/apm/e2e/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "include": ["**/*"], - "exclude": ["tmp", "target/**/*"], - "compilerOptions": { - "outDir": "target/types", - "types": ["cypress", "node"] - } -} diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/no_data_screen.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/no_data_screen.ts new file mode 100644 index 0000000000000..2d5c2a6f16228 --- /dev/null +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/no_data_screen.ts @@ -0,0 +1,65 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +/* eslint-disable @typescript-eslint/naming-convention */ + +const apmIndicesSaveURL = '/api/apm/settings/apm-indices/save'; + +describe('No data screen', () => { + describe('bypass no data screen on settings pages', () => { + beforeEach(() => { + cy.loginAsPowerUser(); + }); + + before(() => { + // Change default indices + cy.request({ + url: apmIndicesSaveURL, + method: 'POST', + body: { + 'apm_oss.sourcemapIndices': 'foo-*', + 'apm_oss.errorIndices': 'foo-*', + 'apm_oss.onboardingIndices': 'foo-*', + 'apm_oss.spanIndices': 'foo-*', + 'apm_oss.transactionIndices': 'foo-*', + 'apm_oss.metricsIndices': 'foo-*', + }, + headers: { + 'kbn-xsrf': true, + }, + auth: { user: 'apm_power_user', pass: 'changeme' }, + }); + }); + + it('shows no data screen instead of service inventory', () => { + cy.visit('/app/apm/'); + cy.contains('Welcome to Elastic Observability!'); + }); + it('shows settings page', () => { + cy.visit('/app/apm/settings'); + cy.contains('Welcome to Elastic Observability!').should('not.exist'); + cy.get('h1').contains('Settings'); + }); + + after(() => { + // reset to default indices + cy.request({ + url: apmIndicesSaveURL, + method: 'POST', + body: { + 'apm_oss.sourcemapIndices': '', + 'apm_oss.errorIndices': '', + 'apm_oss.onboardingIndices': '', + 'apm_oss.spanIndices': '', + 'apm_oss.transactionIndices': '', + 'apm_oss.metricsIndices': '', + }, + headers: { 'kbn-xsrf': true }, + auth: { user: 'apm_power_user', pass: 'changeme' }, + }); + }); + }); +}); diff --git a/x-pack/plugins/apm/jest.config.js b/x-pack/plugins/apm/jest.config.js index 5bce9bbfb5b1b..4fd2e72776943 100644 --- a/x-pack/plugins/apm/jest.config.js +++ b/x-pack/plugins/apm/jest.config.js @@ -12,5 +12,9 @@ module.exports = { rootDir: path.resolve(__dirname, '../../..'), roots: ['/x-pack/plugins/apm'], setupFiles: ['/x-pack/plugins/apm/.storybook/jest_setup.js'], - testPathIgnorePatterns: ['/x-pack/plugins/apm/e2e/'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/apm', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/apm/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/apm/public/application/application.test.tsx b/x-pack/plugins/apm/public/application/application.test.tsx index cbc72f918877c..144da47828bf7 100644 --- a/x-pack/plugins/apm/public/application/application.test.tsx +++ b/x-pack/plugins/apm/public/application/application.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { act } from '@testing-library/react'; import { createMemoryHistory } from 'history'; import { Observable } from 'rxjs'; -import { CoreStart } from 'src/core/public'; +import { CoreStart, DocLinksStart, HttpStart } from 'src/core/public'; import { mockApmPluginContextValue } from '../context/apm_plugin/mock_apm_plugin_context'; import { createCallApmApi } from '../services/rest/createCallApmApi'; import { renderApp } from './'; @@ -85,6 +85,20 @@ describe('renderApp', () => { getEditAlertFlyout: jest.fn(), }, usageCollection: { reportUiCounter: () => {} }, + http: { + basePath: { + prepend: (path: string) => `/basepath${path}`, + get: () => `/basepath`, + }, + } as HttpStart, + docLinks: ({ + DOC_LINK_VERSION: '0', + ELASTIC_WEBSITE_URL: 'https://www.elastic.co/', + links: { + apm: {}, + observability: { guide: '' }, + }, + } as unknown) as DocLinksStart, } as unknown) as ApmPluginStartDeps; jest.spyOn(window, 'scrollTo').mockReturnValueOnce(undefined); diff --git a/x-pack/plugins/apm/public/components/alerting/alerting_flyout/index.tsx b/x-pack/plugins/apm/public/components/alerting/alerting_flyout/index.tsx index 7cf3100046d57..fa56c44d8d374 100644 --- a/x-pack/plugins/apm/public/components/alerting/alerting_flyout/index.tsx +++ b/x-pack/plugins/apm/public/components/alerting/alerting_flyout/index.tsx @@ -60,7 +60,7 @@ export function AlertingFlyout(props: Props) { metadata: { environment, serviceName, - transactionType, + ...(alertType === AlertType.ErrorCount ? {} : { transactionType }), start, end, } as AlertMetadata, diff --git a/x-pack/plugins/apm/public/components/alerting/error_count_alert_trigger/index.tsx b/x-pack/plugins/apm/public/components/alerting/error_count_alert_trigger/index.tsx index a06520f1c5bfc..dd94cf4b175a6 100644 --- a/x-pack/plugins/apm/public/components/alerting/error_count_alert_trigger/index.tsx +++ b/x-pack/plugins/apm/public/components/alerting/error_count_alert_trigger/index.tsx @@ -8,14 +8,20 @@ import { i18n } from '@kbn/i18n'; import { defaults, omit } from 'lodash'; import React from 'react'; -import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { ForLastExpression } from '../../../../../triggers_actions_ui/public'; +import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { asInteger } from '../../../../common/utils/formatters'; import { useEnvironmentsFetcher } from '../../../hooks/use_environments_fetcher'; import { useFetcher } from '../../../hooks/use_fetcher'; import { ChartPreview } from '../chart_preview'; import { EnvironmentField, IsAboveField, ServiceField } from '../fields'; -import { AlertMetadata, getAbsoluteTimeRange } from '../helper'; +import { + AlertMetadata, + getIntervalAndTimeRange, + isNewApmRuleFromStackManagement, + TimeUnit, +} from '../helper'; +import { NewAlertEmptyPrompt } from '../new_alert_empty_prompt'; import { ServiceAlertTrigger } from '../service_alert_trigger'; export interface AlertParams { @@ -54,14 +60,20 @@ export function ErrorCountAlertTrigger(props: Props) { const { data } = useFetcher( (callApmApi) => { - if (params.windowSize && params.windowUnit) { + const { interval, start, end } = getIntervalAndTimeRange({ + windowSize: params.windowSize, + windowUnit: params.windowUnit as TimeUnit, + }); + if (interval && start && end) { return callApmApi({ endpoint: 'GET /api/apm/alerts/chart_preview/transaction_error_count', params: { query: { - ...getAbsoluteTimeRange(params.windowSize, params.windowUnit), environment: params.environment, serviceName: params.serviceName, + interval, + start, + end, }, }, }); @@ -75,6 +87,10 @@ export function ErrorCountAlertTrigger(props: Props) { ] ); + if (isNewApmRuleFromStackManagement(alertParams, metadata)) { + return ; + } + const fields = [ , ; + return ( + + ); } return ( diff --git a/x-pack/plugins/apm/public/components/alerting/helper.ts b/x-pack/plugins/apm/public/components/alerting/helper.ts index 7a8f128e41564..b3dac5c2643db 100644 --- a/x-pack/plugins/apm/public/components/alerting/helper.ts +++ b/x-pack/plugins/apm/public/components/alerting/helper.ts @@ -4,8 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -import datemath from '@elastic/datemath'; +import moment from 'moment'; export interface AlertMetadata { environment: string; @@ -15,12 +14,36 @@ export interface AlertMetadata { end?: string; } -export function getAbsoluteTimeRange(windowSize: number, windowUnit: string) { - const now = new Date().toISOString(); +export type TimeUnit = 's' | 'm' | 'h' | 'd'; + +const BUCKET_SIZE = 20; + +export function getIntervalAndTimeRange({ + windowSize, + windowUnit, +}: { + windowSize: number; + windowUnit: TimeUnit; +}) { + const end = Date.now(); + const start = + end - + moment.duration(windowSize, windowUnit).asMilliseconds() * BUCKET_SIZE; return { - start: - datemath.parse(`now-${windowSize}${windowUnit}`)?.toISOString() ?? now, - end: now, + interval: `${windowSize}${windowUnit}`, + start: new Date(start).toISOString(), + end: new Date(end).toISOString(), }; } + +export function isNewApmRuleFromStackManagement( + alertParams: any, + metadata?: AlertMetadata +) { + return ( + alertParams !== undefined && + Object.keys(alertParams).length === 0 && + metadata === undefined + ); +} diff --git a/x-pack/plugins/apm/public/components/alerting/new_alert_empty_prompt.tsx b/x-pack/plugins/apm/public/components/alerting/new_alert_empty_prompt.tsx new file mode 100644 index 0000000000000..4777da7871b68 --- /dev/null +++ b/x-pack/plugins/apm/public/components/alerting/new_alert_empty_prompt.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. + */ + +/* eslint-disable @elastic/eui/href-or-on-click */ + +import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React, { MouseEvent } from 'react'; +import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; + +export function NewAlertEmptyPrompt() { + const { services } = useKibana(); + const apmUrl = services.http?.basePath.prepend('/app/apm'); + const navigateToUrl = services.application?.navigateToUrl; + const handleClick = (event: MouseEvent) => { + event.preventDefault(); + if (apmUrl && navigateToUrl) { + navigateToUrl(apmUrl); + } + }; + + return ( + + {i18n.translate('xpack.apm.NewAlertEmptyPrompt.goToApmLinkText', { + defaultMessage: 'Go to APM', + })} + , + ]} + /> + ); +} diff --git a/x-pack/plugins/apm/public/components/alerting/transaction_duration_alert_trigger/index.tsx b/x-pack/plugins/apm/public/components/alerting/transaction_duration_alert_trigger/index.tsx index 2a73cba0a63d5..dbbb7186de65c 100644 --- a/x-pack/plugins/apm/public/components/alerting/transaction_duration_alert_trigger/index.tsx +++ b/x-pack/plugins/apm/public/components/alerting/transaction_duration_alert_trigger/index.tsx @@ -9,10 +9,10 @@ import { EuiSelect } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { defaults, map, omit } from 'lodash'; import React from 'react'; -import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { CoreStart } from '../../../../../../../src/core/public'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; import { ForLastExpression } from '../../../../../triggers_actions_ui/public'; +import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { getDurationFormatter } from '../../../../common/utils/formatters'; import { useServiceTransactionTypesFetcher } from '../../../context/apm_service/use_service_transaction_types_fetcher'; import { useEnvironmentsFetcher } from '../../../hooks/use_environments_fetcher'; @@ -29,7 +29,13 @@ import { ServiceField, TransactionTypeField, } from '../fields'; -import { AlertMetadata, getAbsoluteTimeRange } from '../helper'; +import { + AlertMetadata, + getIntervalAndTimeRange, + isNewApmRuleFromStackManagement, + TimeUnit, +} from '../helper'; +import { NewAlertEmptyPrompt } from '../new_alert_empty_prompt'; import { ServiceAlertTrigger } from '../service_alert_trigger'; import { PopoverExpression } from '../service_alert_trigger/popover_expression'; @@ -77,9 +83,11 @@ export function TransactionDurationAlertTrigger(props: Props) { createCallApmApi(services as CoreStart); - const transactionTypes = useServiceTransactionTypesFetcher( - metadata?.serviceName - ); + const transactionTypes = useServiceTransactionTypesFetcher({ + serviceName: metadata?.serviceName, + start: metadata?.start, + end: metadata?.end, + }); const params = defaults( { @@ -104,16 +112,22 @@ export function TransactionDurationAlertTrigger(props: Props) { const { data } = useFetcher( (callApmApi) => { - if (params.windowSize && params.windowUnit) { + const { interval, start, end } = getIntervalAndTimeRange({ + windowSize: params.windowSize, + windowUnit: params.windowUnit as TimeUnit, + }); + if (interval && start && end) { return callApmApi({ endpoint: 'GET /api/apm/alerts/chart_preview/transaction_duration', params: { query: { - ...getAbsoluteTimeRange(params.windowSize, params.windowUnit), aggregationType: params.aggregationType, environment: params.environment, serviceName: params.serviceName, transactionType: params.transactionType, + interval, + start, + end, }, }, }); @@ -146,6 +160,10 @@ export function TransactionDurationAlertTrigger(props: Props) { /> ); + if (isNewApmRuleFromStackManagement(alertParams, metadata)) { + return ; + } + if (!params.serviceName) { return null; } diff --git a/x-pack/plugins/apm/public/components/alerting/transaction_duration_anomaly_alert_trigger/index.tsx b/x-pack/plugins/apm/public/components/alerting/transaction_duration_anomaly_alert_trigger/index.tsx index 519b18cd3a6b6..7b3c30da44c08 100644 --- a/x-pack/plugins/apm/public/components/alerting/transaction_duration_anomaly_alert_trigger/index.tsx +++ b/x-pack/plugins/apm/public/components/alerting/transaction_duration_anomaly_alert_trigger/index.tsx @@ -17,7 +17,8 @@ import { ServiceField, TransactionTypeField, } from '../fields'; -import { AlertMetadata } from '../helper'; +import { AlertMetadata, isNewApmRuleFromStackManagement } from '../helper'; +import { NewAlertEmptyPrompt } from '../new_alert_empty_prompt'; import { ServiceAlertTrigger } from '../service_alert_trigger'; import { PopoverExpression } from '../service_alert_trigger/popover_expression'; import { @@ -48,9 +49,11 @@ interface Props { export function TransactionDurationAnomalyAlertTrigger(props: Props) { const { alertParams, metadata, setAlertParams, setAlertProperty } = props; - const transactionTypes = useServiceTransactionTypesFetcher( - metadata?.serviceName - ); + const transactionTypes = useServiceTransactionTypesFetcher({ + serviceName: metadata?.serviceName, + start: metadata?.start, + end: metadata?.end, + }); const params = defaults( { @@ -71,6 +74,10 @@ export function TransactionDurationAnomalyAlertTrigger(props: Props) { end: metadata?.end, }); + if (isNewApmRuleFromStackManagement(alertParams, metadata)) { + return ; + } + const fields = [ , { - if (params.windowSize && params.windowUnit) { + const { interval, start, end } = getIntervalAndTimeRange({ + windowSize: params.windowSize, + windowUnit: params.windowUnit as TimeUnit, + }); + if (interval && start && end) { return callApmApi({ endpoint: 'GET /api/apm/alerts/chart_preview/transaction_error_rate', params: { query: { - ...getAbsoluteTimeRange(params.windowSize, params.windowUnit), environment: params.environment, serviceName: params.serviceName, transactionType: params.transactionType, + interval, + start, + end, }, }, }); @@ -95,6 +108,10 @@ export function TransactionErrorRateAlertTrigger(props: Props) { ] ); + if (isNewApmRuleFromStackManagement(alertParams, metadata)) { + return ; + } + const fields = [ , diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/RumDashboard.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/RumDashboard.tsx index a182de8540f58..4ed011441c81b 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/RumDashboard.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/RumDashboard.tsx @@ -11,11 +11,11 @@ import { UXMetrics } from './UXMetrics'; import { ImpactfulMetrics } from './ImpactfulMetrics'; import { PageLoadAndViews } from './Panels/PageLoadAndViews'; import { VisitorBreakdownsPanel } from './Panels/VisitorBreakdowns'; -import { useBreakPoints } from '../../../hooks/use_break_points'; +import { useBreakpoints } from '../../../hooks/use_breakpoints'; import { ClientMetrics } from './ClientMetrics'; export function RumDashboard() { - const { isSmall } = useBreakPoints(); + const { isSmall } = useBreakpoints(); return ( diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/RumHome.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/RumHome.tsx index 487d477485ce1..0371f7eb669e5 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/RumHome.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/RumHome.tsx @@ -15,23 +15,52 @@ import { DatePicker } from '../../shared/DatePicker'; import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; import { UxEnvironmentFilter } from '../../shared/EnvironmentFilter'; import { UserPercentile } from './UserPercentile'; -import { useBreakPoints } from '../../../hooks/use_break_points'; +import { useBreakpoints } from '../../../hooks/use_breakpoints'; +import { KibanaPageTemplateProps } from '../../../../../../../src/plugins/kibana_react/public'; +import { useHasRumData } from './hooks/useHasRumData'; export const UX_LABEL = i18n.translate('xpack.apm.ux.title', { defaultMessage: 'Dashboard', }); export function RumHome() { - const { observability } = useApmPluginContext(); + const { core, observability } = useApmPluginContext(); const PageTemplateComponent = observability.navigation.PageTemplate; - const { isSmall, isXXL } = useBreakPoints(); + const { isSmall, isXXL } = useBreakpoints(); + + const { data: rumHasData } = useHasRumData(); const envStyle = isSmall ? {} : { maxWidth: 500 }; + const noDataConfig: KibanaPageTemplateProps['noDataConfig'] = !rumHasData?.hasData + ? { + solution: i18n.translate('xpack.apm.ux.overview.solutionName', { + defaultMessage: 'Observability', + }), + actions: { + beats: { + title: i18n.translate('xpack.apm.ux.overview.beatsCard.title', { + defaultMessage: 'Add RUM data', + }), + description: i18n.translate( + 'xpack.apm.ux.overview.beatsCard.description', + { + defaultMessage: + 'Use the RUM (JS) agent to collect user experience data.', + } + ), + href: core.http.basePath.prepend(`/app/home#/tutorial/apm`), + }, + }, + docsLink: core.docLinks.links.observability.guide, + } + : undefined; + return ( { diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/hooks/useHasRumData.ts b/x-pack/plugins/apm/public/components/app/RumDashboard/hooks/useHasRumData.ts new file mode 100644 index 0000000000000..170ecc235aa6c --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/hooks/useHasRumData.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 { useFetcher } from '../../../../hooks/use_fetcher'; + +export function useHasRumData() { + return useFetcher((callApmApi) => { + return callApmApi({ + endpoint: 'GET /api/apm/observability_overview/has_rum_data', + }); + }, []); +} diff --git a/x-pack/plugins/apm/public/components/app/Settings/agent_configurations/List/index.tsx b/x-pack/plugins/apm/public/components/app/Settings/agent_configurations/List/index.tsx index 140584a625b90..3ab5c25ed3dc9 100644 --- a/x-pack/plugins/apm/public/components/app/Settings/agent_configurations/List/index.tsx +++ b/x-pack/plugins/apm/public/components/app/Settings/agent_configurations/List/index.tsx @@ -12,6 +12,7 @@ import { EuiEmptyPrompt, EuiHealth, EuiToolTip, + RIGHT_ALIGNMENT, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { isEmpty } from 'lodash'; @@ -180,7 +181,7 @@ export function AgentConfigurationList({ render: (_, { service }) => getOptionLabel(service.environment), }, { - align: 'right', + align: RIGHT_ALIGNMENT, field: '@timestamp', name: i18n.translate( 'xpack.apm.agentConfig.configTable.lastUpdatedColumnLabel', diff --git a/x-pack/plugins/apm/public/components/app/Settings/anomaly_detection/jobs_list.tsx b/x-pack/plugins/apm/public/components/app/Settings/anomaly_detection/jobs_list.tsx index 81a0da9792830..7aafb27aa18f3 100644 --- a/x-pack/plugins/apm/public/components/app/Settings/anomaly_detection/jobs_list.tsx +++ b/x-pack/plugins/apm/public/components/app/Settings/anomaly_detection/jobs_list.tsx @@ -12,6 +12,7 @@ import { EuiSpacer, EuiText, EuiTitle, + RIGHT_ALIGNMENT, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; @@ -38,7 +39,7 @@ const columns: Array> = [ }, { field: 'job_id', - align: 'right', + align: RIGHT_ALIGNMENT, name: i18n.translate( 'xpack.apm.settings.anomalyDetection.jobList.actionColumnLabel', { defaultMessage: 'Action' } diff --git a/x-pack/plugins/apm/public/components/app/Settings/customize_ui/custom_link/create_edit_custom_link_flyout/Documentation.tsx b/x-pack/plugins/apm/public/components/app/Settings/customize_ui/custom_link/create_edit_custom_link_flyout/Documentation.tsx index 58bcd756582a4..95f7cc871bcb3 100644 --- a/x-pack/plugins/apm/public/components/app/Settings/customize_ui/custom_link/create_edit_custom_link_flyout/Documentation.tsx +++ b/x-pack/plugins/apm/public/components/app/Settings/customize_ui/custom_link/create_edit_custom_link_flyout/Documentation.tsx @@ -6,19 +6,14 @@ */ import React from 'react'; -import { ElasticDocsLink } from '../../../../../shared/Links/ElasticDocsLink'; +import { EuiLink } from '@elastic/eui'; +import { useApmPluginContext } from '../../../../../../context/apm_plugin/use_apm_plugin_context'; interface Props { label: string; } + export function Documentation({ label }: Props) { - return ( - - {label} - - ); + const { docLinks } = useApmPluginContext().core; + return {label}; } diff --git a/x-pack/plugins/apm/public/components/app/Settings/customize_ui/custom_link/custom_link_table.tsx b/x-pack/plugins/apm/public/components/app/Settings/customize_ui/custom_link/custom_link_table.tsx index 86a7a8742eaea..a5134058a349d 100644 --- a/x-pack/plugins/apm/public/components/app/Settings/customize_ui/custom_link/custom_link_table.tsx +++ b/x-pack/plugins/apm/public/components/app/Settings/customize_ui/custom_link/custom_link_table.tsx @@ -11,6 +11,7 @@ import { EuiFlexItem, EuiSpacer, EuiText, + RIGHT_ALIGNMENT, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { isEmpty } from 'lodash'; @@ -50,7 +51,7 @@ export function CustomLinkTable({ items = [], onCustomLinkSelected }: Props) { }, { width: '160px', - align: 'right', + align: RIGHT_ALIGNMENT, field: '@timestamp', name: i18n.translate( 'xpack.apm.settings.customizeUI.customLink.table.lastUpdated', diff --git a/x-pack/plugins/apm/public/components/app/TraceLink/index.tsx b/x-pack/plugins/apm/public/components/app/TraceLink/index.tsx index 36ebb239fd7dd..2733ee0ddbdba 100644 --- a/x-pack/plugins/apm/public/components/app/TraceLink/index.tsx +++ b/x-pack/plugins/apm/public/components/app/TraceLink/index.tsx @@ -23,7 +23,7 @@ export function TraceLink() { const { path: { traceId }, query: { rangeFrom, rangeTo }, - } = useApmParams('/link-to/trace/:traceId'); + } = useApmParams('/link-to/trace/{traceId}'); const { data = { transaction: null }, status } = useFetcher( (callApmApi) => { diff --git a/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_detail_dependencies_table.tsx b/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_detail_dependencies_table.tsx index 4812d17183c5f..f98358e3a9c27 100644 --- a/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_detail_dependencies_table.tsx +++ b/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_detail_dependencies_table.tsx @@ -24,7 +24,7 @@ export function BackendDetailDependenciesTable() { const { query: { rangeFrom, rangeTo, kuery, environment }, - } = useApmParams('/backends/:backendName/overview'); + } = useApmParams('/backends/{backendName}/overview'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_error_rate_chart.tsx b/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_error_rate_chart.tsx index 16ab5cefdc658..d48178a8522be 100644 --- a/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_error_rate_chart.tsx +++ b/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_error_rate_chart.tsx @@ -31,7 +31,7 @@ export function BackendFailedTransactionRateChart({ const { query: { kuery, environment, rangeFrom, rangeTo }, - } = useApmParams('/backends/:backendName/overview'); + } = useApmParams('/backends/{backendName}/overview'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_latency_chart.tsx b/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_latency_chart.tsx index 99f46e77b60f1..759d153988875 100644 --- a/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_latency_chart.tsx +++ b/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_latency_chart.tsx @@ -27,7 +27,7 @@ export function BackendLatencyChart({ height }: { height: number }) { const { query: { rangeFrom, rangeTo, kuery, environment }, - } = useApmParams('/backends/:backendName/overview'); + } = useApmParams('/backends/{backendName}/overview'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_throughput_chart.tsx b/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_throughput_chart.tsx index ba4bdafe94bdf..2cfc7ea317628 100644 --- a/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_throughput_chart.tsx +++ b/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_throughput_chart.tsx @@ -23,7 +23,7 @@ export function BackendThroughputChart({ height }: { height: number }) { const { query: { rangeFrom, rangeTo, kuery, environment }, - } = useApmParams('/backends/:backendName/overview'); + } = useApmParams('/backends/{backendName}/overview'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/plugins/apm/public/components/app/backend_detail_overview/index.tsx b/x-pack/plugins/apm/public/components/app/backend_detail_overview/index.tsx index 2c9ec0a232974..16120a6f5b429 100644 --- a/x-pack/plugins/apm/public/components/app/backend_detail_overview/index.tsx +++ b/x-pack/plugins/apm/public/components/app/backend_detail_overview/index.tsx @@ -27,13 +27,13 @@ import { getKueryBarBoolFilter, kueryBarPlaceholder, } from '../../../../common/backends'; -import { useBreakPoints } from '../../../hooks/use_break_points'; +import { useBreakpoints } from '../../../hooks/use_breakpoints'; export function BackendDetailOverview() { const { path: { backendName }, query: { rangeFrom, rangeTo, environment, kuery }, - } = useApmParams('/backends/:backendName/overview'); + } = useApmParams('/backends/{backendName}/overview'); const apmRouter = useApmRouter(); @@ -46,7 +46,7 @@ export function BackendDetailOverview() { }, { title: backendName, - href: apmRouter.link('/backends/:backendName/overview', { + href: apmRouter.link('/backends/{backendName}/overview', { path: { backendName }, query: { rangeFrom, @@ -63,7 +63,7 @@ export function BackendDetailOverview() { backendName, }); - const largeScreenOrSmaller = useBreakPoints().isLarge; + const largeScreenOrSmaller = useBreakpoints().isLarge; return ( diff --git a/x-pack/plugins/apm/public/components/app/correlations/correlations_table.tsx b/x-pack/plugins/apm/public/components/app/correlations/correlations_table.tsx index f7e62b76a61c0..adf1805e0b9ae 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/correlations_table.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/correlations_table.tsx @@ -14,28 +14,23 @@ import type { Criteria } from '@elastic/eui/src/components/basic_table/basic_tab import { FETCH_STATUS } from '../../../hooks/use_fetcher'; import { useUiTracker } from '../../../../../observability/public'; import { useTheme } from '../../../hooks/use_theme'; -import type { CorrelationsTerm } from '../../../../common/search_strategies/failure_correlations/types'; +import type { FieldValuePair } from '../../../../common/search_strategies/types'; const PAGINATION_SIZE_OPTIONS = [5, 10, 20, 50]; -export type SelectedCorrelationTerm = Pick< - T, - 'fieldName' | 'fieldValue' ->; - -interface Props { +interface CorrelationsTableProps { significantTerms?: T[]; status: FETCH_STATUS; percentageColumnName?: string; setSelectedSignificantTerm: (term: T | null) => void; - selectedTerm?: { fieldName: string; fieldValue: string }; + selectedTerm?: FieldValuePair; onFilter?: () => void; columns: Array>; onTableChange: (c: Criteria) => void; sorting?: EuiTableSortingType; } -export function CorrelationsTable({ +export function CorrelationsTable({ significantTerms, status, setSelectedSignificantTerm, @@ -43,7 +38,7 @@ export function CorrelationsTable({ selectedTerm, onTableChange, sorting, -}: Props) { +}: CorrelationsTableProps) { const euiTheme = useTheme(); const trackApmEvent = useUiTracker({ app: 'apm' }); const trackSelectSignificantCorrelationTerm = useCallback( @@ -92,6 +87,7 @@ export function CorrelationsTable({ status === FETCH_STATUS.LOADING ? loadingText : noDataText } loading={status === FETCH_STATUS.LOADING} + error={status === FETCH_STATUS.FAILURE ? errorMessage : ''} columns={columns} rowProps={(term) => { return { @@ -126,3 +122,8 @@ const noDataText = i18n.translate( 'xpack.apm.correlations.correlationsTable.noDataText', { defaultMessage: 'No data' } ); + +const errorMessage = i18n.translate( + 'xpack.apm.correlations.correlationsTable.errorMessage', + { defaultMessage: 'Failed to fetch' } +); diff --git a/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx b/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx index 4fb7bf5d6fcfb..2c911c9aa962e 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx @@ -6,6 +6,9 @@ */ import React, { useCallback, useEffect, useMemo, useState } from 'react'; +import { useHistory } from 'react-router-dom'; +import { orderBy } from 'lodash'; + import { EuiBasicTableColumn, EuiFlexGroup, @@ -17,34 +20,45 @@ import { EuiBetaBadge, EuiBadge, EuiToolTip, + RIGHT_ALIGNMENT, } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { useHistory } from 'react-router-dom'; -import { orderBy } from 'lodash'; import type { EuiTableSortingType } from '@elastic/eui/src/components/basic_table/table_types'; import type { Direction } from '@elastic/eui/src/services/sort/sort_direction'; -import { useUrlParams } from '../../../context/url_params_context/use_url_params'; + +import { i18n } from '@kbn/i18n'; +import { + enableInspectEsQueries, + useUiTracker, +} from '../../../../../observability/public'; + +import { asPercent } from '../../../../common/utils/formatters'; +import { FailedTransactionsCorrelation } from '../../../../common/search_strategies/failed_transactions_correlations/types'; +import { + APM_SEARCH_STRATEGIES, + DEFAULT_PERCENTILE_THRESHOLD, +} from '../../../../common/search_strategies/constants'; + import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; +import { FETCH_STATUS } from '../../../hooks/use_fetcher'; +import { useSearchStrategy } from '../../../hooks/use_search_strategy'; + +import { ImpactBar } from '../../shared/ImpactBar'; +import { createHref, push } from '../../shared/Links/url_helpers'; +import { Summary } from '../../shared/Summary'; + import { CorrelationsTable } from './correlations_table'; -import { enableInspectEsQueries } from '../../../../../observability/public'; -import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context'; import { FailedTransactionsCorrelationsHelpPopover } from './failed_transactions_correlations_help_popover'; -import { ImpactBar } from '../../shared/ImpactBar'; import { isErrorMessage } from './utils/is_error_message'; -import { FETCH_STATUS } from '../../../hooks/use_fetcher'; import { getFailedTransactionsCorrelationImpactLabel } from './utils/get_failed_transactions_correlation_impact_label'; -import { createHref, push } from '../../shared/Links/url_helpers'; -import { useUiTracker } from '../../../../../observability/public'; -import { useFailedTransactionsCorrelationsFetcher } from '../../../hooks/use_failed_transactions_correlations_fetcher'; -import { useApmParams } from '../../../hooks/use_apm_params'; +import { getOverallHistogram } from './utils/get_overall_histogram'; +import { + TransactionDistributionChart, + TransactionDistributionChartData, +} from '../../shared/charts/transaction_distribution_chart'; import { CorrelationsLog } from './correlations_log'; import { CorrelationsEmptyStatePrompt } from './empty_state_prompt'; import { CrossClusterSearchCompatibilityWarning } from './cross_cluster_search_warning'; import { CorrelationsProgressControls } from './progress_controls'; -import type { FailedTransactionsCorrelationValue } from '../../../../common/search_strategies/failure_correlations/types'; -import { Summary } from '../../shared/Summary'; -import { asPercent } from '../../../../common/utils/formatters'; -import { useTimeRange } from '../../../hooks/use_time_range'; export function FailedTransactionsCorrelations({ onFilter, @@ -56,80 +70,44 @@ export function FailedTransactionsCorrelations({ } = useApmPluginContext(); const trackApmEvent = useUiTracker({ app: 'apm' }); - const { serviceName, transactionType } = useApmServiceContext(); - - const { - query: { kuery, environment, rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName'); - - const { urlParams } = useUrlParams(); - const { transactionName } = urlParams; - - const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - const inspectEnabled = uiSettings.get(enableInspectEsQueries); - const result = useFailedTransactionsCorrelationsFetcher(); - - const { - ccsWarning, - log, - error, - isRunning, - progress, - startFetch, - cancelFetch, - } = result; - - const startFetchHandler = useCallback(() => { - startFetch({ - environment, - kuery, - serviceName, - transactionName, - transactionType, - start, - end, - }); - }, [ - startFetch, - environment, - serviceName, - transactionName, - transactionType, - kuery, - start, - end, - ]); - - useEffect(() => { - startFetchHandler(); - return cancelFetch; - }, [cancelFetch, startFetchHandler]); + const { progress, response, startFetch, cancelFetch } = useSearchStrategy( + APM_SEARCH_STRATEGIES.APM_FAILED_TRANSACTIONS_CORRELATIONS, + { + percentileThreshold: DEFAULT_PERCENTILE_THRESHOLD, + } + ); + const progressNormalized = progress.loaded / progress.total; + const { overallHistogram, hasData, status } = getOverallHistogram( + response, + progress.isRunning + ); const [ selectedSignificantTerm, setSelectedSignificantTerm, - ] = useState(null); + ] = useState(null); - const selectedTerm = useMemo(() => { - if (selectedSignificantTerm) return selectedSignificantTerm; - return result?.values && - Array.isArray(result.values) && - result.values.length > 0 - ? result?.values[0] - : undefined; - }, [selectedSignificantTerm, result]); + const selectedTerm = + selectedSignificantTerm ?? response.failedTransactionsCorrelations?.[0]; const history = useHistory(); const failedTransactionsCorrelationsColumns: Array< - EuiBasicTableColumn + EuiBasicTableColumn > = useMemo(() => { const percentageColumns: Array< - EuiBasicTableColumn + EuiBasicTableColumn > = inspectEnabled ? [ + { + width: '100px', + field: 'pValue', + name: 'p-value', + render: (pValue: number) => pValue.toPrecision(3), + sortable: true, + }, { width: '100px', field: 'failurePercentage', @@ -159,7 +137,7 @@ export function FailedTransactionsCorrelations({ ), - render: (failurePercentage: number) => + render: (_, { failurePercentage }) => asPercent(failurePercentage, 1), sortable: true, }, @@ -193,7 +171,7 @@ export function FailedTransactionsCorrelations({ ), - render: (successPercentage: number) => + render: (_, { successPercentage }) => asPercent(successPercentage, 1), sortable: true, }, @@ -201,7 +179,7 @@ export function FailedTransactionsCorrelations({ : []; return [ { - width: '80px', + width: '116px', field: 'normalizedScore', name: ( <> @@ -213,7 +191,8 @@ export function FailedTransactionsCorrelations({ )} ), - render: (normalizedScore: number) => { + align: RIGHT_ALIGNMENT, + render: (_, { normalizedScore }) => { return ( <> @@ -235,7 +214,7 @@ export function FailedTransactionsCorrelations({ )} ), - render: (pValue: number) => { + render: (_, { pValue }) => { const label = getFailedTransactionsCorrelationImpactLabel(pValue); return label ? ( {label.impact} @@ -252,12 +231,12 @@ export function FailedTransactionsCorrelations({ sortable: true, }, { - field: 'key', + field: 'fieldValue', name: i18n.translate( 'xpack.apm.correlations.failedTransactions.correlationsTable.fieldValueLabel', { defaultMessage: 'Field value' } ), - render: (fieldValue: string) => String(fieldValue).slice(0, 50), + render: (_, { fieldValue }) => String(fieldValue).slice(0, 50), sortable: true, }, ...percentageColumns, @@ -275,7 +254,7 @@ export function FailedTransactionsCorrelations({ ), icon: 'plusInCircle', type: 'icon', - onClick: (term: FailedTransactionsCorrelationValue) => { + onClick: (term: FailedTransactionsCorrelation) => { push(history, { query: { kuery: `${term.fieldName}:"${term.fieldValue}"`, @@ -296,7 +275,7 @@ export function FailedTransactionsCorrelations({ ), icon: 'minusInCircle', type: 'icon', - onClick: (term: FailedTransactionsCorrelationValue) => { + onClick: (term: FailedTransactionsCorrelation) => { push(history, { query: { kuery: `not ${term.fieldName}:"${term.fieldValue}"`, @@ -311,13 +290,13 @@ export function FailedTransactionsCorrelations({ 'xpack.apm.correlations.correlationsTable.actionsLabel', { defaultMessage: 'Filter' } ), - render: (_: unknown, term: FailedTransactionsCorrelationValue) => { + render: (_, { fieldName, fieldValue }) => { return ( <> @@ -327,7 +306,7 @@ export function FailedTransactionsCorrelations({ @@ -337,11 +316,11 @@ export function FailedTransactionsCorrelations({ ); }, }, - ] as Array>; + ] as Array>; }, [history, onFilter, trackApmEvent, inspectEnabled]); useEffect(() => { - if (isErrorMessage(error)) { + if (isErrorMessage(progress.error)) { notifications.toasts.addDanger({ title: i18n.translate( 'xpack.apm.correlations.failedTransactions.errorTitle', @@ -350,13 +329,13 @@ export function FailedTransactionsCorrelations({ 'An error occurred performing correlations on failed transactions', } ), - text: error.toString(), + text: progress.error.toString(), }); } - }, [error, notifications.toasts]); + }, [progress.error, notifications.toasts]); const [sortField, setSortField] = useState< - keyof FailedTransactionsCorrelationValue + keyof FailedTransactionsCorrelation >('normalizedScore'); const [sortDirection, setSortDirection] = useState('desc'); @@ -367,28 +346,61 @@ export function FailedTransactionsCorrelations({ setSortDirection(currentSortDirection); }, []); - const { sorting, correlationTerms } = useMemo(() => { - if (!Array.isArray(result.values)) { - return { correlationTerms: [], sorting: undefined }; - } - const orderedTerms = orderBy( - result.values, - // The smaller the p value the higher the impact - // So we want to sort by the normalized score here - // which goes from 0 -> 1 - sortField === 'pValue' ? 'normalizedScore' : sortField, - sortDirection - ); - return { - correlationTerms: orderedTerms, - sorting: { - sort: { - field: sortField, - direction: sortDirection, - }, - } as EuiTableSortingType, - }; - }, [result?.values, sortField, sortDirection]); + const sorting: EuiTableSortingType = { + sort: { field: sortField, direction: sortDirection }, + }; + + const correlationTerms = useMemo( + () => + orderBy( + response.failedTransactionsCorrelations, + // The smaller the p value the higher the impact + // So we want to sort by the normalized score here + // which goes from 0 -> 1 + sortField === 'pValue' ? 'normalizedScore' : sortField, + sortDirection + ), + [response.failedTransactionsCorrelations, sortField, sortDirection] + ); + + const showCorrelationsTable = + progress.isRunning || correlationTerms.length > 0; + + const showCorrelationsEmptyStatePrompt = + correlationTerms.length < 1 && + (progressNormalized === 1 || !progress.isRunning); + + const showSummaryBadge = + inspectEnabled && (progress.isRunning || correlationTerms.length > 0); + + const transactionDistributionChartData: TransactionDistributionChartData[] = []; + + if (Array.isArray(overallHistogram)) { + transactionDistributionChartData.push({ + id: i18n.translate( + 'xpack.apm.transactionDistribution.chart.allTransactionsLabel', + { defaultMessage: 'All transactions' } + ), + histogram: overallHistogram, + }); + } + + if (Array.isArray(response.errorHistogram)) { + transactionDistributionChartData.push({ + id: i18n.translate( + 'xpack.apm.transactionDistribution.chart.allFailedTransactionsLabel', + { defaultMessage: 'All failed transactions' } + ), + histogram: response.errorHistogram, + }); + } + + if (selectedTerm && Array.isArray(selectedTerm.histogram)) { + transactionDistributionChartData.push({ + id: `${selectedTerm.fieldName}:${selectedTerm.fieldValue}`, + histogram: selectedTerm.histogram, + }); + } return (
@@ -403,7 +415,7 @@ export function FailedTransactionsCorrelations({ {i18n.translate( 'xpack.apm.correlations.failedTransactions.panelTitle', { - defaultMessage: 'Failed transactions', + defaultMessage: 'Failed transactions latency distribution', } )} @@ -442,6 +454,16 @@ export function FailedTransactionsCorrelations({ + + + + {i18n.translate( @@ -456,54 +478,53 @@ export function FailedTransactionsCorrelations({ - {ccsWarning && ( + {response.ccsWarning && ( <> + {/* Failed transactions correlations uses ES aggs that are available since 7.15 */} )} - {inspectEnabled && - selectedTerm?.pValue != null && - (isRunning || correlationTerms.length > 0) ? ( + {showSummaryBadge && selectedTerm?.pValue && ( <> - {`${selectedTerm.fieldName}: ${selectedTerm.key}`} + {`${selectedTerm.fieldName}: ${selectedTerm.fieldValue}`} , <>{`p-value: ${selectedTerm.pValue.toPrecision(3)}`}, ]} /> - ) : null} + )}
- {(isRunning || correlationTerms.length > 0) && ( - + {showCorrelationsTable && ( + columns={failedTransactionsCorrelationsColumns} significantTerms={correlationTerms} - status={isRunning ? FETCH_STATUS.LOADING : FETCH_STATUS.SUCCESS} + status={ + progress.isRunning ? FETCH_STATUS.LOADING : FETCH_STATUS.SUCCESS + } setSelectedSignificantTerm={setSelectedSignificantTerm} selectedTerm={selectedTerm} onTableChange={onTableChange} sorting={sorting} /> )} - {correlationTerms.length < 1 && (progress === 1 || !isRunning) && ( - - )} + {showCorrelationsEmptyStatePrompt && }
- {inspectEnabled && } + {inspectEnabled && }
); } diff --git a/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations_help_popover.tsx b/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations_help_popover.tsx index e66101d619224..65f6f54ecf89e 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations_help_popover.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations_help_popover.tsx @@ -5,6 +5,7 @@ * 2.0. */ +import { EuiCode } from '@elastic/eui'; import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; @@ -36,7 +37,11 @@ export function FailedTransactionsCorrelationsHelpPopover() {

event.outcome, + value: failure, + }} />

diff --git a/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.test.tsx b/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.test.tsx index b0da5b6d60d74..c1fb1beb1918e 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.test.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.test.tsx @@ -18,7 +18,7 @@ import { dataPluginMock } from 'src/plugins/data/public/mocks'; import type { IKibanaSearchResponse } from 'src/plugins/data/public'; import { EuiThemeProvider } from 'src/plugins/kibana_react/common'; import { createKibanaReactContext } from 'src/plugins/kibana_react/public'; -import type { SearchServiceRawResponse } from '../../../../common/search_strategies/correlations/types'; +import type { LatencyCorrelationsRawResponse } from '../../../../common/search_strategies/latency_correlations/types'; import { MockUrlParamsContextProvider } from '../../../context/url_params_context/mock_url_params_context_provider'; import { ApmPluginContextValue } from '../../../context/apm_plugin/apm_plugin_context'; import { @@ -34,7 +34,7 @@ function Wrapper({ dataSearchResponse, }: { children?: ReactNode; - dataSearchResponse: IKibanaSearchResponse; + dataSearchResponse: IKibanaSearchResponse; }) { const mockDataSearch = jest.fn(() => of(dataSearchResponse)); @@ -97,7 +97,12 @@ describe('correlations', () => { @@ -115,7 +120,12 @@ describe('correlations', () => { diff --git a/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx b/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx index ad8a56a3ac6f9..44a1122298d59 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx @@ -7,6 +7,8 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { useHistory } from 'react-router-dom'; +import { orderBy } from 'lodash'; + import { EuiIcon, EuiBasicTableColumn, @@ -16,103 +18,64 @@ import { EuiTitle, EuiToolTip, } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; import { Direction } from '@elastic/eui/src/services/sort/sort_direction'; -import { orderBy } from 'lodash'; import { EuiTableSortingType } from '@elastic/eui/src/components/basic_table/table_types'; -import { useUrlParams } from '../../../context/url_params_context/use_url_params'; -import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; -import { FETCH_STATUS } from '../../../hooks/use_fetcher'; -import { useTransactionLatencyCorrelationsFetcher } from '../../../hooks/use_transaction_latency_correlations_fetcher'; -import { TransactionDistributionChart } from '../../shared/charts/transaction_distribution_chart'; -import { CorrelationsTable } from './correlations_table'; -import { push } from '../../shared/Links/url_helpers'; + +import { i18n } from '@kbn/i18n'; + import { enableInspectEsQueries, useUiTracker, } from '../../../../../observability/public'; + import { asPreciseDecimal } from '../../../../common/utils/formatters'; -import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context'; +import { + APM_SEARCH_STRATEGIES, + DEFAULT_PERCENTILE_THRESHOLD, +} from '../../../../common/search_strategies/constants'; +import { LatencyCorrelation } from '../../../../common/search_strategies/latency_correlations/types'; + +import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; +import { FETCH_STATUS } from '../../../hooks/use_fetcher'; +import { useSearchStrategy } from '../../../hooks/use_search_strategy'; + +import { + TransactionDistributionChart, + TransactionDistributionChartData, +} from '../../shared/charts/transaction_distribution_chart'; +import { push } from '../../shared/Links/url_helpers'; + +import { CorrelationsTable } from './correlations_table'; import { LatencyCorrelationsHelpPopover } from './latency_correlations_help_popover'; -import { useApmParams } from '../../../hooks/use_apm_params'; import { isErrorMessage } from './utils/is_error_message'; +import { getOverallHistogram } from './utils/get_overall_histogram'; import { CorrelationsLog } from './correlations_log'; import { CorrelationsEmptyStatePrompt } from './empty_state_prompt'; import { CrossClusterSearchCompatibilityWarning } from './cross_cluster_search_warning'; import { CorrelationsProgressControls } from './progress_controls'; -import { useTimeRange } from '../../../hooks/use_time_range'; - -const DEFAULT_PERCENTILE_THRESHOLD = 95; - -interface MlCorrelationsTerms { - correlation: number; - ksTest: number; - fieldName: string; - fieldValue: string; - duplicatedFields?: string[]; -} export function LatencyCorrelations({ onFilter }: { onFilter: () => void }) { const { core: { notifications, uiSettings }, } = useApmPluginContext(); - const { serviceName, transactionType } = useApmServiceContext(); - - const { - query: { kuery, environment, rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName/transactions/view'); - - const { urlParams } = useUrlParams(); - - const { transactionName } = urlParams; - - const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - const displayLog = uiSettings.get(enableInspectEsQueries); - const { - ccsWarning, - log, - error, - histograms, - percentileThresholdValue, - isRunning, - progress, - startFetch, - cancelFetch, - overallHistogram, - } = useTransactionLatencyCorrelationsFetcher(); - - const startFetchHandler = useCallback(() => { - startFetch({ - environment, - kuery, - serviceName, - transactionName, - transactionType, - start, - end, + const { progress, response, startFetch, cancelFetch } = useSearchStrategy( + APM_SEARCH_STRATEGIES.APM_LATENCY_CORRELATIONS, + { percentileThreshold: DEFAULT_PERCENTILE_THRESHOLD, - }); - }, [ - startFetch, - environment, - serviceName, - transactionName, - transactionType, - kuery, - start, - end, - ]); - - useEffect(() => { - startFetchHandler(); - return cancelFetch; - }, [cancelFetch, startFetchHandler]); + analyzeCorrelations: true, + } + ); + const progressNormalized = progress.loaded / progress.total; + const { overallHistogram, hasData, status } = getOverallHistogram( + response, + progress.isRunning + ); useEffect(() => { - if (isErrorMessage(error)) { + if (isErrorMessage(progress.error)) { notifications.toasts.addDanger({ title: i18n.translate( 'xpack.apm.correlations.latencyCorrelations.errorTitle', @@ -120,34 +83,31 @@ export function LatencyCorrelations({ onFilter }: { onFilter: () => void }) { defaultMessage: 'An error occurred fetching correlations', } ), - text: error.toString(), + text: progress.error.toString(), }); } - }, [error, notifications.toasts]); + }, [progress.error, notifications.toasts]); const [ selectedSignificantTerm, setSelectedSignificantTerm, - ] = useState(null); + ] = useState(null); - const selectedHistogram = useMemo(() => { - let selected = histograms.length > 0 ? histograms[0] : undefined; - - if (histograms.length > 0 && selectedSignificantTerm !== null) { - selected = histograms.find( + const selectedHistogram = useMemo( + () => + response.latencyCorrelations?.find( (h) => - h.field === selectedSignificantTerm.fieldName && - h.value === selectedSignificantTerm.fieldValue - ); - } - return selected; - }, [histograms, selectedSignificantTerm]); + h.fieldName === selectedSignificantTerm?.fieldName && + h.fieldValue === selectedSignificantTerm?.fieldValue + ) ?? response.latencyCorrelations?.[0], + [response.latencyCorrelations, selectedSignificantTerm] + ); const history = useHistory(); const trackApmEvent = useUiTracker({ app: 'apm' }); const mlCorrelationColumns: Array< - EuiBasicTableColumn + EuiBasicTableColumn > = useMemo( () => [ { @@ -179,7 +139,7 @@ export function LatencyCorrelations({ onFilter }: { onFilter: () => void }) { ), - render: (correlation: number) => { + render: (_, { correlation }) => { return

{asPreciseDecimal(correlation, 2)}
; }, sortable: true, @@ -198,7 +158,7 @@ export function LatencyCorrelations({ onFilter }: { onFilter: () => void }) { 'xpack.apm.correlations.latencyCorrelations.correlationsTable.fieldValueLabel', { defaultMessage: 'Field value' } ), - render: (fieldValue: string) => String(fieldValue).slice(0, 50), + render: (_, { fieldValue }) => String(fieldValue).slice(0, 50), sortable: true, }, { @@ -215,7 +175,7 @@ export function LatencyCorrelations({ onFilter }: { onFilter: () => void }) { ), icon: 'plusInCircle', type: 'icon', - onClick: (term: MlCorrelationsTerms) => { + onClick: (term: LatencyCorrelation) => { push(history, { query: { kuery: `${term.fieldName}:"${term.fieldValue}"`, @@ -236,7 +196,7 @@ export function LatencyCorrelations({ onFilter }: { onFilter: () => void }) { ), icon: 'minusInCircle', type: 'icon', - onClick: (term: MlCorrelationsTerms) => { + onClick: (term: LatencyCorrelation) => { push(history, { query: { kuery: `not ${term.fieldName}:"${term.fieldValue}"`, @@ -256,7 +216,7 @@ export function LatencyCorrelations({ onFilter }: { onFilter: () => void }) { [history, onFilter, trackApmEvent] ); - const [sortField, setSortField] = useState( + const [sortField, setSortField] = useState( 'correlation' ); const [sortDirection, setSortDirection] = useState('desc'); @@ -268,34 +228,38 @@ export function LatencyCorrelations({ onFilter }: { onFilter: () => void }) { setSortDirection(currentSortDirection); }, []); - const { histogramTerms, sorting } = useMemo(() => { - if (!Array.isArray(histograms)) { - return { histogramTerms: [], sorting: undefined }; - } - const orderedTerms = orderBy( - histograms.map((d) => { - return { - fieldName: d.field, - fieldValue: d.value, - ksTest: d.ksTest, - correlation: d.correlation, - duplicatedFields: d.duplicatedFields, - }; - }), - sortField, - sortDirection - ); - - return { - histogramTerms: orderedTerms, - sorting: { - sort: { - field: sortField, - direction: sortDirection, - }, - } as EuiTableSortingType, - }; - }, [histograms, sortField, sortDirection]); + const sorting: EuiTableSortingType = { + sort: { field: sortField, direction: sortDirection }, + }; + + const histogramTerms = useMemo( + () => orderBy(response.latencyCorrelations ?? [], sortField, sortDirection), + [response.latencyCorrelations, sortField, sortDirection] + ); + + const showCorrelationsTable = progress.isRunning || histogramTerms.length > 0; + const showCorrelationsEmptyStatePrompt = + histogramTerms.length < 1 && + (progressNormalized === 1 || !progress.isRunning); + + const transactionDistributionChartData: TransactionDistributionChartData[] = []; + + if (Array.isArray(overallHistogram)) { + transactionDistributionChartData.push({ + id: i18n.translate( + 'xpack.apm.transactionDistribution.chart.allTransactionsLabel', + { defaultMessage: 'All transactions' } + ), + histogram: overallHistogram, + }); + } + + if (selectedHistogram && Array.isArray(selectedHistogram.histogram)) { + transactionDistributionChartData.push({ + id: `${selectedHistogram.fieldName}:${selectedHistogram.fieldValue}`, + histogram: selectedHistogram.histogram, + }); + } return (
@@ -321,9 +285,10 @@ export function LatencyCorrelations({ onFilter }: { onFilter: () => void }) { @@ -342,15 +307,16 @@ export function LatencyCorrelations({ onFilter }: { onFilter: () => void }) { - {ccsWarning && ( + {response.ccsWarning && ( <> + {/* Latency correlations uses ES aggs that are available since 7.14 */} )} @@ -358,29 +324,22 @@ export function LatencyCorrelations({ onFilter }: { onFilter: () => void }) {
- {(isRunning || histogramTerms.length > 0) && ( - + {showCorrelationsTable && ( + columns={mlCorrelationColumns} significantTerms={histogramTerms} - status={isRunning ? FETCH_STATUS.LOADING : FETCH_STATUS.SUCCESS} - setSelectedSignificantTerm={setSelectedSignificantTerm} - selectedTerm={ - selectedHistogram !== undefined - ? { - fieldName: selectedHistogram.field, - fieldValue: selectedHistogram.value, - } - : undefined + status={ + progress.isRunning ? FETCH_STATUS.LOADING : FETCH_STATUS.SUCCESS } + setSelectedSignificantTerm={setSelectedSignificantTerm} + selectedTerm={selectedHistogram} onTableChange={onTableChange} sorting={sorting} /> )} - {histogramTerms.length < 1 && (progress === 1 || !isRunning) && ( - - )} + {showCorrelationsEmptyStatePrompt && }
- {displayLog && } + {displayLog && }
); } diff --git a/x-pack/plugins/apm/public/components/app/correlations/utils/get_failed_transactions_correlation_impact_label.test.ts b/x-pack/plugins/apm/public/components/app/correlations/utils/get_failed_transactions_correlation_impact_label.test.ts index edb7c8c16e267..e4c08b42b2420 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/utils/get_failed_transactions_correlation_impact_label.test.ts +++ b/x-pack/plugins/apm/public/components/app/correlations/utils/get_failed_transactions_correlation_impact_label.test.ts @@ -6,7 +6,7 @@ */ import { getFailedTransactionsCorrelationImpactLabel } from './get_failed_transactions_correlation_impact_label'; -import { FAILED_TRANSACTIONS_IMPACT_THRESHOLD } from '../../../../../common/search_strategies/failure_correlations/constants'; +import { FAILED_TRANSACTIONS_IMPACT_THRESHOLD } from '../../../../../common/search_strategies/failed_transactions_correlations/constants'; const EXPECTED_RESULT = { HIGH: { diff --git a/x-pack/plugins/apm/public/components/app/correlations/utils/get_failed_transactions_correlation_impact_label.ts b/x-pack/plugins/apm/public/components/app/correlations/utils/get_failed_transactions_correlation_impact_label.ts index 5a806aba5371e..cbfaee88ff6f4 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/utils/get_failed_transactions_correlation_impact_label.ts +++ b/x-pack/plugins/apm/public/components/app/correlations/utils/get_failed_transactions_correlation_impact_label.ts @@ -5,12 +5,22 @@ * 2.0. */ -import { FailureCorrelationImpactThreshold } from '../../../../../common/search_strategies/failure_correlations/types'; -import { FAILED_TRANSACTIONS_IMPACT_THRESHOLD } from '../../../../../common/search_strategies/failure_correlations/constants'; +import { + FailedTransactionsCorrelation, + FailedTransactionsCorrelationsImpactThreshold, +} from '../../../../../common/search_strategies/failed_transactions_correlations/types'; +import { FAILED_TRANSACTIONS_IMPACT_THRESHOLD } from '../../../../../common/search_strategies/failed_transactions_correlations/constants'; export function getFailedTransactionsCorrelationImpactLabel( - pValue: number -): { impact: FailureCorrelationImpactThreshold; color: string } | null { + pValue: FailedTransactionsCorrelation['pValue'] +): { + impact: FailedTransactionsCorrelationsImpactThreshold; + color: string; +} | null { + if (pValue === null) { + return null; + } + // The lower the p value, the higher the impact if (pValue >= 0 && pValue < 1e-6) return { diff --git a/x-pack/plugins/apm/public/components/app/correlations/utils/get_overall_histogram.test.ts b/x-pack/plugins/apm/public/components/app/correlations/utils/get_overall_histogram.test.ts new file mode 100644 index 0000000000000..c323b69594013 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/correlations/utils/get_overall_histogram.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 type { LatencyCorrelationsRawResponse } from '../../../../../common/search_strategies/latency_correlations/types'; + +import { getOverallHistogram } from './get_overall_histogram'; + +describe('getOverallHistogram', () => { + it('returns "loading" when undefined and running', () => { + const { overallHistogram, hasData, status } = getOverallHistogram( + {} as LatencyCorrelationsRawResponse, + true + ); + expect(overallHistogram).toStrictEqual(undefined); + expect(hasData).toBe(false); + expect(status).toBe('loading'); + }); + + it('returns "success" when undefined and not running', () => { + const { overallHistogram, hasData, status } = getOverallHistogram( + {} as LatencyCorrelationsRawResponse, + false + ); + expect(overallHistogram).toStrictEqual([]); + expect(hasData).toBe(false); + expect(status).toBe('success'); + }); + + it('returns "success" when not undefined and still running', () => { + const { overallHistogram, hasData, status } = getOverallHistogram( + { + overallHistogram: [{ key: 1, doc_count: 1234 }], + } as LatencyCorrelationsRawResponse, + true + ); + expect(overallHistogram).toStrictEqual([{ key: 1, doc_count: 1234 }]); + expect(hasData).toBe(true); + expect(status).toBe('success'); + }); + + it('returns "success" when not undefined and not running', () => { + const { overallHistogram, hasData, status } = getOverallHistogram( + { + overallHistogram: [{ key: 1, doc_count: 1234 }], + } as LatencyCorrelationsRawResponse, + false + ); + expect(overallHistogram).toStrictEqual([{ key: 1, doc_count: 1234 }]); + expect(hasData).toBe(true); + expect(status).toBe('success'); + }); +}); diff --git a/x-pack/plugins/apm/public/components/app/correlations/utils/get_overall_histogram.ts b/x-pack/plugins/apm/public/components/app/correlations/utils/get_overall_histogram.ts new file mode 100644 index 0000000000000..3a90eb4b89123 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/correlations/utils/get_overall_histogram.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 { LatencyCorrelationsRawResponse } from '../../../../../common/search_strategies/latency_correlations/types'; + +import { FETCH_STATUS } from '../../../../hooks/use_fetcher'; + +// `isRunning` refers to the search strategy as whole which might still be in the process +// of fetching more data such as correlation results. That's why we have to determine +// the `status` of the data for the latency chart separately. +export function getOverallHistogram( + data: LatencyCorrelationsRawResponse, + isRunning: boolean +) { + const overallHistogram = + data.overallHistogram === undefined && !isRunning + ? [] + : data.overallHistogram; + const hasData = + Array.isArray(overallHistogram) && overallHistogram.length > 0; + const status = Array.isArray(overallHistogram) + ? FETCH_STATUS.SUCCESS + : FETCH_STATUS.LOADING; + + return { overallHistogram, hasData, status }; +} diff --git a/x-pack/plugins/apm/public/components/app/error_group_details/index.tsx b/x-pack/plugins/apm/public/components/app/error_group_details/index.tsx index 3929a055bd77b..9145e019c37ea 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_details/index.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_details/index.tsx @@ -103,13 +103,13 @@ export function ErrorGroupDetails() { const { path: { groupId }, query: { rangeFrom, rangeTo, environment, kuery }, - } = useApmParams('/services/:serviceName/errors/:groupId'); + } = useApmParams('/services/{serviceName}/errors/{groupId}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); useBreadcrumb({ title: groupId, - href: apmRouter.link('/services/:serviceName/errors/:groupId', { + href: apmRouter.link('/services/{serviceName}/errors/{groupId}', { path: { serviceName, groupId, diff --git a/x-pack/plugins/apm/public/components/app/error_group_overview/List/__snapshots__/List.test.tsx.snap b/x-pack/plugins/apm/public/components/app/error_group_overview/List/__snapshots__/List.test.tsx.snap index 8fc51bd05be31..890c692096a66 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_overview/List/__snapshots__/List.test.tsx.snap +++ b/x-pack/plugins/apm/public/components/app/error_group_overview/List/__snapshots__/List.test.tsx.snap @@ -86,7 +86,6 @@ exports[`ErrorGroupOverview -> List should render empty state 1`] = ` @@ -383,7 +382,6 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` @@ -552,7 +550,6 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` @@ -627,7 +624,6 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` > @@ -644,7 +640,6 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = `
@@ -708,7 +703,6 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` > @@ -735,7 +729,6 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` @@ -810,7 +803,6 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` > @@ -827,7 +819,6 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = `
@@ -891,7 +882,6 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` > @@ -918,7 +908,6 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` @@ -993,7 +982,6 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` > @@ -1010,7 +998,6 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = `
@@ -1074,7 +1061,6 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` > @@ -1101,7 +1087,6 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` @@ -1176,7 +1161,6 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` > @@ -1193,7 +1177,6 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = `
@@ -1257,7 +1240,6 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = ` > diff --git a/x-pack/plugins/apm/public/components/app/error_group_overview/List/index.tsx b/x-pack/plugins/apm/public/components/app/error_group_overview/List/index.tsx index 73eb9c72416af..81d1208e6cbf5 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_overview/List/index.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_overview/List/index.tsx @@ -5,7 +5,12 @@ * 2.0. */ -import { EuiBadge, EuiIconTip, EuiToolTip } from '@elastic/eui'; +import { + EuiBadge, + EuiIconTip, + EuiToolTip, + RIGHT_ALIGNMENT, +} from '@elastic/eui'; import numeral from '@elastic/numeral'; import { i18n } from '@kbn/i18n'; import React, { useMemo } from 'react'; @@ -150,7 +155,7 @@ function ErrorGroupList({ items, serviceName }: Props) { name: '', field: 'handled', sortable: false, - align: 'right', + align: RIGHT_ALIGNMENT, render: (_, { handled }) => handled === false && ( @@ -181,7 +186,7 @@ function ErrorGroupList({ items, serviceName }: Props) { defaultMessage: 'Latest occurrence', } ), - align: 'right', + align: RIGHT_ALIGNMENT, render: (_, { latestOccurrenceAt }) => latestOccurrenceAt ? ( diff --git a/x-pack/plugins/apm/public/components/app/error_group_overview/index.tsx b/x-pack/plugins/apm/public/components/app/error_group_overview/index.tsx index 7fdedb8f7e7b9..97a3c38b65986 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_overview/index.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_overview/index.tsx @@ -27,7 +27,7 @@ export function ErrorGroupOverview() { const { query: { environment, kuery, sortField, sortDirection, rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName/errors'); + } = useApmParams('/services/{serviceName}/errors'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/plugins/apm/public/components/app/service_dependencies/service_dependencies_breakdown_chart.tsx b/x-pack/plugins/apm/public/components/app/service_dependencies/service_dependencies_breakdown_chart.tsx index 1ce6d54754719..426328a8ce9f0 100644 --- a/x-pack/plugins/apm/public/components/app/service_dependencies/service_dependencies_breakdown_chart.tsx +++ b/x-pack/plugins/apm/public/components/app/service_dependencies/service_dependencies_breakdown_chart.tsx @@ -22,7 +22,7 @@ export function ServiceDependenciesBreakdownChart({ const { query: { kuery, environment, rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName/dependencies'); + } = useApmParams('/services/{serviceName}/dependencies'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/plugins/apm/public/components/app/service_inventory/index.tsx b/x-pack/plugins/apm/public/components/app/service_inventory/index.tsx index c822e32ea1fc6..0b505c4f5ade8 100644 --- a/x-pack/plugins/apm/public/components/app/service_inventory/index.tsx +++ b/x-pack/plugins/apm/public/components/app/service_inventory/index.tsx @@ -5,7 +5,12 @@ * 2.0. */ -import { EuiFlexGroup, EuiFlexItem, EuiLink } from '@elastic/eui'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiLink, + EuiEmptyPrompt, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useEffect } from 'react'; import uuid from 'uuid'; @@ -20,7 +25,6 @@ import { useTimeRange } from '../../../hooks/use_time_range'; import { useUpgradeAssistantHref } from '../../shared/Links/kibana'; import { SearchBar } from '../../shared/search_bar'; import { getTimeRangeComparison } from '../../shared/time_comparison/get_time_range_comparison'; -import { NoServicesMessage } from './no_services_message'; import { ServiceList } from './service_list'; import { MLCallout } from './service_list/MLCallout'; @@ -42,7 +46,7 @@ function useServicesFetcher() { const { query: { rangeFrom, rangeTo, environment, kuery }, - } = useApmParams('/services/:serviceName', '/services'); + } = useApmParams('/services/{serviceName}', '/services'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); @@ -180,6 +184,19 @@ export function ServiceInventory() { !userHasDismissedCallout; const isLoading = mainStatisticsStatus === FETCH_STATUS.LOADING; + const isFailure = mainStatisticsStatus === FETCH_STATUS.FAILURE; + const noItemsMessage = ( + + {i18n.translate('xpack.apm.servicesTable.notFoundLabel', { + defaultMessage: 'No services found', + })} +
+ } + titleSize="s" + /> + ); return ( <> @@ -193,16 +210,10 @@ export function ServiceInventory() { - ) - } + noItemsMessage={noItemsMessage} /> diff --git a/x-pack/plugins/apm/public/components/app/service_inventory/no_services_message.test.tsx b/x-pack/plugins/apm/public/components/app/service_inventory/no_services_message.test.tsx deleted file mode 100644 index 3e07e18f95a02..0000000000000 --- a/x-pack/plugins/apm/public/components/app/service_inventory/no_services_message.test.tsx +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { render } from '@testing-library/react'; -import React, { ReactNode } from 'react'; -import { MockApmPluginContextWrapper } from '../../../context/apm_plugin/mock_apm_plugin_context'; -import { FETCH_STATUS } from '../../../hooks/use_fetcher'; -import { NoServicesMessage } from './no_services_message'; - -function Wrapper({ children }: { children?: ReactNode }) { - return {children}; -} - -describe('NoServicesMessage', () => { - Object.values(FETCH_STATUS).forEach((status) => { - [true, false].forEach((historicalDataFound) => { - describe(`when status is ${status}`, () => { - describe(`when historicalDataFound is ${historicalDataFound}`, () => { - it('renders', () => { - expect(() => - render( - , - { wrapper: Wrapper } - ) - ).not.toThrowError(); - }); - }); - }); - }); - }); -}); diff --git a/x-pack/plugins/apm/public/components/app/service_inventory/no_services_message.tsx b/x-pack/plugins/apm/public/components/app/service_inventory/no_services_message.tsx deleted file mode 100644 index a2dc5feec44f8..0000000000000 --- a/x-pack/plugins/apm/public/components/app/service_inventory/no_services_message.tsx +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiEmptyPrompt, EuiLink } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import React from 'react'; -import { FETCH_STATUS } from '../../../hooks/use_fetcher'; -import { ErrorStatePrompt } from '../../shared/ErrorStatePrompt'; -import { useUpgradeAssistantHref } from '../../shared/Links/kibana'; -import { SetupInstructionsLink } from '../../shared/Links/SetupInstructionsLink'; - -interface Props { - // any data submitted from APM agents found (not just in the given time range) - historicalDataFound: boolean; - status: FETCH_STATUS | undefined; -} - -export function NoServicesMessage({ historicalDataFound, status }: Props) { - const upgradeAssistantHref = useUpgradeAssistantHref(); - - if (status === 'failure') { - return ; - } - - if (historicalDataFound) { - return ( - - {i18n.translate('xpack.apm.servicesTable.notFoundLabel', { - defaultMessage: 'No services found', - })} -
- } - titleSize="s" - /> - ); - } - - return ( - - {i18n.translate('xpack.apm.servicesTable.noServicesLabel', { - defaultMessage: `Looks like you don't have any APM services installed. Let's add some!`, - })} -
- } - titleSize="s" - body={ - -

- {i18n.translate('xpack.apm.servicesTable.7xUpgradeServerMessage', { - defaultMessage: `Upgrading from a pre-7.x version? Make sure you've also upgraded - your APM Server instance(s) to at least 7.0.`, - })} -

-

- {i18n.translate('xpack.apm.servicesTable.7xOldDataMessage', { - defaultMessage: - 'You may also have old data that needs to be migrated.', - })}{' '} - - {i18n.translate('xpack.apm.servicesTable.UpgradeAssistantLink', { - defaultMessage: - 'Learn more by visiting the Kibana Upgrade Assistant', - })} - - . -

-
- } - actions={} - /> - ); -} diff --git a/x-pack/plugins/apm/public/components/app/service_inventory/service_inventory.test.tsx b/x-pack/plugins/apm/public/components/app/service_inventory/service_inventory.test.tsx index 8f2e921d4bd83..2ff3f2702cb53 100644 --- a/x-pack/plugins/apm/public/components/app/service_inventory/service_inventory.test.tsx +++ b/x-pack/plugins/apm/public/components/app/service_inventory/service_inventory.test.tsx @@ -134,28 +134,6 @@ describe('ServiceInventory', () => { expect(container.querySelectorAll('.euiTableRow')).toHaveLength(2); }); - it('should render getting started message, when list is empty and no historical data is found', async () => { - httpGet - .mockResolvedValueOnce({ fallbackToTransactions: false }) - .mockResolvedValueOnce({ - hasLegacyData: false, - hasHistoricalData: false, - items: [], - }); - - const { findByText } = render(, { wrapper }); - - // wait for requests to be made - await waitFor(() => expect(httpGet).toHaveBeenCalledTimes(2)); - - // wait for elements to be rendered - const gettingStartedMessage = await findByText( - "Looks like you don't have any APM services installed. Let's add some!" - ); - - expect(gettingStartedMessage).not.toBeEmptyDOMElement(); - }); - it('should render empty message, when list is empty and historical data is found', async () => { httpGet .mockResolvedValueOnce({ fallbackToTransactions: false }) diff --git a/x-pack/plugins/apm/public/components/app/service_inventory/service_list/ServiceListMetric.tsx b/x-pack/plugins/apm/public/components/app/service_inventory/service_list/ServiceListMetric.tsx deleted file mode 100644 index 7a4721407e69b..0000000000000 --- a/x-pack/plugins/apm/public/components/app/service_inventory/service_list/ServiceListMetric.tsx +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; -import React from 'react'; -import { Coordinate } from '../../../../../typings/timeseries'; -import { SparkPlot } from '../../../shared/charts/spark_plot'; - -export function ServiceListMetric({ - color, - series, - valueLabel, - comparisonSeries, - hideSeries = false, -}: { - color: 'euiColorVis1' | 'euiColorVis0' | 'euiColorVis7'; - series?: Coordinate[]; - comparisonSeries?: Coordinate[]; - valueLabel: React.ReactNode; - hideSeries?: boolean; -}) { - if (!hideSeries) { - return ( - - ); - } - - return ( - - - - {valueLabel} - - - - ); -} diff --git a/x-pack/plugins/apm/public/components/app/service_inventory/service_list/index.tsx b/x-pack/plugins/apm/public/components/app/service_inventory/service_list/index.tsx index 8732084e6331e..17dfee35e221b 100644 --- a/x-pack/plugins/apm/public/components/app/service_inventory/service_list/index.tsx +++ b/x-pack/plugins/apm/public/components/app/service_inventory/service_list/index.tsx @@ -11,16 +11,13 @@ import { EuiIcon, EuiText, EuiToolTip, + RIGHT_ALIGNMENT, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { TypeOf } from '@kbn/typed-react-router-config'; import { orderBy } from 'lodash'; import React, { useMemo } from 'react'; import { ValuesType } from 'utility-types'; -import { - BreakPoints, - useBreakPoints, -} from '../../../../hooks/use_break_points'; import { NOT_AVAILABLE_LABEL } from '../../../../../common/i18n'; import { ServiceHealthStatus } from '../../../../../common/service_health_status'; import { @@ -33,17 +30,18 @@ import { asTransactionRate, } from '../../../../../common/utils/formatters'; import { useApmParams } from '../../../../hooks/use_apm_params'; +import { Breakpoints, useBreakpoints } from '../../../../hooks/use_breakpoints'; +import { useFallbackToTransactionsFetcher } from '../../../../hooks/use_fallback_to_transactions_fetcher'; import { APIReturnType } from '../../../../services/rest/createCallApmApi'; import { unit } from '../../../../utils/style'; import { ApmRoutes } from '../../../routing/apm_route_config'; +import { AggregatedTransactionsBadge } from '../../../shared/aggregated_transactions_badge'; import { EnvironmentBadge } from '../../../shared/EnvironmentBadge'; +import { ListMetric } from '../../../shared/list_metric'; import { ITableColumn, ManagedTable } from '../../../shared/managed_table'; import { ServiceLink } from '../../../shared/service_link'; -import { HealthBadge } from './HealthBadge'; -import { ServiceListMetric } from './ServiceListMetric'; import { TruncateWithTooltip } from '../../../shared/truncate_with_tooltip'; -import { useFallbackToTransactionsFetcher } from '../../../../hooks/use_fallback_to_transactions_fetcher'; -import { AggregatedTransactionsBadge } from '../../../shared/aggregated_transactions_badge'; +import { HealthBadge } from './HealthBadge'; type ServiceListAPIResponse = APIReturnType<'GET /api/apm/services'>; type Items = ServiceListAPIResponse['items']; @@ -66,14 +64,14 @@ export function getServiceColumns({ query, showTransactionTypeColumn, comparisonData, - breakPoints, + breakpoints, }: { query: TypeOf['query']; showTransactionTypeColumn: boolean; - breakPoints: BreakPoints; + breakpoints: Breakpoints; comparisonData?: ServicesDetailedStatisticsAPIResponse; }): Array> { - const { isSmall, isLarge, isXl } = breakPoints; + const { isSmall, isLarge, isXl } = breakpoints; const showWhenSmallOrGreaterThanLarge = isSmall || !isLarge; const showWhenSmallOrGreaterThanXL = isSmall || !isXl; return [ @@ -97,16 +95,15 @@ export function getServiceColumns({ name: i18n.translate('xpack.apm.servicesTable.nameColumnLabel', { defaultMessage: 'Name', }), - width: '40%', sortable: true, - render: (_, { serviceName, agentName }) => ( + render: (_, { serviceName, agentName, transactionType }) => ( } @@ -152,7 +149,7 @@ export function getServiceColumns({ sortable: true, dataType: 'number', render: (_, { serviceName, latency }) => ( - ), - align: 'left', - width: showWhenSmallOrGreaterThanLarge ? `${unit * 11}px` : 'auto', + align: RIGHT_ALIGNMENT, }, { field: 'throughput', @@ -173,7 +169,7 @@ export function getServiceColumns({ sortable: true, dataType: 'number', render: (_, { serviceName, throughput }) => ( - ), - align: 'left', - width: showWhenSmallOrGreaterThanLarge ? `${unit * 11}px` : 'auto', + align: RIGHT_ALIGNMENT, }, { field: 'transactionErrorRate', @@ -196,7 +191,7 @@ export function getServiceColumns({ render: (_, { serviceName, transactionErrorRate }) => { const valueLabel = asPercent(transactionErrorRate, 1); return ( - ); }, - align: 'left', - width: showWhenSmallOrGreaterThanLarge ? `${unit * 10}px` : 'auto', + align: RIGHT_ALIGNMENT, }, ]; } @@ -220,6 +214,7 @@ interface Props { comparisonData?: ServicesDetailedStatisticsAPIResponse; noItemsMessage?: React.ReactNode; isLoading: boolean; + isFailure?: boolean; } export function ServiceList({ @@ -227,8 +222,9 @@ export function ServiceList({ noItemsMessage, comparisonData, isLoading, + isFailure, }: Props) { - const breakPoints = useBreakPoints(); + const breakpoints = useBreakpoints(); const displayHealthStatus = items.some((item) => 'healthStatus' in item); const showTransactionTypeColumn = items.some( @@ -250,9 +246,9 @@ export function ServiceList({ query, showTransactionTypeColumn, comparisonData, - breakPoints, + breakpoints, }), - [query, showTransactionTypeColumn, comparisonData, breakPoints] + [query, showTransactionTypeColumn, comparisonData, breakpoints] ); const columns = displayHealthStatus @@ -302,6 +298,7 @@ export function ServiceList({ { const renderedColumns = getServiceColumns({ query, showTransactionTypeColumn: true, - breakPoints: { + breakpoints: { isSmall: true, isLarge: true, isXl: true, - } as BreakPoints, + } as Breakpoints, }).map((c) => c.render ? c.render!(service[c.field!], service) : service[c.field!] ); @@ -110,7 +110,7 @@ describe('ServiceList', () => { `); expect(renderedColumns[3]).toMatchInlineSnapshot(`"request"`); expect(renderedColumns[4]).toMatchInlineSnapshot(` - { const renderedColumns = getServiceColumns({ query, showTransactionTypeColumn: true, - breakPoints: { + breakpoints: { isSmall: false, isLarge: true, isXl: true, - } as BreakPoints, + } as Breakpoints, }).map((c) => c.render ? c.render!(service[c.field!], service) : service[c.field!] ); expect(renderedColumns.length).toEqual(5); expect(renderedColumns[2]).toMatchInlineSnapshot(` - { const renderedColumns = getServiceColumns({ query, showTransactionTypeColumn: true, - breakPoints: { + breakpoints: { isSmall: false, isLarge: false, isXl: true, - } as BreakPoints, + } as Breakpoints, }).map((c) => c.render ? c.render!(service[c.field!], service) : service[c.field!] ); @@ -166,7 +166,7 @@ describe('ServiceList', () => { /> `); expect(renderedColumns[3]).toMatchInlineSnapshot(` - { const renderedColumns = getServiceColumns({ query, showTransactionTypeColumn: true, - breakPoints: { + breakpoints: { isSmall: false, isLarge: false, isXl: false, - } as BreakPoints, + } as Breakpoints, }).map((c) => c.render ? c.render!(service[c.field!], service) : service[c.field!] ); expect(renderedColumns.length).toEqual(7); expect(renderedColumns[2]).toMatchInlineSnapshot(` - - `); + + `); expect(renderedColumns[3]).toMatchInlineSnapshot(`"request"`); expect(renderedColumns[4]).toMatchInlineSnapshot(` - - `); + + `); }); }); }); diff --git a/x-pack/plugins/apm/public/components/app/service_logs/index.tsx b/x-pack/plugins/apm/public/components/app/service_logs/index.tsx index ac4a4fb51ce8a..79818473d26b1 100644 --- a/x-pack/plugins/apm/public/components/app/service_logs/index.tsx +++ b/x-pack/plugins/apm/public/components/app/service_logs/index.tsx @@ -27,7 +27,7 @@ export function ServiceLogs() { const { query: { environment, kuery, rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName/logs'); + } = useApmParams('/services/{serviceName}/logs'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/plugins/apm/public/components/app/service_map/Controls.tsx b/x-pack/plugins/apm/public/components/app/service_map/Controls.tsx index f46b1232b00fd..dd34110a8ffc6 100644 --- a/x-pack/plugins/apm/public/components/app/service_map/Controls.tsx +++ b/x-pack/plugins/apm/public/components/app/service_map/Controls.tsx @@ -107,7 +107,7 @@ export function Controls() { const { query: { kuery }, - } = useApmParams('/service-map', '/services/:serviceName/service-map'); + } = useApmParams('/service-map', '/services/{serviceName}/service-map'); const [zoom, setZoom] = useState((cy && cy.zoom()) || 1); const duration = parseInt(theme.eui.euiAnimSpeedFast, 10); diff --git a/x-pack/plugins/apm/public/components/app/service_map/Popover/backend_contents.tsx b/x-pack/plugins/apm/public/components/app/service_map/Popover/backend_contents.tsx index 9bc30ee67d2c7..c01cf4579fdbd 100644 --- a/x-pack/plugins/apm/public/components/app/service_map/Popover/backend_contents.tsx +++ b/x-pack/plugins/apm/public/components/app/service_map/Popover/backend_contents.tsx @@ -27,7 +27,7 @@ export function BackendContents({ }: ContentsProps) { const { query } = useApmParams( '/service-map', - '/services/:serviceName/service-map' + '/services/{serviceName}/service-map' ); const apmRouter = useApmRouter(); @@ -57,11 +57,11 @@ export function BackendContents({ ); const isLoading = status === FETCH_STATUS.LOADING; - const detailsUrl = apmRouter.link('/backends/:backendName/overview', { + const detailsUrl = apmRouter.link('/backends/{backendName}/overview', { path: { backendName }, query: query as TypeOf< ApmRoutes, - '/backends/:backendName/overview' + '/backends/{backendName}/overview' >['query'], }); diff --git a/x-pack/plugins/apm/public/components/app/service_map/Popover/service_contents.tsx b/x-pack/plugins/apm/public/components/app/service_map/Popover/service_contents.tsx index eb13a854925c4..5eef580793d10 100644 --- a/x-pack/plugins/apm/public/components/app/service_map/Popover/service_contents.tsx +++ b/x-pack/plugins/apm/public/components/app/service_map/Popover/service_contents.tsx @@ -63,12 +63,12 @@ export function ServiceContents({ const isLoading = status === FETCH_STATUS.LOADING; - const detailsUrl = apmRouter.link('/services/:serviceName', { + const detailsUrl = apmRouter.link('/services/{serviceName}', { path: { serviceName }, query: { rangeFrom, rangeTo, environment, kuery }, }); - const focusUrl = apmRouter.link('/services/:serviceName/service-map', { + const focusUrl = apmRouter.link('/services/{serviceName}/service-map', { path: { serviceName }, query: { rangeFrom, rangeTo, environment, kuery }, }); diff --git a/x-pack/plugins/apm/public/components/app/service_map/index.tsx b/x-pack/plugins/apm/public/components/app/service_map/index.tsx index c3a6dca165131..97b4f548f4bf9 100644 --- a/x-pack/plugins/apm/public/components/app/service_map/index.tsx +++ b/x-pack/plugins/apm/public/components/app/service_map/index.tsx @@ -83,7 +83,7 @@ export function ServiceMapHome() { export function ServiceMapServiceDetail() { const { query: { environment, kuery, rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName/service-map'); + } = useApmParams('/services/{serviceName}/service-map'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); return ( + {i18n.translate( 'xpack.apm.serviceNodeMetrics.unidentifiedServiceNodesWarningDocumentationLink', { defaultMessage: 'documentation of APM Server' } )} - + ), }} /> diff --git a/x-pack/plugins/apm/public/components/app/service_node_overview/index.tsx b/x-pack/plugins/apm/public/components/app/service_node_overview/index.tsx index 1158a671bfe0a..bef87891d7416 100644 --- a/x-pack/plugins/apm/public/components/app/service_node_overview/index.tsx +++ b/x-pack/plugins/apm/public/components/app/service_node_overview/index.tsx @@ -19,7 +19,7 @@ import { } from '../../../../common/utils/formatters'; import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context'; import { useApmParams } from '../../../hooks/use_apm_params'; -import { useFetcher } from '../../../hooks/use_fetcher'; +import { useFetcher, FETCH_STATUS } from '../../../hooks/use_fetcher'; import { useTimeRange } from '../../../hooks/use_time_range'; import { truncate, unit } from '../../../utils/style'; import { ServiceNodeMetricOverviewLink } from '../../shared/Links/apm/ServiceNodeMetricOverviewLink'; @@ -36,13 +36,13 @@ const ServiceNodeName = euiStyled.div` function ServiceNodeOverview() { const { query: { environment, kuery, rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName/nodes'); + } = useApmParams('/services/{serviceName}/nodes'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); const { serviceName } = useApmServiceContext(); - const { data } = useFetcher( + const { data, status } = useFetcher( (callApmApi) => { if (!start || !end) { return undefined; @@ -164,6 +164,7 @@ function ServiceNodeOverview() { return ( @@ -91,7 +111,7 @@ export function ServiceOverview() { > @@ -102,6 +122,7 @@ export function ServiceOverview() { kuery={kuery} environment={environment} fixedHeight={true} + isSingleColumn={isSingleColumn} start={start} end={end} /> @@ -118,7 +139,7 @@ export function ServiceOverview() { {!isRumAgent && ( {!isRumAgent && ( @@ -150,6 +171,7 @@ export function ServiceOverview() { {i18n.translate( @@ -172,7 +194,7 @@ export function ServiceOverview() { responsive={false} > diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_dependencies_table/index.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_dependencies_table/index.tsx index 08f29d7727cda..b035d626c371a 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_dependencies_table/index.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_dependencies_table/index.tsx @@ -22,11 +22,13 @@ import { getTimeRangeComparison } from '../../../shared/time_comparison/get_time interface ServiceOverviewDependenciesTableProps { fixedHeight?: boolean; + isSingleColumn?: boolean; link?: ReactNode; } export function ServiceOverviewDependenciesTable({ fixedHeight, + isSingleColumn = true, link, }: ServiceOverviewDependenciesTableProps) { const { @@ -35,7 +37,7 @@ export function ServiceOverviewDependenciesTable({ const { query: { environment, kuery, rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName/*'); + } = useApmParams('/services/{serviceName}/*'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); @@ -122,6 +124,7 @@ export function ServiceOverviewDependenciesTable({ ; -type ErrorGroupDetailedStatistics = APIReturnType<'GET /api/apm/services/{serviceName}/error_groups/detailed_statistics'>; - -export function getColumns({ - serviceName, - errorGroupDetailedStatistics, - comparisonEnabled, -}: { - serviceName: string; - errorGroupDetailedStatistics: ErrorGroupDetailedStatistics; - comparisonEnabled?: boolean; -}): Array> { - return [ - { - field: 'name', - name: i18n.translate('xpack.apm.serviceOverview.errorsTableColumnName', { - defaultMessage: 'Name', - }), - render: (_, { name, group_id: errorGroupId }) => { - return ( - - {name} - - } - /> - ); - }, - }, - { - field: 'lastSeen', - name: i18n.translate( - 'xpack.apm.serviceOverview.errorsTableColumnLastSeen', - { - defaultMessage: 'Last seen', - } - ), - render: (_, { lastSeen }) => { - return ; - }, - width: `${unit * 9}px`, - align: 'right', - }, - { - field: 'occurrences', - name: i18n.translate( - 'xpack.apm.serviceOverview.errorsTableColumnOccurrences', - { - defaultMessage: 'Occurrences', - } - ), - width: `${unit * 12}px`, - render: (_, { occurrences, group_id: errorGroupId }) => { - const currentPeriodTimeseries = - errorGroupDetailedStatistics?.currentPeriod?.[errorGroupId] - ?.timeseries; - const previousPeriodTimeseries = - errorGroupDetailedStatistics?.previousPeriod?.[errorGroupId] - ?.timeseries; - - return ( - - ); - }, - }, - ]; -} diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/get_columns.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/get_columns.tsx new file mode 100644 index 0000000000000..23c0f49cdafa6 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/get_columns.tsx @@ -0,0 +1,107 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiBasicTableColumn, RIGHT_ALIGNMENT } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React from 'react'; +import { asInteger } from '../../../../../common/utils/formatters'; +import { APIReturnType } from '../../../../services/rest/createCallApmApi'; +import { SparkPlot } from '../../../shared/charts/spark_plot'; +import { ErrorDetailLink } from '../../../shared/Links/apm/ErrorDetailLink'; +import { TimestampTooltip } from '../../../shared/TimestampTooltip'; +import { TruncateWithTooltip } from '../../../shared/truncate_with_tooltip'; + +type ErrorGroupMainStatistics = APIReturnType<'GET /api/apm/services/{serviceName}/error_groups/main_statistics'>; +type ErrorGroupDetailedStatistics = APIReturnType<'GET /api/apm/services/{serviceName}/error_groups/detailed_statistics'>; + +export function getColumns({ + serviceName, + errorGroupDetailedStatistics, + comparisonEnabled, +}: { + serviceName: string; + errorGroupDetailedStatistics: ErrorGroupDetailedStatistics; + comparisonEnabled?: boolean; +}): Array> { + return [ + { + field: 'name', + name: i18n.translate('xpack.apm.serviceOverview.errorsTableColumnName', { + defaultMessage: 'Name', + }), + render: (_, { name, group_id: errorGroupId }) => { + return ( + + {name} + + } + /> + ); + }, + }, + { + field: 'lastSeen', + name: i18n.translate( + 'xpack.apm.serviceOverview.errorsTableColumnLastSeen', + { + defaultMessage: 'Last seen', + } + ), + align: RIGHT_ALIGNMENT, + render: (_, { lastSeen }) => { + return ( + + + + ); + }, + }, + { + field: 'occurrences', + name: i18n.translate( + 'xpack.apm.serviceOverview.errorsTableColumnOccurrences', + { + defaultMessage: 'Occurrences', + } + ), + align: RIGHT_ALIGNMENT, + render: (_, { occurrences, group_id: errorGroupId }) => { + const currentPeriodTimeseries = + errorGroupDetailedStatistics?.currentPeriod?.[errorGroupId] + ?.timeseries; + const previousPeriodTimeseries = + errorGroupDetailedStatistics?.previousPeriod?.[errorGroupId] + ?.timeseries; + + return ( + + ); + }, + }, + ]; +} diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/index.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/index.tsx index 0c874bb02abea..bfcd20b22301c 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/index.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/index.tsx @@ -20,10 +20,9 @@ import { useUrlParams } from '../../../../context/url_params_context/use_url_par import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher'; import { APIReturnType } from '../../../../services/rest/createCallApmApi'; import { ErrorOverviewLink } from '../../../shared/Links/apm/ErrorOverviewLink'; -import { TableFetchWrapper } from '../../../shared/table_fetch_wrapper'; import { getTimeRangeComparison } from '../../../shared/time_comparison/get_time_range_comparison'; import { OverviewTableContainer } from '../../../shared/overview_table_container'; -import { getColumns } from './get_column'; +import { getColumns } from './get_columns'; import { useApmParams } from '../../../../hooks/use_apm_params'; import { useTimeRange } from '../../../../hooks/use_time_range'; @@ -75,7 +74,7 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) { const { query: { environment, kuery, rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName/overview'); + } = useApmParams('/services/{serviceName}/overview'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); @@ -204,58 +203,64 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) { - - + - { - setTableOptions({ - pageIndex: newTableOptions.page?.index ?? 0, - sort: newTableOptions.sort - ? { - field: newTableOptions.sort.field as SortField, - direction: newTableOptions.sort.direction, - } - : DEFAULT_SORT, - }); - }} - sorting={{ - enableAllColumns: true, - sort, - }} - /> - - + noItemsMessage={ + status === FETCH_STATUS.LOADING + ? i18n.translate( + 'xpack.apm.serviceOverview.errorsTable.loading', + { defaultMessage: 'Loading...' } + ) + : i18n.translate( + 'xpack.apm.serviceOverview.errorsTable.noResults', + { defaultMessage: 'No errors found' } + ) + } + columns={columns} + items={items} + pagination={{ + pageIndex, + pageSize: PAGE_SIZE, + totalItemCount: totalItems, + pageSizeOptions: [PAGE_SIZE], + hidePerPageOptions: true, + }} + loading={status === FETCH_STATUS.LOADING} + onChange={(newTableOptions: { + page?: { + index: number; + }; + sort?: { field: string; direction: SortDirection }; + }) => { + setTableOptions({ + pageIndex: newTableOptions.page?.index ?? 0, + sort: newTableOptions.sort + ? { + field: newTableOptions.sort.field as SortField, + direction: newTableOptions.sort.direction, + } + : DEFAULT_SORT, + }); + }} + sorting={{ + enableAllColumns: true, + sort, + }} + /> + ); diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_chart_and_table.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_chart_and_table.tsx index ed148d1403442..87a4d4b7b87fb 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_chart_and_table.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_chart_and_table.tsx @@ -72,7 +72,7 @@ export function ServiceOverviewInstancesChartAndTable({ const { query: { environment, kuery, rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName/overview'); + } = useApmParams('/services/{serviceName}/overview'); const { urlParams: { latencyAggregationType, comparisonType, comparisonEnabled }, @@ -228,6 +228,7 @@ export function ServiceOverviewInstancesChartAndTable({ serviceName={serviceName} tableOptions={tableOptions} isLoading={mainStatsStatus === FETCH_STATUS.LOADING} + isNotInitiated={mainStatsStatus === FETCH_STATUS.NOT_INITIATED} onChangeTableOptions={(newTableOptions) => { setTableOptions({ pageIndex: newTableOptions.page?.index ?? 0, diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_table/get_columns.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_table/get_columns.tsx index 07081069039cf..97a92cb9e0576 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_table/get_columns.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_table/get_columns.tsx @@ -25,12 +25,11 @@ import { asTransactionRate, } from '../../../../../common/utils/formatters'; import { APIReturnType } from '../../../../services/rest/createCallApmApi'; -import { unit } from '../../../../utils/style'; -import { SparkPlot } from '../../../shared/charts/spark_plot'; import { MetricOverviewLink } from '../../../shared/Links/apm/MetricOverviewLink'; import { ServiceNodeMetricOverviewLink } from '../../../shared/Links/apm/ServiceNodeMetricOverviewLink'; -import { TruncateWithTooltip } from '../../../shared/truncate_with_tooltip'; +import { ListMetric } from '../../../shared/list_metric'; import { getLatencyColumnLabel } from '../../../shared/transactions_table/get_latency_column_label'; +import { TruncateWithTooltip } from '../../../shared/truncate_with_tooltip'; import { InstanceActionsMenu } from './instance_actions_menu'; type ServiceInstanceMainStatistics = APIReturnType<'GET /api/apm/services/{serviceName}/service_overview_instances/main_statistics'>; @@ -48,6 +47,7 @@ export function getColumns({ itemIdToExpandedRowMap, toggleRowActionMenu, itemIdToOpenActionMenuRowMap, + shouldShowSparkPlots = true, }: { serviceName: string; kuery: string; @@ -59,6 +59,7 @@ export function getColumns({ itemIdToExpandedRowMap: Record; toggleRowActionMenu: (selectedServiceNodeName: string) => void; itemIdToOpenActionMenuRowMap: Record; + shouldShowSparkPlots?: boolean; }): Array> { return [ { @@ -101,16 +102,17 @@ export function getColumns({ { field: 'latency', name: getLatencyColumnLabel(latencyAggregationType), - width: `${unit * 11}px`, + align: RIGHT_ALIGNMENT, render: (_, { serviceNodeName, latency }) => { const currentPeriodTimestamp = detailedStatsData?.currentPeriod?.[serviceNodeName]?.latency; const previousPeriodTimestamp = detailedStatsData?.previousPeriod?.[serviceNodeName]?.latency; return ( - { const currentPeriodTimestamp = detailedStatsData?.currentPeriod?.[serviceNodeName]?.throughput; const previousPeriodTimestamp = detailedStatsData?.previousPeriod?.[serviceNodeName]?.throughput; return ( - { const currentPeriodTimestamp = detailedStatsData?.currentPeriod?.[serviceNodeName]?.errorRate; const previousPeriodTimestamp = detailedStatsData?.previousPeriod?.[serviceNodeName]?.errorRate; return ( - { const currentPeriodTimestamp = detailedStatsData?.currentPeriod?.[serviceNodeName]?.cpuUsage; const previousPeriodTimestamp = detailedStatsData?.previousPeriod?.[serviceNodeName]?.cpuUsage; return ( - { const currentPeriodTimestamp = detailedStatsData?.currentPeriod?.[serviceNodeName]?.memoryUsage; const previousPeriodTimestamp = detailedStatsData?.previousPeriod?.[serviceNodeName]?.memoryUsage; return ( - ; type MainStatsServiceInstanceItem = ServiceInstanceMainStatistics['currentPeriod'][0]; @@ -52,6 +52,7 @@ interface Props { }) => void; detailedStatsData?: ServiceInstanceDetailedStatistics; isLoading: boolean; + isNotInitiated: boolean; } export function ServiceOverviewInstancesTable({ mainStatsItems = [], @@ -62,12 +63,13 @@ export function ServiceOverviewInstancesTable({ onChangeTableOptions, detailedStatsData: detailedStatsData, isLoading, + isNotInitiated, }: Props) { const { agentName } = useApmServiceContext(); const { query: { kuery }, - } = useApmParams('/services/:serviceName'); + } = useApmParams('/services/{serviceName}'); const { urlParams: { latencyAggregationType, comparisonEnabled }, @@ -116,6 +118,10 @@ export function ServiceOverviewInstancesTable({ setItemIdToExpandedRowMap(expandedRowMapValues); }; + // Hide the spark plots if we're below 1600 px + const { isXl } = useBreakpoints(); + const shouldShowSparkPlots = !isXl; + const columns = getColumns({ agentName, serviceName, @@ -127,6 +133,7 @@ export function ServiceOverviewInstancesTable({ itemIdToExpandedRowMap, toggleRowActionMenu, itemIdToOpenActionMenuRowMap, + shouldShowSparkPlots, }); const pagination = { @@ -148,33 +155,39 @@ export function ServiceOverviewInstancesTable({ - - - - - + + + ); diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_table/use_instance_details_fetcher.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_table/use_instance_details_fetcher.tsx index f47c6fe9879a2..c1018d6d742fa 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_table/use_instance_details_fetcher.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_table/use_instance_details_fetcher.tsx @@ -17,7 +17,7 @@ export function useInstanceDetailsFetcher({ }) { const { query: { rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName/overview'); + } = useApmParams('/services/{serviceName}/overview'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_throughput_chart.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_throughput_chart.tsx index 6751e76cfa335..c3d17b9f18a98 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_throughput_chart.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_throughput_chart.tsx @@ -52,7 +52,7 @@ export function ServiceOverviewThroughputChart({ const { query: { rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName'); + } = useApmParams('/services/{serviceName}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/plugins/apm/public/components/app/service_profiling/index.tsx b/x-pack/plugins/apm/public/components/app/service_profiling/index.tsx index 5f020b19f671a..4149b426e0388 100644 --- a/x-pack/plugins/apm/public/components/app/service_profiling/index.tsx +++ b/x-pack/plugins/apm/public/components/app/service_profiling/index.tsx @@ -26,7 +26,7 @@ export function ServiceProfiling() { const { query: { environment, kuery, rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName/profiling'); + } = useApmParams('/services/{serviceName}/profiling'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); 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 5286b821dd23f..63cd27cba41e8 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 @@ -65,6 +65,7 @@ export function TraceOverview() { ); diff --git a/x-pack/plugins/apm/public/components/app/trace_overview/trace_list.tsx b/x-pack/plugins/apm/public/components/app/trace_overview/trace_list.tsx index 1da7a56a096c7..7c4e0ffca1f58 100644 --- a/x-pack/plugins/apm/public/components/app/trace_overview/trace_list.tsx +++ b/x-pack/plugins/apm/public/components/app/trace_overview/trace_list.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { EuiIcon, EuiToolTip } from '@elastic/eui'; +import { EuiIcon, EuiToolTip, RIGHT_ALIGNMENT } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common'; @@ -14,11 +14,10 @@ import { asTransactionRate, } from '../../../../common/utils/formatters'; import { APIReturnType } from '../../../services/rest/createCallApmApi'; -import { truncate, unit } from '../../../utils/style'; +import { truncate } from '../../../utils/style'; import { EmptyMessage } from '../../shared/EmptyMessage'; import { ImpactBar } from '../../shared/ImpactBar'; import { TransactionDetailLink } from '../../shared/Links/apm/transaction_detail_link'; -import { LoadingStatePrompt } from '../../shared/LoadingStatePrompt'; import { ITableColumn, ManagedTable } from '../../shared/managed_table'; type TraceGroup = APIReturnType<'GET /api/apm/traces'>['items'][0]; @@ -31,6 +30,7 @@ const StyledTransactionLink = euiStyled(TransactionDetailLink)` interface Props { items: TraceGroup[]; isLoading: boolean; + isFailure: boolean; } const traceListColumns: Array> = [ @@ -111,8 +111,7 @@ const traceListColumns: Array> = [ ), - width: `${unit * 6}px`, - align: 'left', + align: RIGHT_ALIGNMENT, sortable: true, render: (_, { impact }) => , }, @@ -126,15 +125,16 @@ const noItemsMessage = ( /> ); -export function TraceList({ items = [], isLoading }: Props) { - const noItems = isLoading ? : noItemsMessage; +export function TraceList({ items = [], isLoading, isFailure }: Props) { return ( ); diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.test.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.test.tsx index 5a9977b373c33..9a38e0fcf6289 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.test.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.test.tsx @@ -16,7 +16,7 @@ import { dataPluginMock } from 'src/plugins/data/public/mocks'; import type { IKibanaSearchResponse } from 'src/plugins/data/public'; import { EuiThemeProvider } from 'src/plugins/kibana_react/common'; import { createKibanaReactContext } from 'src/plugins/kibana_react/public'; -import type { SearchServiceRawResponse } from '../../../../../common/search_strategies/correlations/types'; +import type { LatencyCorrelationsRawResponse } from '../../../../../common/search_strategies/latency_correlations/types'; import { MockUrlParamsContextProvider } from '../../../../context/url_params_context/mock_url_params_context_provider'; import { ApmPluginContextValue } from '../../../../context/apm_plugin/apm_plugin_context'; import { @@ -32,7 +32,7 @@ function Wrapper({ dataSearchResponse, }: { children?: ReactNode; - dataSearchResponse: IKibanaSearchResponse; + dataSearchResponse: IKibanaSearchResponse; }) { const mockDataSearch = jest.fn(() => of(dataSearchResponse)); @@ -101,18 +101,22 @@ describe('transaction_details/distribution', () => { describe('TransactionDistribution', () => { it('shows loading indicator when the service is running and returned no results yet', async () => { - const onHasData = jest.fn(); render( ); @@ -120,23 +124,26 @@ describe('transaction_details/distribution', () => { await waitFor(() => { expect(screen.getByTestId('apmCorrelationsChart')).toBeInTheDocument(); expect(screen.getByTestId('loading')).toBeInTheDocument(); - expect(onHasData).toHaveBeenLastCalledWith(false); }); }); it("doesn't show loading indicator when the service isn't running", async () => { - const onHasData = jest.fn(); render( ); @@ -144,7 +151,6 @@ describe('transaction_details/distribution', () => { await waitFor(() => { expect(screen.getByTestId('apmCorrelationsChart')).toBeInTheDocument(); expect(screen.queryByTestId('loading')).toBeNull(); // it doesn't exist - expect(onHasData).toHaveBeenLastCalledWith(false); }); }); }); 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 2da61bc0fc555..d77d337db2de6 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 @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useCallback, useEffect, useState } from 'react'; +import React, { useEffect } from 'react'; import { BrushEndListener, XYBrushArea } from '@elastic/charts'; import { EuiBadge, @@ -17,21 +17,31 @@ import { EuiTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; + +import { useUiTracker } from '../../../../../../observability/public'; + import { getDurationFormatter } from '../../../../../common/utils/formatters'; -import { useUrlParams } from '../../../../context/url_params_context/use_url_params'; +import { + APM_SEARCH_STRATEGIES, + DEFAULT_PERCENTILE_THRESHOLD, +} from '../../../../../common/search_strategies/constants'; + import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context'; -import { useTransactionDistributionFetcher } from '../../../../hooks/use_transaction_distribution_fetcher'; +import { useSearchStrategy } from '../../../../hooks/use_search_strategy'; +import { useUrlParams } from '../../../../context/url_params_context/use_url_params'; +import { FETCH_STATUS } from '../../../../hooks/use_fetcher'; + import { - OnHasData, TransactionDistributionChart, + TransactionDistributionChartData, } from '../../../shared/charts/transaction_distribution_chart'; -import { useUiTracker } from '../../../../../../observability/public'; -import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; -import { useApmParams } from '../../../../hooks/use_apm_params'; import { isErrorMessage } from '../../correlations/utils/is_error_message'; -import { useTimeRange } from '../../../../hooks/use_time_range'; +import { getOverallHistogram } from '../../correlations/utils/get_overall_histogram'; + +import type { TabContentProps } from '../types'; +import { useWaterfallFetcher } from '../use_waterfall_fetcher'; +import { WaterfallWithSummary } from '../waterfall_with_summary'; -const DEFAULT_PERCENTILE_THRESHOLD = 95; // Enforce min height so it's consistent across all tabs on the same level // to prevent "flickering" behavior const MIN_TAB_TITLE_HEIGHT = 56; @@ -51,45 +61,28 @@ export function getFormattedSelection(selection: Selection): string { } interface TransactionDistributionProps { - markerCurrentTransaction?: number; onChartSelection: BrushEndListener; onClearSelection: () => void; - onHasData: OnHasData; selection?: Selection; + traceSamples: TabContentProps['traceSamples']; } export function TransactionDistribution({ - markerCurrentTransaction, onChartSelection, onClearSelection, - onHasData, selection, + traceSamples, }: TransactionDistributionProps) { const { core: { notifications }, } = useApmPluginContext(); - const { serviceName, transactionType } = useApmServiceContext(); - - const { - query: { kuery, environment, rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName/transactions/view'); - - const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - const { urlParams } = useUrlParams(); - const { transactionName } = urlParams; + const { waterfall, status: waterfallStatus } = useWaterfallFetcher(); - const [showSelection, setShowSelection] = useState(false); - - const onTransactionDistributionHasData: OnHasData = useCallback( - (hasData) => { - setShowSelection(hasData); - onHasData(hasData); - }, - [onHasData] - ); + const markerCurrentTransaction = + waterfall.entryWaterfallTransaction?.doc.transaction.duration.us; const emptySelectionText = i18n.translate( 'xpack.apm.transactionDetails.emptySelectionText', @@ -105,43 +98,20 @@ export function TransactionDistribution({ } ); - const { - error, - percentileThresholdValue, - startFetch, - cancelFetch, - transactionDistribution, - } = useTransactionDistributionFetcher(); - - const startFetchHandler = useCallback(() => { - startFetch({ - environment, - kuery, - serviceName, - transactionName, - transactionType, - start, - end, + const { progress, response } = useSearchStrategy( + APM_SEARCH_STRATEGIES.APM_LATENCY_CORRELATIONS, + { percentileThreshold: DEFAULT_PERCENTILE_THRESHOLD, - }); - }, [ - startFetch, - environment, - serviceName, - transactionName, - transactionType, - kuery, - start, - end, - ]); - - useEffect(() => { - startFetchHandler(); - return cancelFetch; - }, [cancelFetch, startFetchHandler]); + analyzeCorrelations: false, + } + ); + const { overallHistogram, hasData, status } = getOverallHistogram( + response, + progress.isRunning + ); useEffect(() => { - if (isErrorMessage(error)) { + if (isErrorMessage(progress.error)) { notifications.toasts.addDanger({ title: i18n.translate( 'xpack.apm.transactionDetails.distribution.errorTitle', @@ -149,10 +119,10 @@ export function TransactionDistribution({ defaultMessage: 'An error occurred fetching the distribution', } ), - text: error.toString(), + text: progress.error.toString(), }); } - }, [error, notifications.toasts]); + }, [progress.error, notifications.toasts]); const trackApmEvent = useUiTracker({ app: 'apm' }); @@ -168,6 +138,18 @@ export function TransactionDistribution({ trackApmEvent({ metric: 'transaction_distribution_chart_clear_selection' }); }; + const transactionDistributionChartData: TransactionDistributionChartData[] = []; + + if (Array.isArray(overallHistogram)) { + transactionDistributionChartData.push({ + id: i18n.translate( + 'xpack.apm.transactionDistribution.chart.allTransactionsLabel', + { defaultMessage: 'All transactions' } + ), + histogram: overallHistogram, + }); + } + return (
@@ -183,7 +165,7 @@ export function TransactionDistribution({ - {showSelection && !selection && ( + {hasData && !selection && ( )} - {showSelection && selection && ( + {hasData && selection && ( + + {hasData && ( + <> + + + + + )}
); } diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/index.tsx index 06acaeeb5dd3b..96c7f104de404 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/index.tsx @@ -7,6 +7,8 @@ import { EuiSpacer, EuiTitle } from '@elastic/eui'; import React from 'react'; +import { useHistory } from 'react-router-dom'; +import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context'; import { useBreadcrumb } from '../../../context/breadcrumbs/use_breadcrumb'; import { ChartPointerEventContextProvider } from '../../../context/chart_pointer_event/chart_pointer_event_context'; import { useApmParams } from '../../../hooks/use_apm_params'; @@ -15,22 +17,33 @@ import { useTimeRange } from '../../../hooks/use_time_range'; import { useFallbackToTransactionsFetcher } from '../../../hooks/use_fallback_to_transactions_fetcher'; import { AggregatedTransactionsBadge } from '../../shared/aggregated_transactions_badge'; import { TransactionCharts } from '../../shared/charts/transaction_charts'; - +import { replace } from '../../shared/Links/url_helpers'; import { TransactionDetailsTabs } from './transaction_details_tabs'; export function TransactionDetails() { const { path, query } = useApmParams( - '/services/:serviceName/transactions/view' + '/services/{serviceName}/transactions/view' ); - const { transactionName, rangeFrom, rangeTo } = query; - + const { + transactionName, + rangeFrom, + rangeTo, + transactionType: transactionTypeFromUrl, + } = query; const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - const apmRouter = useApmRouter(); + const { transactionType } = useApmServiceContext(); + + const history = useHistory(); + + // redirect to first transaction type + if (!transactionTypeFromUrl && transactionType) { + replace(history, { query: { transactionType } }); + } useBreadcrumb({ title: transactionName, - href: apmRouter.link('/services/:serviceName/transactions/view', { + href: apmRouter.link('/services/{serviceName}/transactions/view', { path, query, }), diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/trace_samples_tab.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/trace_samples_tab.tsx index ea02cfea5a941..ad629b7a2d132 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/trace_samples_tab.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/trace_samples_tab.tsx @@ -5,19 +5,12 @@ * 2.0. */ -import React, { useState } from 'react'; - -import { EuiSpacer } from '@elastic/eui'; +import React from 'react'; import { i18n } from '@kbn/i18n'; -import { useUrlParams } from '../../../context/url_params_context/use_url_params'; -import { FETCH_STATUS } from '../../../hooks/use_fetcher'; - import { TransactionDistribution } from './distribution'; -import { useWaterfallFetcher } from './use_waterfall_fetcher'; import type { TabContentProps } from './types'; -import { WaterfallWithSummary } from './waterfall_with_summary'; function TraceSamplesTab({ selectSampleFromChartSelection, @@ -26,49 +19,17 @@ function TraceSamplesTab({ sampleRangeTo, traceSamples, }: TabContentProps) { - const { urlParams } = useUrlParams(); - - const { - waterfall, - exceedsMax, - status: waterfallStatus, - } = useWaterfallFetcher(); - - const [ - transactionDistributionHasData, - setTransactionDistributionHasData, - ] = useState(false); - return ( - <> - - - {transactionDistributionHasData && ( - <> - - - - - )} - + ); } 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 160d41bfa9bde..b249161980586 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 @@ -32,7 +32,7 @@ const tabs = [ ]; export function TransactionDetailsTabs() { - const { query } = useApmParams('/services/:serviceName/transactions/view'); + const { query } = useApmParams('/services/{serviceName}/transactions/view'); const { urlParams } = useUrlParams(); const history = useHistory(); diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/use_waterfall_fetcher.ts b/x-pack/plugins/apm/public/components/app/transaction_details/use_waterfall_fetcher.ts index 6bde8edcc250a..1506580d7b9e3 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/use_waterfall_fetcher.ts +++ b/x-pack/plugins/apm/public/components/app/transaction_details/use_waterfall_fetcher.ts @@ -13,9 +13,9 @@ import { useTimeRange } from '../../../hooks/use_time_range'; import { getWaterfall } from './waterfall_with_summary/waterfall_container/Waterfall/waterfall_helpers/waterfall_helpers'; const INITIAL_DATA = { - root: undefined, - trace: { items: [], exceedsMax: false, errorDocs: [] }, - errorsPerTransaction: {}, + errorDocs: [], + traceDocs: [], + exceedsMax: false, }; export function useWaterfallFetcher() { @@ -24,7 +24,7 @@ export function useWaterfallFetcher() { const { query: { rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName/transactions/view'); + } = useApmParams('/services/{serviceName}/transactions/view'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); @@ -51,5 +51,5 @@ export function useWaterfallFetcher() { transactionId, ]); - return { waterfall, status, error, exceedsMax: data.trace.exceedsMax }; + return { waterfall, status, error }; } diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/ErrorCount.test.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/ErrorCount.test.tsx deleted file mode 100644 index b8476200abfe3..0000000000000 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/ErrorCount.test.tsx +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { fireEvent, render } from '@testing-library/react'; -import React from 'react'; -import { expectTextsInDocument } from '../../../../utils/testHelpers'; -import { ErrorCount } from './ErrorCount'; - -describe('ErrorCount', () => { - it('shows singular error message', () => { - const component = render(); - expectTextsInDocument(component, ['1 Error']); - }); - it('shows plural error message', () => { - const component = render(); - expectTextsInDocument(component, ['2 Errors']); - }); - it('prevents click propagation', () => { - const mock = jest.fn(); - const { getByText } = render( - - ); - fireEvent( - getByText('1 Error'), - new MouseEvent('click', { - bubbles: true, - cancelable: true, - }) - ); - expect(mock).not.toHaveBeenCalled(); - }); -}); diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/ErrorCount.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/ErrorCount.tsx deleted file mode 100644 index c66cff89eb0c1..0000000000000 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/ErrorCount.tsx +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiText, EuiTextColor } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import React from 'react'; - -interface Props { - count: number; -} - -export function ErrorCount({ count }: Props) { - return ( - -

- { - e.stopPropagation(); - }} - > - {i18n.translate('xpack.apm.transactionDetails.errorCount', { - defaultMessage: - '{errorCount, number} {errorCount, plural, one {Error} other {Errors}}', - values: { errorCount: count }, - })} - -

-
- ); -} diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/TransactionTabs.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/TransactionTabs.tsx index d402a2b19b5a9..0e01c44b3fb5a 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/TransactionTabs.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/TransactionTabs.tsx @@ -21,15 +21,9 @@ interface Props { transaction: Transaction; urlParams: ApmUrlParams; waterfall: IWaterfall; - exceedsMax: boolean; } -export function TransactionTabs({ - transaction, - urlParams, - waterfall, - exceedsMax, -}: Props) { +export function TransactionTabs({ transaction, urlParams, waterfall }: Props) { const history = useHistory(); const tabs = [timelineTab, metadataTab, logsTab]; const currentTab = @@ -65,7 +59,6 @@ export function TransactionTabs({ @@ -99,19 +92,11 @@ const logsTab = { function TimelineTabContent({ urlParams, waterfall, - exceedsMax, }: { urlParams: ApmUrlParams; waterfall: IWaterfall; - exceedsMax: boolean; }) { - return ( - - ); + return ; } function MetadataTabContent({ transaction }: { transaction: Transaction }) { 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 b7feb917d2184..93ee75d852e5d 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 @@ -30,7 +30,6 @@ import { useApmParams } from '../../../../hooks/use_apm_params'; interface Props { urlParams: ApmUrlParams; waterfall: IWaterfall; - exceedsMax: boolean; isLoading: boolean; traceSamples: TraceSample[]; } @@ -38,7 +37,6 @@ interface Props { export function WaterfallWithSummary({ urlParams, waterfall, - exceedsMax, isLoading, traceSamples, }: Props) { @@ -47,7 +45,7 @@ export function WaterfallWithSummary({ const { query: { environment }, - } = useApmParams('/services/:serviceName/transactions/view'); + } = useApmParams('/services/{serviceName}/transactions/view'); useEffect(() => { setSampleActivePage(0); @@ -125,7 +123,7 @@ export function WaterfallWithSummary({ @@ -135,7 +133,6 @@ export function WaterfallWithSummary({ transaction={entryTransaction} urlParams={urlParams} waterfall={waterfall} - exceedsMax={exceedsMax} /> ); diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/FlyoutTopLevelProperties.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/FlyoutTopLevelProperties.tsx index 6bbcfcf545ee1..8954081f9ab47 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/FlyoutTopLevelProperties.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/FlyoutTopLevelProperties.tsx @@ -27,7 +27,7 @@ export function FlyoutTopLevelProperties({ transaction }: Props) { const { urlParams: { latencyAggregationType }, } = useUrlParams(); - const { query } = useApmParams('/services/:serviceName/transactions/view'); + const { query } = useApmParams('/services/{serviceName}/transactions/view'); if (!transaction) { return null; 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 1935d373caf79..e4a851b890a7c 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 @@ -22,8 +22,7 @@ interface AccordionWaterfallProps { level: number; duration: IWaterfall['duration']; waterfallItemId?: string; - errorsPerTransaction: IWaterfall['errorsPerTransaction']; - childrenByParentId: Record; + waterfall: IWaterfall; onToggleEntryTransaction?: () => void; timelineMargins: Margins; onClickWaterfallItem: (item: IWaterfallSpanOrTransaction) => void; @@ -96,9 +95,8 @@ export function AccordionWaterfall(props: AccordionWaterfallProps) { item, level, duration, - childrenByParentId, + waterfall, waterfallItemId, - errorsPerTransaction, timelineMargins, onClickWaterfallItem, onToggleEntryTransaction, @@ -106,12 +104,8 @@ export function AccordionWaterfall(props: AccordionWaterfallProps) { const nextLevel = level + 1; - const errorCount = - item.docType === 'transaction' - ? errorsPerTransaction[item.doc.transaction.id] - : 0; - - const children = childrenByParentId[item.id] || []; + const children = waterfall.childrenByParentId[item.id] || []; + const errorCount = waterfall.getErrorCount(item.id); // To indent the items creating the parent/child tree const marginLeftLevel = 8 * level; @@ -121,7 +115,7 @@ export function AccordionWaterfall(props: AccordionWaterfallProps) { buttonClassName={`button_${item.id}`} key={item.id} id={item.id} - hasError={errorCount > 0} + hasError={item.doc.event?.outcome === 'failure'} marginLeftLevel={marginLeftLevel} childrenCount={children.length} buttonContent={ @@ -152,16 +146,11 @@ export function AccordionWaterfall(props: AccordionWaterfallProps) { > {children.map((child) => ( ))} diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/failure_badge.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/failure_badge.tsx new file mode 100644 index 0000000000000..14f47fe22b4c0 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/failure_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 from 'react'; +import { EuiBadge, EuiToolTip } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { EventOutcome } from '../../../../../../../typings/es_schemas/raw/fields/event_outcome'; +import { useTheme } from '../../../../../../hooks/use_theme'; +import { euiStyled } from '../../../../../../../../../../src/plugins/kibana_react/common'; + +const ResetLineHeight = euiStyled.span` + line-height: initial; +`; + +export function FailureBadge({ outcome }: { outcome?: EventOutcome }) { + const theme = useTheme(); + + if (outcome !== 'failure') { + return null; + } + + return ( + + + failure + + + ); +} 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 d31af783e08c2..3932a02c9d974 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 @@ -21,7 +21,6 @@ import { WaterfallFlyout } from './waterfall_flyout'; import { IWaterfall, IWaterfallItem, - IWaterfallSpanOrTransaction, } from './waterfall_helpers/waterfall_helpers'; const Container = euiStyled.div` @@ -61,9 +60,8 @@ const WaterfallItemsContainer = euiStyled.div` interface Props { waterfallItemId?: string; waterfall: IWaterfall; - exceedsMax: boolean; } -export function Waterfall({ waterfall, exceedsMax, waterfallItemId }: Props) { +export function Waterfall({ waterfall, waterfallItemId }: 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 @@ -74,37 +72,10 @@ export function Waterfall({ waterfall, exceedsMax, waterfallItemId }: Props) { const agentMarks = getAgentMarks(waterfall.entryWaterfallTransaction?.doc); const errorMarks = getErrorMarks(waterfall.errorItems); - function renderItems( - childrenByParentId: Record - ) { - const { entryWaterfallTransaction } = waterfall; - if (!entryWaterfallTransaction) { - return null; - } - return ( - - toggleFlyout({ history, item }) - } - onToggleEntryTransaction={() => setIsAccordionOpen((isOpen) => !isOpen)} - /> - ); - } - return ( - {exceedsMax && ( + {waterfall.apiResponse.exceedsMax && (
- {renderItems(waterfall.childrenByParentId)} + {!waterfall.entryWaterfallTransaction ? null : ( + + toggleFlyout({ history, item }) + } + onToggleEntryTransaction={() => + setIsAccordionOpen((isOpen) => !isOpen) + } + /> + )}
diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/span_flyout/database_context.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/span_flyout/database_context.tsx deleted file mode 100644 index 4279205743442..0000000000000 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/span_flyout/database_context.tsx +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiSpacer, EuiTitle } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { tint } from 'polished'; -import React, { Fragment } from 'react'; -import { Light as SyntaxHighlighter } from 'react-syntax-highlighter'; -import sql from 'react-syntax-highlighter/dist/cjs/languages/hljs/sql'; -import xcode from 'react-syntax-highlighter/dist/cjs/styles/hljs/xcode'; -import { euiStyled } from '../../../../../../../../../../../src/plugins/kibana_react/common'; -import { Span } from '../../../../../../../../typings/es_schemas/ui/span'; -import { useTheme } from '../../../../../../../hooks/use_theme'; -import { TruncateHeightSection } from './truncate_height_section'; - -SyntaxHighlighter.registerLanguage('sql', sql); - -const DatabaseStatement = euiStyled.div` - padding: ${({ theme }) => - `${theme.eui.paddingSizes.s} ${theme.eui.paddingSizes.m}`}; - background: ${({ theme }) => tint(0.9, theme.eui.euiColorWarning)}; - border-radius: ${({ theme }) => theme.eui.euiBorderRadiusSmall}; - border: 1px solid ${({ theme }) => theme.eui.euiColorLightShade}; - font-family: ${({ theme }) => theme.eui.euiCodeFontFamily}; - font-size: ${({ theme }) => theme.eui.euiFontSizeS}; -`; - -interface Props { - dbContext?: NonNullable['db']; -} - -export function DatabaseContext({ dbContext }: Props) { - const theme = useTheme(); - const dbSyntaxLineHeight = theme.eui.euiSizeL; - const previewHeight = 240; // 10 * dbSyntaxLineHeight - - if (!dbContext || !dbContext.statement) { - return null; - } - - if (dbContext.type !== 'sql') { - return {dbContext.statement}; - } - - return ( - - -

- {i18n.translate( - 'xpack.apm.transactionDetails.spanFlyout.databaseStatementTitle', - { - defaultMessage: 'Database statement', - } - )} -

-
- - - - - {dbContext.statement} - - - - -
- ); -} diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/span_flyout/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/span_flyout/index.tsx index 50fc56dff7f85..4921dfe0606c3 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/span_flyout/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/span_flyout/index.tsx @@ -35,8 +35,9 @@ import { HttpInfoSummaryItem } from '../../../../../../shared/Summary/http_info_ import { TimestampTooltip } from '../../../../../../shared/TimestampTooltip'; import { ResponsiveFlyout } from '../ResponsiveFlyout'; import { SyncBadge } from '../sync_badge'; -import { DatabaseContext } from './database_context'; +import { SpanDatabase } from './span_db'; import { StickySpanProperties } from './sticky_span_properties'; +import { FailureBadge } from '../failure_badge'; function formatType(type: string) { switch (type) { @@ -73,13 +74,11 @@ function getSpanTypes(span: Span) { }; } -const SpanBadge = euiStyled(EuiBadge)` - display: inline-block; - margin-right: ${({ theme }) => theme.eui.euiSizeXS}; -`; - -const HttpInfoContainer = euiStyled('div')` - margin-right: ${({ theme }) => theme.eui.euiSizeXS}; +const ContainerWithMarginRight = euiStyled.div` + /* add margin to all direct descendants */ + & > * { + margin-right: ${({ theme }) => theme.eui.euiSizeXS}; + } `; interface Props { @@ -101,7 +100,7 @@ export function SpanFlyout({ const stackframes = span.span.stacktrace; const codeLanguage = parentTransaction?.service.language?.name; - const dbContext = span.span.db; + const spanDb = span.span.db; const httpContext = span.span.http; const spanTypes = getSpanTypes(span); const spanHttpStatusCode = httpContext?.response?.status_code; @@ -173,15 +172,13 @@ export function SpanFlyout({ /> )} , - <> + {spanHttpUrl && ( - - - + )} - {spanTypes.spanType} + {spanTypes.spanType} {spanTypes.spanSubtype && ( - - {spanTypes.spanSubtype} - + {spanTypes.spanSubtype} )} {spanTypes.spanAction && ( @@ -210,15 +205,18 @@ export function SpanFlyout({ { defaultMessage: 'Action' } )} > - {spanTypes.spanAction} + {spanTypes.spanAction} )} + + + - , + , ]} /> - + + `${theme.eui.paddingSizes.s} ${theme.eui.paddingSizes.m}`}; + background: ${({ theme }) => tint(0.9, theme.eui.euiColorWarning)}; + border-radius: ${({ theme }) => theme.eui.euiBorderRadiusSmall}; + border: 1px solid ${({ theme }) => theme.eui.euiColorLightShade}; + font-family: ${({ theme }) => theme.eui.euiCodeFontFamily}; + font-size: ${({ theme }) => theme.eui.euiFontSizeS}; +`; + +interface Props { + spanDb?: NonNullable['db']; +} + +export function SpanDatabase({ spanDb }: Props) { + const theme = useTheme(); + const dbSyntaxLineHeight = theme.eui.euiSizeL; + const previewHeight = 240; // 10 * dbSyntaxLineHeight + + if (!spanDb || !spanDb.statement) { + return null; + } + + if (spanDb.type !== 'sql') { + return {spanDb.statement}; + } + + return ( + + +

+ {i18n.translate( + 'xpack.apm.transactionDetails.spanFlyout.databaseStatementTitle', + { + defaultMessage: 'Database statement', + } + )} +

+
+ + + + + {spanDb.statement} + + + + +
+ ); +} 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 97e353d22ccf6..2e02dcee95371 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,7 @@ interface Props { } export function StickySpanProperties({ span, transaction }: Props) { - const { query } = useApmParams('/services/:serviceName/transactions/view'); + const { query } = useApmParams('/services/{serviceName}/transactions/view'); const { environment, latencyAggregationType } = query; const trackEvent = useUiTracker(); diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/sync_badge.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/sync_badge.tsx index cfc369fa12a26..fe74f3d51c8bc 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/sync_badge.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/sync_badge.tsx @@ -8,12 +8,6 @@ import { EuiBadge } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { euiStyled } from '../../../../../../../../../../src/plugins/kibana_react/common'; - -const SpanBadge = euiStyled(EuiBadge)` - display: inline-block; - margin-right: ${({ theme }) => theme.eui.euiSizeXS}; -`; export interface SyncBadgeProps { /** @@ -26,19 +20,19 @@ export function SyncBadge({ sync }: SyncBadgeProps) { switch (sync) { case true: return ( - + {i18n.translate('xpack.apm.transactionDetails.syncBadgeBlocking', { defaultMessage: 'blocking', })} - + ); case false: return ( - + {i18n.translate('xpack.apm.transactionDetails.syncBadgeAsync', { defaultMessage: 'async', })} - + ); default: return null; diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/transaction_flyout/DroppedSpansWarning.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/transaction_flyout/DroppedSpansWarning.tsx index 6fb1cdc45805e..2c6dbe99b6061 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/transaction_flyout/DroppedSpansWarning.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/transaction_flyout/DroppedSpansWarning.tsx @@ -5,17 +5,18 @@ * 2.0. */ -import { EuiCallOut, EuiHorizontalRule } from '@elastic/eui'; +import { EuiCallOut, EuiHorizontalRule, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; import { Transaction } from '../../../../../../../../typings/es_schemas/ui/transaction'; -import { ElasticDocsLink } from '../../../../../../shared/Links/ElasticDocsLink'; +import { useApmPluginContext } from '../../../../../../../context/apm_plugin/use_apm_plugin_context'; export function DroppedSpansWarning({ transactionDoc, }: { transactionDoc: Transaction; }) { + const { docLinks } = useApmPluginContext().core; const dropped = transactionDoc.transaction.span_count?.dropped; if (!dropped) { return null; @@ -32,18 +33,14 @@ export function DroppedSpansWarning({ values: { dropped }, } )}{' '} - + {i18n.translate( 'xpack.apm.transactionDetails.transFlyout.callout.learnMoreAboutDroppedSpansLinkText', { defaultMessage: 'Learn more about dropped spans.', } )} - + diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/waterfall_flyout.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/waterfall_flyout.tsx index 4163388db1ec0..948f790848e8f 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/waterfall_flyout.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/waterfall_flyout.tsx @@ -55,7 +55,7 @@ export function WaterfallFlyout({ rootTransactionDuration={ waterfall.rootTransaction?.transaction.duration.us } - errorCount={waterfall.errorsPerTransaction[currentItem.id]} + errorCount={waterfall.getErrorCount(currentItem.id)} /> ); default: diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/waterfall_helpers/__snapshots__/waterfall_helpers.test.ts.snap b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/waterfall_helpers/__snapshots__/waterfall_helpers.test.ts.snap index 8905162daada2..b1ea74c3eb0c0 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/waterfall_helpers/__snapshots__/waterfall_helpers.test.ts.snap +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/waterfall_helpers/__snapshots__/waterfall_helpers.test.ts.snap @@ -912,11 +912,7 @@ Object { "skew": 0, }, ], - "errorsCount": 1, - "errorsPerTransaction": Object { - "myTransactionId1": 2, - "myTransactionId2": 3, - }, + "getErrorCount": [Function], "items": Array [ Object { "color": "", @@ -2188,11 +2184,7 @@ Object { "skew": 0, }, "errorItems": Array [], - "errorsCount": 0, - "errorsPerTransaction": Object { - "myTransactionId1": 2, - "myTransactionId2": 3, - }, + "getErrorCount": [Function], "items": Array [ Object { "color": "", diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/waterfall_helpers/waterfall_helpers.test.ts b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/waterfall_helpers/waterfall_helpers.test.ts index 34933a3a6f8ec..3e0c5034f37a2 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/waterfall_helpers/waterfall_helpers.test.ts +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/waterfall_helpers/waterfall_helpers.test.ts @@ -129,44 +129,39 @@ describe('waterfall_helpers', () => { it('should return full waterfall', () => { const entryTransactionId = 'myTransactionId1'; - const errorsPerTransaction = { - myTransactionId1: 2, - myTransactionId2: 3, + const apiResp = { + traceDocs: hits, + errorDocs, + exceedsMax: false, }; - const waterfall = getWaterfall( - { - trace: { items: hits, errorDocs, exceedsMax: false }, - errorsPerTransaction, - }, - entryTransactionId - ); + const waterfall = getWaterfall(apiResp, entryTransactionId); + const { apiResponse, ...waterfallRest } = waterfall; expect(waterfall.items.length).toBe(6); expect(waterfall.items[0].id).toBe('myTransactionId1'); expect(waterfall.errorItems.length).toBe(1); - expect(waterfall.errorsCount).toEqual(1); - expect(waterfall).toMatchSnapshot(); + expect(waterfall.getErrorCount('myTransactionId1')).toEqual(1); + expect(waterfallRest).toMatchSnapshot(); + expect(apiResponse).toEqual(apiResp); }); it('should return partial waterfall', () => { const entryTransactionId = 'myTransactionId2'; - const errorsPerTransaction = { - myTransactionId1: 2, - myTransactionId2: 3, + const apiResp = { + traceDocs: hits, + errorDocs, + exceedsMax: false, }; - const waterfall = getWaterfall( - { - trace: { items: hits, errorDocs, exceedsMax: false }, - errorsPerTransaction, - }, - entryTransactionId - ); + const waterfall = getWaterfall(apiResp, entryTransactionId); + + const { apiResponse, ...waterfallRest } = waterfall; expect(waterfall.items.length).toBe(4); expect(waterfall.items[0].id).toBe('myTransactionId2'); expect(waterfall.errorItems.length).toBe(0); - expect(waterfall.errorsCount).toEqual(0); - expect(waterfall).toMatchSnapshot(); + expect(waterfall.getErrorCount('myTransactionId2')).toEqual(0); + expect(waterfallRest).toMatchSnapshot(); + expect(apiResponse).toEqual(apiResp); }); it('should reparent spans', () => { const traceItems = [ @@ -238,8 +233,9 @@ describe('waterfall_helpers', () => { const entryTransactionId = 'myTransactionId1'; const waterfall = getWaterfall( { - trace: { items: traceItems, errorDocs: [], exceedsMax: false }, - errorsPerTransaction: {}, + traceDocs: traceItems, + errorDocs: [], + exceedsMax: false, }, entryTransactionId ); @@ -247,6 +243,7 @@ describe('waterfall_helpers', () => { id: item.id, parentId: item.parent?.id, }); + expect(waterfall.items.length).toBe(5); expect(getIdAndParentId(waterfall.items[0])).toEqual({ id: 'myTransactionId1', @@ -269,8 +266,9 @@ describe('waterfall_helpers', () => { parentId: 'mySpanIdB', }); expect(waterfall.errorItems.length).toBe(0); - expect(waterfall.errorsCount).toEqual(0); + expect(waterfall.getErrorCount('myTransactionId1')).toEqual(0); }); + it("shouldn't reparent spans when child id isn't found", () => { const traceItems = [ { @@ -341,8 +339,9 @@ describe('waterfall_helpers', () => { const entryTransactionId = 'myTransactionId1'; const waterfall = getWaterfall( { - trace: { items: traceItems, errorDocs: [], exceedsMax: false }, - errorsPerTransaction: {}, + traceDocs: traceItems, + errorDocs: [], + exceedsMax: false, }, entryTransactionId ); @@ -372,7 +371,7 @@ describe('waterfall_helpers', () => { parentId: 'mySpanIdB', }); expect(waterfall.errorItems.length).toBe(0); - expect(waterfall.errorsCount).toEqual(0); + expect(waterfall.getErrorCount('myTransactionId1')).toEqual(0); }); }); diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/waterfall_helpers/waterfall_helpers.ts b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/waterfall_helpers/waterfall_helpers.ts index b6e427e8cc0a1..9501ad1839d46 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/waterfall_helpers/waterfall_helpers.ts +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/waterfall_helpers/waterfall_helpers.ts @@ -6,7 +6,7 @@ */ import { euiPaletteColorBlind } from '@elastic/eui'; -import { first, flatten, groupBy, isEmpty, sortBy, sum, uniq } from 'lodash'; +import { first, flatten, groupBy, isEmpty, sortBy, uniq } from 'lodash'; import { APIReturnType } from '../../../../../../../services/rest/createCallApmApi'; import { APMError } from '../../../../../../../../typings/es_schemas/ui/apm_error'; import { Span } from '../../../../../../../../typings/es_schemas/ui/span'; @@ -35,10 +35,10 @@ export interface IWaterfall { duration: number; items: IWaterfallItem[]; childrenByParentId: Record; - errorsPerTransaction: TraceAPIResponse['errorsPerTransaction']; - errorsCount: number; + getErrorCount: (parentId: string) => number; legends: IWaterfallLegend[]; errorItems: IWaterfallError[]; + apiResponse: TraceAPIResponse; } interface IWaterfallSpanItemBase @@ -80,7 +80,8 @@ export type IWaterfallSpanOrTransaction = | IWaterfallTransaction | IWaterfallSpan; -export type IWaterfallItem = IWaterfallSpanOrTransaction | IWaterfallError; +// export type IWaterfallItem = IWaterfallSpanOrTransaction | IWaterfallError; +export type IWaterfallItem = IWaterfallSpanOrTransaction; export interface IWaterfallLegend { type: WaterfallLegendType; @@ -264,7 +265,7 @@ const getWaterfallDuration = (waterfallItems: IWaterfallItem[]) => 0 ); -const getWaterfallItems = (items: TraceAPIResponse['trace']['items']) => +const getWaterfallItems = (items: TraceAPIResponse['traceDocs']) => items.map((item) => { const docType = item.processor.event; switch (docType) { @@ -332,7 +333,7 @@ function isInEntryTransaction( } function getWaterfallErrors( - errorDocs: TraceAPIResponse['trace']['errorDocs'], + errorDocs: TraceAPIResponse['errorDocs'], items: IWaterfallItem[], entryWaterfallTransaction?: IWaterfallTransaction ) { @@ -358,24 +359,44 @@ function getWaterfallErrors( ); } +// map parent.id to the number of errors +/* + { 'parentId': 2 } + */ +function getErrorCountByParentId(errorDocs: TraceAPIResponse['errorDocs']) { + return errorDocs.reduce>((acc, doc) => { + const parentId = doc.parent?.id; + + if (!parentId) { + return acc; + } + + acc[parentId] = (acc[parentId] ?? 0) + 1; + + return acc; + }, {}); +} + export function getWaterfall( - { trace, errorsPerTransaction }: TraceAPIResponse, + apiResponse: TraceAPIResponse, entryTransactionId?: Transaction['transaction']['id'] ): IWaterfall { - if (isEmpty(trace.items) || !entryTransactionId) { + if (isEmpty(apiResponse.traceDocs) || !entryTransactionId) { return { + apiResponse, duration: 0, items: [], - errorsPerTransaction, - errorsCount: sum(Object.values(errorsPerTransaction)), legends: [], errorItems: [], childrenByParentId: {}, + getErrorCount: () => 0, }; } + const errorCountByParentId = getErrorCountByParentId(apiResponse.errorDocs); + const waterfallItems: IWaterfallSpanOrTransaction[] = getWaterfallItems( - trace.items + apiResponse.traceDocs ); const childrenByParentId = getChildrenGroupedByParentId( @@ -392,7 +413,7 @@ export function getWaterfall( entryWaterfallTransaction ); const errorItems = getWaterfallErrors( - trace.errorDocs, + apiResponse.errorDocs, items, entryWaterfallTransaction ); @@ -402,14 +423,14 @@ export function getWaterfall( const legends = getLegends(items); return { + apiResponse, entryWaterfallTransaction, rootTransaction, duration, items, - errorsPerTransaction, - errorsCount: errorItems.length, legends, errorItems, childrenByParentId: getChildrenGroupedByParentId(items), + getErrorCount: (parentId: string) => errorCountByParentId[parentId] ?? 0, }; } 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 3af010fb30b86..4001a0624a809 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 @@ -5,18 +5,23 @@ * 2.0. */ -import { EuiIcon, EuiText, EuiTitle, EuiToolTip } from '@elastic/eui'; +import { EuiBadge, EuiIcon, EuiText, EuiTitle, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { ReactNode } from 'react'; +import { useTheme } from '../../../../../../hooks/use_theme'; import { euiStyled } from '../../../../../../../../../../src/plugins/kibana_react/common'; import { isRumAgentName } from '../../../../../../../common/agent_name'; -import { TRACE_ID } from '../../../../../../../common/elasticsearch_fieldnames'; +import { + TRACE_ID, + TRANSACTION_ID, +} from '../../../../../../../common/elasticsearch_fieldnames'; import { asDuration } from '../../../../../../../common/utils/formatters'; import { Margins } from '../../../../../shared/charts/Timeline'; -import { ErrorOverviewLink } from '../../../../../shared/Links/apm/ErrorOverviewLink'; -import { ErrorCount } from '../../ErrorCount'; import { SyncBadge } from './sync_badge'; import { IWaterfallSpanOrTransaction } from './waterfall_helpers/waterfall_helpers'; +import { FailureBadge } from './failure_badge'; +import { useApmRouter } from '../../../../../../hooks/use_apm_router'; +import { useApmParams } from '../../../../../../hooks/use_apm_params'; type ItemType = 'transaction' | 'span' | 'error'; @@ -181,15 +186,6 @@ export function WaterfallItem({ const width = (item.duration / totalDuration) * 100; const left = ((item.offset + item.skew) / totalDuration) * 100; - const tooltipContent = i18n.translate( - 'xpack.apm.transactionDetails.errorsOverviewLinkTooltip', - { - values: { errorCount }, - defaultMessage: - '{errorCount, plural, one {View 1 related error} other {View # related errors}}', - } - ); - const isCompositeSpan = item.docType === 'span' && item.doc.span.composite; const itemBarStyle = getItemBarStyle(item, color, width, left); @@ -216,27 +212,56 @@ export function WaterfallItem({ - {errorCount > 0 && item.docType === 'transaction' ? ( - - - - - - ) : null} + + {item.docType === 'span' && } ); } +function RelatedErrors({ + item, + errorCount, +}: { + item: IWaterfallSpanOrTransaction; + errorCount: number; +}) { + const apmRouter = useApmRouter(); + const theme = useTheme(); + const { query } = useApmParams('/services/{serviceName}/transactions/view'); + + const href = apmRouter.link(`/services/{serviceName}/errors`, { + path: { serviceName: item.doc.service.name }, + query: { + ...query, + kuery: `${TRACE_ID} : "${item.doc.trace.id}" and ${TRANSACTION_ID} : "${item.doc.transaction?.id}"`, + }, + }); + + if (errorCount > 0) { + return ( + // eslint-disable-next-line jsx-a11y/click-events-have-key-events +
e.stopPropagation()}> + + {i18n.translate('xpack.apm.waterfall.errorCount', { + defaultMessage: + '{errorCount, plural, one {View related error} other {View # related errors}}', + values: { errorCount }, + })} + +
+ ); + } + + return ; +} + function getItemBarStyle( item: IWaterfallSpanOrTransaction, color: string, diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/WaterfallContainer.stories.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/WaterfallContainer.stories.tsx index f8abff2c9609c..a03b7b29f9666 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/WaterfallContainer.stories.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/WaterfallContainer.stories.tsx @@ -8,7 +8,6 @@ import React, { ComponentType } from 'react'; import { MemoryRouter } from 'react-router-dom'; import { MockApmPluginContextWrapper } from '../../../../../context/apm_plugin/mock_apm_plugin_context'; -import { APIReturnType } from '../../../../../services/rest/createCallApmApi'; import { WaterfallContainer } from './index'; import { getWaterfall } from './Waterfall/waterfall_helpers/waterfall_helpers'; import { @@ -19,8 +18,6 @@ import { urlParams, } from './waterfallContainer.stories.data'; -type TraceAPIResponse = APIReturnType<'GET /api/apm/traces/{traceId}'>; - export default { title: 'app/TransactionDetails/Waterfall', component: WaterfallContainer, @@ -36,57 +33,24 @@ export default { }; export function Example() { - const waterfall = getWaterfall( - simpleTrace as TraceAPIResponse, - '975c8d5bfd1dd20b' - ); - return ( - - ); + const waterfall = getWaterfall(simpleTrace, '975c8d5bfd1dd20b'); + return ; } export function WithErrors() { - const waterfall = getWaterfall( - (traceWithErrors as unknown) as TraceAPIResponse, - '975c8d5bfd1dd20b' - ); - return ( - - ); + const waterfall = getWaterfall(traceWithErrors, '975c8d5bfd1dd20b'); + return ; } export function ChildStartsBeforeParent() { const waterfall = getWaterfall( - traceChildStartBeforeParent as TraceAPIResponse, + traceChildStartBeforeParent, '975c8d5bfd1dd20b' ); - return ( - - ); + return ; } export function InferredSpans() { - const waterfall = getWaterfall( - inferredSpans as TraceAPIResponse, - 'f2387d37260d00bd' - ); - return ( - - ); + const waterfall = getWaterfall(inferredSpans, 'f2387d37260d00bd'); + return ; } 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 f3949fcfb03d5..6ef7651a1e404 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 @@ -19,14 +19,9 @@ import { useApmServiceContext } from '../../../../../context/apm_service/use_apm interface Props { urlParams: ApmUrlParams; waterfall: IWaterfall; - exceedsMax: boolean; } -export function WaterfallContainer({ - urlParams, - waterfall, - exceedsMax, -}: Props) { +export function WaterfallContainer({ urlParams, waterfall }: Props) { const { serviceName } = useApmServiceContext(); if (!waterfall) { @@ -83,7 +78,6 @@ export function WaterfallContainer({ ); diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfallContainer.stories.data.ts b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfallContainer.stories.data.ts index 80ae2978498b3..1e58c1bd00a28 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfallContainer.stories.data.ts +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfallContainer.stories.data.ts @@ -7,6 +7,7 @@ import type { Location } from 'history'; import type { ApmUrlParams } from '../../../../../context/url_params_context/types'; +import { APIReturnType } from '../../../../../services/rest/createCallApmApi'; export const location = { pathname: '/services/opbeans-go/transactions/view', @@ -15,6 +16,8 @@ export const location = { hash: '', } as Location; +type TraceAPIResponse = APIReturnType<'GET /api/apm/traces/{traceId}'>; + export const urlParams = { start: '2020-03-22T15:16:38.742Z', end: '2020-03-23T15:16:38.742Z', @@ -32,2296 +35,2265 @@ export const urlParams = { } as ApmUrlParams; export const simpleTrace = { - trace: { - items: [ - { - container: { - id: + traceDocs: [ + { + container: { + id: '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', + }, + process: { + pid: 6, + title: '/usr/lib/jvm/java-10-openjdk-amd64/bin/java', + ppid: 1, + }, + agent: { + name: 'java', + ephemeral_id: '99ce8403-5875-4945-b074-d37dc10563eb', + version: '1.14.1-SNAPSHOT', + }, + internal: { + sampler: { + value: 46, + }, + }, + source: { + ip: '172.19.0.13', + }, + processor: { + name: 'transaction', + event: 'transaction', + }, + url: { + path: '/api/orders', + scheme: 'http', + port: 3000, + domain: '172.19.0.9', + full: 'http://172.19.0.9:3000/api/orders', + }, + observer: { + hostname: 'f37f48d8b60b', + id: 'd8522e1f-be8e-43c2-b290-ac6b6c0f171e', + ephemeral_id: '6ed88f14-170e-478d-a4f5-ea5e7f4b16b9', + type: 'apm-server', + version: '8.0.0', + version_major: 8, + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + '@timestamp': '2020-03-23T15:04:28.785Z', + ecs: { + version: '1.4.0', + }, + service: { + node: { + name: '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', }, - process: { - pid: 6, - title: '/usr/lib/jvm/java-10-openjdk-amd64/bin/java', - ppid: 1, + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '10.0.2', }, - agent: { - name: 'java', - ephemeral_id: '99ce8403-5875-4945-b074-d37dc10563eb', - version: '1.14.1-SNAPSHOT', + language: { + name: 'Java', + version: '10.0.2', }, - internal: { - sampler: { - value: 46, - }, + version: 'None', + }, + host: { + hostname: '4cf84d094553', + os: { + platform: 'Linux', + }, + ip: '172.19.0.9', + name: '4cf84d094553', + architecture: 'amd64', + }, + http: { + request: { + headers: { + Accept: ['*/*'], + 'User-Agent': ['Python/3.7 aiohttp/3.3.2'], + Host: ['172.19.0.9:3000'], + 'Accept-Encoding': ['gzip, deflate'], + }, + method: 'get', + socket: { + encrypted: false, + remote_address: '172.19.0.13', + }, + body: { + original: '[REDACTED]', + }, + }, + response: { + headers: { + 'Transfer-Encoding': ['chunked'], + Date: ['Mon, 23 Mar 2020 15:04:28 GMT'], + 'Content-Type': ['application/json;charset=ISO-8859-1'], + }, + status_code: 200, + finished: true, + headers_sent: true, + }, + version: '1.1', + }, + client: { + ip: '172.19.0.13', + }, + transaction: { + duration: { + us: 18842, + }, + result: 'HTTP 2xx', + name: 'DispatcherServlet#doGet', + id: '49809ad3c26adf74', + span_count: { + dropped: 0, + started: 1, + }, + type: 'request', + sampled: true, + }, + user_agent: { + original: 'Python/3.7 aiohttp/3.3.2', + name: 'Other', + device: { + name: 'Other', }, - source: { - ip: '172.19.0.13', - }, - processor: { - name: 'transaction', - event: 'transaction', - }, - url: { - path: '/api/orders', - scheme: 'http', - port: 3000, - domain: '172.19.0.9', - full: 'http://172.19.0.9:3000/api/orders', - }, - observer: { - hostname: 'f37f48d8b60b', - id: 'd8522e1f-be8e-43c2-b290-ac6b6c0f171e', - ephemeral_id: '6ed88f14-170e-478d-a4f5-ea5e7f4b16b9', - type: 'apm-server', - version: '8.0.0', - version_major: 8, - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - '@timestamp': '2020-03-23T15:04:28.785Z', - ecs: { - version: '1.4.0', - }, - service: { - node: { - name: - '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', - }, - environment: 'production', - name: 'opbeans-java', - runtime: { - name: 'Java', - version: '10.0.2', - }, - language: { - name: 'Java', - version: '10.0.2', - }, - version: 'None', + }, + timestamp: { + us: 1584975868785000, + }, + }, + { + parent: { + id: 'fc107f7b556eb49b', + }, + agent: { + name: 'go', + version: '1.7.2', + }, + processor: { + name: 'transaction', + event: 'transaction', + }, + url: { + path: '/api/orders', + scheme: 'http', + port: 3000, + domain: 'opbeans-go', + full: 'http://opbeans-go:3000/api/orders', + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + '@timestamp': '2020-03-23T15:04:28.787Z', + service: { + node: { + name: + 'e948a08b8f5efe99b5da01f50da48c7d8aee3bbf4701f3da85ebe760c2ffef29', + }, + environment: 'production', + framework: { + name: 'gin', + version: 'v1.4.0', + }, + name: 'opbeans-go', + runtime: { + name: 'gc', + version: 'go1.14.1', + }, + language: { + name: 'go', + version: 'go1.14.1', }, - host: { - hostname: '4cf84d094553', - os: { - platform: 'Linux', - }, - ip: '172.19.0.9', - name: '4cf84d094553', - architecture: 'amd64', + version: 'None', + }, + transaction: { + duration: { + us: 16597, + }, + result: 'HTTP 2xx', + name: 'GET /api/orders', + id: '975c8d5bfd1dd20b', + span_count: { + dropped: 0, + started: 1, + }, + type: 'request', + sampled: true, + }, + timestamp: { + us: 1584975868787052, + }, + }, + { + parent: { + id: 'daae24d83c269918', + }, + agent: { + name: 'python', + version: '5.5.2', + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + timestamp: { + us: 1584975868788603, + }, + processor: { + name: 'transaction', + event: 'transaction', + }, + url: { + path: '/api/orders', + scheme: 'http', + port: 3000, + domain: 'opbeans-go', + full: 'http://opbeans-go:3000/api/orders', + }, + '@timestamp': '2020-03-23T15:04:28.788Z', + service: { + node: { + name: + 'a636915f1f6eec81ab44342b13a3ea9597ef03a24391e4e55f34ae2e20b30f51', }, - http: { - request: { - headers: { - Accept: ['*/*'], - 'User-Agent': ['Python/3.7 aiohttp/3.3.2'], - Host: ['172.19.0.9:3000'], - 'Accept-Encoding': ['gzip, deflate'], - }, - method: 'get', - socket: { - encrypted: false, - remote_address: '172.19.0.13', - }, - body: { - original: '[REDACTED]', - }, - }, - response: { - headers: { - 'Transfer-Encoding': ['chunked'], - Date: ['Mon, 23 Mar 2020 15:04:28 GMT'], - 'Content-Type': ['application/json;charset=ISO-8859-1'], - }, - status_code: 200, - finished: true, - headers_sent: true, - }, - version: '1.1', + environment: 'production', + framework: { + name: 'django', + version: '2.1.13', }, - client: { - ip: '172.19.0.13', + name: 'opbeans-python', + runtime: { + name: 'CPython', + version: '3.6.10', }, - transaction: { - duration: { - us: 18842, - }, - result: 'HTTP 2xx', - name: 'DispatcherServlet#doGet', - id: '49809ad3c26adf74', - span_count: { - dropped: 0, - started: 1, - }, - type: 'request', - sampled: true, + language: { + name: 'python', + version: '3.6.10', }, - user_agent: { - original: 'Python/3.7 aiohttp/3.3.2', - name: 'Other', - device: { - name: 'Other', - }, + version: 'None', + }, + transaction: { + result: 'HTTP 2xx', + duration: { + us: 14648, + }, + name: 'GET opbeans.views.orders', + span_count: { + dropped: 0, + started: 1, + }, + id: '6fb0ff7365b87298', + type: 'request', + sampled: true, + }, + }, + { + container: { + id: '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', + }, + parent: { + id: '49809ad3c26adf74', + }, + process: { + pid: 6, + title: '/usr/lib/jvm/java-10-openjdk-amd64/bin/java', + ppid: 1, + }, + agent: { + name: 'java', + ephemeral_id: '99ce8403-5875-4945-b074-d37dc10563eb', + version: '1.14.1-SNAPSHOT', + }, + internal: { + sampler: { + value: 44, + }, + }, + destination: { + address: 'opbeans-go', + port: 3000, + }, + processor: { + name: 'transaction', + event: 'span', + }, + observer: { + hostname: 'f37f48d8b60b', + id: 'd8522e1f-be8e-43c2-b290-ac6b6c0f171e', + type: 'apm-server', + ephemeral_id: '6ed88f14-170e-478d-a4f5-ea5e7f4b16b9', + version: '8.0.0', + version_major: 8, + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + '@timestamp': '2020-03-23T15:04:28.785Z', + ecs: { + version: '1.4.0', + }, + service: { + node: { + name: + '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', + }, + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '10.0.2', }, - timestamp: { - us: 1584975868785000, + language: { + name: 'Java', + version: '10.0.2', }, + version: 'None', + }, + host: { + hostname: '4cf84d094553', + os: { + platform: 'Linux', + }, + ip: '172.19.0.9', + name: '4cf84d094553', + architecture: 'amd64', + }, + connection: { + hash: + "{service.environment:'production'}/{service.name:'opbeans-java'}/{span.subtype:'http'}/{destination.address:'opbeans-go'}/{span.type:'external'}", }, - { - parent: { - id: 'fc107f7b556eb49b', + transaction: { + id: '49809ad3c26adf74', + }, + timestamp: { + us: 1584975868785273, + }, + span: { + duration: { + us: 17530, }, - agent: { - name: 'go', - version: '1.7.2', - }, - processor: { - name: 'transaction', - event: 'transaction', - }, - url: { - path: '/api/orders', - scheme: 'http', - port: 3000, - domain: 'opbeans-go', - full: 'http://opbeans-go:3000/api/orders', - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - '@timestamp': '2020-03-23T15:04:28.787Z', - service: { - node: { - name: - 'e948a08b8f5efe99b5da01f50da48c7d8aee3bbf4701f3da85ebe760c2ffef29', - }, - environment: 'production', - framework: { - name: 'gin', - version: 'v1.4.0', - }, - name: 'opbeans-go', - runtime: { - name: 'gc', - version: 'go1.14.1', - }, - language: { - name: 'go', - version: 'go1.14.1', + subtype: 'http', + name: 'GET opbeans-go', + destination: { + service: { + resource: 'opbeans-go:3000', + name: 'http://opbeans-go:3000', + type: 'external', }, - version: 'None', }, - transaction: { - duration: { - us: 16597, + http: { + response: { + status_code: 200, }, - result: 'HTTP 2xx', - name: 'GET /api/orders', - id: '975c8d5bfd1dd20b', - span_count: { - dropped: 0, - started: 1, + url: { + original: 'http://opbeans-go:3000/api/orders', }, - type: 'request', - sampled: true, }, - timestamp: { - us: 1584975868787052, + id: 'fc107f7b556eb49b', + type: 'external', + }, + }, + { + parent: { + id: '975c8d5bfd1dd20b', + }, + agent: { + name: 'go', + version: '1.7.2', + }, + processor: { + name: 'transaction', + event: 'span', + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + '@timestamp': '2020-03-23T15:04:28.787Z', + service: { + node: { + name: + 'e948a08b8f5efe99b5da01f50da48c7d8aee3bbf4701f3da85ebe760c2ffef29', + }, + environment: 'production', + name: 'opbeans-go', + runtime: { + name: 'gc', + version: 'go1.14.1', + }, + language: { + name: 'go', + version: 'go1.14.1', }, + version: 'None', }, - { - parent: { - id: 'daae24d83c269918', + transaction: { + id: '975c8d5bfd1dd20b', + }, + timestamp: { + us: 1584975868787174, + }, + span: { + duration: { + us: 16250, }, - agent: { - name: 'python', - version: '5.5.2', - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - timestamp: { - us: 1584975868788603, - }, - processor: { - name: 'transaction', - event: 'transaction', - }, - url: { - path: '/api/orders', - scheme: 'http', - port: 3000, - domain: 'opbeans-go', - full: 'http://opbeans-go:3000/api/orders', - }, - '@timestamp': '2020-03-23T15:04:28.788Z', - service: { - node: { - name: - 'a636915f1f6eec81ab44342b13a3ea9597ef03a24391e4e55f34ae2e20b30f51', - }, - environment: 'production', - framework: { - name: 'django', - version: '2.1.13', - }, - name: 'opbeans-python', - runtime: { - name: 'CPython', - version: '3.6.10', - }, - language: { - name: 'python', - version: '3.6.10', + subtype: 'http', + destination: { + service: { + resource: 'opbeans-python:3000', + name: 'http://opbeans-python:3000', + type: 'external', }, - version: 'None', }, - transaction: { - result: 'HTTP 2xx', - duration: { - us: 14648, + name: 'GET opbeans-python:3000', + http: { + response: { + status_code: 200, }, - name: 'GET opbeans.views.orders', - span_count: { - dropped: 0, - started: 1, + url: { + original: 'http://opbeans-python:3000/api/orders', }, - id: '6fb0ff7365b87298', - type: 'request', - sampled: true, }, + id: 'daae24d83c269918', + type: 'external', }, - { - container: { - id: - '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', + }, + { + container: { + id: 'a636915f1f6eec81ab44342b13a3ea9597ef03a24391e4e55f34ae2e20b30f51', + }, + parent: { + id: '6fb0ff7365b87298', + }, + agent: { + name: 'python', + version: '5.5.2', + }, + processor: { + name: 'transaction', + event: 'span', + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + '@timestamp': '2020-03-23T15:04:28.790Z', + service: { + node: { + name: + 'a636915f1f6eec81ab44342b13a3ea9597ef03a24391e4e55f34ae2e20b30f51', }, - parent: { - id: '49809ad3c26adf74', + environment: 'production', + framework: { + name: 'django', + version: '2.1.13', }, - process: { - pid: 6, - title: '/usr/lib/jvm/java-10-openjdk-amd64/bin/java', - ppid: 1, + name: 'opbeans-python', + runtime: { + name: 'CPython', + version: '3.6.10', }, - agent: { - name: 'java', - ephemeral_id: '99ce8403-5875-4945-b074-d37dc10563eb', - version: '1.14.1-SNAPSHOT', + language: { + name: 'python', + version: '3.6.10', }, - internal: { - sampler: { - value: 44, - }, + version: 'None', + }, + transaction: { + id: '6fb0ff7365b87298', + }, + timestamp: { + us: 1584975868790080, + }, + span: { + duration: { + us: 2519, }, + subtype: 'postgresql', + name: 'SELECT FROM opbeans_order', destination: { - address: 'opbeans-go', - port: 3000, - }, - processor: { - name: 'transaction', - event: 'span', - }, - observer: { - hostname: 'f37f48d8b60b', - id: 'd8522e1f-be8e-43c2-b290-ac6b6c0f171e', - type: 'apm-server', - ephemeral_id: '6ed88f14-170e-478d-a4f5-ea5e7f4b16b9', - version: '8.0.0', - version_major: 8, - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - '@timestamp': '2020-03-23T15:04:28.785Z', - ecs: { - version: '1.4.0', - }, - service: { - node: { - name: - '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', - }, - environment: 'production', - name: 'opbeans-java', - runtime: { - name: 'Java', - version: '10.0.2', - }, - language: { - name: 'Java', - version: '10.0.2', + service: { + resource: 'postgresql', + name: 'postgresql', + type: 'db', }, - version: 'None', }, - host: { - hostname: '4cf84d094553', - os: { - platform: 'Linux', - }, - ip: '172.19.0.9', - name: '4cf84d094553', - architecture: 'amd64', + action: 'query', + id: 'c9407abb4d08ead1', + type: 'db', + sync: true, + db: { + statement: + 'SELECT "opbeans_order"."id", "opbeans_order"."customer_id", "opbeans_customer"."full_name", "opbeans_order"."created_at" FROM "opbeans_order" INNER JOIN "opbeans_customer" ON ("opbeans_order"."customer_id" = "opbeans_customer"."id") LIMIT 1000', + type: 'sql', }, - connection: { - hash: - "{service.environment:'production'}/{service.name:'opbeans-java'}/{span.subtype:'http'}/{destination.address:'opbeans-go'}/{span.type:'external'}", + }, + }, + ], + exceedsMax: false, + errorDocs: [], +} as TraceAPIResponse; + +export const traceWithErrors = ({ + traceDocs: [ + { + container: { + id: '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', + }, + process: { + pid: 6, + title: '/usr/lib/jvm/java-10-openjdk-amd64/bin/java', + ppid: 1, + }, + agent: { + name: 'java', + ephemeral_id: '99ce8403-5875-4945-b074-d37dc10563eb', + version: '1.14.1-SNAPSHOT', + }, + internal: { + sampler: { + value: 46, }, - transaction: { - id: '49809ad3c26adf74', + }, + source: { + ip: '172.19.0.13', + }, + processor: { + name: 'transaction', + event: 'transaction', + }, + url: { + path: '/api/orders', + scheme: 'http', + port: 3000, + domain: '172.19.0.9', + full: 'http://172.19.0.9:3000/api/orders', + }, + observer: { + hostname: 'f37f48d8b60b', + id: 'd8522e1f-be8e-43c2-b290-ac6b6c0f171e', + ephemeral_id: '6ed88f14-170e-478d-a4f5-ea5e7f4b16b9', + type: 'apm-server', + version: '8.0.0', + version_major: 8, + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + '@timestamp': '2020-03-23T15:04:28.785Z', + ecs: { + version: '1.4.0', + }, + service: { + node: { + name: + '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', }, - timestamp: { - us: 1584975868785273, + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '10.0.2', }, - span: { - duration: { - us: 17530, - }, - subtype: 'http', - name: 'GET opbeans-go', - destination: { - service: { - resource: 'opbeans-go:3000', - name: 'http://opbeans-go:3000', - type: 'external', - }, - }, - http: { - response: { - status_code: 200, - }, - url: { - original: 'http://opbeans-go:3000/api/orders', - }, - }, - id: 'fc107f7b556eb49b', - type: 'external', + language: { + name: 'Java', + version: '10.0.2', }, + version: 'None', + }, + host: { + hostname: '4cf84d094553', + os: { + platform: 'Linux', + }, + ip: '172.19.0.9', + name: '4cf84d094553', + architecture: 'amd64', + }, + http: { + request: { + headers: { + Accept: ['*/*'], + 'User-Agent': ['Python/3.7 aiohttp/3.3.2'], + Host: ['172.19.0.9:3000'], + 'Accept-Encoding': ['gzip, deflate'], + }, + method: 'get', + socket: { + encrypted: false, + remote_address: '172.19.0.13', + }, + body: { + original: '[REDACTED]', + }, + }, + response: { + headers: { + 'Transfer-Encoding': ['chunked'], + Date: ['Mon, 23 Mar 2020 15:04:28 GMT'], + 'Content-Type': ['application/json;charset=ISO-8859-1'], + }, + status_code: 200, + finished: true, + headers_sent: true, + }, + version: '1.1', + }, + client: { + ip: '172.19.0.13', + }, + transaction: { + duration: { + us: 18842, + }, + result: 'HTTP 2xx', + name: 'DispatcherServlet#doGet', + id: '49809ad3c26adf74', + span_count: { + dropped: 0, + started: 1, + }, + type: 'request', + sampled: true, }, - { - parent: { - id: '975c8d5bfd1dd20b', + user_agent: { + original: 'Python/3.7 aiohttp/3.3.2', + name: 'Other', + device: { + name: 'Other', }, - agent: { + }, + timestamp: { + us: 1584975868785000, + }, + }, + { + parent: { + id: 'fc107f7b556eb49b', + }, + agent: { + name: 'go', + version: '1.7.2', + }, + processor: { + name: 'transaction', + event: 'transaction', + }, + url: { + path: '/api/orders', + scheme: 'http', + port: 3000, + domain: 'opbeans-go', + full: 'http://opbeans-go:3000/api/orders', + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + '@timestamp': '2020-03-23T15:04:28.787Z', + service: { + node: { + name: + 'e948a08b8f5efe99b5da01f50da48c7d8aee3bbf4701f3da85ebe760c2ffef29', + }, + environment: 'production', + framework: { + name: 'gin', + version: 'v1.4.0', + }, + name: 'opbeans-go', + runtime: { + name: 'gc', + version: 'go1.14.1', + }, + language: { name: 'go', - version: '1.7.2', - }, - processor: { - name: 'transaction', - event: 'span', - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - '@timestamp': '2020-03-23T15:04:28.787Z', - service: { - node: { - name: - 'e948a08b8f5efe99b5da01f50da48c7d8aee3bbf4701f3da85ebe760c2ffef29', - }, - environment: 'production', - name: 'opbeans-go', - runtime: { - name: 'gc', - version: 'go1.14.1', - }, - language: { - name: 'go', - version: 'go1.14.1', - }, - version: 'None', - }, - transaction: { - id: '975c8d5bfd1dd20b', - }, - timestamp: { - us: 1584975868787174, - }, - span: { - duration: { - us: 16250, - }, - subtype: 'http', - destination: { - service: { - resource: 'opbeans-python:3000', - name: 'http://opbeans-python:3000', - type: 'external', - }, - }, - name: 'GET opbeans-python:3000', - http: { - response: { - status_code: 200, - }, - url: { - original: 'http://opbeans-python:3000/api/orders', - }, - }, - id: 'daae24d83c269918', - type: 'external', + version: 'go1.14.1', }, + version: 'None', + }, + transaction: { + duration: { + us: 16597, + }, + result: 'HTTP 2xx', + name: 'GET /api/orders', + id: '975c8d5bfd1dd20b', + span_count: { + dropped: 0, + started: 1, + }, + type: 'request', + sampled: true, }, - { - container: { - id: + timestamp: { + us: 1584975868787052, + }, + }, + { + parent: { + id: 'daae24d83c269918', + }, + agent: { + name: 'python', + version: '5.5.2', + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + timestamp: { + us: 1584975868788603, + }, + processor: { + name: 'transaction', + event: 'transaction', + }, + url: { + path: '/api/orders', + scheme: 'http', + port: 3000, + domain: 'opbeans-go', + full: 'http://opbeans-go:3000/api/orders', + }, + '@timestamp': '2020-03-23T15:04:28.788Z', + service: { + node: { + name: 'a636915f1f6eec81ab44342b13a3ea9597ef03a24391e4e55f34ae2e20b30f51', }, - parent: { - id: '6fb0ff7365b87298', - }, - agent: { - name: 'python', - version: '5.5.2', - }, - processor: { - name: 'transaction', - event: 'span', - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - '@timestamp': '2020-03-23T15:04:28.790Z', - service: { - node: { - name: - 'a636915f1f6eec81ab44342b13a3ea9597ef03a24391e4e55f34ae2e20b30f51', - }, - environment: 'production', - framework: { - name: 'django', - version: '2.1.13', - }, - name: 'opbeans-python', - runtime: { - name: 'CPython', - version: '3.6.10', - }, - language: { - name: 'python', - version: '3.6.10', - }, - version: 'None', + environment: 'production', + framework: { + name: 'django', + version: '2.1.13', }, - transaction: { - id: '6fb0ff7365b87298', + name: 'opbeans-python', + runtime: { + name: 'CPython', + version: '3.6.10', }, - timestamp: { - us: 1584975868790080, + language: { + name: 'python', + version: '3.6.10', }, - span: { - duration: { - us: 2519, - }, - subtype: 'postgresql', - name: 'SELECT FROM opbeans_order', - destination: { - service: { - resource: 'postgresql', - name: 'postgresql', - type: 'db', - }, - }, - action: 'query', - id: 'c9407abb4d08ead1', - type: 'db', - sync: true, - db: { - statement: - 'SELECT "opbeans_order"."id", "opbeans_order"."customer_id", "opbeans_customer"."full_name", "opbeans_order"."created_at" FROM "opbeans_order" INNER JOIN "opbeans_customer" ON ("opbeans_order"."customer_id" = "opbeans_customer"."id") LIMIT 1000', - type: 'sql', - }, + version: 'None', + }, + transaction: { + result: 'HTTP 2xx', + duration: { + us: 14648, + }, + name: 'GET opbeans.views.orders', + span_count: { + dropped: 0, + started: 1, + }, + id: '6fb0ff7365b87298', + type: 'request', + sampled: true, + }, + }, + { + container: { + id: '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', + }, + parent: { + id: '49809ad3c26adf74', + }, + process: { + pid: 6, + title: '/usr/lib/jvm/java-10-openjdk-amd64/bin/java', + ppid: 1, + }, + agent: { + name: 'java', + ephemeral_id: '99ce8403-5875-4945-b074-d37dc10563eb', + version: '1.14.1-SNAPSHOT', + }, + internal: { + sampler: { + value: 44, }, }, - ], - exceedsMax: false, - errorDocs: [], - }, - errorsPerTransaction: {}, -}; - -export const traceWithErrors = { - trace: { - items: [ - { - container: { - id: + destination: { + address: 'opbeans-go', + port: 3000, + }, + processor: { + name: 'transaction', + event: 'span', + }, + observer: { + hostname: 'f37f48d8b60b', + id: 'd8522e1f-be8e-43c2-b290-ac6b6c0f171e', + type: 'apm-server', + ephemeral_id: '6ed88f14-170e-478d-a4f5-ea5e7f4b16b9', + version: '8.0.0', + version_major: 8, + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + '@timestamp': '2020-03-23T15:04:28.785Z', + ecs: { + version: '1.4.0', + }, + service: { + node: { + name: '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', }, - process: { - pid: 6, - title: '/usr/lib/jvm/java-10-openjdk-amd64/bin/java', - ppid: 1, - }, - agent: { - name: 'java', - ephemeral_id: '99ce8403-5875-4945-b074-d37dc10563eb', - version: '1.14.1-SNAPSHOT', + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '10.0.2', }, - internal: { - sampler: { - value: 46, - }, + language: { + name: 'Java', + version: '10.0.2', }, - source: { - ip: '172.19.0.13', - }, - processor: { - name: 'transaction', - event: 'transaction', - }, - url: { - path: '/api/orders', - scheme: 'http', - port: 3000, - domain: '172.19.0.9', - full: 'http://172.19.0.9:3000/api/orders', - }, - observer: { - hostname: 'f37f48d8b60b', - id: 'd8522e1f-be8e-43c2-b290-ac6b6c0f171e', - ephemeral_id: '6ed88f14-170e-478d-a4f5-ea5e7f4b16b9', - type: 'apm-server', - version: '8.0.0', - version_major: 8, - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - '@timestamp': '2020-03-23T15:04:28.785Z', - ecs: { - version: '1.4.0', - }, - service: { - node: { - name: - '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', - }, - environment: 'production', - name: 'opbeans-java', - runtime: { - name: 'Java', - version: '10.0.2', - }, - language: { - name: 'Java', - version: '10.0.2', - }, - version: 'None', + version: 'None', + }, + host: { + hostname: '4cf84d094553', + os: { + platform: 'Linux', + }, + ip: '172.19.0.9', + name: '4cf84d094553', + architecture: 'amd64', + }, + connection: { + hash: + "{service.environment:'production'}/{service.name:'opbeans-java'}/{span.subtype:'http'}/{destination.address:'opbeans-go'}/{span.type:'external'}", + }, + transaction: { + id: '49809ad3c26adf74', + }, + timestamp: { + us: 1584975868785273, + }, + span: { + duration: { + us: 17530, }, - host: { - hostname: '4cf84d094553', - os: { - platform: 'Linux', + subtype: 'http', + name: 'GET opbeans-go', + destination: { + service: { + resource: 'opbeans-go:3000', + name: 'http://opbeans-go:3000', + type: 'external', }, - ip: '172.19.0.9', - name: '4cf84d094553', - architecture: 'amd64', }, http: { - request: { - headers: { - Accept: ['*/*'], - 'User-Agent': ['Python/3.7 aiohttp/3.3.2'], - Host: ['172.19.0.9:3000'], - 'Accept-Encoding': ['gzip, deflate'], - }, - method: 'get', - socket: { - encrypted: false, - remote_address: '172.19.0.13', - }, - body: { - original: '[REDACTED]', - }, - }, response: { - headers: { - 'Transfer-Encoding': ['chunked'], - Date: ['Mon, 23 Mar 2020 15:04:28 GMT'], - 'Content-Type': ['application/json;charset=ISO-8859-1'], - }, status_code: 200, - finished: true, - headers_sent: true, - }, - version: '1.1', - }, - client: { - ip: '172.19.0.13', - }, - transaction: { - duration: { - us: 18842, }, - result: 'HTTP 2xx', - name: 'DispatcherServlet#doGet', - id: '49809ad3c26adf74', - span_count: { - dropped: 0, - started: 1, + url: { + original: 'http://opbeans-go:3000/api/orders', }, - type: 'request', - sampled: true, - }, - user_agent: { - original: 'Python/3.7 aiohttp/3.3.2', - name: 'Other', - device: { - name: 'Other', - }, - }, - timestamp: { - us: 1584975868785000, }, + id: 'fc107f7b556eb49b', + type: 'external', }, - { - parent: { - id: 'fc107f7b556eb49b', - }, - agent: { + }, + { + parent: { + id: '975c8d5bfd1dd20b', + }, + agent: { + name: 'go', + version: '1.7.2', + }, + processor: { + name: 'transaction', + event: 'span', + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + '@timestamp': '2020-03-23T15:04:28.787Z', + service: { + node: { + name: + 'e948a08b8f5efe99b5da01f50da48c7d8aee3bbf4701f3da85ebe760c2ffef29', + }, + environment: 'production', + name: 'opbeans-go', + runtime: { + name: 'gc', + version: 'go1.14.1', + }, + language: { name: 'go', - version: '1.7.2', - }, - processor: { - name: 'transaction', - event: 'transaction', - }, - url: { - path: '/api/orders', - scheme: 'http', - port: 3000, - domain: 'opbeans-go', - full: 'http://opbeans-go:3000/api/orders', - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - '@timestamp': '2020-03-23T15:04:28.787Z', - service: { - node: { - name: - 'e948a08b8f5efe99b5da01f50da48c7d8aee3bbf4701f3da85ebe760c2ffef29', - }, - environment: 'production', - framework: { - name: 'gin', - version: 'v1.4.0', - }, - name: 'opbeans-go', - runtime: { - name: 'gc', - version: 'go1.14.1', - }, - language: { - name: 'go', - version: 'go1.14.1', - }, - version: 'None', - }, - transaction: { - duration: { - us: 16597, - }, - result: 'HTTP 2xx', - name: 'GET /api/orders', - id: '975c8d5bfd1dd20b', - span_count: { - dropped: 0, - started: 1, - }, - type: 'request', - sampled: true, - }, - timestamp: { - us: 1584975868787052, + version: 'go1.14.1', }, + version: 'None', + }, + transaction: { + id: '975c8d5bfd1dd20b', }, - { - parent: { - id: 'daae24d83c269918', + timestamp: { + us: 1584975868787174, + }, + span: { + duration: { + us: 16250, }, - agent: { - name: 'python', - version: '5.5.2', - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - timestamp: { - us: 1584975868788603, - }, - processor: { - name: 'transaction', - event: 'transaction', - }, - url: { - path: '/api/orders', - scheme: 'http', - port: 3000, - domain: 'opbeans-go', - full: 'http://opbeans-go:3000/api/orders', - }, - '@timestamp': '2020-03-23T15:04:28.788Z', - service: { - node: { - name: - 'a636915f1f6eec81ab44342b13a3ea9597ef03a24391e4e55f34ae2e20b30f51', - }, - environment: 'production', - framework: { - name: 'django', - version: '2.1.13', - }, - name: 'opbeans-python', - runtime: { - name: 'CPython', - version: '3.6.10', - }, - language: { - name: 'python', - version: '3.6.10', + subtype: 'http', + destination: { + service: { + resource: 'opbeans-python:3000', + name: 'http://opbeans-python:3000', + type: 'external', }, - version: 'None', }, - transaction: { - result: 'HTTP 2xx', - duration: { - us: 14648, + name: 'GET opbeans-python:3000', + http: { + response: { + status_code: 200, }, - name: 'GET opbeans.views.orders', - span_count: { - dropped: 0, - started: 1, + url: { + original: 'http://opbeans-python:3000/api/orders', }, - id: '6fb0ff7365b87298', - type: 'request', - sampled: true, }, + id: 'daae24d83c269918', + type: 'external', }, - { - container: { - id: - '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', + }, + { + container: { + id: 'a636915f1f6eec81ab44342b13a3ea9597ef03a24391e4e55f34ae2e20b30f51', + }, + parent: { + id: '6fb0ff7365b87298', + }, + agent: { + name: 'python', + version: '5.5.2', + }, + processor: { + name: 'transaction', + event: 'span', + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + '@timestamp': '2020-03-23T15:04:28.790Z', + service: { + node: { + name: + 'a636915f1f6eec81ab44342b13a3ea9597ef03a24391e4e55f34ae2e20b30f51', }, - parent: { - id: '49809ad3c26adf74', + environment: 'production', + framework: { + name: 'django', + version: '2.1.13', }, - process: { - pid: 6, - title: '/usr/lib/jvm/java-10-openjdk-amd64/bin/java', - ppid: 1, + name: 'opbeans-python', + runtime: { + name: 'CPython', + version: '3.6.10', }, - agent: { - name: 'java', - ephemeral_id: '99ce8403-5875-4945-b074-d37dc10563eb', - version: '1.14.1-SNAPSHOT', + language: { + name: 'python', + version: '3.6.10', }, - internal: { - sampler: { - value: 44, - }, + version: 'None', + }, + transaction: { + id: '6fb0ff7365b87298', + }, + timestamp: { + us: 1584975868790080, + }, + span: { + duration: { + us: 2519, }, + subtype: 'postgresql', + name: 'SELECT FROM opbeans_order', destination: { - address: 'opbeans-go', - port: 3000, - }, - processor: { - name: 'transaction', - event: 'span', - }, - observer: { - hostname: 'f37f48d8b60b', - id: 'd8522e1f-be8e-43c2-b290-ac6b6c0f171e', - type: 'apm-server', - ephemeral_id: '6ed88f14-170e-478d-a4f5-ea5e7f4b16b9', - version: '8.0.0', - version_major: 8, - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - '@timestamp': '2020-03-23T15:04:28.785Z', - ecs: { - version: '1.4.0', - }, - service: { - node: { - name: - '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', - }, - environment: 'production', - name: 'opbeans-java', - runtime: { - name: 'Java', - version: '10.0.2', + service: { + resource: 'postgresql', + name: 'postgresql', + type: 'db', }, - language: { - name: 'Java', - version: '10.0.2', - }, - version: 'None', - }, - host: { - hostname: '4cf84d094553', - os: { - platform: 'Linux', - }, - ip: '172.19.0.9', - name: '4cf84d094553', - architecture: 'amd64', - }, - connection: { - hash: - "{service.environment:'production'}/{service.name:'opbeans-java'}/{span.subtype:'http'}/{destination.address:'opbeans-go'}/{span.type:'external'}", }, - transaction: { - id: '49809ad3c26adf74', - }, - timestamp: { - us: 1584975868785273, - }, - span: { - duration: { - us: 17530, - }, - subtype: 'http', - name: 'GET opbeans-go', - destination: { - service: { - resource: 'opbeans-go:3000', - name: 'http://opbeans-go:3000', - type: 'external', - }, - }, - http: { - response: { - status_code: 200, - }, - url: { - original: 'http://opbeans-go:3000/api/orders', - }, - }, - id: 'fc107f7b556eb49b', - type: 'external', + action: 'query', + id: 'c9407abb4d08ead1', + type: 'db', + sync: true, + db: { + statement: + 'SELECT "opbeans_order"."id", "opbeans_order"."customer_id", "opbeans_customer"."full_name", "opbeans_order"."created_at" FROM "opbeans_order" INNER JOIN "opbeans_customer" ON ("opbeans_order"."customer_id" = "opbeans_customer"."id") LIMIT 1000', + type: 'sql', }, }, - { - parent: { - id: '975c8d5bfd1dd20b', - }, - agent: { - name: 'go', - version: '1.7.2', - }, - processor: { - name: 'transaction', - event: 'span', - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - '@timestamp': '2020-03-23T15:04:28.787Z', - service: { - node: { - name: - 'e948a08b8f5efe99b5da01f50da48c7d8aee3bbf4701f3da85ebe760c2ffef29', - }, - environment: 'production', - name: 'opbeans-go', - runtime: { - name: 'gc', - version: 'go1.14.1', - }, - language: { - name: 'go', - version: 'go1.14.1', - }, - version: 'None', - }, - transaction: { - id: '975c8d5bfd1dd20b', - }, - timestamp: { - us: 1584975868787174, - }, - span: { - duration: { - us: 16250, - }, - subtype: 'http', - destination: { - service: { - resource: 'opbeans-python:3000', - name: 'http://opbeans-python:3000', - type: 'external', - }, - }, - name: 'GET opbeans-python:3000', - http: { - response: { - status_code: 200, - }, - url: { - original: 'http://opbeans-python:3000/api/orders', - }, - }, - id: 'daae24d83c269918', - type: 'external', - }, + }, + ], + exceedsMax: false, + errorDocs: [ + { + parent: { + id: '975c8d5bfd1dd20b', }, - { - container: { - id: - 'a636915f1f6eec81ab44342b13a3ea9597ef03a24391e4e55f34ae2e20b30f51', - }, - parent: { - id: '6fb0ff7365b87298', - }, - agent: { - name: 'python', - version: '5.5.2', - }, - processor: { - name: 'transaction', - event: 'span', - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - '@timestamp': '2020-03-23T15:04:28.790Z', - service: { - node: { - name: - 'a636915f1f6eec81ab44342b13a3ea9597ef03a24391e4e55f34ae2e20b30f51', - }, - environment: 'production', - framework: { - name: 'django', - version: '2.1.13', - }, - name: 'opbeans-python', - runtime: { - name: 'CPython', - version: '3.6.10', - }, - language: { - name: 'python', - version: '3.6.10', - }, - version: 'None', - }, - transaction: { - id: '6fb0ff7365b87298', - }, - timestamp: { - us: 1584975868790080, - }, - span: { - duration: { - us: 2519, - }, - subtype: 'postgresql', - name: 'SELECT FROM opbeans_order', - destination: { - service: { - resource: 'postgresql', - name: 'postgresql', - type: 'db', - }, - }, - action: 'query', - id: 'c9407abb4d08ead1', - type: 'db', - sync: true, - db: { - statement: - 'SELECT "opbeans_order"."id", "opbeans_order"."customer_id", "opbeans_customer"."full_name", "opbeans_order"."created_at" FROM "opbeans_order" INNER JOIN "opbeans_customer" ON ("opbeans_order"."customer_id" = "opbeans_customer"."id") LIMIT 1000', - type: 'sql', - }, - }, + agent: { + name: 'go', + version: '1.7.2', }, - ], - exceedsMax: false, - errorDocs: [ - { - parent: { - id: '975c8d5bfd1dd20b', - }, - agent: { + error: { + culprit: 'logrusMiddleware', + log: { + level: 'error', + message: 'GET //api/products (502)', + }, + id: '1f3cb98206b5c54225cb7c8908a658da', + grouping_key: '4dba2ff58fe6c036a5dee2ce411e512a', + }, + processor: { + name: 'error', + event: 'error', + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + '@timestamp': '2020-03-23T16:04:28.787Z', + service: { + node: { + name: + 'e948a08b8f5efe99b5da01f50da48c7d8aee3bbf4701f3da85ebe760c2ffef29', + }, + environment: 'production', + name: 'opbeans-go', + runtime: { + name: 'gc', + version: 'go1.14.1', + }, + language: { name: 'go', - version: '1.7.2', - }, - error: { - culprit: 'logrusMiddleware', - log: { - level: 'error', - message: 'GET //api/products (502)', - }, - id: '1f3cb98206b5c54225cb7c8908a658da', - grouping_key: '4dba2ff58fe6c036a5dee2ce411e512a', - }, - processor: { - name: 'error', - event: 'error', - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - '@timestamp': '2020-03-23T16:04:28.787Z', - service: { - node: { - name: - 'e948a08b8f5efe99b5da01f50da48c7d8aee3bbf4701f3da85ebe760c2ffef29', - }, - environment: 'production', - name: 'opbeans-go', - runtime: { - name: 'gc', - version: 'go1.14.1', - }, - language: { - name: 'go', - version: 'go1.14.1', - }, - version: 'None', - }, - transaction: { - id: '975c8d5bfd1dd20b', - sampled: false, - }, - timestamp: { - us: 1584975868787052, + version: 'go1.14.1', }, + version: 'None', }, - { - parent: { - id: '6fb0ff7365b87298', - }, - agent: { - name: 'python', - version: '5.5.2', - }, - error: { - culprit: 'logrusMiddleware', - log: { - level: 'error', - message: 'GET //api/products (502)', - }, - id: '1f3cb98206b5c54225cb7c8908a658d2', - grouping_key: '4dba2ff58fe6c036a5dee2ce411e512a', - }, - processor: { - name: 'error', - event: 'error', - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - '@timestamp': '2020-03-23T16:04:28.790Z', - service: { - node: { - name: - 'e948a08b8f5efe99b5da01f50da48c7d8aee3bbf4701f3da85ebe760c2ffef29', - }, - environment: 'production', - name: 'opbeans-python', - runtime: { - name: 'gc', - version: 'go1.14.1', - }, - version: 'None', - }, - transaction: { - id: '6fb0ff7365b87298', - sampled: false, - }, - timestamp: { - us: 1584975868790000, - }, + transaction: { + id: '975c8d5bfd1dd20b', + sampled: false, + }, + timestamp: { + us: 1584975868787052, }, - ], - }, - errorsPerTransaction: { - '975c8d5bfd1dd20b': 1, - '6fb0ff7365b87298': 1, - }, -}; + }, + { + parent: { + id: '6fb0ff7365b87298', + }, + agent: { + name: 'python', + version: '5.5.2', + }, + error: { + culprit: 'logrusMiddleware', + log: { + level: 'error', + message: 'GET //api/products (502)', + }, + id: '1f3cb98206b5c54225cb7c8908a658d2', + grouping_key: '4dba2ff58fe6c036a5dee2ce411e512a', + }, + processor: { + name: 'error', + event: 'error', + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + '@timestamp': '2020-03-23T16:04:28.790Z', + service: { + node: { + name: + 'e948a08b8f5efe99b5da01f50da48c7d8aee3bbf4701f3da85ebe760c2ffef29', + }, + environment: 'production', + name: 'opbeans-python', + runtime: { + name: 'gc', + version: 'go1.14.1', + }, + version: 'None', + }, + transaction: { + id: '6fb0ff7365b87298', + sampled: false, + }, + timestamp: { + us: 1584975868790000, + }, + }, + ], +} as unknown) as TraceAPIResponse; export const traceChildStartBeforeParent = { - trace: { - items: [ - { - container: { - id: - '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', - }, - process: { - pid: 6, - title: '/usr/lib/jvm/java-10-openjdk-amd64/bin/java', - ppid: 1, - }, - agent: { - name: 'java', - ephemeral_id: '99ce8403-5875-4945-b074-d37dc10563eb', - version: '1.14.1-SNAPSHOT', - }, - internal: { - sampler: { - value: 46, - }, - }, - source: { - ip: '172.19.0.13', - }, - processor: { - name: 'transaction', - event: 'transaction', - }, - url: { - path: '/api/orders', - scheme: 'http', - port: 3000, - domain: '172.19.0.9', - full: 'http://172.19.0.9:3000/api/orders', - }, - observer: { - hostname: 'f37f48d8b60b', - id: 'd8522e1f-be8e-43c2-b290-ac6b6c0f171e', - ephemeral_id: '6ed88f14-170e-478d-a4f5-ea5e7f4b16b9', - type: 'apm-server', - version: '8.0.0', - version_major: 8, - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - '@timestamp': '2020-03-23T15:04:28.785Z', - ecs: { - version: '1.4.0', - }, - service: { - node: { - name: - '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', - }, - environment: 'production', - name: 'opbeans-java', - runtime: { - name: 'Java', - version: '10.0.2', - }, - language: { - name: 'Java', - version: '10.0.2', - }, - version: 'None', - }, - host: { - hostname: '4cf84d094553', - os: { - platform: 'Linux', - }, - ip: '172.19.0.9', - name: '4cf84d094553', - architecture: 'amd64', + traceDocs: [ + { + container: { + id: '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', + }, + process: { + pid: 6, + title: '/usr/lib/jvm/java-10-openjdk-amd64/bin/java', + ppid: 1, + }, + agent: { + name: 'java', + ephemeral_id: '99ce8403-5875-4945-b074-d37dc10563eb', + version: '1.14.1-SNAPSHOT', + }, + internal: { + sampler: { + value: 46, }, - http: { - request: { - headers: { - Accept: ['*/*'], - 'User-Agent': ['Python/3.7 aiohttp/3.3.2'], - Host: ['172.19.0.9:3000'], - 'Accept-Encoding': ['gzip, deflate'], - }, - method: 'get', - socket: { - encrypted: false, - remote_address: '172.19.0.13', - }, - body: { - original: '[REDACTED]', - }, - }, - response: { - headers: { - 'Transfer-Encoding': ['chunked'], - Date: ['Mon, 23 Mar 2020 15:04:28 GMT'], - 'Content-Type': ['application/json;charset=ISO-8859-1'], - }, - status_code: 200, - finished: true, - headers_sent: true, - }, - version: '1.1', + }, + source: { + ip: '172.19.0.13', + }, + processor: { + name: 'transaction', + event: 'transaction', + }, + url: { + path: '/api/orders', + scheme: 'http', + port: 3000, + domain: '172.19.0.9', + full: 'http://172.19.0.9:3000/api/orders', + }, + observer: { + hostname: 'f37f48d8b60b', + id: 'd8522e1f-be8e-43c2-b290-ac6b6c0f171e', + ephemeral_id: '6ed88f14-170e-478d-a4f5-ea5e7f4b16b9', + type: 'apm-server', + version: '8.0.0', + version_major: 8, + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + '@timestamp': '2020-03-23T15:04:28.785Z', + ecs: { + version: '1.4.0', + }, + service: { + node: { + name: + '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', }, - client: { - ip: '172.19.0.13', + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '10.0.2', }, - transaction: { - duration: { - us: 18842, - }, - result: 'HTTP 2xx', - name: 'DispatcherServlet#doGet', - id: '49809ad3c26adf74', - span_count: { - dropped: 0, - started: 1, - }, - type: 'request', - sampled: true, + language: { + name: 'Java', + version: '10.0.2', }, - user_agent: { - original: 'Python/3.7 aiohttp/3.3.2', + version: 'None', + }, + host: { + hostname: '4cf84d094553', + os: { + platform: 'Linux', + }, + ip: '172.19.0.9', + name: '4cf84d094553', + architecture: 'amd64', + }, + http: { + request: { + headers: { + Accept: ['*/*'], + 'User-Agent': ['Python/3.7 aiohttp/3.3.2'], + Host: ['172.19.0.9:3000'], + 'Accept-Encoding': ['gzip, deflate'], + }, + method: 'get', + socket: { + encrypted: false, + remote_address: '172.19.0.13', + }, + body: { + original: '[REDACTED]', + }, + }, + response: { + headers: { + 'Transfer-Encoding': ['chunked'], + Date: ['Mon, 23 Mar 2020 15:04:28 GMT'], + 'Content-Type': ['application/json;charset=ISO-8859-1'], + }, + status_code: 200, + finished: true, + headers_sent: true, + }, + version: '1.1', + }, + client: { + ip: '172.19.0.13', + }, + transaction: { + duration: { + us: 18842, + }, + result: 'HTTP 2xx', + name: 'DispatcherServlet#doGet', + id: '49809ad3c26adf74', + span_count: { + dropped: 0, + started: 1, + }, + type: 'request', + sampled: true, + }, + user_agent: { + original: 'Python/3.7 aiohttp/3.3.2', + name: 'Other', + device: { name: 'Other', - device: { - name: 'Other', - }, - }, - timestamp: { - us: 1584975868785000, }, }, - { - parent: { - id: 'fc107f7b556eb49b', - }, - agent: { + timestamp: { + us: 1584975868785000, + }, + }, + { + parent: { + id: 'fc107f7b556eb49b', + }, + agent: { + name: 'go', + version: '1.7.2', + }, + processor: { + name: 'transaction', + event: 'transaction', + }, + url: { + path: '/api/orders', + scheme: 'http', + port: 3000, + domain: 'opbeans-go', + full: 'http://opbeans-go:3000/api/orders', + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + '@timestamp': '2020-03-23T15:04:28.787Z', + service: { + node: { + name: + 'e948a08b8f5efe99b5da01f50da48c7d8aee3bbf4701f3da85ebe760c2ffef29', + }, + environment: 'production', + framework: { + name: 'gin', + version: 'v1.4.0', + }, + name: 'opbeans-go', + runtime: { + name: 'gc', + version: 'go1.14.1', + }, + language: { name: 'go', - version: '1.7.2', - }, - processor: { - name: 'transaction', - event: 'transaction', - }, - url: { - path: '/api/orders', - scheme: 'http', - port: 3000, - domain: 'opbeans-go', - full: 'http://opbeans-go:3000/api/orders', - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - '@timestamp': '2020-03-23T15:04:28.787Z', - service: { - node: { - name: - 'e948a08b8f5efe99b5da01f50da48c7d8aee3bbf4701f3da85ebe760c2ffef29', - }, - environment: 'production', - framework: { - name: 'gin', - version: 'v1.4.0', - }, - name: 'opbeans-go', - runtime: { - name: 'gc', - version: 'go1.14.1', - }, - language: { - name: 'go', - version: 'go1.14.1', - }, - version: 'None', + version: 'go1.14.1', }, - transaction: { - duration: { - us: 16597, - }, - result: 'HTTP 2xx', - name: 'GET /api/orders', - id: '975c8d5bfd1dd20b', - span_count: { - dropped: 0, - started: 1, - }, - type: 'request', - sampled: true, + version: 'None', + }, + transaction: { + duration: { + us: 16597, + }, + result: 'HTTP 2xx', + name: 'GET /api/orders', + id: '975c8d5bfd1dd20b', + span_count: { + dropped: 0, + started: 1, + }, + type: 'request', + sampled: true, + }, + timestamp: { + us: 1584975868787052, + }, + }, + { + parent: { + id: 'daae24d83c269918', + }, + agent: { + name: 'python', + version: '5.5.2', + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + timestamp: { + us: 1584975868780000, + }, + processor: { + name: 'transaction', + event: 'transaction', + }, + url: { + path: '/api/orders', + scheme: 'http', + port: 3000, + domain: 'opbeans-go', + full: 'http://opbeans-go:3000/api/orders', + }, + '@timestamp': '2020-03-23T15:04:28.788Z', + service: { + node: { + name: + 'a636915f1f6eec81ab44342b13a3ea9597ef03a24391e4e55f34ae2e20b30f51', }, - timestamp: { - us: 1584975868787052, + environment: 'production', + framework: { + name: 'django', + version: '2.1.13', }, - }, - { - parent: { - id: 'daae24d83c269918', + name: 'opbeans-python', + runtime: { + name: 'CPython', + version: '3.6.10', }, - agent: { + language: { name: 'python', - version: '5.5.2', - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - timestamp: { - us: 1584975868780000, - }, - processor: { - name: 'transaction', - event: 'transaction', - }, - url: { - path: '/api/orders', - scheme: 'http', - port: 3000, - domain: 'opbeans-go', - full: 'http://opbeans-go:3000/api/orders', - }, - '@timestamp': '2020-03-23T15:04:28.788Z', - service: { - node: { - name: - 'a636915f1f6eec81ab44342b13a3ea9597ef03a24391e4e55f34ae2e20b30f51', - }, - environment: 'production', - framework: { - name: 'django', - version: '2.1.13', - }, - name: 'opbeans-python', - runtime: { - name: 'CPython', - version: '3.6.10', - }, - language: { - name: 'python', - version: '3.6.10', - }, - version: 'None', + version: '3.6.10', }, - transaction: { - result: 'HTTP 2xx', - duration: { - us: 1464, - }, - name: 'I started before my parent 😰', - span_count: { - dropped: 0, - started: 1, - }, - id: '6fb0ff7365b87298', - type: 'request', - sampled: true, + version: 'None', + }, + transaction: { + result: 'HTTP 2xx', + duration: { + us: 1464, + }, + name: 'I started before my parent 😰', + span_count: { + dropped: 0, + started: 1, + }, + id: '6fb0ff7365b87298', + type: 'request', + sampled: true, + }, + }, + { + container: { + id: '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', + }, + parent: { + id: '49809ad3c26adf74', + }, + process: { + pid: 6, + title: '/usr/lib/jvm/java-10-openjdk-amd64/bin/java', + ppid: 1, + }, + agent: { + name: 'java', + ephemeral_id: '99ce8403-5875-4945-b074-d37dc10563eb', + version: '1.14.1-SNAPSHOT', + }, + internal: { + sampler: { + value: 44, }, }, - { - container: { - id: + destination: { + address: 'opbeans-go', + port: 3000, + }, + processor: { + name: 'transaction', + event: 'span', + }, + observer: { + hostname: 'f37f48d8b60b', + id: 'd8522e1f-be8e-43c2-b290-ac6b6c0f171e', + type: 'apm-server', + ephemeral_id: '6ed88f14-170e-478d-a4f5-ea5e7f4b16b9', + version: '8.0.0', + version_major: 8, + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + '@timestamp': '2020-03-23T15:04:28.785Z', + ecs: { + version: '1.4.0', + }, + service: { + node: { + name: '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', }, - parent: { - id: '49809ad3c26adf74', - }, - process: { - pid: 6, - title: '/usr/lib/jvm/java-10-openjdk-amd64/bin/java', - ppid: 1, + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '10.0.2', }, - agent: { - name: 'java', - ephemeral_id: '99ce8403-5875-4945-b074-d37dc10563eb', - version: '1.14.1-SNAPSHOT', + language: { + name: 'Java', + version: '10.0.2', }, - internal: { - sampler: { - value: 44, - }, + version: 'None', + }, + host: { + hostname: '4cf84d094553', + os: { + platform: 'Linux', + }, + ip: '172.19.0.9', + name: '4cf84d094553', + architecture: 'amd64', + }, + connection: { + hash: + "{service.environment:'production'}/{service.name:'opbeans-java'}/{span.subtype:'http'}/{destination.address:'opbeans-go'}/{span.type:'external'}", + }, + transaction: { + id: '49809ad3c26adf74', + }, + timestamp: { + us: 1584975868785273, + }, + span: { + duration: { + us: 17530, }, + subtype: 'http', + name: 'GET opbeans-go', destination: { - address: 'opbeans-go', - port: 3000, - }, - processor: { - name: 'transaction', - event: 'span', - }, - observer: { - hostname: 'f37f48d8b60b', - id: 'd8522e1f-be8e-43c2-b290-ac6b6c0f171e', - type: 'apm-server', - ephemeral_id: '6ed88f14-170e-478d-a4f5-ea5e7f4b16b9', - version: '8.0.0', - version_major: 8, - }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', - }, - '@timestamp': '2020-03-23T15:04:28.785Z', - ecs: { - version: '1.4.0', - }, - service: { - node: { - name: - '4cf84d094553201997ddb7fea344b7c6ef18dcb8233eba39278946ee8449794e', + service: { + resource: 'opbeans-go:3000', + name: 'http://opbeans-go:3000', + type: 'external', }, - environment: 'production', - name: 'opbeans-java', - runtime: { - name: 'Java', - version: '10.0.2', - }, - language: { - name: 'Java', - version: '10.0.2', - }, - version: 'None', - }, - host: { - hostname: '4cf84d094553', - os: { - platform: 'Linux', - }, - ip: '172.19.0.9', - name: '4cf84d094553', - architecture: 'amd64', - }, - connection: { - hash: - "{service.environment:'production'}/{service.name:'opbeans-java'}/{span.subtype:'http'}/{destination.address:'opbeans-go'}/{span.type:'external'}", - }, - transaction: { - id: '49809ad3c26adf74', }, - timestamp: { - us: 1584975868785273, - }, - span: { - duration: { - us: 17530, - }, - subtype: 'http', - name: 'GET opbeans-go', - destination: { - service: { - resource: 'opbeans-go:3000', - name: 'http://opbeans-go:3000', - type: 'external', - }, + http: { + response: { + status_code: 200, }, - http: { - response: { - status_code: 200, - }, - url: { - original: 'http://opbeans-go:3000/api/orders', - }, + url: { + original: 'http://opbeans-go:3000/api/orders', }, - id: 'fc107f7b556eb49b', - type: 'external', }, + id: 'fc107f7b556eb49b', + type: 'external', }, - { - parent: { - id: '975c8d5bfd1dd20b', - }, - agent: { + }, + { + parent: { + id: '975c8d5bfd1dd20b', + }, + agent: { + name: 'go', + version: '1.7.2', + }, + processor: { + name: 'transaction', + event: 'span', + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + '@timestamp': '2020-03-23T15:04:28.787Z', + service: { + node: { + name: + 'e948a08b8f5efe99b5da01f50da48c7d8aee3bbf4701f3da85ebe760c2ffef29', + }, + environment: 'production', + name: 'opbeans-go', + runtime: { + name: 'gc', + version: 'go1.14.1', + }, + language: { name: 'go', - version: '1.7.2', - }, - processor: { - name: 'transaction', - event: 'span', + version: 'go1.14.1', }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', + version: 'None', + }, + transaction: { + id: '975c8d5bfd1dd20b', + }, + timestamp: { + us: 1584975868787174, + }, + span: { + duration: { + us: 16250, }, - '@timestamp': '2020-03-23T15:04:28.787Z', - service: { - node: { - name: - 'e948a08b8f5efe99b5da01f50da48c7d8aee3bbf4701f3da85ebe760c2ffef29', - }, - environment: 'production', - name: 'opbeans-go', - runtime: { - name: 'gc', - version: 'go1.14.1', - }, - language: { - name: 'go', - version: 'go1.14.1', + subtype: 'http', + destination: { + service: { + resource: 'opbeans-python:3000', + name: 'http://opbeans-python:3000', + type: 'external', }, - version: 'None', - }, - transaction: { - id: '975c8d5bfd1dd20b', }, - timestamp: { - us: 1584975868787174, - }, - span: { - duration: { - us: 16250, - }, - subtype: 'http', - destination: { - service: { - resource: 'opbeans-python:3000', - name: 'http://opbeans-python:3000', - type: 'external', - }, + name: 'I am his 👇🏻 parent 😡', + http: { + response: { + status_code: 200, }, - name: 'I am his 👇🏻 parent 😡', - http: { - response: { - status_code: 200, - }, - url: { - original: 'http://opbeans-python:3000/api/orders', - }, + url: { + original: 'http://opbeans-python:3000/api/orders', }, - id: 'daae24d83c269918', - type: 'external', }, + id: 'daae24d83c269918', + type: 'external', + }, + }, + { + container: { + id: 'a636915f1f6eec81ab44342b13a3ea9597ef03a24391e4e55f34ae2e20b30f51', }, - { - container: { - id: + parent: { + id: '6fb0ff7365b87298', + }, + agent: { + name: 'python', + version: '5.5.2', + }, + processor: { + name: 'transaction', + event: 'span', + }, + trace: { + id: '513d33fafe99bbe6134749310c9b5322', + }, + '@timestamp': '2020-03-23T15:04:28.790Z', + service: { + node: { + name: 'a636915f1f6eec81ab44342b13a3ea9597ef03a24391e4e55f34ae2e20b30f51', }, - parent: { - id: '6fb0ff7365b87298', + environment: 'production', + framework: { + name: 'django', + version: '2.1.13', }, - agent: { - name: 'python', - version: '5.5.2', + name: 'opbeans-python', + runtime: { + name: 'CPython', + version: '3.6.10', }, - processor: { - name: 'transaction', - event: 'span', + language: { + name: 'python', + version: '3.6.10', }, - trace: { - id: '513d33fafe99bbe6134749310c9b5322', + version: 'None', + }, + transaction: { + id: '6fb0ff7365b87298', + }, + timestamp: { + us: 1584975868781000, + }, + span: { + duration: { + us: 2519, }, - '@timestamp': '2020-03-23T15:04:28.790Z', - service: { - node: { - name: - 'a636915f1f6eec81ab44342b13a3ea9597ef03a24391e4e55f34ae2e20b30f51', - }, - environment: 'production', - framework: { - name: 'django', - version: '2.1.13', - }, - name: 'opbeans-python', - runtime: { - name: 'CPython', - version: '3.6.10', - }, - language: { - name: 'python', - version: '3.6.10', + subtype: 'postgresql', + name: 'I am using my parents skew 😇', + destination: { + service: { + resource: 'postgresql', + name: 'postgresql', + type: 'db', }, - version: 'None', - }, - transaction: { - id: '6fb0ff7365b87298', - }, - timestamp: { - us: 1584975868781000, }, - span: { - duration: { - us: 2519, - }, - subtype: 'postgresql', - name: 'I am using my parents skew 😇', - destination: { - service: { - resource: 'postgresql', - name: 'postgresql', - type: 'db', - }, - }, - action: 'query', - id: 'c9407abb4d08ead1', - type: 'db', - sync: true, - db: { - statement: - 'SELECT "opbeans_order"."id", "opbeans_order"."customer_id", "opbeans_customer"."full_name", "opbeans_order"."created_at" FROM "opbeans_order" INNER JOIN "opbeans_customer" ON ("opbeans_order"."customer_id" = "opbeans_customer"."id") LIMIT 1000', - type: 'sql', - }, + action: 'query', + id: 'c9407abb4d08ead1', + type: 'db', + sync: true, + db: { + statement: + 'SELECT "opbeans_order"."id", "opbeans_order"."customer_id", "opbeans_customer"."full_name", "opbeans_order"."created_at" FROM "opbeans_order" INNER JOIN "opbeans_customer" ON ("opbeans_order"."customer_id" = "opbeans_customer"."id") LIMIT 1000', + type: 'sql', }, }, - ], - exceedsMax: false, - errorDocs: [], - }, - errorsPerTransaction: {}, -}; + }, + ], + exceedsMax: false, + errorDocs: [], +} as TraceAPIResponse; export const inferredSpans = { - trace: { - items: [ - { - container: { - id: + traceDocs: [ + { + container: { + id: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', + }, + agent: { + name: 'java', + ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', + version: '1.15.1-SNAPSHOT', + }, + process: { + pid: 6, + title: '/opt/java/openjdk/bin/java', + ppid: 1, + }, + source: { + ip: '172.18.0.8', + }, + processor: { + name: 'transaction', + event: 'transaction', + }, + url: { + path: '/api/products/2', + scheme: 'http', + port: 3000, + domain: '172.18.0.7', + full: 'http://172.18.0.7:3000/api/products/2', + }, + observer: { + hostname: '7189f754b5a3', + id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', + ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', + type: 'apm-server', + version: '8.0.0', + version_major: 8, + }, + trace: { + id: '3b0dc77f3754e5bcb9da0e4c15e0db97', + }, + '@timestamp': '2020-04-09T11:36:00.786Z', + ecs: { + version: '1.5.0', + }, + service: { + node: { + name: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', }, - agent: { - name: 'java', - ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', - version: '1.15.1-SNAPSHOT', - }, - process: { - pid: 6, - title: '/opt/java/openjdk/bin/java', - ppid: 1, - }, - source: { - ip: '172.18.0.8', - }, - processor: { - name: 'transaction', - event: 'transaction', - }, - url: { - path: '/api/products/2', - scheme: 'http', - port: 3000, - domain: '172.18.0.7', - full: 'http://172.18.0.7:3000/api/products/2', - }, - observer: { - hostname: '7189f754b5a3', - id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', - ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', - type: 'apm-server', - version: '8.0.0', - version_major: 8, - }, - trace: { - id: '3b0dc77f3754e5bcb9da0e4c15e0db97', - }, - '@timestamp': '2020-04-09T11:36:00.786Z', - ecs: { - version: '1.5.0', - }, - service: { - node: { - name: - 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', - }, - environment: 'production', - name: 'opbeans-java', - runtime: { - name: 'Java', - version: '11.0.6', - }, - language: { - name: 'Java', - version: '11.0.6', - }, - version: 'None', - }, - host: { - hostname: 'fc2ae281f56f', - os: { - platform: 'Linux', - }, - ip: '172.18.0.7', - name: 'fc2ae281f56f', - architecture: 'amd64', - }, - client: { - ip: '172.18.0.8', + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '11.0.6', }, - http: { - request: { - headers: { - Accept: ['*/*'], - 'User-Agent': ['Python/3.7 aiohttp/3.3.2'], - Host: ['172.18.0.7:3000'], - 'Accept-Encoding': ['gzip, deflate'], - }, - method: 'get', - socket: { - encrypted: false, - remote_address: '172.18.0.8', - }, - }, - response: { - headers: { - 'Transfer-Encoding': ['chunked'], - Date: ['Thu, 09 Apr 2020 11:36:01 GMT'], - 'Content-Type': ['application/json;charset=UTF-8'], - }, - status_code: 200, - finished: true, - headers_sent: true, - }, - version: '1.1', + language: { + name: 'Java', + version: '11.0.6', }, - user_agent: { - original: 'Python/3.7 aiohttp/3.3.2', + version: 'None', + }, + host: { + hostname: 'fc2ae281f56f', + os: { + platform: 'Linux', + }, + ip: '172.18.0.7', + name: 'fc2ae281f56f', + architecture: 'amd64', + }, + client: { + ip: '172.18.0.8', + }, + http: { + request: { + headers: { + Accept: ['*/*'], + 'User-Agent': ['Python/3.7 aiohttp/3.3.2'], + Host: ['172.18.0.7:3000'], + 'Accept-Encoding': ['gzip, deflate'], + }, + method: 'get', + socket: { + encrypted: false, + remote_address: '172.18.0.8', + }, + }, + response: { + headers: { + 'Transfer-Encoding': ['chunked'], + Date: ['Thu, 09 Apr 2020 11:36:01 GMT'], + 'Content-Type': ['application/json;charset=UTF-8'], + }, + status_code: 200, + finished: true, + headers_sent: true, + }, + version: '1.1', + }, + user_agent: { + original: 'Python/3.7 aiohttp/3.3.2', + name: 'Other', + device: { name: 'Other', - device: { - name: 'Other', - }, - }, - transaction: { - duration: { - us: 237537, - }, - result: 'HTTP 2xx', - name: 'APIRestController#product', - span_count: { - dropped: 0, - started: 3, - }, - id: 'f2387d37260d00bd', - type: 'request', - sampled: true, - }, - timestamp: { - us: 1586432160786001, }, }, - { - container: { - id: + transaction: { + duration: { + us: 237537, + }, + result: 'HTTP 2xx', + name: 'APIRestController#product', + span_count: { + dropped: 0, + started: 3, + }, + id: 'f2387d37260d00bd', + type: 'request', + sampled: true, + }, + timestamp: { + us: 1586432160786001, + }, + }, + { + container: { + id: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', + }, + parent: { + id: 'f2387d37260d00bd', + }, + agent: { + name: 'java', + ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', + version: '1.15.1-SNAPSHOT', + }, + process: { + pid: 6, + title: '/opt/java/openjdk/bin/java', + ppid: 1, + }, + processor: { + name: 'transaction', + event: 'span', + }, + observer: { + hostname: '7189f754b5a3', + id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', + ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', + type: 'apm-server', + version: '8.0.0', + version_major: 8, + }, + trace: { + id: '3b0dc77f3754e5bcb9da0e4c15e0db97', + }, + '@timestamp': '2020-04-09T11:36:00.810Z', + ecs: { + version: '1.5.0', + }, + service: { + node: { + name: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', }, - parent: { - id: 'f2387d37260d00bd', - }, - agent: { - name: 'java', - ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', - version: '1.15.1-SNAPSHOT', - }, - process: { - pid: 6, - title: '/opt/java/openjdk/bin/java', - ppid: 1, - }, - processor: { - name: 'transaction', - event: 'span', - }, - observer: { - hostname: '7189f754b5a3', - id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', - ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', - type: 'apm-server', - version: '8.0.0', - version_major: 8, - }, - trace: { - id: '3b0dc77f3754e5bcb9da0e4c15e0db97', - }, - '@timestamp': '2020-04-09T11:36:00.810Z', - ecs: { - version: '1.5.0', - }, - service: { - node: { - name: - 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', - }, - environment: 'production', - name: 'opbeans-java', - runtime: { - name: 'Java', - version: '11.0.6', - }, - language: { - name: 'Java', - version: '11.0.6', - }, - version: 'None', - }, - host: { - hostname: 'fc2ae281f56f', - os: { - platform: 'Linux', - }, - ip: '172.18.0.7', - name: 'fc2ae281f56f', - architecture: 'amd64', - }, - transaction: { - id: 'f2387d37260d00bd', - }, - span: { - duration: { - us: 204574, - }, - subtype: 'inferred', - name: 'ServletInvocableHandlerMethod#invokeAndHandle', - id: 'a5df600bd7bd5e38', - type: 'app', + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '11.0.6', }, - timestamp: { - us: 1586432160810441, + language: { + name: 'Java', + version: '11.0.6', }, + version: 'None', + }, + host: { + hostname: 'fc2ae281f56f', + os: { + platform: 'Linux', + }, + ip: '172.18.0.7', + name: 'fc2ae281f56f', + architecture: 'amd64', + }, + transaction: { + id: 'f2387d37260d00bd', + }, + span: { + duration: { + us: 204574, + }, + subtype: 'inferred', + name: 'ServletInvocableHandlerMethod#invokeAndHandle', + id: 'a5df600bd7bd5e38', + type: 'app', }, - { - container: { - id: + timestamp: { + us: 1586432160810441, + }, + }, + { + container: { + id: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', + }, + parent: { + id: 'a5df600bd7bd5e38', + }, + agent: { + name: 'java', + ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', + version: '1.15.1-SNAPSHOT', + }, + process: { + pid: 6, + title: '/opt/java/openjdk/bin/java', + ppid: 1, + }, + processor: { + name: 'transaction', + event: 'span', + }, + observer: { + hostname: '7189f754b5a3', + id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', + type: 'apm-server', + ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', + version: '8.0.0', + version_major: 8, + }, + trace: { + id: '3b0dc77f3754e5bcb9da0e4c15e0db97', + }, + '@timestamp': '2020-04-09T11:36:00.810Z', + ecs: { + version: '1.5.0', + }, + service: { + node: { + name: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', }, - parent: { - id: 'a5df600bd7bd5e38', - }, - agent: { - name: 'java', - ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', - version: '1.15.1-SNAPSHOT', - }, - process: { - pid: 6, - title: '/opt/java/openjdk/bin/java', - ppid: 1, - }, - processor: { - name: 'transaction', - event: 'span', - }, - observer: { - hostname: '7189f754b5a3', - id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', - type: 'apm-server', - ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', - version: '8.0.0', - version_major: 8, - }, - trace: { - id: '3b0dc77f3754e5bcb9da0e4c15e0db97', - }, - '@timestamp': '2020-04-09T11:36:00.810Z', - ecs: { - version: '1.5.0', - }, - service: { - node: { - name: - 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', - }, - environment: 'production', - name: 'opbeans-java', - runtime: { - name: 'Java', - version: '11.0.6', - }, - language: { - name: 'Java', - version: '11.0.6', - }, - version: 'None', - }, - host: { - hostname: 'fc2ae281f56f', - os: { - platform: 'Linux', - }, - ip: '172.18.0.7', - name: 'fc2ae281f56f', - architecture: 'amd64', - }, - transaction: { - id: 'f2387d37260d00bd', + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '11.0.6', }, - timestamp: { - us: 1586432160810441, + language: { + name: 'Java', + version: '11.0.6', }, - span: { - duration: { - us: 102993, - }, - stacktrace: [ - { - library_frame: true, - exclude_from_grouping: false, - filename: 'InvocableHandlerMethod.java', - line: { - number: -1, - }, - function: 'doInvoke', + version: 'None', + }, + host: { + hostname: 'fc2ae281f56f', + os: { + platform: 'Linux', + }, + ip: '172.18.0.7', + name: 'fc2ae281f56f', + architecture: 'amd64', + }, + transaction: { + id: 'f2387d37260d00bd', + }, + timestamp: { + us: 1586432160810441, + }, + span: { + duration: { + us: 102993, + }, + stacktrace: [ + { + library_frame: true, + exclude_from_grouping: false, + filename: 'InvocableHandlerMethod.java', + line: { + number: -1, }, - { - exclude_from_grouping: false, - library_frame: true, - filename: 'InvocableHandlerMethod.java', - line: { - number: -1, - }, - function: 'invokeForRequest', + function: 'doInvoke', + }, + { + exclude_from_grouping: false, + library_frame: true, + filename: 'InvocableHandlerMethod.java', + line: { + number: -1, }, - ], - subtype: 'inferred', - name: 'APIRestController#product', - id: '808dc34fc41ce522', - type: 'app', - }, + function: 'invokeForRequest', + }, + ], + subtype: 'inferred', + name: 'APIRestController#product', + id: '808dc34fc41ce522', + type: 'app', + }, + }, + { + container: { + id: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', + }, + parent: { + id: 'f2387d37260d00bd', }, - { - container: { - id: + agent: { + name: 'java', + ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', + version: '1.15.1-SNAPSHOT', + }, + process: { + pid: 6, + title: '/opt/java/openjdk/bin/java', + ppid: 1, + }, + processor: { + name: 'transaction', + event: 'span', + }, + labels: { + productId: '2', + }, + observer: { + hostname: '7189f754b5a3', + id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', + ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', + type: 'apm-server', + version: '8.0.0', + version_major: 8, + }, + trace: { + id: '3b0dc77f3754e5bcb9da0e4c15e0db97', + }, + '@timestamp': '2020-04-09T11:36:00.832Z', + ecs: { + version: '1.5.0', + }, + service: { + node: { + name: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', }, - parent: { - id: 'f2387d37260d00bd', - }, - agent: { - name: 'java', - ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', - version: '1.15.1-SNAPSHOT', - }, - process: { - pid: 6, - title: '/opt/java/openjdk/bin/java', - ppid: 1, - }, - processor: { - name: 'transaction', - event: 'span', - }, - labels: { - productId: '2', - }, - observer: { - hostname: '7189f754b5a3', - id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', - ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', - type: 'apm-server', - version: '8.0.0', - version_major: 8, - }, - trace: { - id: '3b0dc77f3754e5bcb9da0e4c15e0db97', - }, - '@timestamp': '2020-04-09T11:36:00.832Z', - ecs: { - version: '1.5.0', - }, - service: { - node: { - name: - 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', - }, - environment: 'production', - name: 'opbeans-java', - runtime: { - name: 'Java', - version: '11.0.6', - }, - language: { - name: 'Java', - version: '11.0.6', - }, - version: 'None', - }, - host: { - hostname: 'fc2ae281f56f', - os: { - platform: 'Linux', - }, - ip: '172.18.0.7', - name: 'fc2ae281f56f', - architecture: 'amd64', - }, - transaction: { - id: 'f2387d37260d00bd', + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '11.0.6', }, - timestamp: { - us: 1586432160832300, + language: { + name: 'Java', + version: '11.0.6', }, - span: { - duration: { - us: 99295, - }, - name: 'OpenTracing product span', - id: '41226ae63af4f235', - type: 'unknown', + version: 'None', + }, + host: { + hostname: 'fc2ae281f56f', + os: { + platform: 'Linux', + }, + ip: '172.18.0.7', + name: 'fc2ae281f56f', + architecture: 'amd64', + }, + transaction: { + id: 'f2387d37260d00bd', + }, + timestamp: { + us: 1586432160832300, + }, + span: { + duration: { + us: 99295, }, - child: { id: ['8d80de06aa11a6fc'] }, + name: 'OpenTracing product span', + id: '41226ae63af4f235', + type: 'unknown', + }, + child: { id: ['8d80de06aa11a6fc'] }, + }, + { + container: { + id: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', + }, + parent: { + id: '808dc34fc41ce522', + }, + process: { + pid: 6, + title: '/opt/java/openjdk/bin/java', + ppid: 1, + }, + agent: { + name: 'java', + ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', + version: '1.15.1-SNAPSHOT', + }, + processor: { + name: 'transaction', + event: 'span', + }, + observer: { + hostname: '7189f754b5a3', + id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', + ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', + type: 'apm-server', + version: '8.0.0', + version_major: 8, }, - { - container: { - id: + trace: { + id: '3b0dc77f3754e5bcb9da0e4c15e0db97', + }, + '@timestamp': '2020-04-09T11:36:00.859Z', + ecs: { + version: '1.5.0', + }, + service: { + node: { + name: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', }, - parent: { - id: '808dc34fc41ce522', - }, - process: { - pid: 6, - title: '/opt/java/openjdk/bin/java', - ppid: 1, - }, - agent: { - name: 'java', - ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', - version: '1.15.1-SNAPSHOT', - }, - processor: { - name: 'transaction', - event: 'span', - }, - observer: { - hostname: '7189f754b5a3', - id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', - ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', - type: 'apm-server', - version: '8.0.0', - version_major: 8, - }, - trace: { - id: '3b0dc77f3754e5bcb9da0e4c15e0db97', - }, - '@timestamp': '2020-04-09T11:36:00.859Z', - ecs: { - version: '1.5.0', - }, - service: { - node: { - name: - 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', - }, - environment: 'production', - name: 'opbeans-java', - runtime: { - name: 'Java', - version: '11.0.6', - }, - language: { - name: 'Java', - version: '11.0.6', - }, - version: 'None', - }, - host: { - hostname: 'fc2ae281f56f', - os: { - platform: 'Linux', - }, - ip: '172.18.0.7', - name: 'fc2ae281f56f', - architecture: 'amd64', - }, - transaction: { - id: 'f2387d37260d00bd', - }, - timestamp: { - us: 1586432160859600, + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '11.0.6', }, - span: { - duration: { - us: 53835, - }, - subtype: 'inferred', - name: 'Loader#executeQueryStatement', - id: '8d80de06aa11a6fc', - type: 'app', + language: { + name: 'Java', + version: '11.0.6', }, + version: 'None', + }, + host: { + hostname: 'fc2ae281f56f', + os: { + platform: 'Linux', + }, + ip: '172.18.0.7', + name: 'fc2ae281f56f', + architecture: 'amd64', + }, + transaction: { + id: 'f2387d37260d00bd', }, - { - container: { - id: + timestamp: { + us: 1586432160859600, + }, + span: { + duration: { + us: 53835, + }, + subtype: 'inferred', + name: 'Loader#executeQueryStatement', + id: '8d80de06aa11a6fc', + type: 'app', + }, + }, + { + container: { + id: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', + }, + parent: { + id: '41226ae63af4f235', + }, + agent: { + name: 'java', + ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', + version: '1.15.1-SNAPSHOT', + }, + process: { + pid: 6, + title: '/opt/java/openjdk/bin/java', + ppid: 1, + }, + destination: { + address: 'postgres', + port: 5432, + }, + processor: { + name: 'transaction', + event: 'span', + }, + observer: { + hostname: '7189f754b5a3', + id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', + ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', + type: 'apm-server', + version: '8.0.0', + version_major: 8, + }, + trace: { + id: '3b0dc77f3754e5bcb9da0e4c15e0db97', + }, + '@timestamp': '2020-04-09T11:36:00.903Z', + ecs: { + version: '1.5.0', + }, + service: { + node: { + name: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', }, - parent: { - id: '41226ae63af4f235', + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '11.0.6', }, - agent: { - name: 'java', - ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', - version: '1.15.1-SNAPSHOT', + language: { + name: 'Java', + version: '11.0.6', }, - process: { - pid: 6, - title: '/opt/java/openjdk/bin/java', - ppid: 1, + version: 'None', + }, + host: { + hostname: 'fc2ae281f56f', + os: { + platform: 'Linux', + }, + ip: '172.18.0.7', + name: 'fc2ae281f56f', + architecture: 'amd64', + }, + transaction: { + id: 'f2387d37260d00bd', + }, + timestamp: { + us: 1586432160903236, + }, + span: { + duration: { + us: 10211, }, + subtype: 'postgresql', destination: { - address: 'postgres', - port: 5432, - }, - processor: { - name: 'transaction', - event: 'span', - }, - observer: { - hostname: '7189f754b5a3', - id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', - ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', - type: 'apm-server', - version: '8.0.0', - version_major: 8, - }, - trace: { - id: '3b0dc77f3754e5bcb9da0e4c15e0db97', - }, - '@timestamp': '2020-04-09T11:36:00.903Z', - ecs: { - version: '1.5.0', - }, - service: { - node: { - name: - 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', - }, - environment: 'production', - name: 'opbeans-java', - runtime: { - name: 'Java', - version: '11.0.6', - }, - language: { - name: 'Java', - version: '11.0.6', - }, - version: 'None', - }, - host: { - hostname: 'fc2ae281f56f', - os: { - platform: 'Linux', + service: { + resource: 'postgresql', + name: 'postgresql', + type: 'db', }, - ip: '172.18.0.7', - name: 'fc2ae281f56f', - architecture: 'amd64', - }, - transaction: { - id: 'f2387d37260d00bd', - }, - timestamp: { - us: 1586432160903236, }, - span: { - duration: { - us: 10211, - }, - subtype: 'postgresql', - destination: { - service: { - resource: 'postgresql', - name: 'postgresql', - type: 'db', - }, - }, - name: 'SELECT FROM products', - action: 'query', - id: '3708d5623658182f', - type: 'db', - db: { - statement: - 'select product0_.id as col_0_0_, product0_.sku as col_1_0_, product0_.name as col_2_0_, product0_.description as col_3_0_, product0_.cost as col_4_0_, product0_.selling_price as col_5_0_, product0_.stock as col_6_0_, producttyp1_.id as col_7_0_, producttyp1_.name as col_8_0_, (select sum(orderline2_.amount) from order_lines orderline2_ where orderline2_.product_id=product0_.id) as col_9_0_ from products product0_ left outer join product_types producttyp1_ on product0_.type_id=producttyp1_.id where product0_.id=?', - type: 'sql', - user: { - name: 'postgres', - }, + name: 'SELECT FROM products', + action: 'query', + id: '3708d5623658182f', + type: 'db', + db: { + statement: + 'select product0_.id as col_0_0_, product0_.sku as col_1_0_, product0_.name as col_2_0_, product0_.description as col_3_0_, product0_.cost as col_4_0_, product0_.selling_price as col_5_0_, product0_.stock as col_6_0_, producttyp1_.id as col_7_0_, producttyp1_.name as col_8_0_, (select sum(orderline2_.amount) from order_lines orderline2_ where orderline2_.product_id=product0_.id) as col_9_0_ from products product0_ left outer join product_types producttyp1_ on product0_.type_id=producttyp1_.id where product0_.id=?', + type: 'sql', + user: { + name: 'postgres', }, }, }, - { - container: { - id: + }, + { + container: { + id: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', + }, + parent: { + id: '41226ae63af4f235', + }, + process: { + pid: 6, + title: '/opt/java/openjdk/bin/java', + ppid: 1, + }, + agent: { + name: 'java', + ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', + version: '1.15.1-SNAPSHOT', + }, + destination: { + address: 'postgres', + port: 5432, + }, + processor: { + name: 'transaction', + event: 'span', + }, + observer: { + hostname: '7189f754b5a3', + id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', + ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', + type: 'apm-server', + version: '8.0.0', + version_major: 8, + }, + trace: { + id: '3b0dc77f3754e5bcb9da0e4c15e0db97', + }, + '@timestamp': '2020-04-09T11:36:00.859Z', + ecs: { + version: '1.5.0', + }, + service: { + node: { + name: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', }, - parent: { - id: '41226ae63af4f235', + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '11.0.6', }, - process: { - pid: 6, - title: '/opt/java/openjdk/bin/java', - ppid: 1, + language: { + name: 'Java', + version: '11.0.6', }, - agent: { - name: 'java', - ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', - version: '1.15.1-SNAPSHOT', + version: 'None', + }, + host: { + hostname: 'fc2ae281f56f', + os: { + platform: 'Linux', + }, + ip: '172.18.0.7', + name: 'fc2ae281f56f', + architecture: 'amd64', + }, + transaction: { + id: 'f2387d37260d00bd', + }, + timestamp: { + us: 1586432160859508, + }, + span: { + duration: { + us: 4503, }, + subtype: 'postgresql', destination: { - address: 'postgres', - port: 5432, - }, - processor: { - name: 'transaction', - event: 'span', - }, - observer: { - hostname: '7189f754b5a3', - id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', - ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', - type: 'apm-server', - version: '8.0.0', - version_major: 8, - }, - trace: { - id: '3b0dc77f3754e5bcb9da0e4c15e0db97', - }, - '@timestamp': '2020-04-09T11:36:00.859Z', - ecs: { - version: '1.5.0', - }, - service: { - node: { - name: - 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad', - }, - environment: 'production', - name: 'opbeans-java', - runtime: { - name: 'Java', - version: '11.0.6', - }, - language: { - name: 'Java', - version: '11.0.6', - }, - version: 'None', - }, - host: { - hostname: 'fc2ae281f56f', - os: { - platform: 'Linux', + service: { + resource: 'postgresql', + name: 'postgresql', + type: 'db', }, - ip: '172.18.0.7', - name: 'fc2ae281f56f', - architecture: 'amd64', }, - transaction: { - id: 'f2387d37260d00bd', - }, - timestamp: { - us: 1586432160859508, - }, - span: { - duration: { - us: 4503, - }, - subtype: 'postgresql', - destination: { - service: { - resource: 'postgresql', - name: 'postgresql', - type: 'db', - }, - }, - name: 'empty query', - action: 'query', - id: '9871cfd612368932', - type: 'db', - db: { - rows_affected: 0, - statement: '(empty query)', - type: 'sql', - user: { - name: 'postgres', - }, + name: 'empty query', + action: 'query', + id: '9871cfd612368932', + type: 'db', + db: { + rows_affected: 0, + statement: '(empty query)', + type: 'sql', + user: { + name: 'postgres', }, }, }, - ], - exceedsMax: false, - errorDocs: [], - }, - errorsPerTransaction: {}, -}; + }, + ], + exceedsMax: false, + errorDocs: [], +} as TraceAPIResponse; diff --git a/x-pack/plugins/apm/public/components/app/transaction_link/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_link/index.tsx index 25cbf2d319587..468a90f6b17de 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_link/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_link/index.tsx @@ -22,7 +22,7 @@ export function TransactionLink() { const { path: { transactionId }, query: { rangeFrom, rangeTo }, - } = useApmParams('/link-to/transaction/:transactionId'); + } = useApmParams('/link-to/transaction/{transactionId}'); const { data = { transaction: null }, status } = useFetcher( (callApmApi) => { diff --git a/x-pack/plugins/apm/public/components/app/transaction_overview/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_overview/index.tsx index be12522920740..a1362f7373e2a 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_overview/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_overview/index.tsx @@ -5,61 +5,42 @@ * 2.0. */ -import { EuiPanel, EuiSpacer, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { Location } from 'history'; +import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiSpacer } from '@elastic/eui'; import React from 'react'; -import { useLocation } from 'react-router-dom'; +import { useHistory } from 'react-router-dom'; import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context'; -import type { ApmUrlParams } from '../../../context/url_params_context/types'; -import { useUrlParams } from '../../../context/url_params_context/use_url_params'; import { useApmParams } from '../../../hooks/use_apm_params'; import { useFallbackToTransactionsFetcher } from '../../../hooks/use_fallback_to_transactions_fetcher'; import { useTimeRange } from '../../../hooks/use_time_range'; import { AggregatedTransactionsBadge } from '../../shared/aggregated_transactions_badge'; import { TransactionCharts } from '../../shared/charts/transaction_charts'; -import { fromQuery, toQuery } from '../../shared/Links/url_helpers'; +import { replace } from '../../shared/Links/url_helpers'; import { TransactionsTable } from '../../shared/transactions_table'; -import { useRedirect } from './useRedirect'; - -function getRedirectLocation({ - location, - transactionType, - urlParams, -}: { - location: Location; - transactionType?: string; - urlParams: ApmUrlParams; -}): Location | undefined { - const transactionTypeFromUrlParams = urlParams.transactionType; - - if (!transactionTypeFromUrlParams && transactionType) { - return { - ...location, - search: fromQuery({ - ...toQuery(location.search), - transactionType, - }), - }; - } -} - export function TransactionOverview() { const { - query: { environment, kuery, rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName/transactions'); + query: { + environment, + kuery, + rangeFrom, + rangeTo, + transactionType: transactionTypeFromUrl, + }, + } = useApmParams('/services/{serviceName}/transactions'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); const { fallbackToTransactions } = useFallbackToTransactionsFetcher({ kuery, }); - const location = useLocation(); - const { urlParams } = useUrlParams(); const { transactionType, serviceName } = useApmServiceContext(); + const history = useHistory(); + // redirect to first transaction type - useRedirect(getRedirectLocation({ location, transactionType, urlParams })); + if (!transactionTypeFromUrl && transactionType) { + replace(history, { query: { transactionType } }); + } // TODO: improve urlParams typings. // `serviceName` or `transactionType` will never be undefined here, and this check should not be needed diff --git a/x-pack/plugins/apm/public/components/app/transaction_overview/useRedirect.ts b/x-pack/plugins/apm/public/components/app/transaction_overview/useRedirect.ts deleted file mode 100644 index fae80eec42f9b..0000000000000 --- a/x-pack/plugins/apm/public/components/app/transaction_overview/useRedirect.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 { Location } from 'history'; -import { useEffect } from 'react'; -import { useHistory } from 'react-router-dom'; - -export function useRedirect(redirectLocation?: Location) { - const history = useHistory(); - - useEffect(() => { - if (redirectLocation) { - history.replace(redirectLocation); - } - }, [history, redirectLocation]); -} 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 b751ef3f71190..5377cb81b372e 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 @@ -21,7 +21,7 @@ import { settings } from './settings'; */ const apmRoutes = route([ { - path: '/link-to/transaction/:transactionId', + path: '/link-to/transaction/{transactionId}', element: , params: t.intersection([ t.type({ @@ -38,7 +38,7 @@ const apmRoutes = route([ ]), }, { - path: '/link-to/trace/:traceId', + path: '/link-to/trace/{traceId}', element: , params: t.intersection([ t.type({ 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 1430f5d8e4756..1736a22e9b540 100644 --- a/x-pack/plugins/apm/public/components/routing/home/index.tsx +++ b/x-pack/plugins/apm/public/components/routing/home/index.tsx @@ -104,7 +104,7 @@ export const home = { }), children: [ { - path: '/:backendName/overview', + path: '/backends/{backendName}/overview', element: , params: t.type({ path: t.type({ @@ -113,7 +113,7 @@ export const home = { }), }, page({ - path: '/', + path: '/backends', title: DependenciesInventoryTitle, element: , }), diff --git a/x-pack/plugins/apm/public/components/routing/service_detail/apm_service_wrapper.tsx b/x-pack/plugins/apm/public/components/routing/service_detail/apm_service_wrapper.tsx index aa69aa4fa7965..ef929331f3c1c 100644 --- a/x-pack/plugins/apm/public/components/routing/service_detail/apm_service_wrapper.tsx +++ b/x-pack/plugins/apm/public/components/routing/service_detail/apm_service_wrapper.tsx @@ -15,7 +15,7 @@ export function ApmServiceWrapper() { const { path: { serviceName }, query, - } = useApmParams('/services/:serviceName'); + } = useApmParams('/services/{serviceName}'); const router = useApmRouter(); @@ -26,7 +26,7 @@ export function ApmServiceWrapper() { }, { title: serviceName, - href: router.link('/services/:serviceName', { + href: router.link('/services/{serviceName}', { query, path: { serviceName }, }), 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 5124087369ee4..9b87cc338bb9b 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 @@ -62,7 +62,7 @@ function page({ } export const serviceDetail = { - path: '/services/:serviceName', + path: '/services/{serviceName}', element: , params: t.intersection([ t.type({ @@ -97,7 +97,7 @@ export const serviceDetail = { }, children: [ page({ - path: '/overview', + path: '/services/{serviceName}/overview', element: , tab: 'overview', title: i18n.translate('xpack.apm.views.overview.title', { @@ -110,7 +110,7 @@ export const serviceDetail = { }), { ...page({ - path: '/transactions', + path: '/services/{serviceName}/transactions', tab: 'transactions', title: i18n.translate('xpack.apm.views.transactions.title', { defaultMessage: 'Transactions', @@ -123,7 +123,7 @@ export const serviceDetail = { }), children: [ { - path: '/view', + path: '/services/{serviceName}/transactions/view', element: , params: t.type({ query: t.intersection([ @@ -138,13 +138,13 @@ export const serviceDetail = { }), }, { - path: '/', + path: '/services/{serviceName}/transactions', element: , }, ], }, page({ - path: '/dependencies', + path: '/services/{serviceName}/dependencies', element: , tab: 'dependencies', title: i18n.translate('xpack.apm.views.dependencies.title', { @@ -156,7 +156,7 @@ export const serviceDetail = { }), { ...page({ - path: '/errors', + path: '/services/{serviceName}/errors', tab: 'errors', title: i18n.translate('xpack.apm.views.errors.title', { defaultMessage: 'Errors', @@ -173,7 +173,7 @@ export const serviceDetail = { }), children: [ { - path: '/:groupId', + path: '/services/{serviceName}/errors/{groupId}', element: , params: t.type({ path: t.type({ @@ -182,13 +182,13 @@ export const serviceDetail = { }), }, { - path: '/', + path: '/services/{serviceName}/errors', element: , }, ], }, page({ - path: '/metrics', + path: '/services/{serviceName}/metrics', tab: 'metrics', title: i18n.translate('xpack.apm.views.metrics.title', { defaultMessage: 'Metrics', @@ -197,7 +197,7 @@ export const serviceDetail = { }), { ...page({ - path: '/nodes', + path: '/services/{serviceName}/nodes', tab: 'nodes', title: i18n.translate('xpack.apm.views.nodes.title', { defaultMessage: 'JVMs', @@ -206,7 +206,7 @@ export const serviceDetail = { }), children: [ { - path: '/:serviceNodeName/metrics', + path: '/services/{serviceName}/nodes/{serviceNodeName}/metrics', element: , params: t.type({ path: t.type({ @@ -215,7 +215,7 @@ export const serviceDetail = { }), }, { - path: '/', + path: '/services/{serviceName}/nodes', element: , params: t.partial({ query: t.partial({ @@ -229,7 +229,7 @@ export const serviceDetail = { ], }, page({ - path: '/service-map', + path: '/services/{serviceName}/service-map', tab: 'service-map', title: i18n.translate('xpack.apm.views.serviceMap.title', { defaultMessage: 'Service Map', @@ -240,7 +240,7 @@ export const serviceDetail = { }, }), page({ - path: '/logs', + path: '/services/{serviceName}/logs', tab: 'logs', title: i18n.translate('xpack.apm.views.logs.title', { defaultMessage: 'Logs', @@ -251,7 +251,7 @@ export const serviceDetail = { }, }), page({ - path: '/profiling', + path: '/services/{serviceName}/profiling', tab: 'profiling', title: i18n.translate('xpack.apm.views.serviceProfiling.title', { defaultMessage: 'Profiling', @@ -259,7 +259,7 @@ export const serviceDetail = { element: , }), { - path: '/', + path: '/services/{serviceName}/', element: , }, ], diff --git a/x-pack/plugins/apm/public/components/routing/service_detail/redirect_to_default_service_route_view.tsx b/x-pack/plugins/apm/public/components/routing/service_detail/redirect_to_default_service_route_view.tsx index 66595430f618d..1cd61ef6e9243 100644 --- a/x-pack/plugins/apm/public/components/routing/service_detail/redirect_to_default_service_route_view.tsx +++ b/x-pack/plugins/apm/public/components/routing/service_detail/redirect_to_default_service_route_view.tsx @@ -13,7 +13,7 @@ export function RedirectToDefaultServiceRouteView() { const { path: { serviceName }, query, - } = useApmParams('/services/:serviceName/*'); + } = useApmParams('/services/{serviceName}/*'); const search = qs.stringify(query); diff --git a/x-pack/plugins/apm/public/components/routing/settings/index.tsx b/x-pack/plugins/apm/public/components/routing/settings/index.tsx index e844f05050d17..e33f60e5593b0 100644 --- a/x-pack/plugins/apm/public/components/routing/settings/index.tsx +++ b/x-pack/plugins/apm/public/components/routing/settings/index.tsx @@ -58,7 +58,7 @@ export const settings = { ), children: [ page({ - path: '/agent-configuration', + path: '/settings/agent-configuration', tab: 'agent-configurations', title: i18n.translate( 'xpack.apm.views.settings.agentConfiguration.title', @@ -68,7 +68,7 @@ export const settings = { }), { ...page({ - path: '/agent-configuration/create', + path: '/settings/agent-configuration/create', title: i18n.translate( 'xpack.apm.views.settings.createAgentConfiguration.title', { defaultMessage: 'Create Agent Configuration' } @@ -84,7 +84,7 @@ export const settings = { }, { ...page({ - path: '/agent-configuration/edit', + path: '/settings/agent-configuration/edit', title: i18n.translate( 'xpack.apm.views.settings.editAgentConfiguration.title', { defaultMessage: 'Edit Agent Configuration' } @@ -101,7 +101,7 @@ export const settings = { }), }, page({ - path: '/apm-indices', + path: '/settings/apm-indices', title: i18n.translate('xpack.apm.views.settings.indices.title', { defaultMessage: 'Indices', }), @@ -109,7 +109,7 @@ export const settings = { element: , }), page({ - path: '/customize-ui', + path: '/settings/customize-ui', title: i18n.translate('xpack.apm.views.settings.customizeUI.title', { defaultMessage: 'Customize app', }), @@ -117,7 +117,7 @@ export const settings = { element: , }), page({ - path: '/schema', + path: '/settings/schema', title: i18n.translate('xpack.apm.views.settings.schema.title', { defaultMessage: 'Schema', }), @@ -125,7 +125,7 @@ export const settings = { tab: 'schema', }), page({ - path: '/anomaly-detection', + path: '/settings/anomaly-detection', title: i18n.translate('xpack.apm.views.settings.anomalyDetection.title', { defaultMessage: 'Anomaly detection', }), @@ -133,7 +133,7 @@ export const settings = { tab: 'anomaly-detection', }), { - path: '/', + path: '/settings', element: , }, ], 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 2a1ccd00e5a71..6a4ab5d7d9bc5 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 @@ -7,9 +7,15 @@ import { EuiPageHeaderProps, EuiPageTemplateProps } from '@elastic/eui'; import React from 'react'; +import { useLocation } from 'react-router-dom'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { useFetcher } from '../../../hooks/use_fetcher'; import { ApmPluginStartDeps } from '../../../plugin'; import { ApmEnvironmentFilter } from '../../shared/EnvironmentFilter'; +import { getNoDataConfig } from './no_data_config'; + +// Paths that must skip the no data screen +const bypassNoDataScreenPaths = ['/settings']; /* * This template contains: @@ -30,13 +36,32 @@ export function ApmMainTemplate({ pageHeader?: EuiPageHeaderProps; children: React.ReactNode; } & EuiPageTemplateProps) { + const location = useLocation(); + const { services } = useKibana(); + const { http, docLinks } = services; + const basePath = http?.basePath.get(); const ObservabilityPageTemplate = services.observability.navigation.PageTemplate; + const { data } = useFetcher((callApmApi) => { + return callApmApi({ endpoint: 'GET /api/apm/has_data' }); + }, []); + + const noDataConfig = getNoDataConfig({ + basePath, + docsLink: docLinks!.links.observability.guide, + hasData: data?.hasData, + }); + + const shouldBypassNoDataScreen = bypassNoDataScreenPaths.some((path) => + location.pathname.includes(path) + ); + return ( ], diff --git a/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/analyze_data_button.tsx b/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/analyze_data_button.tsx index 03fe39e818eaa..068d7bb1c242f 100644 --- a/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/analyze_data_button.tsx +++ b/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/analyze_data_button.tsx @@ -47,7 +47,7 @@ export function AnalyzeDataButton() { const { query: { rangeFrom, rangeTo, environment }, - } = useApmParams('/services/:serviceName'); + } = useApmParams('/services/{serviceName}'); const basepath = services.http?.basePath.get(); const canShowDashboard = services.application?.capabilities.dashboard.show; diff --git a/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/index.tsx b/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/index.tsx index bb00c631fe171..0ae718c79cf39 100644 --- a/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/index.tsx +++ b/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/index.tsx @@ -72,7 +72,7 @@ function TemplateWithContext({ path: { serviceName }, query, query: { rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName/*'); + } = useApmParams('/services/{serviceName}/*'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); @@ -82,7 +82,7 @@ function TemplateWithContext({ useBreadcrumb({ title, - href: router.link(`/services/:serviceName/${selectedTab}` as const, { + href: router.link(`/services/{serviceName}/${selectedTab}` as const, { path: { serviceName }, query, }), @@ -162,7 +162,7 @@ function useTabs({ selectedTab }: { selectedTab: Tab['key'] }) { const { path: { serviceName }, query: queryFromUrl, - } = useApmParams(`/services/:serviceName/${selectedTab}` as const); + } = useApmParams(`/services/{serviceName}/${selectedTab}` as const); const query = omit( queryFromUrl, @@ -175,7 +175,7 @@ function useTabs({ selectedTab }: { selectedTab: Tab['key'] }) { const tabs: Tab[] = [ { key: 'overview', - href: router.link('/services/:serviceName/overview', { + href: router.link('/services/{serviceName}/overview', { path: { serviceName }, query, }), @@ -185,7 +185,7 @@ function useTabs({ selectedTab }: { selectedTab: Tab['key'] }) { }, { key: 'transactions', - href: router.link('/services/:serviceName/transactions', { + href: router.link('/services/{serviceName}/transactions', { path: { serviceName }, query, }), @@ -195,7 +195,7 @@ function useTabs({ selectedTab }: { selectedTab: Tab['key'] }) { }, { key: 'dependencies', - href: router.link('/services/:serviceName/dependencies', { + href: router.link('/services/{serviceName}/dependencies', { path: { serviceName }, query, }), @@ -207,7 +207,7 @@ function useTabs({ selectedTab }: { selectedTab: Tab['key'] }) { }, { key: 'errors', - href: router.link('/services/:serviceName/errors', { + href: router.link('/services/{serviceName}/errors', { path: { serviceName }, query, }), @@ -217,7 +217,7 @@ function useTabs({ selectedTab }: { selectedTab: Tab['key'] }) { }, { key: 'metrics', - href: router.link('/services/:serviceName/metrics', { + href: router.link('/services/{serviceName}/metrics', { path: { serviceName }, query, }), @@ -228,7 +228,7 @@ function useTabs({ selectedTab }: { selectedTab: Tab['key'] }) { }, { key: 'nodes', - href: router.link('/services/:serviceName/nodes', { + href: router.link('/services/{serviceName}/nodes', { path: { serviceName }, query, }), @@ -239,7 +239,7 @@ function useTabs({ selectedTab }: { selectedTab: Tab['key'] }) { }, { key: 'service-map', - href: router.link('/services/:serviceName/service-map', { + href: router.link('/services/{serviceName}/service-map', { path: { serviceName }, query, }), @@ -249,7 +249,7 @@ function useTabs({ selectedTab }: { selectedTab: Tab['key'] }) { }, { key: 'logs', - href: router.link('/services/:serviceName/logs', { + href: router.link('/services/{serviceName}/logs', { path: { serviceName }, query, }), @@ -261,7 +261,7 @@ function useTabs({ selectedTab }: { selectedTab: Tab['key'] }) { }, { key: 'profiling', - href: router.link('/services/:serviceName/profiling', { + href: router.link('/services/{serviceName}/profiling', { path: { serviceName, }, diff --git a/x-pack/plugins/apm/public/components/routing/templates/no_data_config.ts b/x-pack/plugins/apm/public/components/routing/templates/no_data_config.ts new file mode 100644 index 0000000000000..868db57a0efdc --- /dev/null +++ b/x-pack/plugins/apm/public/components/routing/templates/no_data_config.ts @@ -0,0 +1,44 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import { KibanaPageTemplateProps } from '../../../../../../../src/plugins/kibana_react/public'; + +export function getNoDataConfig({ + docsLink, + basePath, + hasData, +}: { + docsLink: string; + basePath?: string; + hasData?: boolean; +}): KibanaPageTemplateProps['noDataConfig'] { + // Returns no data config when there is no historical data + if (hasData === false) { + return { + solution: i18n.translate('xpack.apm.noDataConfig.solutionName', { + defaultMessage: 'Observability', + }), + actions: { + beats: { + title: i18n.translate('xpack.apm.noDataConfig.beatsCard.title', { + defaultMessage: 'Add data with APM agents', + }), + description: i18n.translate( + 'xpack.apm.noDataConfig.beatsCard.description', + { + defaultMessage: + 'Use APM agents to collect APM data. We make it easy with agents for many popular languages.', + } + ), + href: basePath + `/app/home#/tutorial/apm`, + }, + }, + docsLink, + }; + } +} diff --git a/x-pack/plugins/apm/public/components/routing/templates/settings_template.test.tsx b/x-pack/plugins/apm/public/components/routing/templates/settings_template.test.tsx index d3efef4c88380..b601eb8ffcb2b 100644 --- a/x-pack/plugins/apm/public/components/routing/templates/settings_template.test.tsx +++ b/x-pack/plugins/apm/public/components/routing/templates/settings_template.test.tsx @@ -11,7 +11,7 @@ import React, { ReactNode } from 'react'; import { SettingsTemplate } from './settings_template'; import { createMemoryHistory } from 'history'; import { MemoryRouter, RouteComponentProps } from 'react-router-dom'; -import { CoreStart } from 'kibana/public'; +import { CoreStart, DocLinksStart, HttpStart } from 'kibana/public'; import { createKibanaReactContext } from 'src/plugins/kibana_react/public'; const { location } = createMemoryHistory(); @@ -25,6 +25,20 @@ const KibanaReactContext = createKibanaReactContext({ }, }, }, + http: { + basePath: { + prepend: (path: string) => `/basepath${path}`, + get: () => `/basepath`, + }, + } as HttpStart, + docLinks: ({ + DOC_LINK_VERSION: '0', + ELASTIC_WEBSITE_URL: 'https://www.elastic.co/', + links: { + apm: {}, + observability: { guide: '' }, + }, + } as unknown) as DocLinksStart, } as Partial); function Wrapper({ children }: { children?: ReactNode }) { diff --git a/x-pack/plugins/apm/public/components/shared/ImpactBar/__snapshots__/ImpactBar.test.js.snap b/x-pack/plugins/apm/public/components/shared/ImpactBar/__snapshots__/ImpactBar.test.js.snap index 87b5b68e26026..1c7b9c7662776 100644 --- a/x-pack/plugins/apm/public/components/shared/ImpactBar/__snapshots__/ImpactBar.test.js.snap +++ b/x-pack/plugins/apm/public/components/shared/ImpactBar/__snapshots__/ImpactBar.test.js.snap @@ -5,6 +5,11 @@ exports[`ImpactBar component should render with default values 1`] = ` color="primary" max={100} size="m" + style={ + Object { + "width": "96px", + } + } value={25} /> `; @@ -14,6 +19,11 @@ exports[`ImpactBar component should render with overridden values 1`] = ` color="danger" max={5} size="s" + style={ + Object { + "width": "96px", + } + } value={2} /> `; diff --git a/x-pack/plugins/apm/public/components/shared/ImpactBar/index.tsx b/x-pack/plugins/apm/public/components/shared/ImpactBar/index.tsx index 87b3c669e993c..5c7c4edec1850 100644 --- a/x-pack/plugins/apm/public/components/shared/ImpactBar/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/ImpactBar/index.tsx @@ -7,6 +7,7 @@ import { EuiProgress } from '@elastic/eui'; import React from 'react'; +import { unit } from '../../../utils/style'; // TODO: extend from EUI's EuiProgress prop interface export interface ImpactBarProps extends Record { @@ -16,6 +17,8 @@ export interface ImpactBarProps extends Record { color?: string; } +const style = { width: `${unit * 6}px` }; + export function ImpactBar({ value, size = 'm', @@ -24,6 +27,13 @@ export function ImpactBar({ ...rest }: ImpactBarProps) { return ( - + ); } diff --git a/x-pack/plugins/apm/public/components/shared/Links/apm/ErrorOverviewLink.tsx b/x-pack/plugins/apm/public/components/shared/Links/apm/ErrorOverviewLink.tsx index 562cd255843bb..b06de47472a11 100644 --- a/x-pack/plugins/apm/public/components/shared/Links/apm/ErrorOverviewLink.tsx +++ b/x-pack/plugins/apm/public/components/shared/Links/apm/ErrorOverviewLink.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { pickKeys } from '../../../../../common/utils/pick_keys'; import { useUrlParams } from '../../../../context/url_params_context/use_url_params'; import { APMQueryParams } from '../url_helpers'; -import { APMLink, APMLinkExtendProps, useAPMHref } from './APMLink'; +import { APMLink, APMLinkExtendProps } from './APMLink'; const persistedFilters: Array = [ 'host', @@ -18,13 +18,6 @@ const persistedFilters: Array = [ 'serviceVersion', ]; -export function useErrorOverviewHref(serviceName: string) { - return useAPMHref({ - path: `/services/${serviceName}/errors`, - persistedFilters, - }); -} - interface Props extends APMLinkExtendProps { serviceName: string; query?: APMQueryParams; diff --git a/x-pack/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/sections.ts b/x-pack/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/sections.ts index 141a054a311c3..f19aef8e0bd8a 100644 --- a/x-pack/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/sections.ts +++ b/x-pack/plugins/apm/public/components/shared/MetadataTable/SpanMetadata/sections.ts @@ -11,6 +11,7 @@ import { SERVICE, SPAN, LABELS, + EVENT, TRANSACTION, TRACE, MESSAGE_SPAN, @@ -20,6 +21,7 @@ export const SPAN_METADATA_SECTIONS: Section[] = [ LABELS, TRACE, TRANSACTION, + EVENT, SPAN, SERVICE, MESSAGE_SPAN, diff --git a/x-pack/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/sections.ts b/x-pack/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/sections.ts index 59a2c88809ccc..2f4a3d3229857 100644 --- a/x-pack/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/sections.ts +++ b/x-pack/plugins/apm/public/components/shared/MetadataTable/TransactionMetadata/sections.ts @@ -9,6 +9,7 @@ import { Section, TRANSACTION, LABELS, + EVENT, HTTP, HOST, CLIENT, @@ -29,6 +30,7 @@ export const TRANSACTION_METADATA_SECTIONS: Section[] = [ { ...LABELS, required: true }, TRACE, TRANSACTION, + EVENT, HTTP, HOST, CLIENT, diff --git a/x-pack/plugins/apm/public/components/shared/MetadataTable/index.tsx b/x-pack/plugins/apm/public/components/shared/MetadataTable/index.tsx index 938d5f4519431..45be525512d0a 100644 --- a/x-pack/plugins/apm/public/components/shared/MetadataTable/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/MetadataTable/index.tsx @@ -10,6 +10,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiIcon, + EuiLink, EuiSpacer, EuiText, EuiTitle, @@ -19,11 +20,11 @@ import { isEmpty } from 'lodash'; import React, { useCallback } from 'react'; import { useHistory, useLocation } from 'react-router-dom'; import { useUrlParams } from '../../../context/url_params_context/use_url_params'; -import { ElasticDocsLink } from '../../shared/Links/ElasticDocsLink'; import { HeightRetainer } from '../HeightRetainer'; import { fromQuery, toQuery } from '../Links/url_helpers'; import { filterSectionsByTerm, SectionsWithRows } from './helper'; import { Section } from './Section'; +import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; interface Props { sections: SectionsWithRows; @@ -34,6 +35,7 @@ export function MetadataTable({ sections }: Props) { const location = useLocation(); const { urlParams } = useUrlParams(); const { searchTerm = '' } = urlParams; + const { docLinks } = useApmPluginContext().core; const filteredSections = filterSectionsByTerm(sections, searchTerm); @@ -55,11 +57,11 @@ export function MetadataTable({ sections }: Props) { - + How to add labels and other data - + { 5 hours ago diff --git a/x-pack/plugins/apm/public/components/shared/agent_icon/get_agent_icon.ts b/x-pack/plugins/apm/public/components/shared/agent_icon/get_agent_icon.ts index b3551e7ccebcb..e361d72eb2ce8 100644 --- a/x-pack/plugins/apm/public/components/shared/agent_icon/get_agent_icon.ts +++ b/x-pack/plugins/apm/public/components/shared/agent_icon/get_agent_icon.ts @@ -19,6 +19,7 @@ import goIcon from './icons/go.svg'; import iosIcon from './icons/ios.svg'; import darkIosIcon from './icons/ios_dark.svg'; import javaIcon from './icons/java.svg'; +import lambdaIcon from './icons/lambda.svg'; import nodeJsIcon from './icons/nodejs.svg'; import ocamlIcon from './icons/ocaml.svg'; import openTelemetryIcon from './icons/opentelemetry.svg'; @@ -37,6 +38,7 @@ const agentIcons: { [key: string]: string } = { go: goIcon, ios: iosIcon, java: javaIcon, + lambda: lambdaIcon, nodejs: nodeJsIcon, ocaml: ocamlIcon, opentelemetry: openTelemetryIcon, diff --git a/x-pack/plugins/apm/public/components/shared/agent_icon/icons/lambda.svg b/x-pack/plugins/apm/public/components/shared/agent_icon/icons/lambda.svg new file mode 100644 index 0000000000000..2ecd8c5e916b4 --- /dev/null +++ b/x-pack/plugins/apm/public/components/shared/agent_icon/icons/lambda.svg @@ -0,0 +1,4 @@ + + + + diff --git a/x-pack/plugins/apm/public/components/shared/backend_link.tsx b/x-pack/plugins/apm/public/components/shared/backend_link.tsx index caae47184510a..342c668d2efdb 100644 --- a/x-pack/plugins/apm/public/components/shared/backend_link.tsx +++ b/x-pack/plugins/apm/public/components/shared/backend_link.tsx @@ -18,7 +18,7 @@ const StyledLink = euiStyled(EuiLink)`${truncate('100%')};`; interface BackendLinkProps { backendName: string; - query: TypeOf['query']; + query: TypeOf['query']; subtype?: string; type?: string; onClick?: React.ComponentProps['onClick']; @@ -35,7 +35,7 @@ export function BackendLink({ return ( - + @@ -141,7 +142,7 @@ Example.args = { [ALERT_UUID]: ['af2ae371-df79-4fca-b0eb-a2dbd9478180'], [ALERT_RULE_UUID]: ['82e0ee40-c2f4-11eb-9a42-a9da66a1722f'], 'event.action': ['active'], - '@timestamp': ['2021-06-01T20:27:48.833Z'], + [TIMESTAMP]: ['2021-06-01T20:27:48.833Z'], [ALERT_INSTANCE_ID]: ['apm.transaction_duration_All'], 'processor.event': ['transaction'], [ALERT_EVALUATION_THRESHOLD]: [500000], @@ -163,7 +164,7 @@ Example.args = { [ALERT_UUID]: ['af2ae371-df79-4fca-b0eb-a2dbd9478181'], [ALERT_RULE_UUID]: ['82e0ee40-c2f4-11eb-9a42-a9da66a1722f'], 'event.action': ['active'], - '@timestamp': ['2021-06-01T20:27:48.833Z'], + [TIMESTAMP]: ['2021-06-01T20:27:48.833Z'], [ALERT_INSTANCE_ID]: ['apm.transaction_duration_All'], 'processor.event': ['transaction'], [ALERT_EVALUATION_THRESHOLD]: [500000], @@ -185,7 +186,7 @@ Example.args = { [ALERT_UUID]: ['af2ae371-df79-4fca-b0eb-a2dbd9478182'], [ALERT_RULE_UUID]: ['82e0ee40-c2f4-11eb-9a42-a9da66a1722f'], 'event.action': ['active'], - '@timestamp': ['2021-06-01T20:27:48.833Z'], + [TIMESTAMP]: ['2021-06-01T20:27:48.833Z'], [ALERT_INSTANCE_ID]: ['apm.transaction_duration_All'], 'processor.event': ['transaction'], [ALERT_EVALUATION_THRESHOLD]: [500000], 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 2743e957cd8ee..2f38ab9cdeb4b 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 @@ -40,6 +40,8 @@ function hasValidTimeseries( return !!series?.some((point) => point.y !== null); } +const flexGroupStyle = { overflow: 'hidden' }; + export function SparkPlot({ color, series, @@ -80,11 +82,15 @@ export function SparkPlot({ return ( + + {valueLabel} + {hasValidTimeseries(series) ? ( @@ -129,9 +135,6 @@ export function SparkPlot({ )} - - {valueLabel} - ); } diff --git a/x-pack/plugins/apm/public/components/shared/charts/transaction_breakdown_chart/use_transaction_breakdown.ts b/x-pack/plugins/apm/public/components/shared/charts/transaction_breakdown_chart/use_transaction_breakdown.ts index bb56338531df3..789461379d044 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/transaction_breakdown_chart/use_transaction_breakdown.ts +++ b/x-pack/plugins/apm/public/components/shared/charts/transaction_breakdown_chart/use_transaction_breakdown.ts @@ -24,7 +24,7 @@ export function useTransactionBreakdown({ const { query: { rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName'); + } = useApmParams('/services/{serviceName}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/plugins/apm/public/components/shared/charts/transaction_charts/ml_header.tsx b/x-pack/plugins/apm/public/components/shared/charts/transaction_charts/ml_header.tsx index f69b7e7004510..76e85b1d9998d 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/transaction_charts/ml_header.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/transaction_charts/ml_header.tsx @@ -36,7 +36,7 @@ export function MLHeader({ hasValidMlLicense, mlJobId }: Props) { const { query: { kuery }, - } = useApmParams('/services/:serviceName'); + } = useApmParams('/services/{serviceName}'); if (!hasValidMlLicense || !mlJobId) { return null; diff --git a/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.test.tsx b/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.test.tsx new file mode 100644 index 0000000000000..48bd992952c30 --- /dev/null +++ b/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.test.tsx @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { HistogramItem } from '../../../../../common/search_strategies/types'; + +import { replaceHistogramDotsWithBars } from './index'; + +describe('TransactionDistributionChart', () => { + describe('replaceHistogramDotsWithBars', () => { + it('does the thing', () => { + const mockHistogram = [ + { doc_count: 10 }, + { doc_count: 10 }, + { doc_count: 0 }, + { doc_count: 0 }, + { doc_count: 0 }, + { doc_count: 10 }, + { doc_count: 10 }, + { doc_count: 0 }, + { doc_count: 10 }, + { doc_count: 10 }, + ] as HistogramItem[]; + + expect(replaceHistogramDotsWithBars(mockHistogram)).toEqual([ + { doc_count: 10 }, + { doc_count: 10 }, + { doc_count: 0.0001 }, + { doc_count: 0 }, + { doc_count: 0 }, + { doc_count: 10 }, + { doc_count: 10 }, + { doc_count: 0.0001 }, + { doc_count: 10 }, + { doc_count: 10 }, + ]); + }); + }); +}); diff --git a/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.tsx b/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.tsx index a58a2887b1576..e8a159f23ee3d 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.tsx @@ -5,7 +5,9 @@ * 2.0. */ -import React, { useEffect, useMemo } from 'react'; +import React from 'react'; +import { flatten } from 'lodash'; + import { AnnotationDomainType, AreaSeries, @@ -30,31 +32,27 @@ import { i18n } from '@kbn/i18n'; import { useChartTheme } from '../../../../../../observability/public'; import { getDurationFormatter } from '../../../../../common/utils/formatters'; -import { HistogramItem } from '../../../../../common/search_strategies/correlations/types'; +import type { HistogramItem } from '../../../../../common/search_strategies/types'; import { FETCH_STATUS } from '../../../../hooks/use_fetcher'; import { useTheme } from '../../../../hooks/use_theme'; -import { ChartContainer, ChartContainerProps } from '../chart_container'; - -export type TransactionDistributionChartLoadingState = Pick< - ChartContainerProps, - 'hasData' | 'status' ->; +import { ChartContainer } from '../chart_container'; -export type OnHasData = (hasData: boolean) => void; +export interface TransactionDistributionChartData { + id: string; + histogram: HistogramItem[]; +} interface TransactionDistributionChartProps { - field?: string; - value?: string; - histogram?: HistogramItem[]; + data: TransactionDistributionChartData[]; + hasData: boolean; markerCurrentTransaction?: number; markerValue: number; markerPercentile: number; - overallHistogram?: HistogramItem[]; onChartSelection?: BrushEndListener; - onHasData?: OnHasData; selection?: [number, number]; + status: FETCH_STATUS; } const getAnnotationsStyle = (color = 'gray'): LineAnnotationStyle => ({ @@ -72,29 +70,24 @@ const getAnnotationsStyle = (color = 'gray'): LineAnnotationStyle => ({ }, }); +// TODO Revisit this approach since it actually manipulates the numbers +// showing in the chart and its tooltips. const CHART_PLACEHOLDER_VALUE = 0.0001; // Elastic charts will show any lone bin (i.e. a populated bin followed by empty bin) // as a circular marker instead of a bar // This provides a workaround by making the next bin not empty -export const replaceHistogramDotsWithBars = ( - originalHistogram: HistogramItem[] | undefined -) => { - if (originalHistogram === undefined) return; - const histogram = [...originalHistogram]; - { - for (let i = 0; i < histogram.length - 1; i++) { - if ( - histogram[i].doc_count > 0 && - histogram[i].doc_count !== CHART_PLACEHOLDER_VALUE && - histogram[i + 1].doc_count === 0 - ) { - histogram[i + 1].doc_count = CHART_PLACEHOLDER_VALUE; - } +export const replaceHistogramDotsWithBars = (histogramItems: HistogramItem[]) => + histogramItems.reduce((histogramItem, _, i) => { + if ( + histogramItem[i - 1]?.doc_count > 0 && + histogramItem[i - 1]?.doc_count !== CHART_PLACEHOLDER_VALUE && + histogramItem[i].doc_count === 0 + ) { + histogramItem[i].doc_count = CHART_PLACEHOLDER_VALUE; } - return histogram; - } -}; + return histogramItem; + }, histogramItems); // Create and call a duration formatter for every value since the durations for the // x axis might have a wide range of values e.g. from low milliseconds to large seconds. @@ -103,24 +96,23 @@ const xAxisTickFormat: TickFormatter = (d) => getDurationFormatter(d, 0.9999)(d).formatted; export function TransactionDistributionChart({ - field: fieldName, - value: fieldValue, - histogram: originalHistogram, + data, + hasData, markerCurrentTransaction, markerValue, markerPercentile, - overallHistogram, onChartSelection, - onHasData, selection, + status, }: TransactionDistributionChartProps) { const chartTheme = useChartTheme(); const euiTheme = useTheme(); - const patchedOverallHistogram = useMemo( - () => replaceHistogramDotsWithBars(overallHistogram), - [overallHistogram] - ); + const areaSeriesColors = [ + euiTheme.eui.euiColorVis1, + euiTheme.eui.euiColorVis2, + euiTheme.eui.euiColorVis5, + ]; const annotationsDataValues: LineAnnotationDatum[] = [ { @@ -139,15 +131,15 @@ export function TransactionDistributionChart({ // This will create y axis ticks for 1, 10, 100, 1000 ... const yMax = - Math.max(...(overallHistogram ?? []).map((d) => d.doc_count)) ?? 0; + Math.max( + ...flatten(data.map((d) => d.histogram)).map((d) => d.doc_count) + ) ?? 0; const yTicks = Math.ceil(Math.log10(yMax)); const yAxisDomain = { min: 0.9, max: Math.pow(10, yTicks), }; - const histogram = replaceHistogramDotsWithBars(originalHistogram); - const selectionAnnotation = selection !== undefined ? [ @@ -163,34 +155,12 @@ export function TransactionDistributionChart({ ] : undefined; - const chartLoadingState: TransactionDistributionChartLoadingState = useMemo( - () => ({ - hasData: - Array.isArray(patchedOverallHistogram) && - patchedOverallHistogram.length > 0, - status: Array.isArray(patchedOverallHistogram) - ? FETCH_STATUS.SUCCESS - : FETCH_STATUS.LOADING, - }), - [patchedOverallHistogram] - ); - - useEffect(() => { - if (onHasData) { - onHasData(chartLoadingState.hasData); - } - }, [chartLoadingState, onHasData]); - return (
- + - - {Array.isArray(histogram) && - fieldName !== undefined && - fieldValue !== undefined && ( - - )} + {data.map((d, i) => ( + + ))}
diff --git a/x-pack/plugins/apm/public/components/shared/charts/transaction_error_rate_chart/index.tsx b/x-pack/plugins/apm/public/components/shared/charts/transaction_error_rate_chart/index.tsx index 2e8578e29297c..ae24a5e53444e 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/transaction_error_rate_chart/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/transaction_error_rate_chart/index.tsx @@ -63,7 +63,7 @@ export function TransactionErrorRateChart({ const { query: { rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName'); + } = useApmParams('/services/{serviceName}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/plugins/apm/public/components/shared/dependencies_table/index.tsx b/x-pack/plugins/apm/public/components/shared/dependencies_table/index.tsx index a3dabeeca5b4b..8791075158c95 100644 --- a/x-pack/plugins/apm/public/components/shared/dependencies_table/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/dependencies_table/index.tsx @@ -6,11 +6,10 @@ */ import { - EuiBasicTableColumn, EuiFlexGroup, EuiFlexItem, - EuiInMemoryTable, EuiTitle, + RIGHT_ALIGNMENT, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; @@ -20,13 +19,14 @@ import { asPercent, asTransactionRate, } from '../../../../common/utils/formatters'; +import { useBreakpoints } from '../../../hooks/use_breakpoints'; import { FETCH_STATUS } from '../../../hooks/use_fetcher'; -import { unit } from '../../../utils/style'; -import { SparkPlot } from '../charts/spark_plot'; +import { EmptyMessage } from '../EmptyMessage'; import { ImpactBar } from '../ImpactBar'; -import { TableFetchWrapper } from '../table_fetch_wrapper'; -import { TruncateWithTooltip } from '../truncate_with_tooltip'; +import { ListMetric } from '../list_metric'; +import { ITableColumn, ManagedTable } from '../managed_table'; import { OverviewTableContainer } from '../overview_table_container'; +import { TruncateWithTooltip } from '../truncate_with_tooltip'; export type DependenciesItem = Omit< ConnectionStatsItemWithComparisonData, @@ -39,6 +39,7 @@ export type DependenciesItem = Omit< interface Props { dependencies: DependenciesItem[]; fixedHeight?: boolean; + isSingleColumn?: boolean; link?: React.ReactNode; title: React.ReactNode; nameColumnTitle: React.ReactNode; @@ -50,6 +51,7 @@ export function DependenciesTable(props: Props) { const { dependencies, fixedHeight, + isSingleColumn = true, link, title, nameColumnTitle, @@ -57,15 +59,11 @@ export function DependenciesTable(props: Props) { compact = true, } = props; - const pagination = compact - ? { - initialPageSize: 5, - pageSizeOptions: [5], - hidePerPageOptions: true, - } - : {}; + // SparkPlots should be hidden if we're in two-column view and size XL (1200px) + const { isXl } = useBreakpoints(); + const shouldShowSparkPlots = isSingleColumn || !isXl; - const columns: Array> = [ + const columns: Array> = [ { field: 'name', name: nameColumnTitle, @@ -80,12 +78,13 @@ export function DependenciesTable(props: Props) { name: i18n.translate('xpack.apm.dependenciesTable.columnLatency', { defaultMessage: 'Latency (avg.)', }), - width: `${unit * 11}px`, + align: RIGHT_ALIGNMENT, render: (_, { currentStats, previousStats }) => { return ( - { return ( - { return ( - { return ( - + @@ -170,6 +171,18 @@ export function DependenciesTable(props: Props) { impactValue: item.currentStats.impact, })) ?? []; + const noItemsMessage = !compact ? ( + + ) : ( + i18n.translate('xpack.apm.dependenciesTable.notFoundLabel', { + defaultMessage: 'No dependencies found', + }) + ); + return ( @@ -183,28 +196,24 @@ export function DependenciesTable(props: Props) {
- - - - - + + +
); diff --git a/x-pack/plugins/apm/public/components/shared/list_metric.tsx b/x-pack/plugins/apm/public/components/shared/list_metric.tsx new file mode 100644 index 0000000000000..df70ced1daa53 --- /dev/null +++ b/x-pack/plugins/apm/public/components/shared/list_metric.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 { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; +import React, { ComponentProps } from 'react'; +import { SparkPlot } from './charts/spark_plot'; + +interface ListMetricProps extends ComponentProps { + hideSeries?: boolean; +} + +export function ListMetric(props: ListMetricProps) { + const { hideSeries, ...sparkPlotProps } = props; + const { valueLabel } = sparkPlotProps; + + if (!hideSeries) { + return ; + } + + return ( + + + + {valueLabel} + + + + ); +} diff --git a/x-pack/plugins/apm/public/components/shared/managed_table/__snapshots__/managed_table.test.tsx.snap b/x-pack/plugins/apm/public/components/shared/managed_table/__snapshots__/managed_table.test.tsx.snap index 1e01c00543949..e4674b3add880 100644 --- a/x-pack/plugins/apm/public/components/shared/managed_table/__snapshots__/managed_table.test.tsx.snap +++ b/x-pack/plugins/apm/public/components/shared/managed_table/__snapshots__/managed_table.test.tsx.snap @@ -17,6 +17,7 @@ exports[`ManagedTable should render a page-full of items, with defaults 1`] = ` }, ] } + error="" items={ Array [ Object { @@ -74,6 +75,7 @@ exports[`ManagedTable should render when specifying initial values 1`] = ` }, ] } + error="" items={ Array [ Object { 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 541ed63a080a2..54f0aebbe818c 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 @@ -43,6 +43,7 @@ interface Props { ) => T[]; pagination?: boolean; isLoading?: boolean; + error?: boolean; } function defaultSortFn( @@ -68,6 +69,7 @@ function UnoptimizedManagedTable(props: Props) { sortFn = defaultSortFn, pagination = true, isLoading = false, + error = false, } = props; const { @@ -127,16 +129,25 @@ function UnoptimizedManagedTable(props: Props) { }; }, [hidePerPageOptions, items, page, pageSize, pagination]); + const showNoItemsMessage = useMemo(() => { + return isLoading + ? i18n.translate('xpack.apm.managedTable.loadingDescription', { + defaultMessage: 'Loading…', + }) + : noItemsMessage; + }, [isLoading, noItemsMessage]); + return ( >} // EuiBasicTableColumn is stricter than ITableColumn sorting={sort} diff --git a/x-pack/plugins/apm/public/components/shared/overview_table_container/index.tsx b/x-pack/plugins/apm/public/components/shared/overview_table_container/index.tsx index 207fa8e1fea76..15246d5375abe 100644 --- a/x-pack/plugins/apm/public/components/shared/overview_table_container/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/overview_table_container/index.tsx @@ -7,7 +7,7 @@ import React, { ReactNode } from 'react'; import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common'; -import { useBreakPoints } from '../../../hooks/use_break_points'; +import { useBreakpoints } from '../../../hooks/use_breakpoints'; /** * The height for a table on a overview page. Is the height of a 5-row basic @@ -22,11 +22,11 @@ const tableHeight = 282; * * Only do this when we're at a non-mobile breakpoint. * - * Hide the empty message when we don't yet have any items and are still loading. + * Hide the empty message when we don't yet have any items and are still not initiated. */ const OverviewTableContainerDiv = euiStyled.div<{ fixedHeight?: boolean; - isEmptyAndLoading: boolean; + isEmptyAndNotInitiated: boolean; shouldUseMobileLayout: boolean; }>` ${({ fixedHeight, shouldUseMobileLayout }) => @@ -48,26 +48,26 @@ const OverviewTableContainerDiv = euiStyled.div<{ `} .euiTableRowCell { - visibility: ${({ isEmptyAndLoading }) => - isEmptyAndLoading ? 'hidden' : 'visible'}; + visibility: ${({ isEmptyAndNotInitiated }) => + isEmptyAndNotInitiated ? 'hidden' : 'visible'}; } `; export function OverviewTableContainer({ children, fixedHeight, - isEmptyAndLoading, + isEmptyAndNotInitiated, }: { children?: ReactNode; fixedHeight?: boolean; - isEmptyAndLoading: boolean; + isEmptyAndNotInitiated: boolean; }) { - const { isMedium } = useBreakPoints(); + const { isMedium } = useBreakpoints(); return ( {children} diff --git a/x-pack/plugins/apm/public/components/shared/search_bar.tsx b/x-pack/plugins/apm/public/components/shared/search_bar.tsx index 55e19e547b282..035635908e56c 100644 --- a/x-pack/plugins/apm/public/components/shared/search_bar.tsx +++ b/x-pack/plugins/apm/public/components/shared/search_bar.tsx @@ -13,7 +13,7 @@ import { EuiSpacer, } from '@elastic/eui'; import React from 'react'; -import { useBreakPoints } from '../../hooks/use_break_points'; +import { useBreakpoints } from '../../hooks/use_breakpoints'; import { DatePicker } from './DatePicker'; import { KueryBar } from './kuery_bar'; import { TimeComparison } from './time_comparison'; @@ -36,7 +36,7 @@ export function SearchBar({ kueryBarBoolFilter, kueryBarPlaceholder, }: Props) { - const { isSmall, isMedium, isLarge, isXl, isXXL, isXXXL } = useBreakPoints(); + const { isSmall, isMedium, isLarge, isXl, isXXL, isXXXL } = useBreakpoints(); if (hidden) { return null; diff --git a/x-pack/plugins/apm/public/components/shared/service_link.tsx b/x-pack/plugins/apm/public/components/shared/service_link.tsx index a09ce958fdcab..d8f346f63b2ae 100644 --- a/x-pack/plugins/apm/public/components/shared/service_link.tsx +++ b/x-pack/plugins/apm/public/components/shared/service_link.tsx @@ -19,7 +19,7 @@ const StyledLink = euiStyled(EuiLink)`${truncate('100%')};`; interface ServiceLinkProps { agentName?: AgentName; - query: TypeOf['query']; + query: TypeOf['query']; serviceName: string; } @@ -33,7 +33,7 @@ export function ServiceLink({ return ( } delay="regular" + display="inlineBlock" position="top" > @@ -39,6 +40,7 @@ exports[`StickyProperties should render entire component 1`] = ` @@ -64,6 +66,7 @@ exports[`StickyProperties should render entire component 1`] = ` } delay="regular" + display="inlineBlock" position="top" > @@ -93,6 +96,7 @@ exports[`StickyProperties should render entire component 1`] = ` } delay="regular" + display="inlineBlock" position="top" > @@ -122,6 +126,7 @@ exports[`StickyProperties should render entire component 1`] = ` } delay="regular" + display="inlineBlock" position="top" > diff --git a/x-pack/plugins/apm/public/components/shared/table_fetch_wrapper/index.tsx b/x-pack/plugins/apm/public/components/shared/table_fetch_wrapper/index.tsx deleted file mode 100644 index 8a87ede9b3daa..0000000000000 --- a/x-pack/plugins/apm/public/components/shared/table_fetch_wrapper/index.tsx +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { ReactNode } from 'react'; -import { FETCH_STATUS } from '../../../hooks/use_fetcher'; -import { ErrorStatePrompt } from '../ErrorStatePrompt'; - -export function TableFetchWrapper({ - status, - children, -}: { - status: FETCH_STATUS; - children: ReactNode; -}) { - if (status === FETCH_STATUS.FAILURE) { - return ; - } - - return <>{children}; -} diff --git a/x-pack/plugins/apm/public/components/shared/time_comparison/index.tsx b/x-pack/plugins/apm/public/components/shared/time_comparison/index.tsx index 6624de496b2d1..d5e38a3df7aac 100644 --- a/x-pack/plugins/apm/public/components/shared/time_comparison/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/time_comparison/index.tsx @@ -14,7 +14,7 @@ import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common' import { useUiTracker } from '../../../../../observability/public'; import { useUrlParams } from '../../../context/url_params_context/use_url_params'; import { useApmParams } from '../../../hooks/use_apm_params'; -import { useBreakPoints } from '../../../hooks/use_break_points'; +import { useBreakpoints } from '../../../hooks/use_breakpoints'; import { useTimeRange } from '../../../hooks/use_time_range'; import * as urlHelpers from '../../shared/Links/url_helpers'; import { getComparisonTypes } from './get_comparison_types'; @@ -117,10 +117,10 @@ export function getSelectOptions({ export function TimeComparison() { const trackApmEvent = useUiTracker({ app: 'apm' }); const history = useHistory(); - const { isSmall } = useBreakPoints(); + const { isSmall } = useBreakpoints(); const { query: { rangeFrom, rangeTo }, - } = useApmParams('/services', '/backends/*', '/services/:serviceName'); + } = useApmParams('/services', '/backends/*', '/services/{serviceName}'); const { exactStart, exactEnd } = useTimeRange({ rangeFrom, diff --git a/x-pack/plugins/apm/public/components/shared/transaction_type_select.tsx b/x-pack/plugins/apm/public/components/shared/transaction_type_select.tsx index b0f90cfc53971..84f3b1e45d4a1 100644 --- a/x-pack/plugins/apm/public/components/shared/transaction_type_select.tsx +++ b/x-pack/plugins/apm/public/components/shared/transaction_type_select.tsx @@ -10,7 +10,7 @@ import React, { FormEvent, useCallback } from 'react'; import { useHistory } from 'react-router-dom'; import styled from 'styled-components'; import { useApmServiceContext } from '../../context/apm_service/use_apm_service_context'; -import { useBreakPoints } from '../../hooks/use_break_points'; +import { useBreakpoints } from '../../hooks/use_breakpoints'; import * as urlHelpers from './Links/url_helpers'; // The default transaction type (for non-RUM services) is "request". Set the @@ -21,7 +21,7 @@ const EuiSelectWithWidth = styled(EuiSelect)` `; export function TransactionTypeSelect() { - const { isSmall } = useBreakPoints(); + const { isSmall } = useBreakpoints(); const { transactionTypes, transactionType } = useApmServiceContext(); const history = useHistory(); diff --git a/x-pack/plugins/apm/public/components/shared/transactions_table/get_columns.tsx b/x-pack/plugins/apm/public/components/shared/transactions_table/get_columns.tsx index 276fa0a12f64e..24ad61f80b028 100644 --- a/x-pack/plugins/apm/public/components/shared/transactions_table/get_columns.tsx +++ b/x-pack/plugins/apm/public/components/shared/transactions_table/get_columns.tsx @@ -5,7 +5,12 @@ * 2.0. */ -import { EuiBasicTableColumn, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { + EuiBasicTableColumn, + EuiFlexGroup, + EuiFlexItem, + RIGHT_ALIGNMENT, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; import { ValuesType } from 'utility-types'; @@ -16,10 +21,9 @@ import { asTransactionRate, } from '../../../../common/utils/formatters'; import { APIReturnType } from '../../../services/rest/createCallApmApi'; -import { unit } from '../../../utils/style'; -import { SparkPlot } from '../charts/spark_plot'; import { ImpactBar } from '../ImpactBar'; import { TransactionDetailLink } from '../Links/apm/transaction_detail_link'; +import { ListMetric } from '../list_metric'; import { TruncateWithTooltip } from '../truncate_with_tooltip'; import { getLatencyColumnLabel } from './get_latency_column_label'; @@ -35,11 +39,13 @@ export function getColumns({ latencyAggregationType, transactionGroupDetailedStatistics, comparisonEnabled, + shouldShowSparkPlots = true, }: { serviceName: string; latencyAggregationType?: LatencyAggregationType; transactionGroupDetailedStatistics?: TransactionGroupDetailedStatistics; comparisonEnabled?: boolean; + shouldShowSparkPlots?: boolean; }): Array> { return [ { @@ -71,16 +77,17 @@ export function getColumns({ field: 'latency', sortable: true, name: getLatencyColumnLabel(latencyAggregationType), - width: `${unit * 11}px`, + align: RIGHT_ALIGNMENT, render: (_, { latency, name }) => { const currentTimeseries = transactionGroupDetailedStatistics?.currentPeriod?.[name]?.latency; const previousTimeseries = transactionGroupDetailedStatistics?.previousPeriod?.[name]?.latency; return ( - { const currentTimeseries = transactionGroupDetailedStatistics?.currentPeriod?.[name]?.throughput; @@ -105,9 +112,10 @@ export function getColumns({ transactionGroupDetailedStatistics?.previousPeriod?.[name] ?.throughput; return ( - { const currentTimeseries = transactionGroupDetailedStatistics?.currentPeriod?.[name]?.errorRate; const previousTimeseries = transactionGroupDetailedStatistics?.previousPeriod?.[name]?.errorRate; return ( - { const currentImpact = transactionGroupDetailedStatistics?.currentPeriod?.[name]?.impact ?? @@ -158,7 +167,7 @@ export function getColumns({ const previousImpact = transactionGroupDetailedStatistics?.previousPeriod?.[name]?.impact; return ( - + diff --git a/x-pack/plugins/apm/public/components/shared/transactions_table/index.tsx b/x-pack/plugins/apm/public/components/shared/transactions_table/index.tsx index 593ce4c10609c..60612b581e1d4 100644 --- a/x-pack/plugins/apm/public/components/shared/transactions_table/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/transactions_table/index.tsx @@ -23,11 +23,11 @@ import { useApmServiceContext } from '../../../context/apm_service/use_apm_servi import { useUrlParams } from '../../../context/url_params_context/use_url_params'; import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher'; import { TransactionOverviewLink } from '../Links/apm/transaction_overview_link'; -import { TableFetchWrapper } from '../table_fetch_wrapper'; import { getTimeRangeComparison } from '../time_comparison/get_time_range_comparison'; import { OverviewTableContainer } from '../overview_table_container'; import { getColumns } from './get_columns'; import { ElasticDocsLink } from '../Links/ElasticDocsLink'; +import { useBreakpoints } from '../../../hooks/use_breakpoints'; type ApiResponse = APIReturnType<'GET /api/apm/services/{serviceName}/transactions/groups/main_statistics'>; @@ -57,6 +57,7 @@ const DEFAULT_SORT = { interface Props { hideViewTransactionsLink?: boolean; + isSingleColumn?: boolean; numberOfTransactionsPerPage?: number; showAggregationAccurateCallout?: boolean; environment: string; @@ -69,6 +70,7 @@ interface Props { export function TransactionsTable({ fixedHeight = false, hideViewTransactionsLink = false, + isSingleColumn = true, numberOfTransactionsPerPage = 5, showAggregationAccurateCallout = false, environment, @@ -87,6 +89,10 @@ export function TransactionsTable({ sort: DEFAULT_SORT, }); + // SparkPlots should be hidden if we're in two-column view and size XL (1200px) + const { isXl } = useBreakpoints(); + const shouldShowSparkPlots = isSingleColumn || !isXl; + const { pageIndex, sort } = tableOptions; const { direction, field } = sort; @@ -214,9 +220,11 @@ export function TransactionsTable({ latencyAggregationType, transactionGroupDetailedStatistics, comparisonEnabled, + shouldShowSparkPlots, }); const isLoading = status === FETCH_STATUS.LOADING; + const isNotInitiated = status === FETCH_STATUS.NOT_INITIATED; const pagination = { pageIndex, @@ -293,45 +301,52 @@ export function TransactionsTable({ )} - - - { - setTableOptions({ - pageIndex: newTableOptions.page?.index ?? 0, - sort: newTableOptions.sort - ? { - field: newTableOptions.sort.field as SortField, - direction: newTableOptions.sort.direction, - } - : DEFAULT_SORT, - }); - }} - /> - - + + { + setTableOptions({ + pageIndex: newTableOptions.page?.index ?? 0, + sort: newTableOptions.sort + ? { + field: newTableOptions.sort.field as SortField, + direction: newTableOptions.sort.direction, + } + : DEFAULT_SORT, + }); + }} + /> + diff --git a/x-pack/plugins/apm/public/context/apm_backend/apm_backend_context.tsx b/x-pack/plugins/apm/public/context/apm_backend/apm_backend_context.tsx index b41dcefeb421a..d6cc139e72b64 100644 --- a/x-pack/plugins/apm/public/context/apm_backend/apm_backend_context.tsx +++ b/x-pack/plugins/apm/public/context/apm_backend/apm_backend_context.tsx @@ -30,7 +30,7 @@ export function ApmBackendContextProvider({ const { path: { backendName }, query: { rangeFrom, rangeTo }, - } = useApmParams('/backends/:backendName/overview'); + } = useApmParams('/backends/{backendName}/overview'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/plugins/apm/public/context/apm_service/apm_service_context.tsx b/x-pack/plugins/apm/public/context/apm_service/apm_service_context.tsx index 3286e092a9ab9..d6b052a5dc884 100644 --- a/x-pack/plugins/apm/public/context/apm_service/apm_service_context.tsx +++ b/x-pack/plugins/apm/public/context/apm_service/apm_service_context.tsx @@ -41,7 +41,7 @@ export function ApmServiceContextProvider({ path: { serviceName }, query, query: { rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName'); + } = useApmParams('/services/{serviceName}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); @@ -51,7 +51,11 @@ export function ApmServiceContextProvider({ end, }); - const transactionTypes = useServiceTransactionTypesFetcher(serviceName); + const transactionTypes = useServiceTransactionTypesFetcher({ + serviceName, + start, + end, + }); const transactionType = getTransactionType({ transactionType: query.transactionType, diff --git a/x-pack/plugins/apm/public/context/apm_service/use_service_transaction_types_fetcher.tsx b/x-pack/plugins/apm/public/context/apm_service/use_service_transaction_types_fetcher.tsx index 529aceec9c82e..c2e81cb0c92ae 100644 --- a/x-pack/plugins/apm/public/context/apm_service/use_service_transaction_types_fetcher.tsx +++ b/x-pack/plugins/apm/public/context/apm_service/use_service_transaction_types_fetcher.tsx @@ -5,19 +5,19 @@ * 2.0. */ -import { useApmParams } from '../../hooks/use_apm_params'; import { useFetcher } from '../../hooks/use_fetcher'; -import { useTimeRange } from '../../hooks/use_time_range'; const INITIAL_DATA = { transactionTypes: [] }; -export function useServiceTransactionTypesFetcher(serviceName?: string) { - const { - query: { rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName'); - - const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - +export function useServiceTransactionTypesFetcher({ + serviceName, + start, + end, +}: { + serviceName?: string; + start?: string; + end?: string; +}) { const { data = INITIAL_DATA } = useFetcher( (callApmApi) => { if (serviceName && start && end) { diff --git a/x-pack/plugins/apm/public/hooks/use_break_points.test.ts b/x-pack/plugins/apm/public/hooks/use_break_points.test.ts deleted file mode 100644 index 66cfd3119a26b..0000000000000 --- a/x-pack/plugins/apm/public/hooks/use_break_points.test.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 { getScreenSizes } from './use_break_points'; - -describe('use_break_points', () => { - describe('getScreenSizes', () => { - it('return xs when within 0px - 5740x', () => { - expect(getScreenSizes(0)).toEqual({ - isXSmall: true, - isSmall: true, - isMedium: true, - isLarge: true, - isXl: true, - isXXL: true, - isXXXL: false, - }); - expect(getScreenSizes(574)).toEqual({ - isXSmall: true, - isSmall: true, - isMedium: true, - isLarge: true, - isXl: true, - isXXL: true, - isXXXL: false, - }); - }); - it('return s when within 575px - 767px', () => { - expect(getScreenSizes(575)).toEqual({ - isXSmall: false, - isSmall: true, - isMedium: true, - isLarge: true, - isXl: true, - isXXL: true, - isXXXL: false, - }); - expect(getScreenSizes(767)).toEqual({ - isXSmall: false, - isSmall: true, - isMedium: true, - isLarge: true, - isXl: true, - isXXL: true, - isXXXL: false, - }); - }); - it('return m when within 768px - 991', () => { - expect(getScreenSizes(768)).toEqual({ - isXSmall: false, - isSmall: false, - isMedium: true, - isLarge: true, - isXl: true, - isXXL: true, - isXXXL: false, - }); - expect(getScreenSizes(991)).toEqual({ - isXSmall: false, - isSmall: false, - isMedium: true, - isLarge: true, - isXl: true, - isXXL: true, - isXXXL: false, - }); - }); - it('return l when within 992px - 1199px', () => { - expect(getScreenSizes(992)).toEqual({ - isXSmall: false, - isSmall: false, - isMedium: false, - isLarge: true, - isXl: true, - isXXL: true, - isXXXL: false, - }); - expect(getScreenSizes(1199)).toEqual({ - isXSmall: false, - isSmall: false, - isMedium: false, - isLarge: true, - isXl: true, - isXXL: true, - isXXXL: false, - }); - }); - it('return xl when within 1200px - 1599px', () => { - expect(getScreenSizes(1200)).toEqual({ - isXSmall: false, - isSmall: false, - isMedium: false, - isLarge: false, - isXl: true, - isXXL: true, - isXXXL: false, - }); - expect(getScreenSizes(1599)).toEqual({ - isXSmall: false, - isSmall: false, - isMedium: false, - isLarge: false, - isXl: true, - isXXL: true, - isXXXL: false, - }); - }); - it('return xxl when within 1600px - 1999px', () => { - expect(getScreenSizes(1600)).toEqual({ - isXSmall: false, - isSmall: false, - isMedium: false, - isLarge: false, - isXl: false, - isXXL: true, - isXXXL: false, - }); - expect(getScreenSizes(1999)).toEqual({ - isXSmall: false, - isSmall: false, - isMedium: false, - isLarge: false, - isXl: false, - isXXL: true, - isXXXL: false, - }); - }); - it('return xxxl when greater than or equals to 2000px', () => { - expect(getScreenSizes(2000)).toEqual({ - isXSmall: false, - isSmall: false, - isMedium: false, - isLarge: false, - isXl: false, - isXXL: false, - isXXXL: true, - }); - expect(getScreenSizes(3000)).toEqual({ - isXSmall: false, - isSmall: false, - isMedium: false, - isLarge: false, - isXl: false, - isXXL: false, - isXXXL: true, - }); - }); - }); -}); diff --git a/x-pack/plugins/apm/public/hooks/use_break_points.ts b/x-pack/plugins/apm/public/hooks/use_break_points.ts deleted file mode 100644 index 3b428a02dc97b..0000000000000 --- a/x-pack/plugins/apm/public/hooks/use_break_points.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { useState } from 'react'; -import useWindowSize from 'react-use/lib/useWindowSize'; -import useDebounce from 'react-use/lib/useDebounce'; -import { isWithinMaxBreakpoint, isWithinMinBreakpoint } from '@elastic/eui'; - -export type BreakPoints = ReturnType; - -export function getScreenSizes(windowWidth: number) { - return { - isXSmall: isWithinMaxBreakpoint(windowWidth, 'xs'), - isSmall: isWithinMaxBreakpoint(windowWidth, 's'), - isMedium: isWithinMaxBreakpoint(windowWidth, 'm'), - isLarge: isWithinMaxBreakpoint(windowWidth, 'l'), - isXl: isWithinMaxBreakpoint(windowWidth, 1599), - isXXL: isWithinMaxBreakpoint(windowWidth, 1999), - isXXXL: isWithinMinBreakpoint(windowWidth, 2000), - }; -} - -export function useBreakPoints() { - const { width } = useWindowSize(); - const [screenSizes, setScreenSizes] = useState(getScreenSizes(width)); - - useDebounce( - () => { - setScreenSizes(getScreenSizes(width)); - }, - 50, - [width] - ); - - return screenSizes; -} diff --git a/x-pack/plugins/apm/public/hooks/use_breakpoints.test.ts b/x-pack/plugins/apm/public/hooks/use_breakpoints.test.ts new file mode 100644 index 0000000000000..93b738a1e3e50 --- /dev/null +++ b/x-pack/plugins/apm/public/hooks/use_breakpoints.test.ts @@ -0,0 +1,153 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { getScreenSizes } from './use_breakpoints'; + +describe('use_breakpoints', () => { + describe('getScreenSizes', () => { + it('return xs when within 0px - 5740x', () => { + expect(getScreenSizes(0)).toEqual({ + isXSmall: true, + isSmall: true, + isMedium: true, + isLarge: true, + isXl: true, + isXXL: true, + isXXXL: false, + }); + expect(getScreenSizes(574)).toEqual({ + isXSmall: true, + isSmall: true, + isMedium: true, + isLarge: true, + isXl: true, + isXXL: true, + isXXXL: false, + }); + }); + it('return s when within 575px - 767px', () => { + expect(getScreenSizes(575)).toEqual({ + isXSmall: false, + isSmall: true, + isMedium: true, + isLarge: true, + isXl: true, + isXXL: true, + isXXXL: false, + }); + expect(getScreenSizes(767)).toEqual({ + isXSmall: false, + isSmall: true, + isMedium: true, + isLarge: true, + isXl: true, + isXXL: true, + isXXXL: false, + }); + }); + it('return m when within 768px - 991', () => { + expect(getScreenSizes(768)).toEqual({ + isXSmall: false, + isSmall: false, + isMedium: true, + isLarge: true, + isXl: true, + isXXL: true, + isXXXL: false, + }); + expect(getScreenSizes(991)).toEqual({ + isXSmall: false, + isSmall: false, + isMedium: true, + isLarge: true, + isXl: true, + isXXL: true, + isXXXL: false, + }); + }); + it('return l when within 992px - 1199px', () => { + expect(getScreenSizes(992)).toEqual({ + isXSmall: false, + isSmall: false, + isMedium: false, + isLarge: true, + isXl: true, + isXXL: true, + isXXXL: false, + }); + expect(getScreenSizes(1199)).toEqual({ + isXSmall: false, + isSmall: false, + isMedium: false, + isLarge: true, + isXl: true, + isXXL: true, + isXXXL: false, + }); + }); + it('return xl when within 1200px - 1599px', () => { + expect(getScreenSizes(1200)).toEqual({ + isXSmall: false, + isSmall: false, + isMedium: false, + isLarge: false, + isXl: true, + isXXL: true, + isXXXL: false, + }); + expect(getScreenSizes(1599)).toEqual({ + isXSmall: false, + isSmall: false, + isMedium: false, + isLarge: false, + isXl: true, + isXXL: true, + isXXXL: false, + }); + }); + it('return xxl when within 1600px - 1999px', () => { + expect(getScreenSizes(1600)).toEqual({ + isXSmall: false, + isSmall: false, + isMedium: false, + isLarge: false, + isXl: false, + isXXL: true, + isXXXL: false, + }); + expect(getScreenSizes(1999)).toEqual({ + isXSmall: false, + isSmall: false, + isMedium: false, + isLarge: false, + isXl: false, + isXXL: true, + isXXXL: false, + }); + }); + it('return xxxl when greater than or equals to 2000px', () => { + expect(getScreenSizes(2000)).toEqual({ + isXSmall: false, + isSmall: false, + isMedium: false, + isLarge: false, + isXl: false, + isXXL: false, + isXXXL: true, + }); + expect(getScreenSizes(3000)).toEqual({ + isXSmall: false, + isSmall: false, + isMedium: false, + isLarge: false, + isXl: false, + isXXL: false, + isXXXL: true, + }); + }); + }); +}); diff --git a/x-pack/plugins/apm/public/hooks/use_breakpoints.ts b/x-pack/plugins/apm/public/hooks/use_breakpoints.ts new file mode 100644 index 0000000000000..f87ddb929b66a --- /dev/null +++ b/x-pack/plugins/apm/public/hooks/use_breakpoints.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 { useState } from 'react'; +import useWindowSize from 'react-use/lib/useWindowSize'; +import useDebounce from 'react-use/lib/useDebounce'; +import { + getBreakpoint, + isWithinMaxBreakpoint, + isWithinMinBreakpoint, +} from '@elastic/eui'; + +export type Breakpoints = ReturnType; + +export function getScreenSizes(windowWidth: number) { + return { + isXSmall: isWithinMaxBreakpoint(windowWidth, 'xs'), + isSmall: isWithinMaxBreakpoint(windowWidth, 's'), + isMedium: isWithinMaxBreakpoint(windowWidth, 'm'), + isLarge: isWithinMaxBreakpoint(windowWidth, 'l'), + isXl: isWithinMaxBreakpoint(windowWidth, 1599), + isXXL: isWithinMaxBreakpoint(windowWidth, 1999), + isXXXL: isWithinMinBreakpoint(windowWidth, 2000), + }; +} + +export function useBreakpoints() { + const { width } = useWindowSize(); + const [breakpoint, setBreakpoint] = useState(getBreakpoint(width)); + const [screenSizes, setScreenSizes] = useState(getScreenSizes(width)); + + useDebounce( + () => { + setBreakpoint(getBreakpoint(width)); + setScreenSizes(getScreenSizes(width)); + }, + 50, + [width] + ); + + return { ...screenSizes, breakpoint, width }; +} diff --git a/x-pack/plugins/apm/public/hooks/use_error_group_distribution_fetcher.tsx b/x-pack/plugins/apm/public/hooks/use_error_group_distribution_fetcher.tsx index 0dd07a3b5c85d..683a545cdd125 100644 --- a/x-pack/plugins/apm/public/hooks/use_error_group_distribution_fetcher.tsx +++ b/x-pack/plugins/apm/public/hooks/use_error_group_distribution_fetcher.tsx @@ -22,7 +22,7 @@ export function useErrorGroupDistributionFetcher({ }) { const { query: { rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName'); + } = useApmParams('/services/{serviceName}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/plugins/apm/public/hooks/use_failed_transactions_correlations_fetcher.ts b/x-pack/plugins/apm/public/hooks/use_failed_transactions_correlations_fetcher.ts deleted file mode 100644 index f12cee7ee0332..0000000000000 --- a/x-pack/plugins/apm/public/hooks/use_failed_transactions_correlations_fetcher.ts +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { useCallback, useRef, useState } from 'react'; -import type { Subscription } from 'rxjs'; -import { - IKibanaSearchRequest, - IKibanaSearchResponse, - isCompleteResponse, - isErrorResponse, -} from '../../../../../src/plugins/data/public'; -import type { SearchServiceParams } from '../../common/search_strategies/correlations/types'; -import { useKibana } from '../../../../../src/plugins/kibana_react/public'; -import { ApmPluginStartDeps } from '../plugin'; -import { FailedTransactionsCorrelationValue } from '../../common/search_strategies/failure_correlations/types'; -import { FAILED_TRANSACTIONS_CORRELATION_SEARCH_STRATEGY } from '../../common/search_strategies/failure_correlations/constants'; - -interface RawResponse { - took: number; - values: FailedTransactionsCorrelationValue[]; - log: string[]; - ccsWarning: boolean; -} - -interface FailedTransactionsCorrelationsFetcherState { - error?: Error; - isComplete: boolean; - isRunning: boolean; - loaded: number; - ccsWarning: RawResponse['ccsWarning']; - values: RawResponse['values']; - log: RawResponse['log']; - timeTook?: number; - total: number; -} - -export const useFailedTransactionsCorrelationsFetcher = () => { - const { - services: { data }, - } = useKibana(); - - const [ - fetchState, - setFetchState, - ] = useState({ - isComplete: false, - isRunning: false, - loaded: 0, - ccsWarning: false, - values: [], - log: [], - total: 100, - }); - - const abortCtrl = useRef(new AbortController()); - const searchSubscription$ = useRef(); - - function setResponse(response: IKibanaSearchResponse) { - setFetchState((prevState) => ({ - ...prevState, - isRunning: response.isRunning || false, - ccsWarning: response.rawResponse?.ccsWarning ?? false, - values: response.rawResponse?.values ?? [], - log: response.rawResponse?.log ?? [], - loaded: response.loaded!, - total: response.total!, - timeTook: response.rawResponse.took, - })); - } - - const startFetch = useCallback( - (params: SearchServiceParams) => { - setFetchState((prevState) => ({ - ...prevState, - error: undefined, - isComplete: false, - })); - searchSubscription$.current?.unsubscribe(); - abortCtrl.current.abort(); - abortCtrl.current = new AbortController(); - - const req = { params }; - - // Submit the search request using the `data.search` service. - searchSubscription$.current = data.search - .search>(req, { - strategy: FAILED_TRANSACTIONS_CORRELATION_SEARCH_STRATEGY, - abortSignal: abortCtrl.current.signal, - }) - .subscribe({ - next: (res: IKibanaSearchResponse) => { - setResponse(res); - if (isCompleteResponse(res)) { - searchSubscription$.current?.unsubscribe(); - setFetchState((prevState) => ({ - ...prevState, - isRunnning: false, - isComplete: true, - })); - } else if (isErrorResponse(res)) { - searchSubscription$.current?.unsubscribe(); - setFetchState((prevState) => ({ - ...prevState, - error: (res as unknown) as Error, - isRunning: false, - })); - } - }, - error: (error: Error) => { - setFetchState((prevState) => ({ - ...prevState, - error, - isRunning: false, - })); - }, - }); - }, - [data.search, setFetchState] - ); - - const cancelFetch = useCallback(() => { - searchSubscription$.current?.unsubscribe(); - searchSubscription$.current = undefined; - abortCtrl.current.abort(); - setFetchState((prevState) => ({ - ...prevState, - isRunning: false, - })); - }, [setFetchState]); - - return { - ...fetchState, - progress: fetchState.loaded / fetchState.total, - startFetch, - cancelFetch, - }; -}; diff --git a/x-pack/plugins/apm/public/hooks/use_search_strategy.ts b/x-pack/plugins/apm/public/hooks/use_search_strategy.ts new file mode 100644 index 0000000000000..c01196e23c6cd --- /dev/null +++ b/x-pack/plugins/apm/public/hooks/use_search_strategy.ts @@ -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 { useCallback, useEffect, useReducer, useRef } from 'react'; +import type { Subscription } from 'rxjs'; + +import { + IKibanaSearchRequest, + IKibanaSearchResponse, + isCompleteResponse, + isErrorResponse, +} from '../../../../../src/plugins/data/public'; +import { useKibana } from '../../../../../src/plugins/kibana_react/public'; + +import type { SearchStrategyClientParams } from '../../common/search_strategies/types'; +import type { RawResponseBase } from '../../common/search_strategies/types'; +import type { + LatencyCorrelationsParams, + LatencyCorrelationsRawResponse, +} from '../../common/search_strategies/latency_correlations/types'; +import type { + FailedTransactionsCorrelationsParams, + FailedTransactionsCorrelationsRawResponse, +} from '../../common/search_strategies/failed_transactions_correlations/types'; +import { + ApmSearchStrategies, + APM_SEARCH_STRATEGIES, +} from '../../common/search_strategies/constants'; +import { useApmServiceContext } from '../context/apm_service/use_apm_service_context'; +import { useUrlParams } from '../context/url_params_context/use_url_params'; + +import { ApmPluginStartDeps } from '../plugin'; + +import { useApmParams } from './use_apm_params'; +import { useTimeRange } from './use_time_range'; + +interface SearchStrategyProgress { + error?: Error; + isRunning: boolean; + loaded: number; + total: number; +} + +const getInitialRawResponse = < + TRawResponse extends RawResponseBase +>(): TRawResponse => + ({ + ccsWarning: false, + took: 0, + } as TRawResponse); + +const getInitialProgress = (): SearchStrategyProgress => ({ + isRunning: false, + loaded: 0, + total: 100, +}); + +const getReducer = () => (prev: T, update: Partial): T => ({ + ...prev, + ...update, +}); + +interface SearchStrategyReturnBase { + progress: SearchStrategyProgress; + response: TRawResponse; + startFetch: () => void; + cancelFetch: () => void; +} + +// Function overload for Latency Correlations +export function useSearchStrategy( + searchStrategyName: typeof APM_SEARCH_STRATEGIES.APM_LATENCY_CORRELATIONS, + searchStrategyParams: LatencyCorrelationsParams +): SearchStrategyReturnBase; + +// Function overload for Failed Transactions Correlations +export function useSearchStrategy( + searchStrategyName: typeof APM_SEARCH_STRATEGIES.APM_FAILED_TRANSACTIONS_CORRELATIONS, + searchStrategyParams: FailedTransactionsCorrelationsParams +): SearchStrategyReturnBase; + +export function useSearchStrategy< + TRawResponse extends RawResponseBase, + TParams = unknown +>( + searchStrategyName: ApmSearchStrategies, + searchStrategyParams?: TParams +): SearchStrategyReturnBase { + const { + services: { data }, + } = useKibana(); + + const { serviceName, transactionType } = useApmServiceContext(); + const { + query: { kuery, environment, rangeFrom, rangeTo }, + } = useApmParams('/services/{serviceName}/transactions/view'); + const { start, end } = useTimeRange({ rangeFrom, rangeTo }); + const { urlParams } = useUrlParams(); + const { transactionName } = urlParams; + + const [rawResponse, setRawResponse] = useReducer( + getReducer(), + getInitialRawResponse() + ); + + const [fetchState, setFetchState] = useReducer( + getReducer(), + getInitialProgress() + ); + + const abortCtrl = useRef(new AbortController()); + const searchSubscription$ = useRef(); + const searchStrategyParamsRef = useRef(searchStrategyParams); + + const startFetch = useCallback(() => { + searchSubscription$.current?.unsubscribe(); + abortCtrl.current.abort(); + abortCtrl.current = new AbortController(); + setFetchState({ + ...getInitialProgress(), + error: undefined, + }); + + const request = { + params: { + environment, + serviceName, + transactionName, + transactionType, + kuery, + start, + end, + ...(searchStrategyParamsRef.current + ? { ...searchStrategyParamsRef.current } + : {}), + }, + }; + + // Submit the search request using the `data.search` service. + searchSubscription$.current = data.search + .search< + IKibanaSearchRequest, + IKibanaSearchResponse + >(request, { + strategy: searchStrategyName, + abortSignal: abortCtrl.current.signal, + }) + .subscribe({ + next: (response: IKibanaSearchResponse) => { + setRawResponse(response.rawResponse); + setFetchState({ + isRunning: response.isRunning || false, + loaded: response.loaded, + total: response.total, + }); + + if (isCompleteResponse(response)) { + searchSubscription$.current?.unsubscribe(); + setFetchState({ + isRunning: false, + }); + } else if (isErrorResponse(response)) { + searchSubscription$.current?.unsubscribe(); + setFetchState({ + error: (response as unknown) as Error, + isRunning: false, + }); + } + }, + error: (error: Error) => { + setFetchState({ + error, + isRunning: false, + }); + }, + }); + }, [ + searchStrategyName, + data.search, + environment, + serviceName, + transactionName, + transactionType, + kuery, + start, + end, + ]); + + const cancelFetch = useCallback(() => { + searchSubscription$.current?.unsubscribe(); + searchSubscription$.current = undefined; + abortCtrl.current.abort(); + setFetchState({ + isRunning: false, + }); + }, []); + + // auto-update + useEffect(() => { + startFetch(); + return cancelFetch; + }, [startFetch, cancelFetch]); + + return { + progress: fetchState, + response: rawResponse, + startFetch, + cancelFetch, + }; +} 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 a1c609f273926..28e8a4e0396aa 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 @@ -27,7 +27,7 @@ export function useServiceMetricChartsFetcher({ }) { const { query: { rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName'); + } = useApmParams('/services/{serviceName}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); const { agentName, serviceName } = useApmServiceContext(); diff --git a/x-pack/plugins/apm/public/hooks/use_transaction_distribution_fetcher.ts b/x-pack/plugins/apm/public/hooks/use_transaction_distribution_fetcher.ts deleted file mode 100644 index 2ff1b83ef1782..0000000000000 --- a/x-pack/plugins/apm/public/hooks/use_transaction_distribution_fetcher.ts +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { useCallback, useRef, useState } from 'react'; -import type { Subscription } from 'rxjs'; -import { - IKibanaSearchRequest, - IKibanaSearchResponse, - isCompleteResponse, - isErrorResponse, -} from '../../../../../src/plugins/data/public'; -import type { - SearchServiceParams, - SearchServiceRawResponse, -} from '../../common/search_strategies/correlations/types'; -import { useKibana } from '../../../../../src/plugins/kibana_react/public'; -import { ApmPluginStartDeps } from '../plugin'; - -interface TransactionDistributionFetcherState { - error?: Error; - isComplete: boolean; - isRunning: boolean; - loaded: number; - ccsWarning: SearchServiceRawResponse['ccsWarning']; - log: SearchServiceRawResponse['log']; - transactionDistribution?: SearchServiceRawResponse['overallHistogram']; - percentileThresholdValue?: SearchServiceRawResponse['percentileThresholdValue']; - timeTook?: number; - total: number; -} - -export function useTransactionDistributionFetcher() { - const { - services: { data }, - } = useKibana(); - - const [ - fetchState, - setFetchState, - ] = useState({ - isComplete: false, - isRunning: false, - loaded: 0, - ccsWarning: false, - log: [], - total: 100, - }); - - const abortCtrl = useRef(new AbortController()); - const searchSubscription$ = useRef(); - - function setResponse( - response: IKibanaSearchResponse - ) { - setFetchState((prevState) => ({ - ...prevState, - isRunning: response.isRunning || false, - ccsWarning: response.rawResponse?.ccsWarning ?? false, - histograms: response.rawResponse?.values ?? [], - log: response.rawResponse?.log ?? [], - loaded: response.loaded!, - total: response.total!, - timeTook: response.rawResponse.took, - // only set percentileThresholdValue and overallHistogram once it's repopulated on a refresh, - // otherwise the consuming chart would flicker with an empty state on reload. - ...(response.rawResponse?.percentileThresholdValue !== undefined && - response.rawResponse?.overallHistogram !== undefined - ? { - transactionDistribution: response.rawResponse?.overallHistogram, - percentileThresholdValue: - response.rawResponse?.percentileThresholdValue, - } - : {}), - // if loading is done but didn't return any data for the overall histogram, - // set it to an empty array so the consuming chart component knows loading is done. - ...(!response.isRunning && - response.rawResponse?.overallHistogram === undefined - ? { transactionDistribution: [] } - : {}), - })); - } - - const startFetch = useCallback( - (params: Omit) => { - setFetchState((prevState) => ({ - ...prevState, - error: undefined, - isComplete: false, - })); - searchSubscription$.current?.unsubscribe(); - abortCtrl.current.abort(); - abortCtrl.current = new AbortController(); - - const searchServiceParams: SearchServiceParams = { - ...params, - analyzeCorrelations: false, - }; - const req = { params: searchServiceParams }; - - // Submit the search request using the `data.search` service. - searchSubscription$.current = data.search - .search< - IKibanaSearchRequest, - IKibanaSearchResponse - >(req, { - strategy: 'apmCorrelationsSearchStrategy', - abortSignal: abortCtrl.current.signal, - }) - .subscribe({ - next: (res: IKibanaSearchResponse) => { - setResponse(res); - if (isCompleteResponse(res)) { - searchSubscription$.current?.unsubscribe(); - setFetchState((prevState) => ({ - ...prevState, - isRunnning: false, - isComplete: true, - })); - } else if (isErrorResponse(res)) { - searchSubscription$.current?.unsubscribe(); - setFetchState((prevState) => ({ - ...prevState, - error: (res as unknown) as Error, - isRunning: false, - })); - } - }, - error: (error: Error) => { - setFetchState((prevState) => ({ - ...prevState, - error, - isRunning: false, - })); - }, - }); - }, - [data.search, setFetchState] - ); - - const cancelFetch = useCallback(() => { - searchSubscription$.current?.unsubscribe(); - searchSubscription$.current = undefined; - abortCtrl.current.abort(); - setFetchState((prevState) => ({ - ...prevState, - isRunning: false, - })); - }, [setFetchState]); - - return { - ...fetchState, - progress: fetchState.loaded / fetchState.total, - startFetch, - cancelFetch, - }; -} diff --git a/x-pack/plugins/apm/public/hooks/use_transaction_latency_chart_fetcher.ts b/x-pack/plugins/apm/public/hooks/use_transaction_latency_chart_fetcher.ts index 26f361706ee88..660408700b4df 100644 --- a/x-pack/plugins/apm/public/hooks/use_transaction_latency_chart_fetcher.ts +++ b/x-pack/plugins/apm/public/hooks/use_transaction_latency_chart_fetcher.ts @@ -35,7 +35,7 @@ export function useTransactionLatencyChartsFetcher({ const { query: { rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName'); + } = useApmParams('/services/{serviceName}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/plugins/apm/public/hooks/use_transaction_latency_correlations_fetcher.ts b/x-pack/plugins/apm/public/hooks/use_transaction_latency_correlations_fetcher.ts deleted file mode 100644 index 0b035c6af2354..0000000000000 --- a/x-pack/plugins/apm/public/hooks/use_transaction_latency_correlations_fetcher.ts +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { useCallback, useRef, useState } from 'react'; -import type { Subscription } from 'rxjs'; -import { - IKibanaSearchRequest, - IKibanaSearchResponse, - isCompleteResponse, - isErrorResponse, -} from '../../../../../src/plugins/data/public'; -import type { - SearchServiceParams, - SearchServiceRawResponse, -} from '../../common/search_strategies/correlations/types'; -import { useKibana } from '../../../../../src/plugins/kibana_react/public'; -import { ApmPluginStartDeps } from '../plugin'; - -interface TransactionLatencyCorrelationsFetcherState { - error?: Error; - isComplete: boolean; - isRunning: boolean; - loaded: number; - ccsWarning: SearchServiceRawResponse['ccsWarning']; - histograms: SearchServiceRawResponse['values']; - log: SearchServiceRawResponse['log']; - overallHistogram?: SearchServiceRawResponse['overallHistogram']; - percentileThresholdValue?: SearchServiceRawResponse['percentileThresholdValue']; - timeTook?: number; - total: number; -} - -export const useTransactionLatencyCorrelationsFetcher = () => { - const { - services: { data }, - } = useKibana(); - - const [ - fetchState, - setFetchState, - ] = useState({ - isComplete: false, - isRunning: false, - loaded: 0, - ccsWarning: false, - histograms: [], - log: [], - total: 100, - }); - - const abortCtrl = useRef(new AbortController()); - const searchSubscription$ = useRef(); - - function setResponse( - response: IKibanaSearchResponse - ) { - setFetchState((prevState) => ({ - ...prevState, - isRunning: response.isRunning || false, - ccsWarning: response.rawResponse?.ccsWarning ?? false, - histograms: response.rawResponse?.values ?? [], - log: response.rawResponse?.log ?? [], - loaded: response.loaded!, - total: response.total!, - timeTook: response.rawResponse.took, - // only set percentileThresholdValue and overallHistogram once it's repopulated on a refresh, - // otherwise the consuming chart would flicker with an empty state on reload. - ...(response.rawResponse?.percentileThresholdValue !== undefined && - response.rawResponse?.overallHistogram !== undefined - ? { - overallHistogram: response.rawResponse?.overallHistogram, - percentileThresholdValue: - response.rawResponse?.percentileThresholdValue, - } - : {}), - // if loading is done but didn't return any data for the overall histogram, - // set it to an empty array so the consuming chart component knows loading is done. - ...(!response.isRunning && - response.rawResponse?.overallHistogram === undefined - ? { overallHistogram: [] } - : {}), - })); - } - - const startFetch = useCallback( - (params: Omit) => { - setFetchState((prevState) => ({ - ...prevState, - error: undefined, - isComplete: false, - })); - searchSubscription$.current?.unsubscribe(); - abortCtrl.current.abort(); - abortCtrl.current = new AbortController(); - - const searchServiceParams: SearchServiceParams = { - ...params, - analyzeCorrelations: true, - }; - const req = { params: searchServiceParams }; - - // Submit the search request using the `data.search` service. - searchSubscription$.current = data.search - .search< - IKibanaSearchRequest, - IKibanaSearchResponse - >(req, { - strategy: 'apmCorrelationsSearchStrategy', - abortSignal: abortCtrl.current.signal, - }) - .subscribe({ - next: (res: IKibanaSearchResponse) => { - setResponse(res); - if (isCompleteResponse(res)) { - searchSubscription$.current?.unsubscribe(); - setFetchState((prevState) => ({ - ...prevState, - isRunnning: false, - isComplete: true, - })); - } else if (isErrorResponse(res)) { - searchSubscription$.current?.unsubscribe(); - setFetchState((prevState) => ({ - ...prevState, - error: (res as unknown) as Error, - isRunning: false, - })); - } - }, - error: (error: Error) => { - setFetchState((prevState) => ({ - ...prevState, - error, - isRunning: false, - })); - }, - }); - }, - [data.search, setFetchState] - ); - - const cancelFetch = useCallback(() => { - searchSubscription$.current?.unsubscribe(); - searchSubscription$.current = undefined; - abortCtrl.current.abort(); - setFetchState((prevState) => ({ - ...prevState, - // If we didn't receive data for the overall histogram yet - // set it to an empty array to indicate loading stopped. - ...(prevState.overallHistogram === undefined - ? { overallHistogram: [] } - : {}), - isRunning: false, - })); - }, [setFetchState]); - - return { - ...fetchState, - progress: fetchState.loaded / fetchState.total, - startFetch, - cancelFetch, - }; -}; 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 484a00fc56082..f7a6e6c3a80ad 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 @@ -34,7 +34,7 @@ export function useTransactionTraceSamplesFetcher({ const { query: { rangeFrom, rangeTo }, - } = useApmParams('/services/:serviceName'); + } = useApmParams('/services/{serviceName}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/plugins/apm/public/plugin.ts b/x-pack/plugins/apm/public/plugin.ts index da2ea0ba8ae5c..1e1d9ce5687d1 100644 --- a/x-pack/plugins/apm/public/plugin.ts +++ b/x-pack/plugins/apm/public/plugin.ts @@ -132,7 +132,6 @@ export class ApmPlugin implements Plugin { label: dependenciesTitle, app: 'apm', path: '/backends', - isNewFeature: true, onClick: () => { const { usageCollection } = pluginsStart as { usageCollection?: UsageCollectionStart; diff --git a/x-pack/plugins/apm/public/services/rest/createCallApmApi.ts b/x-pack/plugins/apm/public/services/rest/createCallApmApi.ts index 35dbca1b0c955..40713f93d3ee5 100644 --- a/x-pack/plugins/apm/public/services/rest/createCallApmApi.ts +++ b/x-pack/plugins/apm/public/services/rest/createCallApmApi.ts @@ -9,7 +9,6 @@ import { CoreSetup, CoreStart } from 'kibana/public'; import * as t from 'io-ts'; import type { ClientRequestParamsOf, - EndpointOf, formatRequest as formatRequestType, ReturnOf, RouteRepositoryClient, @@ -26,6 +25,7 @@ import { callApi } from './callApi'; import type { APMServerRouteRepository, APMRouteHandlerResources, + APIEndpoint, // eslint-disable-next-line @kbn/eslint/no-restricted-paths } from '../../../server'; import { InspectResponse } from '../../../typings/common'; @@ -47,16 +47,15 @@ export type AutoAbortedAPMClient = RouteRepositoryClient< Omit >; -export type APIReturnType< - TEndpoint extends EndpointOf -> = ReturnOf & { +export type APIReturnType = ReturnOf< + APMServerRouteRepository, + TEndpoint +> & { _inspect?: InspectResponse; }; -export type APIEndpoint = EndpointOf; - export type APIClientRequestParamsOf< - TEndpoint extends EndpointOf + TEndpoint extends APIEndpoint > = ClientRequestParamsOf; export type AbstractAPMRepository = ServerRouteRepository< diff --git a/x-pack/plugins/apm/public/services/rest/index_pattern.ts b/x-pack/plugins/apm/public/services/rest/index_pattern.ts index bc321d700a7a6..0bb5839759f64 100644 --- a/x-pack/plugins/apm/public/services/rest/index_pattern.ts +++ b/x-pack/plugins/apm/public/services/rest/index_pattern.ts @@ -13,10 +13,3 @@ export const createStaticIndexPattern = async () => { signal: null, }); }; - -export const getApmIndexPatternTitle = async () => { - return await callApmApi({ - endpoint: 'GET /api/apm/index_pattern/title', - signal: null, - }); -}; diff --git a/x-pack/plugins/apm/public/tutorial/tutorial_fleet_instructions/index.tsx b/x-pack/plugins/apm/public/tutorial/tutorial_fleet_instructions/index.tsx index fbbb2e1ffedf4..c69623f92987a 100644 --- a/x-pack/plugins/apm/public/tutorial/tutorial_fleet_instructions/index.tsx +++ b/x-pack/plugins/apm/public/tutorial/tutorial_fleet_instructions/index.tsx @@ -80,7 +80,7 @@ function TutorialFleetInstructions({ http, basePath, isDarkTheme }: Props) { display="plain" textAlign="left" title={i18n.translate('xpack.apm.tutorial.apmServer.fleet.title', { - defaultMessage: 'Elastic APM (beta) now available in Fleet!', + defaultMessage: 'Elastic APM now available in Fleet!', })} description={i18n.translate( 'xpack.apm.tutorial.apmServer.fleet.message', diff --git a/x-pack/plugins/apm/readme.md b/x-pack/plugins/apm/readme.md index a331bb4e9f116..fe7e77d28986c 100644 --- a/x-pack/plugins/apm/readme.md +++ b/x-pack/plugins/apm/readme.md @@ -2,105 +2,28 @@ ## Local environment setup -### Kibana - -``` -git clone git@github.com:elastic/kibana.git -cd kibana/ -yarn kbn bootstrap -yarn start --no-base-path -``` - -### APM Server, Elasticsearch and data - -To access an elasticsearch instance that has live data you have two options: - -#### A. Connect to Elasticsearch on Cloud (internal devs only) - -Find the credentials for the cluster [here](https://github.com/elastic/apm-dev/blob/master/docs/credentials/apm-ui-clusters.md#apmelstcco) - -#### B. Start Elastic Stack and APM data generators - -``` -git clone git@github.com:elastic/apm-integration-testing.git -cd apm-integration-testing/ -./scripts/compose.py start master --all --no-kibana -``` - -_Docker Compose is required_ +[Local setup documentation](./dev_docs/local_setup.md) ## Testing -Go to [tests documentation](./scripts/test/README.md) +[Testing documentation](./dev_docs/testing.md) ## Linting -_Note: Run the following commands from `kibana/`._ - -### Typescript - -``` -node scripts/type_check.js --project x-pack/plugins/apm/tsconfig.json -``` - -### Prettier - -``` -yarn prettier "./x-pack/plugins/apm/**/*.{tsx,ts,js}" --write -``` - -### ESLint - -``` -node scripts/eslint.js x-pack/legacy/plugins/apm -``` - -## Setup default APM users - -APM behaves differently depending on which the role and permissions a logged in user has. To create the users run: - -```sh -node x-pack/plugins/apm/scripts/create-apm-users-and-roles.js --username admin --password changeme --kibana-url http://localhost:5601 --role-suffix -``` - -This will create: - -**apm_read_user**: Read only user - -**apm_power_user**: Read+write user. - -## Debugging Elasticsearch queries - -All APM api endpoints accept `_inspect=true` as a query param that will result in the underlying ES query being outputted in the Kibana backend process. - -Example: -`/api/apm/services/my_service?_inspect=true` +[Linting documentation](./dev_docs/linting.md) ## Storybook -Start the [Storybook](https://storybook.js.org/) development environment with -`yarn storybook apm`. All files with a .stories.tsx extension will be loaded. -You can access the development environment at http://localhost:9001. - -## Experimental features settings - -To set up a flagged feature, add the name of the feature key (`apm:myFeature`) to [commmon/ui_settings_keys.ts](./common/ui_settings_keys.ts) and the feature parameters to [server/ui_settings.ts](./server/ui_settings.ts). - -Test for the feature like: - -```js -import { myFeatureEnabled } from '../ui_settings_keys'; -if (core.uiSettings.get(myFeatureEnabled)) { - doStuff(); -} +**Start** +``` +yarn storybook apm ``` -Settings can be managed in Kibana under Stack Management > Advanced Settings > Observability. +All files with a .stories.tsx extension will be loaded. You can access the development environment at http://localhost:9001. ## Further resources - -- [Cypress integration tests](./e2e/README.md) - [VSCode setup instructions](./dev_docs/vscode_setup.md) - [Github PR commands](./dev_docs/github_commands.md) - [Routing and Linking](./dev_docs/routing_and_linking.md) - [Telemetry](./dev_docs/telemetry.md) +- [Features flags](./dev_docs/feature_flags.md) diff --git a/x-pack/plugins/apm/scripts/create-apm-users-and-roles/create_apm_users_and_roles.ts b/x-pack/plugins/apm/scripts/create-apm-users-and-roles/create_apm_users_and_roles.ts index 6b67d8d80e798..708a8b62287be 100644 --- a/x-pack/plugins/apm/scripts/create-apm-users-and-roles/create_apm_users_and_roles.ts +++ b/x-pack/plugins/apm/scripts/create-apm-users-and-roles/create_apm_users_and_roles.ts @@ -28,6 +28,14 @@ export async function createApmUsersAndRoles({ kibana: Kibana; elasticsearch: Elasticsearch; }) { + const isCredentialsValid = await getIsCredentialsValid({ + elasticsearch, + kibana, + }); + if (!isCredentialsValid) { + throw new AbortError('Invalid username/password'); + } + const isSecurityEnabled = await getIsSecurityEnabled({ elasticsearch, kibana, @@ -86,3 +94,25 @@ async function getIsSecurityEnabled({ return false; } } + +async function getIsCredentialsValid({ + elasticsearch, + kibana, +}: { + elasticsearch: Elasticsearch; + kibana: Kibana; +}) { + try { + await callKibana({ + elasticsearch, + kibana, + options: { + validateStatus: (status) => status >= 200 && status < 400, + url: `/`, + }, + }); + return true; + } catch (err) { + return false; + } +} diff --git a/x-pack/plugins/apm/scripts/optimize-tsconfig/tsconfig.json b/x-pack/plugins/apm/scripts/optimize-tsconfig/tsconfig.json index 40d42298b967b..31f756eeabde3 100644 --- a/x-pack/plugins/apm/scripts/optimize-tsconfig/tsconfig.json +++ b/x-pack/plugins/apm/scripts/optimize-tsconfig/tsconfig.json @@ -7,7 +7,6 @@ ], "exclude": [ "**/__fixtures__/**/*", - "./x-pack/plugins/apm/e2e", "./x-pack/plugins/apm/ftr_e2e" ], "compilerOptions": { diff --git a/x-pack/plugins/apm/scripts/test/README.md b/x-pack/plugins/apm/scripts/test/README.md index b241b2efdfd99..2b5e4212ea08f 100644 --- a/x-pack/plugins/apm/scripts/test/README.md +++ b/x-pack/plugins/apm/scripts/test/README.md @@ -1,63 +1 @@ -## Unit Tests (Jest) - -``` -node scripts/tests/jest [--watch] [--updateSnapshot] -``` - -#### Coverage - -HTML coverage report can be found in target/coverage/jest after tests have run. - -``` -open target/coverage/jest/index.html -``` - ---- - -## API Tests - -API tests are separated in two suites: - -- a basic license test suite [default] -- a trial license test suite (the equivalent of gold+) - -``` -node scripts/tests/api [--trial] [--help] -``` - -The API tests are located in `x-pack/test/apm_api_integration/`. - -**API Test tips** - -- For debugging access Elasticsearch on http://localhost:9220` (elastic/changeme) -- To update snapshots append `--updateSnapshots` to the functional_test_runner command - ---- - -## E2E Tests (Cypress) - -``` -node scripts/tests/e2e [--trial] [--help] -``` - -The E2E tests are located [here](../../ftr_e2e) - ---- - -## Functional tests (Security and Correlations tests) -TODO: We could try moving this tests to the new e2e tests located at `x-pack/plugins/apm/ftr_e2e`. - -**Start server** - -``` -node scripts/functional_tests_server --config x-pack/test/functional/config.js -``` - -**Run tests** - -``` -node scripts/functional_test_runner --config x-pack/test/functional/config.js --grep='APM specs' -``` - -APM tests are located in `x-pack/test/functional/apps/apm`. -For debugging access Elasticsearch on http://localhost:9220` (elastic/changeme) +Go to [testing documentation](../../dev_docs/testing.md) \ No newline at end of file diff --git a/x-pack/plugins/apm/server/index.test.ts b/x-pack/plugins/apm/server/index.test.ts index 56c9825db5a5c..be93557fea6fc 100644 --- a/x-pack/plugins/apm/server/index.test.ts +++ b/x-pack/plugins/apm/server/index.test.ts @@ -18,7 +18,6 @@ describe('mergeConfigs', () => { spanIndices: 'apm-*-span-*', errorIndices: 'apm-*-error-*', metricsIndices: 'apm-*-metric-*', - indexPattern: 'apm-*', } as APMOSSConfig; const apmConfig = { @@ -30,7 +29,6 @@ describe('mergeConfigs', () => { expect(mergeConfigs(apmOssConfig, apmConfig)).toEqual({ 'apm_oss.errorIndices': 'logs-apm*,apm-*-error-*', - 'apm_oss.indexPattern': 'traces-apm*,logs-apm*,metrics-apm*,apm-*', 'apm_oss.metricsIndices': 'metrics-apm*,apm-*-metric-*', 'apm_oss.spanIndices': 'traces-apm*,apm-*-span-*', 'apm_oss.transactionIndices': 'traces-apm*,apm-*-transaction-*', diff --git a/x-pack/plugins/apm/server/index.ts b/x-pack/plugins/apm/server/index.ts index 5b97173601950..6ba412bd22029 100644 --- a/x-pack/plugins/apm/server/index.ts +++ b/x-pack/plugins/apm/server/index.ts @@ -72,7 +72,6 @@ export function mergeConfigs( 'apm_oss.metricsIndices': apmOssConfig.metricsIndices, 'apm_oss.sourcemapIndices': apmOssConfig.sourcemapIndices, 'apm_oss.onboardingIndices': apmOssConfig.onboardingIndices, - 'apm_oss.indexPattern': apmOssConfig.indexPattern, /* eslint-enable @typescript-eslint/naming-convention */ 'xpack.apm.serviceMapEnabled': apmConfig.serviceMapEnabled, 'xpack.apm.serviceMapFingerprintBucketSize': @@ -117,10 +116,6 @@ export function mergeConfigs( 'apm_oss.metricsIndices' ] = `metrics-apm*,${mergedConfig['apm_oss.metricsIndices']}`; - mergedConfig[ - 'apm_oss.indexPattern' - ] = `traces-apm*,logs-apm*,metrics-apm*,${mergedConfig['apm_oss.indexPattern']}`; - return mergedConfig; } @@ -130,7 +125,10 @@ export const plugin = (initContext: PluginInitializerContext) => export { APM_SERVER_FEATURE_ID } from '../common/alert_types'; export { APMPlugin } from './plugin'; export { APMPluginSetup } from './types'; -export { APMServerRouteRepository } from './routes/get_global_apm_server_route_repository'; +export { + APMServerRouteRepository, + APIEndpoint, +} from './routes/get_global_apm_server_route_repository'; export { APMRouteHandlerResources } from './routes/typings'; export type { ProcessorEvent } from '../common/processor_event'; diff --git a/x-pack/plugins/apm/server/lib/alerts/chart_preview/get_transaction_duration.ts b/x-pack/plugins/apm/server/lib/alerts/chart_preview/get_transaction_duration.ts index 3a67076201efa..8e3a44d780630 100644 --- a/x-pack/plugins/apm/server/lib/alerts/chart_preview/get_transaction_duration.ts +++ b/x-pack/plugins/apm/server/lib/alerts/chart_preview/get_transaction_duration.ts @@ -6,17 +6,19 @@ */ import { QueryDslQueryContainer } from '@elastic/elasticsearch/api/types'; +import { rangeQuery } from '../../../../../observability/server'; import { - PROCESSOR_EVENT, SERVICE_NAME, - TRANSACTION_DURATION, TRANSACTION_TYPE, } from '../../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../../common/processor_event'; -import { rangeQuery } from '../../../../../observability/server'; import { environmentQuery } from '../../../../common/utils/environment_query'; import { AlertParams } from '../../../routes/alerts/chart_preview'; -import { getBucketSize } from '../../helpers/get_bucket_size'; +import { + getDocumentTypeFilterForAggregatedTransactions, + getProcessorEventForAggregatedTransactions, + getSearchAggregatedTransactions, + getTransactionDurationFieldForAggregatedTransactions, +} from '../../helpers/aggregated_transactions'; import { Setup, SetupTimeRange } from '../../helpers/setup_request'; export async function getTransactionDurationChartPreview({ @@ -26,43 +28,58 @@ export async function getTransactionDurationChartPreview({ alertParams: AlertParams; setup: Setup & SetupTimeRange; }) { + const searchAggregatedTransactions = await getSearchAggregatedTransactions({ + ...setup, + kuery: '', + }); + const { apmEventClient, start, end } = setup; const { aggregationType, environment, serviceName, transactionType, + interval, } = alertParams; const query = { bool: { filter: [ - { term: { [PROCESSOR_EVENT]: ProcessorEvent.transaction } }, ...(serviceName ? [{ term: { [SERVICE_NAME]: serviceName } }] : []), ...(transactionType ? [{ term: { [TRANSACTION_TYPE]: transactionType } }] : []), ...rangeQuery(start, end), ...environmentQuery(environment), + ...getDocumentTypeFilterForAggregatedTransactions( + searchAggregatedTransactions + ), ] as QueryDslQueryContainer[], }, }; - const { intervalString } = getBucketSize({ start, end, numBuckets: 20 }); + const transactionDurationField = getTransactionDurationFieldForAggregatedTransactions( + searchAggregatedTransactions + ); const aggs = { timeseries: { date_histogram: { field: '@timestamp', - fixed_interval: intervalString, + fixed_interval: interval, + min_doc_count: 0, + extended_bounds: { + min: start, + max: end, + }, }, aggs: { agg: aggregationType === 'avg' - ? { avg: { field: TRANSACTION_DURATION } } + ? { avg: { field: transactionDurationField } } : { percentiles: { - field: TRANSACTION_DURATION, + field: transactionDurationField, percents: [aggregationType === '95th' ? 95 : 99], }, }, @@ -70,7 +87,13 @@ export async function getTransactionDurationChartPreview({ }, }; const params = { - apm: { events: [ProcessorEvent.transaction] }, + apm: { + events: [ + getProcessorEventForAggregatedTransactions( + searchAggregatedTransactions + ), + ], + }, body: { size: 0, query, aggs }, }; const resp = await apmEventClient.search( diff --git a/x-pack/plugins/apm/server/lib/alerts/chart_preview/get_transaction_error_count.ts b/x-pack/plugins/apm/server/lib/alerts/chart_preview/get_transaction_error_count.ts index 0ead50c709083..d15f82248dec5 100644 --- a/x-pack/plugins/apm/server/lib/alerts/chart_preview/get_transaction_error_count.ts +++ b/x-pack/plugins/apm/server/lib/alerts/chart_preview/get_transaction_error_count.ts @@ -10,7 +10,6 @@ import { ProcessorEvent } from '../../../../common/processor_event'; import { AlertParams } from '../../../routes/alerts/chart_preview'; import { rangeQuery } from '../../../../../observability/server'; import { environmentQuery } from '../../../../common/utils/environment_query'; -import { getBucketSize } from '../../helpers/get_bucket_size'; import { Setup, SetupTimeRange } from '../../helpers/setup_request'; export async function getTransactionErrorCountChartPreview({ @@ -21,7 +20,7 @@ export async function getTransactionErrorCountChartPreview({ alertParams: AlertParams; }) { const { apmEventClient, start, end } = setup; - const { serviceName, environment } = alertParams; + const { serviceName, environment, interval } = alertParams; const query = { bool: { @@ -33,13 +32,15 @@ export async function getTransactionErrorCountChartPreview({ }, }; - const { intervalString } = getBucketSize({ start, end, numBuckets: 20 }); - const aggs = { timeseries: { date_histogram: { field: '@timestamp', - fixed_interval: intervalString, + fixed_interval: interval, + extended_bounds: { + min: start, + max: end, + }, }, }, }; diff --git a/x-pack/plugins/apm/server/lib/alerts/chart_preview/get_transaction_error_rate.ts b/x-pack/plugins/apm/server/lib/alerts/chart_preview/get_transaction_error_rate.ts index f4d8ffc2749c3..ed4a7a7208eeb 100644 --- a/x-pack/plugins/apm/server/lib/alerts/chart_preview/get_transaction_error_rate.ts +++ b/x-pack/plugins/apm/server/lib/alerts/chart_preview/get_transaction_error_rate.ts @@ -5,16 +5,18 @@ * 2.0. */ +import { rangeQuery } from '../../../../../observability/server'; import { - PROCESSOR_EVENT, SERVICE_NAME, TRANSACTION_TYPE, } from '../../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../../common/processor_event'; -import { AlertParams } from '../../../routes/alerts/chart_preview'; -import { rangeQuery } from '../../../../../observability/server'; import { environmentQuery } from '../../../../common/utils/environment_query'; -import { getBucketSize } from '../../helpers/get_bucket_size'; +import { AlertParams } from '../../../routes/alerts/chart_preview'; +import { + getDocumentTypeFilterForAggregatedTransactions, + getProcessorEventForAggregatedTransactions, + getSearchAggregatedTransactions, +} from '../../helpers/aggregated_transactions'; import { Setup, SetupTimeRange } from '../../helpers/setup_request'; import { calculateFailedTransactionRate, @@ -28,43 +30,58 @@ export async function getTransactionErrorRateChartPreview({ setup: Setup & SetupTimeRange; alertParams: AlertParams; }) { - const { apmEventClient, start, end } = setup; - const { serviceName, environment, transactionType } = alertParams; + const searchAggregatedTransactions = await getSearchAggregatedTransactions({ + ...setup, + kuery: '', + }); - const query = { - bool: { - filter: [ - { term: { [PROCESSOR_EVENT]: ProcessorEvent.transaction } }, - ...(serviceName ? [{ term: { [SERVICE_NAME]: serviceName } }] : []), - ...(transactionType - ? [{ term: { [TRANSACTION_TYPE]: transactionType } }] - : []), - ...rangeQuery(start, end), - ...environmentQuery(environment), - ], - }, - }; + const { apmEventClient, start, end } = setup; + const { serviceName, environment, transactionType, interval } = alertParams; const outcomes = getOutcomeAggregation(); - const { intervalString } = getBucketSize({ start, end, numBuckets: 20 }); - - const aggs = { - outcomes, - timeseries: { - date_histogram: { - field: '@timestamp', - fixed_interval: intervalString, + const params = { + apm: { + events: [ + getProcessorEventForAggregatedTransactions( + searchAggregatedTransactions + ), + ], + }, + body: { + size: 0, + query: { + bool: { + filter: [ + ...(serviceName ? [{ term: { [SERVICE_NAME]: serviceName } }] : []), + ...(transactionType + ? [{ term: { [TRANSACTION_TYPE]: transactionType } }] + : []), + ...rangeQuery(start, end), + ...environmentQuery(environment), + ...getDocumentTypeFilterForAggregatedTransactions( + searchAggregatedTransactions + ), + ], + }, + }, + aggs: { + outcomes, + timeseries: { + date_histogram: { + field: '@timestamp', + fixed_interval: interval, + extended_bounds: { + min: start, + max: end, + }, + }, + aggs: { outcomes }, + }, }, - aggs: { outcomes }, }, }; - const params = { - apm: { events: [ProcessorEvent.transaction] }, - body: { size: 0, query, aggs }, - }; - const resp = await apmEventClient.search( 'get_transaction_error_rate_chart_preview', 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 28f3041d65d70..1ea9ae6b65ac5 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 @@ -9,6 +9,7 @@ import { Logger } from 'kibana/server'; import uuid from 'uuid/v4'; import { snakeCase } from 'lodash'; import Boom from '@hapi/boom'; +import moment from 'moment'; import { ML_ERRORS } from '../../../common/anomaly_detection'; import { ProcessorEvent } from '../../../common/processor_event'; import { environmentQuery } from '../../../common/utils/environment_query'; @@ -87,6 +88,7 @@ async function createAnomalyDetectionJob({ groups: [APM_ML_JOB_GROUP], indexPatternName, applyToAllSpaces: true, + start: moment().subtract(4, 'weeks').valueOf(), query: { bool: { filter: [ diff --git a/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.test.ts b/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.test.ts index ef869a0ed6cfa..46596d8ac864a 100644 --- a/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.test.ts +++ b/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.test.ts @@ -5,28 +5,36 @@ * 2.0. */ +/* eslint-disable @typescript-eslint/naming-convention */ import { createStaticIndexPattern } from './create_static_index_pattern'; import { Setup } from '../helpers/setup_request'; -import * as HistoricalAgentData from '../services/get_services/has_historical_agent_data'; +import * as HistoricalAgentData from '../../routes/historical_data/has_historical_agent_data'; import { InternalSavedObjectsClient } from '../helpers/get_internal_saved_objects_client'; import { APMConfig } from '../..'; -function getMockSavedObjectsClient() { +function getMockSavedObjectsClient(existingIndexPatternTitle: string) { return ({ get: jest.fn(() => ({ attributes: { - title: 'apm-*', + title: existingIndexPatternTitle, }, })), create: jest.fn(), } as unknown) as InternalSavedObjectsClient; } +const setup = ({ + indices: { + 'apm_oss.transactionIndices': 'apm-*-transaction-*', + 'apm_oss.spanIndices': 'apm-*-span-*', + 'apm_oss.errorIndices': 'apm-*-error-*', + 'apm_oss.metricsIndices': 'apm-*-metrics-*', + }, +} as unknown) as Setup; + describe('createStaticIndexPattern', () => { it(`should not create index pattern if 'xpack.apm.autocreateApmIndexPattern=false'`, async () => { - const setup = {} as Setup; - - const savedObjectsClient = getMockSavedObjectsClient(); + const savedObjectsClient = getMockSavedObjectsClient('apm-*'); await createStaticIndexPattern({ setup, config: { 'xpack.apm.autocreateApmIndexPattern': false } as APMConfig, @@ -37,14 +45,12 @@ describe('createStaticIndexPattern', () => { }); it(`should not create index pattern if no APM data is found`, async () => { - const setup = {} as Setup; - // does not have APM data jest .spyOn(HistoricalAgentData, 'hasHistoricalAgentData') .mockResolvedValue(false); - const savedObjectsClient = getMockSavedObjectsClient(); + const savedObjectsClient = getMockSavedObjectsClient('apm-*'); await createStaticIndexPattern({ setup, @@ -56,14 +62,12 @@ describe('createStaticIndexPattern', () => { }); it(`should create index pattern`, async () => { - const setup = {} as Setup; - // does have APM data jest .spyOn(HistoricalAgentData, 'hasHistoricalAgentData') .mockResolvedValue(true); - const savedObjectsClient = getMockSavedObjectsClient(); + const savedObjectsClient = getMockSavedObjectsClient('apm-*'); await createStaticIndexPattern({ setup, @@ -75,23 +79,20 @@ describe('createStaticIndexPattern', () => { expect(savedObjectsClient.create).toHaveBeenCalled(); }); - it(`should upgrade an index pattern if 'apm_oss.indexPattern' does not match title`, async () => { - const setup = {} as Setup; - + it(`should overwrite the index pattern if the new index pattern title does not match the old index pattern title`, async () => { // does have APM data jest .spyOn(HistoricalAgentData, 'hasHistoricalAgentData') .mockResolvedValue(true); - const savedObjectsClient = getMockSavedObjectsClient(); - const apmIndexPatternTitle = 'traces-apm*,logs-apm*,metrics-apm*,apm-*'; + const savedObjectsClient = getMockSavedObjectsClient('apm-*'); + const expectedIndexPatternTitle = + 'apm-*-transaction-*,apm-*-span-*,apm-*-error-*,apm-*-metrics-*'; await createStaticIndexPattern({ setup, config: { 'xpack.apm.autocreateApmIndexPattern': true, - // eslint-disable-next-line @typescript-eslint/naming-convention - 'apm_oss.indexPattern': apmIndexPatternTitle, } as APMConfig, savedObjectsClient, spaceId: 'default', @@ -101,29 +102,26 @@ describe('createStaticIndexPattern', () => { expect(savedObjectsClient.create).toHaveBeenCalled(); // @ts-ignore expect(savedObjectsClient.create.mock.calls[0][1].title).toBe( - apmIndexPatternTitle + expectedIndexPatternTitle ); // @ts-ignore expect(savedObjectsClient.create.mock.calls[0][2].overwrite).toBe(true); }); - it(`should not upgrade an index pattern if 'apm_oss.indexPattern' already match existing title`, async () => { - const setup = {} as Setup; - + it(`should not overwrite an index pattern if the new index pattern title matches the old index pattern title`, async () => { // does have APM data jest .spyOn(HistoricalAgentData, 'hasHistoricalAgentData') .mockResolvedValue(true); - const savedObjectsClient = getMockSavedObjectsClient(); - const apmIndexPatternTitle = 'apm-*'; + const savedObjectsClient = getMockSavedObjectsClient( + 'apm-*-transaction-*,apm-*-span-*,apm-*-error-*,apm-*-metrics-*' + ); await createStaticIndexPattern({ setup, config: { 'xpack.apm.autocreateApmIndexPattern': true, - // eslint-disable-next-line @typescript-eslint/naming-convention - 'apm_oss.indexPattern': apmIndexPatternTitle, } as APMConfig, savedObjectsClient, spaceId: 'default', diff --git a/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.ts b/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.ts index 5dbee59b4ce86..6fa96de0b9413 100644 --- a/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.ts +++ b/x-pack/plugins/apm/server/lib/index_pattern/create_static_index_pattern.ts @@ -8,7 +8,7 @@ import { SavedObjectsErrorHelpers } from '../../../../../../src/core/server'; import { APM_STATIC_INDEX_PATTERN_ID } from '../../../common/index_pattern_constants'; import apmIndexPattern from '../../tutorial/index_pattern.json'; -import { hasHistoricalAgentData } from '../services/get_services/has_historical_agent_data'; +import { hasHistoricalAgentData } from '../../routes/historical_data/has_historical_agent_data'; import { Setup } from '../helpers/setup_request'; import { APMRouteHandlerResources } from '../../routes/typings'; import { InternalSavedObjectsClient } from '../helpers/get_internal_saved_objects_client.js'; @@ -45,29 +45,12 @@ export async function createStaticIndexPattern({ return false; } - const apmIndexPatternTitle = getApmIndexPatternTitle(config); - - if (!overwrite) { - try { - const { - attributes: { title: existingApmIndexPatternTitle }, - }: { - attributes: ApmIndexPatternAttributes; - } = await savedObjectsClient.get( - 'index-pattern', - APM_STATIC_INDEX_PATTERN_ID - ); - // if the existing index pattern does not matches the new one, force an update - if (existingApmIndexPatternTitle !== apmIndexPatternTitle) { - overwrite = true; - } - } catch (e) { - // if the index pattern (saved object) is not found, then we can continue with creation - if (!SavedObjectsErrorHelpers.isNotFoundError(e)) { - throw e; - } - } - } + const apmIndexPatternTitle = getApmIndexPatternTitle(setup.indices); + const forceOverwrite = await getForceOverwrite({ + apmIndexPatternTitle, + overwrite, + savedObjectsClient, + }); try { await withApmSpan('create_index_pattern_saved_object', () => @@ -79,7 +62,7 @@ export async function createStaticIndexPattern({ }, { id: APM_STATIC_INDEX_PATTERN_ID, - overwrite, + overwrite: forceOverwrite ? true : overwrite, namespace: spaceId, } ) @@ -95,3 +78,33 @@ export async function createStaticIndexPattern({ } }); } + +// force an overwrite of the index pattern if the index pattern has been changed +async function getForceOverwrite({ + savedObjectsClient, + overwrite, + apmIndexPatternTitle, +}: { + savedObjectsClient: InternalSavedObjectsClient; + overwrite: boolean; + apmIndexPatternTitle: string; +}) { + if (!overwrite) { + try { + const existingIndexPattern = await savedObjectsClient.get( + 'index-pattern', + APM_STATIC_INDEX_PATTERN_ID + ); + + // if the existing index pattern does not matches the new one, force an update + return existingIndexPattern.attributes.title !== apmIndexPatternTitle; + } catch (e) { + // ignore exception if the index pattern (saved object) is not found + if (SavedObjectsErrorHelpers.isNotFoundError(e)) { + return false; + } + + throw e; + } + } +} diff --git a/x-pack/plugins/apm/server/lib/index_pattern/get_apm_index_pattern_title.test.ts b/x-pack/plugins/apm/server/lib/index_pattern/get_apm_index_pattern_title.test.ts new file mode 100644 index 0000000000000..8103630157584 --- /dev/null +++ b/x-pack/plugins/apm/server/lib/index_pattern/get_apm_index_pattern_title.test.ts @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import { ApmIndicesConfig } from '../settings/apm_indices/get_apm_indices'; +import { getApmIndexPatternTitle } from './get_apm_index_pattern_title'; + +describe('getApmIndexPatternTitle', () => { + it('returns an index pattern title by combining existing indicies', () => { + const title = getApmIndexPatternTitle({ + 'apm_oss.transactionIndices': 'apm-*-transaction-*', + 'apm_oss.spanIndices': 'apm-*-span-*', + 'apm_oss.errorIndices': 'apm-*-error-*', + 'apm_oss.metricsIndices': 'apm-*-metrics-*', + } as ApmIndicesConfig); + expect(title).toBe( + 'apm-*-transaction-*,apm-*-span-*,apm-*-error-*,apm-*-metrics-*' + ); + }); + + it('removes duplicates', () => { + const title = getApmIndexPatternTitle({ + 'apm_oss.transactionIndices': 'apm-*', + 'apm_oss.spanIndices': 'apm-*', + 'apm_oss.errorIndices': 'apm-*', + 'apm_oss.metricsIndices': 'apm-*', + } as ApmIndicesConfig); + expect(title).toBe('apm-*'); + }); +}); diff --git a/x-pack/plugins/apm/server/lib/index_pattern/get_apm_index_pattern_title.ts b/x-pack/plugins/apm/server/lib/index_pattern/get_apm_index_pattern_title.ts index faec64c798c7d..e65f200130e9a 100644 --- a/x-pack/plugins/apm/server/lib/index_pattern/get_apm_index_pattern_title.ts +++ b/x-pack/plugins/apm/server/lib/index_pattern/get_apm_index_pattern_title.ts @@ -5,10 +5,14 @@ * 2.0. */ -import { APMRouteHandlerResources } from '../../routes/typings'; +import { uniq } from 'lodash'; +import { ApmIndicesConfig } from '../settings/apm_indices/get_apm_indices'; -export function getApmIndexPatternTitle( - config: APMRouteHandlerResources['config'] -) { - return config['apm_oss.indexPattern']; +export function getApmIndexPatternTitle(apmIndicesConfig: ApmIndicesConfig) { + return uniq([ + apmIndicesConfig['apm_oss.transactionIndices'], + apmIndicesConfig['apm_oss.spanIndices'], + apmIndicesConfig['apm_oss.errorIndices'], + apmIndicesConfig['apm_oss.metricsIndices'], + ]).join(','); } diff --git a/x-pack/plugins/apm/server/lib/index_pattern/get_dynamic_index_pattern.ts b/x-pack/plugins/apm/server/lib/index_pattern/get_dynamic_index_pattern.ts index 8bbc22fbf289d..19bd801a1f0e1 100644 --- a/x-pack/plugins/apm/server/lib/index_pattern/get_dynamic_index_pattern.ts +++ b/x-pack/plugins/apm/server/lib/index_pattern/get_dynamic_index_pattern.ts @@ -11,6 +11,8 @@ import { } from '../../../../../../src/plugins/data/server'; import { APMRouteHandlerResources } from '../../routes/typings'; import { withApmSpan } from '../../utils/with_apm_span'; +import { getApmIndices } from '../settings/apm_indices/get_apm_indices'; +import { getApmIndexPatternTitle } from './get_apm_index_pattern_title'; export interface IndexPatternTitleAndFields { title: string; @@ -18,14 +20,17 @@ export interface IndexPatternTitleAndFields { fields: FieldDescriptor[]; } -// TODO: this is currently cached globally. In the future we might want to cache this per user export const getDynamicIndexPattern = ({ config, context, logger, }: Pick) => { return withApmSpan('get_dynamic_index_pattern', async () => { - const indexPatternTitle = config['apm_oss.indexPattern']; + const apmIndicies = await getApmIndices({ + savedObjectsClient: context.core.savedObjects.client, + config, + }); + const indexPatternTitle = getApmIndexPatternTitle(apmIndicies); const indexPatternsFetcher = new IndexPatternsFetcher( context.core.elasticsearch.client.asCurrentUser diff --git a/x-pack/plugins/apm/server/lib/search_strategies/constants.ts b/x-pack/plugins/apm/server/lib/search_strategies/constants.ts new file mode 100644 index 0000000000000..5500e336c3542 --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/constants.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +/** + * Fields to exclude as potential field candidates + */ +export const FIELDS_TO_EXCLUDE_AS_CANDIDATE = new Set([ + // Exclude for all usage Contexts + 'parent.id', + 'trace.id', + 'transaction.id', + '@timestamp', + 'timestamp.us', + 'agent.ephemeral_id', + 'ecs.version', + 'event.ingested', + 'http.response.finished', + 'parent.id', + 'trace.id', + 'transaction.duration.us', + 'transaction.id', + 'process.pid', + 'process.ppid', + 'processor.event', + 'processor.name', + 'transaction.sampled', + 'transaction.span_count.dropped', + // Exclude for correlation on a Single Service + 'agent.name', + 'http.request.method', + 'service.framework.name', + 'service.language.name', + 'service.name', + 'service.runtime.name', + 'transaction.name', + 'transaction.type', +]); + +export const FIELD_PREFIX_TO_EXCLUDE_AS_CANDIDATE = ['observer.']; + +/** + * Fields to include/prioritize as potential field candidates + */ +export const FIELDS_TO_ADD_AS_CANDIDATE = new Set([ + 'service.version', + 'service.node.name', + 'service.framework.version', + 'service.language.version', + 'service.runtime.version', + 'kubernetes.pod.name', + 'kubernetes.pod.uid', + 'container.id', + 'source.ip', + 'client.ip', + 'host.ip', + 'service.environment', + 'process.args', + 'http.response.status_code', +]); +export const FIELD_PREFIX_TO_ADD_AS_CANDIDATE = [ + 'cloud.', + 'labels.', + 'user_agent.', +]; + +/** + * Other constants + */ +export const POPULATED_DOC_COUNT_SAMPLE_SIZE = 1000; + +export const PERCENTILES_STEP = 2; +export const TERMS_SIZE = 20; +export const SIGNIFICANT_FRACTION = 3; +export const SIGNIFICANT_VALUE_DIGITS = 3; + +export const CORRELATION_THRESHOLD = 0.3; +export const KS_TEST_THRESHOLD = 0.1; + +export const ERROR_CORRELATION_THRESHOLD = 0.02; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/async_search_service.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/async_search_service.ts deleted file mode 100644 index e9986bd9f0cf5..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/async_search_service.ts +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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 type { ElasticsearchClient } from 'src/core/server'; -import type { - SearchServiceParams, - SearchServiceFetchParams, -} from '../../../../common/search_strategies/correlations/types'; -import type { ApmIndicesConfig } from '../../settings/apm_indices/get_apm_indices'; -import { - fetchTransactionDurationFieldCandidates, - fetchTransactionDurationFieldValuePairs, - fetchTransactionDurationFractions, - fetchTransactionDurationPercentiles, - fetchTransactionDurationHistograms, - fetchTransactionDurationHistogramRangeSteps, - fetchTransactionDurationRanges, -} from './queries'; -import { computeExpectationsAndRanges } from './utils'; -import { asyncSearchServiceLogProvider } from './async_search_service_log'; -import { asyncSearchServiceStateProvider } from './async_search_service_state'; - -export const asyncSearchServiceProvider = ( - esClient: ElasticsearchClient, - getApmIndices: () => Promise, - searchServiceParams: SearchServiceParams, - includeFrozen: boolean -) => { - const { addLogMessage, getLogMessages } = asyncSearchServiceLogProvider(); - - const state = asyncSearchServiceStateProvider(); - - async function fetchCorrelations() { - let params: SearchServiceFetchParams | undefined; - - try { - const indices = await getApmIndices(); - params = { - ...searchServiceParams, - index: indices['apm_oss.transactionIndices'], - includeFrozen, - }; - - // 95th percentile to be displayed as a marker in the log log chart - const { - totalDocs, - percentiles: percentilesResponseThresholds, - } = await fetchTransactionDurationPercentiles( - esClient, - params, - params.percentileThreshold ? [params.percentileThreshold] : undefined - ); - const percentileThresholdValue = - percentilesResponseThresholds[`${params.percentileThreshold}.0`]; - state.setPercentileThresholdValue(percentileThresholdValue); - - addLogMessage( - `Fetched ${params.percentileThreshold}th percentile value of ${percentileThresholdValue} based on ${totalDocs} documents.` - ); - - // finish early if we weren't able to identify the percentileThresholdValue. - if (percentileThresholdValue === undefined) { - addLogMessage( - `Abort service since percentileThresholdValue could not be determined.` - ); - state.setProgress({ - loadedHistogramStepsize: 1, - loadedOverallHistogram: 1, - loadedFieldCanditates: 1, - loadedFieldValuePairs: 1, - loadedHistograms: 1, - }); - state.setIsRunning(false); - return; - } - - const histogramRangeSteps = await fetchTransactionDurationHistogramRangeSteps( - esClient, - params - ); - state.setProgress({ loadedHistogramStepsize: 1 }); - - addLogMessage(`Loaded histogram range steps.`); - - if (state.getIsCancelled()) { - state.setIsRunning(false); - return; - } - - const overallLogHistogramChartData = await fetchTransactionDurationRanges( - esClient, - params, - histogramRangeSteps - ); - state.setProgress({ loadedOverallHistogram: 1 }); - state.setOverallHistogram(overallLogHistogramChartData); - - addLogMessage(`Loaded overall histogram chart data.`); - - if (state.getIsCancelled()) { - state.setIsRunning(false); - return; - } - - // finish early if correlation analysis is not required. - if (params.analyzeCorrelations === false) { - addLogMessage( - `Finish service since correlation analysis wasn't requested.` - ); - state.setProgress({ - loadedHistogramStepsize: 1, - loadedOverallHistogram: 1, - loadedFieldCanditates: 1, - loadedFieldValuePairs: 1, - loadedHistograms: 1, - }); - state.setIsRunning(false); - return; - } - - // Create an array of ranges [2, 4, 6, ..., 98] - const percentileAggregationPercents = range(2, 100, 2); - const { - percentiles: percentilesRecords, - } = await fetchTransactionDurationPercentiles( - esClient, - params, - percentileAggregationPercents - ); - const percentiles = Object.values(percentilesRecords); - - addLogMessage(`Loaded percentiles.`); - - if (state.getIsCancelled()) { - state.setIsRunning(false); - return; - } - - const { fieldCandidates } = await fetchTransactionDurationFieldCandidates( - esClient, - params - ); - - addLogMessage(`Identified ${fieldCandidates.length} fieldCandidates.`); - - state.setProgress({ loadedFieldCanditates: 1 }); - - const fieldValuePairs = await fetchTransactionDurationFieldValuePairs( - esClient, - params, - fieldCandidates, - state, - addLogMessage - ); - - addLogMessage(`Identified ${fieldValuePairs.length} fieldValuePairs.`); - - if (state.getIsCancelled()) { - state.setIsRunning(false); - return; - } - - const { expectations, ranges } = computeExpectationsAndRanges( - percentiles - ); - - const { - fractions, - totalDocCount, - } = await fetchTransactionDurationFractions(esClient, params, ranges); - - addLogMessage(`Loaded fractions and totalDocCount of ${totalDocCount}.`); - - let loadedHistograms = 0; - for await (const item of fetchTransactionDurationHistograms( - esClient, - addLogMessage, - params, - state, - expectations, - ranges, - fractions, - histogramRangeSteps, - totalDocCount, - fieldValuePairs - )) { - if (item !== undefined) { - state.addValue(item); - } - loadedHistograms++; - state.setProgress({ - loadedHistograms: loadedHistograms / fieldValuePairs.length, - }); - } - - addLogMessage( - `Identified ${ - state.getState().values.length - } significant correlations out of ${ - fieldValuePairs.length - } field/value pairs.` - ); - } catch (e) { - state.setError(e); - } - - if (state.getState().error !== undefined && params?.index.includes(':')) { - state.setCcsWarning(true); - } - - state.setIsRunning(false); - } - - fetchCorrelations(); - - return () => { - const { - ccsWarning, - error, - isRunning, - overallHistogram, - percentileThresholdValue, - progress, - } = state.getState(); - - return { - ccsWarning, - error, - log: getLogMessages(), - isRunning, - loaded: Math.round(state.getOverallProgress() * 100), - overallHistogram, - started: progress.started, - total: 100, - values: state.getValuesSortedByCorrelation(), - percentileThresholdValue, - cancel: () => { - addLogMessage(`Service cancelled.`); - state.setIsCancelled(true); - }, - }; - }; -}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/async_search_service_log.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/async_search_service_log.test.ts deleted file mode 100644 index bbeb8435e61bf..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/async_search_service_log.test.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { asyncSearchServiceLogProvider } from './async_search_service_log'; - -describe('async search service', () => { - describe('asyncSearchServiceLogProvider', () => { - it('adds and retrieves messages from the log', async () => { - const { addLogMessage, getLogMessages } = asyncSearchServiceLogProvider(); - - const mockDate = new Date(1392202800000); - // @ts-ignore ignore the mockImplementation callback error - const spy = jest.spyOn(global, 'Date').mockImplementation(() => mockDate); - - addLogMessage('the first message'); - addLogMessage('the second message'); - - expect(getLogMessages()).toEqual([ - '2014-02-12T11:00:00.000Z: the first message', - '2014-02-12T11:00:00.000Z: the second message', - ]); - - spy.mockRestore(); - }); - }); -}); diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/async_search_service_log.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/async_search_service_log.ts deleted file mode 100644 index e69d2f55b6c56..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/async_search_service_log.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 { currentTimeAsString } from './utils'; - -interface LogMessage { - timestamp: string; - message: string; - error?: string; -} - -export const asyncSearchServiceLogProvider = () => { - const log: LogMessage[] = []; - - function addLogMessage(message: string, error?: string) { - log.push({ - timestamp: currentTimeAsString(), - message, - ...(error !== undefined ? { error } : {}), - }); - } - - function getLogMessages() { - return log.map((l) => `${l.timestamp}: ${l.message}`); - } - - return { addLogMessage, getLogMessages }; -}; - -export type AsyncSearchServiceLog = ReturnType< - typeof asyncSearchServiceLogProvider ->; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/async_search_service_state.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/async_search_service_state.test.ts deleted file mode 100644 index cfa1bf2a5ad71..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/async_search_service_state.test.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { asyncSearchServiceStateProvider } from './async_search_service_state'; - -describe('async search service', () => { - describe('asyncSearchServiceStateProvider', () => { - it('initializes with default state', () => { - const state = asyncSearchServiceStateProvider(); - const defaultState = state.getState(); - const defaultProgress = state.getOverallProgress(); - - expect(defaultState.ccsWarning).toBe(false); - expect(defaultState.error).toBe(undefined); - expect(defaultState.isCancelled).toBe(false); - expect(defaultState.isRunning).toBe(true); - expect(defaultState.overallHistogram).toBe(undefined); - expect(defaultState.progress.loadedFieldCanditates).toBe(0); - expect(defaultState.progress.loadedFieldValuePairs).toBe(0); - expect(defaultState.progress.loadedHistogramStepsize).toBe(0); - expect(defaultState.progress.loadedHistograms).toBe(0); - expect(defaultState.progress.loadedOverallHistogram).toBe(0); - expect(defaultState.progress.started > 0).toBe(true); - - expect(defaultProgress).toBe(0); - }); - - it('returns updated state', () => { - const state = asyncSearchServiceStateProvider(); - - state.setCcsWarning(true); - state.setError(new Error('the-error-message')); - state.setIsCancelled(true); - state.setIsRunning(false); - state.setOverallHistogram([{ key: 1392202800000, doc_count: 1234 }]); - state.setProgress({ loadedHistograms: 0.5 }); - - const updatedState = state.getState(); - const updatedProgress = state.getOverallProgress(); - - expect(updatedState.ccsWarning).toBe(true); - expect(updatedState.error?.message).toBe('the-error-message'); - expect(updatedState.isCancelled).toBe(true); - expect(updatedState.isRunning).toBe(false); - expect(updatedState.overallHistogram).toEqual([ - { key: 1392202800000, doc_count: 1234 }, - ]); - expect(updatedState.progress.loadedFieldCanditates).toBe(0); - expect(updatedState.progress.loadedFieldValuePairs).toBe(0); - expect(updatedState.progress.loadedHistogramStepsize).toBe(0); - expect(updatedState.progress.loadedHistograms).toBe(0.5); - expect(updatedState.progress.loadedOverallHistogram).toBe(0); - expect(updatedState.progress.started > 0).toBe(true); - - expect(updatedProgress).toBe(0.45); - }); - }); -}); diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/async_search_service_state.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/async_search_service_state.ts deleted file mode 100644 index d0aac8987e070..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/async_search_service_state.ts +++ /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 type { - AsyncSearchProviderProgress, - SearchServiceValue, -} from '../../../../common/search_strategies/correlations/types'; - -import { HistogramItem } from './queries'; - -export const asyncSearchServiceStateProvider = () => { - let ccsWarning = false; - function setCcsWarning(d: boolean) { - ccsWarning = d; - } - - let error: Error; - function setError(d: Error) { - error = d; - } - - let isCancelled = false; - function getIsCancelled() { - return isCancelled; - } - function setIsCancelled(d: boolean) { - isCancelled = d; - } - - let isRunning = true; - function setIsRunning(d: boolean) { - isRunning = d; - } - - let overallHistogram: HistogramItem[] | undefined; - function setOverallHistogram(d: HistogramItem[]) { - overallHistogram = d; - } - - let percentileThresholdValue: number; - function setPercentileThresholdValue(d: number) { - percentileThresholdValue = d; - } - - let progress: AsyncSearchProviderProgress = { - started: Date.now(), - loadedHistogramStepsize: 0, - loadedOverallHistogram: 0, - loadedFieldCanditates: 0, - loadedFieldValuePairs: 0, - loadedHistograms: 0, - }; - function getOverallProgress() { - return ( - progress.loadedHistogramStepsize * 0.025 + - progress.loadedOverallHistogram * 0.025 + - progress.loadedFieldCanditates * 0.025 + - progress.loadedFieldValuePairs * 0.025 + - progress.loadedHistograms * 0.9 - ); - } - function setProgress( - d: Partial> - ) { - progress = { - ...progress, - ...d, - }; - } - - const values: SearchServiceValue[] = []; - function addValue(d: SearchServiceValue) { - values.push(d); - } - - function getValuesSortedByCorrelation() { - return values.sort((a, b) => b.correlation - a.correlation); - } - - function getState() { - return { - ccsWarning, - error, - isCancelled, - isRunning, - overallHistogram, - percentileThresholdValue, - progress, - values, - }; - } - - return { - addValue, - getIsCancelled, - getOverallProgress, - getState, - getValuesSortedByCorrelation, - setCcsWarning, - setError, - setIsCancelled, - setIsRunning, - setOverallHistogram, - setPercentileThresholdValue, - setProgress, - }; -}; - -export type AsyncSearchServiceState = ReturnType< - typeof asyncSearchServiceStateProvider ->; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/constants.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/constants.ts deleted file mode 100644 index 6b96b6b9d2131..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/constants.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -/** - * Fields to exclude as potential field candidates - */ -export const FIELDS_TO_EXCLUDE_AS_CANDIDATE = new Set([ - // Exclude for all usage Contexts - 'parent.id', - 'trace.id', - 'transaction.id', - '@timestamp', - 'timestamp.us', - 'agent.ephemeral_id', - 'ecs.version', - 'event.ingested', - 'http.response.finished', - 'parent.id', - 'trace.id', - 'transaction.duration.us', - 'transaction.id', - 'process.pid', - 'process.ppid', - 'processor.event', - 'processor.name', - 'transaction.sampled', - 'transaction.span_count.dropped', - // Exclude for correlation on a Single Service - 'agent.name', - 'http.request.method', - 'service.framework.name', - 'service.language.name', - 'service.name', - 'service.runtime.name', - 'transaction.name', - 'transaction.type', -]); - -export const FIELD_PREFIX_TO_EXCLUDE_AS_CANDIDATE = ['observer.']; - -/** - * Fields to include/prioritize as potential field candidates - */ -export const FIELDS_TO_ADD_AS_CANDIDATE = new Set([ - 'service.version', - 'service.node.name', - 'service.framework.version', - 'service.language.version', - 'service.runtime.version', - 'kubernetes.pod.name', - 'kubernetes.pod.uid', - 'container.id', - 'source.ip', - 'client.ip', - 'host.ip', - 'service.environment', - 'process.args', - 'http.response.status_code', -]); -export const FIELD_PREFIX_TO_ADD_AS_CANDIDATE = [ - 'cloud.', - 'labels.', - 'user_agent.', -]; - -/** - * Other constants - */ -export const POPULATED_DOC_COUNT_SAMPLE_SIZE = 1000; - -export const PERCENTILES_STEP = 2; -export const TERMS_SIZE = 20; -export const SIGNIFICANT_FRACTION = 3; -export const SIGNIFICANT_VALUE_DIGITS = 3; - -export const CORRELATION_THRESHOLD = 0.3; -export const KS_TEST_THRESHOLD = 0.1; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/index.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/index.ts deleted file mode 100644 index 5ba7b4d7c957a..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/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 { apmCorrelationsSearchStrategyProvider } from './search_strategy'; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_prioritized_field_value_pairs.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_prioritized_field_value_pairs.test.ts deleted file mode 100644 index dc11b4860a8b6..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_prioritized_field_value_pairs.test.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { getPrioritizedFieldValuePairs } from './get_prioritized_field_value_pairs'; - -describe('correlations', () => { - describe('getPrioritizedFieldValuePairs', () => { - it('returns fields without prioritization in the same order', () => { - const fieldValuePairs = [ - { field: 'the-field-1', value: 'the-value-1' }, - { field: 'the-field-2', value: 'the-value-2' }, - ]; - const prioritziedFieldValuePairs = getPrioritizedFieldValuePairs( - fieldValuePairs - ); - expect(prioritziedFieldValuePairs.map((d) => d.field)).toEqual([ - 'the-field-1', - 'the-field-2', - ]); - }); - - it('returns fields with already sorted prioritization in the same order', () => { - const fieldValuePairs = [ - { field: 'service.version', value: 'the-value-1' }, - { field: 'the-field-2', value: 'the-value-2' }, - ]; - const prioritziedFieldValuePairs = getPrioritizedFieldValuePairs( - fieldValuePairs - ); - expect(prioritziedFieldValuePairs.map((d) => d.field)).toEqual([ - 'service.version', - 'the-field-2', - ]); - }); - - it('returns fields with unsorted prioritization in the corrected order', () => { - const fieldValuePairs = [ - { field: 'the-field-1', value: 'the-value-1' }, - { field: 'service.version', value: 'the-value-2' }, - ]; - const prioritziedFieldValuePairs = getPrioritizedFieldValuePairs( - fieldValuePairs - ); - expect(prioritziedFieldValuePairs.map((d) => d.field)).toEqual([ - 'service.version', - 'the-field-1', - ]); - }); - - it('considers prefixes when sorting', () => { - const fieldValuePairs = [ - { field: 'the-field-1', value: 'the-value-1' }, - { field: 'service.version', value: 'the-value-2' }, - { field: 'cloud.the-field-3', value: 'the-value-3' }, - ]; - const prioritziedFieldValuePairs = getPrioritizedFieldValuePairs( - fieldValuePairs - ); - expect(prioritziedFieldValuePairs.map((d) => d.field)).toEqual([ - 'service.version', - 'cloud.the-field-3', - 'the-field-1', - ]); - }); - }); -}); diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_prioritized_field_value_pairs.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_prioritized_field_value_pairs.ts deleted file mode 100644 index ddfd87c83f9f3..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_prioritized_field_value_pairs.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 { FIELDS_TO_ADD_AS_CANDIDATE } from '../constants'; -import { hasPrefixToInclude } from '../utils'; - -import type { FieldValuePairs } from './query_field_value_pairs'; - -export const getPrioritizedFieldValuePairs = ( - fieldValuePairs: FieldValuePairs -) => { - const prioritizedFields = [...FIELDS_TO_ADD_AS_CANDIDATE]; - - return fieldValuePairs.sort((a, b) => { - const hasPrefixA = hasPrefixToInclude(a.field); - const hasPrefixB = hasPrefixToInclude(b.field); - - const includesA = prioritizedFields.includes(a.field); - const includesB = prioritizedFields.includes(b.field); - - if ((includesA || hasPrefixA) && !includesB && !hasPrefixB) { - return -1; - } else if (!includesA && !hasPrefixA && (includesB || hasPrefixB)) { - return 1; - } - - return 0; - }); -}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_query_with_params.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_query_with_params.ts deleted file mode 100644 index 8bd9f3d4e582c..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_query_with_params.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { estypes } from '@elastic/elasticsearch'; -import { getOrElse } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import * as t from 'io-ts'; -import { failure } from 'io-ts/lib/PathReporter'; -import type { SearchServiceFetchParams } from '../../../../../common/search_strategies/correlations/types'; -import { rangeRt } from '../../../../routes/default_api_types'; -import { getCorrelationsFilters } from '../../../correlations/get_filters'; -import { Setup, SetupTimeRange } from '../../../helpers/setup_request'; - -export const getTermsQuery = ( - fieldName: string | undefined, - fieldValue: string | undefined -) => { - return fieldName && fieldValue ? [{ term: { [fieldName]: fieldValue } }] : []; -}; - -interface QueryParams { - params: SearchServiceFetchParams; - fieldName?: string; - fieldValue?: string; -} -export const getQueryWithParams = ({ - params, - fieldName, - fieldValue, -}: QueryParams) => { - const { - environment, - kuery, - serviceName, - start, - end, - transactionType, - transactionName, - } = params; - - // converts string based start/end to epochmillis - const setup = pipe( - rangeRt.decode({ start, end }), - getOrElse((errors) => { - throw new Error(failure(errors).join('\n')); - }) - ) as Setup & SetupTimeRange; - - const filters = getCorrelationsFilters({ - setup, - environment, - kuery, - serviceName, - transactionType, - transactionName, - }); - - return { - bool: { - filter: [ - ...filters, - ...getTermsQuery(fieldName, fieldValue), - ] as estypes.QueryDslQueryContainer[], - }, - }; -}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/index.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/index.ts deleted file mode 100644 index c33b131d9cbd7..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { fetchTransactionDurationFieldCandidates } from './query_field_candidates'; -export { fetchTransactionDurationFieldValuePairs } from './query_field_value_pairs'; -export { fetchTransactionDurationFractions } from './query_fractions'; -export { fetchTransactionDurationPercentiles } from './query_percentiles'; -export { fetchTransactionDurationCorrelation } from './query_correlation'; -export { fetchTransactionDurationHistograms } from './query_histograms_generator'; -export { fetchTransactionDurationHistogramRangeSteps } from './query_histogram_range_steps'; -export { fetchTransactionDurationRanges, HistogramItem } from './query_ranges'; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_field_value_pairs.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_field_value_pairs.test.ts deleted file mode 100644 index a20720944f19b..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_field_value_pairs.test.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { estypes } from '@elastic/elasticsearch'; - -import type { ElasticsearchClient } from 'src/core/server'; -import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; - -import { asyncSearchServiceLogProvider } from '../async_search_service_log'; -import { asyncSearchServiceStateProvider } from '../async_search_service_state'; - -import { - fetchTransactionDurationFieldValuePairs, - getTermsAggRequest, -} from './query_field_value_pairs'; - -const params = { - index: 'apm-*', - start: '2020', - end: '2021', - includeFrozen: false, - environment: ENVIRONMENT_ALL.value, - kuery: '', -}; - -describe('query_field_value_pairs', () => { - describe('getTermsAggRequest', () => { - it('returns the most basic request body for a terms aggregation', () => { - const fieldName = 'myFieldName'; - const req = getTermsAggRequest(params, fieldName); - expect(req?.body?.aggs?.attribute_terms?.terms?.field).toBe(fieldName); - }); - }); - - describe('fetchTransactionDurationFieldValuePairs', () => { - it('returns field/value pairs for field candidates', async () => { - const fieldCandidates = [ - 'myFieldCandidate1', - 'myFieldCandidate2', - 'myFieldCandidate3', - ]; - - const esClientSearchMock = jest.fn((req: estypes.SearchRequest): { - body: estypes.SearchResponse; - } => { - return { - body: ({ - aggregations: { - attribute_terms: { - buckets: [{ key: 'myValue1' }, { key: 'myValue2' }], - }, - }, - } as unknown) as estypes.SearchResponse, - }; - }); - - const esClientMock = ({ - search: esClientSearchMock, - } as unknown) as ElasticsearchClient; - - const { addLogMessage, getLogMessages } = asyncSearchServiceLogProvider(); - const state = asyncSearchServiceStateProvider(); - - const resp = await fetchTransactionDurationFieldValuePairs( - esClientMock, - params, - fieldCandidates, - state, - addLogMessage - ); - - const { progress } = state.getState(); - - expect(progress.loadedFieldValuePairs).toBe(1); - expect(resp).toEqual([ - { field: 'myFieldCandidate1', value: 'myValue1' }, - { field: 'myFieldCandidate1', value: 'myValue2' }, - { field: 'myFieldCandidate2', value: 'myValue1' }, - { field: 'myFieldCandidate2', value: 'myValue2' }, - { field: 'myFieldCandidate3', value: 'myValue1' }, - { field: 'myFieldCandidate3', value: 'myValue2' }, - ]); - expect(esClientSearchMock).toHaveBeenCalledTimes(3); - expect(getLogMessages()).toEqual([]); - }); - }); -}); diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_field_value_pairs.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_field_value_pairs.ts deleted file mode 100644 index 33adff4af7a52..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_field_value_pairs.ts +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { ElasticsearchClient } from 'src/core/server'; - -import type { estypes } from '@elastic/elasticsearch'; - -import type { SearchServiceFetchParams } from '../../../../../common/search_strategies/correlations/types'; - -import type { AsyncSearchServiceLog } from '../async_search_service_log'; -import type { AsyncSearchServiceState } from '../async_search_service_state'; -import { TERMS_SIZE } from '../constants'; - -import { getQueryWithParams } from './get_query_with_params'; -import { getRequestBase } from './get_request_base'; - -export type FieldName = string; - -interface FieldValuePair { - field: FieldName; - value: string; -} -export type FieldValuePairs = FieldValuePair[]; - -export const getTermsAggRequest = ( - params: SearchServiceFetchParams, - fieldName: FieldName -): estypes.SearchRequest => ({ - ...getRequestBase(params), - body: { - query: getQueryWithParams({ params }), - size: 0, - aggs: { - attribute_terms: { - terms: { - field: fieldName, - size: TERMS_SIZE, - }, - }, - }, - }, -}); - -const fetchTransactionDurationFieldTerms = async ( - esClient: ElasticsearchClient, - params: SearchServiceFetchParams, - fieldName: string, - addLogMessage: AsyncSearchServiceLog['addLogMessage'] -): Promise => { - try { - const resp = await esClient.search(getTermsAggRequest(params, fieldName)); - - if (resp.body.aggregations === undefined) { - addLogMessage( - `Failed to fetch terms for field candidate ${fieldName} fieldValuePairs, no aggregations returned.`, - JSON.stringify(resp) - ); - return []; - } - const buckets = (resp.body.aggregations - .attribute_terms as estypes.AggregationsMultiBucketAggregate<{ - key: string; - }>)?.buckets; - if (buckets?.length >= 1) { - return buckets.map((d) => ({ - field: fieldName, - value: d.key, - })); - } - } catch (e) { - addLogMessage( - `Failed to fetch terms for field candidate ${fieldName} fieldValuePairs.`, - JSON.stringify(e) - ); - } - - return []; -}; - -async function fetchInSequence( - fieldCandidates: FieldName[], - fn: (fieldCandidate: string) => Promise -) { - const results = []; - - for (const fieldCandidate of fieldCandidates) { - results.push(...(await fn(fieldCandidate))); - } - - return results; -} - -export const fetchTransactionDurationFieldValuePairs = async ( - esClient: ElasticsearchClient, - params: SearchServiceFetchParams, - fieldCandidates: FieldName[], - state: AsyncSearchServiceState, - addLogMessage: AsyncSearchServiceLog['addLogMessage'] -): Promise => { - let fieldValuePairsProgress = 1; - - return await fetchInSequence( - fieldCandidates, - async function (fieldCandidate: string) { - const fieldTerms = await fetchTransactionDurationFieldTerms( - esClient, - params, - fieldCandidate, - addLogMessage - ); - - state.setProgress({ - loadedFieldValuePairs: fieldValuePairsProgress / fieldCandidates.length, - }); - fieldValuePairsProgress++; - - return fieldTerms; - } - ); -}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram.ts deleted file mode 100644 index 18fc18af1472e..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { estypes } from '@elastic/elasticsearch'; - -import type { ElasticsearchClient } from 'src/core/server'; - -import { TRANSACTION_DURATION } from '../../../../../common/elasticsearch_fieldnames'; -import type { - HistogramItem, - ResponseHit, - SearchServiceFetchParams, -} from '../../../../../common/search_strategies/correlations/types'; - -import { getQueryWithParams } from './get_query_with_params'; -import { getRequestBase } from './get_request_base'; - -export const getTransactionDurationHistogramRequest = ( - params: SearchServiceFetchParams, - interval: number, - fieldName?: string, - fieldValue?: string -): estypes.SearchRequest => ({ - ...getRequestBase(params), - body: { - query: getQueryWithParams({ params, fieldName, fieldValue }), - size: 0, - aggs: { - transaction_duration_histogram: { - histogram: { field: TRANSACTION_DURATION, interval }, - }, - }, - }, -}); - -export const fetchTransactionDurationHistogram = async ( - esClient: ElasticsearchClient, - params: SearchServiceFetchParams, - interval: number, - fieldName?: string, - fieldValue?: string -): Promise => { - const resp = await esClient.search( - getTransactionDurationHistogramRequest( - params, - interval, - fieldName, - fieldValue - ) - ); - - if (resp.body.aggregations === undefined) { - throw new Error( - 'fetchTransactionDurationHistogram failed, did not return aggregations.' - ); - } - - return ( - (resp.body.aggregations - .transaction_duration_histogram as estypes.AggregationsMultiBucketAggregate) - .buckets ?? [] - ); -}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_percentiles.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_percentiles.ts deleted file mode 100644 index bd230687314e6..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_percentiles.ts +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { estypes } from '@elastic/elasticsearch'; - -import type { ElasticsearchClient } from 'src/core/server'; - -import { TRANSACTION_DURATION } from '../../../../../common/elasticsearch_fieldnames'; -import type { SearchServiceFetchParams } from '../../../../../common/search_strategies/correlations/types'; - -import { getQueryWithParams } from './get_query_with_params'; -import { getRequestBase } from './get_request_base'; -import { SIGNIFICANT_VALUE_DIGITS } from '../constants'; - -export interface HistogramItem { - key: number; - doc_count: number; -} - -interface ResponseHitSource { - [s: string]: unknown; -} -interface ResponseHit { - _source: ResponseHitSource; -} - -export const getTransactionDurationPercentilesRequest = ( - params: SearchServiceFetchParams, - percents?: number[], - fieldName?: string, - fieldValue?: string -): estypes.SearchRequest => { - const query = getQueryWithParams({ params, fieldName, fieldValue }); - - return { - ...getRequestBase(params), - body: { - track_total_hits: true, - query, - size: 0, - aggs: { - transaction_duration_percentiles: { - percentiles: { - hdr: { - number_of_significant_value_digits: SIGNIFICANT_VALUE_DIGITS, - }, - field: TRANSACTION_DURATION, - ...(Array.isArray(percents) ? { percents } : {}), - }, - }, - }, - }, - }; -}; - -export const fetchTransactionDurationPercentiles = async ( - esClient: ElasticsearchClient, - params: SearchServiceFetchParams, - percents?: number[], - fieldName?: string, - fieldValue?: string -): Promise<{ totalDocs: number; percentiles: Record }> => { - const resp = await esClient.search( - getTransactionDurationPercentilesRequest( - params, - percents, - fieldName, - fieldValue - ) - ); - - // return early with no results if the search didn't return any documents - if ((resp.body.hits.total as estypes.SearchTotalHits).value === 0) { - return { totalDocs: 0, percentiles: {} }; - } - - if (resp.body.aggregations === undefined) { - throw new Error( - 'fetchTransactionDurationPercentiles failed, did not return aggregations.' - ); - } - - return { - totalDocs: (resp.body.hits.total as estypes.SearchTotalHits).value, - percentiles: - (resp.body.aggregations - .transaction_duration_percentiles as estypes.AggregationsTDigestPercentilesAggregate) - .values ?? {}, - }; -}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_ranges.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_ranges.ts deleted file mode 100644 index 6f662363d0c42..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_ranges.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 type { estypes } from '@elastic/elasticsearch'; - -import type { ElasticsearchClient } from 'src/core/server'; - -import { TRANSACTION_DURATION } from '../../../../../common/elasticsearch_fieldnames'; -import type { SearchServiceFetchParams } from '../../../../../common/search_strategies/correlations/types'; - -import { getQueryWithParams } from './get_query_with_params'; -import { getRequestBase } from './get_request_base'; - -export interface HistogramItem { - key: number; - doc_count: number; -} - -interface ResponseHitSource { - [s: string]: unknown; -} -interface ResponseHit { - _source: ResponseHitSource; -} - -export const getTransactionDurationRangesRequest = ( - params: SearchServiceFetchParams, - rangesSteps: number[], - fieldName?: string, - fieldValue?: string -): estypes.SearchRequest => { - const query = getQueryWithParams({ params, fieldName, fieldValue }); - - const ranges = rangesSteps.reduce( - (p, to) => { - const from = p[p.length - 1].to; - p.push({ from, to }); - return p; - }, - [{ to: 0 }] as Array<{ from?: number; to?: number }> - ); - if (ranges.length > 0) { - ranges.push({ from: ranges[ranges.length - 1].to }); - } - - return { - ...getRequestBase(params), - body: { - query, - size: 0, - aggs: { - logspace_ranges: { - range: { - field: TRANSACTION_DURATION, - ranges, - }, - }, - }, - }, - }; -}; - -export const fetchTransactionDurationRanges = async ( - esClient: ElasticsearchClient, - params: SearchServiceFetchParams, - rangesSteps: number[], - fieldName?: string, - fieldValue?: string -): Promise> => { - const resp = await esClient.search( - getTransactionDurationRangesRequest( - params, - rangesSteps, - fieldName, - fieldValue - ) - ); - - if (resp.body.aggregations === undefined) { - throw new Error( - 'fetchTransactionDurationCorrelation failed, did not return aggregations.' - ); - } - - return (resp.body.aggregations - .logspace_ranges as estypes.AggregationsMultiBucketAggregate<{ - from: number; - doc_count: number; - }>).buckets - .map((d) => ({ - key: d.from, - doc_count: d.doc_count, - })) - .filter((d) => d.key !== undefined); -}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/search_strategy.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/search_strategy.test.ts deleted file mode 100644 index b5ab4a072be6c..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/search_strategy.test.ts +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { estypes } from '@elastic/elasticsearch'; - -import { SearchStrategyDependencies } from 'src/plugins/data/server'; -import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; - -import type { ApmIndicesConfig } from '../../settings/apm_indices/get_apm_indices'; - -import { - apmCorrelationsSearchStrategyProvider, - PartialSearchRequest, -} from './search_strategy'; - -// helper to trigger promises in the async search service -const flushPromises = () => new Promise(setImmediate); - -const clientFieldCapsMock = () => ({ body: { fields: [] } }); - -// minimal client mock to fulfill search requirements of the async search service to succeed -const clientSearchMock = ( - req: estypes.SearchRequest -): { body: estypes.SearchResponse } => { - let aggregations: - | { - transaction_duration_percentiles: estypes.AggregationsTDigestPercentilesAggregate; - } - | { - transaction_duration_min: estypes.AggregationsValueAggregate; - transaction_duration_max: estypes.AggregationsValueAggregate; - } - | { - logspace_ranges: estypes.AggregationsMultiBucketAggregate<{ - from: number; - doc_count: number; - }>; - } - | { - latency_ranges: estypes.AggregationsMultiBucketAggregate<{ - doc_count: number; - }>; - } - | undefined; - - if (req?.body?.aggs !== undefined) { - const aggs = req.body.aggs; - // fetchTransactionDurationPercentiles - if (aggs.transaction_duration_percentiles !== undefined) { - aggregations = { transaction_duration_percentiles: { values: {} } }; - } - - // fetchTransactionDurationHistogramInterval - if ( - aggs.transaction_duration_min !== undefined && - aggs.transaction_duration_max !== undefined - ) { - aggregations = { - transaction_duration_min: { value: 0 }, - transaction_duration_max: { value: 1234 }, - }; - } - - // fetchTransactionDurationCorrelation - if (aggs.logspace_ranges !== undefined) { - aggregations = { logspace_ranges: { buckets: [] } }; - } - - // fetchTransactionDurationFractions - if (aggs.latency_ranges !== undefined) { - aggregations = { latency_ranges: { buckets: [] } }; - } - } - - return { - body: { - _shards: { - failed: 0, - successful: 1, - total: 1, - }, - took: 162, - timed_out: false, - hits: { - hits: [], - total: { - value: 0, - relation: 'eq', - }, - }, - ...(aggregations !== undefined ? { aggregations } : {}), - }, - }; -}; - -const getApmIndicesMock = async () => - ({ - // eslint-disable-next-line @typescript-eslint/naming-convention - 'apm_oss.transactionIndices': 'apm-*', - } as ApmIndicesConfig); - -describe('APM Correlations search strategy', () => { - describe('strategy interface', () => { - it('returns a custom search strategy with a `search` and `cancel` function', async () => { - const searchStrategy = await apmCorrelationsSearchStrategyProvider( - getApmIndicesMock, - false - ); - expect(typeof searchStrategy.search).toBe('function'); - expect(typeof searchStrategy.cancel).toBe('function'); - }); - }); - - describe('search', () => { - let mockClientFieldCaps: jest.Mock; - let mockClientSearch: jest.Mock; - let mockGetApmIndicesMock: jest.Mock; - let mockDeps: SearchStrategyDependencies; - let params: Required['params']; - - beforeEach(() => { - mockClientFieldCaps = jest.fn(clientFieldCapsMock); - mockClientSearch = jest.fn(clientSearchMock); - mockGetApmIndicesMock = jest.fn(getApmIndicesMock); - mockDeps = ({ - esClient: { - asCurrentUser: { - fieldCaps: mockClientFieldCaps, - search: mockClientSearch, - }, - }, - } as unknown) as SearchStrategyDependencies; - params = { - start: '2020', - end: '2021', - environment: ENVIRONMENT_ALL.value, - kuery: '', - }; - }); - - describe('async functionality', () => { - describe('when no params are provided', () => { - it('throws an error', async () => { - const searchStrategy = await apmCorrelationsSearchStrategyProvider( - mockGetApmIndicesMock, - false - ); - - expect(mockGetApmIndicesMock).toHaveBeenCalledTimes(0); - - expect(() => searchStrategy.search({}, {}, mockDeps)).toThrow( - 'Invalid request parameters.' - ); - }); - }); - - describe('when no ID is provided', () => { - it('performs a client search with params', async () => { - const searchStrategy = await apmCorrelationsSearchStrategyProvider( - mockGetApmIndicesMock, - false - ); - await searchStrategy.search({ params }, {}, mockDeps).toPromise(); - - expect(mockGetApmIndicesMock).toHaveBeenCalledTimes(1); - - const [[request]] = mockClientSearch.mock.calls; - - expect(request.index).toEqual('apm-*'); - expect(request.body).toEqual( - expect.objectContaining({ - aggs: { - transaction_duration_percentiles: { - percentiles: { - field: 'transaction.duration.us', - hdr: { number_of_significant_value_digits: 3 }, - }, - }, - }, - query: { - bool: { - filter: [ - { term: { 'processor.event': 'transaction' } }, - { - range: { - '@timestamp': { - format: 'epoch_millis', - gte: 1577836800000, - lte: 1609459200000, - }, - }, - }, - ], - }, - }, - size: 0, - track_total_hits: true, - }) - ); - }); - }); - - describe('when an ID with params is provided', () => { - it('retrieves the current request', async () => { - const searchStrategy = await apmCorrelationsSearchStrategyProvider( - mockGetApmIndicesMock, - false - ); - const response = await searchStrategy - .search({ params }, {}, mockDeps) - .toPromise(); - - const searchStrategyId = response.id; - - const response2 = await searchStrategy - .search({ id: searchStrategyId, params }, {}, mockDeps) - .toPromise(); - - expect(mockGetApmIndicesMock).toHaveBeenCalledTimes(1); - expect(response2).toEqual( - expect.objectContaining({ id: searchStrategyId }) - ); - }); - }); - - describe('if the client throws', () => { - it('does not emit an error', async () => { - mockClientSearch - .mockReset() - .mockRejectedValueOnce(new Error('client error')); - const searchStrategy = await apmCorrelationsSearchStrategyProvider( - mockGetApmIndicesMock, - false - ); - const response = await searchStrategy - .search({ params }, {}, mockDeps) - .toPromise(); - - expect(mockGetApmIndicesMock).toHaveBeenCalledTimes(1); - - expect(response).toEqual( - expect.objectContaining({ isRunning: true }) - ); - }); - }); - - it('triggers the subscription only once', async () => { - expect.assertions(2); - const searchStrategy = await apmCorrelationsSearchStrategyProvider( - mockGetApmIndicesMock, - false - ); - searchStrategy - .search({ params }, {}, mockDeps) - .subscribe((response) => { - expect(mockGetApmIndicesMock).toHaveBeenCalledTimes(1); - expect(response).toEqual( - expect.objectContaining({ loaded: 0, isRunning: true }) - ); - }); - }); - }); - - describe('response', () => { - it('sends an updated response on consecutive search calls', async () => { - const searchStrategy = await apmCorrelationsSearchStrategyProvider( - mockGetApmIndicesMock, - false - ); - - const response1 = await searchStrategy - .search({ params }, {}, mockDeps) - .toPromise(); - - expect(mockGetApmIndicesMock).toHaveBeenCalledTimes(1); - expect(typeof response1.id).toEqual('string'); - expect(response1).toEqual( - expect.objectContaining({ loaded: 0, isRunning: true }) - ); - - await flushPromises(); - - const response2 = await searchStrategy - .search({ id: response1.id, params }, {}, mockDeps) - .toPromise(); - - expect(mockGetApmIndicesMock).toHaveBeenCalledTimes(1); - expect(response2.id).toEqual(response1.id); - expect(response2).toEqual( - expect.objectContaining({ loaded: 100, isRunning: false }) - ); - }); - }); - }); -}); diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/search_strategy.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/search_strategy.ts deleted file mode 100644 index 7f67147a75580..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/search_strategy.ts +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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 { of } from 'rxjs'; - -import type { ISearchStrategy } from '../../../../../../../src/plugins/data/server'; -import { - IKibanaSearchRequest, - IKibanaSearchResponse, -} from '../../../../../../../src/plugins/data/common'; - -import type { - SearchServiceParams, - SearchServiceRawResponse, - SearchServiceValue, -} from '../../../../common/search_strategies/correlations/types'; - -import type { ApmIndicesConfig } from '../../settings/apm_indices/get_apm_indices'; - -import { asyncSearchServiceProvider } from './async_search_service'; - -export type PartialSearchRequest = IKibanaSearchRequest; -export type PartialSearchResponse = IKibanaSearchResponse<{ - values: SearchServiceValue[]; -}>; - -export const apmCorrelationsSearchStrategyProvider = ( - getApmIndices: () => Promise, - includeFrozen: boolean -): ISearchStrategy => { - const asyncSearchServiceMap = new Map< - string, - ReturnType - >(); - - return { - search: (request, options, deps) => { - if (request.params === undefined) { - throw new Error('Invalid request parameters.'); - } - - // The function to fetch the current state of the async search service. - // This will be either an existing service for a follow up fetch or a new one for new requests. - let getAsyncSearchServiceState: ReturnType< - typeof asyncSearchServiceProvider - >; - - // If the request includes an ID, we require that the async search service already exists - // otherwise we throw an error. The client should never poll a service that's been cancelled or finished. - // This also avoids instantiating async search services when the service gets called with random IDs. - if (typeof request.id === 'string') { - const existingGetAsyncSearchServiceState = asyncSearchServiceMap.get( - request.id - ); - - if (typeof existingGetAsyncSearchServiceState === 'undefined') { - throw new Error( - `AsyncSearchService with ID '${request.id}' does not exist.` - ); - } - - getAsyncSearchServiceState = existingGetAsyncSearchServiceState; - } else { - getAsyncSearchServiceState = asyncSearchServiceProvider( - deps.esClient.asCurrentUser, - getApmIndices, - request.params, - includeFrozen - ); - } - - // Reuse the request's id or create a new one. - const id = request.id ?? uuid(); - - const { - ccsWarning, - error, - log, - isRunning, - loaded, - started, - total, - values, - percentileThresholdValue, - overallHistogram, - } = getAsyncSearchServiceState(); - - if (error instanceof Error) { - asyncSearchServiceMap.delete(id); - throw error; - } else if (isRunning) { - asyncSearchServiceMap.set(id, getAsyncSearchServiceState); - } else { - asyncSearchServiceMap.delete(id); - } - - const took = Date.now() - started; - - const rawResponse: SearchServiceRawResponse = { - ccsWarning, - log, - took, - values, - percentileThresholdValue, - overallHistogram, - }; - - return of({ - id, - loaded, - total, - isRunning, - isPartial: isRunning, - rawResponse, - }); - }, - cancel: async (id, options, deps) => { - const getAsyncSearchServiceState = asyncSearchServiceMap.get(id); - if (getAsyncSearchServiceState !== undefined) { - getAsyncSearchServiceState().cancel(); - asyncSearchServiceMap.delete(id); - } - }, - }; -}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/utils/current_time_as_string.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/utils/current_time_as_string.test.ts deleted file mode 100644 index 2034c29b01d94..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/utils/current_time_as_string.test.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 { currentTimeAsString } from './current_time_as_string'; - -describe('aggregation utils', () => { - describe('currentTimeAsString', () => { - it('returns the current time as a string', () => { - const mockDate = new Date(1392202800000); - // @ts-ignore ignore the mockImplementation callback error - const spy = jest.spyOn(global, 'Date').mockImplementation(() => mockDate); - - const timeString = currentTimeAsString(); - - expect(timeString).toEqual('2014-02-12T11:00:00.000Z'); - - spy.mockRestore(); - }); - }); -}); diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/utils/current_time_as_string.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/utils/current_time_as_string.ts deleted file mode 100644 index f454b8c8274f1..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/utils/current_time_as_string.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 const currentTimeAsString = () => new Date().toISOString(); diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/utils/index.ts b/x-pack/plugins/apm/server/lib/search_strategies/correlations/utils/index.ts deleted file mode 100644 index 000fd57c718b7..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/utils/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 { computeExpectationsAndRanges } from './compute_expectations_and_ranges'; -export { currentTimeAsString } from './current_time_as_string'; -export { hasPrefixToInclude } from './has_prefix_to_include'; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/async_search_service.ts b/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/async_search_service.ts deleted file mode 100644 index 89fcda926d547..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/async_search_service.ts +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license 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 'src/core/server'; -import { chunk } from 'lodash'; -import type { SearchServiceParams } from '../../../../common/search_strategies/correlations/types'; -import type { ApmIndicesConfig } from '../../settings/apm_indices/get_apm_indices'; -import { asyncSearchServiceLogProvider } from '../correlations/async_search_service_log'; -import { asyncErrorCorrelationsSearchServiceStateProvider } from './async_search_service_state'; -import { fetchTransactionDurationFieldCandidates } from '../correlations/queries'; -import type { SearchServiceFetchParams } from '../../../../common/search_strategies/correlations/types'; -import { fetchFailedTransactionsCorrelationPValues } from './queries/query_failure_correlation'; -import { ERROR_CORRELATION_THRESHOLD } from './constants'; -import { EVENT_OUTCOME } from '../../../../common/elasticsearch_fieldnames'; - -export const asyncErrorCorrelationSearchServiceProvider = ( - esClient: ElasticsearchClient, - getApmIndices: () => Promise, - searchServiceParams: SearchServiceParams, - includeFrozen: boolean -) => { - const { addLogMessage, getLogMessages } = asyncSearchServiceLogProvider(); - - const state = asyncErrorCorrelationsSearchServiceStateProvider(); - - async function fetchErrorCorrelations() { - try { - const indices = await getApmIndices(); - const params: SearchServiceFetchParams = { - ...searchServiceParams, - index: indices['apm_oss.transactionIndices'], - includeFrozen, - }; - - const { - fieldCandidates: candidates, - } = await fetchTransactionDurationFieldCandidates(esClient, params); - - const fieldCandidates = candidates.filter((t) => !(t === EVENT_OUTCOME)); - - addLogMessage(`Identified ${fieldCandidates.length} fieldCandidates.`); - - state.setProgress({ loadedFieldCandidates: 1 }); - - let fieldCandidatesFetchedCount = 0; - if (params !== undefined && fieldCandidates.length > 0) { - const batches = chunk(fieldCandidates, 10); - for (let i = 0; i < batches.length; i++) { - try { - const results = await Promise.allSettled( - batches[i].map((fieldName) => - fetchFailedTransactionsCorrelationPValues( - esClient, - params, - fieldName - ) - ) - ); - - results.forEach((result, idx) => { - if (result.status === 'fulfilled') { - state.addValues( - result.value.filter( - (record) => - record && - typeof record.pValue === 'number' && - record.pValue < ERROR_CORRELATION_THRESHOLD - ) - ); - } else { - // If one of the fields in the batch had an error - addLogMessage( - `Error getting error correlation for field ${batches[i][idx]}: ${result.reason}.` - ); - } - }); - } catch (e) { - state.setError(e); - - if (params?.index.includes(':')) { - state.setCcsWarning(true); - } - } finally { - fieldCandidatesFetchedCount += batches[i].length; - state.setProgress({ - loadedErrorCorrelations: - fieldCandidatesFetchedCount / fieldCandidates.length, - }); - } - } - - addLogMessage( - `Identified correlations for ${fieldCandidatesFetchedCount} fields out of ${fieldCandidates.length} candidates.` - ); - } - } catch (e) { - state.setError(e); - } - - addLogMessage( - `Identified ${ - state.getState().values.length - } significant correlations relating to failed transactions.` - ); - - state.setIsRunning(false); - } - - fetchErrorCorrelations(); - - return () => { - const { ccsWarning, error, isRunning, progress } = state.getState(); - - return { - ccsWarning, - error, - log: getLogMessages(), - isRunning, - loaded: Math.round(state.getOverallProgress() * 100), - started: progress.started, - total: 100, - values: state.getValuesSortedByScore(), - cancel: () => { - addLogMessage(`Service cancelled.`); - state.setIsCancelled(true); - }, - }; - }; -}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/async_search_service_state.ts b/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/async_search_service_state.ts deleted file mode 100644 index fb0c6fea4879a..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/async_search_service_state.ts +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FailedTransactionsCorrelationValue } from '../../../../common/search_strategies/failure_correlations/types'; - -interface Progress { - started: number; - loadedFieldCandidates: number; - loadedErrorCorrelations: number; -} -export const asyncErrorCorrelationsSearchServiceStateProvider = () => { - let ccsWarning = false; - function setCcsWarning(d: boolean) { - ccsWarning = d; - } - - let error: Error; - function setError(d: Error) { - error = d; - } - - let isCancelled = false; - function setIsCancelled(d: boolean) { - isCancelled = d; - } - - let isRunning = true; - function setIsRunning(d: boolean) { - isRunning = d; - } - - let progress: Progress = { - started: Date.now(), - loadedFieldCandidates: 0, - loadedErrorCorrelations: 0, - }; - function getOverallProgress() { - return ( - progress.loadedFieldCandidates * 0.025 + - progress.loadedErrorCorrelations * (1 - 0.025) - ); - } - function setProgress(d: Partial>) { - progress = { - ...progress, - ...d, - }; - } - - const values: FailedTransactionsCorrelationValue[] = []; - function addValue(d: FailedTransactionsCorrelationValue) { - values.push(d); - } - function addValues(d: FailedTransactionsCorrelationValue[]) { - values.push(...d); - } - - function getValuesSortedByScore() { - return values.sort((a, b) => b.score - a.score); - } - - function getState() { - return { - ccsWarning, - error, - isCancelled, - isRunning, - progress, - values, - }; - } - - return { - addValue, - addValues, - getOverallProgress, - getState, - getValuesSortedByScore, - setCcsWarning, - setError, - setIsCancelled, - setIsRunning, - setProgress, - }; -}; - -export type AsyncSearchServiceState = ReturnType< - typeof asyncErrorCorrelationsSearchServiceStateProvider ->; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/constants.ts b/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/constants.ts deleted file mode 100644 index 711c5f736d774..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/constants.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 const ERROR_CORRELATION_THRESHOLD = 0.02; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/failed_transactions_correlations_search_service.ts b/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/failed_transactions_correlations_search_service.ts new file mode 100644 index 0000000000000..a089c5043f9a3 --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/failed_transactions_correlations_search_service.ts @@ -0,0 +1,234 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { chunk } from 'lodash'; + +import type { ElasticsearchClient } from 'src/core/server'; + +import type { ISearchStrategy } from '../../../../../../../src/plugins/data/server'; +import { + IKibanaSearchRequest, + IKibanaSearchResponse, +} from '../../../../../../../src/plugins/data/common'; + +import { EVENT_OUTCOME } from '../../../../common/elasticsearch_fieldnames'; +import { EventOutcome } from '../../../../common/event_outcome'; +import type { SearchStrategyServerParams } from '../../../../common/search_strategies/types'; +import type { + FailedTransactionsCorrelationsRequestParams, + FailedTransactionsCorrelationsRawResponse, +} from '../../../../common/search_strategies/failed_transactions_correlations/types'; +import type { ApmIndicesConfig } from '../../settings/apm_indices/get_apm_indices'; +import { searchServiceLogProvider } from '../search_service_log'; +import { + fetchFailedTransactionsCorrelationPValues, + fetchTransactionDurationFieldCandidates, + fetchTransactionDurationPercentiles, + fetchTransactionDurationRanges, + fetchTransactionDurationHistogramRangeSteps, +} from '../queries'; +import type { SearchServiceProvider } from '../search_strategy_provider'; + +import { failedTransactionsCorrelationsSearchServiceStateProvider } from './failed_transactions_correlations_search_service_state'; + +import { ERROR_CORRELATION_THRESHOLD } from '../constants'; + +export type FailedTransactionsCorrelationsSearchServiceProvider = SearchServiceProvider< + FailedTransactionsCorrelationsRequestParams, + FailedTransactionsCorrelationsRawResponse +>; + +export type FailedTransactionsCorrelationsSearchStrategy = ISearchStrategy< + IKibanaSearchRequest, + IKibanaSearchResponse +>; + +export const failedTransactionsCorrelationsSearchServiceProvider: FailedTransactionsCorrelationsSearchServiceProvider = ( + esClient: ElasticsearchClient, + getApmIndices: () => Promise, + searchServiceParams: FailedTransactionsCorrelationsRequestParams, + includeFrozen: boolean +) => { + const { addLogMessage, getLogMessages } = searchServiceLogProvider(); + + const state = failedTransactionsCorrelationsSearchServiceStateProvider(); + + async function fetchErrorCorrelations() { + try { + const indices = await getApmIndices(); + const params: FailedTransactionsCorrelationsRequestParams & + SearchStrategyServerParams = { + ...searchServiceParams, + index: indices['apm_oss.transactionIndices'], + includeFrozen, + }; + + // 95th percentile to be displayed as a marker in the log log chart + const { + totalDocs, + percentiles: percentilesResponseThresholds, + } = await fetchTransactionDurationPercentiles( + esClient, + params, + params.percentileThreshold ? [params.percentileThreshold] : undefined + ); + const percentileThresholdValue = + percentilesResponseThresholds[`${params.percentileThreshold}.0`]; + state.setPercentileThresholdValue(percentileThresholdValue); + + addLogMessage( + `Fetched ${params.percentileThreshold}th percentile value of ${percentileThresholdValue} based on ${totalDocs} documents.` + ); + + // finish early if we weren't able to identify the percentileThresholdValue. + if (percentileThresholdValue === undefined) { + addLogMessage( + `Abort service since percentileThresholdValue could not be determined.` + ); + state.setProgress({ + loadedFieldCandidates: 1, + loadedErrorCorrelations: 1, + loadedOverallHistogram: 1, + loadedFailedTransactionsCorrelations: 1, + }); + state.setIsRunning(false); + return; + } + + const histogramRangeSteps = await fetchTransactionDurationHistogramRangeSteps( + esClient, + params + ); + + const overallLogHistogramChartData = await fetchTransactionDurationRanges( + esClient, + params, + histogramRangeSteps + ); + const errorLogHistogramChartData = await fetchTransactionDurationRanges( + esClient, + params, + histogramRangeSteps, + [{ fieldName: EVENT_OUTCOME, fieldValue: EventOutcome.failure }] + ); + + state.setProgress({ loadedOverallHistogram: 1 }); + state.setErrorHistogram(errorLogHistogramChartData); + state.setOverallHistogram(overallLogHistogramChartData); + + const { + fieldCandidates: candidates, + } = await fetchTransactionDurationFieldCandidates(esClient, params); + + const fieldCandidates = candidates.filter((t) => !(t === EVENT_OUTCOME)); + + addLogMessage(`Identified ${fieldCandidates.length} fieldCandidates.`); + + state.setProgress({ loadedFieldCandidates: 1 }); + + let fieldCandidatesFetchedCount = 0; + if (params !== undefined && fieldCandidates.length > 0) { + const batches = chunk(fieldCandidates, 10); + for (let i = 0; i < batches.length; i++) { + try { + const results = await Promise.allSettled( + batches[i].map((fieldName) => + fetchFailedTransactionsCorrelationPValues( + esClient, + params, + histogramRangeSteps, + fieldName + ) + ) + ); + + results.forEach((result, idx) => { + if (result.status === 'fulfilled') { + state.addFailedTransactionsCorrelations( + result.value.filter( + (record) => + record && + typeof record.pValue === 'number' && + record.pValue < ERROR_CORRELATION_THRESHOLD + ) + ); + } else { + // If one of the fields in the batch had an error + addLogMessage( + `Error getting error correlation for field ${batches[i][idx]}: ${result.reason}.` + ); + } + }); + } catch (e) { + state.setError(e); + + if (params?.index.includes(':')) { + state.setCcsWarning(true); + } + } finally { + fieldCandidatesFetchedCount += batches[i].length; + state.setProgress({ + loadedFailedTransactionsCorrelations: + fieldCandidatesFetchedCount / fieldCandidates.length, + }); + } + } + + addLogMessage( + `Identified correlations for ${fieldCandidatesFetchedCount} fields out of ${fieldCandidates.length} candidates.` + ); + } + } catch (e) { + state.setError(e); + } + + addLogMessage( + `Identified ${ + state.getState().failedTransactionsCorrelations.length + } significant correlations relating to failed transactions.` + ); + + state.setIsRunning(false); + } + + fetchErrorCorrelations(); + + return () => { + const { + ccsWarning, + error, + isRunning, + overallHistogram, + errorHistogram, + percentileThresholdValue, + progress, + } = state.getState(); + + return { + cancel: () => { + addLogMessage(`Service cancelled.`); + state.setIsCancelled(true); + }, + error, + meta: { + loaded: Math.round(state.getOverallProgress() * 100), + total: 100, + isRunning, + isPartial: isRunning, + }, + rawResponse: { + ccsWarning, + log: getLogMessages(), + took: Date.now() - progress.started, + failedTransactionsCorrelations: state.getFailedTransactionsCorrelationsSortedByScore(), + overallHistogram, + errorHistogram, + percentileThresholdValue, + }, + }; + }; +}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/failed_transactions_correlations_search_service_state.ts b/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/failed_transactions_correlations_search_service_state.ts new file mode 100644 index 0000000000000..a2530ea8a400c --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/failed_transactions_correlations_search_service_state.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 { FailedTransactionsCorrelation } from '../../../../common/search_strategies/failed_transactions_correlations/types'; + +import type { HistogramItem } from '../../../../common/search_strategies/types'; + +interface Progress { + started: number; + loadedFieldCandidates: number; + loadedErrorCorrelations: number; + loadedOverallHistogram: number; + loadedFailedTransactionsCorrelations: number; +} + +export const failedTransactionsCorrelationsSearchServiceStateProvider = () => { + let ccsWarning = false; + function setCcsWarning(d: boolean) { + ccsWarning = d; + } + + let error: Error; + function setError(d: Error) { + error = d; + } + + let isCancelled = false; + function setIsCancelled(d: boolean) { + isCancelled = d; + } + + let isRunning = true; + function setIsRunning(d: boolean) { + isRunning = d; + } + + let errorHistogram: HistogramItem[] | undefined; + function setErrorHistogram(d: HistogramItem[]) { + errorHistogram = d; + } + + let overallHistogram: HistogramItem[] | undefined; + function setOverallHistogram(d: HistogramItem[]) { + overallHistogram = d; + } + + let percentileThresholdValue: number; + function setPercentileThresholdValue(d: number) { + percentileThresholdValue = d; + } + + let progress: Progress = { + started: Date.now(), + loadedFieldCandidates: 0, + loadedErrorCorrelations: 0, + loadedOverallHistogram: 0, + loadedFailedTransactionsCorrelations: 0, + }; + function getOverallProgress() { + return ( + progress.loadedFieldCandidates * 0.025 + + progress.loadedFailedTransactionsCorrelations * (1 - 0.025) + ); + } + function setProgress(d: Partial>) { + progress = { + ...progress, + ...d, + }; + } + + const failedTransactionsCorrelations: FailedTransactionsCorrelation[] = []; + function addFailedTransactionsCorrelation(d: FailedTransactionsCorrelation) { + failedTransactionsCorrelations.push(d); + } + function addFailedTransactionsCorrelations( + d: FailedTransactionsCorrelation[] + ) { + failedTransactionsCorrelations.push(...d); + } + + function getFailedTransactionsCorrelationsSortedByScore() { + return failedTransactionsCorrelations.sort((a, b) => b.score - a.score); + } + + function getState() { + return { + ccsWarning, + error, + isCancelled, + isRunning, + overallHistogram, + errorHistogram, + percentileThresholdValue, + progress, + failedTransactionsCorrelations, + }; + } + + return { + addFailedTransactionsCorrelation, + addFailedTransactionsCorrelations, + getOverallProgress, + getState, + getFailedTransactionsCorrelationsSortedByScore, + setCcsWarning, + setError, + setIsCancelled, + setIsRunning, + setOverallHistogram, + setErrorHistogram, + setPercentileThresholdValue, + setProgress, + }; +}; + +export type FailedTransactionsCorrelationsSearchServiceState = ReturnType< + typeof failedTransactionsCorrelationsSearchServiceStateProvider +>; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/index.ts b/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/index.ts index f7e24ac6e1335..ec91165cb481b 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/index.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/index.ts @@ -5,5 +5,8 @@ * 2.0. */ -export { apmFailedTransactionsCorrelationsSearchStrategyProvider } from './search_strategy'; -export { FAILED_TRANSACTIONS_CORRELATION_SEARCH_STRATEGY } from '../../../../common/search_strategies/failure_correlations/constants'; +export { + failedTransactionsCorrelationsSearchServiceProvider, + FailedTransactionsCorrelationsSearchServiceProvider, + FailedTransactionsCorrelationsSearchStrategy, +} from './failed_transactions_correlations_search_service'; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/queries/query_failure_correlation.ts b/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/queries/query_failure_correlation.ts deleted file mode 100644 index 81fe6697d1fb1..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/queries/query_failure_correlation.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 { estypes } from '@elastic/elasticsearch'; -import { ElasticsearchClient } from 'kibana/server'; -import { SearchServiceFetchParams } from '../../../../../common/search_strategies/correlations/types'; -import { - getQueryWithParams, - getTermsQuery, -} from '../../correlations/queries/get_query_with_params'; -import { getRequestBase } from '../../correlations/queries/get_request_base'; -import { EVENT_OUTCOME } from '../../../../../common/elasticsearch_fieldnames'; -import { EventOutcome } from '../../../../../common/event_outcome'; - -export const getFailureCorrelationRequest = ( - params: SearchServiceFetchParams, - fieldName: string -): estypes.SearchRequest => { - const query = getQueryWithParams({ - params, - }); - - const queryWithFailure = { - ...query, - bool: { - ...query.bool, - filter: [ - ...query.bool.filter, - ...getTermsQuery(EVENT_OUTCOME, EventOutcome.failure), - ], - }, - }; - - const body = { - query: queryWithFailure, - size: 0, - aggs: { - failure_p_value: { - significant_terms: { - field: fieldName, - background_filter: { - // Important to have same query as above here - // without it, we would be comparing sets of different filtered elements - ...query, - }, - // No need to have must_not "event.outcome": "failure" clause - // if background_is_superset is set to true - p_value: { background_is_superset: true }, - }, - }, - }, - }; - - return { - ...getRequestBase(params), - body, - }; -}; - -export const fetchFailedTransactionsCorrelationPValues = async ( - esClient: ElasticsearchClient, - params: SearchServiceFetchParams, - fieldName: string -) => { - const resp = await esClient.search( - getFailureCorrelationRequest(params, fieldName) - ); - - if (resp.body.aggregations === undefined) { - throw new Error( - 'fetchErrorCorrelation failed, did not return aggregations.' - ); - } - - const overallResult = resp.body.aggregations - .failure_p_value as estypes.AggregationsSignificantTermsAggregate<{ - key: string; - doc_count: number; - bg_count: number; - score: number; - }>; - const result = overallResult.buckets.map((bucket) => { - const score = bucket.score; - - // Scale the score into a value from 0 - 1 - // using a concave piecewise linear function in -log(p-value) - const normalizedScore = - 0.5 * Math.min(Math.max((score - 3.912) / 2.995, 0), 1) + - 0.25 * Math.min(Math.max((score - 6.908) / 6.908, 0), 1) + - 0.25 * Math.min(Math.max((score - 13.816) / 101.314, 0), 1); - - return { - ...bucket, - fieldName, - fieldValue: bucket.key, - pValue: Math.exp(-score), - normalizedScore, - // Percentage of time the term appears in failed transactions - failurePercentage: bucket.doc_count / overallResult.doc_count, - // Percentage of time the term appears in successful transactions - successPercentage: - (bucket.bg_count - bucket.doc_count) / - (overallResult.bg_count - overallResult.doc_count), - }; - }); - - return result; -}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/search_strategy.ts b/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/search_strategy.ts deleted file mode 100644 index 415f19e892741..0000000000000 --- a/x-pack/plugins/apm/server/lib/search_strategies/failed_transactions_correlations/search_strategy.ts +++ /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 uuid from 'uuid'; -import { of } from 'rxjs'; - -import type { ISearchStrategy } from '../../../../../../../src/plugins/data/server'; -import { - IKibanaSearchRequest, - IKibanaSearchResponse, -} from '../../../../../../../src/plugins/data/common'; - -import type { SearchServiceParams } from '../../../../common/search_strategies/correlations/types'; -import type { ApmIndicesConfig } from '../../settings/apm_indices/get_apm_indices'; - -import { asyncErrorCorrelationSearchServiceProvider } from './async_search_service'; -import { FailedTransactionsCorrelationValue } from '../../../../common/search_strategies/failure_correlations/types'; - -export type PartialSearchRequest = IKibanaSearchRequest; -export type PartialSearchResponse = IKibanaSearchResponse<{ - values: FailedTransactionsCorrelationValue[]; -}>; - -export const apmFailedTransactionsCorrelationsSearchStrategyProvider = ( - getApmIndices: () => Promise, - includeFrozen: boolean -): ISearchStrategy => { - const asyncSearchServiceMap = new Map< - string, - ReturnType - >(); - - return { - search: (request, options, deps) => { - if (request.params === undefined) { - throw new Error('Invalid request parameters.'); - } - - // The function to fetch the current state of the async search service. - // This will be either an existing service for a follow up fetch or a new one for new requests. - let getAsyncSearchServiceState: ReturnType< - typeof asyncErrorCorrelationSearchServiceProvider - >; - - // If the request includes an ID, we require that the async search service already exists - // otherwise we throw an error. The client should never poll a service that's been cancelled or finished. - // This also avoids instantiating async search services when the service gets called with random IDs. - if (typeof request.id === 'string') { - const existingGetAsyncSearchServiceState = asyncSearchServiceMap.get( - request.id - ); - - if (typeof existingGetAsyncSearchServiceState === 'undefined') { - throw new Error( - `AsyncSearchService with ID '${request.id}' does not exist.` - ); - } - - getAsyncSearchServiceState = existingGetAsyncSearchServiceState; - } else { - getAsyncSearchServiceState = asyncErrorCorrelationSearchServiceProvider( - deps.esClient.asCurrentUser, - getApmIndices, - request.params, - includeFrozen - ); - } - - // Reuse the request's id or create a new one. - const id = request.id ?? uuid(); - - const { - ccsWarning, - error, - log, - isRunning, - loaded, - started, - total, - values, - } = getAsyncSearchServiceState(); - - if (error instanceof Error) { - asyncSearchServiceMap.delete(id); - throw error; - } else if (isRunning) { - asyncSearchServiceMap.set(id, getAsyncSearchServiceState); - } else { - asyncSearchServiceMap.delete(id); - } - - const took = Date.now() - started; - - return of({ - id, - loaded, - total, - isRunning, - isPartial: isRunning, - rawResponse: { - ccsWarning, - log, - took, - values, - }, - }); - }, - cancel: async (id, options, deps) => { - const getAsyncSearchServiceState = asyncSearchServiceMap.get(id); - if (getAsyncSearchServiceState !== undefined) { - getAsyncSearchServiceState().cancel(); - asyncSearchServiceMap.delete(id); - } - }, - }; -}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/index.ts b/x-pack/plugins/apm/server/lib/search_strategies/index.ts new file mode 100644 index 0000000000000..b4668138eefab --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/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 { registerSearchStrategies } from './register_search_strategies'; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/latency_correlations/index.ts b/x-pack/plugins/apm/server/lib/search_strategies/latency_correlations/index.ts new file mode 100644 index 0000000000000..073bb122896ff --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/latency_correlations/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 { + latencyCorrelationsSearchServiceProvider, + LatencyCorrelationsSearchServiceProvider, + LatencyCorrelationsSearchStrategy, +} from './latency_correlations_search_service'; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/latency_correlations/latency_correlations_search_service.ts b/x-pack/plugins/apm/server/lib/search_strategies/latency_correlations/latency_correlations_search_service.ts new file mode 100644 index 0000000000000..9344b354808be --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/latency_correlations/latency_correlations_search_service.ts @@ -0,0 +1,279 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 type { ElasticsearchClient } from 'src/core/server'; + +import type { ISearchStrategy } from '../../../../../../../src/plugins/data/server'; +import { + IKibanaSearchRequest, + IKibanaSearchResponse, +} from '../../../../../../../src/plugins/data/common'; + +import type { SearchStrategyServerParams } from '../../../../common/search_strategies/types'; +import type { + LatencyCorrelationsRequestParams, + LatencyCorrelationsRawResponse, +} from '../../../../common/search_strategies/latency_correlations/types'; + +import type { ApmIndicesConfig } from '../../settings/apm_indices/get_apm_indices'; + +import { + fetchTransactionDurationFieldCandidates, + fetchTransactionDurationFieldValuePairs, + fetchTransactionDurationFractions, + fetchTransactionDurationPercentiles, + fetchTransactionDurationHistograms, + fetchTransactionDurationHistogramRangeSteps, + fetchTransactionDurationRanges, +} from '../queries'; +import { computeExpectationsAndRanges } from '../utils'; +import { searchServiceLogProvider } from '../search_service_log'; +import type { SearchServiceProvider } from '../search_strategy_provider'; + +import { latencyCorrelationsSearchServiceStateProvider } from './latency_correlations_search_service_state'; + +export type LatencyCorrelationsSearchServiceProvider = SearchServiceProvider< + LatencyCorrelationsRequestParams, + LatencyCorrelationsRawResponse +>; + +export type LatencyCorrelationsSearchStrategy = ISearchStrategy< + IKibanaSearchRequest, + IKibanaSearchResponse +>; + +export const latencyCorrelationsSearchServiceProvider: LatencyCorrelationsSearchServiceProvider = ( + esClient: ElasticsearchClient, + getApmIndices: () => Promise, + searchServiceParams: LatencyCorrelationsRequestParams, + includeFrozen: boolean +) => { + const { addLogMessage, getLogMessages } = searchServiceLogProvider(); + + const state = latencyCorrelationsSearchServiceStateProvider(); + + async function fetchCorrelations() { + let params: + | (LatencyCorrelationsRequestParams & SearchStrategyServerParams) + | undefined; + + try { + const indices = await getApmIndices(); + params = { + ...searchServiceParams, + index: indices['apm_oss.transactionIndices'], + includeFrozen, + }; + + // 95th percentile to be displayed as a marker in the log log chart + const { + totalDocs, + percentiles: percentilesResponseThresholds, + } = await fetchTransactionDurationPercentiles( + esClient, + params, + params.percentileThreshold ? [params.percentileThreshold] : undefined + ); + const percentileThresholdValue = + percentilesResponseThresholds[`${params.percentileThreshold}.0`]; + state.setPercentileThresholdValue(percentileThresholdValue); + + addLogMessage( + `Fetched ${params.percentileThreshold}th percentile value of ${percentileThresholdValue} based on ${totalDocs} documents.` + ); + + // finish early if we weren't able to identify the percentileThresholdValue. + if (percentileThresholdValue === undefined) { + addLogMessage( + `Abort service since percentileThresholdValue could not be determined.` + ); + state.setProgress({ + loadedHistogramStepsize: 1, + loadedOverallHistogram: 1, + loadedFieldCandidates: 1, + loadedFieldValuePairs: 1, + loadedHistograms: 1, + }); + state.setIsRunning(false); + return; + } + + const histogramRangeSteps = await fetchTransactionDurationHistogramRangeSteps( + esClient, + params + ); + state.setProgress({ loadedHistogramStepsize: 1 }); + + addLogMessage(`Loaded histogram range steps.`); + + if (state.getIsCancelled()) { + state.setIsRunning(false); + return; + } + + const overallLogHistogramChartData = await fetchTransactionDurationRanges( + esClient, + params, + histogramRangeSteps + ); + state.setProgress({ loadedOverallHistogram: 1 }); + state.setOverallHistogram(overallLogHistogramChartData); + + addLogMessage(`Loaded overall histogram chart data.`); + + if (state.getIsCancelled()) { + state.setIsRunning(false); + return; + } + + // finish early if correlation analysis is not required. + if (params.analyzeCorrelations === false) { + addLogMessage( + `Finish service since correlation analysis wasn't requested.` + ); + state.setProgress({ + loadedHistogramStepsize: 1, + loadedOverallHistogram: 1, + loadedFieldCandidates: 1, + loadedFieldValuePairs: 1, + loadedHistograms: 1, + }); + state.setIsRunning(false); + return; + } + + // Create an array of ranges [2, 4, 6, ..., 98] + const percentileAggregationPercents = range(2, 100, 2); + const { + percentiles: percentilesRecords, + } = await fetchTransactionDurationPercentiles( + esClient, + params, + percentileAggregationPercents + ); + const percentiles = Object.values(percentilesRecords); + + addLogMessage(`Loaded percentiles.`); + + if (state.getIsCancelled()) { + state.setIsRunning(false); + return; + } + + const { fieldCandidates } = await fetchTransactionDurationFieldCandidates( + esClient, + params + ); + + addLogMessage(`Identified ${fieldCandidates.length} fieldCandidates.`); + + state.setProgress({ loadedFieldCandidates: 1 }); + + const fieldValuePairs = await fetchTransactionDurationFieldValuePairs( + esClient, + params, + fieldCandidates, + state, + addLogMessage + ); + + addLogMessage(`Identified ${fieldValuePairs.length} fieldValuePairs.`); + + if (state.getIsCancelled()) { + state.setIsRunning(false); + return; + } + + const { expectations, ranges } = computeExpectationsAndRanges( + percentiles + ); + + const { + fractions, + totalDocCount, + } = await fetchTransactionDurationFractions(esClient, params, ranges); + + addLogMessage(`Loaded fractions and totalDocCount of ${totalDocCount}.`); + + let loadedHistograms = 0; + for await (const item of fetchTransactionDurationHistograms( + esClient, + addLogMessage, + params, + state, + expectations, + ranges, + fractions, + histogramRangeSteps, + totalDocCount, + fieldValuePairs + )) { + if (item !== undefined) { + state.addLatencyCorrelation(item); + } + loadedHistograms++; + state.setProgress({ + loadedHistograms: loadedHistograms / fieldValuePairs.length, + }); + } + + addLogMessage( + `Identified ${ + state.getState().latencyCorrelations.length + } significant correlations out of ${ + fieldValuePairs.length + } field/value pairs.` + ); + } catch (e) { + state.setError(e); + } + + if (state.getState().error !== undefined && params?.index.includes(':')) { + state.setCcsWarning(true); + } + + state.setIsRunning(false); + } + + function cancel() { + addLogMessage(`Service cancelled.`); + state.setIsCancelled(true); + } + + fetchCorrelations(); + + return () => { + const { + ccsWarning, + error, + isRunning, + overallHistogram, + percentileThresholdValue, + progress, + } = state.getState(); + + return { + cancel, + error, + meta: { + loaded: Math.round(state.getOverallProgress() * 100), + total: 100, + isRunning, + isPartial: isRunning, + }, + rawResponse: { + ccsWarning, + log: getLogMessages(), + took: Date.now() - progress.started, + latencyCorrelations: state.getLatencyCorrelationsSortedByCorrelation(), + percentileThresholdValue, + overallHistogram, + }, + }; + }; +}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/latency_correlations/latency_correlations_search_service_state.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/latency_correlations/latency_correlations_search_service_state.test.ts new file mode 100644 index 0000000000000..ce9014004f4b0 --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/latency_correlations/latency_correlations_search_service_state.test.ts @@ -0,0 +1,62 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { latencyCorrelationsSearchServiceStateProvider } from './latency_correlations_search_service_state'; + +describe('search service', () => { + describe('latencyCorrelationsSearchServiceStateProvider', () => { + it('initializes with default state', () => { + const state = latencyCorrelationsSearchServiceStateProvider(); + const defaultState = state.getState(); + const defaultProgress = state.getOverallProgress(); + + expect(defaultState.ccsWarning).toBe(false); + expect(defaultState.error).toBe(undefined); + expect(defaultState.isCancelled).toBe(false); + expect(defaultState.isRunning).toBe(true); + expect(defaultState.overallHistogram).toBe(undefined); + expect(defaultState.progress.loadedFieldCandidates).toBe(0); + expect(defaultState.progress.loadedFieldValuePairs).toBe(0); + expect(defaultState.progress.loadedHistogramStepsize).toBe(0); + expect(defaultState.progress.loadedHistograms).toBe(0); + expect(defaultState.progress.loadedOverallHistogram).toBe(0); + expect(defaultState.progress.started > 0).toBe(true); + + expect(defaultProgress).toBe(0); + }); + + it('returns updated state', () => { + const state = latencyCorrelationsSearchServiceStateProvider(); + + state.setCcsWarning(true); + state.setError(new Error('the-error-message')); + state.setIsCancelled(true); + state.setIsRunning(false); + state.setOverallHistogram([{ key: 1392202800000, doc_count: 1234 }]); + state.setProgress({ loadedHistograms: 0.5 }); + + const updatedState = state.getState(); + const updatedProgress = state.getOverallProgress(); + + expect(updatedState.ccsWarning).toBe(true); + expect(updatedState.error?.message).toBe('the-error-message'); + expect(updatedState.isCancelled).toBe(true); + expect(updatedState.isRunning).toBe(false); + expect(updatedState.overallHistogram).toEqual([ + { key: 1392202800000, doc_count: 1234 }, + ]); + expect(updatedState.progress.loadedFieldCandidates).toBe(0); + expect(updatedState.progress.loadedFieldValuePairs).toBe(0); + expect(updatedState.progress.loadedHistogramStepsize).toBe(0); + expect(updatedState.progress.loadedHistograms).toBe(0.5); + expect(updatedState.progress.loadedOverallHistogram).toBe(0); + expect(updatedState.progress.started > 0).toBe(true); + + expect(updatedProgress).toBe(0.45); + }); + }); +}); diff --git a/x-pack/plugins/apm/server/lib/search_strategies/latency_correlations/latency_correlations_search_service_state.ts b/x-pack/plugins/apm/server/lib/search_strategies/latency_correlations/latency_correlations_search_service_state.ts new file mode 100644 index 0000000000000..53f357ed1135f --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/latency_correlations/latency_correlations_search_service_state.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 type { HistogramItem } from '../../../../common/search_strategies/types'; +import type { + LatencyCorrelationSearchServiceProgress, + LatencyCorrelation, +} from '../../../../common/search_strategies/latency_correlations/types'; + +export const latencyCorrelationsSearchServiceStateProvider = () => { + let ccsWarning = false; + function setCcsWarning(d: boolean) { + ccsWarning = d; + } + + let error: Error; + function setError(d: Error) { + error = d; + } + + let isCancelled = false; + function getIsCancelled() { + return isCancelled; + } + function setIsCancelled(d: boolean) { + isCancelled = d; + } + + let isRunning = true; + function setIsRunning(d: boolean) { + isRunning = d; + } + + let overallHistogram: HistogramItem[] | undefined; + function setOverallHistogram(d: HistogramItem[]) { + overallHistogram = d; + } + + let percentileThresholdValue: number; + function setPercentileThresholdValue(d: number) { + percentileThresholdValue = d; + } + + let progress: LatencyCorrelationSearchServiceProgress = { + started: Date.now(), + loadedHistogramStepsize: 0, + loadedOverallHistogram: 0, + loadedFieldCandidates: 0, + loadedFieldValuePairs: 0, + loadedHistograms: 0, + }; + function getOverallProgress() { + return ( + progress.loadedHistogramStepsize * 0.025 + + progress.loadedOverallHistogram * 0.025 + + progress.loadedFieldCandidates * 0.025 + + progress.loadedFieldValuePairs * 0.025 + + progress.loadedHistograms * 0.9 + ); + } + function setProgress( + d: Partial> + ) { + progress = { + ...progress, + ...d, + }; + } + + const latencyCorrelations: LatencyCorrelation[] = []; + function addLatencyCorrelation(d: LatencyCorrelation) { + latencyCorrelations.push(d); + } + + function getLatencyCorrelationsSortedByCorrelation() { + return latencyCorrelations.sort((a, b) => b.correlation - a.correlation); + } + + function getState() { + return { + ccsWarning, + error, + isCancelled, + isRunning, + overallHistogram, + percentileThresholdValue, + progress, + latencyCorrelations, + }; + } + + return { + addLatencyCorrelation, + getIsCancelled, + getOverallProgress, + getState, + getLatencyCorrelationsSortedByCorrelation, + setCcsWarning, + setError, + setIsCancelled, + setIsRunning, + setOverallHistogram, + setPercentileThresholdValue, + setProgress, + }; +}; + +export type LatencyCorrelationsSearchServiceState = ReturnType< + typeof latencyCorrelationsSearchServiceStateProvider +>; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/queries/get_prioritized_field_value_pairs.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/get_prioritized_field_value_pairs.test.ts new file mode 100644 index 0000000000000..cb1500e70babc --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/get_prioritized_field_value_pairs.test.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 { getPrioritizedFieldValuePairs } from './get_prioritized_field_value_pairs'; + +describe('correlations', () => { + describe('getPrioritizedFieldValuePairs', () => { + it('returns fields without prioritization in the same order', () => { + const fieldValuePairs = [ + { fieldName: 'the-field-1', fieldValue: 'the-value-1' }, + { fieldName: 'the-field-2', fieldValue: 'the-value-2' }, + ]; + const prioritziedFieldValuePairs = getPrioritizedFieldValuePairs( + fieldValuePairs + ); + expect(prioritziedFieldValuePairs.map((d) => d.fieldName)).toEqual([ + 'the-field-1', + 'the-field-2', + ]); + }); + + it('returns fields with already sorted prioritization in the same order', () => { + const fieldValuePairs = [ + { fieldName: 'service.version', fieldValue: 'the-value-1' }, + { fieldName: 'the-field-2', fieldValue: 'the-value-2' }, + ]; + const prioritziedFieldValuePairs = getPrioritizedFieldValuePairs( + fieldValuePairs + ); + expect(prioritziedFieldValuePairs.map((d) => d.fieldName)).toEqual([ + 'service.version', + 'the-field-2', + ]); + }); + + it('returns fields with unsorted prioritization in the corrected order', () => { + const fieldValuePairs = [ + { fieldName: 'the-field-1', fieldValue: 'the-value-1' }, + { fieldName: 'service.version', fieldValue: 'the-value-2' }, + ]; + const prioritziedFieldValuePairs = getPrioritizedFieldValuePairs( + fieldValuePairs + ); + expect(prioritziedFieldValuePairs.map((d) => d.fieldName)).toEqual([ + 'service.version', + 'the-field-1', + ]); + }); + + it('considers prefixes when sorting', () => { + const fieldValuePairs = [ + { fieldName: 'the-field-1', fieldValue: 'the-value-1' }, + { fieldName: 'service.version', fieldValue: 'the-value-2' }, + { fieldName: 'cloud.the-field-3', fieldValue: 'the-value-3' }, + ]; + const prioritziedFieldValuePairs = getPrioritizedFieldValuePairs( + fieldValuePairs + ); + expect(prioritziedFieldValuePairs.map((d) => d.fieldName)).toEqual([ + 'service.version', + 'cloud.the-field-3', + 'the-field-1', + ]); + }); + }); +}); diff --git a/x-pack/plugins/apm/server/lib/search_strategies/queries/get_prioritized_field_value_pairs.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/get_prioritized_field_value_pairs.ts new file mode 100644 index 0000000000000..6338422b022da --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/get_prioritized_field_value_pairs.ts @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FIELDS_TO_ADD_AS_CANDIDATE } from '../constants'; +import { hasPrefixToInclude } from '../utils'; + +import type { FieldValuePair } from '../../../../common/search_strategies/types'; + +export const getPrioritizedFieldValuePairs = ( + fieldValuePairs: FieldValuePair[] +) => { + const prioritizedFields = [...FIELDS_TO_ADD_AS_CANDIDATE]; + + return fieldValuePairs.sort((a, b) => { + const hasPrefixA = hasPrefixToInclude(a.fieldName); + const hasPrefixB = hasPrefixToInclude(b.fieldName); + + const includesA = prioritizedFields.includes(a.fieldName); + const includesB = prioritizedFields.includes(b.fieldName); + + if ((includesA || hasPrefixA) && !includesB && !hasPrefixB) { + return -1; + } else if (!includesA && !hasPrefixA && (includesB || hasPrefixB)) { + return 1; + } + + return 0; + }); +}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_query_with_params.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/get_query_with_params.test.ts similarity index 93% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_query_with_params.test.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/get_query_with_params.test.ts index 3be3438b2d18f..c77b4df78f865 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_query_with_params.test.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/get_query_with_params.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; +import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { getQueryWithParams } from './get_query_with_params'; describe('correlations', () => { @@ -99,8 +99,12 @@ describe('correlations', () => { environment: ENVIRONMENT_ALL.value, kuery: '', }, - fieldName: 'actualFieldName', - fieldValue: 'actualFieldValue', + termFilters: [ + { + fieldName: 'actualFieldName', + fieldValue: 'actualFieldValue', + }, + ], }); expect(query).toEqual({ bool: { diff --git a/x-pack/plugins/apm/server/lib/search_strategies/queries/get_query_with_params.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/get_query_with_params.ts new file mode 100644 index 0000000000000..4fed34f58d675 --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/get_query_with_params.ts @@ -0,0 +1,65 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { estypes } from '@elastic/elasticsearch'; +import { getOrElse } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import * as t from 'io-ts'; +import { failure } from 'io-ts/lib/PathReporter'; +import type { + FieldValuePair, + SearchStrategyParams, +} from '../../../../common/search_strategies/types'; +import { rangeRt } from '../../../routes/default_api_types'; +import { getCorrelationsFilters } from '../../correlations/get_filters'; +import { Setup, SetupTimeRange } from '../../helpers/setup_request'; + +export const getTermsQuery = ({ fieldName, fieldValue }: FieldValuePair) => { + return { term: { [fieldName]: fieldValue } }; +}; + +interface QueryParams { + params: SearchStrategyParams; + termFilters?: FieldValuePair[]; +} +export const getQueryWithParams = ({ params, termFilters }: QueryParams) => { + const { + environment, + kuery, + serviceName, + start, + end, + transactionType, + transactionName, + } = params; + + // converts string based start/end to epochmillis + const setup = pipe( + rangeRt.decode({ start, end }), + getOrElse((errors) => { + throw new Error(failure(errors).join('\n')); + }) + ) as Setup & SetupTimeRange; + + const correlationFilters = getCorrelationsFilters({ + setup, + environment, + kuery, + serviceName, + transactionType, + transactionName, + }); + + return { + bool: { + filter: [ + ...correlationFilters, + ...(Array.isArray(termFilters) ? termFilters.map(getTermsQuery) : []), + ] as estypes.QueryDslQueryContainer[], + }, + }; +}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_request_base.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/get_request_base.test.ts similarity index 92% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_request_base.test.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/get_request_base.test.ts index b95db6d2691f1..fd5f52207d4c5 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_request_base.test.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/get_request_base.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; +import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { getRequestBase } from './get_request_base'; describe('correlations', () => { diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_request_base.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/get_request_base.ts similarity index 76% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_request_base.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/get_request_base.ts index e2cdbab830e0d..fb1639b5d5f4a 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/get_request_base.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/get_request_base.ts @@ -5,12 +5,12 @@ * 2.0. */ -import type { SearchServiceFetchParams } from '../../../../../common/search_strategies/correlations/types'; +import type { SearchStrategyParams } from '../../../../common/search_strategies/types'; export const getRequestBase = ({ index, includeFrozen, -}: SearchServiceFetchParams) => ({ +}: SearchStrategyParams) => ({ index, // matches APM's event client settings ignore_throttled: includeFrozen === undefined ? true : !includeFrozen, diff --git a/x-pack/plugins/apm/server/lib/search_strategies/queries/index.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/index.ts new file mode 100644 index 0000000000000..e691b81e4adcf --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { fetchFailedTransactionsCorrelationPValues } from './query_failure_correlation'; +export { fetchTransactionDurationFieldCandidates } from './query_field_candidates'; +export { fetchTransactionDurationFieldValuePairs } from './query_field_value_pairs'; +export { fetchTransactionDurationFractions } from './query_fractions'; +export { fetchTransactionDurationPercentiles } from './query_percentiles'; +export { fetchTransactionDurationCorrelation } from './query_correlation'; +export { fetchTransactionDurationHistograms } from './query_histograms_generator'; +export { fetchTransactionDurationHistogramRangeSteps } from './query_histogram_range_steps'; +export { fetchTransactionDurationRanges } from './query_ranges'; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_correlation.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_correlation.test.ts similarity index 97% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_correlation.test.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/query_correlation.test.ts index 5245af6cdadcd..d3d14260df65c 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_correlation.test.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_correlation.test.ts @@ -8,7 +8,7 @@ import type { estypes } from '@elastic/elasticsearch'; import type { ElasticsearchClient } from 'src/core/server'; -import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; +import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { fetchTransactionDurationCorrelation, diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_correlation.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_correlation.ts similarity index 81% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_correlation.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/query_correlation.ts index 823abe936e223..82913a91db16f 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_correlation.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_correlation.ts @@ -9,24 +9,16 @@ import type { estypes } from '@elastic/elasticsearch'; import type { ElasticsearchClient } from 'src/core/server'; -import { TRANSACTION_DURATION } from '../../../../../common/elasticsearch_fieldnames'; -import type { SearchServiceFetchParams } from '../../../../../common/search_strategies/correlations/types'; +import { TRANSACTION_DURATION } from '../../../../common/elasticsearch_fieldnames'; +import type { + FieldValuePair, + ResponseHit, + SearchStrategyParams, +} from '../../../../common/search_strategies/types'; import { getQueryWithParams } from './get_query_with_params'; import { getRequestBase } from './get_request_base'; -export interface HistogramItem { - key: number; - doc_count: number; -} - -interface ResponseHitSource { - [s: string]: unknown; -} -interface ResponseHit { - _source: ResponseHitSource; -} - export interface BucketCorrelation { buckets_path: string; function: { @@ -41,15 +33,14 @@ export interface BucketCorrelation { } export const getTransactionDurationCorrelationRequest = ( - params: SearchServiceFetchParams, + params: SearchStrategyParams, expectations: number[], ranges: estypes.AggregationsAggregationRange[], fractions: number[], totalDocCount: number, - fieldName?: string, - fieldValue?: string + termFilters?: FieldValuePair[] ): estypes.SearchRequest => { - const query = getQueryWithParams({ params, fieldName, fieldValue }); + const query = getQueryWithParams({ params, termFilters }); const bucketCorrelation: BucketCorrelation = { buckets_path: 'latency_ranges>_count', @@ -96,13 +87,12 @@ export const getTransactionDurationCorrelationRequest = ( export const fetchTransactionDurationCorrelation = async ( esClient: ElasticsearchClient, - params: SearchServiceFetchParams, + params: SearchStrategyParams, expectations: number[], ranges: estypes.AggregationsAggregationRange[], fractions: number[], totalDocCount: number, - fieldName?: string, - fieldValue?: string + termFilters?: FieldValuePair[] ): Promise<{ ranges: unknown[]; correlation: number | null; @@ -115,8 +105,7 @@ export const fetchTransactionDurationCorrelation = async ( ranges, fractions, totalDocCount, - fieldName, - fieldValue + termFilters ) ); diff --git a/x-pack/plugins/apm/server/lib/search_strategies/queries/query_failure_correlation.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_failure_correlation.ts new file mode 100644 index 0000000000000..4e6d37932ed88 --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_failure_correlation.ts @@ -0,0 +1,129 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { estypes } from '@elastic/elasticsearch'; +import { ElasticsearchClient } from 'kibana/server'; +import { SearchStrategyParams } from '../../../../common/search_strategies/types'; +import { EVENT_OUTCOME } from '../../../../common/elasticsearch_fieldnames'; +import { EventOutcome } from '../../../../common/event_outcome'; +import { fetchTransactionDurationRanges } from './query_ranges'; +import { getQueryWithParams, getTermsQuery } from './get_query_with_params'; +import { getRequestBase } from './get_request_base'; + +export const getFailureCorrelationRequest = ( + params: SearchStrategyParams, + fieldName: string +): estypes.SearchRequest => { + const query = getQueryWithParams({ + params, + }); + + const queryWithFailure = { + ...query, + bool: { + ...query.bool, + filter: [ + ...query.bool.filter, + ...[ + getTermsQuery({ + fieldName: EVENT_OUTCOME, + fieldValue: EventOutcome.failure, + }), + ], + ], + }, + }; + + const body = { + query: queryWithFailure, + size: 0, + aggs: { + failure_p_value: { + significant_terms: { + field: fieldName, + background_filter: { + // Important to have same query as above here + // without it, we would be comparing sets of different filtered elements + ...query, + }, + // No need to have must_not "event.outcome": "failure" clause + // if background_is_superset is set to true + p_value: { background_is_superset: true }, + }, + }, + }, + }; + + return { + ...getRequestBase(params), + body, + }; +}; + +export const fetchFailedTransactionsCorrelationPValues = async ( + esClient: ElasticsearchClient, + params: SearchStrategyParams, + histogramRangeSteps: number[], + fieldName: string +) => { + const resp = await esClient.search( + getFailureCorrelationRequest(params, fieldName) + ); + + if (resp.body.aggregations === undefined) { + throw new Error( + 'fetchErrorCorrelation failed, did not return aggregations.' + ); + } + + const overallResult = resp.body.aggregations + .failure_p_value as estypes.AggregationsSignificantTermsAggregate<{ + key: string | number; + doc_count: number; + bg_count: number; + score: number; + }>; + + // Using for of to sequentially augment the results with histogram data. + const result = []; + for (const bucket of overallResult.buckets) { + // Scale the score into a value from 0 - 1 + // using a concave piecewise linear function in -log(p-value) + const normalizedScore = + 0.5 * Math.min(Math.max((bucket.score - 3.912) / 2.995, 0), 1) + + 0.25 * Math.min(Math.max((bucket.score - 6.908) / 6.908, 0), 1) + + 0.25 * Math.min(Math.max((bucket.score - 13.816) / 101.314, 0), 1); + + const histogram = await fetchTransactionDurationRanges( + esClient, + params, + histogramRangeSteps, + [ + { fieldName: EVENT_OUTCOME, fieldValue: EventOutcome.failure }, + { fieldName, fieldValue: bucket.key }, + ] + ); + + result.push({ + fieldName, + fieldValue: bucket.key, + doc_count: bucket.doc_count, + bg_count: bucket.doc_count, + score: bucket.score, + pValue: Math.exp(-bucket.score), + normalizedScore, + // Percentage of time the term appears in failed transactions + failurePercentage: bucket.doc_count / overallResult.doc_count, + // Percentage of time the term appears in successful transactions + successPercentage: + (bucket.bg_count - bucket.doc_count) / + (overallResult.bg_count - overallResult.doc_count), + histogram, + }); + } + + return result; +}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_field_candidates.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_field_candidates.test.ts similarity index 96% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_field_candidates.test.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/query_field_candidates.test.ts index 688af72e8f6d3..150348e2a7aa2 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_field_candidates.test.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_field_candidates.test.ts @@ -8,9 +8,9 @@ import type { estypes } from '@elastic/elasticsearch'; import type { ElasticsearchClient } from 'src/core/server'; -import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; +import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; -import { hasPrefixToInclude } from '../utils/has_prefix_to_include'; +import { hasPrefixToInclude } from '../utils'; import { fetchTransactionDurationFieldCandidates, diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_field_candidates.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_field_candidates.ts similarity index 90% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_field_candidates.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/query_field_candidates.ts index aeb67a4d6884b..390243295c4f0 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_field_candidates.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_field_candidates.ts @@ -9,7 +9,7 @@ import type { estypes } from '@elastic/elasticsearch'; import type { ElasticsearchClient } from 'src/core/server'; -import type { SearchServiceFetchParams } from '../../../../../common/search_strategies/correlations/types'; +import type { SearchStrategyParams } from '../../../../common/search_strategies/types'; import { FIELD_PREFIX_TO_EXCLUDE_AS_CANDIDATE, @@ -21,7 +21,6 @@ import { hasPrefixToInclude } from '../utils'; import { getQueryWithParams } from './get_query_with_params'; import { getRequestBase } from './get_request_base'; -import type { FieldName } from './query_field_value_pairs'; export const shouldBeExcluded = (fieldName: string) => { return ( @@ -33,7 +32,7 @@ export const shouldBeExcluded = (fieldName: string) => { }; export const getRandomDocsRequest = ( - params: SearchServiceFetchParams + params: SearchStrategyParams ): estypes.SearchRequest => ({ ...getRequestBase(params), body: { @@ -52,8 +51,8 @@ export const getRandomDocsRequest = ( export const fetchTransactionDurationFieldCandidates = async ( esClient: ElasticsearchClient, - params: SearchServiceFetchParams -): Promise<{ fieldCandidates: FieldName[] }> => { + params: SearchStrategyParams +): Promise<{ fieldCandidates: string[] }> => { const { index } = params; // Get all fields with keyword mapping const respMapping = await esClient.fieldCaps({ diff --git a/x-pack/plugins/apm/server/lib/search_strategies/queries/query_field_value_pairs.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_field_value_pairs.test.ts new file mode 100644 index 0000000000000..1fff8cde5bbb3 --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_field_value_pairs.test.ts @@ -0,0 +1,91 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { estypes } from '@elastic/elasticsearch'; + +import type { ElasticsearchClient } from 'src/core/server'; +import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; + +import { searchServiceLogProvider } from '../search_service_log'; +import { latencyCorrelationsSearchServiceStateProvider } from '../latency_correlations/latency_correlations_search_service_state'; + +import { + fetchTransactionDurationFieldValuePairs, + getTermsAggRequest, +} from './query_field_value_pairs'; + +const params = { + index: 'apm-*', + start: '2020', + end: '2021', + includeFrozen: false, + environment: ENVIRONMENT_ALL.value, + kuery: '', +}; + +describe('query_field_value_pairs', () => { + describe('getTermsAggRequest', () => { + it('returns the most basic request body for a terms aggregation', () => { + const fieldName = 'myFieldName'; + const req = getTermsAggRequest(params, fieldName); + expect(req?.body?.aggs?.attribute_terms?.terms?.field).toBe(fieldName); + }); + }); + + describe('fetchTransactionDurationFieldValuePairs', () => { + it('returns field/value pairs for field candidates', async () => { + const fieldCandidates = [ + 'myFieldCandidate1', + 'myFieldCandidate2', + 'myFieldCandidate3', + ]; + + const esClientSearchMock = jest.fn((req: estypes.SearchRequest): { + body: estypes.SearchResponse; + } => { + return { + body: ({ + aggregations: { + attribute_terms: { + buckets: [{ key: 'myValue1' }, { key: 'myValue2' }], + }, + }, + } as unknown) as estypes.SearchResponse, + }; + }); + + const esClientMock = ({ + search: esClientSearchMock, + } as unknown) as ElasticsearchClient; + + const { addLogMessage, getLogMessages } = searchServiceLogProvider(); + const state = latencyCorrelationsSearchServiceStateProvider(); + + const resp = await fetchTransactionDurationFieldValuePairs( + esClientMock, + params, + fieldCandidates, + state, + addLogMessage + ); + + const { progress } = state.getState(); + + expect(progress.loadedFieldValuePairs).toBe(1); + expect(resp).toEqual([ + { fieldName: 'myFieldCandidate1', fieldValue: 'myValue1' }, + { fieldName: 'myFieldCandidate1', fieldValue: 'myValue2' }, + { fieldName: 'myFieldCandidate2', fieldValue: 'myValue1' }, + { fieldName: 'myFieldCandidate2', fieldValue: 'myValue2' }, + { fieldName: 'myFieldCandidate3', fieldValue: 'myValue1' }, + { fieldName: 'myFieldCandidate3', fieldValue: 'myValue2' }, + ]); + expect(esClientSearchMock).toHaveBeenCalledTimes(3); + expect(getLogMessages()).toEqual([]); + }); + }); +}); diff --git a/x-pack/plugins/apm/server/lib/search_strategies/queries/query_field_value_pairs.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_field_value_pairs.ts new file mode 100644 index 0000000000000..aa7d9f341a345 --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_field_value_pairs.ts @@ -0,0 +1,119 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { ElasticsearchClient } from 'src/core/server'; + +import type { estypes } from '@elastic/elasticsearch'; + +import type { + FieldValuePair, + SearchStrategyParams, +} from '../../../../common/search_strategies/types'; + +import type { SearchServiceLog } from '../search_service_log'; +import type { LatencyCorrelationsSearchServiceState } from '../latency_correlations/latency_correlations_search_service_state'; +import { TERMS_SIZE } from '../constants'; + +import { getQueryWithParams } from './get_query_with_params'; +import { getRequestBase } from './get_request_base'; + +export const getTermsAggRequest = ( + params: SearchStrategyParams, + fieldName: string +): estypes.SearchRequest => ({ + ...getRequestBase(params), + body: { + query: getQueryWithParams({ params }), + size: 0, + aggs: { + attribute_terms: { + terms: { + field: fieldName, + size: TERMS_SIZE, + }, + }, + }, + }, +}); + +const fetchTransactionDurationFieldTerms = async ( + esClient: ElasticsearchClient, + params: SearchStrategyParams, + fieldName: string, + addLogMessage: SearchServiceLog['addLogMessage'] +): Promise => { + try { + const resp = await esClient.search(getTermsAggRequest(params, fieldName)); + + if (resp.body.aggregations === undefined) { + addLogMessage( + `Failed to fetch terms for field candidate ${fieldName} fieldValuePairs, no aggregations returned.`, + JSON.stringify(resp) + ); + return []; + } + const buckets = (resp.body.aggregations + .attribute_terms as estypes.AggregationsMultiBucketAggregate<{ + key: string; + }>)?.buckets; + if (buckets?.length >= 1) { + return buckets.map((d) => ({ + fieldName, + fieldValue: d.key, + })); + } + } catch (e) { + addLogMessage( + `Failed to fetch terms for field candidate ${fieldName} fieldValuePairs.`, + JSON.stringify(e) + ); + } + + return []; +}; + +async function fetchInSequence( + fieldCandidates: string[], + fn: (fieldCandidate: string) => Promise +) { + const results = []; + + for (const fieldCandidate of fieldCandidates) { + results.push(...(await fn(fieldCandidate))); + } + + return results; +} + +export const fetchTransactionDurationFieldValuePairs = async ( + esClient: ElasticsearchClient, + params: SearchStrategyParams, + fieldCandidates: string[], + state: LatencyCorrelationsSearchServiceState, + addLogMessage: SearchServiceLog['addLogMessage'] +): Promise => { + let fieldValuePairsProgress = 1; + + return await fetchInSequence( + fieldCandidates, + async function (fieldCandidate: string) { + const fieldTerms = await fetchTransactionDurationFieldTerms( + esClient, + params, + fieldCandidate, + addLogMessage + ); + + state.setProgress({ + loadedFieldValuePairs: fieldValuePairsProgress / fieldCandidates.length, + }); + fieldValuePairsProgress++; + + return fieldTerms; + } + ); +}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_fractions.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_fractions.test.ts similarity index 96% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_fractions.test.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/query_fractions.test.ts index 73df48a0d8170..fdf383453e17f 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_fractions.test.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_fractions.test.ts @@ -8,7 +8,7 @@ import type { estypes } from '@elastic/elasticsearch'; import type { ElasticsearchClient } from 'src/core/server'; -import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; +import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { fetchTransactionDurationFractions, diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_fractions.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_fractions.ts similarity index 87% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_fractions.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/query_fractions.ts index 35e59054ad01f..25e5f62564b04 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_fractions.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_fractions.ts @@ -8,14 +8,14 @@ import { ElasticsearchClient } from 'kibana/server'; import { estypes } from '@elastic/elasticsearch'; -import { SearchServiceFetchParams } from '../../../../../common/search_strategies/correlations/types'; -import { TRANSACTION_DURATION } from '../../../../../common/elasticsearch_fieldnames'; +import { SearchStrategyParams } from '../../../../common/search_strategies/types'; +import { TRANSACTION_DURATION } from '../../../../common/elasticsearch_fieldnames'; import { getQueryWithParams } from './get_query_with_params'; import { getRequestBase } from './get_request_base'; export const getTransactionDurationRangesRequest = ( - params: SearchServiceFetchParams, + params: SearchStrategyParams, ranges: estypes.AggregationsAggregationRange[] ): estypes.SearchRequest => ({ ...getRequestBase(params), @@ -38,7 +38,7 @@ export const getTransactionDurationRangesRequest = ( */ export const fetchTransactionDurationFractions = async ( esClient: ElasticsearchClient, - params: SearchServiceFetchParams, + params: SearchStrategyParams, ranges: estypes.AggregationsAggregationRange[] ): Promise<{ fractions: number[]; totalDocCount: number }> => { const resp = await esClient.search( diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram.test.ts similarity index 97% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram.test.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram.test.ts index 9b2a4807d4863..e6faeb16247fb 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram.test.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram.test.ts @@ -8,7 +8,7 @@ import type { estypes } from '@elastic/elasticsearch'; import type { ElasticsearchClient } from 'src/core/server'; -import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; +import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { fetchTransactionDurationHistogram, diff --git a/x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram.ts new file mode 100644 index 0000000000000..2514caf3ff876 --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram.ts @@ -0,0 +1,61 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { estypes } from '@elastic/elasticsearch'; + +import type { ElasticsearchClient } from 'src/core/server'; + +import { TRANSACTION_DURATION } from '../../../../common/elasticsearch_fieldnames'; +import type { + FieldValuePair, + HistogramItem, + ResponseHit, + SearchStrategyParams, +} from '../../../../common/search_strategies/types'; + +import { getQueryWithParams } from './get_query_with_params'; +import { getRequestBase } from './get_request_base'; + +export const getTransactionDurationHistogramRequest = ( + params: SearchStrategyParams, + interval: number, + termFilters?: FieldValuePair[] +): estypes.SearchRequest => ({ + ...getRequestBase(params), + body: { + query: getQueryWithParams({ params, termFilters }), + size: 0, + aggs: { + transaction_duration_histogram: { + histogram: { field: TRANSACTION_DURATION, interval }, + }, + }, + }, +}); + +export const fetchTransactionDurationHistogram = async ( + esClient: ElasticsearchClient, + params: SearchStrategyParams, + interval: number, + termFilters?: FieldValuePair[] +): Promise => { + const resp = await esClient.search( + getTransactionDurationHistogramRequest(params, interval, termFilters) + ); + + if (resp.body.aggregations === undefined) { + throw new Error( + 'fetchTransactionDurationHistogram failed, did not return aggregations.' + ); + } + + return ( + (resp.body.aggregations + .transaction_duration_histogram as estypes.AggregationsMultiBucketAggregate) + .buckets ?? [] + ); +}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram_interval.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram_interval.test.ts similarity index 97% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram_interval.test.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram_interval.test.ts index bb76769fe94b5..7b0d00d0d9b57 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram_interval.test.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram_interval.test.ts @@ -8,7 +8,7 @@ import type { estypes } from '@elastic/elasticsearch'; import type { ElasticsearchClient } from 'src/core/server'; -import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; +import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { fetchTransactionDurationHistogramInterval, diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram_interval.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram_interval.ts similarity index 85% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram_interval.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram_interval.ts index cc50c8d4d860a..7a8752e45c6f2 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram_interval.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram_interval.ts @@ -9,8 +9,8 @@ import type { estypes } from '@elastic/elasticsearch'; import type { ElasticsearchClient } from 'src/core/server'; -import { TRANSACTION_DURATION } from '../../../../../common/elasticsearch_fieldnames'; -import type { SearchServiceFetchParams } from '../../../../../common/search_strategies/correlations/types'; +import { TRANSACTION_DURATION } from '../../../../common/elasticsearch_fieldnames'; +import type { SearchStrategyParams } from '../../../../common/search_strategies/types'; import { getQueryWithParams } from './get_query_with_params'; import { getRequestBase } from './get_request_base'; @@ -18,7 +18,7 @@ import { getRequestBase } from './get_request_base'; const HISTOGRAM_INTERVALS = 1000; export const getHistogramIntervalRequest = ( - params: SearchServiceFetchParams + params: SearchStrategyParams ): estypes.SearchRequest => ({ ...getRequestBase(params), body: { @@ -33,7 +33,7 @@ export const getHistogramIntervalRequest = ( export const fetchTransactionDurationHistogramInterval = async ( esClient: ElasticsearchClient, - params: SearchServiceFetchParams + params: SearchStrategyParams ): Promise => { const resp = await esClient.search(getHistogramIntervalRequest(params)); diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram_range_steps.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram_range_steps.test.ts similarity index 97% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram_range_steps.test.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram_range_steps.test.ts index 52cfe6168232d..88d4f1a57adeb 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram_range_steps.test.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram_range_steps.test.ts @@ -8,7 +8,7 @@ import type { estypes } from '@elastic/elasticsearch'; import type { ElasticsearchClient } from 'src/core/server'; -import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; +import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { fetchTransactionDurationHistogramRangeSteps, diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram_range_steps.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram_range_steps.ts similarity index 88% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram_range_steps.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram_range_steps.ts index 116b5d1645601..31ab7392155bc 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histogram_range_steps.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_histogram_range_steps.ts @@ -11,8 +11,8 @@ import type { estypes } from '@elastic/elasticsearch'; import type { ElasticsearchClient } from 'src/core/server'; -import { TRANSACTION_DURATION } from '../../../../../common/elasticsearch_fieldnames'; -import type { SearchServiceFetchParams } from '../../../../../common/search_strategies/correlations/types'; +import { TRANSACTION_DURATION } from '../../../../common/elasticsearch_fieldnames'; +import type { SearchStrategyParams } from '../../../../common/search_strategies/types'; import { getQueryWithParams } from './get_query_with_params'; import { getRequestBase } from './get_request_base'; @@ -26,7 +26,7 @@ const getHistogramRangeSteps = (min: number, max: number, steps: number) => { }; export const getHistogramIntervalRequest = ( - params: SearchServiceFetchParams + params: SearchStrategyParams ): estypes.SearchRequest => ({ ...getRequestBase(params), body: { @@ -41,7 +41,7 @@ export const getHistogramIntervalRequest = ( export const fetchTransactionDurationHistogramRangeSteps = async ( esClient: ElasticsearchClient, - params: SearchServiceFetchParams + params: SearchStrategyParams ): Promise => { const steps = 100; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histograms_generator.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_histograms_generator.test.ts similarity index 82% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histograms_generator.test.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/query_histograms_generator.test.ts index 22876684bec7e..c80b2533d7e32 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histograms_generator.test.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_histograms_generator.test.ts @@ -8,10 +8,10 @@ import type { estypes } from '@elastic/elasticsearch'; import type { ElasticsearchClient } from 'src/core/server'; -import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; +import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; -import { asyncSearchServiceLogProvider } from '../async_search_service_log'; -import { asyncSearchServiceStateProvider } from '../async_search_service_state'; +import { searchServiceLogProvider } from '../search_service_log'; +import { latencyCorrelationsSearchServiceStateProvider } from '../latency_correlations/latency_correlations_search_service_state'; import { fetchTransactionDurationHistograms } from './query_histograms_generator'; @@ -30,9 +30,9 @@ const totalDocCount = 1234; const histogramRangeSteps = [1, 2, 4, 5]; const fieldValuePairs = [ - { field: 'the-field-name-1', value: 'the-field-value-1' }, - { field: 'the-field-name-2', value: 'the-field-value-2' }, - { field: 'the-field-name-2', value: 'the-field-value-3' }, + { fieldName: 'the-field-name-1', fieldValue: 'the-field-value-1' }, + { fieldName: 'the-field-name-2', fieldValue: 'the-field-value-2' }, + { fieldName: 'the-field-name-2', fieldValue: 'the-field-value-3' }, ]; describe('query_histograms_generator', () => { @@ -50,8 +50,8 @@ describe('query_histograms_generator', () => { search: esClientSearchMock, } as unknown) as ElasticsearchClient; - const state = asyncSearchServiceStateProvider(); - const { addLogMessage, getLogMessages } = asyncSearchServiceLogProvider(); + const state = latencyCorrelationsSearchServiceStateProvider(); + const { addLogMessage, getLogMessages } = searchServiceLogProvider(); let loadedHistograms = 0; const items = []; @@ -104,8 +104,8 @@ describe('query_histograms_generator', () => { search: esClientSearchMock, } as unknown) as ElasticsearchClient; - const state = asyncSearchServiceStateProvider(); - const { addLogMessage, getLogMessages } = asyncSearchServiceLogProvider(); + const state = latencyCorrelationsSearchServiceStateProvider(); + const { addLogMessage, getLogMessages } = searchServiceLogProvider(); let loadedHistograms = 0; const items = []; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histograms_generator.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_histograms_generator.ts similarity index 76% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histograms_generator.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/query_histograms_generator.ts index c4869aac187c6..a7f78d62d973f 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_histograms_generator.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_histograms_generator.ts @@ -9,29 +9,30 @@ import type { estypes } from '@elastic/elasticsearch'; import type { ElasticsearchClient } from 'src/core/server'; -import type { SearchServiceFetchParams } from '../../../../../common/search_strategies/correlations/types'; +import type { + FieldValuePair, + SearchStrategyParams, +} from '../../../../common/search_strategies/types'; -import type { AsyncSearchServiceLog } from '../async_search_service_log'; -import type { AsyncSearchServiceState } from '../async_search_service_state'; +import type { SearchServiceLog } from '../search_service_log'; +import type { LatencyCorrelationsSearchServiceState } from '../latency_correlations/latency_correlations_search_service_state'; import { CORRELATION_THRESHOLD, KS_TEST_THRESHOLD } from '../constants'; import { getPrioritizedFieldValuePairs } from './get_prioritized_field_value_pairs'; import { fetchTransactionDurationCorrelation } from './query_correlation'; import { fetchTransactionDurationRanges } from './query_ranges'; -import type { FieldValuePairs } from './query_field_value_pairs'; - export async function* fetchTransactionDurationHistograms( esClient: ElasticsearchClient, - addLogMessage: AsyncSearchServiceLog['addLogMessage'], - params: SearchServiceFetchParams, - state: AsyncSearchServiceState, + addLogMessage: SearchServiceLog['addLogMessage'], + params: SearchStrategyParams, + state: LatencyCorrelationsSearchServiceState, expectations: number[], ranges: estypes.AggregationsAggregationRange[], fractions: number[], histogramRangeSteps: number[], totalDocCount: number, - fieldValuePairs: FieldValuePairs + fieldValuePairs: FieldValuePair[] ) { for (const item of getPrioritizedFieldValuePairs(fieldValuePairs)) { if (params === undefined || item === undefined || state.getIsCancelled()) { @@ -42,15 +43,17 @@ export async function* fetchTransactionDurationHistograms( // If one of the fields have an error // We don't want to stop the whole process try { - const { correlation, ksTest } = await fetchTransactionDurationCorrelation( + const { + correlation, + ksTest, + } = await fetchTransactionDurationCorrelation( esClient, params, expectations, ranges, fractions, totalDocCount, - item.field, - item.value + [item] ); if (state.getIsCancelled()) { @@ -68,8 +71,7 @@ export async function* fetchTransactionDurationHistograms( esClient, params, histogramRangeSteps, - item.field, - item.value + [item] ); yield { ...item, @@ -85,7 +87,7 @@ export async function* fetchTransactionDurationHistograms( // just add the error to the internal log and check if we'd want to set the // cross-cluster search compatibility warning to true. addLogMessage( - `Failed to fetch correlation/kstest for '${item.field}/${item.value}'`, + `Failed to fetch correlation/kstest for '${item.fieldName}/${item.fieldValue}'`, JSON.stringify(e) ); if (params?.index.includes(':')) { diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_percentiles.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_percentiles.test.ts similarity index 97% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_percentiles.test.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/query_percentiles.test.ts index cab2e283935d6..1a5d518b7e47a 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_percentiles.test.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_percentiles.test.ts @@ -8,7 +8,7 @@ import type { estypes } from '@elastic/elasticsearch'; import type { ElasticsearchClient } from 'src/core/server'; -import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; +import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { fetchTransactionDurationPercentiles, diff --git a/x-pack/plugins/apm/server/lib/search_strategies/queries/query_percentiles.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_percentiles.ts new file mode 100644 index 0000000000000..afc2487acfbfc --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_percentiles.ts @@ -0,0 +1,79 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { estypes } from '@elastic/elasticsearch'; + +import type { ElasticsearchClient } from 'src/core/server'; + +import { TRANSACTION_DURATION } from '../../../../common/elasticsearch_fieldnames'; +import type { + FieldValuePair, + ResponseHit, + SearchStrategyParams, +} from '../../../../common/search_strategies/types'; + +import { getQueryWithParams } from './get_query_with_params'; +import { getRequestBase } from './get_request_base'; +import { SIGNIFICANT_VALUE_DIGITS } from '../constants'; + +export const getTransactionDurationPercentilesRequest = ( + params: SearchStrategyParams, + percents?: number[], + termFilters?: FieldValuePair[] +): estypes.SearchRequest => { + const query = getQueryWithParams({ params, termFilters }); + + return { + ...getRequestBase(params), + body: { + track_total_hits: true, + query, + size: 0, + aggs: { + transaction_duration_percentiles: { + percentiles: { + hdr: { + number_of_significant_value_digits: SIGNIFICANT_VALUE_DIGITS, + }, + field: TRANSACTION_DURATION, + ...(Array.isArray(percents) ? { percents } : {}), + }, + }, + }, + }, + }; +}; + +export const fetchTransactionDurationPercentiles = async ( + esClient: ElasticsearchClient, + params: SearchStrategyParams, + percents?: number[], + termFilters?: FieldValuePair[] +): Promise<{ totalDocs: number; percentiles: Record }> => { + const resp = await esClient.search( + getTransactionDurationPercentilesRequest(params, percents, termFilters) + ); + + // return early with no results if the search didn't return any documents + if ((resp.body.hits.total as estypes.SearchTotalHits).value === 0) { + return { totalDocs: 0, percentiles: {} }; + } + + if (resp.body.aggregations === undefined) { + throw new Error( + 'fetchTransactionDurationPercentiles failed, did not return aggregations.' + ); + } + + return { + totalDocs: (resp.body.hits.total as estypes.SearchTotalHits).value, + percentiles: + (resp.body.aggregations + .transaction_duration_percentiles as estypes.AggregationsTDigestPercentilesAggregate) + .values ?? {}, + }; +}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_ranges.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_ranges.test.ts similarity index 97% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_ranges.test.ts rename to x-pack/plugins/apm/server/lib/search_strategies/queries/query_ranges.test.ts index 839d6a33cfe05..64b746b72534a 100644 --- a/x-pack/plugins/apm/server/lib/search_strategies/correlations/queries/query_ranges.test.ts +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_ranges.test.ts @@ -8,7 +8,7 @@ import type { estypes } from '@elastic/elasticsearch'; import type { ElasticsearchClient } from 'src/core/server'; -import { ENVIRONMENT_ALL } from '../../../../../common/environment_filter_values'; +import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { fetchTransactionDurationRanges, diff --git a/x-pack/plugins/apm/server/lib/search_strategies/queries/query_ranges.ts b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_ranges.ts new file mode 100644 index 0000000000000..487b23e76a105 --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/queries/query_ranges.ts @@ -0,0 +1,84 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { estypes } from '@elastic/elasticsearch'; + +import type { ElasticsearchClient } from 'src/core/server'; + +import { TRANSACTION_DURATION } from '../../../../common/elasticsearch_fieldnames'; +import type { + FieldValuePair, + ResponseHit, + SearchStrategyParams, +} from '../../../../common/search_strategies/types'; + +import { getQueryWithParams } from './get_query_with_params'; +import { getRequestBase } from './get_request_base'; + +export const getTransactionDurationRangesRequest = ( + params: SearchStrategyParams, + rangesSteps: number[], + termFilters?: FieldValuePair[] +): estypes.SearchRequest => { + const query = getQueryWithParams({ params, termFilters }); + + const ranges = rangesSteps.reduce( + (p, to) => { + const from = p[p.length - 1].to; + p.push({ from, to }); + return p; + }, + [{ to: 0 }] as Array<{ from?: number; to?: number }> + ); + if (ranges.length > 0) { + ranges.push({ from: ranges[ranges.length - 1].to }); + } + + return { + ...getRequestBase(params), + body: { + query, + size: 0, + aggs: { + logspace_ranges: { + range: { + field: TRANSACTION_DURATION, + ranges, + }, + }, + }, + }, + }; +}; + +export const fetchTransactionDurationRanges = async ( + esClient: ElasticsearchClient, + params: SearchStrategyParams, + rangesSteps: number[], + termFilters?: FieldValuePair[] +): Promise> => { + const resp = await esClient.search( + getTransactionDurationRangesRequest(params, rangesSteps, termFilters) + ); + + if (resp.body.aggregations === undefined) { + throw new Error( + 'fetchTransactionDurationCorrelation failed, did not return aggregations.' + ); + } + + return (resp.body.aggregations + .logspace_ranges as estypes.AggregationsMultiBucketAggregate<{ + from: number; + doc_count: number; + }>).buckets + .map((d) => ({ + key: d.from, + doc_count: d.doc_count, + })) + .filter((d) => d.key !== undefined); +}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/register_search_strategies.ts b/x-pack/plugins/apm/server/lib/search_strategies/register_search_strategies.ts new file mode 100644 index 0000000000000..713c5e390ca8b --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/register_search_strategies.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 { PluginSetup as DataPluginSetup } from 'src/plugins/data/server'; + +import { APM_SEARCH_STRATEGIES } from '../../../common/search_strategies/constants'; + +import type { ApmIndicesConfig } from '../settings/apm_indices/get_apm_indices'; + +import { failedTransactionsCorrelationsSearchServiceProvider } from './failed_transactions_correlations'; +import { latencyCorrelationsSearchServiceProvider } from './latency_correlations'; +import { searchStrategyProvider } from './search_strategy_provider'; + +export const registerSearchStrategies = ( + registerSearchStrategy: DataPluginSetup['search']['registerSearchStrategy'], + getApmIndices: () => Promise, + includeFrozen: boolean +) => { + registerSearchStrategy( + APM_SEARCH_STRATEGIES.APM_LATENCY_CORRELATIONS, + searchStrategyProvider( + latencyCorrelationsSearchServiceProvider, + getApmIndices, + includeFrozen + ) + ); + + registerSearchStrategy( + APM_SEARCH_STRATEGIES.APM_FAILED_TRANSACTIONS_CORRELATIONS, + searchStrategyProvider( + failedTransactionsCorrelationsSearchServiceProvider, + getApmIndices, + includeFrozen + ) + ); +}; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/search_service_log.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/search_service_log.test.ts new file mode 100644 index 0000000000000..5b887f15a584e --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/search_service_log.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 { + searchServiceLogProvider, + currentTimeAsString, +} from './search_service_log'; + +describe('search service', () => { + describe('currentTimeAsString', () => { + it('returns the current time as a string', () => { + const mockDate = new Date(1392202800000); + // @ts-ignore ignore the mockImplementation callback error + const spy = jest.spyOn(global, 'Date').mockReturnValue(mockDate); + + const timeString = currentTimeAsString(); + + expect(timeString).toEqual('2014-02-12T11:00:00.000Z'); + + spy.mockRestore(); + }); + }); + + describe('searchServiceLogProvider', () => { + it('adds and retrieves messages from the log', async () => { + const { addLogMessage, getLogMessages } = searchServiceLogProvider(); + + const mockDate = new Date(1392202800000); + // @ts-ignore ignore the mockImplementation callback error + const spy = jest.spyOn(global, 'Date').mockReturnValue(mockDate); + + addLogMessage('the first message'); + addLogMessage('the second message'); + + expect(getLogMessages()).toEqual([ + '2014-02-12T11:00:00.000Z: the first message', + '2014-02-12T11:00:00.000Z: the second message', + ]); + + spy.mockRestore(); + }); + }); +}); diff --git a/x-pack/plugins/apm/server/lib/search_strategies/search_service_log.ts b/x-pack/plugins/apm/server/lib/search_strategies/search_service_log.ts new file mode 100644 index 0000000000000..73a59021b01ed --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/search_service_log.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +interface LogMessage { + timestamp: string; + message: string; + error?: string; +} + +export const currentTimeAsString = () => new Date().toISOString(); + +export const searchServiceLogProvider = () => { + const log: LogMessage[] = []; + + function addLogMessage(message: string, error?: string) { + log.push({ + timestamp: currentTimeAsString(), + message, + ...(error !== undefined ? { error } : {}), + }); + } + + function getLogMessages() { + return log.map((l) => `${l.timestamp}: ${l.message}`); + } + + return { addLogMessage, getLogMessages }; +}; + +export type SearchServiceLog = ReturnType; diff --git a/x-pack/plugins/apm/server/lib/search_strategies/search_strategy_provider.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/search_strategy_provider.test.ts new file mode 100644 index 0000000000000..f1f4bf637b511 --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/search_strategy_provider.test.ts @@ -0,0 +1,316 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { estypes } from '@elastic/elasticsearch'; + +import { SearchStrategyDependencies } from 'src/plugins/data/server'; + +import { IKibanaSearchRequest } from '../../../../../../src/plugins/data/common'; + +import { ENVIRONMENT_ALL } from '../../../common/environment_filter_values'; +import type { LatencyCorrelationsParams } from '../../../common/search_strategies/latency_correlations/types'; +import type { SearchStrategyClientParams } from '../../../common/search_strategies/types'; + +import type { ApmIndicesConfig } from '../settings/apm_indices/get_apm_indices'; + +import { latencyCorrelationsSearchServiceProvider } from './latency_correlations'; +import { searchStrategyProvider } from './search_strategy_provider'; + +// helper to trigger promises in the async search service +const flushPromises = () => new Promise(setImmediate); + +const clientFieldCapsMock = () => ({ body: { fields: [] } }); + +// minimal client mock to fulfill search requirements of the async search service to succeed +const clientSearchMock = ( + req: estypes.SearchRequest +): { body: estypes.SearchResponse } => { + let aggregations: + | { + transaction_duration_percentiles: estypes.AggregationsTDigestPercentilesAggregate; + } + | { + transaction_duration_min: estypes.AggregationsValueAggregate; + transaction_duration_max: estypes.AggregationsValueAggregate; + } + | { + logspace_ranges: estypes.AggregationsMultiBucketAggregate<{ + from: number; + doc_count: number; + }>; + } + | { + latency_ranges: estypes.AggregationsMultiBucketAggregate<{ + doc_count: number; + }>; + } + | undefined; + + if (req?.body?.aggs !== undefined) { + const aggs = req.body.aggs; + // fetchTransactionDurationPercentiles + if (aggs.transaction_duration_percentiles !== undefined) { + aggregations = { transaction_duration_percentiles: { values: {} } }; + } + + // fetchTransactionDurationHistogramInterval + if ( + aggs.transaction_duration_min !== undefined && + aggs.transaction_duration_max !== undefined + ) { + aggregations = { + transaction_duration_min: { value: 0 }, + transaction_duration_max: { value: 1234 }, + }; + } + + // fetchTransactionDurationCorrelation + if (aggs.logspace_ranges !== undefined) { + aggregations = { logspace_ranges: { buckets: [] } }; + } + + // fetchTransactionDurationFractions + if (aggs.latency_ranges !== undefined) { + aggregations = { latency_ranges: { buckets: [] } }; + } + } + + return { + body: { + _shards: { + failed: 0, + successful: 1, + total: 1, + }, + took: 162, + timed_out: false, + hits: { + hits: [], + total: { + value: 0, + relation: 'eq', + }, + }, + ...(aggregations !== undefined ? { aggregations } : {}), + }, + }; +}; + +const getApmIndicesMock = async () => + ({ + // eslint-disable-next-line @typescript-eslint/naming-convention + 'apm_oss.transactionIndices': 'apm-*', + } as ApmIndicesConfig); + +describe('APM Correlations search strategy', () => { + describe('strategy interface', () => { + it('returns a custom search strategy with a `search` and `cancel` function', async () => { + const searchStrategy = await searchStrategyProvider( + latencyCorrelationsSearchServiceProvider, + getApmIndicesMock, + false + ); + expect(typeof searchStrategy.search).toBe('function'); + expect(typeof searchStrategy.cancel).toBe('function'); + }); + }); + + describe('search', () => { + let mockClientFieldCaps: jest.Mock; + let mockClientSearch: jest.Mock; + let mockGetApmIndicesMock: jest.Mock; + let mockDeps: SearchStrategyDependencies; + let params: Required< + IKibanaSearchRequest< + LatencyCorrelationsParams & SearchStrategyClientParams + > + >['params']; + + beforeEach(() => { + mockClientFieldCaps = jest.fn(clientFieldCapsMock); + mockClientSearch = jest.fn(clientSearchMock); + mockGetApmIndicesMock = jest.fn(getApmIndicesMock); + mockDeps = ({ + esClient: { + asCurrentUser: { + fieldCaps: mockClientFieldCaps, + search: mockClientSearch, + }, + }, + } as unknown) as SearchStrategyDependencies; + params = { + start: '2020', + end: '2021', + environment: ENVIRONMENT_ALL.value, + kuery: '', + percentileThreshold: 95, + analyzeCorrelations: true, + }; + }); + + describe('async functionality', () => { + describe('when no params are provided', () => { + it('throws an error', async () => { + const searchStrategy = await searchStrategyProvider( + latencyCorrelationsSearchServiceProvider, + mockGetApmIndicesMock, + false + ); + + expect(mockGetApmIndicesMock).toHaveBeenCalledTimes(0); + + expect(() => searchStrategy.search({}, {}, mockDeps)).toThrow( + 'Invalid request parameters.' + ); + }); + }); + + describe('when no ID is provided', () => { + it('performs a client search with params', async () => { + const searchStrategy = await searchStrategyProvider( + latencyCorrelationsSearchServiceProvider, + mockGetApmIndicesMock, + false + ); + await searchStrategy.search({ params }, {}, mockDeps).toPromise(); + + expect(mockGetApmIndicesMock).toHaveBeenCalledTimes(1); + + const [[request]] = mockClientSearch.mock.calls; + + expect(request.index).toEqual('apm-*'); + expect(request.body).toEqual( + expect.objectContaining({ + aggs: { + transaction_duration_percentiles: { + percentiles: { + field: 'transaction.duration.us', + hdr: { number_of_significant_value_digits: 3 }, + percents: [95], + }, + }, + }, + query: { + bool: { + filter: [ + { term: { 'processor.event': 'transaction' } }, + { + range: { + '@timestamp': { + format: 'epoch_millis', + gte: 1577836800000, + lte: 1609459200000, + }, + }, + }, + ], + }, + }, + size: 0, + track_total_hits: true, + }) + ); + }); + }); + + describe('when an ID with params is provided', () => { + it('retrieves the current request', async () => { + const searchStrategy = await searchStrategyProvider( + latencyCorrelationsSearchServiceProvider, + mockGetApmIndicesMock, + false + ); + const response = await searchStrategy + .search({ params }, {}, mockDeps) + .toPromise(); + + const searchStrategyId = response.id; + + const response2 = await searchStrategy + .search({ id: searchStrategyId, params }, {}, mockDeps) + .toPromise(); + + expect(mockGetApmIndicesMock).toHaveBeenCalledTimes(1); + expect(response2).toEqual( + expect.objectContaining({ id: searchStrategyId }) + ); + }); + }); + + describe('if the client throws', () => { + it('does not emit an error', async () => { + mockClientSearch + .mockReset() + .mockRejectedValueOnce(new Error('client error')); + const searchStrategy = await searchStrategyProvider( + latencyCorrelationsSearchServiceProvider, + mockGetApmIndicesMock, + false + ); + const response = await searchStrategy + .search({ params }, {}, mockDeps) + .toPromise(); + + expect(mockGetApmIndicesMock).toHaveBeenCalledTimes(1); + + expect(response).toEqual( + expect.objectContaining({ isRunning: true }) + ); + }); + }); + + it('triggers the subscription only once', async () => { + expect.assertions(2); + const searchStrategy = await searchStrategyProvider( + latencyCorrelationsSearchServiceProvider, + mockGetApmIndicesMock, + false + ); + searchStrategy + .search({ params }, {}, mockDeps) + .subscribe((response) => { + expect(mockGetApmIndicesMock).toHaveBeenCalledTimes(1); + expect(response).toEqual( + expect.objectContaining({ loaded: 0, isRunning: true }) + ); + }); + }); + }); + + describe('response', () => { + it('sends an updated response on consecutive search calls', async () => { + const searchStrategy = await searchStrategyProvider( + latencyCorrelationsSearchServiceProvider, + mockGetApmIndicesMock, + false + ); + + const response1 = await searchStrategy + .search({ params }, {}, mockDeps) + .toPromise(); + + expect(mockGetApmIndicesMock).toHaveBeenCalledTimes(1); + expect(typeof response1.id).toEqual('string'); + expect(response1).toEqual( + expect.objectContaining({ loaded: 0, isRunning: true }) + ); + + await flushPromises(); + + const response2 = await searchStrategy + .search({ id: response1.id, params }, {}, mockDeps) + .toPromise(); + + expect(mockGetApmIndicesMock).toHaveBeenCalledTimes(1); + expect(response2.id).toEqual(response1.id); + expect(response2).toEqual( + expect.objectContaining({ loaded: 100, isRunning: false }) + ); + }); + }); + }); +}); diff --git a/x-pack/plugins/apm/server/lib/search_strategies/search_strategy_provider.ts b/x-pack/plugins/apm/server/lib/search_strategies/search_strategy_provider.ts new file mode 100644 index 0000000000000..c0376852b2505 --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/search_strategy_provider.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 uuid from 'uuid'; +import { of } from 'rxjs'; + +import type { ElasticsearchClient } from 'src/core/server'; + +import type { ISearchStrategy } from '../../../../../../src/plugins/data/server'; +import { + IKibanaSearchRequest, + IKibanaSearchResponse, +} from '../../../../../../src/plugins/data/common'; + +import type { SearchStrategyClientParams } from '../../../common/search_strategies/types'; +import type { RawResponseBase } from '../../../common/search_strategies/types'; +import type { ApmIndicesConfig } from '../settings/apm_indices/get_apm_indices'; + +import type { + LatencyCorrelationsSearchServiceProvider, + LatencyCorrelationsSearchStrategy, +} from './latency_correlations'; +import type { + FailedTransactionsCorrelationsSearchServiceProvider, + FailedTransactionsCorrelationsSearchStrategy, +} from './failed_transactions_correlations'; + +interface SearchServiceState { + cancel: () => void; + error: Error; + meta: { + loaded: number; + total: number; + isRunning: boolean; + isPartial: boolean; + }; + rawResponse: TRawResponse; +} + +type GetSearchServiceState< + TRawResponse extends RawResponseBase +> = () => SearchServiceState; + +export type SearchServiceProvider< + TSearchStrategyClientParams extends SearchStrategyClientParams, + TRawResponse extends RawResponseBase +> = ( + esClient: ElasticsearchClient, + getApmIndices: () => Promise, + searchServiceParams: TSearchStrategyClientParams, + includeFrozen: boolean +) => GetSearchServiceState; + +// Failed Transactions Correlations function overload +export function searchStrategyProvider( + searchServiceProvider: FailedTransactionsCorrelationsSearchServiceProvider, + getApmIndices: () => Promise, + includeFrozen: boolean +): FailedTransactionsCorrelationsSearchStrategy; + +// Latency Correlations function overload +export function searchStrategyProvider( + searchServiceProvider: LatencyCorrelationsSearchServiceProvider, + getApmIndices: () => Promise, + includeFrozen: boolean +): LatencyCorrelationsSearchStrategy; + +export function searchStrategyProvider< + TSearchStrategyClientParams extends SearchStrategyClientParams, + TRawResponse extends RawResponseBase +>( + searchServiceProvider: SearchServiceProvider< + TSearchStrategyClientParams, + TRawResponse + >, + getApmIndices: () => Promise, + includeFrozen: boolean +): ISearchStrategy< + IKibanaSearchRequest, + IKibanaSearchResponse +> { + const searchServiceMap = new Map< + string, + GetSearchServiceState + >(); + + return { + search: (request, options, deps) => { + if (request.params === undefined) { + throw new Error('Invalid request parameters.'); + } + + // The function to fetch the current state of the search service. + // This will be either an existing service for a follow up fetch or a new one for new requests. + let getSearchServiceState: GetSearchServiceState; + + // If the request includes an ID, we require that the search service already exists + // otherwise we throw an error. The client should never poll a service that's been cancelled or finished. + // This also avoids instantiating search services when the service gets called with random IDs. + if (typeof request.id === 'string') { + const existingGetSearchServiceState = searchServiceMap.get(request.id); + + if (typeof existingGetSearchServiceState === 'undefined') { + throw new Error( + `SearchService with ID '${request.id}' does not exist.` + ); + } + + getSearchServiceState = existingGetSearchServiceState; + } else { + getSearchServiceState = searchServiceProvider( + deps.esClient.asCurrentUser, + getApmIndices, + request.params as TSearchStrategyClientParams, + includeFrozen + ); + } + + // Reuse the request's id or create a new one. + const id = request.id ?? uuid(); + + const { error, meta, rawResponse } = getSearchServiceState(); + + if (error instanceof Error) { + searchServiceMap.delete(id); + throw error; + } else if (meta.isRunning) { + searchServiceMap.set(id, getSearchServiceState); + } else { + searchServiceMap.delete(id); + } + + return of({ + id, + ...meta, + rawResponse, + }); + }, + cancel: async (id, options, deps) => { + const getSearchServiceState = searchServiceMap.get(id); + if (getSearchServiceState !== undefined) { + getSearchServiceState().cancel(); + searchServiceMap.delete(id); + } + }, + }; +} diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/utils/compute_expectations_and_ranges.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/utils/compute_expectations_and_ranges.test.ts similarity index 100% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/utils/compute_expectations_and_ranges.test.ts rename to x-pack/plugins/apm/server/lib/search_strategies/utils/compute_expectations_and_ranges.test.ts diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/utils/compute_expectations_and_ranges.ts b/x-pack/plugins/apm/server/lib/search_strategies/utils/compute_expectations_and_ranges.ts similarity index 100% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/utils/compute_expectations_and_ranges.ts rename to x-pack/plugins/apm/server/lib/search_strategies/utils/compute_expectations_and_ranges.ts diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/utils/has_prefix_to_include.test.ts b/x-pack/plugins/apm/server/lib/search_strategies/utils/has_prefix_to_include.test.ts similarity index 100% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/utils/has_prefix_to_include.test.ts rename to x-pack/plugins/apm/server/lib/search_strategies/utils/has_prefix_to_include.test.ts diff --git a/x-pack/plugins/apm/server/lib/search_strategies/correlations/utils/has_prefix_to_include.ts b/x-pack/plugins/apm/server/lib/search_strategies/utils/has_prefix_to_include.ts similarity index 100% rename from x-pack/plugins/apm/server/lib/search_strategies/correlations/utils/has_prefix_to_include.ts rename to x-pack/plugins/apm/server/lib/search_strategies/utils/has_prefix_to_include.ts diff --git a/x-pack/plugins/apm/server/lib/search_strategies/utils/index.ts b/x-pack/plugins/apm/server/lib/search_strategies/utils/index.ts new file mode 100644 index 0000000000000..727bc6cd787a0 --- /dev/null +++ b/x-pack/plugins/apm/server/lib/search_strategies/utils/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { computeExpectationsAndRanges } from './compute_expectations_and_ranges'; +export { hasPrefixToInclude } from './has_prefix_to_include'; diff --git a/x-pack/plugins/apm/server/lib/services/get_services/index.ts b/x-pack/plugins/apm/server/lib/services/get_services/index.ts index 61cb4a28586d7..d4b11880b56ab 100644 --- a/x-pack/plugins/apm/server/lib/services/get_services/index.ts +++ b/x-pack/plugins/apm/server/lib/services/get_services/index.ts @@ -6,12 +6,10 @@ */ import { Logger } from '@kbn/logging'; -import { isEmpty } from 'lodash'; import { withApmSpan } from '../../../utils/with_apm_span'; import { Setup, SetupTimeRange } from '../../helpers/setup_request'; import { getLegacyDataStatus } from './get_legacy_data_status'; import { getServicesItems } from './get_services_items'; -import { hasHistoricalAgentData } from './has_historical_agent_data'; export async function getServices({ environment, @@ -38,14 +36,8 @@ export async function getServices({ getLegacyDataStatus(setup), ]); - const noDataInCurrentTimeRange = isEmpty(items); - const hasHistoricalData = noDataInCurrentTimeRange - ? await hasHistoricalAgentData(setup) - : true; - return { items, - hasHistoricalData, hasLegacyData, }; }); diff --git a/x-pack/plugins/apm/server/lib/services/queries.test.ts b/x-pack/plugins/apm/server/lib/services/queries.test.ts index be5f280477a09..a4a32229cbd44 100644 --- a/x-pack/plugins/apm/server/lib/services/queries.test.ts +++ b/x-pack/plugins/apm/server/lib/services/queries.test.ts @@ -9,7 +9,7 @@ import { getServiceAgent } from './get_service_agent'; import { getServiceTransactionTypes } from './get_service_transaction_types'; import { getServicesItems } from './get_services/get_services_items'; import { getLegacyDataStatus } from './get_services/get_legacy_data_status'; -import { hasHistoricalAgentData } from './get_services/has_historical_agent_data'; +import { hasHistoricalAgentData } from '../../routes/historical_data/has_historical_agent_data'; import { SearchParamsMock, inspectSearchParams, diff --git a/x-pack/plugins/apm/server/lib/traces/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/lib/traces/__snapshots__/queries.test.ts.snap index 3c521839b587e..7691373ada815 100644 --- a/x-pack/plugins/apm/server/lib/traces/__snapshots__/queries.test.ts.snap +++ b/x-pack/plugins/apm/server/lib/traces/__snapshots__/queries.test.ts.snap @@ -8,15 +8,6 @@ Object { ], }, "body": Object { - "aggs": Object { - "by_transaction_id": Object { - "terms": Object { - "execution_hint": "map", - "field": "transaction.id", - "size": "myIndex", - }, - }, - }, "query": Object { "bool": Object { "filter": Array [ diff --git a/x-pack/plugins/apm/server/lib/traces/get_trace.ts b/x-pack/plugins/apm/server/lib/traces/get_trace.ts deleted file mode 100644 index a0cc6b7241d4e..0000000000000 --- a/x-pack/plugins/apm/server/lib/traces/get_trace.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { Setup, SetupTimeRange } from '../helpers/setup_request'; -import { getTraceItems } from './get_trace_items'; - -export async function getTrace(traceId: string, setup: Setup & SetupTimeRange) { - const { errorsPerTransaction, ...trace } = await getTraceItems( - traceId, - setup - ); - - return { - trace, - errorsPerTransaction, - }; -} diff --git a/x-pack/plugins/apm/server/lib/traces/get_trace_items.ts b/x-pack/plugins/apm/server/lib/traces/get_trace_items.ts index 6c957df313866..6cc6713e156bc 100644 --- a/x-pack/plugins/apm/server/lib/traces/get_trace_items.ts +++ b/x-pack/plugins/apm/server/lib/traces/get_trace_items.ts @@ -9,15 +9,13 @@ import { QueryDslQueryContainer } from '@elastic/elasticsearch/api/types'; import { ProcessorEvent } from '../../../common/processor_event'; import { TRACE_ID, - PARENT_ID, TRANSACTION_DURATION, SPAN_DURATION, - TRANSACTION_ID, + PARENT_ID, ERROR_LOG_LEVEL, } from '../../../common/elasticsearch_fieldnames'; import { rangeQuery } from '../../../../observability/server'; import { Setup, SetupTimeRange } from '../helpers/setup_request'; -import { PromiseValueType } from '../../../typings/common'; export async function getTraceItems( traceId: string, @@ -27,7 +25,7 @@ export async function getTraceItems( const maxTraceItems = config['xpack.apm.ui.maxTraceItems']; const excludedLogLevels = ['debug', 'info', 'warning']; - const errorResponsePromise = apmEventClient.search('get_trace_items', { + const errorResponsePromise = apmEventClient.search('get_errors_docs', { apm: { events: [ProcessorEvent.error], }, @@ -42,20 +40,10 @@ export async function getTraceItems( must_not: { terms: { [ERROR_LOG_LEVEL]: excludedLogLevels } }, }, }, - aggs: { - by_transaction_id: { - terms: { - field: TRANSACTION_ID, - size: maxTraceItems, - // high cardinality - execution_hint: 'map' as const, - }, - }, - }, }, }); - const traceResponsePromise = apmEventClient.search('get_trace_span_items', { + const traceResponsePromise = apmEventClient.search('get_trace_docs', { apm: { events: [ProcessorEvent.span, ProcessorEvent.transaction], }, @@ -81,33 +69,18 @@ export async function getTraceItems( }, }); - const [errorResponse, traceResponse]: [ - // explicit intermediary types to avoid TS "excessively deep" error - PromiseValueType, - PromiseValueType - ] = (await Promise.all([errorResponsePromise, traceResponsePromise])) as any; + const [errorResponse, traceResponse] = await Promise.all([ + errorResponsePromise, + traceResponsePromise, + ]); const exceedsMax = traceResponse.hits.total.value > maxTraceItems; - - const items = traceResponse.hits.hits.map((hit) => hit._source); - - const errorFrequencies = { - errorDocs: errorResponse.hits.hits.map(({ _source }) => _source), - errorsPerTransaction: - errorResponse.aggregations?.by_transaction_id.buckets.reduce( - (acc, current) => { - return { - ...acc, - [current.key]: current.doc_count, - }; - }, - {} as Record - ) ?? {}, - }; + const traceDocs = traceResponse.hits.hits.map((hit) => hit._source); + const errorDocs = errorResponse.hits.hits.map((hit) => hit._source); return { - items, exceedsMax, - ...errorFrequencies, + traceDocs, + errorDocs, }; } diff --git a/x-pack/plugins/apm/server/plugin.ts b/x-pack/plugins/apm/server/plugin.ts index fadeae338cbdb..1c6d1cdef37ca 100644 --- a/x-pack/plugins/apm/server/plugin.ts +++ b/x-pack/plugins/apm/server/plugin.ts @@ -28,7 +28,7 @@ import { registerFleetPolicyCallbacks } from './lib/fleet/register_fleet_policy_ import { createApmTelemetry } from './lib/apm_telemetry'; import { createApmEventClient } from './lib/helpers/create_es_client/create_apm_event_client'; import { getInternalSavedObjectsClient } from './lib/helpers/get_internal_saved_objects_client'; -import { apmCorrelationsSearchStrategyProvider } from './lib/search_strategies/correlations'; +import { registerSearchStrategies } from './lib/search_strategies'; import { createApmAgentConfigurationIndex } from './lib/settings/agent_configuration/create_agent_config_index'; import { getApmIndices } from './lib/settings/apm_indices/get_apm_indices'; import { createApmCustomLinkIndex } from './lib/settings/custom_link/create_custom_link_index'; @@ -51,10 +51,6 @@ import { TRANSACTION_TYPE, } from '../common/elasticsearch_fieldnames'; import { tutorialProvider } from './tutorial'; -import { - apmFailedTransactionsCorrelationsSearchStrategyProvider, - FAILED_TRANSACTIONS_CORRELATION_SEARCH_STRATEGY, -} from './lib/search_strategies/failed_transactions_correlations'; export class APMPlugin implements @@ -88,13 +84,12 @@ export class APMPlugin plugins.apmOss.config, this.initContext.config.get() ); - this.currentConfig = currentConfig; if ( plugins.taskManager && plugins.usageCollection && - this.currentConfig['xpack.apm.telemetryCollectionEnabled'] + currentConfig['xpack.apm.telemetryCollectionEnabled'] ) { createApmTelemetry({ core, @@ -156,21 +151,22 @@ export class APMPlugin }; }) as APMRouteHandlerResources['plugins']; - plugins.home?.tutorials.registerTutorial( - tutorialProvider({ - isEnabled: this.currentConfig['xpack.apm.ui.enabled'], - indexPatternTitle: this.currentConfig['apm_oss.indexPattern'], - cloud: plugins.cloud, - isFleetPluginEnabled: !isEmpty(resourcePlugins.fleet), - indices: { - errorIndices: this.currentConfig['apm_oss.errorIndices'], - metricsIndices: this.currentConfig['apm_oss.metricsIndices'], - onboardingIndices: this.currentConfig['apm_oss.onboardingIndices'], - sourcemapIndices: this.currentConfig['apm_oss.sourcemapIndices'], - transactionIndices: this.currentConfig['apm_oss.transactionIndices'], - }, - }) - ); + const boundGetApmIndices = async () => + getApmIndices({ + savedObjectsClient: await getInternalSavedObjectsClient(core), + config: await mergedConfig$.pipe(take(1)).toPromise(), + }); + + boundGetApmIndices().then((indices) => { + plugins.home?.tutorials.registerTutorial( + tutorialProvider({ + apmConfig: currentConfig, + apmIndices: indices, + cloud: plugins.cloud, + isFleetPluginEnabled: !isEmpty(resourcePlugins.fleet), + }) + ); + }); const telemetryUsageCounter = resourcePlugins.usageCollection?.setup.createUsageCounter( APM_SERVER_FEATURE_ID @@ -189,12 +185,6 @@ export class APMPlugin telemetryUsageCounter, }); - const boundGetApmIndices = async () => - getApmIndices({ - savedObjectsClient: await getInternalSavedObjectsClient(core), - config: await mergedConfig$.pipe(take(1)).toPromise(), - }); - if (plugins.alerting) { registerApmAlerts({ ruleDataClient, @@ -208,7 +198,7 @@ export class APMPlugin registerFleetPolicyCallbacks({ plugins: resourcePlugins, ruleDataClient, - config: this.currentConfig, + config: currentConfig, logger: this.logger, }); @@ -223,22 +213,10 @@ export class APMPlugin .asScopedToClient(savedObjectsClient) .get(UI_SETTINGS.SEARCH_INCLUDE_FROZEN); - // Register APM latency correlations search strategy - plugins.data.search.registerSearchStrategy( - 'apmCorrelationsSearchStrategy', - apmCorrelationsSearchStrategyProvider( - boundGetApmIndices, - includeFrozen - ) - ); - - // Register APM failed transactions correlations search strategy - plugins.data.search.registerSearchStrategy( - FAILED_TRANSACTIONS_CORRELATION_SEARCH_STRATEGY, - apmFailedTransactionsCorrelationsSearchStrategyProvider( - boundGetApmIndices, - includeFrozen - ) + registerSearchStrategies( + plugins.data.search.registerSearchStrategy, + boundGetApmIndices, + includeFrozen ); })(); }); diff --git a/x-pack/plugins/apm/server/routes/alerts/chart_preview.ts b/x-pack/plugins/apm/server/routes/alerts/chart_preview.ts index 13879cb5fecb7..c28bca5048350 100644 --- a/x-pack/plugins/apm/server/routes/alerts/chart_preview.ts +++ b/x-pack/plugins/apm/server/routes/alerts/chart_preview.ts @@ -26,6 +26,9 @@ const alertParamsRt = t.intersection([ }), environmentRt, rangeRt, + t.type({ + interval: t.string, + }), ]); export type AlertParams = t.TypeOf; diff --git a/x-pack/plugins/apm/server/routes/get_global_apm_server_route_repository.ts b/x-pack/plugins/apm/server/routes/get_global_apm_server_route_repository.ts index b66daf80bd763..9bc9108da9055 100644 --- a/x-pack/plugins/apm/server/routes/get_global_apm_server_route_repository.ts +++ b/x-pack/plugins/apm/server/routes/get_global_apm_server_route_repository.ts @@ -33,6 +33,7 @@ import { sourceMapsRouteRepository } from './source_maps'; import { traceRouteRepository } from './traces'; import { transactionRouteRepository } from './transactions'; import { APMRouteHandlerResources } from './typings'; +import { historicalDataRouteRepository } from './historical_data'; const getTypedGlobalApmServerRouteRepository = () => { const repository = createApmServerRouteRepository() @@ -56,7 +57,8 @@ const getTypedGlobalApmServerRouteRepository = () => { .merge(sourceMapsRouteRepository) .merge(apmFleetRouteRepository) .merge(backendsRouteRepository) - .merge(fallbackToTransactionsRouteRepository); + .merge(fallbackToTransactionsRouteRepository) + .merge(historicalDataRouteRepository); return repository; }; @@ -72,10 +74,10 @@ export type APMServerRouteRepository = ReturnType< // Ensure no APIs return arrays (or, by proxy, the any type), // to guarantee compatibility with _inspect. -type CompositeEndpoint = EndpointOf; +export type APIEndpoint = EndpointOf; type EndpointReturnTypes = { - [Endpoint in CompositeEndpoint]: ReturnOf; + [Endpoint in APIEndpoint]: ReturnOf; }; type ArrayLikeReturnTypes = PickByValue; diff --git a/x-pack/plugins/apm/server/lib/services/get_services/has_historical_agent_data.ts b/x-pack/plugins/apm/server/routes/historical_data/has_historical_agent_data.ts similarity index 86% rename from x-pack/plugins/apm/server/lib/services/get_services/has_historical_agent_data.ts rename to x-pack/plugins/apm/server/routes/historical_data/has_historical_agent_data.ts index 97b8a8fa5505b..13591b47a8584 100644 --- a/x-pack/plugins/apm/server/lib/services/get_services/has_historical_agent_data.ts +++ b/x-pack/plugins/apm/server/routes/historical_data/has_historical_agent_data.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { ProcessorEvent } from '../../../../common/processor_event'; -import { Setup } from '../../helpers/setup_request'; +import { ProcessorEvent } from '../../../common/processor_event'; +import { Setup } from '../../lib/helpers/setup_request'; // Note: this logic is duplicated in tutorials/apm/envs/on_prem export async function hasHistoricalAgentData(setup: Setup) { diff --git a/x-pack/plugins/apm/server/routes/historical_data/index.ts b/x-pack/plugins/apm/server/routes/historical_data/index.ts new file mode 100644 index 0000000000000..6e574a435bc83 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/historical_data/index.ts @@ -0,0 +1,25 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { setupRequest } from '../../lib/helpers/setup_request'; +import { createApmServerRoute } from '../create_apm_server_route'; +import { createApmServerRouteRepository } from '../create_apm_server_route_repository'; +import { hasHistoricalAgentData } from './has_historical_agent_data'; + +const hasDataRoute = createApmServerRoute({ + endpoint: 'GET /api/apm/has_data', + options: { tags: ['access:apm'] }, + handler: async (resources) => { + const setup = await setupRequest(resources); + const hasData = await hasHistoricalAgentData(setup); + return { hasData }; + }, +}); + +export const historicalDataRouteRepository = createApmServerRouteRepository().add( + hasDataRoute +); diff --git a/x-pack/plugins/apm/server/routes/index_pattern.ts b/x-pack/plugins/apm/server/routes/index_pattern.ts index 190baf3bbc270..c957e828bf12a 100644 --- a/x-pack/plugins/apm/server/routes/index_pattern.ts +++ b/x-pack/plugins/apm/server/routes/index_pattern.ts @@ -8,7 +8,6 @@ import { createStaticIndexPattern } from '../lib/index_pattern/create_static_index_pattern'; import { createApmServerRouteRepository } from './create_apm_server_route_repository'; import { setupRequest } from '../lib/helpers/setup_request'; -import { getApmIndexPatternTitle } from '../lib/index_pattern/get_apm_index_pattern_title'; import { getDynamicIndexPattern } from '../lib/index_pattern/get_dynamic_index_pattern'; import { createApmServerRoute } from './create_apm_server_route'; @@ -56,17 +55,6 @@ const dynamicIndexPatternRoute = createApmServerRoute({ }, }); -const indexPatternTitleRoute = createApmServerRoute({ - endpoint: 'GET /api/apm/index_pattern/title', - options: { tags: ['access:apm'] }, - handler: async ({ config }) => { - return { - indexPatternTitle: getApmIndexPatternTitle(config), - }; - }, -}); - export const indexPatternRouteRepository = createApmServerRouteRepository() .add(staticIndexPatternRoute) - .add(dynamicIndexPatternRoute) - .add(indexPatternTitleRoute); + .add(dynamicIndexPatternRoute); diff --git a/x-pack/plugins/apm/server/routes/traces.ts b/x-pack/plugins/apm/server/routes/traces.ts index 11747c847fcbd..c5273b7650e56 100644 --- a/x-pack/plugins/apm/server/routes/traces.ts +++ b/x-pack/plugins/apm/server/routes/traces.ts @@ -7,7 +7,7 @@ import * as t from 'io-ts'; import { setupRequest } from '../lib/helpers/setup_request'; -import { getTrace } from '../lib/traces/get_trace'; +import { getTraceItems } from '../lib/traces/get_trace_items'; import { getTopTransactionGroupList } from '../lib/transaction_groups'; import { createApmServerRoute } from './create_apm_server_route'; import { environmentRt, kueryRt, rangeRt } from './default_api_types'; @@ -52,7 +52,7 @@ const tracesByIdRoute = createApmServerRoute({ const { params } = resources; const { traceId } = params.path; - return getTrace(traceId, setup); + return getTraceItems(traceId, setup); }, }); diff --git a/x-pack/plugins/apm/server/tutorial/envs/on_prem.ts b/x-pack/plugins/apm/server/tutorial/envs/on_prem.ts index 38c8dbfcbe8ba..fb9fbae33ac82 100644 --- a/x-pack/plugins/apm/server/tutorial/envs/on_prem.ts +++ b/x-pack/plugins/apm/server/tutorial/envs/on_prem.ts @@ -6,6 +6,7 @@ */ import { i18n } from '@kbn/i18n'; +import { APMConfig } from '../..'; import { INSTRUCTION_VARIANT, InstructionsSchema, @@ -33,18 +34,16 @@ import { } from '../../../common/tutorial/instructions/apm_server_instructions'; export function onPremInstructions({ - errorIndices, - transactionIndices, - metricsIndices, - sourcemapIndices, - onboardingIndices, + apmConfig, isFleetPluginEnabled, }: { - errorIndices: string; - transactionIndices: string; - metricsIndices: string; - sourcemapIndices: string; - onboardingIndices: string; + apmConfig: Pick< + APMConfig, + | 'apm_oss.errorIndices' + | 'apm_oss.transactionIndices' + | 'apm_oss.metricsIndices' + | 'apm_oss.onboardingIndices' + >; isFleetPluginEnabled: boolean; }): InstructionsSchema { const EDIT_CONFIG = createEditConfig(); @@ -145,7 +144,7 @@ export function onPremInstructions({ } ), esHitsCheck: { - index: onboardingIndices, + index: apmConfig['apm_oss.onboardingIndices'], query: { bool: { filter: [ @@ -238,22 +237,16 @@ export function onPremInstructions({ ), esHitsCheck: { index: [ - errorIndices, - transactionIndices, - metricsIndices, - sourcemapIndices, + apmConfig['apm_oss.errorIndices'], + apmConfig['apm_oss.transactionIndices'], + apmConfig['apm_oss.metricsIndices'], ], query: { bool: { filter: [ { terms: { - 'processor.event': [ - 'error', - 'transaction', - 'metric', - 'sourcemap', - ], + 'processor.event': ['error', 'transaction', 'metric'], }, }, { range: { 'observer.version_major': { gte: 7 } } }, diff --git a/x-pack/plugins/apm/server/tutorial/index.ts b/x-pack/plugins/apm/server/tutorial/index.ts index edf056a6d1be4..78dd1110e7c62 100644 --- a/x-pack/plugins/apm/server/tutorial/index.ts +++ b/x-pack/plugins/apm/server/tutorial/index.ts @@ -6,6 +6,7 @@ */ import { i18n } from '@kbn/i18n'; +import { APMConfig } from '..'; import { ArtifactsSchema, TutorialsCategory, @@ -13,6 +14,8 @@ import { } from '../../../../../src/plugins/home/server'; import { CloudSetup } from '../../../cloud/server'; import { APM_STATIC_INDEX_PATTERN_ID } from '../../common/index_pattern_constants'; +import { getApmIndexPatternTitle } from '../lib/index_pattern/get_apm_index_pattern_title'; +import { ApmIndicesConfig } from '../lib/settings/apm_indices/get_apm_indices'; import { createElasticCloudInstructions } from './envs/elastic_cloud'; import { onPremInstructions } from './envs/on_prem'; import apmIndexPattern from './index_pattern.json'; @@ -24,24 +27,18 @@ const apmIntro = i18n.translate('xpack.apm.tutorial.introduction', { const moduleName = 'apm'; export const tutorialProvider = ({ - isEnabled, - indexPatternTitle, - indices, + apmConfig, + apmIndices, cloud, isFleetPluginEnabled, }: { - isEnabled: boolean; - indexPatternTitle: string; + apmConfig: APMConfig; + apmIndices: ApmIndicesConfig; cloud?: CloudSetup; - indices: { - errorIndices: string; - transactionIndices: string; - metricsIndices: string; - sourcemapIndices: string; - onboardingIndices: string; - }; isFleetPluginEnabled: boolean; }) => () => { + const indexPatternTitle = getApmIndexPatternTitle(apmIndices); + const savedObjects = [ { ...apmIndexPattern, @@ -68,7 +65,7 @@ export const tutorialProvider = ({ ], }; - if (isEnabled) { + if (apmConfig['xpack.apm.ui.enabled']) { // @ts-expect-error artifacts.application is readonly artifacts.application = { path: '/app/apm', @@ -106,7 +103,7 @@ It allows you to monitor the performance of thousands of applications in real ti euiIconType: 'apmApp', artifacts, customStatusCheckName: 'apm_fleet_server_status_check', - onPrem: onPremInstructions({ ...indices, isFleetPluginEnabled }), + onPrem: onPremInstructions({ apmConfig, isFleetPluginEnabled }), elasticCloud: createElasticCloudInstructions(cloud), previewImagePath: '/plugins/apm/assets/apm.png', savedObjects, diff --git a/x-pack/plugins/apm/typings/es_schemas/raw/fields/event_outcome.ts b/x-pack/plugins/apm/typings/es_schemas/raw/fields/event_outcome.ts new file mode 100644 index 0000000000000..d0ca41fcba4ed --- /dev/null +++ b/x-pack/plugins/apm/typings/es_schemas/raw/fields/event_outcome.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 EventOutcome = 'success' | 'failure' | 'unknown'; diff --git a/x-pack/plugins/apm/typings/es_schemas/raw/span_raw.ts b/x-pack/plugins/apm/typings/es_schemas/raw/span_raw.ts index 4865396cae7b2..01bc0ed52ecae 100644 --- a/x-pack/plugins/apm/typings/es_schemas/raw/span_raw.ts +++ b/x-pack/plugins/apm/typings/es_schemas/raw/span_raw.ts @@ -6,6 +6,7 @@ */ import { APMBaseDoc } from './apm_base_doc'; +import { EventOutcome } from './fields/event_outcome'; import { Stackframe } from './fields/stackframe'; import { TimestampUs } from './fields/timestamp_us'; @@ -17,6 +18,7 @@ interface Processor { export interface SpanRaw extends APMBaseDoc { processor: Processor; trace: { id: string }; // trace is required + event?: { outcome?: EventOutcome }; service: { name: string; environment?: string; diff --git a/x-pack/plugins/apm/typings/es_schemas/raw/transaction_raw.ts b/x-pack/plugins/apm/typings/es_schemas/raw/transaction_raw.ts index cefff756963ef..34c391134b604 100644 --- a/x-pack/plugins/apm/typings/es_schemas/raw/transaction_raw.ts +++ b/x-pack/plugins/apm/typings/es_schemas/raw/transaction_raw.ts @@ -8,6 +8,7 @@ import { APMBaseDoc } from './apm_base_doc'; import { Cloud } from './fields/cloud'; import { Container } from './fields/container'; +import { EventOutcome } from './fields/event_outcome'; import { Host } from './fields/host'; import { Http } from './fields/http'; import { Kubernetes } from './fields/kubernetes'; @@ -28,6 +29,7 @@ export interface TransactionRaw extends APMBaseDoc { processor: Processor; timestamp: TimestampUs; trace: { id: string }; // trace is required + event?: { outcome?: EventOutcome }; transaction: { duration: { us: number }; id: string; diff --git a/x-pack/plugins/banners/jest.config.js b/x-pack/plugins/banners/jest.config.js index e2d103c8e4a28..291bdb3436295 100644 --- a/x-pack/plugins/banners/jest.config.js +++ b/x-pack/plugins/banners/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/banners'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/banners', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/banners/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/elements/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/index.ts index 4925849045216..667854bf3e7e2 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/elements/index.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/elements/index.ts @@ -31,6 +31,7 @@ import { timeFilter } from './time_filter'; import { verticalBarChart } from './vert_bar_chart'; import { verticalProgressBar } from './vertical_progress_bar'; import { verticalProgressPill } from './vertical_progress_pill'; +import { tagCloud } from './tag_cloud'; import { SetupInitializer } from '../plugin'; import { ElementFactory } from '../../types'; @@ -60,6 +61,7 @@ const elementSpecs = [ verticalBarChart, verticalProgressBar, verticalProgressPill, + tagCloud, ]; const initializeElementFactories = [metricElementInitializer]; @@ -69,6 +71,5 @@ export const initializeElements: SetupInitializer = (core, plu ...elementSpecs, ...initializeElementFactories.map((factory) => factory(core, plugins)), ]; - return applyElementStrings(specs); }; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/elements/tag_cloud/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/tag_cloud/index.ts new file mode 100644 index 0000000000000..a0b464390fa22 --- /dev/null +++ b/x-pack/plugins/canvas/canvas_plugin_src/elements/tag_cloud/index.ts @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { ElementFactory } from '../../../types'; + +export const tagCloud: ElementFactory = () => ({ + name: 'tagCloud', + displayName: 'Tag Cloud', + type: 'chart', + help: 'Tagcloud visualization', + icon: 'visTagCloud', + expression: `filters + | demodata + | head 150 + | ply by="country" expression={math "count(country)" | as "Count"} + | tagcloud metric={visdimension "Count"} bucket={visdimension "country"} + | render`, +}); diff --git a/x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts b/x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts index 78fc82393994b..79bb75af677ae 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { MAP_SAVED_OBJECT_TYPE } from '../../../../plugins/maps/common/constants'; +import { MAP_SAVED_OBJECT_TYPE } from '../../../../plugins/maps/common'; import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../../../src/plugins/visualizations/common/constants'; import { LENS_EMBEDDABLE_TYPE } from '../../../../plugins/lens/common/constants'; import { SEARCH_EMBEDDABLE_TYPE } from '../../../../../src/plugins/discover/common'; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts index bd844dd3335ef..082a69a874cae 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_lens.ts @@ -85,7 +85,6 @@ export function savedLens(): ExpressionFunctionDefinition< title: args.title === null ? undefined : args.title, disableTriggers: true, palette: args.palette, - renderMode: 'noInteractivity', }, embeddableType: EmbeddableTypes.lens, generatedAt: Date.now(), diff --git a/x-pack/plugins/canvas/canvas_plugin_src/renderers/__stories__/render.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/__stories__/render.tsx index d87c24b1b7e86..643d7cdedc50d 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/renderers/__stories__/render.tsx +++ b/x-pack/plugins/canvas/canvas_plugin_src/renderers/__stories__/render.tsx @@ -13,8 +13,9 @@ export const defaultHandlers: RendererHandlers = { destroy: () => action('destroy'), getElementId: () => 'element-id', getFilter: () => 'filter', - getRenderMode: () => 'display', + getRenderMode: () => 'view', isSyncColorsEnabled: () => false, + isInteractive: () => true, onComplete: (fn) => undefined, onEmbeddableDestroyed: action('onEmbeddableDestroyed'), onEmbeddableInputChange: action('onEmbeddableInputChange'), diff --git a/x-pack/plugins/canvas/common/index.ts b/x-pack/plugins/canvas/common/index.ts index 51a53586dee3c..5bae69e8601b2 100644 --- a/x-pack/plugins/canvas/common/index.ts +++ b/x-pack/plugins/canvas/common/index.ts @@ -8,3 +8,5 @@ export const UI_SETTINGS = { ENABLE_LABS_UI: 'labs:canvas:enable_ui', }; + +export { CANVAS_APP_LOCATOR, CanvasAppLocator, CanvasAppLocatorParams } from './locator'; diff --git a/x-pack/plugins/canvas/common/lib/constants.ts b/x-pack/plugins/canvas/common/lib/constants.ts index 2b916033ce557..7212baf2414ea 100644 --- a/x-pack/plugins/canvas/common/lib/constants.ts +++ b/x-pack/plugins/canvas/common/lib/constants.ts @@ -45,3 +45,4 @@ export const CANVAS_EMBEDDABLE_CLASSNAME = `canvasEmbeddable`; export const CONTEXT_MENU_TOP_BORDER_CLASSNAME = 'canvasContextMenu--topBorder'; export const API_ROUTE_FUNCTIONS = `${API_ROUTE}/fns`; export const ESSQL_SEARCH_STRATEGY = 'essql'; +export const HEADER_BANNER_HEIGHT = 32; // This value is also declared in `/src/core/public/_variables.scss` diff --git a/x-pack/plugins/canvas/common/locator.ts b/x-pack/plugins/canvas/common/locator.ts new file mode 100644 index 0000000000000..147e4fd860982 --- /dev/null +++ b/x-pack/plugins/canvas/common/locator.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 { LocatorDefinition, LocatorPublic } from 'src/plugins/share/common'; + +import { CANVAS_APP } from './lib/constants'; + +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions +export type CanvasAppLocatorParams = { + view: 'workpadPDF'; + id: string; + page: number; +}; + +export type CanvasAppLocator = LocatorPublic; + +export const CANVAS_APP_LOCATOR = 'CANVAS_APP_LOCATOR'; + +export class CanvasAppLocatorDefinition implements LocatorDefinition { + id = CANVAS_APP_LOCATOR; + + public async getLocation(params: CanvasAppLocatorParams) { + const app = CANVAS_APP; + + if (params.view === 'workpadPDF') { + const { id, page } = params; + + return { + app, + path: `#/export/workpad/pdf/${id}/page/${page}`, + state: {}, + }; + } + + return { + app, + path: '#/', + state: {}, + }; + } +} diff --git a/x-pack/plugins/canvas/i18n/elements/element_strings.ts b/x-pack/plugins/canvas/i18n/elements/element_strings.ts index 87879c4c753c9..e1540572f4af6 100644 --- a/x-pack/plugins/canvas/i18n/elements/element_strings.ts +++ b/x-pack/plugins/canvas/i18n/elements/element_strings.ts @@ -222,4 +222,12 @@ export const getElementStrings = (): ElementStringDict => ({ defaultMessage: 'Displays progress as a portion of a vertical pill', }), }, + tagCloud: { + displayName: i18n.translate('xpack.canvas.elements.tagCloudDisplayName', { + defaultMessage: 'Tag Cloud', + }), + help: i18n.translate('xpack.canvas.elements.tagCloudHelpText', { + defaultMessage: 'Tagcloud visualization', + }), + }, }); diff --git a/x-pack/plugins/canvas/jest.config.js b/x-pack/plugins/canvas/jest.config.js index 7524e06159a41..2bff284e94ad8 100644 --- a/x-pack/plugins/canvas/jest.config.js +++ b/x-pack/plugins/canvas/jest.config.js @@ -12,4 +12,9 @@ module.exports = { transform: { '^.+\\.stories\\.tsx?$': '@storybook/addon-storyshots/injectFileName', }, + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/canvas', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/canvas/{canvas_plugin_src,common,i18n,public,server,shareable_runtime}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/canvas/kibana.json b/x-pack/plugins/canvas/kibana.json index 201fb5ab8f78f..772c030e11539 100644 --- a/x-pack/plugins/canvas/kibana.json +++ b/x-pack/plugins/canvas/kibana.json @@ -25,7 +25,8 @@ "features", "inspector", "presentationUtil", - "uiActions" + "uiActions", + "share" ], "optionalPlugins": ["home", "reporting", "usageCollection"], "requiredBundles": [ diff --git a/x-pack/plugins/canvas/public/components/arg_add_popover/arg_add_popover.tsx b/x-pack/plugins/canvas/public/components/arg_add_popover/arg_add_popover.tsx index e1cd5c55393fb..0368cd3d9facf 100644 --- a/x-pack/plugins/canvas/public/components/arg_add_popover/arg_add_popover.tsx +++ b/x-pack/plugins/canvas/public/components/arg_add_popover/arg_add_popover.tsx @@ -11,8 +11,7 @@ import { EuiButtonIcon } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { Popover } from '../popover'; import { ArgAdd } from '../arg_add'; -// @ts-expect-error untyped local -import { Arg } from '../../expression_types/arg'; +import type { Arg } from '../../expression_types/arg'; const strings = { getAddAriaLabel: () => @@ -51,8 +50,8 @@ export const ArgAddPopover: FC = ({ options }) => { options.map((opt) => ( { opt.onValueAdd(); closePopover(); diff --git a/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset.stories.storyshot b/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset.stories.storyshot index 19b44540943b3..a891b7ebe7686 100644 --- a/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset.stories.storyshot +++ b/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset.stories.storyshot @@ -64,7 +64,6 @@ exports[`Storyshots components/Assets/Asset airplane 1`] = ` > @@ -92,7 +91,6 @@ exports[`Storyshots components/Assets/Asset airplane 1`] = ` > @@ -125,7 +123,6 @@ exports[`Storyshots components/Assets/Asset airplane 1`] = ` > @@ -158,7 +155,6 @@ exports[`Storyshots components/Assets/Asset airplane 1`] = ` > @@ -251,7 +247,6 @@ exports[`Storyshots components/Assets/Asset marker 1`] = ` > @@ -279,7 +274,6 @@ exports[`Storyshots components/Assets/Asset marker 1`] = ` > @@ -312,7 +306,6 @@ exports[`Storyshots components/Assets/Asset marker 1`] = ` > @@ -345,7 +338,6 @@ exports[`Storyshots components/Assets/Asset marker 1`] = ` > diff --git a/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset_manager.stories.storyshot b/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset_manager.stories.storyshot index 05ef9df1c8601..6ef6d19e446db 100644 --- a/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset_manager.stories.storyshot +++ b/x-pack/plugins/canvas/public/components/asset_manager/__stories__/__snapshots__/asset_manager.stories.storyshot @@ -348,7 +348,6 @@ exports[`Storyshots components/Assets/AssetManager two assets 1`] = ` > @@ -376,7 +375,6 @@ exports[`Storyshots components/Assets/AssetManager two assets 1`] = ` > @@ -409,7 +407,6 @@ exports[`Storyshots components/Assets/AssetManager two assets 1`] = ` > @@ -442,7 +439,6 @@ exports[`Storyshots components/Assets/AssetManager two assets 1`] = ` > @@ -524,7 +520,6 @@ exports[`Storyshots components/Assets/AssetManager two assets 1`] = ` > @@ -552,7 +547,6 @@ exports[`Storyshots components/Assets/AssetManager two assets 1`] = ` > @@ -585,7 +579,6 @@ exports[`Storyshots components/Assets/AssetManager two assets 1`] = ` > @@ -618,7 +611,6 @@ exports[`Storyshots components/Assets/AssetManager two assets 1`] = ` > diff --git a/x-pack/plugins/canvas/public/components/datasource/__stories__/datasource_component.stories.tsx b/x-pack/plugins/canvas/public/components/datasource/__stories__/datasource_component.stories.tsx index 27fc9e8871c1f..157b612afbb23 100644 --- a/x-pack/plugins/canvas/public/components/datasource/__stories__/datasource_component.stories.tsx +++ b/x-pack/plugins/canvas/public/components/datasource/__stories__/datasource_component.stories.tsx @@ -12,7 +12,6 @@ import React from 'react'; // @ts-expect-error untyped local import { DatasourceComponent } from '../datasource_component'; import { templateFromReactComponent } from '../../../../public/lib/template_from_react_component'; -// @ts-expect-error untyped local import { Datasource } from '../../../../public/expression_types/datasource'; const TestDatasource = ({ args }: any) => ( diff --git a/x-pack/plugins/canvas/public/components/datasource/datasource.js b/x-pack/plugins/canvas/public/components/datasource/datasource.js index acda812792c45..38d3f6d112ecc 100644 --- a/x-pack/plugins/canvas/public/components/datasource/datasource.js +++ b/x-pack/plugins/canvas/public/components/datasource/datasource.js @@ -12,7 +12,9 @@ import { DatasourceComponent } from './datasource_component'; export const Datasource = (props) => { const { datasource, stateDatasource } = props; - if (!datasource || !stateDatasource) return ; + if (!datasource || !stateDatasource) { + return ; + } return ; }; diff --git a/x-pack/plugins/canvas/public/components/expression_input/__stories__/__snapshots__/expression_input.stories.storyshot b/x-pack/plugins/canvas/public/components/expression_input/__stories__/__snapshots__/expression_input.stories.storyshot index fdf14191ece4c..9c9ed566e9482 100644 --- a/x-pack/plugins/canvas/public/components/expression_input/__stories__/__snapshots__/expression_input.stories.storyshot +++ b/x-pack/plugins/canvas/public/components/expression_input/__stories__/__snapshots__/expression_input.stories.storyshot @@ -22,7 +22,6 @@ exports[`Storyshots components/ExpressionInput default 1`] = ` > diff --git a/x-pack/plugins/canvas/public/components/function_form/function_form.js b/x-pack/plugins/canvas/public/components/function_form/function_form.js deleted file mode 100644 index 3f1bd094286b4..0000000000000 --- a/x-pack/plugins/canvas/public/components/function_form/function_form.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import PropTypes from 'prop-types'; -import { compose, branch, renderComponent } from 'recompose'; -import { FunctionFormComponent } from './function_form_component'; -import { FunctionUnknown } from './function_unknown'; -import { FunctionFormContextPending } from './function_form_context_pending'; -import { FunctionFormContextError } from './function_form_context_error'; - -// helper to check the state of the passed in expression type -function checkState(state) { - return ({ context, expressionType }) => { - const matchState = !context || context.state === state; - return expressionType && expressionType.requiresContext && matchState; - }; -} - -// alternate render paths based on expression state -const branches = [ - // if no expressionType was provided, render the ArgTypeUnknown component - branch((props) => !props.expressionType, renderComponent(FunctionUnknown)), - // if the expressionType is in a pending state, render ArgTypeContextPending - branch(checkState('pending'), renderComponent(FunctionFormContextPending)), - // if the expressionType is in an error state, render ArgTypeContextError - branch(checkState('error'), renderComponent(FunctionFormContextError)), -]; - -export const FunctionForm = compose(...branches)(FunctionFormComponent); - -FunctionForm.propTypes = { - context: PropTypes.object, - expressionType: PropTypes.object, -}; diff --git a/x-pack/plugins/canvas/public/components/function_form/function_form.tsx b/x-pack/plugins/canvas/public/components/function_form/function_form.tsx new file mode 100644 index 0000000000000..abe31f0105108 --- /dev/null +++ b/x-pack/plugins/canvas/public/components/function_form/function_form.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 { FunctionFormComponent } from './function_form_component'; +import { FunctionUnknown } from './function_unknown'; +import { FunctionFormContextPending } from './function_form_context_pending'; +import { FunctionFormContextError } from './function_form_context_error'; +import { ExpressionContext } from '../../../types'; +import { RenderArgData, ExpressionType } from '../../expression_types/types'; + +type FunctionFormProps = RenderArgData; + +// helper to check the state of the passed in expression type +function is( + state: ExpressionContext['state'], + expressionType: ExpressionType, + context?: ExpressionContext +) { + const matchState = !context || context.state === state; + return expressionType && expressionType.requiresContext && matchState; +} + +export const FunctionForm: React.FunctionComponent = (props) => { + const { expressionType, context } = props; + + if (!expressionType) { + return ; + } + + if (is('pending', expressionType, context)) { + return ( + + ); + } + + if (is('error', expressionType, context)) { + return ( + + ); + } + + return ; +}; diff --git a/x-pack/plugins/canvas/public/components/function_form/function_form_component.js b/x-pack/plugins/canvas/public/components/function_form/function_form_component.js deleted file mode 100644 index fc953c8dde352..0000000000000 --- a/x-pack/plugins/canvas/public/components/function_form/function_form_component.js +++ /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 PropTypes from 'prop-types'; - -export const FunctionFormComponent = (props) => { - const passedProps = { - argResolver: props.argResolver, - args: props.args, - argType: props.argType, - argTypeDef: props.argTypeDef, - filterGroups: props.filterGroups, - context: props.context, - expressionIndex: props.expressionIndex, - expressionType: props.expressionType, - nextArgType: props.nextArgType, - nextExpressionType: props.nextExpressionType, - onAssetAdd: props.onAssetAdd, - onValueAdd: props.onValueAdd, - onValueChange: props.onValueChange, - onValueRemove: props.onValueRemove, - }; - - return
{props.expressionType.render(passedProps)}
; -}; - -FunctionFormComponent.propTypes = { - // props passed into expression type render functions - argResolver: PropTypes.func.isRequired, - args: PropTypes.object.isRequired, - argType: PropTypes.string.isRequired, - argTypeDef: PropTypes.object.isRequired, - filterGroups: PropTypes.array.isRequired, - context: PropTypes.object, - expressionIndex: PropTypes.number.isRequired, - expressionType: PropTypes.object.isRequired, - nextArgType: PropTypes.string, - nextExpressionType: PropTypes.object, - onAssetAdd: PropTypes.func.isRequired, - onValueAdd: PropTypes.func.isRequired, - onValueChange: PropTypes.func.isRequired, - onValueChange: PropTypes.func.isRequired, - onValueRemove: PropTypes.func.isRequired, - onValueRemove: PropTypes.func.isRequired, -}; diff --git a/x-pack/plugins/canvas/public/components/function_form/function_form_component.tsx b/x-pack/plugins/canvas/public/components/function_form/function_form_component.tsx new file mode 100644 index 0000000000000..8e625db94b498 --- /dev/null +++ b/x-pack/plugins/canvas/public/components/function_form/function_form_component.tsx @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { FunctionComponent } from 'react'; +import { RenderArgData } from '../../expression_types/types'; + +type FunctionFormComponentProps = RenderArgData; + +export const FunctionFormComponent: FunctionComponent = (props) => { + const passedProps = { + name: props.name, + argResolver: props.argResolver, + args: props.args, + argType: props.argType, + argTypeDef: props.argTypeDef, + filterGroups: props.filterGroups, + context: props.context, + expressionIndex: props.expressionIndex, + expressionType: props.expressionType, + nextArgType: props.nextArgType, + nextExpressionType: props.nextExpressionType, + onAssetAdd: props.onAssetAdd, + onValueAdd: props.onValueAdd, + onValueChange: props.onValueChange, + onValueRemove: props.onValueRemove, + updateContext: props.updateContext, + }; + + return
{props.expressionType.render(passedProps)}
; +}; diff --git a/x-pack/plugins/canvas/public/components/function_form/function_form_context_error.tsx b/x-pack/plugins/canvas/public/components/function_form/function_form_context_error.tsx index 2ee709edbf91c..88ad97c52a68f 100644 --- a/x-pack/plugins/canvas/public/components/function_form/function_form_context_error.tsx +++ b/x-pack/plugins/canvas/public/components/function_form/function_form_context_error.tsx @@ -6,11 +6,11 @@ */ import React, { FunctionComponent } from 'react'; -import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; +import { ExpressionContext } from '../../../types'; const strings = { - getContextErrorMessage: (errorMessage: string) => + getContextErrorMessage: (errorMessage: string | null = '') => i18n.translate('xpack.canvas.functionForm.contextError', { defaultMessage: 'ERROR: {errorMessage}', values: { @@ -18,18 +18,14 @@ const strings = { }, }), }; -interface Props { - context: { - error: string; - }; +interface FunctionFormContextErrorProps { + context: ExpressionContext; } -export const FunctionFormContextError: FunctionComponent = ({ context }) => ( +export const FunctionFormContextError: FunctionComponent = ({ + context, +}) => (
{strings.getContextErrorMessage(context.error)}
); - -FunctionFormContextError.propTypes = { - context: PropTypes.shape({ error: PropTypes.string }).isRequired, -}; diff --git a/x-pack/plugins/canvas/public/components/function_form/function_form_context_pending.js b/x-pack/plugins/canvas/public/components/function_form/function_form_context_pending.js deleted file mode 100644 index f4a2a71bb03e8..0000000000000 --- a/x-pack/plugins/canvas/public/components/function_form/function_form_context_pending.js +++ /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 React from 'react'; -import PropTypes from 'prop-types'; -import { Loading } from '../loading'; - -export class FunctionFormContextPending extends React.PureComponent { - static propTypes = { - context: PropTypes.object, - contextExpression: PropTypes.string, - expressionType: PropTypes.object.isRequired, - updateContext: PropTypes.func.isRequired, - }; - - componentDidMount() { - this.fetchContext(this.props); - } - - UNSAFE_componentWillReceiveProps(newProps) { - const oldContext = this.props.contextExpression; - const newContext = newProps.contextExpression; - const forceUpdate = newProps.expressionType.requiresContext && oldContext !== newContext; - this.fetchContext(newProps, forceUpdate); - } - - fetchContext = (props, force = false) => { - // dispatch context update if none is provided - const { expressionType, context, updateContext } = props; - if (force || (context == null && expressionType.requiresContext)) { - updateContext(); - } - }; - - render() { - return ( -
- -
- ); - } -} diff --git a/x-pack/plugins/canvas/public/components/function_form/function_form_context_pending.tsx b/x-pack/plugins/canvas/public/components/function_form/function_form_context_pending.tsx new file mode 100644 index 0000000000000..6cd7b59a2d214 --- /dev/null +++ b/x-pack/plugins/canvas/public/components/function_form/function_form_context_pending.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, { useCallback, useEffect } from 'react'; +import usePrevious from 'react-use/lib/usePrevious'; +import { Loading } from '../loading'; +import { CanvasElement, ExpressionContext } from '../../../types'; +import { ExpressionType } from '../../expression_types/types'; + +interface FunctionFormContextPendingProps { + context?: ExpressionContext; + contextExpression?: string; + expressionType: ExpressionType; + updateContext: (element?: CanvasElement) => void; +} + +export const FunctionFormContextPending: React.FunctionComponent = ( + props +) => { + const { contextExpression, expressionType, context, updateContext } = props; + const prevContextExpression = usePrevious(contextExpression); + const fetchContext = useCallback( + (force = false) => { + // dispatch context update if none is provided + if (force || (context == null && expressionType.requiresContext)) { + updateContext(); + } + }, + [context, expressionType.requiresContext, updateContext] + ); + + useEffect(() => { + const forceUpdate = + expressionType.requiresContext && prevContextExpression !== contextExpression; + fetchContext(forceUpdate); + }, [contextExpression, expressionType, fetchContext, prevContextExpression]); + + return ( +
+ +
+ ); +}; diff --git a/x-pack/plugins/canvas/public/components/function_form/index.js b/x-pack/plugins/canvas/public/components/function_form/index.js deleted file mode 100644 index 76eb23d800b00..0000000000000 --- a/x-pack/plugins/canvas/public/components/function_form/index.js +++ /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 PropTypes from 'prop-types'; -import { connect } from 'react-redux'; -import { findExpressionType } from '../../lib/find_expression_type'; -import { getId } from '../../lib/get_id'; -import { createAsset } from '../../state/actions/assets'; -import { - fetchContext, - setArgumentAtIndex, - addArgumentValueAtIndex, - deleteArgumentAtIndex, -} from '../../state/actions/elements'; -import { - getSelectedElement, - getSelectedPage, - getContextForIndex, - getGlobalFilterGroups, -} from '../../state/selectors/workpad'; -import { getAssets } from '../../state/selectors/assets'; -import { findExistingAsset } from '../../lib/find_existing_asset'; -import { FunctionForm as Component } from './function_form'; - -const mapStateToProps = (state, { expressionIndex }) => ({ - context: getContextForIndex(state, expressionIndex), - element: getSelectedElement(state), - pageId: getSelectedPage(state), - assets: getAssets(state), - filterGroups: getGlobalFilterGroups(state), -}); - -const mapDispatchToProps = (dispatch, { expressionIndex }) => ({ - addArgument: (element, pageId) => (argName, argValue) => () => { - dispatch( - addArgumentValueAtIndex({ index: expressionIndex, element, pageId, argName, value: argValue }) - ); - }, - updateContext: (element) => () => dispatch(fetchContext(expressionIndex, element)), - setArgument: (element, pageId) => (argName, valueIndex) => (value) => { - dispatch( - setArgumentAtIndex({ - index: expressionIndex, - element, - pageId, - argName, - value, - valueIndex, - }) - ); - }, - deleteArgument: (element, pageId) => (argName, argIndex) => () => { - dispatch( - deleteArgumentAtIndex({ - index: expressionIndex, - element, - pageId, - argName, - argIndex, - }) - ); - }, - onAssetAdd: (type, content) => { - // make the ID here and pass it into the action - const assetId = getId('asset'); - dispatch(createAsset(type, content, assetId)); - - // then return the id, so the caller knows the id that will be created - return assetId; - }, -}); - -const mergeProps = (stateProps, dispatchProps, ownProps) => { - const { element, pageId, assets } = stateProps; - const { argType, nextArgType } = ownProps; - const { - updateContext, - setArgument, - addArgument, - deleteArgument, - onAssetAdd, - ...dispatchers - } = dispatchProps; - - return { - ...stateProps, - ...dispatchers, - ...ownProps, - updateContext: updateContext(element), - expressionType: findExpressionType(argType), - nextExpressionType: nextArgType ? findExpressionType(nextArgType) : nextArgType, - onValueChange: setArgument(element, pageId), - onValueAdd: addArgument(element, pageId), - onValueRemove: deleteArgument(element, pageId), - onAssetAdd: (type, content) => { - const existingId = findExistingAsset(type, content, assets); - if (existingId) { - return existingId; - } - return onAssetAdd(type, content); - }, - }; -}; - -export const FunctionForm = connect(mapStateToProps, mapDispatchToProps, mergeProps)(Component); - -FunctionForm.propTypes = { - expressionIndex: PropTypes.number, - argType: PropTypes.string, - nextArgType: PropTypes.string, -}; diff --git a/x-pack/plugins/canvas/public/components/function_form/index.tsx b/x-pack/plugins/canvas/public/components/function_form/index.tsx new file mode 100644 index 0000000000000..9caf18e9e8b4e --- /dev/null +++ b/x-pack/plugins/canvas/public/components/function_form/index.tsx @@ -0,0 +1,150 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useCallback } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import { Ast } from '@kbn/interpreter/common'; +import { + ExpressionAstExpression, + ExpressionValue, +} from '../../../../../../src/plugins/expressions'; +import { findExpressionType } from '../../lib/find_expression_type'; +import { getId } from '../../lib/get_id'; +// @ts-expect-error unconverted action function +import { createAsset } from '../../state/actions/assets'; +import { + fetchContext, + setArgumentAtIndex, + addArgumentValueAtIndex, + deleteArgumentAtIndex, + // @ts-expect-error untyped local +} from '../../state/actions/elements'; +import { + getSelectedElement, + getSelectedPage, + getContextForIndex, + getGlobalFilterGroups, +} from '../../state/selectors/workpad'; +import { getAssets } from '../../state/selectors/assets'; +// @ts-expect-error unconverted lib +import { findExistingAsset } from '../../lib/find_existing_asset'; +import { FunctionForm as Component } from './function_form'; +import { ArgType, ArgTypeDef } from '../../expression_types/types'; +import { State, ExpressionContext, CanvasElement, AssetType } from '../../../types'; + +interface FunctionFormProps { + name: string; + argResolver: (ast: ExpressionAstExpression) => Promise; + args: Record> | null; + argType: ArgType; + argTypeDef: ArgTypeDef; + expressionIndex: number; + nextArgType?: ArgType; +} + +export const FunctionForm: React.FunctionComponent = (props) => { + const { expressionIndex, argType, nextArgType } = props; + const dispatch = useDispatch(); + const context = useSelector((state) => + getContextForIndex(state, expressionIndex) + ); + const element = useSelector((state) => + getSelectedElement(state) + ); + const pageId = useSelector((state) => getSelectedPage(state)); + const assets = useSelector((state) => getAssets(state)); + const filterGroups = useSelector((state) => getGlobalFilterGroups(state)); + const addArgument = useCallback( + (argName: string, argValue: string | Ast | null) => () => { + dispatch( + addArgumentValueAtIndex({ + index: expressionIndex, + element, + pageId, + argName, + value: argValue, + }) + ); + }, + [dispatch, element, expressionIndex, pageId] + ); + + const updateContext = useCallback(() => dispatch(fetchContext(expressionIndex, element)), [ + dispatch, + element, + expressionIndex, + ]); + + const setArgument = useCallback( + (argName: string, valueIndex: number) => (value: string | Ast | null) => { + dispatch( + setArgumentAtIndex({ + index: expressionIndex, + element, + pageId, + argName, + value, + valueIndex, + }) + ); + }, + [dispatch, element, expressionIndex, pageId] + ); + + const deleteArgument = useCallback( + (argName: string, argIndex: number) => () => { + dispatch( + deleteArgumentAtIndex({ + index: expressionIndex, + element, + pageId, + argName, + argIndex, + }) + ); + }, + [dispatch, element, expressionIndex, pageId] + ); + + const onAssetAddDispatch = useCallback( + (type: AssetType['type'], content: AssetType['value']) => { + // make the ID here and pass it into the action + const assetId = getId('asset'); + dispatch(createAsset(type, content, assetId)); + + // then return the id, so the caller knows the id that will be created + return assetId; + }, + [dispatch] + ); + + const onAssetAdd = useCallback( + (type: AssetType['type'], content: AssetType['value']) => { + const existingId = findExistingAsset(type, content, assets); + if (existingId) { + return existingId; + } + return onAssetAddDispatch(type, content); + }, + [assets, onAssetAddDispatch] + ); + + return ( + + ); +}; diff --git a/x-pack/plugins/canvas/public/components/home/my_workpads/__snapshots__/workpad_table.stories.storyshot b/x-pack/plugins/canvas/public/components/home/my_workpads/__snapshots__/workpad_table.stories.storyshot index 0de7012aee1a3..7d05176b8147c 100644 --- a/x-pack/plugins/canvas/public/components/home/my_workpads/__snapshots__/workpad_table.stories.storyshot +++ b/x-pack/plugins/canvas/public/components/home/my_workpads/__snapshots__/workpad_table.stories.storyshot @@ -443,7 +443,6 @@ exports[`Storyshots Home/Components/Workpad Table Workpad Table 1`] = ` > @@ -471,7 +470,6 @@ exports[`Storyshots Home/Components/Workpad Table Workpad Table 1`] = ` > @@ -619,7 +617,6 @@ exports[`Storyshots Home/Components/Workpad Table Workpad Table 1`] = ` > @@ -647,7 +644,6 @@ exports[`Storyshots Home/Components/Workpad Table Workpad Table 1`] = ` > @@ -795,7 +791,6 @@ exports[`Storyshots Home/Components/Workpad Table Workpad Table 1`] = ` > @@ -823,7 +818,6 @@ exports[`Storyshots Home/Components/Workpad Table Workpad Table 1`] = ` > diff --git a/x-pack/plugins/canvas/public/components/saved_elements_modal/__stories__/__snapshots__/element_controls.stories.storyshot b/x-pack/plugins/canvas/public/components/saved_elements_modal/__stories__/__snapshots__/element_controls.stories.storyshot index e70905298a58c..31ff283e7030f 100644 --- a/x-pack/plugins/canvas/public/components/saved_elements_modal/__stories__/__snapshots__/element_controls.stories.storyshot +++ b/x-pack/plugins/canvas/public/components/saved_elements_modal/__stories__/__snapshots__/element_controls.stories.storyshot @@ -16,7 +16,6 @@ exports[`Storyshots components/SavedElementsModal/ElementControls has two button > @@ -45,7 +44,6 @@ exports[`Storyshots components/SavedElementsModal/ElementControls has two button > diff --git a/x-pack/plugins/canvas/public/components/saved_elements_modal/__stories__/__snapshots__/element_grid.stories.storyshot b/x-pack/plugins/canvas/public/components/saved_elements_modal/__stories__/__snapshots__/element_grid.stories.storyshot index e0ed2934f44b6..db5daa86b1386 100644 --- a/x-pack/plugins/canvas/public/components/saved_elements_modal/__stories__/__snapshots__/element_grid.stories.storyshot +++ b/x-pack/plugins/canvas/public/components/saved_elements_modal/__stories__/__snapshots__/element_grid.stories.storyshot @@ -67,7 +67,6 @@ exports[`Storyshots components/SavedElementsModal/ElementGrid default 1`] = ` > @@ -96,7 +95,6 @@ exports[`Storyshots components/SavedElementsModal/ElementGrid default 1`] = ` > @@ -178,7 +176,6 @@ exports[`Storyshots components/SavedElementsModal/ElementGrid default 1`] = ` > @@ -207,7 +204,6 @@ exports[`Storyshots components/SavedElementsModal/ElementGrid default 1`] = ` > @@ -289,7 +285,6 @@ exports[`Storyshots components/SavedElementsModal/ElementGrid default 1`] = ` > @@ -318,7 +313,6 @@ exports[`Storyshots components/SavedElementsModal/ElementGrid default 1`] = ` > diff --git a/x-pack/plugins/canvas/public/components/saved_elements_modal/__stories__/__snapshots__/saved_elements_modal.stories.storyshot b/x-pack/plugins/canvas/public/components/saved_elements_modal/__stories__/__snapshots__/saved_elements_modal.stories.storyshot index 372cd12db1b99..f019f9dc8f23d 100644 --- a/x-pack/plugins/canvas/public/components/saved_elements_modal/__stories__/__snapshots__/saved_elements_modal.stories.storyshot +++ b/x-pack/plugins/canvas/public/components/saved_elements_modal/__stories__/__snapshots__/saved_elements_modal.stories.storyshot @@ -294,7 +294,6 @@ exports[`Storyshots components/SavedElementsModal with custom elements 1`] = ` > @@ -323,7 +322,6 @@ exports[`Storyshots components/SavedElementsModal with custom elements 1`] = ` > @@ -405,7 +403,6 @@ exports[`Storyshots components/SavedElementsModal with custom elements 1`] = ` > @@ -434,7 +431,6 @@ exports[`Storyshots components/SavedElementsModal with custom elements 1`] = ` > @@ -516,7 +512,6 @@ exports[`Storyshots components/SavedElementsModal with custom elements 1`] = ` > @@ -545,7 +540,6 @@ exports[`Storyshots components/SavedElementsModal with custom elements 1`] = ` > @@ -764,7 +758,6 @@ exports[`Storyshots components/SavedElementsModal with text filter 1`] = ` > @@ -793,7 +786,6 @@ exports[`Storyshots components/SavedElementsModal with text filter 1`] = ` > diff --git a/x-pack/plugins/canvas/public/components/sidebar/element_settings/element_settings.tsx b/x-pack/plugins/canvas/public/components/sidebar/element_settings/element_settings.tsx index 9cca858223078..4935647ca6810 100644 --- a/x-pack/plugins/canvas/public/components/sidebar/element_settings/element_settings.tsx +++ b/x-pack/plugins/canvas/public/components/sidebar/element_settings/element_settings.tsx @@ -12,7 +12,7 @@ import { ElementSettings as Component } from './element_settings.component'; import { State, PositionedElement } from '../../../../types'; interface Props { - selectedElementId: string; + selectedElementId: string | null; } const mapStateToProps = (state: State, { selectedElementId }: Props): StateProps => ({ diff --git a/x-pack/plugins/canvas/public/components/sidebar/sidebar.tsx b/x-pack/plugins/canvas/public/components/sidebar/sidebar.tsx index 7976ad1f6d01a..8252455e9ebd8 100644 --- a/x-pack/plugins/canvas/public/components/sidebar/sidebar.tsx +++ b/x-pack/plugins/canvas/public/components/sidebar/sidebar.tsx @@ -6,7 +6,6 @@ */ import React, { FunctionComponent } from 'react'; -// @ts-expect-error unconverted component import { SidebarContent } from './sidebar_content'; interface Props { diff --git a/x-pack/plugins/canvas/public/components/sidebar/sidebar_content.js b/x-pack/plugins/canvas/public/components/sidebar/sidebar_content.js deleted file mode 100644 index 7292a98fa91ae..0000000000000 --- a/x-pack/plugins/canvas/public/components/sidebar/sidebar_content.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { Fragment } from 'react'; -import { connect } from 'react-redux'; -import { compose, branch, renderComponent } from 'recompose'; -import { EuiSpacer } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; - -import { getSelectedToplevelNodes, getSelectedElementId } from '../../state/selectors/workpad'; -import { SidebarHeader } from '../sidebar_header'; -import { MultiElementSettings } from './multi_element_settings'; -import { GroupSettings } from './group_settings'; -import { GlobalConfig } from './global_config'; -import { ElementSettings } from './element_settings'; - -const strings = { - getGroupedElementSidebarTitle: () => - i18n.translate('xpack.canvas.sidebarContent.groupedElementSidebarTitle', { - defaultMessage: 'Grouped element', - description: - 'The title displayed when a grouped element is selected. "elements" refer to the different visualizations, images, ' + - 'text, etc that can be added in a Canvas workpad. These elements can be grouped into a larger "grouped element" ' + - 'that contains multiple individual elements.', - }), - getMultiElementSidebarTitle: () => - i18n.translate('xpack.canvas.sidebarContent.multiElementSidebarTitle', { - defaultMessage: 'Multiple elements', - description: - 'The title displayed when multiple elements are selected. "elements" refer to the different visualizations, images, ' + - 'text, etc that can be added in a Canvas workpad.', - }), - getSingleElementSidebarTitle: () => - i18n.translate('xpack.canvas.sidebarContent.singleElementSidebarTitle', { - defaultMessage: 'Selected element', - description: - 'The title displayed when a single element are selected. "element" refer to the different visualizations, images, ' + - 'text, etc that can be added in a Canvas workpad.', - }), -}; - -const mapStateToProps = (state) => ({ - selectedToplevelNodes: getSelectedToplevelNodes(state), - selectedElementId: getSelectedElementId(state), -}); - -const MultiElementSidebar = () => ( - - - - - -); - -const GroupedElementSidebar = () => ( - - - - - -); - -const SingleElementSidebar = ({ selectedElementId }) => ( - - - - -); - -const branches = [ - // multiple elements are selected - branch( - ({ selectedToplevelNodes }) => selectedToplevelNodes.length > 1, - renderComponent(MultiElementSidebar) - ), - // a single, grouped element is selected - branch( - ({ selectedToplevelNodes }) => - selectedToplevelNodes.length === 1 && selectedToplevelNodes[0].includes('group'), - renderComponent(GroupedElementSidebar) - ), - // a single element is selected - branch( - ({ selectedToplevelNodes }) => selectedToplevelNodes.length === 1, - renderComponent(SingleElementSidebar) - ), -]; - -export const SidebarContent = compose(connect(mapStateToProps), ...branches)(GlobalConfig); diff --git a/x-pack/plugins/canvas/public/components/sidebar/sidebar_content/index.ts b/x-pack/plugins/canvas/public/components/sidebar/sidebar_content/index.ts new file mode 100644 index 0000000000000..867f47ea3de65 --- /dev/null +++ b/x-pack/plugins/canvas/public/components/sidebar/sidebar_content/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { SidebarContent } from './sidebar_content'; +export { SidebarContent as SidebarContentComponent } from './sidebar_content.component'; diff --git a/x-pack/plugins/canvas/public/components/sidebar/sidebar_content/sidebar_content.component.tsx b/x-pack/plugins/canvas/public/components/sidebar/sidebar_content/sidebar_content.component.tsx new file mode 100644 index 0000000000000..c469c2fda2776 --- /dev/null +++ b/x-pack/plugins/canvas/public/components/sidebar/sidebar_content/sidebar_content.component.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, { Fragment } from 'react'; +import { EuiSpacer } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { SidebarHeader } from '../../sidebar_header'; +import { MultiElementSettings } from '../multi_element_settings'; +import { GroupSettings } from '../group_settings'; +import { GlobalConfig } from '../global_config'; +import { ElementSettings } from '../element_settings'; + +interface SidebarContentProps { + commit?: Function; + selectedElementId: string | null; + selectedToplevelNodes: string[]; +} + +const strings = { + getGroupedElementSidebarTitle: () => + i18n.translate('xpack.canvas.sidebarContent.groupedElementSidebarTitle', { + defaultMessage: 'Grouped element', + description: + 'The title displayed when a grouped element is selected. "elements" refer to the different visualizations, images, ' + + 'text, etc that can be added in a Canvas workpad. These elements can be grouped into a larger "grouped element" ' + + 'that contains multiple individual elements.', + }), + getMultiElementSidebarTitle: () => + i18n.translate('xpack.canvas.sidebarContent.multiElementSidebarTitle', { + defaultMessage: 'Multiple elements', + description: + 'The title displayed when multiple elements are selected. "elements" refer to the different visualizations, images, ' + + 'text, etc that can be added in a Canvas workpad.', + }), + getSingleElementSidebarTitle: () => + i18n.translate('xpack.canvas.sidebarContent.singleElementSidebarTitle', { + defaultMessage: 'Selected element', + description: + 'The title displayed when a single element are selected. "element" refer to the different visualizations, images, ' + + 'text, etc that can be added in a Canvas workpad.', + }), +}; + +const MultiElementSidebar: React.FC = () => ( + + + + + +); + +const GroupedElementSidebar: React.FC = () => ( + + + + + +); + +const SingleElementSidebar: React.FC<{ selectedElementId: string | null }> = ({ + selectedElementId, +}) => ( + + + + +); + +export const SidebarContent: React.FC = ({ + selectedToplevelNodes, + selectedElementId, +}) => { + if (selectedToplevelNodes.length > 1) { + return ; + } + + if (selectedToplevelNodes.length === 1 && selectedToplevelNodes[0].includes('group')) { + return ; + } + + if (selectedToplevelNodes.length === 1) { + return ; + } + + return ; +}; diff --git a/x-pack/plugins/canvas/public/components/sidebar/sidebar_content/sidebar_content.tsx b/x-pack/plugins/canvas/public/components/sidebar/sidebar_content/sidebar_content.tsx new file mode 100644 index 0000000000000..e53f5d6d515df --- /dev/null +++ b/x-pack/plugins/canvas/public/components/sidebar/sidebar_content/sidebar_content.tsx @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { useSelector } from 'react-redux'; +import { getSelectedToplevelNodes, getSelectedElementId } from '../../../state/selectors/workpad'; +import { State } from '../../../../types'; +import { SidebarContent as Component } from './sidebar_content.component'; + +interface SidebarContentProps { + commit?: Function; +} + +export const SidebarContent: React.FC = ({ commit }) => { + const selectedToplevelNodes = useSelector((state) => + getSelectedToplevelNodes(state) + ); + + const selectedElementId = useSelector((state) => + getSelectedElementId(state) + ); + + return ( + + ); +}; diff --git a/x-pack/plugins/canvas/public/components/sidebar_header/__stories__/__snapshots__/sidebar_header.stories.storyshot b/x-pack/plugins/canvas/public/components/sidebar_header/__stories__/__snapshots__/sidebar_header.stories.storyshot index e01f34abeb9f0..130f698b1152e 100644 --- a/x-pack/plugins/canvas/public/components/sidebar_header/__stories__/__snapshots__/sidebar_header.stories.storyshot +++ b/x-pack/plugins/canvas/public/components/sidebar_header/__stories__/__snapshots__/sidebar_header.stories.storyshot @@ -55,7 +55,6 @@ exports[`Storyshots components/Sidebar/SidebarHeader with layer controls 1`] = ` > @@ -83,7 +82,6 @@ exports[`Storyshots components/Sidebar/SidebarHeader with layer controls 1`] = ` > @@ -111,7 +109,6 @@ exports[`Storyshots components/Sidebar/SidebarHeader with layer controls 1`] = ` > @@ -139,7 +136,6 @@ exports[`Storyshots components/Sidebar/SidebarHeader with layer controls 1`] = ` > diff --git a/x-pack/plugins/canvas/public/components/sidebar_header/__stories__/sidebar_header.stories.tsx b/x-pack/plugins/canvas/public/components/sidebar_header/__stories__/sidebar_header.stories.tsx index f92ec99995eed..b98d994460dee 100644 --- a/x-pack/plugins/canvas/public/components/sidebar_header/__stories__/sidebar_header.stories.tsx +++ b/x-pack/plugins/canvas/public/components/sidebar_header/__stories__/sidebar_header.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -import { SidebarHeader } from '../sidebar_header'; +import { SidebarHeader } from '../sidebar_header.component'; const handlers = { bringToFront: action('bringToFront'), diff --git a/x-pack/plugins/canvas/public/components/sidebar_header/index.js b/x-pack/plugins/canvas/public/components/sidebar_header/index.js deleted file mode 100644 index 6e0fafc2f6bc2..0000000000000 --- a/x-pack/plugins/canvas/public/components/sidebar_header/index.js +++ /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 { connect } from 'react-redux'; -import { compose, withHandlers } from 'recompose'; -import { insertNodes, elementLayer, removeElements } from '../../state/actions/elements'; -import { getSelectedPage, getNodes, getSelectedToplevelNodes } from '../../state/selectors/workpad'; -import { flatten } from '../../lib/aeroelastic/functional'; -import { - layerHandlerCreators, - clipboardHandlerCreators, - basicHandlerCreators, - groupHandlerCreators, - alignmentDistributionHandlerCreators, -} from '../../lib/element_handler_creators'; -import { crawlTree } from '../workpad_page/integration_utils'; -import { selectToplevelNodes } from './../../state/actions/transient'; -import { SidebarHeader as Component } from './sidebar_header'; - -/* - * TODO: this is all copied from interactive_workpad_page and workpad_shortcuts - */ -const mapStateToProps = (state) => { - const pageId = getSelectedPage(state); - const nodes = getNodes(state, pageId); - const selectedToplevelNodes = getSelectedToplevelNodes(state); - const selectedPrimaryShapeObjects = selectedToplevelNodes - .map((id) => nodes.find((s) => s.id === id)) - .filter((shape) => shape); - const selectedPersistentPrimaryNodes = flatten( - selectedPrimaryShapeObjects.map((shape) => - nodes.find((n) => n.id === shape.id) // is it a leaf or a persisted group? - ? [shape.id] - : nodes.filter((s) => s.parent === shape.id).map((s) => s.id) - ) - ); - const selectedNodeIds = flatten(selectedPersistentPrimaryNodes.map(crawlTree(nodes))); - - return { - pageId, - selectedNodes: selectedNodeIds.map((id) => nodes.find((s) => s.id === id)), - }; -}; - -const mapDispatchToProps = (dispatch) => ({ - insertNodes: (selectedNodes, pageId) => dispatch(insertNodes(selectedNodes, pageId)), - removeNodes: (nodeIds, pageId) => dispatch(removeElements(nodeIds, pageId)), - selectToplevelNodes: (nodes) => - dispatch(selectToplevelNodes(nodes.filter((e) => !e.position.parent).map((e) => e.id))), - elementLayer: (pageId, elementId, movement) => { - dispatch(elementLayer({ pageId, elementId, movement })); - }, -}); - -export const SidebarHeader = compose( - connect(mapStateToProps, mapDispatchToProps), - withHandlers(basicHandlerCreators), - withHandlers(clipboardHandlerCreators), - withHandlers(layerHandlerCreators), - withHandlers(groupHandlerCreators), - withHandlers(alignmentDistributionHandlerCreators) -)(Component); diff --git a/x-pack/plugins/canvas/public/components/sidebar_header/index.tsx b/x-pack/plugins/canvas/public/components/sidebar_header/index.tsx new file mode 100644 index 0000000000000..64e8013b1ddfa --- /dev/null +++ b/x-pack/plugins/canvas/public/components/sidebar_header/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 { SidebarHeader } from './sidebar_header'; +export { SidebarHeader as SidebarHeaderComponent } from './sidebar_header.component'; diff --git a/x-pack/plugins/canvas/public/components/sidebar_header/sidebar_header.component.tsx b/x-pack/plugins/canvas/public/components/sidebar_header/sidebar_header.component.tsx new file mode 100644 index 0000000000000..08785af9b4b96 --- /dev/null +++ b/x-pack/plugins/canvas/public/components/sidebar_header/sidebar_header.component.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { FunctionComponent } from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiButtonIcon, EuiToolTip } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +import { ToolTipShortcut } from '../tool_tip_shortcut'; +import { ShortcutStrings } from '../../../i18n/shortcuts'; + +const strings = { + getBringForwardAriaLabel: () => + i18n.translate('xpack.canvas.sidebarHeader.bringForwardArialLabel', { + defaultMessage: 'Move element up one layer', + }), + getBringToFrontAriaLabel: () => + i18n.translate('xpack.canvas.sidebarHeader.bringToFrontArialLabel', { + defaultMessage: 'Move element to top layer', + }), + getSendBackwardAriaLabel: () => + i18n.translate('xpack.canvas.sidebarHeader.sendBackwardArialLabel', { + defaultMessage: 'Move element down one layer', + }), + getSendToBackAriaLabel: () => + i18n.translate('xpack.canvas.sidebarHeader.sendToBackArialLabel', { + defaultMessage: 'Move element to bottom layer', + }), +}; + +const shortcutHelp = ShortcutStrings.getShortcutHelp(); + +interface Props { + /** + * title to display in the header + */ + title: string; + /** + * indicated whether or not layer controls should be displayed + */ + showLayerControls?: boolean; + /** + * moves selected element to top layer + */ + bringToFront: () => void; + /** + * moves selected element up one layer + */ + bringForward: () => void; + /** + * moves selected element down one layer + */ + sendBackward: () => void; + /** + * moves selected element to bottom layer + */ + sendToBack: () => void; +} + +export const SidebarHeader: FunctionComponent = ({ + title, + showLayerControls = false, + bringToFront, + bringForward, + sendBackward, + sendToBack, +}) => ( + + + +

{title}

+
+
+ {showLayerControls ? ( + + + + + {shortcutHelp.BRING_TO_FRONT} + +
+ } + > + +
+ + + + {shortcutHelp.BRING_FORWARD} + +
+ } + > + + + + + + {shortcutHelp.SEND_BACKWARD} + +
+ } + > + + + + + + {shortcutHelp.SEND_TO_BACK} + + + } + > + + + + + + ) : null} + +); diff --git a/x-pack/plugins/canvas/public/components/sidebar_header/sidebar_header.tsx b/x-pack/plugins/canvas/public/components/sidebar_header/sidebar_header.tsx index 4ba3a7f90f64b..119195f190252 100644 --- a/x-pack/plugins/canvas/public/components/sidebar_header/sidebar_header.tsx +++ b/x-pack/plugins/canvas/public/components/sidebar_header/sidebar_header.tsx @@ -5,171 +5,72 @@ * 2.0. */ -import React, { FunctionComponent } from 'react'; -import PropTypes from 'prop-types'; -import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiButtonIcon, EuiToolTip } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; +import React from 'react'; +import deepEqual from 'react-fast-compare'; +import { useDispatch, useSelector } from 'react-redux'; +// @ts-expect-error unconverted component +import { elementLayer } from '../../state/actions/elements'; +import { getSelectedPage, getNodes, getSelectedToplevelNodes } from '../../state/selectors/workpad'; +// @ts-expect-error unconverted lib +import { flatten } from '../../lib/aeroelastic/functional'; +import { layerHandlerCreators } from '../../lib/element_handler_creators'; +// @ts-expect-error unconverted component +import { crawlTree } from '../workpad_page/integration_utils'; +import { State } from '../../../types'; +import { SidebarHeader as Component } from './sidebar_header.component'; -import { ToolTipShortcut } from '../tool_tip_shortcut/'; -import { ShortcutStrings } from '../../../i18n/shortcuts'; - -const strings = { - getBringForwardAriaLabel: () => - i18n.translate('xpack.canvas.sidebarHeader.bringForwardArialLabel', { - defaultMessage: 'Move element up one layer', - }), - getBringToFrontAriaLabel: () => - i18n.translate('xpack.canvas.sidebarHeader.bringToFrontArialLabel', { - defaultMessage: 'Move element to top layer', - }), - getSendBackwardAriaLabel: () => - i18n.translate('xpack.canvas.sidebarHeader.sendBackwardArialLabel', { - defaultMessage: 'Move element down one layer', - }), - getSendToBackAriaLabel: () => - i18n.translate('xpack.canvas.sidebarHeader.sendToBackArialLabel', { - defaultMessage: 'Move element to bottom layer', - }), +const getSelectedNodes = (state: State, pageId: string): Array => { + const nodes = getNodes(state, pageId); + const selectedToplevelNodes = getSelectedToplevelNodes(state); + const selectedPrimaryShapeObjects = selectedToplevelNodes + .map((id) => nodes.find((s) => s.id === id)) + .filter((shape) => shape); + const selectedPersistentPrimaryNodes = flatten( + selectedPrimaryShapeObjects.map((shape) => + nodes.find((n) => n.id === shape?.id) // is it a leaf or a persisted group? + ? [shape?.id] + : nodes.filter((s) => s.position?.parent === shape?.id).map((s) => s.id) + ) + ); + const selectedNodeIds = flatten(selectedPersistentPrimaryNodes.map(crawlTree(nodes))); + return selectedNodeIds.map((id: string) => nodes.find((s) => s.id === id)); }; -const shortcutHelp = ShortcutStrings.getShortcutHelp(); +const createHandlers = function ( + handlers: Record any>, + context: Record +) { + return Object.keys(handlers).reduce any>>((acc, val) => { + acc[val as keyof T] = handlers[val as keyof T](context); + return acc; + }, {} as Record any>); +}; interface Props { - /** - * title to display in the header - */ title: string; - /** - * indicated whether or not layer controls should be displayed - */ - showLayerControls?: boolean; - /** - * moves selected element to top layer - */ - bringToFront: () => void; - /** - * moves selected element up one layer - */ - bringForward: () => void; - /** - * moves selected element down one layer - */ - sendBackward: () => void; - /** - * moves selected element to bottom layer - */ - sendToBack: () => void; } -export const SidebarHeader: FunctionComponent = ({ - title, - showLayerControls, - bringToFront, - bringForward, - sendBackward, - sendToBack, -}) => ( - - - -

{title}

-
-
- {showLayerControls ? ( - - - - - {shortcutHelp.BRING_TO_FRONT} - - - } - > - - - - - - {shortcutHelp.BRING_FORWARD} - - - } - > - - - - - - {shortcutHelp.SEND_BACKWARD} - - - } - > - - - - - - {shortcutHelp.SEND_TO_BACK} - - - } - > - - - - - - ) : null} -
-); +export const SidebarHeader: React.FC = (props) => { + const pageId = useSelector((state) => getSelectedPage(state)); + const selectedNodes = useSelector>( + (state) => getSelectedNodes(state, pageId), + deepEqual + ); -SidebarHeader.propTypes = { - title: PropTypes.string.isRequired, - showLayerControls: PropTypes.bool, // TODO: remove when we support relayering multiple elements - bringToFront: PropTypes.func.isRequired, - bringForward: PropTypes.func.isRequired, - sendBackward: PropTypes.func.isRequired, - sendToBack: PropTypes.func.isRequired, -}; + const dispatch = useDispatch(); + + const elementLayerDispatch = (selectedPageId: string, elementId: string, movement: number) => { + dispatch(elementLayer({ pageId: selectedPageId, elementId, movement })); + }; + + const handlersContext = { + ...props, + pageId, + selectedNodes, + elementLayer: elementLayerDispatch, + }; + + const layerHandlers = createHandlers(layerHandlerCreators, handlersContext); -SidebarHeader.defaultProps = { - showLayerControls: false, + return ; }; diff --git a/x-pack/plugins/canvas/public/components/var_config/__stories__/__snapshots__/var_config.stories.storyshot b/x-pack/plugins/canvas/public/components/var_config/__stories__/__snapshots__/var_config.stories.storyshot index 5d8efeafef69c..8ca3dc2a94d4e 100644 --- a/x-pack/plugins/canvas/public/components/var_config/__stories__/__snapshots__/var_config.stories.storyshot +++ b/x-pack/plugins/canvas/public/components/var_config/__stories__/__snapshots__/var_config.stories.storyshot @@ -35,7 +35,6 @@ exports[`Storyshots components/Variables/VarConfig default 1`] = ` > @@ -53,7 +52,6 @@ exports[`Storyshots components/Variables/VarConfig default 1`] = ` > diff --git a/x-pack/plugins/canvas/public/components/workpad/index.js b/x-pack/plugins/canvas/public/components/workpad/index.js index 2ebefa5e0e322..ae9b6a1fee22c 100644 --- a/x-pack/plugins/canvas/public/components/workpad/index.js +++ b/x-pack/plugins/canvas/public/components/workpad/index.js @@ -8,6 +8,7 @@ import React, { useContext, useCallback } from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import { pure, compose, withState, withProps, getContext, withHandlers } from 'recompose'; +import useObservable from 'react-use/lib/useObservable'; import { transitionsRegistry } from '../../lib/transitions_registry'; import { fetchAllRenderables } from '../../state/actions/elements'; import { setZoomScale } from '../../state/actions/transient'; @@ -22,6 +23,7 @@ import { zoomHandlerCreators } from '../../lib/app_handler_creators'; import { trackCanvasUiMetric, METRIC_TYPE } from '../../lib/ui_metric'; import { LAUNCHED_FULLSCREEN, LAUNCHED_FULLSCREEN_AUTOPLAY } from '../../../common/lib/constants'; import { WorkpadRoutingContext } from '../../routes/workpad'; +import { usePlatformService } from '../../services'; import { Workpad as WorkpadComponent } from './workpad'; const mapStateToProps = (state) => { @@ -57,6 +59,10 @@ const AddContexts = (props) => { WorkpadRoutingContext ); + const platformService = usePlatformService(); + + const hasHeaderBanner = useObservable(platformService.hasHeaderBanner$()); + const setFullscreenWithEffect = useCallback( (fullscreen) => { setFullscreen(fullscreen); @@ -79,6 +85,7 @@ const AddContexts = (props) => { isFullscreen={isFullscreen} undoHistory={undo} redoHistory={redo} + hasHeaderBanner={hasHeaderBanner} /> ); }; diff --git a/x-pack/plugins/canvas/public/components/workpad/workpad.js b/x-pack/plugins/canvas/public/components/workpad/workpad.js index 1e46558c7a377..9e1c0588e447b 100644 --- a/x-pack/plugins/canvas/public/components/workpad/workpad.js +++ b/x-pack/plugins/canvas/public/components/workpad/workpad.js @@ -12,7 +12,7 @@ import Style from 'style-it'; import { WorkpadPage } from '../workpad_page'; import { Fullscreen } from '../fullscreen'; import { isTextInput } from '../../lib/is_text_input'; -import { WORKPAD_CANVAS_BUFFER } from '../../../common/lib/constants'; +import { HEADER_BANNER_HEIGHT, WORKPAD_CANVAS_BUFFER } from '../../../common/lib/constants'; export class Workpad extends React.PureComponent { static propTypes = { @@ -37,6 +37,7 @@ export class Workpad extends React.PureComponent { zoomIn: PropTypes.func.isRequired, zoomOut: PropTypes.func.isRequired, resetZoom: PropTypes.func.isRequired, + hasHeaderBanner: PropTypes.bool, }; _toggleFullscreen = () => { @@ -80,6 +81,7 @@ export class Workpad extends React.PureComponent { registerLayout, unregisterLayout, zoomScale, + hasHeaderBanner = false, } = this.props; const bufferStyle = { @@ -87,6 +89,8 @@ export class Workpad extends React.PureComponent { width: isFullscreen ? width : (width + 2 * WORKPAD_CANVAS_BUFFER) * zoomScale, }; + const headerBannerOffset = hasHeaderBanner ? HEADER_BANNER_HEIGHT : 0; + return (
{({ isFullscreen, windowSize }) => { - const scale = Math.min(windowSize.height / height, windowSize.width / width); + const scale = Math.min( + (windowSize.height - headerBannerOffset) / height, + windowSize.width / width + ); + const fsStyle = isFullscreen ? { transform: `scale3d(${scale}, ${scale}, 1)`, @@ -112,6 +120,7 @@ export class Workpad extends React.PureComponent { msTransform: `scale3d(${scale}, ${scale}, 1)`, height: windowSize.height < height ? 'auto' : height, width: windowSize.width < width ? 'auto' : width, + top: hasHeaderBanner ? `${headerBannerOffset / 2}px` : undefined, } : {}; diff --git a/x-pack/plugins/canvas/public/components/workpad_header/share_menu/share_menu.tsx b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/share_menu.tsx index ca8f5fd4e3e45..50a3890673ffa 100644 --- a/x-pack/plugins/canvas/public/components/workpad_header/share_menu/share_menu.tsx +++ b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/share_menu.tsx @@ -46,9 +46,7 @@ export const ShareMenu = () => { ReportingPanelPDFComponent !== null ? ({ onClose }: { onClose: () => void }) => ( - getPdfJobParams(sharingData, platformService.getBasePathInterface()) - } + getJobParams={() => getPdfJobParams(sharingData, platformService.getKibanaVersion())} layoutOption="canvas" onClose={onClose} /> diff --git a/x-pack/plugins/canvas/public/components/workpad_header/share_menu/utils.test.ts b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/utils.test.ts index 51d1b9abc5664..18c348aec18ea 100644 --- a/x-pack/plugins/canvas/public/components/workpad_header/share_menu/utils.test.ts +++ b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/utils.test.ts @@ -9,17 +9,11 @@ jest.mock('../../../../common/lib/fetch'); import { getPdfJobParams } from './utils'; import { workpads } from '../../../../__fixtures__/workpads'; -import { IBasePath } from 'kibana/public'; -const basePath = ({ - prepend: jest.fn().mockImplementation((s) => `basepath/s/spacey/${s}`), - get: () => 'basepath/s/spacey', - serverBasePath: `basepath`, -} as unknown) as IBasePath; const workpadSharingData = { workpad: workpads[0], pageCount: 12 }; test('getPdfJobParams returns the correct job params for canvas layout', () => { - const jobParams = getPdfJobParams(workpadSharingData, basePath); + const jobParams = getPdfJobParams(workpadSharingData, 'v99.99.99'); expect(jobParams).toMatchInlineSnapshot(` Object { "layout": Object { @@ -29,21 +23,117 @@ test('getPdfJobParams returns the correct job params for canvas layout', () => { }, "id": "canvas", }, - "objectType": "canvas workpad", - "relativeUrls": Array [ - "/s/spacey/app/canvas#/export/workpad/pdf/base-workpad/page/1", - "/s/spacey/app/canvas#/export/workpad/pdf/base-workpad/page/2", - "/s/spacey/app/canvas#/export/workpad/pdf/base-workpad/page/3", - "/s/spacey/app/canvas#/export/workpad/pdf/base-workpad/page/4", - "/s/spacey/app/canvas#/export/workpad/pdf/base-workpad/page/5", - "/s/spacey/app/canvas#/export/workpad/pdf/base-workpad/page/6", - "/s/spacey/app/canvas#/export/workpad/pdf/base-workpad/page/7", - "/s/spacey/app/canvas#/export/workpad/pdf/base-workpad/page/8", - "/s/spacey/app/canvas#/export/workpad/pdf/base-workpad/page/9", - "/s/spacey/app/canvas#/export/workpad/pdf/base-workpad/page/10", - "/s/spacey/app/canvas#/export/workpad/pdf/base-workpad/page/11", - "/s/spacey/app/canvas#/export/workpad/pdf/base-workpad/page/12", + "locatorParams": Array [ + Object { + "id": "CANVAS_APP_LOCATOR", + "params": Object { + "id": "base-workpad", + "page": 1, + "view": "workpadPDF", + }, + "version": "v99.99.99", + }, + Object { + "id": "CANVAS_APP_LOCATOR", + "params": Object { + "id": "base-workpad", + "page": 2, + "view": "workpadPDF", + }, + "version": "v99.99.99", + }, + Object { + "id": "CANVAS_APP_LOCATOR", + "params": Object { + "id": "base-workpad", + "page": 3, + "view": "workpadPDF", + }, + "version": "v99.99.99", + }, + Object { + "id": "CANVAS_APP_LOCATOR", + "params": Object { + "id": "base-workpad", + "page": 4, + "view": "workpadPDF", + }, + "version": "v99.99.99", + }, + Object { + "id": "CANVAS_APP_LOCATOR", + "params": Object { + "id": "base-workpad", + "page": 5, + "view": "workpadPDF", + }, + "version": "v99.99.99", + }, + Object { + "id": "CANVAS_APP_LOCATOR", + "params": Object { + "id": "base-workpad", + "page": 6, + "view": "workpadPDF", + }, + "version": "v99.99.99", + }, + Object { + "id": "CANVAS_APP_LOCATOR", + "params": Object { + "id": "base-workpad", + "page": 7, + "view": "workpadPDF", + }, + "version": "v99.99.99", + }, + Object { + "id": "CANVAS_APP_LOCATOR", + "params": Object { + "id": "base-workpad", + "page": 8, + "view": "workpadPDF", + }, + "version": "v99.99.99", + }, + Object { + "id": "CANVAS_APP_LOCATOR", + "params": Object { + "id": "base-workpad", + "page": 9, + "view": "workpadPDF", + }, + "version": "v99.99.99", + }, + Object { + "id": "CANVAS_APP_LOCATOR", + "params": Object { + "id": "base-workpad", + "page": 10, + "view": "workpadPDF", + }, + "version": "v99.99.99", + }, + Object { + "id": "CANVAS_APP_LOCATOR", + "params": Object { + "id": "base-workpad", + "page": 11, + "view": "workpadPDF", + }, + "version": "v99.99.99", + }, + Object { + "id": "CANVAS_APP_LOCATOR", + "params": Object { + "id": "base-workpad", + "page": 12, + "view": "workpadPDF", + }, + "version": "v99.99.99", + }, ], + "objectType": "canvas workpad", "title": "base workpad", } `); diff --git a/x-pack/plugins/canvas/public/components/workpad_header/share_menu/utils.ts b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/utils.ts index bbd6b42a38333..311ef73e1c973 100644 --- a/x-pack/plugins/canvas/public/components/workpad_header/share_menu/utils.ts +++ b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/utils.ts @@ -5,8 +5,9 @@ * 2.0. */ -import { IBasePath } from 'kibana/public'; -import rison from 'rison-node'; +import type { RedirectOptions } from 'src/plugins/share/public'; +import { CANVAS_APP_LOCATOR } from '../../../../common/locator'; +import { CanvasAppLocatorParams } from '../../../../common/locator'; import { CanvasWorkpad } from '../../../../types'; export interface CanvasWorkpadSharingData { @@ -16,11 +17,8 @@ export interface CanvasWorkpadSharingData { export function getPdfJobParams( { workpad: { id, name: title, width, height }, pageCount }: CanvasWorkpadSharingData, - basePath: IBasePath + version: string ) { - const urlPrefix = basePath.get().replace(basePath.serverBasePath, ''); // for Spaces prefix, which is included in basePath.get() - const canvasEntry = `${urlPrefix}/app/canvas#`; - // The viewport in Reporting by specifying the dimensions. In order for things to work, // we need a viewport that will include all of the pages in the workpad. The viewport // also needs to include any offset values from the 0,0 position, otherwise the cropped @@ -32,9 +30,18 @@ export function getPdfJobParams( // viewport size. // build a list of all page urls for exporting, they are captured one at a time - const workpadUrls = []; + + const locatorParams: Array> = []; for (let i = 1; i <= pageCount; i++) { - workpadUrls.push(rison.encode(`${canvasEntry}/export/workpad/pdf/${id}/page/${i}`)); + locatorParams.push({ + id: CANVAS_APP_LOCATOR, + version, + params: { + view: 'workpadPDF', + id, + page: i, + }, + }); } return { @@ -43,7 +50,7 @@ export function getPdfJobParams( id: 'canvas', }, objectType: 'canvas workpad', - relativeUrls: workpadUrls, + locatorParams, title, }; } diff --git a/x-pack/plugins/canvas/public/expression_types/arg.js b/x-pack/plugins/canvas/public/expression_types/arg.js deleted file mode 100644 index c3b351e5634ec..0000000000000 --- a/x-pack/plugins/canvas/public/expression_types/arg.js +++ /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 { createElement } from 'react'; -import { pick } from 'lodash'; -import { ArgForm } from '../components/arg_form'; -import { argTypeRegistry } from './arg_type'; - -export class Arg { - constructor(props) { - const argType = argTypeRegistry.get(props.argType); - if (!argType) { - throw new Error(`Invalid arg type: ${props.argType}`); - } - if (!props.name) { - throw new Error('Args must have a name property'); - } - - // properties that can be overridden - const defaultProps = { - multi: false, - required: false, - types: [], - default: argType.default != null ? argType.default : null, - options: {}, - resolve: () => ({}), - }; - - const viewOverrides = { - argType, - ...pick(props, [ - 'name', - 'displayName', - 'help', - 'multi', - 'required', - 'types', - 'default', - 'resolve', - 'options', - ]), - }; - - Object.assign(this, defaultProps, argType, viewOverrides); - } - - // TODO: Document what these otherProps are. Maybe make them named arguments? - render({ onValueChange, onValueRemove, argValue, key, label, ...otherProps }) { - // This is everything the arg_type template needs to render - const templateProps = { - ...otherProps, - ...this.resolve(otherProps), - onValueChange, - argValue, - typeInstance: this, - }; - - const formProps = { - key, - argTypeInstance: this, - valueMissing: this.required && argValue == null, - label, - onValueChange, - onValueRemove, - templateProps, - argId: key, - }; - - return createElement(ArgForm, formProps); - } -} diff --git a/x-pack/plugins/canvas/public/expression_types/arg.ts b/x-pack/plugins/canvas/public/expression_types/arg.ts new file mode 100644 index 0000000000000..0fc1c996f327c --- /dev/null +++ b/x-pack/plugins/canvas/public/expression_types/arg.ts @@ -0,0 +1,145 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { merge } from 'lodash'; +import { createElement } from 'react'; +import { Ast } from '@kbn/interpreter/common'; +// @ts-expect-error unconverted components +import { ArgForm } from '../components/arg_form'; +import { argTypeRegistry } from './arg_type_registry'; +import type { ArgType, ArgTypeDef, ExpressionType } from './types'; +import { + AssetType, + CanvasElement, + ExpressionAstExpression, + ExpressionValue, + ExpressionContext, +} from '../../types'; +import { BaseFormProps } from './base_form'; + +interface ArtOwnProps { + argType: ArgType; + multi?: boolean; + required?: boolean; + types?: string[]; + default?: string | null; + resolve?: (...args: any[]) => any; + options?: { + include?: string[]; + confirm?: string; + labelValue?: string; + choices?: Array<{ name: string; value: string }>; + min?: number; + max?: number; + shapes?: string[]; + }; +} +export type ArgProps = ArtOwnProps & BaseFormProps; + +export interface DataArg { + argValue?: string | Ast | null; + skipRender?: boolean; + label?: string; + valueIndex: number; + key?: string; + labels?: string[]; + contextExpression?: string; + name: string; + argResolver: (ast: ExpressionAstExpression) => Promise; + args: Record> | null; + argType: ArgType; + argTypeDef?: ArgTypeDef; + filterGroups: string[]; + context?: ExpressionContext; + expressionIndex: number; + expressionType: ExpressionType; + nextArgType?: ArgType; + nextExpressionType?: ExpressionType; + onValueAdd: (argName: string, argValue: string | Ast | null) => () => void; + onAssetAdd: (type: AssetType['type'], content: AssetType['value']) => string; + onValueChange: (value: Ast | string) => void; + onValueRemove: () => void; + updateContext: (element?: CanvasElement) => void; + typeInstance?: ExpressionType; +} + +export class Arg { + argType?: ArgType; + multi?: boolean; + required?: boolean; + types?: string[]; + default?: string | null; + resolve?: (...args: any[]) => any; + options?: { + include: string[]; + }; + name: string = ''; + displayName?: string; + help?: string; + + constructor(props: ArgProps) { + const argType = argTypeRegistry.get(props.argType); + if (!argType) { + throw new Error(`Invalid arg type: ${props.argType}`); + } + if (!props.name) { + throw new Error('Args must have a name property'); + } + + // properties that can be overridden + const defaultProps = { + multi: false, + required: false, + types: [], + default: argType.default != null ? argType.default : null, + options: {}, + resolve: () => ({}), + }; + + const { name, displayName, help, multi, types, options } = props; + + merge(this, defaultProps, argType, { + argType, + name, + displayName, + help, + multi, + types, + default: props.default, + resolve: props.resolve, + required: props.required, + options, + }); + } + + // TODO: Document what these otherProps are. Maybe make them named arguments? + render(data: DataArg) { + const { onValueChange, onValueRemove, argValue, key, label, ...otherProps } = data; + // This is everything the arg_type template needs to render + const templateProps = { + ...otherProps, + ...this.resolve?.(otherProps), + onValueChange, + argValue, + typeInstance: this, + }; + + const formProps = { + key, + argTypeInstance: this, + valueMissing: this.required && argValue == null, + label, + onValueChange, + onValueRemove, + templateProps, + argId: key, + options: this.options, + }; + + return createElement(ArgForm, formProps); + } +} diff --git a/x-pack/plugins/canvas/public/expression_types/arg_type.js b/x-pack/plugins/canvas/public/expression_types/arg_type.js deleted file mode 100644 index 30273cedd818c..0000000000000 --- a/x-pack/plugins/canvas/public/expression_types/arg_type.js +++ /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 { Registry } from '@kbn/interpreter/common'; -import { BaseForm } from './base_form'; - -export class ArgType extends BaseForm { - constructor(props) { - super(props); - - this.simpleTemplate = props.simpleTemplate; - this.template = props.template; - this.default = props.default; - this.resolveArgValue = Boolean(props.resolveArgValue); - } -} - -class ArgTypeRegistry extends Registry { - wrapper(obj) { - return new ArgType(obj); - } -} - -export const argTypeRegistry = new ArgTypeRegistry(); diff --git a/x-pack/plugins/canvas/public/expression_types/arg_type.ts b/x-pack/plugins/canvas/public/expression_types/arg_type.ts new file mode 100644 index 0000000000000..2345b07d79807 --- /dev/null +++ b/x-pack/plugins/canvas/public/expression_types/arg_type.ts @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { templateFromReactComponent } from '../lib/template_from_react_component'; +import { BaseForm, BaseFormProps } from './base_form'; + +interface ArgTypeOwnProps { + simpleTemplate: ReturnType; + template?: ReturnType; + default?: string; + resolveArgValue?: boolean; +} + +export type ArgTypeProps = ArgTypeOwnProps & BaseFormProps; + +export class ArgType extends BaseForm { + simpleTemplate: ReturnType; + template?: ReturnType; + default?: string; + resolveArgValue: boolean; + + constructor(props: ArgTypeProps) { + super(props); + this.simpleTemplate = props.simpleTemplate; + this.template = props.template; + this.default = props.default; + this.resolveArgValue = Boolean(props.resolveArgValue); + } +} diff --git a/x-pack/plugins/canvas/public/expression_types/arg_type_registry.ts b/x-pack/plugins/canvas/public/expression_types/arg_type_registry.ts new file mode 100644 index 0000000000000..579245d0d312b --- /dev/null +++ b/x-pack/plugins/canvas/public/expression_types/arg_type_registry.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 { Registry } from '@kbn/interpreter/common'; +import { ArgType, ArgTypeProps } from './arg_type'; + +class ArgTypeRegistry extends Registry { + wrapper(obj: ArgTypeProps) { + return new ArgType(obj); + } +} + +export const argTypeRegistry = new ArgTypeRegistry(); diff --git a/x-pack/plugins/canvas/public/expression_types/arg_types/series_style/__stories__/__snapshots__/simple_template.stories.storyshot b/x-pack/plugins/canvas/public/expression_types/arg_types/series_style/__stories__/__snapshots__/simple_template.stories.storyshot index f4233e27345c0..ccdd0a8592f2b 100644 --- a/x-pack/plugins/canvas/public/expression_types/arg_types/series_style/__stories__/__snapshots__/simple_template.stories.storyshot +++ b/x-pack/plugins/canvas/public/expression_types/arg_types/series_style/__stories__/__snapshots__/simple_template.stories.storyshot @@ -212,7 +212,6 @@ exports[`Storyshots arguments/SeriesStyle/components simple: no series 1`] = ` > diff --git a/x-pack/plugins/canvas/public/expression_types/base_form.js b/x-pack/plugins/canvas/public/expression_types/base_form.js deleted file mode 100644 index 7ca2d6a78b656..0000000000000 --- a/x-pack/plugins/canvas/public/expression_types/base_form.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export class BaseForm { - constructor(props) { - if (!props.name) { - throw new Error('Expression specs require a name property'); - } - - this.name = props.name; - this.displayName = props.displayName || this.name; - this.help = props.help || ''; - } -} diff --git a/x-pack/plugins/canvas/public/expression_types/base_form.ts b/x-pack/plugins/canvas/public/expression_types/base_form.ts new file mode 100644 index 0000000000000..11d6b24ee3e86 --- /dev/null +++ b/x-pack/plugins/canvas/public/expression_types/base_form.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. + */ + +export interface BaseFormProps { + name: string; + displayName?: string; + help?: string; +} + +export class BaseForm { + name: string; + displayName: string; + help: string; + + constructor(props: BaseFormProps) { + if (!props.name) { + throw new Error('Expression specs require a name property'); + } + + this.name = props.name; + this.displayName = props.displayName || this.name; + this.help = props.help || ''; + } +} diff --git a/x-pack/plugins/canvas/public/expression_types/datasource.js b/x-pack/plugins/canvas/public/expression_types/datasource.js deleted file mode 100644 index f8bbff702a4e9..0000000000000 --- a/x-pack/plugins/canvas/public/expression_types/datasource.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import PropTypes from 'prop-types'; -import { Registry } from '@kbn/interpreter/common'; -import { RenderToDom } from '../components/render_to_dom'; -import { ExpressionFormHandlers } from '../../common/lib/expression_form_handlers'; -import { BaseForm } from './base_form'; - -const defaultTemplate = () => ( -
-

This datasource has no interface. Use the expression editor to make changes.

-
-); - -class DatasourceWrapper extends React.PureComponent { - static propTypes = { - spec: PropTypes.object.isRequired, - datasourceProps: PropTypes.object.isRequired, - handlers: PropTypes.object.isRequired, - }; - - componentDidUpdate() { - this.callRenderFn(); - } - - componentWillUnmount() { - this.props.handlers.destroy(); - } - - callRenderFn = () => { - const { spec, datasourceProps, handlers } = this.props; - const { template } = spec; - template(this.domNode, datasourceProps, handlers); - }; - - render() { - return ( - { - this.domNode = domNode; - this.callRenderFn(); - }} - /> - ); - } -} - -export class Datasource extends BaseForm { - constructor(props) { - super(props); - - this.template = props.template || defaultTemplate; - this.image = props.image; - } - - render(props = {}) { - const expressionFormHandlers = new ExpressionFormHandlers(); - return ( - - ); - } -} - -class DatasourceRegistry extends Registry { - wrapper(obj) { - return new Datasource(obj); - } -} - -export const datasourceRegistry = new DatasourceRegistry(); diff --git a/x-pack/plugins/canvas/public/expression_types/datasource.tsx b/x-pack/plugins/canvas/public/expression_types/datasource.tsx new file mode 100644 index 0000000000000..7566c473a720a --- /dev/null +++ b/x-pack/plugins/canvas/public/expression_types/datasource.tsx @@ -0,0 +1,101 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useEffect, useRef, useCallback } from 'react'; +import useEffectOnce from 'react-use/lib/useEffectOnce'; +import { Ast } from '@kbn/interpreter/common'; +import { RenderToDom } from '../components/render_to_dom'; +import { BaseForm, BaseFormProps } from './base_form'; +import { ExpressionFormHandlers } from '../../common/lib'; +import { ExpressionFunction } from '../../types'; + +const defaultTemplate = () => ( +
+

This datasource has no interface. Use the expression editor to make changes.

+
+); + +type TemplateFn = ( + domNode: HTMLElement, + config: DatasourceRenderProps, + handlers: ExpressionFormHandlers +) => void; + +export type DatasourceProps = { + template?: TemplateFn; + image?: string; + requiresContext?: boolean; +} & BaseFormProps; + +export interface DatasourceRenderProps { + args: Record> | null; + updateArgs: (...args: any[]) => void; + datasourceDef: ExpressionFunction; + isInvalid: boolean; + setInvalid: (invalid: boolean) => void; + defaultIndex: string; + renderError: (...args: any[]) => void; +} + +interface DatasourceWrapperProps { + handlers: ExpressionFormHandlers; + spec: Datasource; + datasourceProps: DatasourceRenderProps; +} + +const DatasourceWrapper: React.FunctionComponent = (props) => { + const domNodeRef = useRef(); + const { spec, datasourceProps, handlers } = props; + + const callRenderFn = useCallback(() => { + const { template } = spec; + + if (!domNodeRef.current) { + return; + } + + template(domNodeRef.current, datasourceProps, handlers); + }, [datasourceProps, handlers, spec]); + + useEffect(() => { + callRenderFn(); + }, [callRenderFn, props]); + + useEffectOnce(() => () => { + handlers.destroy(); + }); + + return ( + { + domNodeRef.current = domNode; + callRenderFn(); + }} + /> + ); +}; + +export class Datasource extends BaseForm { + template: TemplateFn | React.FC; + image?: string; + requiresContext?: boolean; + + constructor(props: DatasourceProps) { + super(props); + + this.template = props.template ?? defaultTemplate; + this.image = props.image; + this.requiresContext = props.requiresContext; + } + + render(props: DatasourceRenderProps) { + const expressionFormHandlers = new ExpressionFormHandlers(); + return ( + + ); + } +} diff --git a/x-pack/plugins/canvas/public/expression_types/datasource_registry.ts b/x-pack/plugins/canvas/public/expression_types/datasource_registry.ts new file mode 100644 index 0000000000000..b6427fac9d4a0 --- /dev/null +++ b/x-pack/plugins/canvas/public/expression_types/datasource_registry.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 { Registry } from '@kbn/interpreter/common'; +import { Datasource } from './datasource'; +import type { Datasource as DatasourceType, DatasourceProps } from './datasource'; + +class DatasourceRegistry extends Registry { + wrapper(obj: DatasourceProps): DatasourceType { + return new Datasource(obj); + } +} + +export const datasourceRegistry = new DatasourceRegistry(); diff --git a/x-pack/plugins/canvas/public/expression_types/function_form.js b/x-pack/plugins/canvas/public/expression_types/function_form.js deleted file mode 100644 index 2f4e983e9fd4e..0000000000000 --- a/x-pack/plugins/canvas/public/expression_types/function_form.js +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiCallOut } from '@elastic/eui'; -import React from 'react'; -import { isPlainObject, uniq, last, compact } from 'lodash'; -import { fromExpression } from '@kbn/interpreter/common'; -import { ArgAddPopover } from '../components/arg_add_popover'; -import { SidebarSection } from '../components/sidebar/sidebar_section'; -import { SidebarSectionTitle } from '../components/sidebar/sidebar_section_title'; -import { BaseForm } from './base_form'; -import { Arg } from './arg'; - -export class FunctionForm extends BaseForm { - constructor(props) { - super({ ...props }); - - this.args = props.args || []; - this.resolve = props.resolve || (() => ({})); - } - - renderArg(props, dataArg) { - const { onValueRemove, onValueChange, ...passedProps } = props; - const { arg, argValues, skipRender, label } = dataArg; - const { argType, expressionIndex } = passedProps; - - // TODO: show some information to the user than an argument was skipped - if (!arg || skipRender) { - return null; - } - - const renderArgWithProps = (argValue, valueIndex) => - arg.render({ - key: `${argType}-${expressionIndex}-${arg.name}-${valueIndex}`, - ...passedProps, - label, - valueIndex, - argValue, - onValueChange: onValueChange(arg.name, valueIndex), - onValueRemove: onValueRemove(arg.name, valueIndex), - }); - - // render the argument's template, wrapped in a remove control - // if the argument is required but not included, render the control anyway - if (!argValues && arg.required) { - return renderArgWithProps({ type: undefined, value: '' }, 0); - } - - // render all included argument controls - return argValues && argValues.map(renderArgWithProps); - } - - // TODO: Argument adding isn't very good, we should improve this UI - getAddableArg(props, dataArg) { - const { onValueAdd } = props; - const { arg, argValues, skipRender } = dataArg; - - // skip arguments that aren't defined in the expression type schema - if (!arg || arg.required || skipRender) { - return null; - } - if (argValues && !arg.multi) { - return null; - } - - const value = arg.default == null ? null : fromExpression(arg.default, 'argument'); - - return { arg, onValueAdd: onValueAdd(arg.name, value) }; - } - - resolveArg() { - // basically a no-op placeholder - return {}; - } - - render(data = {}) { - const { args, argTypeDef } = data; - - // Don't instaniate these until render time, to give the registries a chance to populate. - const argInstances = this.args.map((argSpec) => new Arg(argSpec)); - - if (!isPlainObject(args)) { - throw new Error(`Form "${this.name}" expects "args" object`); - } - - // get a mapping of arg values from the expression and from the renderable's schema - const argNames = uniq(argInstances.map((arg) => arg.name).concat(Object.keys(args))); - const dataArgs = argNames.map((argName) => { - const arg = argInstances.find((arg) => arg.name === argName); - - // if arg is not multi, only preserve the last value found - // otherwise, leave the value alone (including if the arg is not defined) - const isMulti = arg && arg.multi; - const argValues = args[argName] && !isMulti ? [last(args[argName])] : args[argName]; - - return { arg, argValues }; - }); - - // props are passed to resolve and the returned object is mixed into the template props - const props = { ...data, ...this.resolve(data), typeInstance: this }; - - try { - // allow a hook to override the data args - const resolvedDataArgs = dataArgs.map((d) => ({ ...d, ...this.resolveArg(d, props) })); - - const argumentForms = compact(resolvedDataArgs.map((d) => this.renderArg(props, d))); - const addableArgs = compact(resolvedDataArgs.map((d) => this.getAddableArg(props, d))); - - if (!addableArgs.length && !argumentForms.length) { - return null; - } - - return ( - - - {addableArgs.length === 0 ? null : } - - {argumentForms} - - ); - } catch (e) { - return ( - -

{e.message}

-
- ); - } - } -} diff --git a/x-pack/plugins/canvas/public/expression_types/function_form.tsx b/x-pack/plugins/canvas/public/expression_types/function_form.tsx new file mode 100644 index 0000000000000..70279453ac658 --- /dev/null +++ b/x-pack/plugins/canvas/public/expression_types/function_form.tsx @@ -0,0 +1,193 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { ReactElement } from 'react'; +import { EuiCallOut } from '@elastic/eui'; +import { isPlainObject, uniq, last, compact } from 'lodash'; +import { Ast, fromExpression } from '@kbn/interpreter/common'; +import { ArgAddPopover } from '../components/arg_add_popover'; +// @ts-expect-error unconverted components +import { SidebarSection } from '../components/sidebar/sidebar_section'; +// @ts-expect-error unconverted components +import { SidebarSectionTitle } from '../components/sidebar/sidebar_section_title'; +import { BaseForm, BaseFormProps } from './base_form'; +import { Arg, ArgProps } from './arg'; +import { ArgType, ArgTypeDef, ExpressionType } from './types'; +import { + AssetType, + CanvasElement, + DatatableColumn, + ExpressionAstExpression, + ExpressionContext, + ExpressionValue, +} from '../../types'; + +export interface DataArg { + arg: Arg | undefined; + argValues?: Array; + skipRender?: boolean; + label?: 'string'; +} + +export type RenderArgData = BaseFormProps & { + argType: ArgType; + argTypeDef?: ArgTypeDef; + args: Record> | null; + argResolver: (ast: ExpressionAstExpression) => Promise; + context?: ExpressionContext; + contextExpression?: string; + expressionIndex: number; + expressionType: ExpressionType; + filterGroups: string[]; + nextArgType?: ArgType; + nextExpressionType?: ExpressionType; + onValueAdd: (argName: string, argValue: string | Ast | null) => () => void; + onValueChange: (argName: string, argIndex: number) => (value: string | Ast) => void; + onValueRemove: (argName: string, argIndex: number) => () => void; + onAssetAdd: (type: AssetType['type'], content: AssetType['value']) => string; + updateContext: (element?: CanvasElement) => void; + typeInstance?: ExpressionType; + columns?: DatatableColumn[]; +}; + +export type RenderArgProps = { + typeInstance: FunctionForm; +} & RenderArgData; + +export type FunctionFormProps = { + args?: ArgProps[]; + resolve?: (...args: any[]) => any; +} & BaseFormProps; + +export class FunctionForm extends BaseForm { + args: ArgProps[]; + resolve: (...args: any[]) => any; + + constructor(props: FunctionFormProps) { + super({ ...props }); + + this.args = props.args || []; + this.resolve = props.resolve || (() => ({})); + } + + renderArg(props: RenderArgProps, dataArg: DataArg) { + const { onValueRemove, onValueChange, ...passedProps } = props; + const { arg, argValues, skipRender, label } = dataArg; + const { argType, expressionIndex } = passedProps; + + // TODO: show some information to the user than an argument was skipped + if (!arg || skipRender) { + return null; + } + const renderArgWithProps = ( + argValue: string | Ast | null, + valueIndex: number + ): ReactElement | null => + arg.render({ + key: `${argType}-${expressionIndex}-${arg.name}-${valueIndex}`, + ...passedProps, + label, + valueIndex, + onValueChange: onValueChange(arg.name, valueIndex), + onValueRemove: onValueRemove(arg.name, valueIndex), + argValue: argValue ?? null, + }); + + // render the argument's template, wrapped in a remove control + // if the argument is required but not included, render the control anyway + if (!argValues && arg.required) { + return renderArgWithProps(null, 0); + } + + // render all included argument controls + return argValues && argValues.map(renderArgWithProps); + } + + // TODO: Argument adding isn't very good, we should improve this UI + getAddableArg(props: RenderArgProps, dataArg: DataArg) { + const { onValueAdd } = props; + const { arg, argValues, skipRender } = dataArg; + + // skip arguments that aren't defined in the expression type schema + if (!arg || arg.required || skipRender) { + return null; + } + if (argValues && !arg.multi) { + return null; + } + + const value = arg.default == null ? null : fromExpression(arg.default, 'argument'); + return { arg, onValueAdd: onValueAdd(arg.name, value) }; + } + + resolveArg(...args: unknown[]) { + // basically a no-op placeholder + return {}; + } + + render(data: RenderArgData) { + if (!data) { + data = { + args: null, + argTypeDef: undefined, + } as RenderArgData; + } + const { args, argTypeDef } = data; + + // Don't instaniate these until render time, to give the registries a chance to populate. + const argInstances = this.args.map((argSpec) => new Arg(argSpec)); + + if (args === null || !isPlainObject(args)) { + throw new Error(`Form "${this.name}" expects "args" object`); + } + + // get a mapping of arg values from the expression and from the renderable's schema + const argNames = uniq(argInstances.map((arg) => arg.name).concat(Object.keys(args))); + const dataArgs = argNames.map((argName) => { + const arg = argInstances.find((argument) => argument.name === argName); + // if arg is not multi, only preserve the last value found + // otherwise, leave the value alone (including if the arg is not defined) + const isMulti = arg && arg.multi; + const argValues = args[argName] && !isMulti ? [last(args[argName]) ?? null] : args[argName]; + + return { arg, argValues }; + }); + + // props are passed to resolve and the returned object is mixed into the template props + const props = { ...data, ...this.resolve(data), typeInstance: this }; + try { + // allow a hook to override the data args + const resolvedDataArgs = dataArgs.map((d) => ({ ...d, ...this.resolveArg(d, props) })); + + const argumentForms = compact( + resolvedDataArgs.map((dataArg) => this.renderArg(props, dataArg)) + ); + const addableArgs = compact( + resolvedDataArgs.map((dataArg) => this.getAddableArg(props, dataArg)) + ); + + if (!addableArgs.length && !argumentForms.length) { + return null; + } + + return ( + + + {addableArgs.length === 0 ? null : } + + {argumentForms} + + ); + } catch (e: any) { + return ( + +

{e.message}

+
+ ); + } + } +} diff --git a/x-pack/plugins/canvas/public/expression_types/index.js b/x-pack/plugins/canvas/public/expression_types/index.js deleted file mode 100644 index ce1af41669086..0000000000000 --- a/x-pack/plugins/canvas/public/expression_types/index.js +++ /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 { Datasource, datasourceRegistry } from './datasource'; -export { Transform, transformRegistry } from './transform'; -export { Model, modelRegistry } from './model'; -export { View, viewRegistry } from './view'; -export { ArgType, argTypeRegistry } from './arg_type'; -export { Arg } from './arg'; diff --git a/x-pack/plugins/canvas/public/expression_types/index.ts b/x-pack/plugins/canvas/public/expression_types/index.ts new file mode 100644 index 0000000000000..88cb9aa1548a2 --- /dev/null +++ b/x-pack/plugins/canvas/public/expression_types/index.ts @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { Datasource } from './datasource'; +export { datasourceRegistry } from './datasource_registry'; + +export { Transform } from './transform'; +export { transformRegistry } from './transform_registry'; + +export { Model } from './model'; +export { modelRegistry } from './model_registry'; + +export { View } from './view'; +export { viewRegistry } from './view_registry'; + +export { ArgType } from './arg_type'; +export { argTypeRegistry } from './arg_type_registry'; + +export { Arg } from './arg'; diff --git a/x-pack/plugins/canvas/public/expression_types/model.js b/x-pack/plugins/canvas/public/expression_types/model.js deleted file mode 100644 index 1ba4f74a0ba5a..0000000000000 --- a/x-pack/plugins/canvas/public/expression_types/model.js +++ /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 { get, pick } from 'lodash'; -import { Registry } from '@kbn/interpreter/common'; -import { FunctionForm } from './function_form'; - -const NO_NEXT_EXP = 'no next expression'; -const MISSING_MODEL_ARGS = 'missing model args'; - -function getModelArgs(expressionType) { - if (!expressionType) { - return NO_NEXT_EXP; - } - - if (!expressionType.modelArgs) { - return MISSING_MODEL_ARGS; - } - - return expressionType.modelArgs.length > 0 ? expressionType.modelArgs : MISSING_MODEL_ARGS; -} - -export class Model extends FunctionForm { - constructor(props) { - super(props); - - const propNames = ['requiresContext']; - const defaultProps = { - requiresContext: true, - }; - - Object.assign(this, defaultProps, pick(props, propNames)); - } - - resolveArg(dataArg, props) { - // custom argument resolver - // uses `modelArgs` from following expression to control which arguments get rendered - const { nextExpressionType } = props; - const modelArgs = getModelArgs(nextExpressionType); - - // if there is no following expression, or no modelArgs, argument is shown by default - if (modelArgs === NO_NEXT_EXP || modelArgs === MISSING_MODEL_ARGS) { - return { skipRender: false }; - } - - // if argument is missing from modelArgs, mark it as skipped - const argName = get(dataArg, 'arg.name'); - const modelArg = modelArgs.find((modelArg) => { - if (Array.isArray(modelArg)) { - return modelArg[0] === argName; - } - return modelArg === argName; - }); - - return { - label: Array.isArray(modelArg) ? get(modelArg[1], 'label') : null, - skipRender: !modelArg, - }; - } -} - -class ModelRegistry extends Registry { - wrapper(obj) { - return new Model(obj); - } -} - -export const modelRegistry = new ModelRegistry(); diff --git a/x-pack/plugins/canvas/public/expression_types/model.ts b/x-pack/plugins/canvas/public/expression_types/model.ts new file mode 100644 index 0000000000000..49f8346212f96 --- /dev/null +++ b/x-pack/plugins/canvas/public/expression_types/model.ts @@ -0,0 +1,80 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { merge } from 'lodash'; +import { FunctionForm, FunctionFormProps } from './function_form'; +import { Arg, View } from './types'; + +const NO_NEXT_EXP = 'no next expression'; +const MISSING_MODEL_ARGS = 'missing model args'; + +interface ModelOwnProps { + nextExpressionType?: View; + requiresContext?: boolean; + default?: string; + resolveArgValue?: boolean; + modelArgs: string[] | Arg[]; +} + +interface DataArg { + arg: Arg; +} + +export type ModelProps = ModelOwnProps & FunctionFormProps; + +function getModelArgs(expressionType?: View) { + if (!expressionType) { + return NO_NEXT_EXP; + } + + if (!expressionType?.modelArgs) { + return MISSING_MODEL_ARGS; + } + + return expressionType?.modelArgs.length > 0 ? expressionType?.modelArgs : MISSING_MODEL_ARGS; +} + +export class Model extends FunctionForm { + requiresContext?: boolean; + + constructor(props: ModelProps) { + super(props); + + const defaultProps = { requiresContext: true }; + const { requiresContext } = props; + + merge(this, defaultProps, { requiresContext }); + } + + resolveArg(dataArg: DataArg, props: ModelProps) { + // custom argument resolver + // uses `modelArgs` from following expression to control which arguments get rendered + const { nextExpressionType } = props; + const modelArgs: Array | string = getModelArgs(nextExpressionType); + + // if there is no following expression, or no modelArgs, argument is shown by default + if (modelArgs === NO_NEXT_EXP || modelArgs === MISSING_MODEL_ARGS) { + return { skipRender: false }; + } + + // if argument is missing from modelArgs, mark it as skipped + const argName = dataArg?.arg?.name; + const modelArg = + typeof modelArgs !== 'string' && + modelArgs.find((arg) => { + if (Array.isArray(arg)) { + return arg[0] === argName; + } + return arg === argName; + }); + + return { + label: Array.isArray(modelArg) ? modelArg[1]?.label : null, + skipRender: !modelArg, + }; + } +} diff --git a/x-pack/plugins/canvas/public/expression_types/model_registry.ts b/x-pack/plugins/canvas/public/expression_types/model_registry.ts new file mode 100644 index 0000000000000..f5c290f2fe2e9 --- /dev/null +++ b/x-pack/plugins/canvas/public/expression_types/model_registry.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 { Registry } from '@kbn/interpreter/common'; +import { Model } from './model'; +import type { ModelProps, Model as ModelType } from './model'; + +class ModelRegistry extends Registry { + wrapper(obj: ModelProps): ModelType { + return new Model(obj); + } +} + +export const modelRegistry = new ModelRegistry(); diff --git a/x-pack/plugins/canvas/public/expression_types/transform.js b/x-pack/plugins/canvas/public/expression_types/transform.js deleted file mode 100644 index 6a190e72aded7..0000000000000 --- a/x-pack/plugins/canvas/public/expression_types/transform.js +++ /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 { pick } from 'lodash'; -import { Registry } from '@kbn/interpreter/common'; -import { FunctionForm } from './function_form'; - -export class Transform extends FunctionForm { - constructor(props) { - super(props); - - const propNames = ['requiresContext']; - const defaultProps = { - requiresContext: true, - }; - - Object.assign(this, defaultProps, pick(props, propNames)); - } -} - -class TransformRegistry extends Registry { - wrapper(obj) { - return new Transform(obj); - } -} - -export const transformRegistry = new TransformRegistry(); diff --git a/x-pack/plugins/canvas/public/expression_types/transform.ts b/x-pack/plugins/canvas/public/expression_types/transform.ts new file mode 100644 index 0000000000000..6b901b5ae7126 --- /dev/null +++ b/x-pack/plugins/canvas/public/expression_types/transform.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 { merge } from 'lodash'; +import { FunctionForm, FunctionFormProps } from './function_form'; + +export type TransformProps = { requiresContext: boolean } & FunctionFormProps; + +export class Transform extends FunctionForm { + requiresContext?: boolean; + + constructor(props: TransformProps) { + super(props); + const { requiresContext } = props; + const defaultProps = { + requiresContext: true, + }; + + merge(this, defaultProps, { requiresContext }); + } +} diff --git a/x-pack/plugins/canvas/public/expression_types/transform_registry.ts b/x-pack/plugins/canvas/public/expression_types/transform_registry.ts new file mode 100644 index 0000000000000..a69f5fcf554fe --- /dev/null +++ b/x-pack/plugins/canvas/public/expression_types/transform_registry.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 { Registry } from '@kbn/interpreter/common'; +import { Transform } from './transform'; +import type { Transform as TransformType, TransformProps } from './transform'; + +class TransformRegistry extends Registry { + wrapper(obj: TransformProps): TransformType { + return new Transform(obj); + } +} + +export const transformRegistry = new TransformRegistry(); diff --git a/x-pack/plugins/canvas/public/expression_types/types.ts b/x-pack/plugins/canvas/public/expression_types/types.ts new file mode 100644 index 0000000000000..704dae83c8a55 --- /dev/null +++ b/x-pack/plugins/canvas/public/expression_types/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 type { Transform } from './transform'; +import type { View } from './view'; +import type { Datasource } from './datasource'; +import type { Model } from './model'; + +export type ArgType = string; + +export type ArgTypeDef = View | Model | Transform | Datasource; + +export { Transform, View, Datasource, Model }; +export type { Arg } from './arg'; + +export type ExpressionType = View | Model | Transform; + +export type { RenderArgData } from './function_form'; diff --git a/x-pack/plugins/canvas/public/expression_types/view.js b/x-pack/plugins/canvas/public/expression_types/view.js deleted file mode 100644 index a4613e51ecbee..0000000000000 --- a/x-pack/plugins/canvas/public/expression_types/view.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { pick } from 'lodash'; -import { Registry } from '@kbn/interpreter/common'; -import { FunctionForm } from './function_form'; - -export class View extends FunctionForm { - constructor(props) { - super(props); - - const propNames = ['help', 'modelArgs', 'requiresContext']; - const defaultProps = { - help: `Element: ${props.name}`, - requiresContext: true, - }; - - Object.assign(this, defaultProps, pick(props, propNames)); - - this.modelArgs = this.modelArgs || []; - - if (!Array.isArray(this.modelArgs)) { - throw new Error(`${this.name} element is invalid, modelArgs must be an array`); - } - } -} - -class ViewRegistry extends Registry { - wrapper(obj) { - return new View(obj); - } -} - -export const viewRegistry = new ViewRegistry(); diff --git a/x-pack/plugins/canvas/public/expression_types/view.ts b/x-pack/plugins/canvas/public/expression_types/view.ts new file mode 100644 index 0000000000000..ae9c37678c396 --- /dev/null +++ b/x-pack/plugins/canvas/public/expression_types/view.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 { merge } from 'lodash'; +import { FunctionForm, FunctionFormProps } from './function_form'; +import { Arg } from './types'; + +interface ViewOwnProps { + modelArgs: string[] | Arg[]; + requiresContext?: boolean; + default?: string; + resolveArgValue?: boolean; +} + +export type ViewProps = ViewOwnProps & FunctionFormProps; + +export class View extends FunctionForm { + modelArgs: string[] | Arg[] = []; + requiresContext?: boolean; + + constructor(props: ViewProps) { + super(props); + const { help, modelArgs, requiresContext } = props; + const defaultProps = { + help: `Element: ${props.name}`, + requiresContext: true, + }; + + merge(this, defaultProps, { help, modelArgs: modelArgs || [], requiresContext }); + + if (!Array.isArray(this.modelArgs)) { + throw new Error(`${this.name} element is invalid, modelArgs must be an array`); + } + } +} diff --git a/x-pack/plugins/canvas/public/expression_types/view_registry.ts b/x-pack/plugins/canvas/public/expression_types/view_registry.ts new file mode 100644 index 0000000000000..108a65c73ec60 --- /dev/null +++ b/x-pack/plugins/canvas/public/expression_types/view_registry.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 { Registry } from '@kbn/interpreter/common'; +import { View } from './view'; +import type { View as ViewType, ViewProps } from './view'; + +class ViewRegistry extends Registry { + wrapper(obj: ViewProps): ViewType { + return new View(obj); + } +} + +export const viewRegistry = new ViewRegistry(); diff --git a/x-pack/plugins/canvas/public/lib/create_handlers.ts b/x-pack/plugins/canvas/public/lib/create_handlers.ts index dfc4387bcbf92..3734b1bf53051 100644 --- a/x-pack/plugins/canvas/public/lib/create_handlers.ts +++ b/x-pack/plugins/canvas/public/lib/create_handlers.ts @@ -26,8 +26,9 @@ export const createBaseHandlers = (): IInterpreterRenderHandlers => ({ update() {}, event() {}, onDestroy() {}, - getRenderMode: () => 'display', + getRenderMode: () => 'view', isSyncColorsEnabled: () => false, + isInteractive: () => true, }); export const createHandlers = (baseHandlers = createBaseHandlers()): RendererHandlers => ({ diff --git a/x-pack/plugins/canvas/public/lib/find_expression_type.js b/x-pack/plugins/canvas/public/lib/find_expression_type.js deleted file mode 100644 index 037b64b334fd6..0000000000000 --- a/x-pack/plugins/canvas/public/lib/find_expression_type.js +++ /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 { datasourceRegistry } from '../expression_types/datasource'; -import { transformRegistry } from '../expression_types/transform'; -import { modelRegistry } from '../expression_types/model'; -import { viewRegistry } from '../expression_types/view'; - -const expressionTypes = ['view', 'model', 'transform', 'datasource']; - -export function findExpressionType(name, type) { - const checkTypes = expressionTypes.filter( - (expressionType) => type == null || expressionType === type - ); - - const matches = checkTypes.reduce((acc, checkType) => { - let expression; - switch (checkType) { - case 'view': - expression = viewRegistry.get(name); - return !expression ? acc : acc.concat(expression); - case 'model': - expression = modelRegistry.get(name); - return !expression ? acc : acc.concat(expression); - case 'transform': - expression = transformRegistry.get(name); - return !expression ? acc : acc.concat(expression); - default: - return acc; - } - }, []); - - if (matches.length > 1) { - throw new Error(`Found multiple expressions with name "${name}"`); - } - return matches[0] || null; -} diff --git a/x-pack/plugins/canvas/public/lib/find_expression_type.ts b/x-pack/plugins/canvas/public/lib/find_expression_type.ts new file mode 100644 index 0000000000000..cb054414b8725 --- /dev/null +++ b/x-pack/plugins/canvas/public/lib/find_expression_type.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 { transformRegistry } from '../expression_types/transform_registry'; +import { modelRegistry } from '../expression_types/model_registry'; +import { viewRegistry } from '../expression_types/view_registry'; +import { ArgType, ExpressionType } from '../expression_types/types'; + +const expressionTypes: ArgType[] = ['view', 'model', 'transform', 'datasource']; + +export function findExpressionType(name: string, type?: ArgType | null) { + const checkTypes = expressionTypes.filter( + (expressionType) => type == null || expressionType === type + ); + + const matches = checkTypes.reduce((acc: ExpressionType[], checkType) => { + let expression; + switch (checkType) { + case 'view': + expression = viewRegistry.get(name); + return !expression ? acc : acc.concat(expression); + case 'model': + expression = modelRegistry.get(name); + return !expression ? acc : acc.concat(expression); + case 'transform': + expression = transformRegistry.get(name); + return !expression ? acc : acc.concat(expression); + default: + return acc; + } + }, []); + + if (matches.length > 1) { + throw new Error(`Found multiple expressions with name "${name}"`); + } + return matches[0] || null; +} diff --git a/x-pack/plugins/canvas/public/plugin.tsx b/x-pack/plugins/canvas/public/plugin.tsx index c149c67544865..3b4a6b6f1ee4b 100644 --- a/x-pack/plugins/canvas/public/plugin.tsx +++ b/x-pack/plugins/canvas/public/plugin.tsx @@ -6,6 +6,7 @@ */ import { BehaviorSubject } from 'rxjs'; +import type { SharePluginSetup } from 'src/plugins/share/public'; import { ChartsPluginSetup, ChartsPluginStart } from 'src/plugins/charts/public'; import { ReportingStart } from '../../reporting/public'; import { @@ -20,7 +21,8 @@ import { import { HomePublicPluginSetup } from '../../../../src/plugins/home/public'; import { initLoadingIndicator } from './lib/loading_indicator'; import { getSessionStorage } from './lib/storage'; -import { SESSIONSTORAGE_LASTPATH } from '../common/lib/constants'; +import { SESSIONSTORAGE_LASTPATH, CANVAS_APP } from '../common/lib/constants'; +import { CanvasAppLocatorDefinition } from '../common/locator'; import { featureCatalogueEntry } from './feature_catalogue_entry'; import { ExpressionsSetup, ExpressionsStart } from '../../../../src/plugins/expressions/public'; import { DataPublicPluginSetup, DataPublicPluginStart } from '../../../../src/plugins/data/public'; @@ -43,6 +45,7 @@ export { CoreStart, CoreSetup }; // This interface will be built out as we require other plugins for setup export interface CanvasSetupDeps { data: DataPublicPluginSetup; + share: SharePluginSetup; expressions: ExpressionsSetup; home?: HomePublicPluginSetup; usageCollection?: UsageCollectionSetup; @@ -97,7 +100,7 @@ export class CanvasPlugin coreSetup.application.register({ category: DEFAULT_APP_CATEGORIES.kibana, - id: 'canvas', + id: CANVAS_APP, title: 'Canvas', euiIconType: 'logoKibana', order: 3000, @@ -105,6 +108,7 @@ export class CanvasPlugin mount: async (params: AppMountParameters) => { const { CanvasSrcPlugin } = await import('../canvas_plugin_src/plugin'); const srcPlugin = new CanvasSrcPlugin(); + srcPlugin.setup(coreSetup, { canvas: canvasApi }); setupExpressions({ coreSetup, setupPlugins }); @@ -144,6 +148,10 @@ export class CanvasPlugin setupPlugins.home.featureCatalogue.register(featureCatalogueEntry); } + if (setupPlugins.share) { + setupPlugins.share.url.locators.create(new CanvasAppLocatorDefinition()); + } + canvasApi.addArgumentUIs(async () => { // @ts-expect-error const { argTypeSpecs } = await import('./expression_types/arg_types'); diff --git a/x-pack/plugins/canvas/public/registries.ts b/x-pack/plugins/canvas/public/registries.ts index 1ad7fa6905c22..56d89affce5ea 100644 --- a/x-pack/plugins/canvas/public/registries.ts +++ b/x-pack/plugins/canvas/public/registries.ts @@ -20,7 +20,6 @@ import { modelRegistry, transformRegistry, viewRegistry, - // @ts-expect-error untyped local } from './expression_types'; import { SetupRegistries } from './plugin_api'; diff --git a/x-pack/plugins/canvas/public/services/kibana/platform.ts b/x-pack/plugins/canvas/public/services/kibana/platform.ts index f71d480b552f6..dc524aab6f444 100644 --- a/x-pack/plugins/canvas/public/services/kibana/platform.ts +++ b/x-pack/plugins/canvas/public/services/kibana/platform.ts @@ -30,6 +30,7 @@ export const platformServiceFactory: CanvaPlatformServiceFactory = ({ coreStart, // though we don't do this. So this cast may be the best option. getHasWriteAccess: () => coreStart.application.capabilities.canvas.save as boolean, getUISetting: coreStart.uiSettings.get.bind(coreStart.uiSettings), + hasHeaderBanner$: coreStart.chrome.hasHeaderBanner$, setBreadcrumbs: coreStart.chrome.setBreadcrumbs, setRecentlyAccessed: coreStart.chrome.recentlyAccessed.add, setFullscreen: coreStart.chrome.setIsVisible, diff --git a/x-pack/plugins/canvas/public/services/kibana/reporting.ts b/x-pack/plugins/canvas/public/services/kibana/reporting.ts index 432fe5675b22f..02611acdea4da 100644 --- a/x-pack/plugins/canvas/public/services/kibana/reporting.ts +++ b/x-pack/plugins/canvas/public/services/kibana/reporting.ts @@ -22,7 +22,7 @@ export const reportingServiceFactory: CanvasReportingServiceFactory = ({ const { reporting } = startPlugins; const reportingEnabled = () => ({ - getReportingPanelPDFComponent: () => reporting?.components.ReportingPanelPDF || null, + getReportingPanelPDFComponent: () => reporting?.components.ReportingPanelPDFV2 || null, }); const reportingDisabled = () => ({ getReportingPanelPDFComponent: () => null }); diff --git a/x-pack/plugins/canvas/public/services/platform.ts b/x-pack/plugins/canvas/public/services/platform.ts index b622484c16fc3..9bff61a0c668a 100644 --- a/x-pack/plugins/canvas/public/services/platform.ts +++ b/x-pack/plugins/canvas/public/services/platform.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { Observable } from 'rxjs'; import { SavedObjectsStart, SavedObjectsClientContract, @@ -22,6 +23,7 @@ export interface CanvasPlatformService { getKibanaVersion: () => string; getHasWriteAccess: () => boolean; getUISetting: (key: string, defaultValue?: any) => any; + hasHeaderBanner$: () => Observable; setBreadcrumbs: (newBreadcrumbs: ChromeBreadcrumb[]) => void; setRecentlyAccessed: (link: string, label: string, id: string) => void; setFullscreen: ChromeStart['setIsVisible']; diff --git a/x-pack/plugins/canvas/public/services/reporting.ts b/x-pack/plugins/canvas/public/services/reporting.ts index 5369dab32bf68..9ec5bd6a06a4c 100644 --- a/x-pack/plugins/canvas/public/services/reporting.ts +++ b/x-pack/plugins/canvas/public/services/reporting.ts @@ -7,7 +7,7 @@ import { ReportingStart } from '../../../reporting/public'; -type ReportingPanelPDFComponent = ReportingStart['components']['ReportingPanelPDF']; +type ReportingPanelPDFComponent = ReportingStart['components']['ReportingPanelPDFV2']; export interface CanvasReportingService { getReportingPanelPDFComponent: () => ReportingPanelPDFComponent | null; } diff --git a/x-pack/plugins/canvas/public/services/stubs/platform.ts b/x-pack/plugins/canvas/public/services/stubs/platform.ts index 1daaa6bd32f09..3942fcf145cee 100644 --- a/x-pack/plugins/canvas/public/services/stubs/platform.ts +++ b/x-pack/plugins/canvas/public/services/stubs/platform.ts @@ -27,6 +27,7 @@ export const platformServiceFactory: CanvasPlatformServiceFactory = () => ({ getKibanaVersion: () => 'kibanaVersion', getHasWriteAccess: () => true, getUISetting, + hasHeaderBanner$: noop, setBreadcrumbs: noop, setRecentlyAccessed: noop, getSavedObjects: noop, diff --git a/x-pack/plugins/canvas/public/state/reducers/pages.js b/x-pack/plugins/canvas/public/state/reducers/pages.js index 78ec0addd970e..1565e73da91bd 100644 --- a/x-pack/plugins/canvas/public/state/reducers/pages.js +++ b/x-pack/plugins/canvas/public/state/reducers/pages.js @@ -123,7 +123,7 @@ export const pagesReducer = handleActions( newState = addPage(newState); } - if (wasOnlyPage) { + if (wasOnlyPage || curIndex === 0) { newState = set(newState, 'page', 0); gotoPage(1); } else if (wasSelected || delIndex < curIndex) { diff --git a/x-pack/plugins/canvas/tsconfig.json b/x-pack/plugins/canvas/tsconfig.json index 87fabe2730c16..5a5a1883240b7 100644 --- a/x-pack/plugins/canvas/tsconfig.json +++ b/x-pack/plugins/canvas/tsconfig.json @@ -7,7 +7,7 @@ "declarationMap": true, // the plugin contains some heavy json files - "resolveJsonModule": false, + "resolveJsonModule": false }, "include": [ "../../../typings/**/*", @@ -20,13 +20,14 @@ "shareable_runtime/**/*", "storybook/**/*", "tasks/mocks/*", - "types/**/*", + "types/**/*" ], "references": [ { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/bfetch/tsconfig.json"}, + { "path": "../../../src/plugins/bfetch/tsconfig.json" }, { "path": "../../../src/plugins/charts/tsconfig.json" }, - { "path": "../../../src/plugins/data/tsconfig.json"}, + { "path": "../../../src/plugins/data/tsconfig.json" }, + { "path": "../../../src/plugins/share/tsconfig.json" }, { "path": "../../../src/plugins/discover/tsconfig.json" }, { "path": "../../../src/plugins/embeddable/tsconfig.json" }, { "path": "../../../src/plugins/expressions/tsconfig.json" }, @@ -48,6 +49,6 @@ { "path": "../features/tsconfig.json" }, { "path": "../lens/tsconfig.json" }, { "path": "../maps/tsconfig.json" }, - { "path": "../reporting/tsconfig.json" }, + { "path": "../reporting/tsconfig.json" } ] } diff --git a/x-pack/plugins/canvas/types/state.ts b/x-pack/plugins/canvas/types/state.ts index cc42839ddfac7..30ded5f2a9c7e 100644 --- a/x-pack/plugins/canvas/types/state.ts +++ b/x-pack/plugins/canvas/types/state.ts @@ -16,6 +16,7 @@ import { Style, Range, } from 'src/plugins/expressions'; +import { Datasource, Model, Transform, View } from '../public/expression_types'; import { AssetType } from './assets'; import { CanvasWorkpad } from './canvas'; @@ -51,7 +52,11 @@ type ExpressionType = | KibanaContext | PointSeries | Style - | Range; + | Range + | View + | Model + | Datasource + | Transform; export interface ExpressionRenderable { state: 'ready' | 'pending'; @@ -60,9 +65,9 @@ export interface ExpressionRenderable { } export interface ExpressionContext { - state: 'ready' | 'pending'; + state: 'ready' | 'pending' | 'error'; value: ExpressionType; - error: null; + error: null | string; } export interface ResolvedArgType { diff --git a/x-pack/plugins/cases/common/utils/markdown_plugins/utils.test.ts b/x-pack/plugins/cases/common/utils/markdown_plugins/utils.test.ts new file mode 100644 index 0000000000000..baee979856511 --- /dev/null +++ b/x-pack/plugins/cases/common/utils/markdown_plugins/utils.test.ts @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { parseCommentString, stringifyMarkdownComment } from './utils'; + +describe('markdown utils', () => { + describe('stringifyComment', () => { + it('adds a newline to the end if one does not exist', () => { + const parsed = parseCommentString('hello'); + expect(stringifyMarkdownComment(parsed)).toEqual('hello\n'); + }); + + it('does not add a newline to the end if one already exists', () => { + const parsed = parseCommentString('hello\n'); + expect(stringifyMarkdownComment(parsed)).toEqual('hello\n'); + }); + }); +}); diff --git a/x-pack/plugins/cases/common/utils/markdown_plugins/utils.ts b/x-pack/plugins/cases/common/utils/markdown_plugins/utils.ts index e9a44fd592846..ca8b26a09c84a 100644 --- a/x-pack/plugins/cases/common/utils/markdown_plugins/utils.ts +++ b/x-pack/plugins/cases/common/utils/markdown_plugins/utils.ts @@ -16,26 +16,33 @@ import { SerializableRecord } from '@kbn/utility-types'; import { LENS_ID, LensParser, LensSerializer } from './lens'; import { TimelineSerializer, TimelineParser } from './timeline'; -interface LensMarkdownNode extends Node { +export interface LensMarkdownNode extends Node { timeRange: TimeRange; attributes: SerializableRecord; type: string; id: string; } -interface LensMarkdownParent extends Node { +/** + * A node that has children of other nodes describing the markdown elements or a specific lens visualization. + */ +export interface MarkdownNode extends Node { children: Array; } export const getLensVisualizations = (parsedComment?: Array) => (parsedComment?.length ? filter(parsedComment, { type: LENS_ID }) : []) as LensMarkdownNode[]; +/** + * Converts a text comment into a series of markdown nodes that represent a lens visualization, a timeline link, or just + * plain markdown. + */ export const parseCommentString = (comment: string) => { const processor = unified().use([[markdown, {}], LensParser, TimelineParser]); - return processor.parse(comment) as LensMarkdownParent; + return processor.parse(comment) as MarkdownNode; }; -export const stringifyComment = (comment: LensMarkdownParent) => +export const stringifyMarkdownComment = (comment: MarkdownNode) => unified() .use([ [ @@ -54,3 +61,13 @@ export const stringifyComment = (comment: LensMarkdownParent) => ], ]) .stringify(comment); + +export const isLensMarkdownNode = (node?: unknown): node is LensMarkdownNode => { + const unsafeNode = node as LensMarkdownNode; + return ( + unsafeNode != null && + unsafeNode.timeRange != null && + unsafeNode.attributes != null && + unsafeNode.type === 'lens' + ); +}; diff --git a/x-pack/plugins/cases/jest.config.js b/x-pack/plugins/cases/jest.config.js index 6368eb8895ad1..3b1b0b1223191 100644 --- a/x-pack/plugins/cases/jest.config.js +++ b/x-pack/plugins/cases/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/cases'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/cases', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/cases/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/cases/public/components/all_cases/all_cases_generic.tsx b/x-pack/plugins/cases/public/components/all_cases/all_cases_generic.tsx index 72491a2bc1e31..9cbb13f7227a3 100644 --- a/x-pack/plugins/cases/public/components/all_cases/all_cases_generic.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/all_cases_generic.tsx @@ -203,7 +203,8 @@ export const AllCasesGeneric = React.memo( handleIsLoading, isLoadingCases: loading, refreshCases, - showActions, + // isSelectorView is boolean | undefined. We need to convert it to a boolean. + isSelectorView: !!isSelectorView, userCanCrud, connectors, }); diff --git a/x-pack/plugins/cases/public/components/all_cases/columns.tsx b/x-pack/plugins/cases/public/components/all_cases/columns.tsx index 8b755b0c60968..c0bd6536f1b73 100644 --- a/x-pack/plugins/cases/public/components/all_cases/columns.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/columns.tsx @@ -72,7 +72,7 @@ export interface GetCasesColumn { handleIsLoading: (a: boolean) => void; isLoadingCases: string[]; refreshCases?: (a?: boolean) => void; - showActions: boolean; + isSelectorView: boolean; userCanCrud: boolean; connectors?: ActionConnector[]; } @@ -84,7 +84,7 @@ export const useCasesColumns = ({ handleIsLoading, isLoadingCases, refreshCases, - showActions, + isSelectorView, userCanCrud, connectors = [], }: GetCasesColumn): CasesColumns[] => { @@ -281,38 +281,42 @@ export const useCasesColumns = ({ return getEmptyTagValue(); }, }, - { - name: i18n.STATUS, - render: (theCase: Case) => { - if (theCase?.subCases == null || theCase.subCases.length === 0) { - if (theCase.status == null || theCase.type === CaseType.collection) { - return getEmptyTagValue(); - } - return ( - 0} - onStatusChanged={(status) => - handleDispatchUpdate({ - updateKey: 'status', - updateValue: status, - caseId: theCase.id, - version: theCase.version, - }) + ...(!isSelectorView + ? [ + { + name: i18n.STATUS, + render: (theCase: Case) => { + if (theCase?.subCases == null || theCase.subCases.length === 0) { + if (theCase.status == null || theCase.type === CaseType.collection) { + return getEmptyTagValue(); + } + return ( + 0} + onStatusChanged={(status) => + handleDispatchUpdate({ + updateKey: 'status', + updateValue: status, + caseId: theCase.id, + version: theCase.version, + }) + } + /> + ); } - /> - ); - } - const badges = getSubCasesStatusCountsBadges(theCase.subCases); - return badges.map(({ color, count }, index) => ( - - {count} - - )); - }, - }, - ...(showActions + const badges = getSubCasesStatusCountsBadges(theCase.subCases); + return badges.map(({ color, count }, index) => ( + + {count} + + )); + }, + }, + ] + : []), + ...(userCanCrud && !isSelectorView ? [ { name: ( diff --git a/x-pack/plugins/cases/public/components/all_cases/index.test.tsx b/x-pack/plugins/cases/public/components/all_cases/index.test.tsx index 9e6928d43c862..3fff43108772d 100644 --- a/x-pack/plugins/cases/public/components/all_cases/index.test.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/index.test.tsx @@ -144,7 +144,7 @@ describe('AllCasesGeneric', () => { filterStatus: CaseStatuses.open, handleIsLoading: jest.fn(), isLoadingCases: [], - showActions: true, + isSelectorView: false, userCanCrud: true, }; @@ -377,7 +377,7 @@ describe('AllCasesGeneric', () => { isLoadingCases: [], filterStatus: CaseStatuses.open, handleIsLoading: jest.fn(), - showActions: false, + isSelectorView: true, userCanCrud: true, }) ); @@ -926,4 +926,27 @@ describe('AllCasesGeneric', () => { ).toBeFalsy(); }); }); + + it('should not render status when isSelectorView=true', async () => { + const wrapper = mount( + + + + ); + + const { result } = renderHook(() => + useCasesColumns({ + ...defaultColumnArgs, + isSelectorView: true, + }) + ); + + expect(result.current.find((i) => i.name === 'Status')).toBeFalsy(); + + await waitFor(() => { + expect(wrapper.find('[data-test-subj="cases-table"]').exists()).toBeTruthy(); + }); + + expect(wrapper.find('[data-test-subj="case-view-status-dropdown"]').exists()).toBeFalsy(); + }); }); diff --git a/x-pack/plugins/cases/public/components/connectors/jira/use_get_fields_by_issue_type.tsx b/x-pack/plugins/cases/public/components/connectors/jira/use_get_fields_by_issue_type.tsx index a4958d91c88aa..686df1022a0d7 100644 --- a/x-pack/plugins/cases/public/components/connectors/jira/use_get_fields_by_issue_type.tsx +++ b/x-pack/plugins/cases/public/components/connectors/jira/use_get_fields_by_issue_type.tsx @@ -57,8 +57,8 @@ export const useGetFieldsByIssueType = ({ }); if (!didCancel.current) { - setIsLoading(false); setFields(res.data ?? {}); + setIsLoading(false); if (res.status && res.status === 'error') { toastNotifications.addDanger({ title: i18n.FIELDS_API_ERROR, diff --git a/x-pack/plugins/cases/public/components/connectors/jira/use_get_issue_types.tsx b/x-pack/plugins/cases/public/components/connectors/jira/use_get_issue_types.tsx index 447491d2a2fff..0d7073f3bf2d4 100644 --- a/x-pack/plugins/cases/public/components/connectors/jira/use_get_issue_types.tsx +++ b/x-pack/plugins/cases/public/components/connectors/jira/use_get_issue_types.tsx @@ -56,13 +56,14 @@ export const useGetIssueTypes = ({ }); if (!didCancel.current) { - setIsLoading(false); const asOptions = (res.data ?? []).map((type) => ({ text: type.name ?? '', value: type.id ?? '', })); + setIssueTypes(res.data ?? []); handleIssueType(asOptions); + setIsLoading(false); if (res.status && res.status === 'error') { toastNotifications.addDanger({ title: i18n.ISSUE_TYPES_API_ERROR, diff --git a/x-pack/plugins/cases/public/components/create/description.tsx b/x-pack/plugins/cases/public/components/create/description.tsx index f589587356c4b..d831470ea1d54 100644 --- a/x-pack/plugins/cases/public/components/create/description.tsx +++ b/x-pack/plugins/cases/public/components/create/description.tsx @@ -7,7 +7,7 @@ import React, { memo, useEffect, useRef } from 'react'; import { MarkdownEditorForm } from '../markdown_editor'; -import { UseField, useFormContext } from '../../common/shared_imports'; +import { UseField, useFormContext, useFormData } from '../../common/shared_imports'; import { useLensDraftComment } from '../markdown_editor/plugins/lens/use_lens_draft_comment'; interface Props { @@ -24,12 +24,21 @@ const DescriptionComponent: React.FC = ({ isLoading }) => { clearDraftComment, } = useLensDraftComment(); const { setFieldValue } = useFormContext(); + const [{ title, tags }] = useFormData({ watch: ['title', 'tags'] }); const editorRef = useRef>(); useEffect(() => { if (draftComment?.commentId === fieldName && editorRef.current) { setFieldValue(fieldName, draftComment.comment); + if (draftComment.caseTitle) { + setFieldValue('title', draftComment.caseTitle); + } + + if (draftComment.caseTags && draftComment.caseTags.length > 0) { + setFieldValue('tags', draftComment.caseTags); + } + if (hasIncomingLensState) { openLensModal({ editorRef: editorRef.current }); } else { @@ -48,6 +57,8 @@ const DescriptionComponent: React.FC = ({ isLoading }) => { dataTestSubj: 'caseDescription', idAria: 'caseDescription', isDisabled: isLoading, + caseTitle: title, + caseTags: tags, }} /> ); diff --git a/x-pack/plugins/cases/public/components/create/form_context.tsx b/x-pack/plugins/cases/public/components/create/form_context.tsx index 65c102583455a..f59e1822c70be 100644 --- a/x-pack/plugins/cases/public/components/create/form_context.tsx +++ b/x-pack/plugins/cases/public/components/create/form_context.tsx @@ -113,7 +113,20 @@ export const FormContext: React.FC = ({ : null, [children, connectors, isLoadingConnectors] ); - return
{childrenWithExtraProp}
; + return ( +
{ + // It avoids the focus scaping from the flyout when enter is pressed. + // https://github.com/elastic/kibana/issues/111120 + if (e.key === 'Enter') { + e.stopPropagation(); + } + }} + form={form} + > + {childrenWithExtraProp} +
+ ); }; FormContext.displayName = 'FormContext'; diff --git a/x-pack/plugins/cases/public/components/create/title.tsx b/x-pack/plugins/cases/public/components/create/title.tsx index cc51a805b5c38..ae8f517173132 100644 --- a/x-pack/plugins/cases/public/components/create/title.tsx +++ b/x-pack/plugins/cases/public/components/create/title.tsx @@ -21,6 +21,7 @@ const TitleComponent: React.FC = ({ isLoading }) => ( idAria: 'caseTitle', 'data-test-subj': 'caseTitle', euiFieldProps: { + autoFocus: true, fullWidth: true, disabled: isLoading, }, diff --git a/x-pack/plugins/cases/public/components/edit_connector/index.test.tsx b/x-pack/plugins/cases/public/components/edit_connector/index.test.tsx index fb45bf6ac3ae0..eec84cdd8d90f 100644 --- a/x-pack/plugins/cases/public/components/edit_connector/index.test.tsx +++ b/x-pack/plugins/cases/public/components/edit_connector/index.test.tsx @@ -7,16 +7,14 @@ import React from 'react'; import { mount } from 'enzyme'; -import { waitFor } from '@testing-library/react'; +import { render, waitFor, screen } from '@testing-library/react'; import { EditConnector, EditConnectorProps } from './index'; -import { getFormMock, useFormMock } from '../__mock__/form'; import { TestProviders } from '../../common/mock'; import { connectorsMock } from '../../containers/configure/mock'; import { basicCase, basicPush, caseUserActions } from '../../containers/mock'; import { useKibana } from '../../common/lib/kibana'; -jest.mock('../../../../../../src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form'); jest.mock('../../common/lib/kibana'); const useKibanaMock = useKibana as jest.Mocked; @@ -50,17 +48,32 @@ const defaultProps: EditConnectorProps = { }; describe('EditConnector ', () => { - const sampleConnector = '123'; - const formHookMock = getFormMock({ connectorId: sampleConnector }); beforeEach(() => { jest.clearAllMocks(); - useFormMock.mockImplementation(() => ({ form: formHookMock })); useKibanaMock().services.triggersActionsUi.actionTypeRegistry.get = jest.fn().mockReturnValue({ actionTypeTitle: '.servicenow', iconClass: 'logoSecurity', }); }); + it('Renders servicenow connector from case initially', async () => { + const serviceNowProps = { + ...defaultProps, + caseData: { + ...defaultProps.caseData, + connector: { ...defaultProps.caseData.connector, id: 'servicenow-1' }, + }, + }; + + render( + + + + ); + + expect(await screen.findByText('My Connector')).toBeInTheDocument(); + }); + it('Renders no connector, and then edit', async () => { const wrapper = mount( @@ -98,58 +111,81 @@ describe('EditConnector ', () => { expect(wrapper.find(`[data-test-subj="edit-connectors-submit"]`).last().exists()).toBeTruthy(); wrapper.find(`[data-test-subj="edit-connectors-submit"]`).last().simulate('click'); - await waitFor(() => expect(onSubmit.mock.calls[0][0]).toBe(sampleConnector)); + await waitFor(() => expect(onSubmit.mock.calls[0][0]).toBe('resilient-2')); }); it('Revert to initial external service on error', async () => { onSubmit.mockImplementation((connector, onSuccess, onError) => { onError(new Error('An error has occurred')); }); + + const props = { + ...defaultProps, + caseData: { + ...defaultProps.caseData, + connector: { ...defaultProps.caseData.connector, id: 'servicenow-1' }, + }, + }; + const wrapper = mount( - + ); - wrapper.find('[data-test-subj="connector-edit"] button').simulate('click'); + wrapper.find('[data-test-subj="connector-edit"] button').simulate('click'); wrapper.find('button[data-test-subj="dropdown-connectors"]').simulate('click'); - wrapper.update(); - wrapper.find('button[data-test-subj="dropdown-connector-resilient-2"]').simulate('click'); - wrapper.update(); - - expect(wrapper.find(`[data-test-subj="edit-connectors-submit"]`).last().exists()).toBeTruthy(); + await waitFor(() => { + wrapper.update(); + wrapper.find('button[data-test-subj="dropdown-connector-resilient-2"]').simulate('click'); + wrapper.update(); + expect( + wrapper.find(`[data-test-subj="edit-connectors-submit"]`).last().exists() + ).toBeTruthy(); + wrapper.find(`[data-test-subj="edit-connectors-submit"]`).last().simulate('click'); + }); - wrapper.find(`[data-test-subj="edit-connectors-submit"]`).last().simulate('click'); await waitFor(() => { wrapper.update(); - expect(formHookMock.setFieldValue).toHaveBeenCalledWith('connectorId', 'none'); + expect(wrapper.find(`[data-test-subj="edit-connectors-submit"]`).exists()).toBeFalsy(); }); + + /** + * If an error is being throw on submit the selected connector should + * be reverted to the initial one. In our test the initial one is the .servicenow-1 + * connector. The title of the .servicenow-1 connector is My Connector. + */ + expect(wrapper.text().includes('My Connector')).toBeTruthy(); }); it('Resets selector on cancel', async () => { const props = { ...defaultProps, + caseData: { + ...defaultProps.caseData, + connector: { ...defaultProps.caseData.connector, id: 'servicenow-1' }, + }, }; + const wrapper = mount( ); - wrapper.find('[data-test-subj="connector-edit"] button').simulate('click'); + wrapper.find('[data-test-subj="connector-edit"] button').simulate('click'); wrapper.find('button[data-test-subj="dropdown-connectors"]').simulate('click'); wrapper.update(); wrapper.find('button[data-test-subj="dropdown-connector-resilient-2"]').simulate('click'); wrapper.update(); - wrapper.find(`[data-test-subj="edit-connectors-cancel"]`).last().simulate('click'); + await waitFor(() => { wrapper.update(); - expect(formHookMock.setFieldValue).toBeCalledWith( - 'connectorId', - defaultProps.caseData.connector.id - ); + expect(wrapper.find(`[data-test-subj="edit-connectors-submit"]`).exists()).toBeFalsy(); }); + + expect(wrapper.text().includes('My Connector')).toBeTruthy(); }); it('Renders loading spinner', async () => { diff --git a/x-pack/plugins/cases/public/components/edit_connector/index.tsx b/x-pack/plugins/cases/public/components/edit_connector/index.tsx index df7855fb9ce33..70845f28e1f6b 100644 --- a/x-pack/plugins/cases/public/components/edit_connector/index.tsx +++ b/x-pack/plugins/cases/public/components/edit_connector/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useCallback, useReducer } from 'react'; +import React, { useCallback, useEffect, useReducer } from 'react'; import deepEqual from 'fast-deep-equal'; import { EuiText, @@ -144,17 +144,43 @@ export const EditConnector = React.memo( { ...initialState, fields: caseFields } ); + useEffect(() => { + // Initialize the current connector with the connector information attached to the case if we can find that + // connector in the retrieved connectors from the API call + if (!isLoading) { + dispatch({ + type: 'SET_CURRENT_CONNECTOR', + payload: getConnectorById(caseData.connector.id, connectors), + }); + + // Set the fields initially to whatever is present in the case, this should match with + // the latest user action for an update connector as well + dispatch({ + type: 'SET_FIELDS', + payload: caseFields, + }); + } + }, [caseData.connector.id, connectors, isLoading, caseFields]); + + /** + * There is a race condition with this callback. At some point during the initial mounting of this component, this + * callback will be called. There are a couple problems with this: + * + * 1. If the call occurs before the above useEffect does its dispatches (aka while the connectors are still loading) this will + * result in setting the current connector to null when in fact we might have a valid connector. It could also + * cause issues when setting the fields because if there are no user actions then the getConnectorFieldsFromUserActions + * will return null even when the caseData.connector.fields is valid and populated. + * + * 2. If the call occurs after the above useEffect then the currentConnector should === newConnectorId + * + * As far as I know dispatch is synchronous so if the useEffect runs first it should successfully set currentConnector. If + * onChangeConnector runs first and sets stuff to null, then when useEffect runs it'll switch everything back to what we need it to be + * initially. + */ const onChangeConnector = useCallback( (newConnectorId) => { - // Init - if (currentConnector == null) { - dispatch({ - type: 'SET_CURRENT_CONNECTOR', - payload: getConnectorById(newConnectorId, connectors), - }); - } - // change connect on dropdown action - else if (currentConnector.id !== newConnectorId) { + // change connector on dropdown action + if (currentConnector?.id !== newConnectorId) { dispatch({ type: 'SET_CURRENT_CONNECTOR', payload: getConnectorById(newConnectorId, connectors), @@ -163,14 +189,9 @@ export const EditConnector = React.memo( type: 'SET_FIELDS', payload: getConnectorFieldsFromUserActions(newConnectorId, userActions ?? []), }); - } else if (fields === null) { - dispatch({ - type: 'SET_FIELDS', - payload: getConnectorFieldsFromUserActions(newConnectorId, userActions ?? []), - }); } }, - [currentConnector, fields, userActions, connectors] + [currentConnector, userActions, connectors] ); const onFieldsChange = useCallback( diff --git a/x-pack/plugins/cases/public/components/markdown_editor/context.tsx b/x-pack/plugins/cases/public/components/markdown_editor/context.tsx index d7f5b0612cb73..44b65d6277b3f 100644 --- a/x-pack/plugins/cases/public/components/markdown_editor/context.tsx +++ b/x-pack/plugins/cases/public/components/markdown_editor/context.tsx @@ -10,4 +10,6 @@ import React from 'react'; export const CommentEditorContext = React.createContext<{ editorId: string; value: string; + caseTitle?: string; + caseTags?: string[]; } | null>(null); diff --git a/x-pack/plugins/cases/public/components/markdown_editor/editor.tsx b/x-pack/plugins/cases/public/components/markdown_editor/editor.tsx index b61fae25aa399..f2351a2b2d793 100644 --- a/x-pack/plugins/cases/public/components/markdown_editor/editor.tsx +++ b/x-pack/plugins/cases/public/components/markdown_editor/editor.tsx @@ -9,7 +9,6 @@ import React, { memo, forwardRef, useCallback, - useMemo, useRef, useState, useImperativeHandle, @@ -24,7 +23,6 @@ import { } from '@elastic/eui'; import { ContextShape } from '@elastic/eui/src/components/markdown_editor/markdown_context'; import { usePlugins } from './use_plugins'; -import { CommentEditorContext } from './context'; import { useLensButtonToggle } from './plugins/lens/use_lens_button_toggle'; interface MarkdownEditorProps { @@ -65,14 +63,6 @@ const MarkdownEditorComponent = forwardRef ({ - editorId, - value, - }), - [editorId, value] - ); - // @ts-expect-error useImperativeHandle(ref, () => { if (!editorRef.current) { @@ -88,22 +78,20 @@ const MarkdownEditorComponent = forwardRef - - + ); } ); diff --git a/x-pack/plugins/cases/public/components/markdown_editor/eui_form.tsx b/x-pack/plugins/cases/public/components/markdown_editor/eui_form.tsx index 2719f38f98fc2..94881e30e10f3 100644 --- a/x-pack/plugins/cases/public/components/markdown_editor/eui_form.tsx +++ b/x-pack/plugins/cases/public/components/markdown_editor/eui_form.tsx @@ -5,19 +5,22 @@ * 2.0. */ -import React, { forwardRef } from 'react'; +import React, { forwardRef, useMemo } from 'react'; import styled from 'styled-components'; import { EuiMarkdownEditorProps, EuiFormRow, EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; import { FieldHook, getFieldValidityAndErrorMessage } from '../../common/shared_imports'; import { MarkdownEditor, MarkdownEditorRef } from './editor'; +import { CommentEditorContext } from './context'; type MarkdownEditorFormProps = EuiMarkdownEditorProps & { id: string; - field: FieldHook; + field: FieldHook; dataTestSubj: string; idAria: string; isDisabled?: boolean; bottomRightContent?: React.ReactNode; + caseTitle?: string; + caseTags?: string[]; }; const BottomContentWrapper = styled(EuiFlexGroup)` @@ -28,11 +31,21 @@ const BottomContentWrapper = styled(EuiFlexGroup)` export const MarkdownEditorForm = React.memo( forwardRef( - ({ id, field, dataTestSubj, idAria, bottomRightContent }, ref) => { + ({ id, field, dataTestSubj, idAria, bottomRightContent, caseTitle, caseTags }, ref) => { const { isInvalid, errorMessage } = getFieldValidityAndErrorMessage(field); + const commentEditorContextValue = useMemo( + () => ({ + editorId: id, + value: field.value, + caseTitle, + caseTags, + }), + [id, field.value, caseTitle, caseTags] + ); + return ( - <> + @@ -57,7 +70,7 @@ export const MarkdownEditorForm = React.memo( {bottomRightContent} )} - + ); } ) diff --git a/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/plugin.tsx b/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/plugin.tsx index 732a99968e883..f840b1ea5bb50 100644 --- a/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/plugin.tsx +++ b/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/plugin.tsx @@ -135,6 +135,8 @@ const LensEditorComponent: LensEuiMarkdownEditorUiPlugin['editor'] = ({ commentId: commentEditorContext?.editorId, comment: commentEditorContext?.value, position: node?.position, + caseTitle: commentEditorContext?.caseTitle, + caseTags: commentEditorContext?.caseTags, }); lens?.navigateToPrefilledEditor(undefined, { @@ -145,10 +147,12 @@ const LensEditorComponent: LensEuiMarkdownEditorUiPlugin['editor'] = ({ storage, commentEditorContext?.editorId, commentEditorContext?.value, + commentEditorContext?.caseTitle, + commentEditorContext?.caseTags, node?.position, + lens, currentAppId, originatingPath, - lens, ]); const handleEditInLensClick = useCallback( @@ -157,6 +161,8 @@ const LensEditorComponent: LensEuiMarkdownEditorUiPlugin['editor'] = ({ commentId: commentEditorContext?.editorId, comment: commentEditorContext?.value, position: node?.position, + caseTitle: commentEditorContext?.caseTitle, + caseTags: commentEditorContext?.caseTags, }); lens?.navigateToPrefilledEditor( @@ -177,11 +183,13 @@ const LensEditorComponent: LensEuiMarkdownEditorUiPlugin['editor'] = ({ storage, commentEditorContext?.editorId, commentEditorContext?.value, + commentEditorContext?.caseTitle, + commentEditorContext?.caseTags, node?.position, + node?.attributes, + lens, currentAppId, originatingPath, - lens, - node?.attributes, ] ); diff --git a/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/processor.tsx b/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/processor.tsx index 18315b1611c56..d0e816a06c7df 100644 --- a/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/processor.tsx +++ b/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/processor.tsx @@ -48,7 +48,7 @@ const LensMarkDownRendererComponent: React.FC = ({ style={{ height: LENS_VISUALIZATION_HEIGHT }} timeRange={timeRange} attributes={attributes} - renderMode="display" + renderMode="view" /> diff --git a/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/use_lens_draft_comment.ts b/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/use_lens_draft_comment.ts index 2a77037b300a3..a2dccc0e44d74 100644 --- a/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/use_lens_draft_comment.ts +++ b/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/use_lens_draft_comment.ts @@ -16,6 +16,8 @@ interface DraftComment { commentId: string; comment: string; position: EuiMarkdownAstNodePosition; + caseTitle?: string; + caseTags?: string[]; } export const useLensDraftComment = () => { diff --git a/x-pack/plugins/cases/server/plugin.ts b/x-pack/plugins/cases/server/plugin.ts index bb1be163585a8..c04e495889a74 100644 --- a/x-pack/plugins/cases/server/plugin.ts +++ b/x-pack/plugins/cases/server/plugin.ts @@ -21,7 +21,7 @@ import { createCaseCommentSavedObjectType, caseConfigureSavedObjectType, caseConnectorMappingsSavedObjectType, - caseSavedObjectType, + createCaseSavedObjectType, caseUserActionSavedObjectType, subCaseSavedObjectType, } from './saved_object_types'; @@ -94,7 +94,7 @@ export class CasePlugin { ); core.savedObjects.registerType(caseConfigureSavedObjectType); core.savedObjects.registerType(caseConnectorMappingsSavedObjectType); - core.savedObjects.registerType(caseSavedObjectType); + core.savedObjects.registerType(createCaseSavedObjectType(core, this.log)); core.savedObjects.registerType(caseUserActionSavedObjectType); this.log.debug( diff --git a/x-pack/plugins/cases/server/saved_object_types/cases.ts b/x-pack/plugins/cases/server/saved_object_types/cases.ts index 199017c36fa3e..a362d77c06626 100644 --- a/x-pack/plugins/cases/server/saved_object_types/cases.ts +++ b/x-pack/plugins/cases/server/saved_object_types/cases.ts @@ -5,11 +5,22 @@ * 2.0. */ -import { SavedObjectsType } from 'src/core/server'; +import { + CoreSetup, + Logger, + SavedObject, + SavedObjectsExportTransformContext, + SavedObjectsType, +} from 'src/core/server'; import { CASE_SAVED_OBJECT } from '../../common'; +import { ESCaseAttributes } from '../services/cases/types'; +import { handleExport } from './import_export/export'; import { caseMigrations } from './migrations'; -export const caseSavedObjectType: SavedObjectsType = { +export const createCaseSavedObjectType = ( + coreSetup: CoreSetup, + logger: Logger +): SavedObjectsType => ({ name: CASE_SAVED_OBJECT, hidden: true, namespaceType: 'single', @@ -144,4 +155,14 @@ export const caseSavedObjectType: SavedObjectsType = { }, }, migrations: caseMigrations, -}; + management: { + importableAndExportable: true, + defaultSearchField: 'title', + icon: 'folderExclamation', + getTitle: (savedObject: SavedObject) => savedObject.attributes.title, + onExport: async ( + context: SavedObjectsExportTransformContext, + objects: Array> + ) => handleExport({ context, objects, coreSetup, logger }), + }, +}); diff --git a/x-pack/plugins/cases/server/saved_object_types/comments.ts b/x-pack/plugins/cases/server/saved_object_types/comments.ts index 00985df8ab834..af14123eca580 100644 --- a/x-pack/plugins/cases/server/saved_object_types/comments.ts +++ b/x-pack/plugins/cases/server/saved_object_types/comments.ts @@ -109,5 +109,8 @@ export const createCaseCommentSavedObjectType = ({ }, }, }, - migrations: () => createCommentsMigrations(migrationDeps), + migrations: createCommentsMigrations(migrationDeps), + management: { + importableAndExportable: true, + }, }); diff --git a/x-pack/plugins/cases/server/saved_object_types/import_export/export.ts b/x-pack/plugins/cases/server/saved_object_types/import_export/export.ts new file mode 100644 index 0000000000000..d089079314443 --- /dev/null +++ b/x-pack/plugins/cases/server/saved_object_types/import_export/export.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 { + CoreSetup, + Logger, + SavedObject, + SavedObjectsClientContract, + SavedObjectsExportTransformContext, +} from 'kibana/server'; +import { + CaseUserActionAttributes, + CASE_COMMENT_SAVED_OBJECT, + CASE_SAVED_OBJECT, + CASE_USER_ACTION_SAVED_OBJECT, + CommentAttributes, + MAX_DOCS_PER_PAGE, + SAVED_OBJECT_TYPES, +} from '../../../common'; +import { createCaseError, defaultSortField } from '../../common'; +import { ESCaseAttributes } from '../../services/cases/types'; + +export async function handleExport({ + context, + objects, + coreSetup, + logger, +}: { + context: SavedObjectsExportTransformContext; + objects: Array>; + coreSetup: CoreSetup; + logger: Logger; +}): Promise>> { + try { + if (objects.length <= 0) { + return []; + } + + const [{ savedObjects }] = await coreSetup.getStartServices(); + const savedObjectsClient = savedObjects.getScopedClient(context.request, { + includedHiddenTypes: SAVED_OBJECT_TYPES, + }); + + const caseIds = objects.map((caseObject) => caseObject.id); + const attachmentsAndUserActionsForCases = await getAttachmentsAndUserActionsForCases( + savedObjectsClient, + caseIds + ); + + return [...objects, ...attachmentsAndUserActionsForCases.flat()]; + } catch (error) { + throw createCaseError({ + message: `Failed to retrieve associated objects for exporting of cases: ${error}`, + error, + logger, + }); + } +} + +async function getAttachmentsAndUserActionsForCases( + savedObjectsClient: SavedObjectsClientContract, + caseIds: string[] +): Promise>> { + const [attachments, userActions] = await Promise.all([ + getAssociatedObjects({ + savedObjectsClient, + caseIds, + sortField: defaultSortField, + type: CASE_COMMENT_SAVED_OBJECT, + }), + getAssociatedObjects({ + savedObjectsClient, + caseIds, + sortField: 'action_at', + type: CASE_USER_ACTION_SAVED_OBJECT, + }), + ]); + + return [...attachments, ...userActions]; +} + +async function getAssociatedObjects({ + savedObjectsClient, + caseIds, + sortField, + type, +}: { + savedObjectsClient: SavedObjectsClientContract; + caseIds: string[]; + sortField: string; + type: string; +}): Promise>> { + const references = caseIds.map((id) => ({ type: CASE_SAVED_OBJECT, id })); + + const finder = savedObjectsClient.createPointInTimeFinder({ + type, + hasReferenceOperator: 'OR', + hasReference: references, + perPage: MAX_DOCS_PER_PAGE, + sortField, + sortOrder: 'asc', + }); + + let result: Array> = []; + for await (const findResults of finder.find()) { + result = result.concat(findResults.saved_objects); + } + + return result; +} diff --git a/x-pack/plugins/cases/server/saved_object_types/index.ts b/x-pack/plugins/cases/server/saved_object_types/index.ts index 2c39a10f61da7..f6b87d1d480c1 100644 --- a/x-pack/plugins/cases/server/saved_object_types/index.ts +++ b/x-pack/plugins/cases/server/saved_object_types/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -export { caseSavedObjectType } from './cases'; +export { createCaseSavedObjectType } from './cases'; export { subCaseSavedObjectType } from './sub_case'; export { caseConfigureSavedObjectType } from './configure'; export { createCaseCommentSavedObjectType } from './comments'; diff --git a/x-pack/plugins/cases/server/saved_object_types/migrations/comments.test.ts b/x-pack/plugins/cases/server/saved_object_types/migrations/comments.test.ts new file mode 100644 index 0000000000000..d1bfe7257c01c --- /dev/null +++ b/x-pack/plugins/cases/server/saved_object_types/migrations/comments.test.ts @@ -0,0 +1,283 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { createCommentsMigrations, stringifyCommentWithoutTrailingNewline } from './comments'; +import { + getLensVisualizations, + parseCommentString, +} from '../../../common/utils/markdown_plugins/utils'; + +import { savedObjectsServiceMock } from '../../../../../../src/core/server/mocks'; +import { lensEmbeddableFactory } from '../../../../lens/server/embeddable/lens_embeddable_factory'; +import { LensDocShape715 } from '../../../../lens/server'; +import { SavedObjectReference } from 'kibana/server'; + +const migrations = createCommentsMigrations({ + lensEmbeddableFactory, +}); + +const contextMock = savedObjectsServiceMock.createMigrationContext(); +describe('index migrations', () => { + describe('lens embeddable migrations for by value panels', () => { + describe('7.14.0 remove time zone from Lens visualization date histogram', () => { + const lensVisualizationToMigrate = { + title: 'MyRenamedOps', + description: '', + visualizationType: 'lnsXY', + state: { + datasourceStates: { + indexpattern: { + layers: { + '2': { + columns: { + '3': { + label: '@timestamp', + dataType: 'date', + operationType: 'date_histogram', + sourceField: '@timestamp', + isBucketed: true, + scale: 'interval', + params: { interval: 'auto', timeZone: 'Europe/Berlin' }, + }, + '4': { + label: '@timestamp', + dataType: 'date', + operationType: 'date_histogram', + sourceField: '@timestamp', + isBucketed: true, + scale: 'interval', + params: { interval: 'auto' }, + }, + '5': { + label: '@timestamp', + dataType: 'date', + operationType: 'my_unexpected_operation', + isBucketed: true, + scale: 'interval', + params: { timeZone: 'do not delete' }, + }, + }, + columnOrder: ['3', '4', '5'], + incompleteColumns: {}, + }, + }, + }, + }, + visualization: { + title: 'Empty XY chart', + legend: { isVisible: true, position: 'right' }, + valueLabels: 'hide', + preferredSeriesType: 'bar_stacked', + layers: [ + { + layerId: '5ab74ddc-93ca-44e2-9857-ecf85c86b53e', + accessors: [ + '5fea2a56-7b73-44b5-9a50-7f0c0c4f8fd0', + 'e5efca70-edb5-4d6d-a30a-79384066987e', + '7ffb7bde-4f42-47ab-b74d-1b4fd8393e0f', + ], + position: 'top', + seriesType: 'bar_stacked', + showGridlines: false, + xAccessor: '2e57a41e-5a52-42d3-877f-bd211d903ef8', + }, + ], + }, + query: { query: '', language: 'kuery' }, + filters: [], + }, + }; + + const expectedLensVisualizationMigrated = { + title: 'MyRenamedOps', + description: '', + visualizationType: 'lnsXY', + state: { + datasourceStates: { + indexpattern: { + layers: { + '2': { + columns: { + '3': { + label: '@timestamp', + dataType: 'date', + operationType: 'date_histogram', + sourceField: '@timestamp', + isBucketed: true, + scale: 'interval', + params: { interval: 'auto' }, + }, + '4': { + label: '@timestamp', + dataType: 'date', + operationType: 'date_histogram', + sourceField: '@timestamp', + isBucketed: true, + scale: 'interval', + params: { interval: 'auto' }, + }, + '5': { + label: '@timestamp', + dataType: 'date', + operationType: 'my_unexpected_operation', + isBucketed: true, + scale: 'interval', + params: { timeZone: 'do not delete' }, + }, + }, + columnOrder: ['3', '4', '5'], + incompleteColumns: {}, + }, + }, + }, + }, + visualization: { + title: 'Empty XY chart', + legend: { isVisible: true, position: 'right' }, + valueLabels: 'hide', + preferredSeriesType: 'bar_stacked', + layers: [ + { + layerId: '5ab74ddc-93ca-44e2-9857-ecf85c86b53e', + accessors: [ + '5fea2a56-7b73-44b5-9a50-7f0c0c4f8fd0', + 'e5efca70-edb5-4d6d-a30a-79384066987e', + '7ffb7bde-4f42-47ab-b74d-1b4fd8393e0f', + ], + position: 'top', + seriesType: 'bar_stacked', + showGridlines: false, + xAccessor: '2e57a41e-5a52-42d3-877f-bd211d903ef8', + }, + ], + }, + query: { query: '', language: 'kuery' }, + filters: [], + }, + }; + + const expectedMigrationCommentResult = `"**Amazing**\n\n!{tooltip[Tessss](https://example.com)}\n\nbrbrbr\n\n[asdasdasdasd](http://localhost:5601/moq/app/security/timelines?timeline=(id%3A%27e4362a60-f478-11eb-a4b0-ebefce184d8d%27%2CisOpen%3A!t))\n\n!{lens{\"timeRange\":{\"from\":\"now-7d\",\"to\":\"now\",\"mode\":\"relative\"},\"attributes\":${JSON.stringify( + expectedLensVisualizationMigrated + )}}}\n\n!{lens{\"timeRange\":{\"from\":\"now-7d\",\"to\":\"now\",\"mode\":\"relative\"},\"attributes\":{\"title\":\"TEst22\",\"type\":\"lens\",\"visualizationType\":\"lnsMetric\",\"state\":{\"datasourceStates\":{\"indexpattern\":{\"layers\":{\"layer1\":{\"columnOrder\":[\"col2\"],\"columns\":{\"col2\":{\"dataType\":\"number\",\"isBucketed\":false,\"label\":\"Count of records\",\"operationType\":\"count\",\"scale\":\"ratio\",\"sourceField\":\"Records\"}}}}}},\"visualization\":{\"layerId\":\"layer1\",\"accessor\":\"col2\"},\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filters\":[]},\"references\":[{\"type\":\"index-pattern\",\"id\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"name\":\"indexpattern-datasource-current-indexpattern\"},{\"type\":\"index-pattern\",\"id\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"name\":\"indexpattern-datasource-layer-layer1\"}]}}}\n\nbrbrbr"`; + + const caseComment = { + type: 'cases-comments', + id: '1cefd0d0-e86d-11eb-bae5-3d065cd16a32', + attributes: { + associationType: 'case', + comment: `"**Amazing**\n\n!{tooltip[Tessss](https://example.com)}\n\nbrbrbr\n\n[asdasdasdasd](http://localhost:5601/moq/app/security/timelines?timeline=(id%3A%27e4362a60-f478-11eb-a4b0-ebefce184d8d%27%2CisOpen%3A!t))\n\n!{lens{\"timeRange\":{\"from\":\"now-7d\",\"to\":\"now\",\"mode\":\"relative\"},\"editMode\":false,\"attributes\":${JSON.stringify( + lensVisualizationToMigrate + )}}}\n\n!{lens{\"timeRange\":{\"from\":\"now-7d\",\"to\":\"now\",\"mode\":\"relative\"},\"editMode\":false,\"attributes\":{\"title\":\"TEst22\",\"type\":\"lens\",\"visualizationType\":\"lnsMetric\",\"state\":{\"datasourceStates\":{\"indexpattern\":{\"layers\":{\"layer1\":{\"columnOrder\":[\"col2\"],\"columns\":{\"col2\":{\"dataType\":\"number\",\"isBucketed\":false,\"label\":\"Count of records\",\"operationType\":\"count\",\"scale\":\"ratio\",\"sourceField\":\"Records\"}}}}}},\"visualization\":{\"layerId\":\"layer1\",\"accessor\":\"col2\"},\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filters\":[]},\"references\":[{\"type\":\"index-pattern\",\"id\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"name\":\"indexpattern-datasource-current-indexpattern\"},{\"type\":\"index-pattern\",\"id\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"name\":\"indexpattern-datasource-layer-layer1\"}]}}}\n\nbrbrbr"`, + type: 'user', + created_at: '2021-07-19T08:41:29.951Z', + created_by: { + email: null, + full_name: null, + username: 'elastic', + }, + pushed_at: null, + pushed_by: null, + updated_at: '2021-07-19T08:41:47.549Z', + updated_by: { + full_name: null, + email: null, + username: 'elastic', + }, + }, + references: [ + { + name: 'associated-cases', + id: '77d1b230-d35e-11eb-8da6-6f746b9cb499', + type: 'cases', + }, + { + name: 'indexpattern-datasource-current-indexpattern', + id: '90943e30-9a47-11e8-b64d-95841ca0b247', + type: 'index-pattern', + }, + { + name: 'indexpattern-datasource-current-indexpattern', + id: '90943e30-9a47-11e8-b64d-95841ca0b247', + type: 'index-pattern', + }, + ], + migrationVersion: { + 'cases-comments': '7.14.0', + }, + coreMigrationVersion: '8.0.0', + updated_at: '2021-07-19T08:41:47.552Z', + version: 'WzgxMTY4MSw5XQ==', + namespaces: ['default'], + score: 0, + }; + + it('should remove time zone param from date histogram', () => { + expect(migrations['7.14.0']).toBeDefined(); + const result = migrations['7.14.0'](caseComment, contextMock); + + const parsedComment = parseCommentString(result.attributes.comment); + const lensVisualizations = (getLensVisualizations( + parsedComment.children + ) as unknown) as Array<{ + attributes: LensDocShape715 & { references: SavedObjectReference[] }; + }>; + + const layers = Object.values( + lensVisualizations[0].attributes.state.datasourceStates.indexpattern.layers + ); + expect(result.attributes.comment).toEqual(expectedMigrationCommentResult); + expect(layers.length).toBe(1); + const columns = Object.values(layers[0].columns); + expect(columns.length).toBe(3); + expect(columns[0].operationType).toEqual('date_histogram'); + expect((columns[0] as { params: {} }).params).toEqual({ interval: 'auto' }); + expect(columns[1].operationType).toEqual('date_histogram'); + expect((columns[1] as { params: {} }).params).toEqual({ interval: 'auto' }); + expect(columns[2].operationType).toEqual('my_unexpected_operation'); + expect((columns[2] as { params: {} }).params).toEqual({ timeZone: 'do not delete' }); + }); + }); + + describe('stringifyCommentWithoutTrailingNewline', () => { + it('removes the newline added by the markdown library when the comment did not originally have one', () => { + const originalComment = 'awesome'; + const parsedString = parseCommentString(originalComment); + + expect(stringifyCommentWithoutTrailingNewline(originalComment, parsedString)).toEqual( + 'awesome' + ); + }); + + it('leaves the newline if it was in the original comment', () => { + const originalComment = 'awesome\n'; + const parsedString = parseCommentString(originalComment); + + expect(stringifyCommentWithoutTrailingNewline(originalComment, parsedString)).toEqual( + 'awesome\n' + ); + }); + + it('does not remove newlines that are not at the end of the comment', () => { + const originalComment = 'awesome\ncomment'; + const parsedString = parseCommentString(originalComment); + + expect(stringifyCommentWithoutTrailingNewline(originalComment, parsedString)).toEqual( + 'awesome\ncomment' + ); + }); + + it('does not remove spaces at the end of the comment', () => { + const originalComment = 'awesome '; + const parsedString = parseCommentString(originalComment); + + expect(stringifyCommentWithoutTrailingNewline(originalComment, parsedString)).toEqual( + 'awesome ' + ); + }); + }); + }); +}); diff --git a/x-pack/plugins/cases/server/saved_object_types/migrations/comments.ts b/x-pack/plugins/cases/server/saved_object_types/migrations/comments.ts new file mode 100644 index 0000000000000..03188d8e75e88 --- /dev/null +++ b/x-pack/plugins/cases/server/saved_object_types/migrations/comments.ts @@ -0,0 +1,152 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { mapValues, trimEnd } from 'lodash'; +import { SerializableRecord } from '@kbn/utility-types'; + +import { LensServerPluginSetup } from '../../../../lens/server'; +import { + mergeMigrationFunctionMaps, + MigrateFunction, + MigrateFunctionsObject, +} from '../../../../../../src/plugins/kibana_utils/common'; +import { + SavedObjectUnsanitizedDoc, + SavedObjectSanitizedDoc, + SavedObjectMigrationFn, + SavedObjectMigrationMap, +} from '../../../../../../src/core/server'; +import { CommentType, AssociationType } from '../../../common'; +import { + isLensMarkdownNode, + LensMarkdownNode, + MarkdownNode, + parseCommentString, + stringifyMarkdownComment, +} from '../../../common/utils/markdown_plugins/utils'; +import { addOwnerToSO, SanitizedCaseOwner } from '.'; + +interface UnsanitizedComment { + comment: string; + type?: CommentType; +} + +interface SanitizedComment { + comment: string; + type: CommentType; +} + +interface SanitizedCommentForSubCases { + associationType: AssociationType; + rule?: { id: string | null; name: string | null }; +} + +export interface CreateCommentsMigrationsDeps { + lensEmbeddableFactory: LensServerPluginSetup['lensEmbeddableFactory']; +} + +export const createCommentsMigrations = ( + migrationDeps: CreateCommentsMigrationsDeps +): SavedObjectMigrationMap => { + const embeddableMigrations = mapValues< + MigrateFunctionsObject, + SavedObjectMigrationFn<{ comment?: string }> + >( + migrationDeps.lensEmbeddableFactory().migrations, + migrateByValueLensVisualizations + ) as MigrateFunctionsObject; + + const commentsMigrations = { + '7.11.0': ( + doc: SavedObjectUnsanitizedDoc + ): SavedObjectSanitizedDoc => { + return { + ...doc, + attributes: { + ...doc.attributes, + type: CommentType.user, + }, + references: doc.references || [], + }; + }, + '7.12.0': ( + doc: SavedObjectUnsanitizedDoc + ): SavedObjectSanitizedDoc => { + let attributes: SanitizedCommentForSubCases & UnsanitizedComment = { + ...doc.attributes, + associationType: AssociationType.case, + }; + + // only add the rule object for alert comments. Prior to 7.12 we only had CommentType.alert, generated alerts are + // introduced in 7.12. + if (doc.attributes.type === CommentType.alert) { + attributes = { ...attributes, rule: { id: null, name: null } }; + } + + return { + ...doc, + attributes, + references: doc.references || [], + }; + }, + '7.14.0': ( + doc: SavedObjectUnsanitizedDoc> + ): SavedObjectSanitizedDoc => { + return addOwnerToSO(doc); + }, + }; + + return mergeMigrationFunctionMaps(commentsMigrations, embeddableMigrations); +}; + +const migrateByValueLensVisualizations = ( + migrate: MigrateFunction, + version: string +): SavedObjectMigrationFn<{ comment?: string }> => ( + doc: SavedObjectUnsanitizedDoc<{ comment?: string }> +) => { + if (doc.attributes.comment == null) { + return doc; + } + + const parsedComment = parseCommentString(doc.attributes.comment); + const migratedComment = parsedComment.children.map((comment) => { + if (isLensMarkdownNode(comment)) { + // casting here because ts complains that comment isn't serializable because LensMarkdownNode + // extends Node which has fields that conflict with SerializableRecord even though it is serializable + return migrate(comment as SerializableRecord) as LensMarkdownNode; + } + + return comment; + }); + + const migratedMarkdown = { ...parsedComment, children: migratedComment }; + + return { + ...doc, + attributes: { + ...doc.attributes, + comment: stringifyCommentWithoutTrailingNewline(doc.attributes.comment, migratedMarkdown), + }, + }; +}; + +export const stringifyCommentWithoutTrailingNewline = ( + originalComment: string, + markdownNode: MarkdownNode +) => { + const stringifiedComment = stringifyMarkdownComment(markdownNode); + + // if the original comment already ended with a newline then just leave it there + if (originalComment.endsWith('\n')) { + return stringifiedComment; + } + + // the original comment did not end with a newline so the markdown library is going to add one, so let's remove it + // so the comment stays consistent + return trimEnd(stringifiedComment, '\n'); +}; diff --git a/x-pack/plugins/cases/server/saved_object_types/migrations/index.test.ts b/x-pack/plugins/cases/server/saved_object_types/migrations/index.test.ts deleted file mode 100644 index 151c340297ceb..0000000000000 --- a/x-pack/plugins/cases/server/saved_object_types/migrations/index.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { createCommentsMigrations } from './index'; -import { - getLensVisualizations, - parseCommentString, -} from '../../../common/utils/markdown_plugins/utils'; - -import { savedObjectsServiceMock } from '../../../../../../src/core/server/mocks'; -import { lensEmbeddableFactory } from '../../../../lens/server/embeddable/lens_embeddable_factory'; -import { LensDocShape715 } from '../../../../lens/server'; -import { SavedObjectReference } from 'kibana/server'; - -const migrations = createCommentsMigrations({ - lensEmbeddableFactory, -}); - -const contextMock = savedObjectsServiceMock.createMigrationContext(); - -describe('lens embeddable migrations for by value panels', () => { - describe('7.14.0 remove time zone from Lens visualization date histogram', () => { - const lensVisualizationToMigrate = { - title: 'MyRenamedOps', - description: '', - visualizationType: 'lnsXY', - state: { - datasourceStates: { - indexpattern: { - layers: { - '2': { - columns: { - '3': { - label: '@timestamp', - dataType: 'date', - operationType: 'date_histogram', - sourceField: '@timestamp', - isBucketed: true, - scale: 'interval', - params: { interval: 'auto', timeZone: 'Europe/Berlin' }, - }, - '4': { - label: '@timestamp', - dataType: 'date', - operationType: 'date_histogram', - sourceField: '@timestamp', - isBucketed: true, - scale: 'interval', - params: { interval: 'auto' }, - }, - '5': { - label: '@timestamp', - dataType: 'date', - operationType: 'my_unexpected_operation', - isBucketed: true, - scale: 'interval', - params: { timeZone: 'do not delete' }, - }, - }, - columnOrder: ['3', '4', '5'], - incompleteColumns: {}, - }, - }, - }, - }, - visualization: { - title: 'Empty XY chart', - legend: { isVisible: true, position: 'right' }, - valueLabels: 'hide', - preferredSeriesType: 'bar_stacked', - layers: [ - { - layerId: '5ab74ddc-93ca-44e2-9857-ecf85c86b53e', - accessors: [ - '5fea2a56-7b73-44b5-9a50-7f0c0c4f8fd0', - 'e5efca70-edb5-4d6d-a30a-79384066987e', - '7ffb7bde-4f42-47ab-b74d-1b4fd8393e0f', - ], - position: 'top', - seriesType: 'bar_stacked', - showGridlines: false, - xAccessor: '2e57a41e-5a52-42d3-877f-bd211d903ef8', - }, - ], - }, - query: { query: '', language: 'kuery' }, - filters: [], - }, - }; - - const expectedLensVisualizationMigrated = { - title: 'MyRenamedOps', - description: '', - visualizationType: 'lnsXY', - state: { - datasourceStates: { - indexpattern: { - layers: { - '2': { - columns: { - '3': { - label: '@timestamp', - dataType: 'date', - operationType: 'date_histogram', - sourceField: '@timestamp', - isBucketed: true, - scale: 'interval', - params: { interval: 'auto' }, - }, - '4': { - label: '@timestamp', - dataType: 'date', - operationType: 'date_histogram', - sourceField: '@timestamp', - isBucketed: true, - scale: 'interval', - params: { interval: 'auto' }, - }, - '5': { - label: '@timestamp', - dataType: 'date', - operationType: 'my_unexpected_operation', - isBucketed: true, - scale: 'interval', - params: { timeZone: 'do not delete' }, - }, - }, - columnOrder: ['3', '4', '5'], - incompleteColumns: {}, - }, - }, - }, - }, - visualization: { - title: 'Empty XY chart', - legend: { isVisible: true, position: 'right' }, - valueLabels: 'hide', - preferredSeriesType: 'bar_stacked', - layers: [ - { - layerId: '5ab74ddc-93ca-44e2-9857-ecf85c86b53e', - accessors: [ - '5fea2a56-7b73-44b5-9a50-7f0c0c4f8fd0', - 'e5efca70-edb5-4d6d-a30a-79384066987e', - '7ffb7bde-4f42-47ab-b74d-1b4fd8393e0f', - ], - position: 'top', - seriesType: 'bar_stacked', - showGridlines: false, - xAccessor: '2e57a41e-5a52-42d3-877f-bd211d903ef8', - }, - ], - }, - query: { query: '', language: 'kuery' }, - filters: [], - }, - }; - - const expectedMigrationCommentResult = `"**Amazing**\n\n!{tooltip[Tessss](https://example.com)}\n\nbrbrbr\n\n[asdasdasdasd](http://localhost:5601/moq/app/security/timelines?timeline=(id%3A%27e4362a60-f478-11eb-a4b0-ebefce184d8d%27%2CisOpen%3A!t))\n\n!{lens{\"timeRange\":{\"from\":\"now-7d\",\"to\":\"now\",\"mode\":\"relative\"},\"attributes\":${JSON.stringify( - expectedLensVisualizationMigrated - )}}}\n\n!{lens{\"timeRange\":{\"from\":\"now-7d\",\"to\":\"now\",\"mode\":\"relative\"},\"attributes\":{\"title\":\"TEst22\",\"type\":\"lens\",\"visualizationType\":\"lnsMetric\",\"state\":{\"datasourceStates\":{\"indexpattern\":{\"layers\":{\"layer1\":{\"columnOrder\":[\"col2\"],\"columns\":{\"col2\":{\"dataType\":\"number\",\"isBucketed\":false,\"label\":\"Count of records\",\"operationType\":\"count\",\"scale\":\"ratio\",\"sourceField\":\"Records\"}}}}}},\"visualization\":{\"layerId\":\"layer1\",\"accessor\":\"col2\"},\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filters\":[]},\"references\":[{\"type\":\"index-pattern\",\"id\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"name\":\"indexpattern-datasource-current-indexpattern\"},{\"type\":\"index-pattern\",\"id\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"name\":\"indexpattern-datasource-layer-layer1\"}]}}}\n\nbrbrbr" -`; - - const caseComment = { - type: 'cases-comments', - id: '1cefd0d0-e86d-11eb-bae5-3d065cd16a32', - attributes: { - associationType: 'case', - comment: `"**Amazing**\n\n!{tooltip[Tessss](https://example.com)}\n\nbrbrbr\n\n[asdasdasdasd](http://localhost:5601/moq/app/security/timelines?timeline=(id%3A%27e4362a60-f478-11eb-a4b0-ebefce184d8d%27%2CisOpen%3A!t))\n\n!{lens{\"timeRange\":{\"from\":\"now-7d\",\"to\":\"now\",\"mode\":\"relative\"},\"editMode\":false,\"attributes\":${JSON.stringify( - lensVisualizationToMigrate - )}}}\n\n!{lens{\"timeRange\":{\"from\":\"now-7d\",\"to\":\"now\",\"mode\":\"relative\"},\"editMode\":false,\"attributes\":{\"title\":\"TEst22\",\"type\":\"lens\",\"visualizationType\":\"lnsMetric\",\"state\":{\"datasourceStates\":{\"indexpattern\":{\"layers\":{\"layer1\":{\"columnOrder\":[\"col2\"],\"columns\":{\"col2\":{\"dataType\":\"number\",\"isBucketed\":false,\"label\":\"Count of records\",\"operationType\":\"count\",\"scale\":\"ratio\",\"sourceField\":\"Records\"}}}}}},\"visualization\":{\"layerId\":\"layer1\",\"accessor\":\"col2\"},\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filters\":[]},\"references\":[{\"type\":\"index-pattern\",\"id\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"name\":\"indexpattern-datasource-current-indexpattern\"},{\"type\":\"index-pattern\",\"id\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"name\":\"indexpattern-datasource-layer-layer1\"}]}}}\n\nbrbrbr"`, - type: 'user', - created_at: '2021-07-19T08:41:29.951Z', - created_by: { - email: null, - full_name: null, - username: 'elastic', - }, - pushed_at: null, - pushed_by: null, - updated_at: '2021-07-19T08:41:47.549Z', - updated_by: { - full_name: null, - email: null, - username: 'elastic', - }, - }, - references: [ - { - name: 'associated-cases', - id: '77d1b230-d35e-11eb-8da6-6f746b9cb499', - type: 'cases', - }, - { - name: 'indexpattern-datasource-current-indexpattern', - id: '90943e30-9a47-11e8-b64d-95841ca0b247', - type: 'index-pattern', - }, - { - name: 'indexpattern-datasource-current-indexpattern', - id: '90943e30-9a47-11e8-b64d-95841ca0b247', - type: 'index-pattern', - }, - ], - migrationVersion: { - 'cases-comments': '7.14.0', - }, - coreMigrationVersion: '8.0.0', - updated_at: '2021-07-19T08:41:47.552Z', - version: 'WzgxMTY4MSw5XQ==', - namespaces: ['default'], - score: 0, - }; - - it('should remove time zone param from date histogram', () => { - expect(migrations['7.14.0']).toBeDefined(); - const result = migrations['7.14.0'](caseComment, contextMock); - - const parsedComment = parseCommentString(result.attributes.comment); - const lensVisualizations = (getLensVisualizations( - parsedComment.children - ) as unknown) as Array<{ - attributes: LensDocShape715 & { references: SavedObjectReference[] }; - }>; - - const layers = Object.values( - lensVisualizations[0].attributes.state.datasourceStates.indexpattern.layers - ); - expect(result.attributes.comment).toEqual(expectedMigrationCommentResult); - expect(layers.length).toBe(1); - const columns = Object.values(layers[0].columns); - expect(columns.length).toBe(3); - expect(columns[0].operationType).toEqual('date_histogram'); - expect((columns[0] as { params: {} }).params).toEqual({ interval: 'auto' }); - expect(columns[1].operationType).toEqual('date_histogram'); - expect((columns[1] as { params: {} }).params).toEqual({ interval: 'auto' }); - expect(columns[2].operationType).toEqual('my_unexpected_operation'); - expect((columns[2] as { params: {} }).params).toEqual({ timeZone: 'do not delete' }); - }); - }); -}); diff --git a/x-pack/plugins/cases/server/saved_object_types/migrations/index.ts b/x-pack/plugins/cases/server/saved_object_types/migrations/index.ts index 339a30f50d631..a445131073d19 100644 --- a/x-pack/plugins/cases/server/saved_object_types/migrations/index.ts +++ b/x-pack/plugins/cases/server/saved_object_types/migrations/index.ts @@ -7,30 +7,15 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { mapValues } from 'lodash'; -import { LensServerPluginSetup } from '../../../../lens/server'; - -import { - mergeMigrationFunctionMaps, - MigrateFunction, - MigrateFunctionsObject, -} from '../../../../../../src/plugins/kibana_utils/common'; import { SavedObjectUnsanitizedDoc, SavedObjectSanitizedDoc, - SavedObjectMigrationFn, - SavedObjectMigrationMap, } from '../../../../../../src/core/server'; -import { - ConnectorTypes, - CommentType, - AssociationType, - SECURITY_SOLUTION_OWNER, -} from '../../../common'; -import { parseCommentString, stringifyComment } from '../../../common/utils/markdown_plugins/utils'; +import { ConnectorTypes, SECURITY_SOLUTION_OWNER } from '../../../common'; export { caseMigrations } from './cases'; export { configureMigrations } from './configuration'; +export { createCommentsMigrations, CreateCommentsMigrationsDeps } from './comments'; interface UserActions { action_field: string[]; @@ -99,97 +84,6 @@ export const userActionsMigrations = { }, }; -interface UnsanitizedComment { - comment: string; - type?: CommentType; -} - -interface SanitizedComment { - comment: string; - type: CommentType; -} - -interface SanitizedCommentForSubCases { - associationType: AssociationType; - rule?: { id: string | null; name: string | null }; -} - -const migrateByValueLensVisualizations = ( - migrate: MigrateFunction, - version: string -): SavedObjectMigrationFn => (doc: any) => { - const parsedComment = parseCommentString(doc.attributes.comment); - const migratedComment = parsedComment.children.map((comment) => { - if (comment?.type === 'lens') { - // @ts-expect-error - return migrate(comment); - } - - return comment; - }); - - // @ts-expect-error - parsedComment.children = migratedComment; - doc.attributes.comment = stringifyComment(parsedComment); - - return doc; -}; - -export interface CreateCommentsMigrationsDeps { - lensEmbeddableFactory: LensServerPluginSetup['lensEmbeddableFactory']; -} - -export const createCommentsMigrations = ( - migrationDeps: CreateCommentsMigrationsDeps -): SavedObjectMigrationMap => { - const embeddableMigrations = mapValues( - migrationDeps.lensEmbeddableFactory().migrations, - migrateByValueLensVisualizations - ) as MigrateFunctionsObject; - - const commentsMigrations = { - '7.11.0': ( - doc: SavedObjectUnsanitizedDoc - ): SavedObjectSanitizedDoc => { - return { - ...doc, - attributes: { - ...doc.attributes, - type: CommentType.user, - }, - references: doc.references || [], - }; - }, - '7.12.0': ( - doc: SavedObjectUnsanitizedDoc - ): SavedObjectSanitizedDoc => { - let attributes: SanitizedCommentForSubCases & UnsanitizedComment = { - ...doc.attributes, - associationType: AssociationType.case, - }; - - // only add the rule object for alert comments. Prior to 7.12 we only had CommentType.alert, generated alerts are - // introduced in 7.12. - if (doc.attributes.type === CommentType.alert) { - attributes = { ...attributes, rule: { id: null, name: null } }; - } - - return { - ...doc, - attributes, - references: doc.references || [], - }; - }, - '7.14.0': ( - doc: SavedObjectUnsanitizedDoc> - ): SavedObjectSanitizedDoc => { - return addOwnerToSO(doc); - }, - }; - - return mergeMigrationFunctionMaps(commentsMigrations, embeddableMigrations); -}; - export const connectorMappingsMigrations = { '7.14.0': ( doc: SavedObjectUnsanitizedDoc> diff --git a/x-pack/plugins/cases/server/saved_object_types/user_actions.ts b/x-pack/plugins/cases/server/saved_object_types/user_actions.ts index 16bb7ac09a6ef..883105982bcb3 100644 --- a/x-pack/plugins/cases/server/saved_object_types/user_actions.ts +++ b/x-pack/plugins/cases/server/saved_object_types/user_actions.ts @@ -49,4 +49,7 @@ export const caseUserActionSavedObjectType: SavedObjectsType = { }, }, migrations: userActionsMigrations, + management: { + importableAndExportable: true, + }, }; diff --git a/x-pack/plugins/cloud/jest.config.js b/x-pack/plugins/cloud/jest.config.js index 68f63b4d8b5ac..4235e79e79268 100644 --- a/x-pack/plugins/cloud/jest.config.js +++ b/x-pack/plugins/cloud/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/cloud'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/cloud', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/cloud/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/cloud/public/fullstory.ts b/x-pack/plugins/cloud/public/fullstory.ts index 25d5320a063bd..4f76abf540cae 100644 --- a/x-pack/plugins/cloud/public/fullstory.ts +++ b/x-pack/plugins/cloud/public/fullstory.ts @@ -14,8 +14,11 @@ export interface FullStoryDeps { packageInfo: PackageInfo; } +export type FullstoryUserVars = Record; + export interface FullStoryApi { - identify(userId: string, userVars?: Record): void; + identify(userId: string, userVars?: FullstoryUserVars): void; + setUserVars(userVars?: FullstoryUserVars): void; event(eventName: string, eventProperties: Record): void; } diff --git a/x-pack/plugins/cloud/public/plugin.test.mocks.ts b/x-pack/plugins/cloud/public/plugin.test.mocks.ts index 4eb206d07bf85..b79fb1bc65130 100644 --- a/x-pack/plugins/cloud/public/plugin.test.mocks.ts +++ b/x-pack/plugins/cloud/public/plugin.test.mocks.ts @@ -10,6 +10,7 @@ import type { FullStoryDeps, FullStoryApi, FullStoryService } from './fullstory' export const fullStoryApiMock: jest.Mocked = { event: jest.fn(), + setUserVars: jest.fn(), identify: jest.fn(), }; export const initializeFullStoryMock = jest.fn(() => ({ diff --git a/x-pack/plugins/cloud/public/plugin.test.ts b/x-pack/plugins/cloud/public/plugin.test.ts index 835a52cb814c8..f3d5bd902c6d7 100644 --- a/x-pack/plugins/cloud/public/plugin.test.ts +++ b/x-pack/plugins/cloud/public/plugin.test.ts @@ -11,6 +11,7 @@ import { homePluginMock } from 'src/plugins/home/public/mocks'; import { securityMock } from '../../security/public/mocks'; import { fullStoryApiMock, initializeFullStoryMock } from './plugin.test.mocks'; import { CloudPlugin, CloudConfigType, loadFullStoryUserId } from './plugin'; +import { Observable, Subject } from 'rxjs'; describe('Cloud Plugin', () => { describe('#setup', () => { @@ -23,10 +24,12 @@ describe('Cloud Plugin', () => { config = {}, securityEnabled = true, currentUserProps = {}, + currentAppId$ = undefined, }: { config?: Partial; securityEnabled?: boolean; currentUserProps?: Record; + currentAppId$?: Observable; }) => { const initContext = coreMock.createPluginInitializerContext({ id: 'cloudId', @@ -39,9 +42,15 @@ describe('Cloud Plugin', () => { }, ...config, }); + const plugin = new CloudPlugin(initContext); const coreSetup = coreMock.createSetup(); + const coreStart = coreMock.createStart(); + if (currentAppId$) { + coreStart.application.currentAppId$ = currentAppId$; + } + coreSetup.getStartServices.mockResolvedValue([coreStart, {}, undefined]); const securitySetup = securityMock.createSetup(); securitySetup.authc.getCurrentUser.mockResolvedValue( securityMock.createMockAuthenticatedUser(currentUserProps) @@ -78,10 +87,46 @@ describe('Cloud Plugin', () => { }); expect(fullStoryApiMock.identify).toHaveBeenCalledWith( - '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4' + '03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4', + { + version_str: 'version', + version_major_int: -1, + version_minor_int: -1, + version_patch_int: -1, + } ); }); + it('calls FS.setUserVars everytime an app changes', async () => { + const currentAppId$ = new Subject(); + const { plugin } = await setupPlugin({ + config: { full_story: { enabled: true, org_id: 'foo' } }, + currentUserProps: { + username: '1234', + }, + currentAppId$, + }); + + expect(fullStoryApiMock.setUserVars).not.toHaveBeenCalled(); + currentAppId$.next('App1'); + expect(fullStoryApiMock.setUserVars).toHaveBeenCalledWith({ + app_id_str: 'App1', + }); + currentAppId$.next(); + expect(fullStoryApiMock.setUserVars).toHaveBeenCalledWith({ + app_id_str: 'unknown', + }); + + currentAppId$.next('App2'); + expect(fullStoryApiMock.setUserVars).toHaveBeenCalledWith({ + app_id_str: 'App2', + }); + + expect(currentAppId$.observers.length).toBe(1); + plugin.stop(); + expect(currentAppId$.observers.length).toBe(0); + }); + it('does not call FS.identify when security is not available', async () => { await setupPlugin({ config: { full_story: { enabled: true, org_id: 'foo' } }, diff --git a/x-pack/plugins/cloud/public/plugin.ts b/x-pack/plugins/cloud/public/plugin.ts index 29befcee397dd..6053f2eb5b8c3 100644 --- a/x-pack/plugins/cloud/public/plugin.ts +++ b/x-pack/plugins/cloud/public/plugin.ts @@ -12,8 +12,10 @@ import { PluginInitializerContext, HttpStart, IBasePath, + ApplicationStart, } from 'src/core/public'; import { i18n } from '@kbn/i18n'; +import { Subscription } from 'rxjs'; import type { AuthenticatedUser, SecurityPluginSetup, @@ -58,9 +60,15 @@ export interface CloudSetup { isCloudEnabled: boolean; } +interface SetupFullstoryDeps extends CloudSetupDependencies { + application?: Promise; + basePath: IBasePath; +} + export class CloudPlugin implements Plugin { private config!: CloudConfigType; private isCloudEnabled: boolean; + private appSubscription?: Subscription; constructor(private readonly initializerContext: PluginInitializerContext) { this.config = this.initializerContext.config.get(); @@ -68,7 +76,10 @@ export class CloudPlugin implements Plugin { } public setup(core: CoreSetup, { home, security }: CloudSetupDependencies) { - this.setupFullstory({ basePath: core.http.basePath, security }).catch((e) => + const application = core.getStartServices().then(([coreStart]) => { + return coreStart.application; + }); + this.setupFullstory({ basePath: core.http.basePath, security, application }).catch((e) => // eslint-disable-next-line no-console console.debug(`Error setting up FullStory: ${e.toString()}`) ); @@ -138,6 +149,10 @@ export class CloudPlugin implements Plugin { .catch(() => setLinks(true)); } + public stop() { + this.appSubscription?.unsubscribe(); + } + /** * Determines if the current user should see links back to Cloud. * This isn't a true authorization check, but rather a heuristic to @@ -164,10 +179,7 @@ export class CloudPlugin implements Plugin { return user?.roles.includes('superuser') ?? true; } - private async setupFullstory({ - basePath, - security, - }: CloudSetupDependencies & { basePath: IBasePath }) { + private async setupFullstory({ basePath, security, application }: SetupFullstoryDeps) { const { enabled, org_id: orgId } = this.config.full_story; if (!enabled || !orgId) { return; // do not load any fullstory code in the browser if not enabled @@ -198,7 +210,35 @@ export class CloudPlugin implements Plugin { if (userId) { // Do the hashing here to keep it at clear as possible in our source code that we do not send literal user IDs const hashedId = sha256(userId.toString()); - fullStory.identify(hashedId); + application + ?.then(async () => { + const appStart = await application; + this.appSubscription = appStart.currentAppId$.subscribe((appId) => { + // Update the current application every time it changes + fullStory.setUserVars({ + app_id_str: appId ?? 'unknown', + }); + }); + }) + .catch((e) => { + // eslint-disable-next-line no-console + console.error( + `[cloud.full_story] Could not retrieve application service due to error: ${e.toString()}`, + e + ); + }); + const kibanaVer = this.initializerContext.env.packageInfo.version; + // TODO: use semver instead + const parsedVer = (kibanaVer.indexOf('.') > -1 ? kibanaVer.split('.') : []).map((s) => + parseInt(s, 10) + ); + // `str` suffix is required for evn vars, see docs: https://help.fullstory.com/hc/en-us/articles/360020623234 + fullStory.identify(hashedId, { + version_str: kibanaVer, + version_major_int: parsedVer[0] ?? -1, + version_minor_int: parsedVer[1] ?? -1, + version_patch_int: parsedVer[2] ?? -1, + }); } } catch (e) { // eslint-disable-next-line no-console diff --git a/x-pack/plugins/cross_cluster_replication/jest.config.js b/x-pack/plugins/cross_cluster_replication/jest.config.js index 8d39781213dbd..87d557b57a6a7 100644 --- a/x-pack/plugins/cross_cluster_replication/jest.config.js +++ b/x-pack/plugins/cross_cluster_replication/jest.config.js @@ -9,4 +9,10 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/cross_cluster_replication'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/cross_cluster_replication', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/cross_cluster_replication/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/dashboard_enhanced/jest.config.js b/x-pack/plugins/dashboard_enhanced/jest.config.js index 8ade9e0a09f5e..86ae949431e69 100644 --- a/x-pack/plugins/dashboard_enhanced/jest.config.js +++ b/x-pack/plugins/dashboard_enhanced/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/dashboard_enhanced'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/dashboard_enhanced', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/dashboard_enhanced/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/data_enhanced/jest.config.js b/x-pack/plugins/data_enhanced/jest.config.js index 62b54b1ba36bc..e48de352c2075 100644 --- a/x-pack/plugins/data_enhanced/jest.config.js +++ b/x-pack/plugins/data_enhanced/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/data_enhanced'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/data_enhanced', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/data_enhanced/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/data_visualizer/jest.config.js b/x-pack/plugins/data_visualizer/jest.config.js index 1c4974471bd79..46de590b709bb 100644 --- a/x-pack/plugins/data_visualizer/jest.config.js +++ b/x-pack/plugins/data_visualizer/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/data_visualizer'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/data_visualizer', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/data_visualizer/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/embedded_map/embedded_map.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/embedded_map/embedded_map.tsx index 29131b4a3372a..13aab06640bd5 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/embedded_map/embedded_map.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/embedded_map/embedded_map.tsx @@ -8,8 +8,7 @@ import React, { useEffect, useRef, useState } from 'react'; import { htmlIdGenerator } from '@elastic/eui'; -import { LayerDescriptor } from '../../../../../../maps/common/descriptor_types'; -import { INITIAL_LOCATION } from '../../../../../../maps/common/constants'; +import { INITIAL_LOCATION, LayerDescriptor } from '../../../../../../maps/common'; import { MapEmbeddable, MapEmbeddableInput, diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content/format_utils.ts b/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content/format_utils.ts index ddc9255b4834d..b314741e95284 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content/format_utils.ts +++ b/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content/format_utils.ts @@ -8,7 +8,7 @@ import { Feature, Point } from 'geojson'; import { euiPaletteColorBlind } from '@elastic/eui'; import { DEFAULT_GEO_REGEX } from './geo_point_content'; -import { SOURCE_TYPES } from '../../../../../../../maps/common/constants'; +import { SOURCE_TYPES } from '../../../../../../../maps/common'; export const convertWKTGeoToLonLat = ( value: string | number diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx index b4c8c3c22f5a9..082083fa92ff2 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/geo_point_content_with_map/geo_point_content_with_map.tsx @@ -7,16 +7,15 @@ import React, { FC, useEffect, useState } from 'react'; import { EuiFlexItem } from '@elastic/eui'; -import { IndexPattern } from '../../../../../../../../../src/plugins/data/common/index_patterns/index_patterns'; +import { IndexPattern } from '../../../../../../../../../src/plugins/data/common'; import { CombinedQuery } from '../../../../index_data_visualizer/types/combined_query'; import { ExpandedRowContent } from '../../stats_table/components/field_data_expanded_row/expanded_row_content'; import { DocumentStatsTable } from '../../stats_table/components/field_data_expanded_row/document_stats'; import { ExamplesList } from '../../examples_list'; import { FieldVisConfig } from '../../stats_table/types'; -import { LayerDescriptor } from '../../../../../../../maps/common/descriptor_types'; import { useDataVisualizerKibana } from '../../../../kibana_context'; import { JOB_FIELD_TYPES } from '../../../../../../common'; -import { ES_GEO_FIELD_TYPE } from '../../../../../../../maps/common'; +import { ES_GEO_FIELD_TYPE, LayerDescriptor } from '../../../../../../../maps/common'; import { EmbeddedMapComponent } from '../../embedded_map'; export const GeoPointContentWithMap: FC<{ diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx index 6406012a0540b..ca9c8301bcfba 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/expanded_row/index_based_expanded_row.tsx @@ -19,7 +19,7 @@ import { } from '../stats_table/components/field_data_expanded_row'; import { NotInDocsContent } from '../not_in_docs_content'; import { FieldVisConfig } from '../stats_table/types'; -import { IndexPattern } from '../../../../../../../../src/plugins/data/common/index_patterns/index_patterns'; +import { IndexPattern } from '../../../../../../../../src/plugins/data/common'; import { CombinedQuery } from '../../../index_data_visualizer/types/combined_query'; import { LoadingIndicator } from '../loading_indicator'; diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts b/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts index a77ca1d589349..1fee95aeb5bfa 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts +++ b/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import { Action } from '@elastic/eui/src/components/basic_table/action_types'; import { MutableRefObject } from 'react'; import { getCompatibleLensDataType, getLensAttributes } from './lens_utils'; -import { IndexPattern } from '../../../../../../../../../src/plugins/data/common/index_patterns/index_patterns'; +import { IndexPattern } from '../../../../../../../../../src/plugins/data/common'; import { CombinedQuery } from '../../../../index_data_visualizer/types/combined_query'; import { FieldVisConfig } from '../../stats_table/types'; import { DataVisualizerKibanaReactContextValue } from '../../../../kibana_context'; diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts b/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts index 0b0c0e8fe3f09..3f80bbefcc259 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts +++ b/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/lens_utils.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import type { IndexPattern } from '../../../../../../../../../src/plugins/data/common/index_patterns/index_patterns'; +import type { IndexPattern } from '../../../../../../../../../src/plugins/data/common'; import type { CombinedQuery } from '../../../../index_data_visualizer/types/combined_query'; import type { IndexPatternColumn, diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/field_type_icon/__snapshots__/field_type_icon.test.tsx.snap b/x-pack/plugins/data_visualizer/public/application/common/components/field_type_icon/__snapshots__/field_type_icon.test.tsx.snap index 769ebdeba9955..e69e2e7626718 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/field_type_icon/__snapshots__/field_type_icon.test.tsx.snap +++ b/x-pack/plugins/data_visualizer/public/application/common/components/field_type_icon/__snapshots__/field_type_icon.test.tsx.snap @@ -4,6 +4,7 @@ exports[`FieldTypeIcon render component when type matches a field type 1`] = ` /x-pack/plugins/discover_enhanced'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/discover_enhanced', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/discover_enhanced/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/drilldowns/jest.config.js b/x-pack/plugins/drilldowns/jest.config.js index 39259ca43b3b8..a5db93a916ebb 100644 --- a/x-pack/plugins/drilldowns/jest.config.js +++ b/x-pack/plugins/drilldowns/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/drilldowns'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/drilldowns', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/drilldowns/url_drilldown/public/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/drilldowns/url_drilldown/kibana.json b/x-pack/plugins/drilldowns/url_drilldown/kibana.json index a4552d201f263..83ea4b7be54bf 100644 --- a/x-pack/plugins/drilldowns/url_drilldown/kibana.json +++ b/x-pack/plugins/drilldowns/url_drilldown/kibana.json @@ -7,6 +7,7 @@ "name": "App Services", "githubTeam": "kibana-app-services" }, + "description": "Adds drilldown implementations to Kibana", "requiredPlugins": ["embeddable", "uiActions", "uiActionsEnhanced"], "requiredBundles": ["kibanaUtils", "kibanaReact"] } diff --git a/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.test.ts b/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.test.ts index 07c6addda2767..a6896367bd613 100644 --- a/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.test.ts +++ b/x-pack/plugins/drilldowns/url_drilldown/public/lib/url_drilldown.test.ts @@ -262,7 +262,7 @@ describe('UrlDrilldown', () => { indexPatterns: [{ id: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' }], } ); - const data: any = { + const data = { data: [ createPoint({ field: 'field0', value: 'value0' }), createPoint({ field: 'field1', value: 'value1' }), diff --git a/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts b/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts index 65c665a182e18..491501b9dd4a7 100644 --- a/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts +++ b/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/context_variables.ts @@ -54,7 +54,7 @@ export interface ContextValues { panel: PanelValues; } -function hasSavedObjectId(obj: Record): obj is { savedObjectId: string } { +function hasSavedObjectId(obj: Record): obj is { savedObjectId: string } { return 'savedObjectId' in obj && typeof obj.savedObjectId === 'string'; } @@ -64,12 +64,13 @@ function hasSavedObjectId(obj: Record): obj is { savedObjectId: str */ function getIndexPatternIds(output: EmbeddableOutput): string[] { function hasIndexPatterns( - _output: Record + _output: unknown ): _output is { indexPatterns: Array<{ id?: string }> } { return ( - 'indexPatterns' in _output && - Array.isArray(_output.indexPatterns) && - _output.indexPatterns.length > 0 + typeof _output === 'object' && + !!_output && + Array.isArray((_output as { indexPatterns: unknown[] }).indexPatterns) && + (_output as { indexPatterns: Array<{ id?: string }> }).indexPatterns.length > 0 ); } return hasIndexPatterns(output) diff --git a/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/event_variables.test.ts b/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/event_variables.test.ts index 3d0c55a08d1bf..2a56a5fa0e102 100644 --- a/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/event_variables.test.ts +++ b/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/event_variables.test.ts @@ -53,7 +53,10 @@ describe('VALUE_CLICK_TRIGGER', () => { describe('handles undefined, null or missing values', () => { test('undefined or missing values are removed from the result scope', () => { - const point = createPoint({ field: undefined } as any); + const point = createPoint(({ field: undefined } as unknown) as { + field: string; + value: string | null | number | boolean; + }); const eventScope = getEventScopeValues({ data: { data: [point] }, }) as ValueClickTriggerEventScope; diff --git a/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/util.ts b/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/util.ts index ef9045b9ba108..660bcae9fe146 100644 --- a/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/util.ts +++ b/x-pack/plugins/drilldowns/url_drilldown/public/lib/variables/util.ts @@ -15,7 +15,7 @@ export const toPrimitiveOrUndefined = (v: unknown): Primitive | undefined => { return String(v); }; -export const deleteUndefinedKeys = >(obj: T): T => { +export const deleteUndefinedKeys = >(obj: T): T => { Object.keys(obj).forEach((key) => { if (obj[key] === undefined) { delete obj[key]; diff --git a/x-pack/plugins/embeddable_enhanced/jest.config.js b/x-pack/plugins/embeddable_enhanced/jest.config.js index 47b539ca226cd..fc9eaec5c972c 100644 --- a/x-pack/plugins/embeddable_enhanced/jest.config.js +++ b/x-pack/plugins/embeddable_enhanced/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/embeddable_enhanced'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/embeddable_enhanced', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/embeddable_enhanced/public/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/embeddable_enhanced/kibana.json b/x-pack/plugins/embeddable_enhanced/kibana.json index 09416ce18aecb..36cd0440b64dd 100644 --- a/x-pack/plugins/embeddable_enhanced/kibana.json +++ b/x-pack/plugins/embeddable_enhanced/kibana.json @@ -7,5 +7,6 @@ "name": "App Services", "githubTeam": "kibana-app-services" }, + "description": "Extends embeddable plugin with more functionality", "requiredPlugins": ["embeddable", "kibanaReact", "uiActions", "uiActionsEnhanced"] } diff --git a/x-pack/plugins/encrypted_saved_objects/jest.config.js b/x-pack/plugins/encrypted_saved_objects/jest.config.js index 213484c8e159d..78bfae78227db 100644 --- a/x-pack/plugins/encrypted_saved_objects/jest.config.js +++ b/x-pack/plugins/encrypted_saved_objects/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/encrypted_saved_objects'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/encrypted_saved_objects', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/encrypted_saved_objects/server/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/enterprise_search/README.md b/x-pack/plugins/enterprise_search/README.md index 5c8d767de3099..64855dc1395ab 100644 --- a/x-pack/plugins/enterprise_search/README.md +++ b/x-pack/plugins/enterprise_search/README.md @@ -2,9 +2,7 @@ ## Overview -This plugin provides beta Kibana user interfaces for managing the Enterprise Search solution and its products, App Search and Workplace Search. - -> :warning: The Kibana interface for Enterprise Search is a beta feature. It is subject to change and is not covered by the same level of support as generally available features. This interface will become the sole management panel for Enterprise Search with the 8.0 release. Until then, the standalone Enterprise Search UI remains available and supported. +This plugin provides Kibana user interfaces for managing the Enterprise Search solution and its products, App Search and Workplace Search. ### App Search diff --git a/x-pack/plugins/enterprise_search/common/constants.ts b/x-pack/plugins/enterprise_search/common/constants.ts index f162f5810cb61..bc60c917094f8 100644 --- a/x-pack/plugins/enterprise_search/common/constants.ts +++ b/x-pack/plugins/enterprise_search/common/constants.ts @@ -55,6 +55,7 @@ export const WORKPLACE_SEARCH_PLUGIN = { } ), URL: '/app/enterprise_search/workplace_search', + NON_ADMIN_URL: '/app/enterprise_search/workplace_search/p', SUPPORT_URL: 'https://discuss.elastic.co/c/enterprise-search/workplace-search/', }; diff --git a/x-pack/plugins/enterprise_search/jest.config.js b/x-pack/plugins/enterprise_search/jest.config.js index 7d10d7aa87bf2..263713697b7e0 100644 --- a/x-pack/plugins/enterprise_search/jest.config.js +++ b/x-pack/plugins/enterprise_search/jest.config.js @@ -10,11 +10,12 @@ module.exports = { rootDir: '../../..', roots: ['/x-pack/plugins/enterprise_search'], collectCoverage: true, - coverageReporters: ['text'], + coverageReporters: ['text', 'html'], collectCoverageFrom: [ '/x-pack/plugins/enterprise_search/**/*.{ts,tsx}', '!/x-pack/plugins/enterprise_search/public/*.ts', '!/x-pack/plugins/enterprise_search/server/*.ts', '!/x-pack/plugins/enterprise_search/public/applications/test_helpers/**/*.{ts,tsx}', ], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/enterprise_search', }; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/analytics_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/analytics_logic.test.ts index 921a0892bb890..7b877419a2977 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/analytics_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/analytics_logic.test.ts @@ -163,7 +163,7 @@ describe('AnalyticsLogic', () => { await nextTick(); expect(http.get).toHaveBeenCalledWith( - '/api/app_search/engines/test-engine/analytics/queries', + '/internal/app_search/engines/test-engine/analytics/queries', { query: { start: DEFAULT_START_DATE, @@ -185,7 +185,7 @@ describe('AnalyticsLogic', () => { AnalyticsLogic.actions.loadAnalyticsData(); expect(http.get).toHaveBeenCalledWith( - '/api/app_search/engines/test-engine/analytics/queries', + '/internal/app_search/engines/test-engine/analytics/queries', { query: { start: '1970-01-01', @@ -229,7 +229,7 @@ describe('AnalyticsLogic', () => { await nextTick(); expect(http.get).toHaveBeenCalledWith( - '/api/app_search/engines/test-engine/analytics/queries/some-query', + '/internal/app_search/engines/test-engine/analytics/queries/some-query', { query: { start: DEFAULT_START_DATE, @@ -248,7 +248,7 @@ describe('AnalyticsLogic', () => { AnalyticsLogic.actions.loadQueryData('some-query'); expect(http.get).toHaveBeenCalledWith( - '/api/app_search/engines/test-engine/analytics/queries/some-query', + '/internal/app_search/engines/test-engine/analytics/queries/some-query', { query: { start: '1970-12-30', diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/analytics_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/analytics_logic.ts index bb89e9735934f..3f6436424a63b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/analytics_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/analytics/analytics_logic.ts @@ -158,7 +158,7 @@ export const AnalyticsLogic = kea { await nextTick(); expect(http.get).toHaveBeenCalledWith( - '/api/app_search/engines/some-engine/curations/find_or_create', + '/internal/app_search/engines/some-engine/curations/find_or_create', { query: { query: 'some search' }, } @@ -63,7 +63,7 @@ export const runActionColumnTests = (wrapper: ReactWrapper) => { await nextTick(); expect(http.get).toHaveBeenCalledWith( - '/api/app_search/engines/some-engine/curations/find_or_create', + '/internal/app_search/engines/some-engine/curations/find_or_create', { query: { query: '""' }, } 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 5af5dca3e97dc..2f3aedc8fa11d 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 @@ -154,7 +154,7 @@ describe('ApiLogsLogic', () => { ApiLogsLogic.actions.fetchApiLogs(); - expect(http.get).toHaveBeenCalledWith('/api/app_search/engines/some-engine/api_logs', { + expect(http.get).toHaveBeenCalledWith('/internal/app_search/engines/some-engine/api_logs', { query: { 'page[current]': 1, 'filters[date][from]': '1970-01-01T00:00:00.000Z', diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/api_logs_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/api_logs_logic.ts index a9186bd4d66cf..86c8ec8c5fbd1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/api_logs_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/api_logs_logic.ts @@ -104,7 +104,7 @@ export const ApiLogsLogic = kea>({ const { engineName } = EngineLogic.values; try { - const response = await http.get(`/api/app_search/engines/${engineName}/api_logs`, { + const response = await http.get(`/internal/app_search/engines/${engineName}/api_logs`, { query: { 'page[current]': values.meta.page.current, 'filters[date][from]': getDateString(-1), diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_logic.test.ts index b2dc665fc2b85..4dd699a733b8c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_logic.test.ts @@ -286,7 +286,7 @@ describe('AddDomainLogic', () => { await nextTick(); expect(http.post).toHaveBeenCalledWith( - '/api/app_search/engines/some-engine/crawler/domains', + '/internal/app_search/engines/some-engine/crawler/domains', { query: { respond_with: 'crawler_details', @@ -304,6 +304,8 @@ describe('AddDomainLogic', () => { http.post.mockReturnValueOnce( Promise.resolve({ domains: [], + events: [], + most_recent_crawl_request: null, }) ); @@ -312,6 +314,8 @@ describe('AddDomainLogic', () => { expect(CrawlerLogic.actions.onReceiveCrawlerData).toHaveBeenCalledWith({ domains: [], + events: [], + mostRecentCrawlRequest: null, }); }); @@ -328,6 +332,8 @@ describe('AddDomainLogic', () => { name: 'https://swiftype.co/site-search', }, ], + events: [], + most_recent_crawl_request: null, }) ); jest.spyOn(AddDomainLogic.actions, 'onSubmitNewDomainSuccess'); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_logic.ts index 23bc147a7291d..020515b2cad87 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_logic.ts @@ -204,7 +204,7 @@ export const AddDomainLogic = kea { expect(result).toEqual('https://elastic.co'); expect(http.post).toHaveBeenCalledTimes(1); - expect(http.post).toHaveBeenCalledWith('/api/app_search/crawler/validate_url', { + expect(http.post).toHaveBeenCalledWith('/internal/app_search/crawler/validate_url', { body: JSON.stringify({ url: 'https://elastic.co', checks: ['tcp', 'url_request'] }), }); }); @@ -69,7 +69,7 @@ describe('getDomainWithProtocol', () => { expect(result).toEqual('http://elastic.co'); expect(http.post).toHaveBeenCalledTimes(2); - expect(http.post).toHaveBeenLastCalledWith('/api/app_search/crawler/validate_url', { + expect(http.post).toHaveBeenLastCalledWith('/internal/app_search/crawler/validate_url', { body: JSON.stringify({ url: 'http://elastic.co', checks: ['tcp', 'url_request'] }), }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/utils.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/utils.ts index b0dc8418c4ca9..47613d3d2b673 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/utils.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/utils.ts @@ -36,7 +36,7 @@ export const getDomainWithProtocol = async (domain: string) => { if (!domain.startsWith('https://') && !domain.startsWith('http://')) { try { - const route = '/api/app_search/crawler/validate_url'; + const route = '/internal/app_search/crawler/validate_url'; const checks = ['tcp', 'url_request']; const httpsCheckData: CrawlerDomainValidationResultFromServer = await http.post(route, { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/validation_step_panel.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/validation_step_panel.test.tsx index c022b09d4638c..ace6b85210fc2 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/validation_step_panel.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/validation_step_panel.test.tsx @@ -44,7 +44,7 @@ describe('ValidationStepPanel', () => { action={action} /> ); - expect(wrapper.find('[data-test-subj="errorMessage"]').dive().text()).toContain( + expect(wrapper.find('[data-test-subj="errorMessage"]').childAt(0).text()).toContain( 'Error message' ); expect(wrapper.find('[data-test-subj="action"]')).toHaveLength(1); @@ -58,7 +58,7 @@ describe('ValidationStepPanel', () => { action={action} /> ); - expect(wrapper.find('[data-test-subj="errorMessage"]').dive().text()).toContain( + expect(wrapper.find('[data-test-subj="errorMessage"]').childAt(0).text()).toContain( 'Error message' ); expect(wrapper.find('[data-test-subj="action"]')).toHaveLength(1); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/validation_step_panel.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/validation_step_panel.tsx index 804c2d86ca099..dc19b526714a5 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/validation_step_panel.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/validation_step_panel.tsx @@ -7,7 +7,14 @@ import React from 'react'; -import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiMarkdownFormat, + EuiPanel, + EuiSpacer, + EuiTitle, +} from '@elastic/eui'; import { CrawlerDomainValidationStep } from '../../types'; @@ -26,9 +33,14 @@ export const ValidationStepPanel: React.FC = ({ action, }) => { const showErrorMessage = step.state === 'invalid' || step.state === 'warning'; + const styleOverride = showErrorMessage ? { paddingBottom: 0 } : {}; return ( - + @@ -41,13 +53,14 @@ export const ValidationStepPanel: React.FC = ({ {showErrorMessage && ( <> - -

{step.message}

-
+ + + {step.message || ''} + {action && ( <> - {action} + )} diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.test.tsx index 13a7c641822b9..b36b92bc42847 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.test.tsx @@ -16,16 +16,17 @@ import { EuiBasicTable, EuiEmptyPrompt } from '@elastic/eui'; import { mountWithIntl } from '../../../../test_helpers'; -import { CrawlerStatus, CrawlRequest } from '../types'; +import { CrawlEvent, CrawlerStatus } from '../types'; import { CrawlRequestsTable } from './crawl_requests_table'; -const values: { crawlRequests: CrawlRequest[] } = { +const values: { events: CrawlEvent[] } = { // CrawlerLogic - crawlRequests: [ + events: [ { id: '618d0e66abe97bc688328900', status: CrawlerStatus.Pending, + stage: 'crawl', createdAt: 'Mon, 31 Aug 2020 17:00:00 +0000', beganAt: null, completedAt: null, @@ -69,7 +70,7 @@ describe('CrawlRequestsTable', () => { it('displays an empty prompt when there are no crawl requests', () => { setMockValues({ ...values, - crawlRequests: [], + events: [], }); wrapper = shallow(); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.tsx index 8a2b08878ff78..6d14e35946adf 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.tsx @@ -9,16 +9,21 @@ import React from 'react'; import { useValues } from 'kea'; -import { EuiBasicTable, EuiEmptyPrompt, EuiTableFieldDataColumnType } from '@elastic/eui'; +import { + EuiBasicTable, + EuiEmptyPrompt, + EuiIconTip, + EuiTableFieldDataColumnType, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { CrawlerLogic } from '../crawler_logic'; -import { CrawlRequest, readableCrawlerStatuses } from '../types'; +import { CrawlEvent, readableCrawlerStatuses } from '../types'; import { CustomFormattedTimestamp } from './custom_formatted_timestamp'; -const columns: Array> = [ +const columns: Array> = [ { field: 'id', name: i18n.translate( @@ -36,7 +41,7 @@ const columns: Array> = [ defaultMessage: 'Created', } ), - render: (createdAt: CrawlRequest['createdAt']) => ( + render: (createdAt: CrawlEvent['createdAt']) => ( ), }, @@ -48,17 +53,32 @@ const columns: Array> = [ defaultMessage: 'Status', } ), - render: (status: CrawlRequest['status']) => readableCrawlerStatuses[status], + align: 'right', + render: (status: CrawlEvent['status'], event: CrawlEvent) => ( + <> + {event.stage === 'process' && ( + + )} + {readableCrawlerStatuses[status]} + + ), }, ]; export const CrawlRequestsTable: React.FC = () => { - const { crawlRequests } = useValues(CrawlerLogic); + const { events } = useValues(CrawlerLogic); return ( { rule: CrawlerRules.beginsWith, }; expect(table.prop('deleteRoute')(crawlRule)).toEqual( - '/api/app_search/engines/my-engine/crawler/domains/6113e1407a2f2e6f42489794/crawl_rules/1' + '/internal/app_search/engines/my-engine/crawler/domains/6113e1407a2f2e6f42489794/crawl_rules/1' ); expect(table.prop('updateRoute')(crawlRule)).toEqual( - '/api/app_search/engines/my-engine/crawler/domains/6113e1407a2f2e6f42489794/crawl_rules/1' + '/internal/app_search/engines/my-engine/crawler/domains/6113e1407a2f2e6f42489794/crawl_rules/1' ); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_rules_table.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_rules_table.tsx index 9af8cb66fdc4f..d8d5d9d10b3b7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_rules_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_rules_table.tsx @@ -149,10 +149,10 @@ export const CrawlRulesTable: React.FC = ({ }, ]; - const crawlRulesRoute = `/api/app_search/engines/${engineName}/crawler/domains/${domainId}/crawl_rules`; - const domainRoute = `/api/app_search/engines/${engineName}/crawler/domains/${domainId}`; + const crawlRulesRoute = `/internal/app_search/engines/${engineName}/crawler/domains/${domainId}/crawl_rules`; + const domainRoute = `/internal/app_search/engines/${engineName}/crawler/domains/${domainId}`; const getCrawlRuleRoute = (crawlRule: CrawlRule) => - `/api/app_search/engines/${engineName}/crawler/domains/${domainId}/crawl_rules/${crawlRule.id}`; + `/internal/app_search/engines/${engineName}/crawler/domains/${domainId}/crawl_rules/${crawlRule.id}`; return ( { const { domain } = useValues(CrawlerSingleDomainLogic); @@ -61,7 +61,7 @@ export const DeleteDomainPanel: React.FC = ({}) => { color="danger" iconType="trash" onClick={() => { - if (confirm(getDeleteDomainSuccessMessage(domain.url))) { + if (confirm(getDeleteDomainConfirmationMessage(domain.url))) { deleteDomain(domain); } }} diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/entry_points_table.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/entry_points_table.test.tsx index 86b3eea25a004..c6a93a8197a76 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/entry_points_table.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/entry_points_table.test.tsx @@ -103,10 +103,10 @@ describe('EntryPointsTable', () => { const entryPoint = { id: '1', value: '/whatever' }; expect(table.prop('deleteRoute')(entryPoint)).toEqual( - '/api/app_search/engines/my-engine/crawler/domains/6113e1407a2f2e6f42489794/entry_points/1' + '/internal/app_search/engines/my-engine/crawler/domains/6113e1407a2f2e6f42489794/entry_points/1' ); expect(table.prop('updateRoute')(entryPoint)).toEqual( - '/api/app_search/engines/my-engine/crawler/domains/6113e1407a2f2e6f42489794/entry_points/1' + '/internal/app_search/engines/my-engine/crawler/domains/6113e1407a2f2e6f42489794/entry_points/1' ); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/entry_points_table.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/entry_points_table.tsx index 7657a23ce4789..d8e4790b842b4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/entry_points_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/entry_points_table.tsx @@ -62,10 +62,10 @@ export const EntryPointsTable: React.FC = ({ }, ]; - const entryPointsRoute = `/api/app_search/engines/${engineName}/crawler/domains/${domain.id}/entry_points`; + const entryPointsRoute = `/internal/app_search/engines/${engineName}/crawler/domains/${domain.id}/entry_points`; const getEntryPointRoute = (entryPoint: EntryPoint) => - `/api/app_search/engines/${engineName}/crawler/domains/${domain.id}/entry_points/${entryPoint.id}`; + `/internal/app_search/engines/${engineName}/crawler/domains/${domain.id}/entry_points/${entryPoint.id}`; return ( { const sitemap = { id: '1', url: '/whatever' }; expect(table.prop('deleteRoute')(sitemap)).toEqual( - '/api/app_search/engines/my-engine/crawler/domains/6113e1407a2f2e6f42489794/sitemaps/1' + '/internal/app_search/engines/my-engine/crawler/domains/6113e1407a2f2e6f42489794/sitemaps/1' ); expect(table.prop('updateRoute')(sitemap)).toEqual( - '/api/app_search/engines/my-engine/crawler/domains/6113e1407a2f2e6f42489794/sitemaps/1' + '/internal/app_search/engines/my-engine/crawler/domains/6113e1407a2f2e6f42489794/sitemaps/1' ); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/sitemaps_table.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/sitemaps_table.tsx index eaa1526299fcd..8637fda449eba 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/sitemaps_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/sitemaps_table.tsx @@ -54,9 +54,9 @@ export const SitemapsTable: React.FC = ({ domain, engineName }, ]; - const sitemapsRoute = `/api/app_search/engines/${engineName}/crawler/domains/${domain.id}/sitemaps`; + const sitemapsRoute = `/internal/app_search/engines/${engineName}/crawler/domains/${domain.id}/sitemaps`; const getSitemapRoute = (sitemap: Sitemap) => - `/api/app_search/engines/${engineName}/crawler/domains/${domain.id}/sitemaps/${sitemap.id}`; + `/internal/app_search/engines/${engineName}/crawler/domains/${domain.id}/sitemaps/${sitemap.id}`; return ( { availableDeduplicationFields: ['title', 'description'], }, ], + events: [ + { + id: '618d0e66abe97bc688328900', + status: CrawlerStatus.Pending, + stage: 'crawl', + createdAt: 'Mon, 31 Aug 2020 17:00:00 +0000', + beganAt: null, + completedAt: null, + }, + ], + mostRecentCrawlRequest: { + id: '618d0e66abe97bc688328900', + status: CrawlerStatus.Pending, + createdAt: 'Mon, 31 Aug 2020 17:00:00 +0000', + beganAt: null, + completedAt: null, + }, }; beforeEach(() => { @@ -127,32 +146,16 @@ describe('CrawlerLogic', () => { it('should set all received data as top-level values', () => { expect(CrawlerLogic.values.domains).toEqual(crawlerData.domains); + expect(CrawlerLogic.values.events).toEqual(crawlerData.events); + expect(CrawlerLogic.values.mostRecentCrawlRequest).toEqual( + crawlerData.mostRecentCrawlRequest + ); }); it('should set dataLoading to false', () => { expect(CrawlerLogic.values.dataLoading).toEqual(false); }); }); - - describe('onReceiveCrawlRequests', () => { - const crawlRequests: CrawlRequest[] = [ - { - id: '618d0e66abe97bc688328900', - status: CrawlerStatus.Pending, - createdAt: 'Mon, 31 Aug 2020 17:00:00 +0000', - beganAt: null, - completedAt: null, - }, - ]; - - beforeEach(() => { - CrawlerLogic.actions.onReceiveCrawlRequests(crawlRequests); - }); - - it('should set the crawl requests', () => { - expect(CrawlerLogic.values.crawlRequests).toEqual(crawlRequests); - }); - }); }); describe('listeners', () => { @@ -164,35 +167,105 @@ describe('CrawlerLogic', () => { CrawlerLogic.actions.fetchCrawlerData(); await nextTick(); - expect(http.get).toHaveBeenCalledWith('/api/app_search/engines/some-engine/crawler'); + expect(http.get).toHaveBeenCalledWith('/internal/app_search/engines/some-engine/crawler'); expect(CrawlerLogic.actions.onReceiveCrawlerData).toHaveBeenCalledWith( MOCK_CLIENT_CRAWLER_DATA ); }); + it('creates a new timeout when there is an active process crawl', async () => { + jest.spyOn(CrawlerLogic.actions, 'createNewTimeoutForCrawlerData'); + http.get.mockReturnValueOnce( + Promise.resolve({ + ...MOCK_SERVER_CRAWLER_DATA, + most_recent_crawl_request: null, + events: [ + { + id: '618d0e66abe97bc688328900', + status: CrawlerStatus.Running, + stage: 'process', + createdAt: 'Mon, 31 Aug 2020 17:00:00 +0000', + beganAt: null, + completedAt: null, + }, + ], + }) + ); + + CrawlerLogic.actions.fetchCrawlerData(); + await nextTick(); + + expect(CrawlerLogic.actions.createNewTimeoutForCrawlerData).toHaveBeenCalled(); + }); + + describe('on success', () => { + [ + CrawlerStatus.Pending, + CrawlerStatus.Starting, + CrawlerStatus.Running, + CrawlerStatus.Canceling, + ].forEach((status) => { + it(`creates a new timeout for status ${status}`, async () => { + jest.spyOn(CrawlerLogic.actions, 'createNewTimeoutForCrawlerData'); + http.get.mockReturnValueOnce( + Promise.resolve({ + ...MOCK_SERVER_CRAWLER_DATA, + most_recent_crawl_request: { status }, + }) + ); + + CrawlerLogic.actions.fetchCrawlerData(); + await nextTick(); + + expect(CrawlerLogic.actions.createNewTimeoutForCrawlerData).toHaveBeenCalled(); + }); + }); + + [CrawlerStatus.Success, CrawlerStatus.Failed, CrawlerStatus.Canceled].forEach((status) => { + it(`clears the timeout and fetches data for status ${status}`, async () => { + jest.spyOn(CrawlerLogic.actions, 'clearTimeoutId'); + jest.spyOn(CrawlerLogic.actions, 'fetchCrawlerData'); + http.get.mockReturnValueOnce( + Promise.resolve({ + ...MOCK_SERVER_CRAWLER_DATA, + most_recent_crawl_request: { status }, + }) + ); + + CrawlerLogic.actions.fetchCrawlerData(); + await nextTick(); + + expect(CrawlerLogic.actions.clearTimeoutId).toHaveBeenCalled(); + expect(CrawlerLogic.actions.fetchCrawlerData).toHaveBeenCalled(); + }); + }); + }); + it('calls flashApiErrors when there is an error on the request for crawler data', async () => { + jest.spyOn(CrawlerLogic.actions, 'createNewTimeoutForCrawlerData'); http.get.mockReturnValueOnce(Promise.reject('error')); CrawlerLogic.actions.fetchCrawlerData(); await nextTick(); expect(flashAPIErrors).toHaveBeenCalledWith('error'); + expect(CrawlerLogic.actions.createNewTimeoutForCrawlerData).toHaveBeenCalled(); }); }); describe('startCrawl', () => { describe('success path', () => { - it('creates a new crawl request and then fetches the latest crawl requests', async () => { - jest.spyOn(CrawlerLogic.actions, 'getLatestCrawlRequests'); + it('creates a new crawl request and then fetches the latest crawler data', async () => { + jest.spyOn(CrawlerLogic.actions, 'fetchCrawlerData'); http.post.mockReturnValueOnce(Promise.resolve()); CrawlerLogic.actions.startCrawl(); await nextTick(); expect(http.post).toHaveBeenCalledWith( - '/api/app_search/engines/some-engine/crawler/crawl_requests' + '/internal/app_search/engines/some-engine/crawler/crawl_requests' ); - expect(CrawlerLogic.actions.getLatestCrawlRequests).toHaveBeenCalled(); + expect(CrawlerLogic.actions.fetchCrawlerData).toHaveBeenCalled(); }); }); @@ -210,23 +283,23 @@ describe('CrawlerLogic', () => { describe('stopCrawl', () => { describe('success path', () => { - it('stops the crawl starts and then fetches the latest crawl requests', async () => { - jest.spyOn(CrawlerLogic.actions, 'getLatestCrawlRequests'); + it('stops the crawl starts and then fetches the latest crawler data', async () => { + jest.spyOn(CrawlerLogic.actions, 'fetchCrawlerData'); http.post.mockReturnValueOnce(Promise.resolve()); CrawlerLogic.actions.stopCrawl(); await nextTick(); expect(http.post).toHaveBeenCalledWith( - '/api/app_search/engines/some-engine/crawler/crawl_requests/cancel' + '/internal/app_search/engines/some-engine/crawler/crawl_requests/cancel' ); - expect(CrawlerLogic.actions.getLatestCrawlRequests).toHaveBeenCalled(); + expect(CrawlerLogic.actions.fetchCrawlerData).toHaveBeenCalled(); }); }); describe('on failure', () => { it('flashes an error message', async () => { - jest.spyOn(CrawlerLogic.actions, 'getLatestCrawlRequests'); + jest.spyOn(CrawlerLogic.actions, 'fetchCrawlerData'); http.post.mockReturnValueOnce(Promise.reject('error')); CrawlerLogic.actions.stopCrawl(); @@ -237,19 +310,19 @@ describe('CrawlerLogic', () => { }); }); - describe('createNewTimeoutForCrawlRequests', () => { + describe('createNewTimeoutForCrawlerData', () => { it('saves the timeout ID in the logic', () => { jest.spyOn(CrawlerLogic.actions, 'onCreateNewTimeout'); - jest.spyOn(CrawlerLogic.actions, 'getLatestCrawlRequests'); + jest.spyOn(CrawlerLogic.actions, 'fetchCrawlerData'); - CrawlerLogic.actions.createNewTimeoutForCrawlRequests(2000); + CrawlerLogic.actions.createNewTimeoutForCrawlerData(2000); expect(setTimeout).toHaveBeenCalledWith(expect.any(Function), 2000); expect(CrawlerLogic.actions.onCreateNewTimeout).toHaveBeenCalled(); jest.runAllTimers(); - expect(CrawlerLogic.actions.getLatestCrawlRequests).toHaveBeenCalled(); + expect(CrawlerLogic.actions.fetchCrawlerData).toHaveBeenCalled(); }); it('clears a timeout if one already exists', () => { @@ -258,130 +331,32 @@ describe('CrawlerLogic', () => { timeoutId, }); - CrawlerLogic.actions.createNewTimeoutForCrawlRequests(2000); + CrawlerLogic.actions.createNewTimeoutForCrawlerData(2000); expect(clearTimeout).toHaveBeenCalledWith(timeoutId); }); }); - - describe('getLatestCrawlRequests', () => { - describe('on success', () => { - [ - CrawlerStatus.Pending, - CrawlerStatus.Starting, - CrawlerStatus.Running, - CrawlerStatus.Canceling, - ].forEach((status) => { - it(`creates a new timeout for status ${status}`, async () => { - jest.spyOn(CrawlerLogic.actions, 'createNewTimeoutForCrawlRequests'); - http.get.mockReturnValueOnce(Promise.resolve([{ status }])); - - CrawlerLogic.actions.getLatestCrawlRequests(); - await nextTick(); - - expect(CrawlerLogic.actions.createNewTimeoutForCrawlRequests).toHaveBeenCalled(); - }); - }); - - [CrawlerStatus.Success, CrawlerStatus.Failed, CrawlerStatus.Canceled].forEach((status) => { - it(`clears the timeout and fetches data for status ${status}`, async () => { - jest.spyOn(CrawlerLogic.actions, 'clearTimeoutId'); - jest.spyOn(CrawlerLogic.actions, 'fetchCrawlerData'); - http.get.mockReturnValueOnce(Promise.resolve([{ status }])); - - CrawlerLogic.actions.getLatestCrawlRequests(); - await nextTick(); - - expect(CrawlerLogic.actions.clearTimeoutId).toHaveBeenCalled(); - expect(CrawlerLogic.actions.fetchCrawlerData).toHaveBeenCalled(); - }); - - it(`optionally supresses fetching data for status ${status}`, async () => { - jest.spyOn(CrawlerLogic.actions, 'clearTimeoutId'); - jest.spyOn(CrawlerLogic.actions, 'fetchCrawlerData'); - http.get.mockReturnValueOnce(Promise.resolve([{ status }])); - - CrawlerLogic.actions.getLatestCrawlRequests(false); - await nextTick(); - - expect(CrawlerLogic.actions.clearTimeoutId).toHaveBeenCalled(); - expect(CrawlerLogic.actions.fetchCrawlerData).toHaveBeenCalledTimes(0); - }); - }); - }); - - describe('on failure', () => { - it('creates a new timeout', async () => { - jest.spyOn(CrawlerLogic.actions, 'createNewTimeoutForCrawlRequests'); - http.get.mockReturnValueOnce(Promise.reject()); - - CrawlerLogic.actions.getLatestCrawlRequests(); - await nextTick(); - - expect(CrawlerLogic.actions.createNewTimeoutForCrawlRequests).toHaveBeenCalled(); - }); - }); - }); }); describe('selectors', () => { describe('mostRecentCrawlRequestStatus', () => { - it('is Success when there are no crawl requests', () => { + it('is Success when there is no recent crawl request', () => { mount({ - crawlRequests: [], + mostRecentCrawlRequest: null, }); expect(CrawlerLogic.values.mostRecentCrawlRequestStatus).toEqual(CrawlerStatus.Success); }); - it('is Success when there are only crawl requests', () => { + it('is the most recent crawl request status', () => { mount({ - crawlRequests: [ - { - id: '2', - status: CrawlerStatus.Skipped, - createdAt: 'Mon, 31 Aug 2020 17:00:00 +0000', - beganAt: null, - completedAt: null, - }, - { - id: '1', - status: CrawlerStatus.Skipped, - createdAt: 'Mon, 30 Aug 2020 17:00:00 +0000', - beganAt: null, - completedAt: null, - }, - ], - }); - - expect(CrawlerLogic.values.mostRecentCrawlRequestStatus).toEqual(CrawlerStatus.Success); - }); - - it('is the first non-skipped crawl request status', () => { - mount({ - crawlRequests: [ - { - id: '3', - status: CrawlerStatus.Skipped, - createdAt: 'Mon, 31 Aug 2020 17:00:00 +0000', - beganAt: null, - completedAt: null, - }, - { - id: '2', - status: CrawlerStatus.Failed, - createdAt: 'Mon, 30 Aug 2020 17:00:00 +0000', - beganAt: null, - completedAt: null, - }, - { - id: '1', - status: CrawlerStatus.Success, - createdAt: 'Mon, 29 Aug 2020 17:00:00 +0000', - beganAt: null, - completedAt: null, - }, - ], + mostRecentCrawlRequest: { + id: '2', + status: CrawlerStatus.Failed, + createdAt: 'Mon, 30 Aug 2020 17:00:00 +0000', + beganAt: null, + completedAt: null, + }, }); expect(CrawlerLogic.values.mostRecentCrawlRequestStatus).toEqual(CrawlerStatus.Failed); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_logic.ts index b9782d84a74cc..5b9960ddf54e0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_logic.ts @@ -12,48 +12,45 @@ import { flashAPIErrors } from '../../../shared/flash_messages'; import { HttpLogic } from '../../../shared/http'; import { EngineLogic } from '../engine'; -import { - CrawlerData, - CrawlerDomain, - CrawlRequest, - CrawlRequestFromServer, - CrawlerStatus, -} from './types'; -import { crawlerDataServerToClient, crawlRequestServerToClient } from './utils'; +import { CrawlerData, CrawlerDomain, CrawlEvent, CrawlRequest, CrawlerStatus } from './types'; +import { crawlerDataServerToClient } from './utils'; const POLLING_DURATION = 1000; const POLLING_DURATION_ON_FAILURE = 5000; +const ACTIVE_STATUSES = [ + CrawlerStatus.Pending, + CrawlerStatus.Starting, + CrawlerStatus.Running, + CrawlerStatus.Canceling, +]; export interface CrawlerValues { - crawlRequests: CrawlRequest[]; + events: CrawlEvent[]; dataLoading: boolean; domains: CrawlerDomain[]; - mostRecentCrawlRequestStatus: CrawlerStatus; + mostRecentCrawlRequest: CrawlRequest | null; + mostRecentCrawlRequestStatus: CrawlerStatus | null; timeoutId: NodeJS.Timeout | null; } interface CrawlerActions { clearTimeoutId(): void; - createNewTimeoutForCrawlRequests(duration: number): { duration: number }; + createNewTimeoutForCrawlerData(duration: number): { duration: number }; fetchCrawlerData(): void; - getLatestCrawlRequests(refreshData?: boolean): { refreshData?: boolean }; onCreateNewTimeout(timeoutId: NodeJS.Timeout): { timeoutId: NodeJS.Timeout }; onReceiveCrawlerData(data: CrawlerData): { data: CrawlerData }; - onReceiveCrawlRequests(crawlRequests: CrawlRequest[]): { crawlRequests: CrawlRequest[] }; startCrawl(): void; stopCrawl(): void; } export const CrawlerLogic = kea>({ - path: ['enterprise_search', 'app_search', 'crawler', 'crawler_overview'], + path: ['enterprise_search', 'app_search', 'crawler_logic'], actions: { clearTimeoutId: true, - createNewTimeoutForCrawlRequests: (duration) => ({ duration }), + createNewTimeoutForCrawlerData: (duration) => ({ duration }), fetchCrawlerData: true, - getLatestCrawlRequests: (refreshData) => ({ refreshData }), onCreateNewTimeout: (timeoutId) => ({ timeoutId }), onReceiveCrawlerData: (data) => ({ data }), - onReceiveCrawlRequests: (crawlRequests) => ({ crawlRequests }), startCrawl: () => null, stopCrawl: () => null, }, @@ -70,10 +67,16 @@ export const CrawlerLogic = kea>({ onReceiveCrawlerData: (_, { data: { domains } }) => domains, }, ], - crawlRequests: [ + events: [ [], { - onReceiveCrawlRequests: (_, { crawlRequests }) => crawlRequests, + onReceiveCrawlerData: (_, { data: { events } }) => events, + }, + ], + mostRecentCrawlRequest: [ + null, + { + onReceiveCrawlerData: (_, { data: { mostRecentCrawlRequest } }) => mostRecentCrawlRequest, }, ], timeoutId: [ @@ -86,15 +89,12 @@ export const CrawlerLogic = kea>({ }, selectors: ({ selectors }) => ({ mostRecentCrawlRequestStatus: [ - () => [selectors.crawlRequests], - (crawlRequests: CrawlerValues['crawlRequests']) => { - const eligibleCrawlRequests = crawlRequests.filter( - (req) => req.status !== CrawlerStatus.Skipped - ); - if (eligibleCrawlRequests.length === 0) { - return CrawlerStatus.Success; + () => [selectors.mostRecentCrawlRequest], + (crawlRequest: CrawlerValues['mostRecentCrawlRequest']) => { + if (crawlRequest) { + return crawlRequest.status; } - return eligibleCrawlRequests[0].status; + return CrawlerStatus.Success; }, ], }), @@ -104,13 +104,24 @@ export const CrawlerLogic = kea>({ const { engineName } = EngineLogic.values; try { - const response = await http.get(`/api/app_search/engines/${engineName}/crawler`); + const response = await http.get(`/internal/app_search/engines/${engineName}/crawler`); const crawlerData = crawlerDataServerToClient(response); - actions.onReceiveCrawlerData(crawlerData); + + const continuePoll = + (crawlerData.mostRecentCrawlRequest && + ACTIVE_STATUSES.includes(crawlerData.mostRecentCrawlRequest.status)) || + crawlerData.events.find((event) => ACTIVE_STATUSES.includes(event.status)); + + if (continuePoll) { + actions.createNewTimeoutForCrawlerData(POLLING_DURATION); + } else { + actions.clearTimeoutId(); + } } catch (e) { flashAPIErrors(e); + actions.createNewTimeoutForCrawlerData(POLLING_DURATION_ON_FAILURE); } }, startCrawl: async () => { @@ -118,8 +129,8 @@ export const CrawlerLogic = kea>({ const { engineName } = EngineLogic.values; try { - await http.post(`/api/app_search/engines/${engineName}/crawler/crawl_requests`); - actions.getLatestCrawlRequests(); + await http.post(`/internal/app_search/engines/${engineName}/crawler/crawl_requests`); + actions.fetchCrawlerData(); } catch (e) { flashAPIErrors(e); } @@ -129,56 +140,23 @@ export const CrawlerLogic = kea>({ const { engineName } = EngineLogic.values; try { - await http.post(`/api/app_search/engines/${engineName}/crawler/crawl_requests/cancel`); - actions.getLatestCrawlRequests(); + await http.post(`/internal/app_search/engines/${engineName}/crawler/crawl_requests/cancel`); + actions.fetchCrawlerData(); } catch (e) { flashAPIErrors(e); } }, - createNewTimeoutForCrawlRequests: ({ duration }) => { + createNewTimeoutForCrawlerData: ({ duration }) => { if (values.timeoutId) { clearTimeout(values.timeoutId); } const timeoutIdId = setTimeout(() => { - actions.getLatestCrawlRequests(); + actions.fetchCrawlerData(); }, duration); actions.onCreateNewTimeout(timeoutIdId); }, - getLatestCrawlRequests: async ({ refreshData = true }) => { - const { http } = HttpLogic.values; - const { engineName } = EngineLogic.values; - - try { - const crawlRequestsFromServer: CrawlRequestFromServer[] = await http.get( - `/api/app_search/engines/${engineName}/crawler/crawl_requests` - ); - const crawlRequests = crawlRequestsFromServer.map(crawlRequestServerToClient); - actions.onReceiveCrawlRequests(crawlRequests); - if ( - [ - CrawlerStatus.Pending, - CrawlerStatus.Starting, - CrawlerStatus.Running, - CrawlerStatus.Canceling, - ].includes(crawlRequests[0]?.status) - ) { - actions.createNewTimeoutForCrawlRequests(POLLING_DURATION); - } else if ( - [CrawlerStatus.Success, CrawlerStatus.Failed, CrawlerStatus.Canceled].includes( - crawlRequests[0]?.status - ) - ) { - actions.clearTimeoutId(); - if (refreshData) { - actions.fetchCrawlerData(); - } - } - } catch (e) { - actions.createNewTimeoutForCrawlRequests(POLLING_DURATION_ON_FAILURE); - } - }, }), events: ({ values }) => ({ beforeUnmount: () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.test.tsx index 705dfc44baa88..67f8826dace8a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.test.tsx @@ -28,7 +28,7 @@ import { CrawlerPolicies, CrawlerRules, CrawlerStatus, - CrawlRequestFromServer, + CrawlEventFromServer, } from './types'; const domains: CrawlerDomainFromServer[] = [ @@ -65,9 +65,10 @@ const domains: CrawlerDomainFromServer[] = [ }, ]; -const crawlRequests: CrawlRequestFromServer[] = [ +const events: CrawlEventFromServer[] = [ { id: 'a', + stage: 'crawl', status: CrawlerStatus.Canceled, created_at: 'Mon, 31 Aug 2020 11:00:00 +0000', began_at: 'Mon, 31 Aug 2020 12:00:00 +0000', @@ -75,6 +76,7 @@ const crawlRequests: CrawlRequestFromServer[] = [ }, { id: 'b', + stage: 'crawl', status: CrawlerStatus.Success, created_at: 'Mon, 31 Aug 2020 14:00:00 +0000', began_at: 'Mon, 31 Aug 2020 15:00:00 +0000', @@ -86,7 +88,8 @@ describe('CrawlerOverview', () => { const mockValues = { dataLoading: false, domains, - crawlRequests, + events, + mostRecentCrawlRequest: null, }; beforeEach(() => { @@ -118,7 +121,7 @@ describe('CrawlerOverview', () => { }); it('hides the domain and crawl request tables when there are no domains, and no crawl requests', () => { - setMockValues({ ...mockValues, domains: [], crawlRequests: [] }); + setMockValues({ ...mockValues, domains: [], events: [] }); const wrapper = shallow(); @@ -130,7 +133,7 @@ describe('CrawlerOverview', () => { }); it('shows the domain and the crawl request tables when there are domains, but no crawl requests', () => { - setMockValues({ ...mockValues, crawlRequests: [] }); + setMockValues({ ...mockValues, events: [] }); const wrapper = shallow(); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.tsx index 78e093f4199da..b6fa50e06c904 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.tsx @@ -29,7 +29,7 @@ import { CRAWLER_TITLE } from './constants'; import { CrawlerLogic } from './crawler_logic'; export const CrawlerOverview: React.FC = () => { - const { crawlRequests, dataLoading, domains } = useValues(CrawlerLogic); + const { events, dataLoading, domains } = useValues(CrawlerLogic); return ( {

+ @@ -95,7 +96,7 @@ export const CrawlerOverview: React.FC = () => { )} - {(crawlRequests.length > 0 || domains.length > 0) && ( + {(events.length > 0 || domains.length > 0) && ( <> diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview_logic.test.ts index d5026ad117073..a701c43d4775c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview_logic.test.ts @@ -43,6 +43,8 @@ const MOCK_SERVER_CRAWLER_DATA: CrawlerDataFromServer = { available_deduplication_fields: ['title', 'description'], }, ], + events: [], + most_recent_crawl_request: null, }; const MOCK_CLIENT_CRAWLER_DATA = crawlerDataServerToClient(MOCK_SERVER_CRAWLER_DATA); @@ -67,7 +69,7 @@ describe('CrawlerOverviewLogic', () => { await nextTick(); expect(http.delete).toHaveBeenCalledWith( - '/api/app_search/engines/some-engine/crawler/domains/1234', + '/internal/app_search/engines/some-engine/crawler/domains/1234', { query: { respond_with: 'crawler_details' }, } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview_logic.ts index 79e3326347d68..c6a26e50a6758 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview_logic.ts @@ -25,14 +25,14 @@ export const CrawlerOverviewLogic = kea ({ domain }), }, - listeners: ({ actions, values }) => ({ + listeners: () => ({ deleteDomain: async ({ domain }) => { const { http } = HttpLogic.values; const { engineName } = EngineLogic.values; try { const response = await http.delete( - `/api/app_search/engines/${engineName}/crawler/domains/${domain.id}`, + `/internal/app_search/engines/${engineName}/crawler/domains/${domain.id}`, { query: { respond_with: 'crawler_details', diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_router.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_router.test.tsx index 8c49e97d6462b..da2b3cf2261b7 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_router.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_router.test.tsx @@ -19,7 +19,6 @@ import { CrawlerSingleDomain } from './crawler_single_domain'; describe('CrawlerRouter', () => { const mockActions = { fetchCrawlerData: jest.fn(), - getLatestCrawlRequests: jest.fn(), }; let wrapper: ShallowWrapper; @@ -32,7 +31,6 @@ describe('CrawlerRouter', () => { it('calls fetchCrawlerData and starts polling on page load', () => { expect(mockActions.fetchCrawlerData).toHaveBeenCalledTimes(1); - expect(mockActions.getLatestCrawlRequests).toHaveBeenCalledWith(false); }); it('renders a crawler views', () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_router.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_router.tsx index f95423cd2c704..2cebb28d962f0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_router.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_router.tsx @@ -18,11 +18,10 @@ import { CrawlerOverview } from './crawler_overview'; import { CrawlerSingleDomain } from './crawler_single_domain'; export const CrawlerRouter: React.FC = () => { - const { fetchCrawlerData, getLatestCrawlRequests } = useActions(CrawlerLogic); + const { fetchCrawlerData } = useActions(CrawlerLogic); useEffect(() => { fetchCrawlerData(); - getLatestCrawlRequests(false); }, []); return ( diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_single_domain.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_single_domain.test.tsx index 76612ee913c48..beb1e65af47a4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_single_domain.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_single_domain.test.tsx @@ -36,7 +36,6 @@ const MOCK_VALUES = { const MOCK_ACTIONS = { fetchCrawlerData: jest.fn(), fetchDomainData: jest.fn(), - getLatestCrawlRequests: jest.fn(), }; describe('CrawlerSingleDomain', () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_single_domain_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_single_domain_logic.test.ts index bf0add6df5cfe..03e20ea988f98 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_single_domain_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_single_domain_logic.test.ts @@ -13,8 +13,17 @@ import { } from '../../../__mocks__/kea_logic'; import '../../__mocks__/engine_logic.mock'; +jest.mock('./crawler_logic', () => ({ + CrawlerLogic: { + actions: { + fetchCrawlerData: jest.fn(), + }, + }, +})); + import { nextTick } from '@kbn/test/jest'; +import { CrawlerLogic } from './crawler_logic'; import { CrawlerSingleDomainLogic, CrawlerSingleDomainValues } from './crawler_single_domain_logic'; import { CrawlerDomain, CrawlerPolicies, CrawlerRules } from './types'; @@ -150,6 +159,7 @@ describe('CrawlerSingleDomainLogic', () => { describe('listeners', () => { describe('deleteDomain', () => { it('flashes a success toast and redirects the user to the crawler overview on success', async () => { + jest.spyOn(CrawlerLogic.actions, 'fetchCrawlerData'); const { navigateToUrl } = mockKibanaValues; http.delete.mockReturnValue(Promise.resolve()); @@ -158,9 +168,10 @@ describe('CrawlerSingleDomainLogic', () => { await nextTick(); expect(http.delete).toHaveBeenCalledWith( - '/api/app_search/engines/some-engine/crawler/domains/1234' + '/internal/app_search/engines/some-engine/crawler/domains/1234' ); + expect(CrawlerLogic.actions.fetchCrawlerData).toHaveBeenCalled(); expect(flashSuccessToast).toHaveBeenCalled(); expect(navigateToUrl).toHaveBeenCalledWith('/engines/some-engine/crawler'); }); @@ -194,7 +205,7 @@ describe('CrawlerSingleDomainLogic', () => { await nextTick(); expect(http.get).toHaveBeenCalledWith( - '/api/app_search/engines/some-engine/crawler/domains/507f1f77bcf86cd799439011' + '/internal/app_search/engines/some-engine/crawler/domains/507f1f77bcf86cd799439011' ); expect(CrawlerSingleDomainLogic.actions.onReceiveDomainData).toHaveBeenCalledWith({ id: '507f1f77bcf86cd799439011', @@ -242,7 +253,7 @@ describe('CrawlerSingleDomainLogic', () => { await nextTick(); expect(http.put).toHaveBeenCalledWith( - '/api/app_search/engines/some-engine/crawler/domains/507f1f77bcf86cd799439011', + '/internal/app_search/engines/some-engine/crawler/domains/507f1f77bcf86cd799439011', { body: JSON.stringify({ deduplication_enabled: true, deduplication_fields: ['title'] }), } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_single_domain_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_single_domain_logic.ts index e9c74c864b1b2..9452ae1d578ed 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_single_domain_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_single_domain_logic.ts @@ -14,6 +14,8 @@ import { KibanaLogic } from '../../../shared/kibana'; import { ENGINE_CRAWLER_PATH } from '../../routes'; import { EngineLogic, generateEnginePath } from '../engine'; +import { CrawlerLogic } from './crawler_logic'; + import { CrawlerDomain, EntryPoint, Sitemap, CrawlRule } from './types'; import { crawlerDomainServerToClient, getDeleteDomainSuccessMessage } from './utils'; @@ -74,8 +76,11 @@ export const CrawlerSingleDomainLogic = kea< const { engineName } = EngineLogic.values; try { - await http.delete(`/api/app_search/engines/${engineName}/crawler/domains/${domain.id}`); + await http.delete( + `/internal/app_search/engines/${engineName}/crawler/domains/${domain.id}` + ); + CrawlerLogic.actions.fetchCrawlerData(); flashSuccessToast(getDeleteDomainSuccessMessage(domain.url)); KibanaLogic.values.navigateToUrl(generateEnginePath(ENGINE_CRAWLER_PATH)); } catch (e) { @@ -88,7 +93,7 @@ export const CrawlerSingleDomainLogic = kea< try { const response = await http.get( - `/api/app_search/engines/${engineName}/crawler/domains/${domainId}` + `/internal/app_search/engines/${engineName}/crawler/domains/${domainId}` ); const domainData = crawlerDomainServerToClient(response); @@ -109,7 +114,7 @@ export const CrawlerSingleDomainLogic = kea< try { const response = await http.put( - `/api/app_search/engines/${engineName}/crawler/domains/${domain.id}`, + `/internal/app_search/engines/${engineName}/crawler/domains/${domain.id}`, { body: JSON.stringify(payload), } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/types.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/types.ts index 8cfbce6c10315..a4d5a984faaec 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/types.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/types.ts @@ -120,10 +120,14 @@ export interface CrawlerDomainFromServer { export interface CrawlerData { domains: CrawlerDomain[]; + events: CrawlEvent[]; + mostRecentCrawlRequest: CrawlRequest | null; } export interface CrawlerDataFromServer { domains: CrawlerDomainFromServer[]; + events: CrawlEventFromServer[]; + most_recent_crawl_request: CrawlRequestFromServer | null; } export interface CrawlerDomainValidationResultFromServer { @@ -191,6 +195,26 @@ export interface CrawlRequest { completedAt: string | null; } +export type CrawlEventStage = 'crawl' | 'process'; + +export interface CrawlEventFromServer { + id: string; + stage: CrawlEventStage; + status: CrawlerStatus; + created_at: string; + began_at: string | null; + completed_at: string | null; +} + +export interface CrawlEvent { + id: string; + stage: CrawlEventStage; + status: CrawlerStatus; + createdAt: string; + beganAt: string | null; + completedAt: string | null; +} + export const readableCrawlerStatuses: { [key in CrawlerStatus]: string } = { [CrawlerStatus.Pending]: i18n.translate( 'xpack.enterpriseSearch.appSearch.crawler.crawlerStatusOptions.pending', diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/utils.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/utils.test.ts index b679a7cc9c12c..fc810ba8fd7cb 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/utils.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/utils.test.ts @@ -153,10 +153,27 @@ describe('crawlerDataServerToClient', () => { beforeAll(() => { output = crawlerDataServerToClient({ domains, + events: [ + { + id: '618d0e66abe97bc688328900', + status: CrawlerStatus.Pending, + stage: 'crawl', + created_at: 'Mon, 31 Aug 2020 17:00:00 +0000', + began_at: null, + completed_at: null, + }, + ], + most_recent_crawl_request: { + id: '618d0e66abe97bc688328900', + status: CrawlerStatus.Pending, + created_at: 'Mon, 31 Aug 2020 17:00:00 +0000', + began_at: null, + completed_at: null, + }, }); }); - it('converts all domains from the server form to their client form', () => { + it('converts all data from the server form to their client form', () => { expect(output.domains).toEqual([ { id: 'x', @@ -185,6 +202,23 @@ describe('crawlerDataServerToClient', () => { availableDeduplicationFields: ['title', 'description'], }, ]); + expect(output.events).toEqual([ + { + id: '618d0e66abe97bc688328900', + status: CrawlerStatus.Pending, + stage: 'crawl', + createdAt: 'Mon, 31 Aug 2020 17:00:00 +0000', + beganAt: null, + completedAt: null, + }, + ]); + expect(output.mostRecentCrawlRequest).toEqual({ + id: '618d0e66abe97bc688328900', + status: CrawlerStatus.Pending, + createdAt: 'Mon, 31 Aug 2020 17:00:00 +0000', + beganAt: null, + completedAt: null, + }); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/utils.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/utils.ts index e44e6c0e652fa..9c94040355d47 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/utils.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/utils.ts @@ -16,6 +16,8 @@ import { CrawlerDomainValidationStep, CrawlRequestFromServer, CrawlRequest, + CrawlEventFromServer, + CrawlEvent, } from './types'; export function crawlerDomainServerToClient(payload: CrawlerDomainFromServer): CrawlerDomain { @@ -76,11 +78,34 @@ export function crawlRequestServerToClient(crawlRequest: CrawlRequestFromServer) }; } +export function crawlerEventServerToClient(event: CrawlEventFromServer): CrawlEvent { + const { + id, + stage, + status, + created_at: createdAt, + began_at: beganAt, + completed_at: completedAt, + } = event; + + return { + id, + stage, + status, + createdAt, + beganAt, + completedAt, + }; +} + export function crawlerDataServerToClient(payload: CrawlerDataFromServer): CrawlerData { - const { domains } = payload; + const { domains, events, most_recent_crawl_request: mostRecentCrawlRequest } = payload; return { domains: domains.map((domain) => crawlerDomainServerToClient(domain)), + events: events.map((event) => crawlerEventServerToClient(event)), + mostRecentCrawlRequest: + mostRecentCrawlRequest && crawlRequestServerToClient(mostRecentCrawlRequest), }; } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_logic.test.ts index a12c174b9478c..3afa531239dc1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_logic.test.ts @@ -1049,7 +1049,7 @@ describe('CredentialsLogic', () => { http.get.mockReturnValue(Promise.resolve({ meta, results })); CredentialsLogic.actions.fetchCredentials(); - expect(http.get).toHaveBeenCalledWith('/api/app_search/credentials', { + expect(http.get).toHaveBeenCalledWith('/internal/app_search/credentials', { query: { 'page[current]': 1, 'page[size]': 10, @@ -1079,7 +1079,7 @@ describe('CredentialsLogic', () => { http.get.mockReturnValue(Promise.resolve(credentialsDetails)); CredentialsLogic.actions.fetchDetails(); - expect(http.get).toHaveBeenCalledWith('/api/app_search/credentials/details'); + expect(http.get).toHaveBeenCalledWith('/internal/app_search/credentials/details'); await nextTick(); expect(CredentialsLogic.actions.setCredentialsDetails).toHaveBeenCalledWith( credentialsDetails @@ -1106,7 +1106,7 @@ describe('CredentialsLogic', () => { http.delete.mockReturnValue(Promise.resolve()); CredentialsLogic.actions.deleteApiKey(tokenName); - expect(http.delete).toHaveBeenCalledWith(`/api/app_search/credentials/${tokenName}`); + expect(http.delete).toHaveBeenCalledWith(`/internal/app_search/credentials/${tokenName}`); await nextTick(); expect(CredentialsLogic.actions.fetchCredentials).toHaveBeenCalled(); @@ -1137,7 +1137,7 @@ describe('CredentialsLogic', () => { http.post.mockReturnValue(Promise.resolve(createdToken)); CredentialsLogic.actions.onApiTokenChange(); - expect(http.post).toHaveBeenCalledWith('/api/app_search/credentials', { + expect(http.post).toHaveBeenCalledWith('/internal/app_search/credentials', { body: JSON.stringify(createdToken), }); await nextTick(); @@ -1164,7 +1164,7 @@ describe('CredentialsLogic', () => { http.put.mockReturnValue(Promise.resolve(updatedToken)); CredentialsLogic.actions.onApiTokenChange(); - expect(http.put).toHaveBeenCalledWith('/api/app_search/credentials/test-key', { + expect(http.put).toHaveBeenCalledWith('/internal/app_search/credentials/test-key', { body: JSON.stringify(updatedToken), }); await nextTick(); @@ -1196,7 +1196,7 @@ describe('CredentialsLogic', () => { mount({ activeApiToken: { ...correctAdminToken, ...extraData } }); CredentialsLogic.actions.onApiTokenChange(); - expect(http.post).toHaveBeenCalledWith('/api/app_search/credentials', { + expect(http.post).toHaveBeenCalledWith('/internal/app_search/credentials', { body: JSON.stringify(correctAdminToken), }); }); @@ -1215,7 +1215,7 @@ describe('CredentialsLogic', () => { mount({ activeApiToken: { ...correctSearchToken, ...extraData } }); CredentialsLogic.actions.onApiTokenChange(); - expect(http.post).toHaveBeenCalledWith('/api/app_search/credentials', { + expect(http.post).toHaveBeenCalledWith('/internal/app_search/credentials', { body: JSON.stringify(correctSearchToken), }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_logic.ts index 60282bc0a3316..52e1b1825b180 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_logic.ts @@ -239,7 +239,7 @@ export const CredentialsLogic = kea({ 'page[current]': meta.page.current, 'page[size]': meta.page.size, }; - const response = await http.get('/api/app_search/credentials', { query }); + const response = await http.get('/internal/app_search/credentials', { query }); actions.setCredentialsData(response.meta, response.results); } catch (e) { flashAPIErrors(e); @@ -248,7 +248,7 @@ export const CredentialsLogic = kea({ fetchDetails: async () => { try { const { http } = HttpLogic.values; - const response = await http.get('/api/app_search/credentials/details'); + const response = await http.get('/internal/app_search/credentials/details'); actions.setCredentialsDetails(response); } catch (e) { @@ -258,7 +258,7 @@ export const CredentialsLogic = kea({ deleteApiKey: async (tokenName) => { try { const { http } = HttpLogic.values; - await http.delete(`/api/app_search/credentials/${tokenName}`); + await http.delete(`/internal/app_search/credentials/${tokenName}`); actions.fetchCredentials(); flashSuccessToast(DELETE_MESSAGE(tokenName)); @@ -287,11 +287,11 @@ export const CredentialsLogic = kea({ const body = JSON.stringify(data); if (id) { - const response = await http.put(`/api/app_search/credentials/${name}`, { body }); + const response = await http.put(`/internal/app_search/credentials/${name}`, { body }); actions.onApiTokenUpdateSuccess(response); flashSuccessToast(UPDATE_MESSAGE(name)); } else { - const response = await http.post('/api/app_search/credentials', { body }); + const response = await http.post('/internal/app_search/credentials', { body }); actions.onApiTokenCreateSuccess(response); flashSuccessToast(CREATE_MESSAGE(name)); } 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 c733294af2910..8fa57e52a26a1 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 @@ -287,7 +287,7 @@ describe('CurationLogic', () => { await nextTick(); expect(http.get).toHaveBeenCalledWith( - '/api/app_search/engines/some-engine/curations/cur-123456789', + '/internal/app_search/engines/some-engine/curations/cur-123456789', { query: { skip_record_analytics: 'true' }, } @@ -329,7 +329,7 @@ describe('CurationLogic', () => { await nextTick(); expect(http.put).toHaveBeenCalledWith( - '/api/app_search/engines/some-engine/curations/cur-123456789', + '/internal/app_search/engines/some-engine/curations/cur-123456789', { body: '{"queries":["a","b","c"],"query":"b","promoted":["d","e","f"],"hidden":["g"]}', // Uses state currently in CurationLogic } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/curation_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/curation_logic.ts index 12ff380ccb389..c49fc76d06874 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/curation_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/curation_logic.ts @@ -169,7 +169,7 @@ export const CurationLogic = kea { CurationsLogic.actions.loadCurations(); await nextTick(); - expect(http.get).toHaveBeenCalledWith('/api/app_search/engines/some-engine/curations', { - query: { - 'page[current]': 1, - 'page[size]': 10, - }, - }); + expect(http.get).toHaveBeenCalledWith( + '/internal/app_search/engines/some-engine/curations', + { + query: { + 'page[current]': 1, + 'page[size]': 10, + }, + } + ); expect(CurationsLogic.actions.onCurationsLoad).toHaveBeenCalledWith( MOCK_CURATIONS_RESPONSE ); @@ -151,7 +154,7 @@ describe('CurationsLogic', () => { await nextTick(); expect(http.delete).toHaveBeenCalledWith( - '/api/app_search/engines/some-engine/curations/some-curation-id' + '/internal/app_search/engines/some-engine/curations/some-curation-id' ); expect(CurationsLogic.actions.loadCurations).toHaveBeenCalled(); expect(flashSuccessToast).toHaveBeenCalledWith('Your curation was deleted'); @@ -189,9 +192,12 @@ describe('CurationsLogic', () => { expect(clearFlashMessages).toHaveBeenCalled(); await nextTick(); - expect(http.post).toHaveBeenCalledWith('/api/app_search/engines/some-engine/curations', { - body: '{"queries":["some query"]}', - }); + expect(http.post).toHaveBeenCalledWith( + '/internal/app_search/engines/some-engine/curations', + { + body: '{"queries":["some query"]}', + } + ); expect(navigateToUrl).toHaveBeenCalledWith('/engines/some-engine/curations/some-cur-id'); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curations_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curations_logic.ts index 89d170a83a4c8..a98f83396b3b8 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curations_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curations_logic.ts @@ -75,7 +75,7 @@ export const CurationsLogic = kea = ({ disabled = false }) = + + } + to={crawlerLink} + isDisabled={disabled} + /> + = ({ disabled = false }) = isDisabled={disabled} /> - - } - to={crawlerLink} - isDisabled={disabled} - /> - ); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.ts index a0ef73bbcea21..e92bc068824b0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.ts @@ -181,7 +181,7 @@ export const DocumentCreationLogic = kea< const promises = chunk(documents, CHUNK_SIZE).map((documentsChunk) => { const body = JSON.stringify({ documents: documentsChunk }); - return http.post(`/api/app_search/engines/${engineName}/documents`, { body }); + return http.post(`/internal/app_search/engines/${engineName}/documents`, { body }); }); try { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/document_detail_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/document_detail_logic.test.ts index 1608e4fb08aac..5705e5ae2ee98 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/document_detail_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/document_detail_logic.test.ts @@ -65,7 +65,7 @@ describe('DocumentDetailLogic', () => { DocumentDetailLogic.actions.getDocumentDetails('1'); - expect(http.get).toHaveBeenCalledWith('/api/app_search/engines/engine1/documents/1'); + expect(http.get).toHaveBeenCalledWith('/internal/app_search/engines/engine1/documents/1'); await nextTick(); expect(DocumentDetailLogic.actions.setFields).toHaveBeenCalledWith(fields); }); @@ -99,7 +99,9 @@ describe('DocumentDetailLogic', () => { mount(); DocumentDetailLogic.actions.deleteDocument('1'); - expect(http.delete).toHaveBeenCalledWith('/api/app_search/engines/engine1/documents/1'); + expect(http.delete).toHaveBeenCalledWith( + '/internal/app_search/engines/engine1/documents/1' + ); await nextTick(); expect(flashSuccessToast).toHaveBeenCalledWith('Your document was deleted'); expect(navigateToUrl).toHaveBeenCalledWith('/engines/engine1/documents'); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/document_detail_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/document_detail_logic.ts index 2bc9155c81c7b..25c16a7df2c50 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/document_detail_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/document_detail_logic.ts @@ -60,7 +60,7 @@ export const DocumentDetailLogic = kea({ try { const { http } = HttpLogic.values; const response = await http.get( - `/api/app_search/engines/${engineName}/documents/${documentId}` + `/internal/app_search/engines/${engineName}/documents/${documentId}` ); actions.setFields(response.fields); } catch (e) { @@ -87,7 +87,7 @@ export const DocumentDetailLogic = kea({ if (window.confirm(CONFIRM_DELETE)) { try { const { http } = HttpLogic.values; - await http.delete(`/api/app_search/engines/${engineName}/documents/${documentId}`); + await http.delete(`/internal/app_search/engines/${engineName}/documents/${documentId}`); flashSuccessToast(DELETE_SUCCESS); navigateToUrl(generateEnginePath(ENGINE_DOCUMENTS_PATH)); } catch (e) { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/search_experience/search_experience.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/search_experience/search_experience.tsx index 8416974ad7a2e..ed2a1ed54f06d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/search_experience/search_experience.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/search_experience/search_experience.tsx @@ -53,7 +53,7 @@ const DEFAULT_SORT_OPTIONS: SortOption[] = [ export const SearchExperience: React.FC = () => { const { engine } = useValues(EngineLogic); const { http } = useValues(HttpLogic); - const endpointBase = http.basePath.prepend('/api/app_search/search-ui'); + const endpointBase = http.basePath.prepend('/internal/app_search/search-ui'); const [showCustomizationModal, setShowCustomizationModal] = useState(false); const openCustomizationModal = () => setShowCustomizationModal(true); 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 0189edbbf871f..bd15f50fe78e3 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 @@ -210,7 +210,7 @@ describe('EngineLogic', () => { EngineLogic.actions.initializeEngine(); await nextTick(); - expect(http.get).toHaveBeenCalledWith('/api/app_search/engines/some-engine'); + expect(http.get).toHaveBeenCalledWith('/internal/app_search/engines/some-engine'); expect(EngineLogic.actions.setEngineData).toHaveBeenCalledWith(mockEngineData); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.ts index bfa77450176f6..c20cc763f3c90 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine/engine_logic.ts @@ -132,7 +132,7 @@ export const EngineLogic = kea>({ const { http } = HttpLogic.values; try { - const response = await http.get(`/api/app_search/engines/${engineName}`); + const response = await http.get(`/internal/app_search/engines/${engineName}`); actions.setEngineData(response); } catch (error) { if (error?.response?.status >= 400 && error?.response?.status < 500) { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_creation/engine_creation_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_creation/engine_creation_logic.test.ts index 2001ac3646e5f..7d7ddb77cab85 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_creation/engine_creation_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_creation/engine_creation_logic.test.ts @@ -117,13 +117,13 @@ describe('EngineCreationLogic', () => { jest.clearAllMocks(); }); - it('POSTS to /api/app_search/engines', () => { + it('POSTS to /internal/app_search/engines', () => { const body = JSON.stringify({ name: EngineCreationLogic.values.name, language: EngineCreationLogic.values.language, }); EngineCreationLogic.actions.submitEngine(); - expect(http.post).toHaveBeenCalledWith('/api/app_search/engines', { body }); + expect(http.post).toHaveBeenCalledWith('/internal/app_search/engines', { body }); }); it('calls onEngineCreationSuccess on valid submission', async () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_creation/engine_creation_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_creation/engine_creation_logic.ts index 4e41cdf4c3949..96be98053c56c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_creation/engine_creation_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_creation/engine_creation_logic.ts @@ -73,7 +73,7 @@ export const EngineCreationLogic = kea { EngineOverviewLogic.actions.loadOverviewMetrics(); await nextTick(); - expect(http.get).toHaveBeenCalledWith('/api/app_search/engines/some-engine/overview'); + expect(http.get).toHaveBeenCalledWith('/internal/app_search/engines/some-engine/overview'); expect(EngineOverviewLogic.actions.onOverviewMetricsLoad).toHaveBeenCalledWith( mockEngineMetrics ); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_logic.ts index 3f9c2e43a332b..73cfef8530521 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_logic.ts @@ -84,7 +84,7 @@ export const EngineOverviewLogic = kea { expect(mockRecursivelyFetchEngines).toHaveBeenCalledWith( expect.objectContaining({ - endpoint: '/api/app_search/engines/test-engine-1/source_engines', + endpoint: '/internal/app_search/engines/test-engine-1/source_engines', }) ); expect(MetaEnginesTableLogic.actions.addSourceEngines).toHaveBeenCalledWith({ diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/tables/meta_engines_table_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/tables/meta_engines_table_logic.ts index af4d0119a94af..94205a5392b63 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/tables/meta_engines_table_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/tables/meta_engines_table_logic.ts @@ -84,7 +84,7 @@ export const MetaEnginesTableLogic = kea< }, fetchSourceEngines: ({ engineName }) => { recursivelyFetchEngines({ - endpoint: `/api/app_search/engines/${engineName}/source_engines`, + endpoint: `/internal/app_search/engines/${engineName}/source_engines`, onComplete: (sourceEngines) => { actions.addSourceEngines({ [engineName]: sourceEngines }); actions.displayRow(engineName); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_logic.test.ts index d29c8a96f1c60..f3dc8a378a7d3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_logic.test.ts @@ -137,7 +137,7 @@ describe('EnginesLogic', () => { EnginesLogic.actions.deleteEngine(MOCK_ENGINE); await nextTick(); - expect(http.delete).toHaveBeenCalledWith('/api/app_search/engines/hello-world'); + expect(http.delete).toHaveBeenCalledWith('/internal/app_search/engines/hello-world'); expect(EnginesLogic.actions.onDeleteEngineSuccess).toHaveBeenCalledWith(MOCK_ENGINE); }); @@ -161,7 +161,7 @@ describe('EnginesLogic', () => { EnginesLogic.actions.loadEngines(); await nextTick(); - expect(http.get).toHaveBeenCalledWith('/api/app_search/engines', { + expect(http.get).toHaveBeenCalledWith('/internal/app_search/engines', { query: { type: 'indexed', 'page[current]': 1, @@ -191,7 +191,7 @@ describe('EnginesLogic', () => { EnginesLogic.actions.loadMetaEngines(); await nextTick(); - expect(http.get).toHaveBeenCalledWith('/api/app_search/engines', { + expect(http.get).toHaveBeenCalledWith('/internal/app_search/engines', { query: { type: 'meta', 'page[current]': 1, diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_logic.ts index f9b691147161f..507b83cc8b5cf 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/engines_logic.ts @@ -105,7 +105,7 @@ export const EnginesLogic = kea>({ let response; try { - response = await http.delete(`/api/app_search/engines/${engine.name}`); + response = await http.delete(`/internal/app_search/engines/${engine.name}`); } catch (e) { flashAPIErrors(e); } @@ -119,7 +119,7 @@ export const EnginesLogic = kea>({ const { enginesMeta } = values; try { - const response = await http.get('/api/app_search/engines', { + const response = await http.get('/internal/app_search/engines', { query: { type: 'indexed', 'page[current]': enginesMeta.page.current, @@ -136,7 +136,7 @@ export const EnginesLogic = kea>({ const { metaEnginesMeta } = values; try { - const response = await http.get('/api/app_search/engines', { + const response = await http.get('/internal/app_search/engines', { query: { type: 'meta', 'page[current]': metaEnginesMeta.page.current, 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 4e2382c23edbd..251fd93069afe 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 @@ -196,7 +196,7 @@ describe('LogRetentionLogic', () => { LogRetentionLogic.actions.saveLogRetention(LogRetentionOptions.Analytics, true); - expect(http.put).toHaveBeenCalledWith('/api/app_search/log_settings', { + expect(http.put).toHaveBeenCalledWith('/internal/app_search/log_settings', { body: JSON.stringify({ analytics: { enabled: true, @@ -320,7 +320,7 @@ describe('LogRetentionLogic', () => { jest.runAllTimers(); await nextTick(); - expect(http.get).toHaveBeenCalledWith('/api/app_search/log_settings'); + expect(http.get).toHaveBeenCalledWith('/internal/app_search/log_settings'); expect(LogRetentionLogic.actions.updateLogRetention).toHaveBeenCalledWith( TYPICAL_CLIENT_LOG_RETENTION ); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.ts index aa1be3f8cdc64..af2fdfed78651 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/log_retention_logic.ts @@ -74,7 +74,7 @@ export const LogRetentionLogic = kea { mount({ rawName: 'test', selectedIndexedEngineNames: ['foo'] }); }); - it('POSTS to /api/app_search/engines', () => { + it('POSTS to /internal/app_search/engines', () => { const body = JSON.stringify({ name: 'test', type: 'meta', source_engines: ['foo'], }); MetaEngineCreationLogic.actions.submitEngine(); - expect(http.post).toHaveBeenCalledWith('/api/app_search/engines', { body }); + expect(http.post).toHaveBeenCalledWith('/internal/app_search/engines', { body }); }); it('calls onEngineCreationSuccess on valid submission', async () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/meta_engine_creation/meta_engine_creation_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/meta_engine_creation/meta_engine_creation_logic.ts index 4df3bc4bff162..95ef53d82cc47 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/meta_engine_creation/meta_engine_creation_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/meta_engine_creation/meta_engine_creation_logic.ts @@ -92,7 +92,7 @@ export const MetaEngineCreationLogic = kea< let response: { results: EngineDetails[]; meta: Meta } | undefined; try { - response = await http.get('/api/app_search/engines', { + response = await http.get('/internal/app_search/engines', { query: { type: 'indexed', 'page[current]': page, 'page[size]': DEFAULT_META.page.size }, }); } catch (e) { @@ -127,7 +127,7 @@ export const MetaEngineCreationLogic = kea< }); try { - await http.post('/api/app_search/engines', { body }); + await http.post('/internal/app_search/engines', { body }); actions.onEngineCreationSuccess(); } catch (e) { flashAPIErrors(e); 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 e2493b6404f7d..7590633b7afef 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 @@ -300,7 +300,7 @@ describe('RelevanceTuningLogic', () => { await nextTick(); expect(http.get).toHaveBeenCalledWith( - '/api/app_search/engines/test-engine/search_settings/details' + '/internal/app_search/engines/test-engine/search_settings/details' ); expect(RelevanceTuningLogic.actions.onInitializeRelevanceTuning).toHaveBeenCalledWith({ ...relevanceTuningProps, @@ -388,7 +388,7 @@ describe('RelevanceTuningLogic', () => { await nextTick(); expect(RelevanceTuningLogic.actions.setResultsLoading).toHaveBeenCalledWith(true); - expect(http.post).toHaveBeenCalledWith('/api/app_search/engines/test-engine/search', { + expect(http.post).toHaveBeenCalledWith('/internal/app_search/engines/test-engine/search', { body: JSON.stringify(searchSettingsWithoutNewBoostProp), query: { query: 'foo', @@ -418,7 +418,7 @@ describe('RelevanceTuningLogic', () => { jest.runAllTimers(); await nextTick(); - expect(http.post).toHaveBeenCalledWith('/api/app_search/engines/test-engine/search', { + expect(http.post).toHaveBeenCalledWith('/internal/app_search/engines/test-engine/search', { body: '{}', query: { query: 'foo', @@ -528,7 +528,7 @@ describe('RelevanceTuningLogic', () => { await nextTick(); expect(http.put).toHaveBeenCalledWith( - '/api/app_search/engines/test-engine/search_settings', + '/internal/app_search/engines/test-engine/search_settings', { body: JSON.stringify(searchSettingsWithoutNewBoostProp), } @@ -587,7 +587,7 @@ describe('RelevanceTuningLogic', () => { await nextTick(); expect(http.post).toHaveBeenCalledWith( - '/api/app_search/engines/test-engine/search_settings/reset' + '/internal/app_search/engines/test-engine/search_settings/reset' ); expect(flashSuccessToast).toHaveBeenCalledWith('Relevance was reset to default values', { text: 'The changes will impact your results shortly.', diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.ts index 02903b4588ed4..02df792f515a2 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_logic.ts @@ -245,7 +245,7 @@ export const RelevanceTuningLogic = kea< const { http } = HttpLogic.values; const { engineName } = EngineLogic.values; - const url = `/api/app_search/engines/${engineName}/search_settings/details`; + const url = `/internal/app_search/engines/${engineName}/search_settings/details`; try { const response = await http.get(url); @@ -269,7 +269,7 @@ export const RelevanceTuningLogic = kea< const { engineName } = EngineLogic.values; const { http } = HttpLogic.values; const { search_fields: searchFields, boosts } = removeBoostStateProps(values.searchSettings); - const url = `/api/app_search/engines/${engineName}/search`; + const url = `/internal/app_search/engines/${engineName}/search`; actions.setResultsLoading(true); @@ -307,7 +307,7 @@ export const RelevanceTuningLogic = kea< const { http } = HttpLogic.values; const { engineName } = EngineLogic.values; - const url = `/api/app_search/engines/${engineName}/search_settings`; + const url = `/internal/app_search/engines/${engineName}/search_settings`; try { const response = await http.put(url, { @@ -331,7 +331,7 @@ export const RelevanceTuningLogic = kea< const { http } = HttpLogic.values; const { engineName } = EngineLogic.values; - const url = `/api/app_search/engines/${engineName}/search_settings/reset`; + const url = `/internal/app_search/engines/${engineName}/search_settings/reset`; try { const response = await http.post(url); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/result_settings_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/result_settings_logic.test.ts index 5ce6fd9328917..94d5e84c67f6d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/result_settings_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/result_settings_logic.test.ts @@ -835,7 +835,7 @@ describe('ResultSettingsLogic', () => { await nextTick(); expect(http.get).toHaveBeenCalledWith( - '/api/app_search/engines/test-engine/result_settings/details' + '/internal/app_search/engines/test-engine/result_settings/details' ); expect(ResultSettingsLogic.actions.initializeResultFields).toHaveBeenCalledWith( serverFieldResultSettings, @@ -910,7 +910,7 @@ describe('ResultSettingsLogic', () => { await nextTick(); expect(http.put).toHaveBeenCalledWith( - '/api/app_search/engines/test-engine/result_settings', + '/internal/app_search/engines/test-engine/result_settings', { body: JSON.stringify({ result_fields: serverResultFields, diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/result_settings_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/result_settings_logic.ts index 216c43e1d3072..49a09b8a7a3f5 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/result_settings_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/result_settings_logic.ts @@ -292,7 +292,7 @@ export const ResultSettingsLogic = kea { expect(RoleMappingsLogic.values.dataLoading).toEqual(true); expect(http.post).toHaveBeenCalledWith( - '/api/app_search/role_mappings/enable_role_based_access' + '/internal/app_search/role_mappings/enable_role_based_access' ); await nextTick(); expect(setRoleMappingsSpy).toHaveBeenCalledWith(mappingsServerProps); @@ -406,7 +406,7 @@ describe('RoleMappingsLogic', () => { http.get.mockReturnValue(Promise.resolve(mappingsServerProps)); RoleMappingsLogic.actions.initializeRoleMappings(); - expect(http.get).toHaveBeenCalledWith('/api/app_search/role_mappings'); + expect(http.get).toHaveBeenCalledWith('/internal/app_search/role_mappings'); await nextTick(); expect(setRoleMappingsDataSpy).toHaveBeenCalledWith(mappingsServerProps); }); @@ -418,6 +418,16 @@ describe('RoleMappingsLogic', () => { expect(flashAPIErrors).toHaveBeenCalledWith('this is an error'); }); + + it('resets roleMapping state', () => { + mount({ + ...mappingsServerProps, + roleMapping: asRoleMapping, + }); + RoleMappingsLogic.actions.initializeRoleMappings(); + + expect(RoleMappingsLogic.values.roleMapping).toEqual(null); + }); }); describe('initializeRoleMapping', () => { @@ -492,7 +502,7 @@ describe('RoleMappingsLogic', () => { http.post.mockReturnValue(Promise.resolve(mappingsServerProps)); RoleMappingsLogic.actions.handleSaveMapping(); - expect(http.post).toHaveBeenCalledWith('/api/app_search/role_mappings', { + expect(http.post).toHaveBeenCalledWith('/internal/app_search/role_mappings', { body: JSON.stringify(body), }); await nextTick(); @@ -513,9 +523,12 @@ describe('RoleMappingsLogic', () => { http.put.mockReturnValue(Promise.resolve(mappingsServerProps)); RoleMappingsLogic.actions.handleSaveMapping(); - expect(http.put).toHaveBeenCalledWith(`/api/app_search/role_mappings/${asRoleMapping.id}`, { - body: JSON.stringify(body), - }); + expect(http.put).toHaveBeenCalledWith( + `/internal/app_search/role_mappings/${asRoleMapping.id}`, + { + body: JSON.stringify(body), + } + ); await nextTick(); expect(initializeRoleMappingsSpy).toHaveBeenCalled(); @@ -535,13 +548,16 @@ describe('RoleMappingsLogic', () => { http.put.mockReturnValue(Promise.resolve(mappingsServerProps)); RoleMappingsLogic.actions.handleSaveMapping(); - expect(http.put).toHaveBeenCalledWith(`/api/app_search/role_mappings/${asRoleMapping.id}`, { - body: JSON.stringify({ - ...body, - accessAllEngines: false, - engines: [engine.name], - }), - }); + expect(http.put).toHaveBeenCalledWith( + `/internal/app_search/role_mappings/${asRoleMapping.id}`, + { + body: JSON.stringify({ + ...body, + accessAllEngines: false, + engines: [engine.name], + }), + } + ); }); it('handles error', async () => { @@ -582,7 +598,7 @@ describe('RoleMappingsLogic', () => { http.post.mockReturnValue(Promise.resolve(mappingsServerProps)); RoleMappingsLogic.actions.handleSaveUser(); - expect(http.post).toHaveBeenCalledWith('/api/app_search/single_user_role_mapping', { + expect(http.post).toHaveBeenCalledWith('/internal/app_search/single_user_role_mapping', { body: JSON.stringify({ roleMapping: { engines: [], @@ -613,7 +629,7 @@ describe('RoleMappingsLogic', () => { http.put.mockReturnValue(Promise.resolve(mappingsServerProps)); RoleMappingsLogic.actions.handleSaveUser(); - expect(http.post).toHaveBeenCalledWith('/api/app_search/single_user_role_mapping', { + expect(http.post).toHaveBeenCalledWith('/internal/app_search/single_user_role_mapping', { body: JSON.stringify({ roleMapping: { engines: [], @@ -666,7 +682,9 @@ describe('RoleMappingsLogic', () => { http.delete.mockReturnValue(Promise.resolve({})); RoleMappingsLogic.actions.handleDeleteMapping(roleMappingId); - expect(http.delete).toHaveBeenCalledWith(`/api/app_search/role_mappings/${roleMappingId}`); + expect(http.delete).toHaveBeenCalledWith( + `/internal/app_search/role_mappings/${roleMappingId}` + ); await nextTick(); expect(initializeRoleMappingsSpy).toHaveBeenCalled(); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_logic.ts index 8647f4f1df357..7b7bcd864ebd0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings_logic.ts @@ -178,6 +178,7 @@ export const RoleMappingsLogic = kea roleMapping, + initializeRoleMappings: () => null, resetState: () => null, closeUsersAndRolesFlyout: () => null, }, @@ -354,7 +355,7 @@ export const RoleMappingsLogic = kea ({ enableRoleBasedAccess: async () => { const { http } = HttpLogic.values; - const route = '/api/app_search/role_mappings/enable_role_based_access'; + const route = '/internal/app_search/role_mappings/enable_role_based_access'; try { const response = await http.post(route); @@ -365,7 +366,7 @@ export const RoleMappingsLogic = kea { const { http } = HttpLogic.values; - const route = '/api/app_search/role_mappings'; + const route = '/internal/app_search/role_mappings'; try { const response = await http.get(route); @@ -391,7 +392,7 @@ export const RoleMappingsLogic = kea { const { http } = HttpLogic.values; - const route = `/api/app_search/role_mappings/${roleMappingId}`; + const route = `/internal/app_search/role_mappings/${roleMappingId}`; try { await http.delete(route); @@ -425,8 +426,8 @@ export const RoleMappingsLogic = kea { describe('listeners', () => { describe('createSampleEngine', () => { - it('POSTS to /api/app_search/engines', () => { + it('POSTS to /internal/app_search/engines', () => { const body = JSON.stringify({ seed_sample_engine: true, }); SampleEngineCreationCtaLogic.actions.createSampleEngine(); - expect(http.post).toHaveBeenCalledWith('/api/app_search/onboarding_complete', { body }); + expect(http.post).toHaveBeenCalledWith('/internal/app_search/onboarding_complete', { + body, + }); }); it('calls onSampleEngineCreationSuccess on valid submission', async () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/sample_engine_creation_cta/sample_engine_creation_cta_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/sample_engine_creation_cta/sample_engine_creation_cta_logic.ts index bea85ea4fb3a5..6f960abac56f9 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/sample_engine_creation_cta/sample_engine_creation_cta_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/sample_engine_creation_cta/sample_engine_creation_cta_logic.ts @@ -52,7 +52,7 @@ export const SampleEngineCreationCtaLogic = kea< const body = JSON.stringify({ seed_sample_engine: true }); try { - await http.post('/api/app_search/onboarding_complete', { + await http.post('/internal/app_search/onboarding_complete', { body, }); actions.onSampleEngineCreationSuccess(); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/reindex_job/reindex_job_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/reindex_job/reindex_job_logic.test.ts index f01c735aeca8e..706dc3549badc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/reindex_job/reindex_job_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/reindex_job/reindex_job_logic.test.ts @@ -103,7 +103,7 @@ describe('ReindexJobLogic', () => { await nextTick(); expect(http.get).toHaveBeenCalledWith( - '/api/app_search/engines/some-engine/reindex_job/some-job-id' + '/internal/app_search/engines/some-engine/reindex_job/some-job-id' ); expect(ReindexJobLogic.actions.onLoadSuccess).toHaveBeenCalledWith(MOCK_RESPONSE); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/reindex_job/reindex_job_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/reindex_job/reindex_job_logic.ts index 8cc76f7f6e94f..fb50c9390a8d9 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/reindex_job/reindex_job_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/reindex_job/reindex_job_logic.ts @@ -53,7 +53,9 @@ export const ReindexJobLogic = kea { SchemaBaseLogic.actions.loadSchema(); await nextTick(); - expect(http.get).toHaveBeenCalledWith('/api/app_search/engines/some-engine/schema'); + expect(http.get).toHaveBeenCalledWith('/internal/app_search/engines/some-engine/schema'); expect(SchemaBaseLogic.actions.onSchemaLoad).toHaveBeenCalledWith(MOCK_RESPONSE); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_base_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_base_logic.ts index c2196c01d402b..b9107666a881b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_base_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_base_logic.ts @@ -56,7 +56,7 @@ export const SchemaBaseLogic = kea { SchemaLogic.actions.updateSchema(); await nextTick(); - expect(http.post).toHaveBeenCalledWith('/api/app_search/engines/some-engine/schema', { + expect(http.post).toHaveBeenCalledWith('/internal/app_search/engines/some-engine/schema', { body: '{}', }); expect(SchemaLogic.actions.onSchemaLoad).toHaveBeenCalledWith(MOCK_RESPONSE); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_logic.ts index 3dcafd6782afd..b26fd92064582 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/schema_logic.ts @@ -146,7 +146,7 @@ export const SchemaLogic = kea>({ clearFlashMessages(); try { - const response = await http.post(`/api/app_search/engines/${engineName}/schema`, { + const response = await http.post(`/internal/app_search/engines/${engineName}/schema`, { body: JSON.stringify(schema), }); actions.onSchemaLoad(response); 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 5b3c0a766fbe1..d4f5ee29f7467 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 @@ -90,7 +90,7 @@ describe('SearchLogic', () => { jest.runAllTimers(); await nextTick(); - expect(http.post).toHaveBeenCalledWith('/api/app_search/engines/some-engine/search', { + expect(http.post).toHaveBeenCalledWith('/internal/app_search/engines/some-engine/search', { query: { query: 'hello world' }, }); expect(logic.actions.onSearch).toHaveBeenCalledWith(MOCK_SEARCH_RESPONSE); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search/search_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search/search_logic.ts index 52aedc1659689..424baedf210f5 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search/search_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search/search_logic.ts @@ -61,7 +61,7 @@ export const SearchLogic = kea>({ const { engineName } = EngineLogic.values; try { - const response = await http.post(`/api/app_search/engines/${engineName}/search`, { + const response = await http.post(`/internal/app_search/engines/${engineName}/search`, { query: { query }, }); actions.onSearch(response); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui_logic.test.ts index aefe3c94f89cc..33144d4188ec1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui_logic.test.ts @@ -160,7 +160,7 @@ describe('SearchUILogic', () => { await nextTick(); expect(http.get).toHaveBeenCalledWith( - '/api/app_search/engines/engine1/search_ui/field_config' + '/internal/app_search/engines/engine1/search_ui/field_config' ); expect(SearchUILogic.actions.onFieldDataLoaded).toHaveBeenCalledWith({ validFields: ['test'], diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui_logic.ts index e6225614fdc18..7a3e429d842f8 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui_logic.ts @@ -103,7 +103,7 @@ export const SearchUILogic = kea> return; } - const url = `/api/app_search/engines/${engineName}/search_ui/field_config`; + const url = `/internal/app_search/engines/${engineName}/search_ui/field_config`; try { const initialFieldValues = await http.get(url); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/source_engines/source_engines_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/source_engines/source_engines_logic.test.ts index eababb9d93c58..75d3c46ef72ee 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/source_engines/source_engines_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/source_engines/source_engines_logic.test.ts @@ -227,7 +227,7 @@ describe('SourceEnginesLogic', () => { expect(mockRecursivelyFetchEngines).toHaveBeenCalledWith( expect.objectContaining({ - endpoint: '/api/app_search/engines/some-engine/source_engines', + endpoint: '/internal/app_search/engines/some-engine/source_engines', }) ); expect(SourceEnginesLogic.actions.onSourceEnginesFetch).toHaveBeenCalledWith([ @@ -245,7 +245,7 @@ describe('SourceEnginesLogic', () => { expect(mockRecursivelyFetchEngines).toHaveBeenCalledWith( expect.objectContaining({ - endpoint: '/api/app_search/engines', + endpoint: '/internal/app_search/engines', query: { type: 'indexed' }, }) ); @@ -283,7 +283,7 @@ describe('SourceEnginesLogic', () => { await nextTick(); expect(http.post).toHaveBeenCalledWith( - '/api/app_search/engines/some-engine/source_engines/bulk_create', + '/internal/app_search/engines/some-engine/source_engines/bulk_create', { body: JSON.stringify({ source_engine_slugs: ['source-engine-3', 'source-engine-4'] }), } @@ -341,7 +341,7 @@ describe('SourceEnginesLogic', () => { await nextTick(); expect(http.delete).toHaveBeenCalledWith( - '/api/app_search/engines/some-engine/source_engines/source-engine-2' + '/internal/app_search/engines/some-engine/source_engines/source-engine-2' ); expect(SourceEnginesLogic.actions.onSourceEngineRemove).toHaveBeenCalledWith( 'source-engine-2' diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/source_engines/source_engines_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/source_engines/source_engines_logic.ts index 21ae24357bcea..af3c955258cf8 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/source_engines/source_engines_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/source_engines/source_engines_logic.ts @@ -132,7 +132,7 @@ export const SourceEnginesLogic = kea< const { engineName } = EngineLogic.values; try { - await http.post(`/api/app_search/engines/${engineName}/source_engines/bulk_create`, { + await http.post(`/internal/app_search/engines/${engineName}/source_engines/bulk_create`, { body: JSON.stringify({ source_engine_slugs: sourceEngineNames, }), @@ -155,13 +155,13 @@ export const SourceEnginesLogic = kea< const { engineName } = EngineLogic.values; recursivelyFetchEngines({ - endpoint: `/api/app_search/engines/${engineName}/source_engines`, + endpoint: `/internal/app_search/engines/${engineName}/source_engines`, onComplete: (engines) => actions.onSourceEnginesFetch(engines), }); }, fetchIndexedEngines: () => { recursivelyFetchEngines({ - endpoint: '/api/app_search/engines', + endpoint: '/internal/app_search/engines', onComplete: (engines) => actions.setIndexedEngines(engines), query: { type: 'indexed' }, }); @@ -172,7 +172,7 @@ export const SourceEnginesLogic = kea< try { await http.delete( - `/api/app_search/engines/${engineName}/source_engines/${sourceEngineName}` + `/internal/app_search/engines/${engineName}/source_engines/${sourceEngineName}` ); actions.onSourceEngineRemove(sourceEngineName); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/synonyms_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/synonyms_logic.test.ts index 630a069d0c5e8..0ff84ad4cb9cb 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/synonyms_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/synonyms_logic.test.ts @@ -137,7 +137,7 @@ describe('SynonymsLogic', () => { SynonymsLogic.actions.loadSynonyms(); await nextTick(); - expect(http.get).toHaveBeenCalledWith('/api/app_search/engines/some-engine/synonyms', { + expect(http.get).toHaveBeenCalledWith('/internal/app_search/engines/some-engine/synonyms', { query: { 'page[current]': 1, 'page[size]': 12, @@ -178,9 +178,12 @@ describe('SynonymsLogic', () => { SynonymsLogic.actions.createSynonymSet(['a', 'b', 'c']); await nextTick(); - expect(http.post).toHaveBeenCalledWith('/api/app_search/engines/some-engine/synonyms', { - body: '{"synonyms":["a","b","c"]}', - }); + expect(http.post).toHaveBeenCalledWith( + '/internal/app_search/engines/some-engine/synonyms', + { + body: '{"synonyms":["a","b","c"]}', + } + ); expect(SynonymsLogic.actions.onSynonymSetSuccess).toHaveBeenCalledWith( 'Synonym set created' ); @@ -221,7 +224,7 @@ describe('SynonymsLogic', () => { await nextTick(); expect(http.put).toHaveBeenCalledWith( - '/api/app_search/engines/some-engine/synonyms/some-synonym-id', + '/internal/app_search/engines/some-engine/synonyms/some-synonym-id', { body: '{"synonyms":["hello","world"]}', } @@ -266,7 +269,7 @@ describe('SynonymsLogic', () => { await nextTick(); expect(http.delete).toHaveBeenCalledWith( - '/api/app_search/engines/some-engine/synonyms/some-synonym-id' + '/internal/app_search/engines/some-engine/synonyms/some-synonym-id' ); expect(SynonymsLogic.actions.onSynonymSetSuccess).toHaveBeenCalledWith( 'Synonym set deleted' diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/synonyms_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/synonyms_logic.ts index fc407dcfc38b3..123a2e50fdf2f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/synonyms_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/synonyms_logic.ts @@ -115,7 +115,7 @@ export const SynonymsLogic = kea> const { engineName } = EngineLogic.values; try { - const response = await http.get(`/api/app_search/engines/${engineName}/synonyms`, { + const response = await http.get(`/internal/app_search/engines/${engineName}/synonyms`, { query: { 'page[current]': meta.page.current, 'page[size]': meta.page.size, @@ -132,7 +132,7 @@ export const SynonymsLogic = kea> clearFlashMessages(); try { - await http.post(`/api/app_search/engines/${engineName}/synonyms`, { + await http.post(`/internal/app_search/engines/${engineName}/synonyms`, { body: JSON.stringify({ synonyms }), }); actions.onSynonymSetSuccess(CREATE_SUCCESS); @@ -147,7 +147,7 @@ export const SynonymsLogic = kea> clearFlashMessages(); try { - await http.put(`/api/app_search/engines/${engineName}/synonyms/${id}`, { + await http.put(`/internal/app_search/engines/${engineName}/synonyms/${id}`, { body: JSON.stringify({ synonyms }), }); actions.onSynonymSetSuccess(UPDATE_SUCCESS); @@ -162,7 +162,7 @@ export const SynonymsLogic = kea> clearFlashMessages(); try { - await http.delete(`/api/app_search/engines/${engineName}/synonyms/${id}`); + await http.delete(`/internal/app_search/engines/${engineName}/synonyms/${id}`); actions.onSynonymSetSuccess(DELETE_SUCCESS); } catch (e) { actions.onSynonymSetError(); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/utils/recursively_fetch_engines/index.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/utils/recursively_fetch_engines/index.test.ts index a73dd075115ee..555a880d544f4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/utils/recursively_fetch_engines/index.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/utils/recursively_fetch_engines/index.test.ts @@ -46,18 +46,21 @@ describe('recursivelyFetchEngines', () => { .mockReturnValueOnce(Promise.resolve(MOCK_PAGE_3)); recursivelyFetchEngines({ - endpoint: '/api/app_search/engines/some-engine/source_engines', + endpoint: '/internal/app_search/engines/some-engine/source_engines', onComplete: MOCK_CALLBACK, }); await nextTick(); expect(http.get).toHaveBeenCalledTimes(3); // Called once for each page - expect(http.get).toHaveBeenCalledWith('/api/app_search/engines/some-engine/source_engines', { - query: { - 'page[current]': 1, - 'page[size]': 25, - }, - }); + expect(http.get).toHaveBeenCalledWith( + '/internal/app_search/engines/some-engine/source_engines', + { + query: { + 'page[current]': 1, + 'page[size]': 25, + }, + } + ); expect(MOCK_CALLBACK).toHaveBeenCalledWith([ { name: 'source-engine-1' }, @@ -68,12 +71,12 @@ describe('recursivelyFetchEngines', () => { it('passes optional query params', () => { recursivelyFetchEngines({ - endpoint: '/api/app_search/engines/some-engine/engines', + endpoint: '/internal/app_search/engines/some-engine/engines', onComplete: MOCK_CALLBACK, query: { type: 'indexed' }, }); - expect(http.get).toHaveBeenCalledWith('/api/app_search/engines/some-engine/engines', { + expect(http.get).toHaveBeenCalledWith('/internal/app_search/engines/some-engine/engines', { query: { 'page[current]': 1, 'page[size]': 25, diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/product_card/product_card.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/product_card/product_card.tsx index c8dd9523f62f4..33b7658788f62 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/product_card/product_card.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/product_card/product_card.tsx @@ -28,9 +28,10 @@ interface ProductCardProps { URL: string; }; image: string; + url?: string; } -export const ProductCard: React.FC = ({ product, image }) => { +export const ProductCard: React.FC = ({ product, image, url }) => { const { sendEnterpriseSearchTelemetry } = useActions(TelemetryLogic); const { config } = useValues(KibanaLogic); @@ -68,7 +69,7 @@ export const ProductCard: React.FC = ({ product, image }) => { footer={ sendEnterpriseSearchTelemetry({ diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/product_selector/product_selector.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/product_selector/product_selector.test.tsx index ee0209c1a124d..c713507083b08 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/product_selector/product_selector.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/product_selector/product_selector.test.tsx @@ -11,6 +11,8 @@ import React from 'react'; import { shallow } from 'enzyme'; +import { WORKPLACE_SEARCH_PLUGIN } from '../../../../../common/constants'; + import { LicenseCallout } from '../license_callout'; import { ProductCard } from '../product_card'; import { SetupGuideCta } from '../setup_guide'; @@ -18,10 +20,15 @@ import { TrialCallout } from '../trial_callout'; import { ProductSelector } from './'; +const props = { + access: {}, + isWorkplaceSearchAdmin: true, +}; + describe('ProductSelector', () => { it('renders the overview page, product cards, & setup guide CTAs with no host set', () => { setMockValues({ config: { host: '' } }); - const wrapper = shallow(); + const wrapper = shallow(); expect(wrapper.find(ProductCard)).toHaveLength(2); expect(wrapper.find(SetupGuideCta)).toHaveLength(1); @@ -30,12 +37,21 @@ describe('ProductSelector', () => { it('renders the license and trial callouts', () => { setMockValues({ config: { host: 'localhost' } }); - const wrapper = shallow(); + const wrapper = shallow(); expect(wrapper.find(TrialCallout)).toHaveLength(1); expect(wrapper.find(LicenseCallout)).toHaveLength(1); }); + it('passes correct URL when Workplace Search user is not an admin', () => { + setMockValues({ config: { host: '' } }); + const wrapper = shallow(); + + expect(wrapper.find(ProductCard).last().prop('url')).toEqual( + WORKPLACE_SEARCH_PLUGIN.NON_ADMIN_URL + ); + }); + describe('access checks when host is set', () => { beforeEach(() => { setMockValues({ config: { host: 'localhost' } }); @@ -43,7 +59,10 @@ describe('ProductSelector', () => { it('does not render the App Search card if the user does not have access to AS', () => { const wrapper = shallow( - + ); expect(wrapper.find(ProductCard)).toHaveLength(1); @@ -52,7 +71,10 @@ describe('ProductSelector', () => { it('does not render the Workplace Search card if the user does not have access to WS', () => { const wrapper = shallow( - + ); expect(wrapper.find(ProductCard)).toHaveLength(1); @@ -60,7 +82,7 @@ describe('ProductSelector', () => { }); it('does not render any cards if the user does not have access', () => { - const wrapper = shallow(); + const wrapper = shallow(); expect(wrapper.find(ProductCard)).toHaveLength(0); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/product_selector/product_selector.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/product_selector/product_selector.tsx index f42a043e7cd81..690122efc2f20 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/product_selector/product_selector.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/product_selector/product_selector.tsx @@ -34,9 +34,13 @@ interface ProductSelectorProps { hasAppSearchAccess?: boolean; hasWorkplaceSearchAccess?: boolean; }; + isWorkplaceSearchAdmin: boolean; } -export const ProductSelector: React.FC = ({ access }) => { +export const ProductSelector: React.FC = ({ + access, + isWorkplaceSearchAdmin, +}) => { const { hasAppSearchAccess, hasWorkplaceSearchAccess } = access; const { config } = useValues(KibanaLogic); @@ -44,6 +48,10 @@ export const ProductSelector: React.FC = ({ access }) => { const shouldShowAppSearchCard = !config.host || hasAppSearchAccess; const shouldShowWorkplaceSearchCard = !config.host || hasWorkplaceSearchAccess; + const WORKPLACE_SEARCH_URL = isWorkplaceSearchAdmin + ? WORKPLACE_SEARCH_PLUGIN.URL + : WORKPLACE_SEARCH_PLUGIN.NON_ADMIN_URL; + return ( @@ -84,7 +92,11 @@ export const ProductSelector: React.FC = ({ access }) => { )} {shouldShowWorkplaceSearchCard && ( - + )} diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/index.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/index.tsx index b1aab0dacabde..17387ae482325 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/index.tsx @@ -19,11 +19,12 @@ import { ProductSelector } from './components/product_selector'; import { SetupGuide } from './components/setup_guide'; import { ROOT_PATH, SETUP_GUIDE_PATH } from './routes'; -export const EnterpriseSearch: React.FC = ({ access = {} }) => { +export const EnterpriseSearch: React.FC = ({ access = {}, workplaceSearch }) => { const { errorConnecting } = useValues(HttpLogic); const { config } = useValues(KibanaLogic); const showErrorConnecting = !!(config.host && errorConnecting); + const isWorkplaceSearchAdmin = !!workplaceSearch?.account?.isAdmin; return ( @@ -31,7 +32,11 @@ export const EnterpriseSearch: React.FC = ({ access = {} }) => { - {showErrorConnecting ? : } + {showErrorConnecting ? ( + + ) : ( + + )} ); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/error_state/error_state_prompt.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/error_state/error_state_prompt.tsx index 282c7ca5721cb..3fbae0a564c17 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/error_state/error_state_prompt.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/error_state/error_state_prompt.tsx @@ -13,7 +13,6 @@ import { EuiEmptyPrompt, EuiCode } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { KibanaLogic } from '../kibana'; -import { BetaNotification } from '../layout/beta'; import { EuiButtonTo } from '../react_router_helpers'; import './error_state_prompt.scss'; @@ -100,7 +99,6 @@ export const ErrorStatePrompt: React.FC = () => { defaultMessage="Review setup guide" /> , - , ]} /> ); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/http/http_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/shared/http/http_logic.test.ts index 836705e98da94..8e1b59096b180 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/http/http_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/http/http_logic.test.ts @@ -93,7 +93,7 @@ describe('HttpLogic', () => { it('sets errorConnecting to true if the response header is true', async () => { const httpResponse = { - response: { url: '/api/app_search/engines', headers: { get: () => 'true' } }, + response: { url: '/internal/app_search/engines', headers: { get: () => 'true' } }, }; await expect(interceptedResponse(httpResponse)).rejects.toEqual(httpResponse); @@ -102,7 +102,10 @@ describe('HttpLogic', () => { it('sets errorConnecting to false if the response header is false', async () => { const httpResponse = { - response: { url: '/api/workplace_search/overview', headers: { get: () => 'false' } }, + response: { + url: '/internal/workplace_search/overview', + headers: { get: () => 'false' }, + }, }; await expect(interceptedResponse(httpResponse)).rejects.toEqual(httpResponse); @@ -140,7 +143,7 @@ describe('HttpLogic', () => { it('sets readOnlyMode to true if the response header is true', async () => { const httpResponse = { - response: { url: '/api/app_search/engines', headers: { get: () => 'true' } }, + response: { url: '/internal/app_search/engines', headers: { get: () => 'true' } }, }; await expect(interceptedResponse(httpResponse)).resolves.toEqual(httpResponse); @@ -149,7 +152,10 @@ describe('HttpLogic', () => { it('sets readOnlyMode to false if the response header is false', async () => { const httpResponse = { - response: { url: '/api/workplace_search/overview', headers: { get: () => 'false' } }, + response: { + url: '/internal/workplace_search/overview', + headers: { get: () => 'false' }, + }, }; await expect(interceptedResponse(httpResponse)).resolves.toEqual(httpResponse); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/http/http_logic.ts b/x-pack/plugins/enterprise_search/public/applications/shared/http/http_logic.ts index ea3c84c1e0534..d18408a78b0d8 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/http/http_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/http/http_logic.ts @@ -128,5 +128,5 @@ const isEnterpriseSearchApi = (httpResponse: HttpResponse) => { if (!httpResponse.response) return false; // Typically this means Kibana has stopped working, in which case we short-circuit early to prevent errors const { url } = httpResponse.response; - return url.includes('/api/app_search/') || url.includes('/api/workplace_search/'); + return url.includes('/internal/app_search/') || url.includes('/internal/workplace_search/'); }; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/beta.scss b/x-pack/plugins/enterprise_search/public/applications/shared/layout/beta.scss deleted file mode 100644 index adf2dc16d8327..0000000000000 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/beta.scss +++ /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. - */ - -@include euiBreakpoint('m', 'l', 'xl') { - .betaSidebarNotification { - .euiSideNav { - display: flex; - flex-direction: column; - - .euiSideNav__content { - flex-grow: 1; - display: flex; - flex-direction: column; - justify-content: space-between; - } - } - } -} - -.betaNotification { - width: 350px; -} diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/beta.test.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/layout/beta.test.tsx deleted file mode 100644 index b8b6f6c257b22..0000000000000 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/beta.test.tsx +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import '../../__mocks__/enterprise_search_url.mock'; - -import React from 'react'; - -import { shallow, ShallowWrapper } from 'enzyme'; - -import { EuiPopover, EuiPopoverTitle, EuiLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; - -import { shallowWithIntl } from '../../test_helpers'; - -import { BetaNotification, appendBetaNotificationItem } from './beta'; - -describe('BetaNotification', () => { - const getToggleButton = (wrapper: ShallowWrapper) => { - return shallow(
{wrapper.prop('button')}
).childAt(0); - }; - - it('renders', () => { - const wrapper = shallow(); - - expect(wrapper.type()).toEqual(EuiPopover); - expect(wrapper.find(EuiPopoverTitle).prop('children')).toEqual( - 'Enterprise Search in Kibana is a beta user interface' - ); - }); - - describe('open/close popover state', () => { - const wrapper = shallow(); - - it('is initially closed', () => { - expect(wrapper.find(EuiPopover).prop('isOpen')).toBe(false); - }); - - it('opens the popover when the toggle button is pressed', () => { - getToggleButton(wrapper).simulate('click'); - - expect(wrapper.find(EuiPopover).prop('isOpen')).toBe(true); - }); - - it('closes the popover', () => { - wrapper.prop('closePopover')(); - - expect(wrapper.find(EuiPopover).prop('isOpen')).toBe(false); - }); - }); - - describe('toggle button props', () => { - it('defaults to a size of xs and flush', () => { - const wrapper = shallow(); - const toggleButton = getToggleButton(wrapper); - - expect(toggleButton.prop('size')).toEqual('xs'); - expect(toggleButton.prop('flush')).toEqual('both'); - }); - - it('passes down custom button props', () => { - const wrapper = shallow(); - const toggleButton = getToggleButton(wrapper); - - expect(toggleButton.prop('size')).toEqual('m'); - }); - }); - - describe('links', () => { - const wrapper = shallowWithIntl(); - const links = wrapper.find(FormattedMessage).dive(); - - it('renders a documentation link', () => { - const docLink = links.find(EuiLink).first(); - - expect(docLink.prop('href')).toContain('/user-interfaces.html'); - }); - - it('renders a link back to the standalone UI', () => { - const switchLink = links.find(EuiLink).last(); - - expect(switchLink.prop('href')).toBe('http://localhost:3002'); - }); - }); -}); - -describe('appendBetaNotificationItem', () => { - const mockSideNav = { - name: 'Hello world', - items: [ - { id: '1', name: 'Link 1' }, - { id: '2', name: 'Link 2' }, - ], - }; - - it('inserts a beta notification into a side nav items array', () => { - appendBetaNotificationItem(mockSideNav); - - expect(mockSideNav).toEqual({ - name: 'Hello world', - items: [ - { id: '1', name: 'Link 1' }, - { id: '2', name: 'Link 2' }, - { - id: 'beta', - name: '', - renderItem: expect.any(Function), - }, - ], - }); - }); - - it('renders the BetaNotification component as a side nav item', () => { - const SideNavItem = (mockSideNav.items[2] as any).renderItem; - const wrapper = shallow(); - - expect(wrapper.find(BetaNotification)).toHaveLength(1); - }); - - it('does nothing if no side nav was passed', () => { - const mockEmptySideNav = undefined; - appendBetaNotificationItem(mockEmptySideNav); - - expect(mockEmptySideNav).toEqual(undefined); - }); -}); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/beta.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/layout/beta.tsx deleted file mode 100644 index 1f4c8328cc874..0000000000000 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/beta.tsx +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { useState } from 'react'; - -import { - EuiPopover, - EuiPopoverTitle, - EuiPopoverFooter, - EuiButtonEmpty, - EuiButtonEmptyProps, - EuiText, - EuiLink, -} from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; - -import { KibanaPageTemplateProps } from '../../../../../../../src/plugins/kibana_react/public'; - -import { docLinks } from '../doc_links'; -import { getEnterpriseSearchUrl } from '../enterprise_search_url'; - -import './beta.scss'; - -interface Props { - buttonProps?: EuiButtonEmptyProps; -} - -export const BetaNotification: React.FC = ({ buttonProps }) => { - const [isPopoverOpen, setIsPopoverOpen] = useState(false); - const togglePopover = () => setIsPopoverOpen((isOpen) => !isOpen); - const closePopover = () => setIsPopoverOpen(false); - - return ( - - {i18n.translate('xpack.enterpriseSearch.beta.buttonLabel', { - defaultMessage: 'This is a beta user interface', - })} - - } - isOpen={isPopoverOpen} - closePopover={closePopover} - anchorPosition="rightDown" - repositionOnScroll - > - - {i18n.translate('xpack.enterpriseSearch.beta.popover.title', { - defaultMessage: 'Enterprise Search in Kibana is a beta user interface', - })} - -
- -

- {i18n.translate('xpack.enterpriseSearch.beta.popover.description', { - defaultMessage: - 'The Kibana interface for Enterprise Search is a beta feature. It is subject to change and is not covered by the same level of support as generally available features. This interface will become the sole management panel for Enterprise Search with the 8.0 release. Until then, the standalone Enterprise Search UI remains available and supported.', - })} -

-
-
- - - Learn more - - ), - standaloneUILink: ( - switch to the Enterprise Search UI - ), - }} - /> - -
- ); -}; - -export const appendBetaNotificationItem = (sideNav: KibanaPageTemplateProps['solutionNav']) => { - if (sideNav) { - sideNav.items.push({ - id: 'beta', - name: '', - renderItem: () => , - }); - } -}; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/page_template.test.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/layout/page_template.test.tsx index bc612de884f8b..5b02756e44b52 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/page_template.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/layout/page_template.test.tsx @@ -7,8 +7,6 @@ import { setMockValues } from '../../__mocks__/kea_logic'; -jest.mock('./beta', () => ({ appendBetaNotificationItem: jest.fn() })); // Mostly adding this to get tests passing. Should be removed once we're out of beta - import React from 'react'; import { shallow } from 'enzyme'; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/page_template.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/layout/page_template.tsx index 202c9b6a59e8d..affec11921545 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/page_template.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/layout/page_template.tsx @@ -23,8 +23,6 @@ import { HttpLogic } from '../http'; import { BreadcrumbTrail } from '../kibana_chrome/generate_breadcrumbs'; import { Loading } from '../loading'; -import { appendBetaNotificationItem } from './beta'; - import './page_template.scss'; /* @@ -63,8 +61,6 @@ export const EnterpriseSearchPageTemplate: React.FC = ({ const hasCustomEmptyState = !!emptyState; const showCustomEmptyState = hasCustomEmptyState && isEmptyState; - appendBetaNotificationItem(solutionNav); - return ( = ({ }} isEmptyState={isEmptyState && !isLoading} solutionNav={solutionNav ? { icon: 'logoEnterpriseSearch', ...solutionNav } : undefined} - pageSideBarProps={{ className: 'betaSidebarNotification' }} > {setPageChrome} {readOnlyMode && ( diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/react_router_helpers/eui_components.test.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/react_router_helpers/eui_components.test.tsx index a04e628e0c4f9..e74c062eab0b9 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/react_router_helpers/eui_components.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/react_router_helpers/eui_components.test.tsx @@ -16,9 +16,23 @@ import React from 'react'; import { shallow } from 'enzyme'; -import { EuiLink, EuiButton, EuiButtonEmpty, EuiPanel, EuiCard } from '@elastic/eui'; - -import { EuiLinkTo, EuiButtonTo, EuiButtonEmptyTo, EuiPanelTo, EuiCardTo } from './eui_components'; +import { + EuiLink, + EuiButton, + EuiButtonEmpty, + EuiListGroupItem, + EuiPanel, + EuiCard, +} from '@elastic/eui'; + +import { + EuiLinkTo, + EuiButtonTo, + EuiButtonEmptyTo, + EuiListGroupItemTo, + EuiPanelTo, + EuiCardTo, +} from './eui_components'; describe('React Router EUI component helpers', () => { it('renders an EuiLink', () => { @@ -39,6 +53,13 @@ describe('React Router EUI component helpers', () => { expect(wrapper.find(EuiButtonEmpty)).toHaveLength(1); }); + it('renders an EuiListGroupItem', () => { + const wrapper = shallow(); + + expect(wrapper.find(EuiListGroupItem)).toHaveLength(1); + expect(wrapper.find(EuiListGroupItem).prop('label')).toEqual('foo'); + }); + it('renders an EuiPanel', () => { const wrapper = shallow(); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/react_router_helpers/eui_components.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/react_router_helpers/eui_components.tsx index e7eb36f279fc7..0c3e8dd607d8e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/react_router_helpers/eui_components.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/react_router_helpers/eui_components.tsx @@ -14,6 +14,8 @@ import { EuiButtonEmptyProps, EuiButtonProps, EuiLinkAnchorProps, + EuiListGroupItem, + EuiListGroupItemProps, EuiPanel, EuiCard, EuiCardProps, @@ -67,3 +69,13 @@ export const EuiCardTo: React.FC = ({ shouldNotCreateHref, ...rest }) => ; + +type ReactRouterEuiListGroupItemProps = ReactRouterProps & EuiListGroupItemProps; +export const EuiListGroupItemTo: React.FC = ({ + to, + onClick, + shouldNotCreateHref, + ...rest +}) => ( + +); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/react_router_helpers/index.ts b/x-pack/plugins/enterprise_search/public/applications/shared/react_router_helpers/index.ts index 17827b0230237..fe76c13c2b707 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/react_router_helpers/index.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/react_router_helpers/index.ts @@ -8,4 +8,11 @@ export { letBrowserHandleEvent } from './link_events'; export { createHref, CreateHrefOptions } from './create_href'; export { generateReactRouterProps, ReactRouterProps } from './generate_react_router_props'; -export { EuiLinkTo, EuiButtonTo, EuiButtonEmptyTo, EuiPanelTo, EuiCardTo } from './eui_components'; +export { + EuiLinkTo, + EuiButtonTo, + EuiButtonEmptyTo, + EuiListGroupItemTo, + EuiPanelTo, + EuiCardTo, +} from './eui_components'; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/role_mapping/users_table.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/role_mapping/users_table.tsx index 3b6e2dc440a76..3dc5560a9eaba 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/role_mapping/users_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/role_mapping/users_table.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import { EuiBadge, EuiBasicTableColumn, EuiInMemoryTable, EuiTextColor } from '@elastic/eui'; import type { EuiSearchBarOnChangeArgs } from '@elastic/eui'; @@ -57,6 +57,8 @@ const noItemsPlaceholder = ; const invitationBadge = {INVITATION_PENDING_LABEL}; const deactivatedBadge = {DEACTIVATED_LABEL}; +type Users = Array>; + export const UsersTable: React.FC = ({ accessItemKey, singleUserRoleMappings, @@ -72,9 +74,13 @@ export const UsersTable: React.FC = ({ id: user.roleMapping.id, accessItems: (user.roleMapping as SharedRoleMapping)[accessItemKey], invitation: user.invitation, - })) as unknown) as Array>; + })) as unknown) as Users; + + const [items, setItems] = useState([] as Users); - const [items, setItems] = useState(users); + useEffect(() => { + setItems(users); + }, [singleUserRoleMappings]); const columns: Array> = [ { diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/telemetry/telemetry_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/shared/telemetry/telemetry_logic.test.ts index d80750d068f2b..d8d0442707730 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/telemetry/telemetry_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/telemetry/telemetry_logic.test.ts @@ -28,7 +28,7 @@ describe('Telemetry logic', () => { product: 'enterprise_search', }); - expect(http.put).toHaveBeenCalledWith('/api/enterprise_search/stats', { + expect(http.put).toHaveBeenCalledWith('/internal/enterprise_search/stats', { headers, body: '{"product":"enterprise_search","action":"viewed","metric":"setup_guide"}', }); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/telemetry/telemetry_logic.ts b/x-pack/plugins/enterprise_search/public/applications/shared/telemetry/telemetry_logic.ts index 343eb21bae107..cdd2f6e09c0a1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/telemetry/telemetry_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/telemetry/telemetry_logic.ts @@ -37,7 +37,7 @@ export const TelemetryLogic = kea>({ const { http } = HttpLogic.values; try { const body = JSON.stringify({ product, action, metric }); - await http.put('/api/enterprise_search/stats', { headers, body }); + await http.put('/internal/enterprise_search/stats', { headers, body }); } catch (error) { throw new Error('Unable to send telemetry'); } diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/credential_item/credential_item.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/credential_item/credential_item.tsx index 61eaa4e42f8dd..e4067e1f98e5d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/credential_item/credential_item.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/credential_item/credential_item.tsx @@ -19,6 +19,21 @@ import { EuiFieldPassword, EuiToolTip, } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +export const COPY_TOOLTIP = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.credentialItem.copy.tooltip', + { + defaultMessage: 'Copy to clipboard', + } +); + +export const COPIED_TOOLTIP = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.credentialItem.copied.tooltip', + { + defaultMessage: 'Copied!', + } +); interface CredentialItemProps { label: string; @@ -37,6 +52,14 @@ export const CredentialItem: React.FC = ({ }) => { const [isVisible, setIsVisible] = useState(false); + const SHOW_CREDENTIAL_TOOLTIP = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.credentialItem.show.tooltip', + { + defaultMessage: 'Show {credential}.', + values: { credential: label }, + } + ); + return ( = ({ {!hideCopy && ( - + {(copy) => ( = ({ )} - + setIsVisible(!isVisible)} iconType={isVisible ? 'eyeClosed' : 'eye'} diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/license_callout/license_callout.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/license_callout/license_callout.tsx index f278cda96ae83..270daf195bd38 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/license_callout/license_callout.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/license_callout/license_callout.tsx @@ -9,6 +9,7 @@ import React from 'react'; import { EuiLink, EuiFlexItem, EuiFlexGroup, EuiText } from '@elastic/eui'; +import { EXPLORE_PLATINUM_FEATURES_LINK } from '../../../constants'; import { ENT_SEARCH_LICENSE_MANAGEMENT } from '../../../routes'; interface LicenseCalloutProps { @@ -20,7 +21,7 @@ export const LicenseCallout: React.FC = ({ message }) => { <> {message}{' '} - Explore Platinum features + {EXPLORE_PLATINUM_FEATURES_LINK} ); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/status_item/status_item.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/status_item/status_item.tsx index 35ac8f1b85c05..025230d0b5c1a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/status_item/status_item.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/status_item/status_item.tsx @@ -11,7 +11,6 @@ import { EuiCopy, EuiButton, EuiButtonIcon, - EuiToolTip, EuiSpacer, EuiCodeBlock, EuiPopover, @@ -30,19 +29,17 @@ export const StatusItem: React.FC = ({ details }) => { const closePopover = () => setIsPopoverOpen(false); const formattedDetails = details.join('\n'); - const tooltipPopoverTrigger = ( - - - + const popoverTrigger = ( + ); const infoPopover = ( - + { const { serviceName, indexPermissions, serviceType } = response; http.get.mockReturnValue(Promise.resolve(response)); AddSourceLogic.actions.saveSourceParams(queryString, params, true); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/sources/create', { + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/sources/create', { query: { ...params, kibana_host: '', @@ -347,7 +347,7 @@ describe('AddSourceLogic', () => { }) ); AddSourceLogic.actions.saveSourceParams(queryString, params, true); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/sources/create', { + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/sources/create', { query: { ...params, kibana_host: '', @@ -407,7 +407,7 @@ describe('AddSourceLogic', () => { AddSourceLogic.actions.getSourceConfigData('github'); expect(http.get).toHaveBeenCalledWith( - '/api/workplace_search/org/settings/connectors/github' + '/internal/workplace_search/org/settings/connectors/github' ); await nextTick(); expect(setSourceConfigDataSpy).toHaveBeenCalledWith(sourceConfigData); @@ -444,8 +444,10 @@ describe('AddSourceLogic', () => { expect(clearFlashMessages).toHaveBeenCalled(); expect(AddSourceLogic.values.buttonLoading).toEqual(true); expect(http.get).toHaveBeenCalledWith( - '/api/workplace_search/org/sources/github/prepare', - { query } + '/internal/workplace_search/org/sources/github/prepare', + { + query, + } ); await nextTick(); expect(setSourceConnectDataSpy).toHaveBeenCalledWith(sourceConnectData); @@ -465,8 +467,10 @@ describe('AddSourceLogic', () => { }; expect(http.get).toHaveBeenCalledWith( - '/api/workplace_search/org/sources/github/prepare', - { query } + '/internal/workplace_search/org/sources/github/prepare', + { + query, + } ); }); @@ -491,7 +495,7 @@ describe('AddSourceLogic', () => { AddSourceLogic.actions.getSourceReConnectData('github'); expect(http.get).toHaveBeenCalledWith( - '/api/workplace_search/org/sources/github/reauth_prepare', + '/internal/workplace_search/org/sources/github/reauth_prepare', { query: { kibana_host: '', @@ -523,7 +527,7 @@ describe('AddSourceLogic', () => { AddSourceLogic.actions.getPreContentSourceConfigData(); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/org/pre_sources/123'); + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/org/pre_sources/123'); await nextTick(); expect(setPreContentSourceConfigDataSpy).toHaveBeenCalledWith(config); }); @@ -568,7 +572,7 @@ describe('AddSourceLogic', () => { expect( http.put ).toHaveBeenCalledWith( - `/api/workplace_search/org/settings/connectors/${sourceConfigData.serviceType}`, + `/internal/workplace_search/org/settings/connectors/${sourceConfigData.serviceType}`, { body: JSON.stringify(params) } ); @@ -591,9 +595,12 @@ describe('AddSourceLogic', () => { consumer_key: sourceConfigData.configuredFields?.consumerKey, }; - expect(http.post).toHaveBeenCalledWith('/api/workplace_search/org/settings/connectors', { - body: JSON.stringify(createParams), - }); + expect(http.post).toHaveBeenCalledWith( + '/internal/workplace_search/org/settings/connectors', + { + body: JSON.stringify(createParams), + } + ); }); it('handles error', async () => { @@ -644,7 +651,7 @@ describe('AddSourceLogic', () => { expect(clearFlashMessages).toHaveBeenCalled(); expect(AddSourceLogic.values.buttonLoading).toEqual(true); - expect(http.post).toHaveBeenCalledWith('/api/workplace_search/org/create_source', { + expect(http.post).toHaveBeenCalledWith('/internal/workplace_search/org/create_source', { body: JSON.stringify({ ...params }), }); await nextTick(); @@ -677,16 +684,19 @@ describe('AddSourceLogic', () => { AddSourceLogic.actions.getSourceConnectData('github', jest.fn()); - expect( - http.get - ).toHaveBeenCalledWith('/api/workplace_search/account/sources/github/prepare', { query }); + expect(http.get).toHaveBeenCalledWith( + '/internal/workplace_search/account/sources/github/prepare', + { + query, + } + ); }); it('getSourceReConnectData', () => { AddSourceLogic.actions.getSourceReConnectData('123'); expect(http.get).toHaveBeenCalledWith( - '/api/workplace_search/account/sources/123/reauth_prepare', + '/internal/workplace_search/account/sources/123/reauth_prepare', { query: { kibana_host: '', @@ -699,13 +709,13 @@ describe('AddSourceLogic', () => { mount({ preContentSourceId: '123' }); AddSourceLogic.actions.getPreContentSourceConfigData(); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/account/pre_sources/123'); + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/account/pre_sources/123'); }); it('createContentSource', () => { AddSourceLogic.actions.createContentSource('github', jest.fn()); - expect(http.post).toHaveBeenCalledWith('/api/workplace_search/account/create_source', { + expect(http.post).toHaveBeenCalledWith('/internal/workplace_search/account/create_source', { body: JSON.stringify({ service_type: 'github' }), }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.ts index 0aa7cbcf5f1c7..e63e58adb38e2 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.ts @@ -393,7 +393,7 @@ export const AddSourceLogic = kea { - const route = `/api/workplace_search/org/settings/connectors/${serviceType}`; + const route = `/internal/workplace_search/org/settings/connectors/${serviceType}`; try { const response = await HttpLogic.values.http.get(route); @@ -408,8 +408,8 @@ export const AddSourceLogic = kea { const { isOrganization } = AppLogic.values; const route = isOrganization - ? `/api/workplace_search/org/sources/${sourceId}/reauth_prepare` - : `/api/workplace_search/account/sources/${sourceId}/reauth_prepare`; + ? `/internal/workplace_search/org/sources/${sourceId}/reauth_prepare` + : `/internal/workplace_search/account/sources/${sourceId}/reauth_prepare`; const query = { kibana_host: kibanaHost, @@ -449,8 +449,8 @@ export const AddSourceLogic = kea = ({ values={{ securityLink: ( - enable private source connection + {CONFIG_COMPLETED_PRIVATE_SOURCES_DISABLED_LINK} ), }} diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configuration_intro.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configuration_intro.tsx index d17e8b84efb2b..15941f14d5ab1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configuration_intro.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configuration_intro.tsx @@ -28,6 +28,7 @@ import { CONFIG_INTRO_STEPS_TEXT, CONFIG_INTRO_STEP1_HEADING, CONFIG_INTRO_STEP1_TEXT, + CONFIG_INTRO_STEP1_BADGE, CONFIG_INTRO_STEP2_HEADING, CONFIG_INTRO_STEP2_TITLE, CONFIG_INTRO_STEP2_TEXT, @@ -108,7 +109,9 @@ export const ConfigurationIntro: React.FC = ({ id="xpack.enterpriseSearch.workplaceSearch.contentSource.configIntro.step1.title" defaultMessage="Configure an OAuth application {badge}" values={{ - badge: One-Time Action, + badge: ( + {CONFIG_INTRO_STEP1_BADGE} + ), }} /> diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configure_custom.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configure_custom.tsx index b142ddcf4937e..1529875e66af5 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configure_custom.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configure_custom.tsx @@ -22,8 +22,10 @@ import { FormattedMessage } from '@kbn/i18n/react'; import { CUSTOM_SOURCE_DOCS_URL } from '../../../../routes'; +import { SOURCE_NAME_LABEL } from '../../constants'; + import { AddSourceLogic } from './add_source_logic'; -import { CONFIG_CUSTOM_BUTTON } from './constants'; +import { CONFIG_CUSTOM_BUTTON, CONFIG_CUSTOM_LINK_TEXT } from './constants'; interface ConfigureCustomProps { header: React.ReactNode; @@ -57,12 +59,12 @@ export const ConfigureCustom: React.FC = ({

{helpText}

- Read the documentation + {CONFIG_CUSTOM_LINK_TEXT} ), }} @@ -70,7 +72,7 @@ export const ConfigureCustom: React.FC = ({

- + = ({ - {SOURCE_FEATURES_EXPLORE_BUTTON} + {EXPLORE_PLATINUM_FEATURES_LINK}
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/constants.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/constants.ts index 2bf185ee048bd..a2e6de8d9c7f5 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/constants.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/constants.ts @@ -101,6 +101,13 @@ export const AVAILABLE_SOURCE_CUSTOM_SOURCE_BUTTON = i18n.translate( } ); +export const CONFIG_COMPLETED_PRIVATE_SOURCES_DISABLED_LINK = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.configCompleted.privateDisabled.link', + { + defaultMessage: 'enable private source connection', + } +); + export const CONFIG_COMPLETED_PRIVATE_SOURCES_DOCS_LINK = i18n.translate( 'xpack.enterpriseSearch.workplaceSearch.contentSource.configCompleted.privateDisabled.button', { @@ -136,6 +143,13 @@ export const CONFIG_INTRO_STEP1_HEADING = i18n.translate( } ); +export const CONFIG_INTRO_STEP1_BADGE = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.configIntro.step1.badge', + { + defaultMessage: 'One-Time Action', + } +); + export const CONFIG_INTRO_STEP1_TEXT = i18n.translate( 'xpack.enterpriseSearch.workplaceSearch.contentSource.configIntro.step1.text', { @@ -173,6 +187,13 @@ export const CONFIG_CUSTOM_BUTTON = i18n.translate( } ); +export const CONFIG_CUSTOM_LINK_TEXT = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.configCustom.docs.link.text', + { + defaultMessage: 'Read the documentation', + } +); + export const CONFIG_OAUTH_LABEL = i18n.translate( 'xpack.enterpriseSearch.workplaceSearch.contentSource.configOauth.label', { @@ -293,6 +314,13 @@ export const SAVE_CUSTOM_VISUAL_WALKTHROUGH_TITLE = i18n.translate( } ); +export const SAVE_CUSTOM_VISUAL_WALKTHROUGH_LINK = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.saveCustom.visualWalkthrough.link', + { + defaultMessage: 'Check out the documentation', + } +); + export const SAVE_CUSTOM_STYLING_RESULTS_TITLE = i18n.translate( 'xpack.enterpriseSearch.workplaceSearch.contentSource.saveCustom.stylingResults.title', { @@ -300,6 +328,13 @@ export const SAVE_CUSTOM_STYLING_RESULTS_TITLE = i18n.translate( } ); +export const SAVE_CUSTOM_STYLING_RESULTS_LINK = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.saveCustom.stylingResults.link', + { + defaultMessage: 'Display Settings', + } +); + export const SAVE_CUSTOM_DOC_PERMISSIONS_TITLE = i18n.translate( 'xpack.enterpriseSearch.workplaceSearch.contentSource.saveCustom.docPermissions.title', { @@ -307,6 +342,13 @@ export const SAVE_CUSTOM_DOC_PERMISSIONS_TITLE = i18n.translate( } ); +export const SAVE_CUSTOM_DOC_PERMISSIONS_LINK = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.saveCustom.docPermissions.link', + { + defaultMessage: 'Document-level permissions', + } +); + export const INCLUDED_FEATURES_TITLE = i18n.translate( 'xpack.enterpriseSearch.workplaceSearch.contentSource.includedFeaturesTitle', { @@ -314,31 +356,80 @@ export const INCLUDED_FEATURES_TITLE = i18n.translate( } ); -export const SOURCE_FEATURES_SEARCHABLE = i18n.translate( - 'xpack.enterpriseSearch.workplaceSearch.contentSource.sourceFeatures.searchable.text', +export const SOURCE_FEATURES_SYNC_FREQUENCY_TITLE = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.sourceFeatures.syncFrequency.title', + { + defaultMessage: 'Syncs every 2 hours', + } +); + +export const SOURCE_FEATURES_SYNC_FREQUENCY_TIME = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.sourceFeatures.syncFrequency.time', + { + defaultMessage: '2 hours', + } +); + +export const SOURCE_FEATURES_SYNCED_ITEMS_TITLE = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.sourceFeatures.syncedItems.title', + { + defaultMessage: 'Synced items', + } +); + +export const SOURCE_FEATURES_SEARCHABLE_TITLE = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.sourceFeatures.searchable.title', + { + defaultMessage: 'Searchable content', + } +); + +export const SOURCE_FEATURES_SEARCHABLE_DESCRIPTION = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.sourceFeatures.searchable.description', { defaultMessage: 'The following items are searchable:', } ); -export const SOURCE_FEATURES_REMOTE_FEATURE = i18n.translate( - 'xpack.enterpriseSearch.workplaceSearch.contentSource.sourceFeatures.remote.text', +export const SOURCE_FEATURES_REMOTE_FEATURE_TITLE = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.sourceFeatures.remote.title', + { + defaultMessage: 'Always up-to-date', + } +); + +export const SOURCE_FEATURES_REMOTE_FEATURE_DESCRIPTION = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.sourceFeatures.remote.description', { defaultMessage: 'Message data and other information is searchable in real-time from the Workplace Search experience.', } ); -export const SOURCE_FEATURES_PRIVATE_FEATURE = i18n.translate( - 'xpack.enterpriseSearch.workplaceSearch.contentSource.sourceFeatures.private.text', +export const SOURCE_FEATURES_PRIVATE_FEATURE_TITLE = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.sourceFeatures.private.title', + { + defaultMessage: 'Always private', + } +); + +export const SOURCE_FEATURES_PRIVATE_FEATURE_DESCRIPTION = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.sourceFeatures.private.description', { defaultMessage: 'Results returned are specific and relevant to you. Connecting this source does not expose your personal data to other search users - only you.', } ); -export const SOURCE_FEATURES_GLOBAL_ACCESS_PERMISSIONS_FEATURE = i18n.translate( - 'xpack.enterpriseSearch.workplaceSearch.contentSource.sourceFeatures.globalAccessPermissions.text', +export const SOURCE_FEATURES_GLOBAL_ACCESS_PERMISSIONS_FEATURE_TITLE = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.sourceFeatures.globalAccessPermissions.title', + { + defaultMessage: 'Global access permissions', + } +); + +export const SOURCE_FEATURES_GLOBAL_ACCESS_PERMISSIONS_FEATURE_DESCRIPTION = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSource.sourceFeatures.globalAccessPermissions.description', { defaultMessage: 'All documents accessible to the connecting service user will be synchronized and made available to the organization’s users, or group’s users. Documents are immediately available for search', @@ -360,12 +451,6 @@ export const SOURCE_FEATURES_DOCUMENT_LEVEL_PERMISSIONS_FEATURE = i18n.translate } ); -export const SOURCE_FEATURES_EXPLORE_BUTTON = i18n.translate( - 'xpack.enterpriseSearch.workplaceSearch.contentSource.sourceFeatures.explore.button', - { - defaultMessage: 'Explore Platinum features', - } -); export const CONNECT_WHICH_OPTION_LINK = i18n.translate( 'xpack.enterpriseSearch.workplaceSearch.contentSource.connect.whichOption.link', { diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/save_custom.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/save_custom.tsx index bbece2f68c717..dbec5d1808167 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/save_custom.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/save_custom.tsx @@ -46,8 +46,11 @@ import { SAVE_CUSTOM_API_KEYS_TITLE, SAVE_CUSTOM_API_KEYS_BODY, SAVE_CUSTOM_VISUAL_WALKTHROUGH_TITLE, + SAVE_CUSTOM_VISUAL_WALKTHROUGH_LINK, SAVE_CUSTOM_STYLING_RESULTS_TITLE, + SAVE_CUSTOM_STYLING_RESULTS_LINK, SAVE_CUSTOM_DOC_PERMISSIONS_TITLE, + SAVE_CUSTOM_DOC_PERMISSIONS_LINK, } from './constants'; interface SaveCustomProps { @@ -140,7 +143,7 @@ export const SaveCustom: React.FC = ({ values={{ link: ( - Check out the documentation + {SAVE_CUSTOM_VISUAL_WALKTHROUGH_LINK} ), }} @@ -168,7 +171,7 @@ export const SaveCustom: React.FC = ({ isOrganization )} > - Display Settings + {SAVE_CUSTOM_STYLING_RESULTS_LINK} ), }} @@ -193,7 +196,7 @@ export const SaveCustom: React.FC = ({ values={{ link: ( - Document-level permissions + {SAVE_CUSTOM_DOC_PERMISSIONS_LINK} ), }} diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/source_features.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/source_features.tsx index 02856320aa535..940cb9cb7372a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/source_features.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/source_features.tsx @@ -26,10 +26,17 @@ import { Features, FeatureIds } from '../../../../types'; import { INCLUDED_FEATURES_TITLE, - SOURCE_FEATURES_SEARCHABLE, - SOURCE_FEATURES_REMOTE_FEATURE, - SOURCE_FEATURES_PRIVATE_FEATURE, - SOURCE_FEATURES_GLOBAL_ACCESS_PERMISSIONS_FEATURE, + SOURCE_FEATURES_SYNC_FREQUENCY_TITLE, + SOURCE_FEATURES_SYNC_FREQUENCY_TIME, + SOURCE_FEATURES_SYNCED_ITEMS_TITLE, + SOURCE_FEATURES_SEARCHABLE_TITLE, + SOURCE_FEATURES_SEARCHABLE_DESCRIPTION, + SOURCE_FEATURES_REMOTE_FEATURE_TITLE, + SOURCE_FEATURES_REMOTE_FEATURE_DESCRIPTION, + SOURCE_FEATURES_PRIVATE_FEATURE_TITLE, + SOURCE_FEATURES_PRIVATE_FEATURE_DESCRIPTION, + SOURCE_FEATURES_GLOBAL_ACCESS_PERMISSIONS_FEATURE_TITLE, + SOURCE_FEATURES_GLOBAL_ACCESS_PERMISSIONS_FEATURE_DESCRIPTION, } from './constants'; interface ConnectInstanceProps { @@ -76,7 +83,7 @@ export const SourceFeatures: React.FC = ({ features, objTy }; const SyncFrequencyFeature = ( - +

= ({ features, objTy defaultMessage="This source gets new content from {name} every {duration} (following the initial sync)." values={{ name, - duration: 2 hours, + duration: {SOURCE_FEATURES_SYNC_FREQUENCY_TIME}, }} />

@@ -93,10 +100,10 @@ export const SourceFeatures: React.FC = ({ features, objTy ); const SyncedItemsFeature = ( - + <> -

{SOURCE_FEATURES_SEARCHABLE}

+

{SOURCE_FEATURES_SEARCHABLE_DESCRIPTION}

@@ -111,10 +118,10 @@ export const SourceFeatures: React.FC = ({ features, objTy ); const SearchableContentFeature = ( - + -

{SOURCE_FEATURES_SEARCHABLE}

+

{SOURCE_FEATURES_SEARCHABLE_DESCRIPTION}

    @@ -127,25 +134,25 @@ export const SourceFeatures: React.FC = ({ features, objTy ); const RemoteFeature = ( - + -

    {SOURCE_FEATURES_REMOTE_FEATURE}

    +

    {SOURCE_FEATURES_REMOTE_FEATURE_DESCRIPTION}

    ); const PrivateFeature = ( - + -

    {SOURCE_FEATURES_PRIVATE_FEATURE}

    +

    {SOURCE_FEATURES_PRIVATE_FEATURE_DESCRIPTION}

    ); const GlobalAccessPermissionsFeature = ( - + -

    {SOURCE_FEATURES_GLOBAL_ACCESS_PERMISSIONS_FEATURE}

    +

    {SOURCE_FEATURES_GLOBAL_ACCESS_PERMISSIONS_FEATURE_DESCRIPTION}

    ); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/constants.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/constants.ts index d6ee25da6e2b1..bd86eb31005af 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/constants.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/constants.ts @@ -80,6 +80,55 @@ export const TITLE_LABEL = i18n.translate( } ); +export const URL_LABEL = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSources.displaySettings.url.label', + { + defaultMessage: 'URL', + } +); + +export const COLOR_LABEL = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSources.displaySettings.color.label', + { + defaultMessage: 'Color', + } +); + +export const TYPE_LABEL = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSources.displaySettings.type.label', + { + defaultMessage: 'Type', + } +); + +export const MEDIA_TYPE_LABEL = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSources.displaySettings.mediaType.label', + { + defaultMessage: 'Media Type', + } +); + +export const CREATED_BY_LABEL = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSources.displaySettings.createdBy.label', + { + defaultMessage: 'Created By', + } +); + +export const UPDATED_BY_LABEL = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSources.displaySettings.updatedBy.label', + { + defaultMessage: 'Updated By', + } +); + +export const OPTIONAL_AREA_TEXT = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.contentSources.displaySettings.optionalArea.text', + { + defaultMessage: 'This area is optional', + } +); + export const EMPTY_FIELDS_DESCRIPTION = i18n.translate( 'xpack.enterpriseSearch.workplaceSearch.contentSources.displaySettings.emptyFields.description', { diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/display_settings_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/display_settings_logic.test.ts index ae497b1e56a09..62e305f72365d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/display_settings_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/display_settings_logic.test.ts @@ -377,7 +377,7 @@ describe('DisplaySettingsLogic', () => { DisplaySettingsLogic.actions.initializeDisplaySettings(); expect(http.get).toHaveBeenCalledWith( - '/api/workplace_search/org/sources/source123/display_settings/config' + '/internal/workplace_search/org/sources/source123/display_settings/config' ); await nextTick(); expect(onInitializeDisplaySettingsSpy).toHaveBeenCalledWith({ @@ -397,7 +397,7 @@ describe('DisplaySettingsLogic', () => { DisplaySettingsLogic.actions.initializeDisplaySettings(); expect(http.get).toHaveBeenCalledWith( - '/api/workplace_search/account/sources/source123/display_settings/config' + '/internal/workplace_search/account/sources/source123/display_settings/config' ); await nextTick(); expect(onInitializeDisplaySettingsSpy).toHaveBeenCalledWith({ diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/display_settings_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/display_settings_logic.ts index 28d10b1566b6c..2d7667e08d8f8 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/display_settings_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/display_settings_logic.ts @@ -377,8 +377,8 @@ export const DisplaySettingsLogic = kea< } = SourceLogic.values; const route = isOrganization - ? `/api/workplace_search/org/sources/${sourceId}/display_settings/config` - : `/api/workplace_search/account/sources/${sourceId}/display_settings/config`; + ? `/internal/workplace_search/org/sources/${sourceId}/display_settings/config` + : `/internal/workplace_search/account/sources/${sourceId}/display_settings/config`; try { const response = await HttpLogic.values.http.get(route); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/field_editor_modal.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/field_editor_modal.tsx index 717eebf5cf873..132adedb829ac 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/field_editor_modal.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/display_settings/field_editor_modal.tsx @@ -23,7 +23,13 @@ import { EuiSelect, } from '@elastic/eui'; -import { CANCEL_BUTTON, FIELD_LABEL, UPDATE_LABEL, ADD_LABEL } from '../../../../constants'; +import { + CANCEL_BUTTON, + FIELD_LABEL, + LABEL_LABEL, + UPDATE_LABEL, + ADD_LABEL, +} from '../../../../constants'; import { DisplaySettingsLogic } from './display_settings_logic'; @@ -67,7 +73,7 @@ export const FieldEditorModal: React.FC = () => { - + { onChange={(e) => setName(e.target.value)} /> - + { { onChange={(e) => setTitleField(e.target.value)} /> - + { onChange={(e) => setUrlField(e.target.value)} /> - + { /> { /> { /> { /> {

    {CONTENT_SUMMARY_TITLE}

    - {!summary && } + {!summary && } {!!summary && (totalDocuments === 0 ? ( emptyState @@ -233,22 +235,18 @@ export const Overview: React.FC = () => {
    {GROUP_ACCESS_TITLE}
    - - {groups.map((group, index) => ( - - + + {groups.map((group, index) => ( + - - {group.name} - - - - ))} - + /> + ))} + + ); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/schema/schema_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/schema/schema_logic.test.ts index 142e50d52c9db..549ffe0546d7c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/schema/schema_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/schema/schema_logic.test.ts @@ -208,7 +208,7 @@ describe('SchemaLogic', () => { SchemaLogic.actions.initializeSchema(); expect(http.get).toHaveBeenCalledWith( - '/api/workplace_search/org/sources/source123/schemas' + '/internal/workplace_search/org/sources/source123/schemas' ); await nextTick(); expect(onInitializeSchemaSpy).toHaveBeenCalledWith(serverResponse); @@ -222,7 +222,7 @@ describe('SchemaLogic', () => { SchemaLogic.actions.initializeSchema(); expect(http.get).toHaveBeenCalledWith( - '/api/workplace_search/account/sources/source123/schemas' + '/internal/workplace_search/account/sources/source123/schemas' ); await nextTick(); expect(onInitializeSchemaSpy).toHaveBeenCalledWith(serverResponse); @@ -254,12 +254,12 @@ describe('SchemaLogic', () => { ); expect(http.get).toHaveBeenCalledWith( - '/api/workplace_search/org/sources/source123/schemas' + '/internal/workplace_search/org/sources/source123/schemas' ); await initPromise; expect(http.get).toHaveBeenCalledWith( - '/api/workplace_search/org/sources/source123/reindex_job/123' + '/internal/workplace_search/org/sources/source123/reindex_job/123' ); await promise; @@ -285,12 +285,12 @@ describe('SchemaLogic', () => { ); expect(http.get).toHaveBeenCalledWith( - '/api/workplace_search/account/sources/source123/schemas' + '/internal/workplace_search/account/sources/source123/schemas' ); await initPromise; expect(http.get).toHaveBeenCalledWith( - '/api/workplace_search/account/sources/source123/reindex_job/123' + '/internal/workplace_search/account/sources/source123/reindex_job/123' ); await promise; @@ -365,7 +365,7 @@ describe('SchemaLogic', () => { SchemaLogic.actions.setServerField(schema, ADD); expect(http.post).toHaveBeenCalledWith( - '/api/workplace_search/org/sources/source123/schemas', + '/internal/workplace_search/org/sources/source123/schemas', { body: JSON.stringify({ ...schema }), } @@ -383,7 +383,7 @@ describe('SchemaLogic', () => { SchemaLogic.actions.setServerField(schema, ADD); expect(http.post).toHaveBeenCalledWith( - '/api/workplace_search/account/sources/source123/schemas', + '/internal/workplace_search/account/sources/source123/schemas', { body: JSON.stringify({ ...schema }), } @@ -424,7 +424,7 @@ describe('SchemaLogic', () => { SchemaLogic.actions.setServerField(schema, UPDATE); expect(http.post).toHaveBeenCalledWith( - '/api/workplace_search/org/sources/source123/schemas', + '/internal/workplace_search/org/sources/source123/schemas', { body: JSON.stringify({ ...schema }), } @@ -442,7 +442,7 @@ describe('SchemaLogic', () => { SchemaLogic.actions.setServerField(schema, UPDATE); expect(http.post).toHaveBeenCalledWith( - '/api/workplace_search/account/sources/source123/schemas', + '/internal/workplace_search/account/sources/source123/schemas', { body: JSON.stringify({ ...schema }), } diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/schema/schema_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/schema/schema_logic.ts index 114d63a3ce142..173f5df162caa 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/schema/schema_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/schema/schema_logic.ts @@ -271,8 +271,8 @@ export const SchemaLogic = kea>({ } = SourceLogic.values; const route = isOrganization - ? `/api/workplace_search/org/sources/${sourceId}/schemas` - : `/api/workplace_search/account/sources/${sourceId}/schemas`; + ? `/internal/workplace_search/org/sources/${sourceId}/schemas` + : `/internal/workplace_search/account/sources/${sourceId}/schemas`; try { const response = await http.get(route); @@ -285,8 +285,8 @@ export const SchemaLogic = kea>({ const { isOrganization } = AppLogic.values; const { http } = HttpLogic.values; const route = isOrganization - ? `/api/workplace_search/org/sources/${sourceId}/reindex_job/${activeReindexJobId}` - : `/api/workplace_search/account/sources/${sourceId}/reindex_job/${activeReindexJobId}`; + ? `/internal/workplace_search/org/sources/${sourceId}/reindex_job/${activeReindexJobId}` + : `/internal/workplace_search/account/sources/${sourceId}/reindex_job/${activeReindexJobId}`; try { await actions.initializeSchema(); @@ -329,8 +329,8 @@ export const SchemaLogic = kea>({ const { sourceId } = values; const successMessage = isAdding ? SCHEMA_FIELD_ADDED_MESSAGE : SCHEMA_UPDATED_MESSAGE; const route = isOrganization - ? `/api/workplace_search/org/sources/${sourceId}/schemas` - : `/api/workplace_search/account/sources/${sourceId}/schemas`; + ? `/internal/workplace_search/org/sources/${sourceId}/schemas` + : `/internal/workplace_search/account/sources/${sourceId}/schemas`; const emptyReindexJob = { percentageComplete: 100, diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_content.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_content.tsx index a97cc85cb822a..78d4d36cf0995 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_content.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_content.tsx @@ -46,6 +46,8 @@ import { GO_BUTTON, RESET_BUTTON, SOURCE_CONTENT_TITLE, + SEARCH_CONTENT_PLACEHOLDER, + FILTER_CONTENT_PLACEHOLDER, CONTENT_LOADING_TEXT, } from '../constants'; import { SourceLogic } from '../source_logic'; @@ -197,13 +199,9 @@ export const SourceContent: React.FC = () => { { const wrapper = shallow(); expect(wrapper.find('[data-test-subj="DownloadDiagnosticsButton"]').prop('href')).toEqual( - '/api/workplace_search/org/sources/123/download_diagnostics' + '/internal/workplace_search/org/sources/123/download_diagnostics' ); }); @@ -200,7 +200,7 @@ describe('SourceSettings', () => { const wrapper = shallow(); expect(wrapper.find('[data-test-subj="DownloadDiagnosticsButton"]').prop('href')).toEqual( - '/api/workplace_search/account/sources/123/download_diagnostics' + '/internal/workplace_search/account/sources/123/download_diagnostics' ); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_settings.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_settings.tsx index d6f16db4d5129..f723391a01cea 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_settings.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_settings.tsx @@ -119,8 +119,10 @@ export const SourceSettings: React.FC = () => { const { clientId, clientSecret, publicKey, consumerKey, baseUrl } = configuredFields || {}; const diagnosticsPath = isOrganization - ? http.basePath.prepend(`/api/workplace_search/org/sources/${id}/download_diagnostics`) - : http.basePath.prepend(`/api/workplace_search/account/sources/${id}/download_diagnostics`); + ? http.basePath.prepend(`/internal/workplace_search/org/sources/${id}/download_diagnostics`) + : http.basePath.prepend( + `/internal/workplace_search/account/sources/${id}/download_diagnostics` + ); const handleNameChange = (e: ChangeEvent) => setValue(e.target.value); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/constants.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/constants.ts index 42969169d7f71..55e7f5938a305 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/constants.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/constants.ts @@ -21,6 +21,13 @@ export const CONTENT_SUMMARY_TITLE = i18n.translate( } ); +export const CONTENT_SUMMARY_LOADING_TEXT = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.sources.contentSummaryLoading.text', + { + defaultMessage: 'Loading summary details...', + } +); + export const CONTENT_TYPE_HEADER = i18n.translate( 'xpack.enterpriseSearch.workplaceSearch.sources.contentType.header', { @@ -222,6 +229,20 @@ export const SOURCE_CONTENT_TITLE = i18n.translate( } ); +export const SEARCH_CONTENT_PLACEHOLDER = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.sources.sourceContent.searchBar.search.placeholder', + { + defaultMessage: 'Search content...', + } +); + +export const FILTER_CONTENT_PLACEHOLDER = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.sources.sourceContent.searchBar.filter.placeholder', + { + defaultMessage: 'Filter content...', + } +); + export const CONTENT_LOADING_TEXT = i18n.translate( 'xpack.enterpriseSearch.workplaceSearch.sources.contentLoading.text', { diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_data.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_data.tsx index 4a3dbbc31faf3..c303190651f57 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_data.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_data.tsx @@ -105,7 +105,7 @@ export const staticSourceData = [ hasOauthRedirect: true, needsBaseUrl: true, documentationUrl: CONFLUENCE_DOCS_URL, - applicationPortalUrl: 'https://developer.atlassian.com/apps/', + applicationPortalUrl: 'https://developer.atlassian.com/console/myapps/', }, objTypes: [ SOURCE_OBJ_TYPES.PAGES, @@ -320,11 +320,11 @@ export const staticSourceData = [ addPath: ADD_JIRA_PATH, editPath: EDIT_JIRA_PATH, configuration: { - isPublicKey: true, + isPublicKey: false, hasOauthRedirect: true, - needsBaseUrl: false, + needsBaseUrl: true, documentationUrl: JIRA_DOCS_URL, - applicationPortalUrl: '', + applicationPortalUrl: 'https://developer.atlassian.com/console/myapps/', }, objTypes: [ SOURCE_OBJ_TYPES.EPICS, diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_logic.test.ts index adeddb08dcb79..94ec730ef256c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_logic.test.ts @@ -136,7 +136,7 @@ describe('SourceLogic', () => { http.get.mockReturnValue(promise); SourceLogic.actions.initializeSource(contentSource.id); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/org/sources/123'); + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/org/sources/123'); await promise; expect(onInitializeSourceSpy).toHaveBeenCalledWith(contentSource); }); @@ -149,7 +149,7 @@ describe('SourceLogic', () => { http.get.mockReturnValue(promise); SourceLogic.actions.initializeSource(contentSource.id); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/account/sources/123'); + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/account/sources/123'); await promise; expect(onInitializeSourceSpy).toHaveBeenCalledWith(contentSource); }); @@ -168,7 +168,7 @@ describe('SourceLogic', () => { http.get.mockReturnValue(promise); SourceLogic.actions.initializeSource(contentSource.id); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/account/sources/123'); + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/account/sources/123'); await promise; expect(initializeFederatedSummarySpy).toHaveBeenCalledWith(contentSource.id); }); @@ -233,7 +233,7 @@ describe('SourceLogic', () => { SourceLogic.actions.initializeFederatedSummary(contentSource.id); expect(http.get).toHaveBeenCalledWith( - '/api/workplace_search/account/sources/123/federated_summary' + '/internal/workplace_search/account/sources/123/federated_summary' ); await promise; expect(onUpdateSummarySpy).toHaveBeenCalledWith(contentSource.summary); @@ -270,9 +270,12 @@ describe('SourceLogic', () => { http.post.mockReturnValue(promise); await searchContentSourceDocuments({ sourceId: contentSource.id }, mockBreakpoint); - expect(http.post).toHaveBeenCalledWith('/api/workplace_search/org/sources/123/documents', { - body: JSON.stringify({ query: '', page: meta.page }), - }); + expect(http.post).toHaveBeenCalledWith( + '/internal/workplace_search/org/sources/123/documents', + { + body: JSON.stringify({ query: '', page: meta.page }), + } + ); await promise; expect(actions.setSearchResults).toHaveBeenCalledWith(searchServerResponse); @@ -286,7 +289,7 @@ describe('SourceLogic', () => { SourceLogic.actions.searchContentSourceDocuments(contentSource.id); await searchContentSourceDocuments({ sourceId: contentSource.id }, mockBreakpoint); expect(http.post).toHaveBeenCalledWith( - '/api/workplace_search/account/sources/123/documents', + '/internal/workplace_search/account/sources/123/documents', { body: JSON.stringify({ query: '', page: meta.page }), } @@ -322,9 +325,12 @@ describe('SourceLogic', () => { http.patch.mockReturnValue(promise); SourceLogic.actions.updateContentSource(contentSource.id, contentSource); - expect(http.patch).toHaveBeenCalledWith('/api/workplace_search/org/sources/123/settings', { - body: JSON.stringify({ content_source: contentSource }), - }); + expect(http.patch).toHaveBeenCalledWith( + '/internal/workplace_search/org/sources/123/settings', + { + body: JSON.stringify({ content_source: contentSource }), + } + ); await promise; expect(onUpdateSourceNameSpy).toHaveBeenCalledWith(contentSource.name); }); @@ -337,9 +343,12 @@ describe('SourceLogic', () => { http.patch.mockReturnValue(promise); SourceLogic.actions.updateContentSource(contentSource.id, { indexing: { enabled: true } }); - expect(http.patch).toHaveBeenCalledWith('/api/workplace_search/org/sources/123/settings', { - body: JSON.stringify({ content_source: { indexing: { enabled: true } } }), - }); + expect(http.patch).toHaveBeenCalledWith( + '/internal/workplace_search/org/sources/123/settings', + { + body: JSON.stringify({ content_source: { indexing: { enabled: true } } }), + } + ); await promise; expect(onUpdateSourceNameSpy).not.toHaveBeenCalledWith(contentSource.name); }); @@ -353,7 +362,7 @@ describe('SourceLogic', () => { SourceLogic.actions.updateContentSource(contentSource.id, contentSource); expect(http.patch).toHaveBeenCalledWith( - '/api/workplace_search/account/sources/123/settings', + '/internal/workplace_search/account/sources/123/settings', { body: JSON.stringify({ content_source: contentSource }), } @@ -388,7 +397,7 @@ describe('SourceLogic', () => { SourceLogic.actions.removeContentSource(contentSource.id); expect(clearFlashMessages).toHaveBeenCalled(); - expect(http.delete).toHaveBeenCalledWith('/api/workplace_search/org/sources/123'); + expect(http.delete).toHaveBeenCalledWith('/internal/workplace_search/org/sources/123'); await promise; expect(flashSuccessToast).toHaveBeenCalled(); expect(setButtonNotLoadingSpy).toHaveBeenCalled(); @@ -403,7 +412,7 @@ describe('SourceLogic', () => { SourceLogic.actions.removeContentSource(contentSource.id); expect(clearFlashMessages).toHaveBeenCalled(); - expect(http.delete).toHaveBeenCalledWith('/api/workplace_search/account/sources/123'); + expect(http.delete).toHaveBeenCalledWith('/internal/workplace_search/account/sources/123'); await promise; expect(setButtonNotLoadingSpy).toHaveBeenCalled(); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_logic.ts index 6040f319357d9..5c947b68f2333 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_logic.ts @@ -153,8 +153,8 @@ export const SourceLogic = kea>({ initializeSource: async ({ sourceId }) => { const { isOrganization } = AppLogic.values; const route = isOrganization - ? `/api/workplace_search/org/sources/${sourceId}` - : `/api/workplace_search/account/sources/${sourceId}`; + ? `/internal/workplace_search/org/sources/${sourceId}` + : `/internal/workplace_search/account/sources/${sourceId}`; try { const response = await HttpLogic.values.http.get(route); @@ -182,7 +182,7 @@ export const SourceLogic = kea>({ } }, initializeFederatedSummary: async ({ sourceId }) => { - const route = `/api/workplace_search/account/sources/${sourceId}/federated_summary`; + const route = `/internal/workplace_search/account/sources/${sourceId}/federated_summary`; try { const response = await HttpLogic.values.http.get(route); actions.onUpdateSummary(response.summary); @@ -195,8 +195,8 @@ export const SourceLogic = kea>({ const { isOrganization } = AppLogic.values; const route = isOrganization - ? `/api/workplace_search/org/sources/${sourceId}/documents` - : `/api/workplace_search/account/sources/${sourceId}/documents`; + ? `/internal/workplace_search/org/sources/${sourceId}/documents` + : `/internal/workplace_search/account/sources/${sourceId}/documents`; const { contentFilterValue: query, @@ -215,8 +215,8 @@ export const SourceLogic = kea>({ updateContentSource: async ({ sourceId, source }) => { const { isOrganization } = AppLogic.values; const route = isOrganization - ? `/api/workplace_search/org/sources/${sourceId}/settings` - : `/api/workplace_search/account/sources/${sourceId}/settings`; + ? `/internal/workplace_search/org/sources/${sourceId}/settings` + : `/internal/workplace_search/account/sources/${sourceId}/settings`; try { const response = await HttpLogic.values.http.patch(route, { @@ -233,8 +233,8 @@ export const SourceLogic = kea>({ clearFlashMessages(); const { isOrganization } = AppLogic.values; const route = isOrganization - ? `/api/workplace_search/org/sources/${sourceId}` - : `/api/workplace_search/account/sources/${sourceId}`; + ? `/internal/workplace_search/org/sources/${sourceId}` + : `/internal/workplace_search/account/sources/${sourceId}`; try { const response = await HttpLogic.values.http.delete(route); 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 bc18fade742aa..53f16a303f70a 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 @@ -164,7 +164,7 @@ describe('SourcesLogic', () => { http.get.mockReturnValue(promise); SourcesLogic.actions.initializeSources(); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/org/sources'); + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/org/sources'); await promise; expect(pollForSourceStatusChangesSpy).toHaveBeenCalled(); expect(onInitializeSourcesSpy).toHaveBeenCalledWith(contentSources); @@ -176,7 +176,7 @@ describe('SourcesLogic', () => { http.get.mockReturnValue(promise); SourcesLogic.actions.initializeSources(); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/account/sources'); + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/account/sources'); }); it('handles error', async () => { @@ -205,9 +205,12 @@ describe('SourcesLogic', () => { http.put.mockReturnValue(promise); SourcesLogic.actions.setSourceSearchability(id, true); - expect(http.put).toHaveBeenCalledWith('/api/workplace_search/org/sources/123/searchable', { - body: JSON.stringify({ searchable: true }), - }); + expect(http.put).toHaveBeenCalledWith( + '/internal/workplace_search/org/sources/123/searchable', + { + body: JSON.stringify({ searchable: true }), + } + ); await promise; expect(onSetSearchability).toHaveBeenCalledWith(id, true); }); @@ -219,7 +222,7 @@ describe('SourcesLogic', () => { SourcesLogic.actions.setSourceSearchability(id, true); expect(http.put).toHaveBeenCalledWith( - '/api/workplace_search/account/sources/123/searchable', + '/internal/workplace_search/account/sources/123/searchable', { body: JSON.stringify({ searchable: true }), } @@ -257,7 +260,7 @@ describe('SourcesLogic', () => { jest.advanceTimersByTime(POLLING_INTERVAL); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/org/sources/status'); + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/org/sources/status'); await promise; expect(setServerSourceStatusesSpy).toHaveBeenCalledWith(contentSources); }); @@ -289,7 +292,7 @@ describe('SourcesLogic', () => { http.get.mockReturnValue(promise); fetchSourceStatuses(true); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/org/sources/status'); + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/org/sources/status'); await promise; expect(setServerSourceStatusesSpy).toHaveBeenCalledWith(contentSources); }); @@ -299,7 +302,7 @@ describe('SourcesLogic', () => { http.get.mockReturnValue(promise); fetchSourceStatuses(false); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/account/sources/status'); + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/account/sources/status'); }); it('handles error', async () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_logic.ts index 14c79b75dff8e..9a88f6238bcc4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_logic.ts @@ -158,8 +158,8 @@ export const SourcesLogic = kea>( initializeSources: async () => { const { isOrganization } = AppLogic.values; const route = isOrganization - ? '/api/workplace_search/org/sources' - : '/api/workplace_search/account/sources'; + ? '/internal/workplace_search/org/sources' + : '/internal/workplace_search/account/sources'; try { const response = await HttpLogic.values.http.get(route); @@ -194,8 +194,8 @@ export const SourcesLogic = kea>( setSourceSearchability: async ({ sourceId, searchable }) => { const { isOrganization } = AppLogic.values; const route = isOrganization - ? `/api/workplace_search/org/sources/${sourceId}/searchable` - : `/api/workplace_search/account/sources/${sourceId}/searchable`; + ? `/internal/workplace_search/org/sources/${sourceId}/searchable` + : `/internal/workplace_search/account/sources/${sourceId}/searchable`; try { await HttpLogic.values.http.put(route, { @@ -242,8 +242,8 @@ export const SourcesLogic = kea>( export const fetchSourceStatuses = async (isOrganization: boolean) => { const route = isOrganization - ? '/api/workplace_search/org/sources/status' - : '/api/workplace_search/account/sources/status'; + ? '/internal/workplace_search/org/sources/status' + : '/internal/workplace_search/account/sources/status'; let response; try { diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/add_group_modal.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/add_group_modal.tsx index 2c5732b4b7157..d87991626ef3f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/add_group_modal.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/add_group_modal.tsx @@ -37,6 +37,12 @@ const ADD_GROUP_SUBMIT = i18n.translate( defaultMessage: 'Add Group', } ); +const ADD_GROUP_LABEL = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.groups.addGroup.label', + { + defaultMessage: 'Group name', + } +); export const AddGroupModal: React.FC<{}> = () => { const { closeNewGroupModal, saveNewGroup, setNewGroupName } = useActions(GroupsLogic); @@ -55,7 +61,7 @@ export const AddGroupModal: React.FC<{}> = () => { - + = ({ const { contentSources } = useValues(GroupsLogic); const allSelected = numSelected === allItems.length; - const isSources = label === 'shared content sources'; - const showEmptyState = isSources && contentSources.length < 1; + const showEmptyState = contentSources.length < 1; const handleClose = () => hideModal(group); const handleSelectAll = () => selectAll(allSelected ? [] : allItems); @@ -125,13 +138,7 @@ export const GroupManagerModal: React.FC = ({ - {i18n.translate( - 'xpack.enterpriseSearch.workplaceSearch.groups.groupManagerSelectAllToggle', - { - defaultMessage: '{action} All', - values: { action: allSelected ? 'Deselect' : 'Select' }, - } - )} + {allSelected ? ADD_SOURCE_MODAL_DESELECT_BUTTON : ADD_SOURCE_MODAL_SELECT_BUTTON} diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/groups_table.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/groups_table.tsx index 3c44261cc911f..41a1c92107661 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/groups_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/groups_table.tsx @@ -31,6 +31,14 @@ const GROUP_TABLE_HEADER = i18n.translate( defaultMessage: 'Group', } ); + +const GROUPS_PAGINATION_LABEL = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.groups.groupsTable.groupPagination.label', + { + defaultMessage: 'Groups', + } +); + const SOURCES_TABLE_HEADER = i18n.translate( 'xpack.enterpriseSearch.workplaceSearch.groups.groupsTable.sourcesTableHeader', { @@ -51,7 +59,7 @@ export const GroupsTable: React.FC<{}> = () => { const clearFiltersLink = hasFiltersSet ? : undefined; const paginationOptions = { - itemLabel: 'Groups', + itemLabel: GROUPS_PAGINATION_LABEL, totalPages, totalItems, activePage, diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/source_option_item.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/source_option_item.tsx index 7983b3a13f4cd..872aa2ed2261e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/source_option_item.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/source_option_item.tsx @@ -20,9 +20,9 @@ interface SourceOptionItemProps { } export const SourceOptionItem: React.FC = ({ source }) => ( - + - + diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_logic.test.ts index 6184dada8f111..088936443ccd3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_logic.test.ts @@ -185,7 +185,7 @@ describe('GroupLogic', () => { http.get.mockReturnValue(Promise.resolve(group)); GroupLogic.actions.initializeGroup(sourceIds[0]); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/groups/123'); + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/groups/123'); await nextTick(); expect(onInitializeGroupSpy).toHaveBeenCalledWith(group); }); @@ -219,7 +219,7 @@ describe('GroupLogic', () => { http.delete.mockReturnValue(Promise.resolve(true)); GroupLogic.actions.deleteGroup(); - expect(http.delete).toHaveBeenCalledWith('/api/workplace_search/groups/123'); + expect(http.delete).toHaveBeenCalledWith('/internal/workplace_search/groups/123'); await nextTick(); expect(navigateToUrl).toHaveBeenCalledWith(GROUPS_PATH); @@ -246,7 +246,7 @@ describe('GroupLogic', () => { http.put.mockReturnValue(Promise.resolve(group)); GroupLogic.actions.updateGroupName(); - expect(http.put).toHaveBeenCalledWith('/api/workplace_search/groups/123', { + expect(http.put).toHaveBeenCalledWith('/internal/workplace_search/groups/123', { body: JSON.stringify({ group: { name: 'new name' } }), }); @@ -277,7 +277,7 @@ describe('GroupLogic', () => { http.post.mockReturnValue(Promise.resolve(group)); GroupLogic.actions.saveGroupSources(); - expect(http.post).toHaveBeenCalledWith('/api/workplace_search/groups/123/share', { + expect(http.post).toHaveBeenCalledWith('/internal/workplace_search/groups/123/share', { body: JSON.stringify({ content_source_ids: sourceIds }), }); @@ -310,7 +310,7 @@ describe('GroupLogic', () => { http.put.mockReturnValue(Promise.resolve(group)); GroupLogic.actions.saveGroupSourcePrioritization(); - expect(http.put).toHaveBeenCalledWith('/api/workplace_search/groups/123/boosts', { + expect(http.put).toHaveBeenCalledWith('/internal/workplace_search/groups/123/boosts', { body: JSON.stringify({ content_source_boosts: [ [sourceIds[0], 1], diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_logic.ts index f8ec50b309725..96b9213d30afc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/group_logic.ts @@ -174,7 +174,9 @@ export const GroupLogic = kea>({ listeners: ({ actions, values }) => ({ initializeGroup: async ({ groupId }) => { try { - const response = await HttpLogic.values.http.get(`/api/workplace_search/groups/${groupId}`); + const response = await HttpLogic.values.http.get( + `/internal/workplace_search/groups/${groupId}` + ); actions.onInitializeGroup(response); } catch (e) { const NOT_FOUND_MESSAGE = i18n.translate( @@ -196,7 +198,7 @@ export const GroupLogic = kea>({ group: { id, name }, } = values; try { - await HttpLogic.values.http.delete(`/api/workplace_search/groups/${id}`); + await HttpLogic.values.http.delete(`/internal/workplace_search/groups/${id}`); const GROUP_DELETED_MESSAGE = i18n.translate( 'xpack.enterpriseSearch.workplaceSearch.groups.groupDeleted', { @@ -218,9 +220,12 @@ export const GroupLogic = kea>({ } = values; try { - const response = await HttpLogic.values.http.put(`/api/workplace_search/groups/${id}`, { - body: JSON.stringify({ group: { name: groupNameInputValue } }), - }); + const response = await HttpLogic.values.http.put( + `/internal/workplace_search/groups/${id}`, + { + body: JSON.stringify({ group: { name: groupNameInputValue } }), + } + ); actions.onGroupNameChanged(response); const GROUP_RENAMED_MESSAGE = i18n.translate( @@ -243,7 +248,7 @@ export const GroupLogic = kea>({ try { const response = await HttpLogic.values.http.post( - `/api/workplace_search/groups/${id}/share`, + `/internal/workplace_search/groups/${id}/share`, { body: JSON.stringify({ content_source_ids: selectedGroupSources }), } @@ -275,7 +280,7 @@ export const GroupLogic = kea>({ try { const response = await HttpLogic.values.http.put( - `/api/workplace_search/groups/${id}/boosts`, + `/internal/workplace_search/groups/${id}/boosts`, { body: JSON.stringify({ content_source_boosts: boosts }), } 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 c4a860368ff8b..c8b725f7131a6 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 @@ -222,7 +222,7 @@ describe('GroupsLogic', () => { http.get.mockReturnValue(Promise.resolve(groupsResponse)); GroupsLogic.actions.initializeGroups(); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/groups'); + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/groups'); await nextTick(); expect(onInitializeGroupsSpy).toHaveBeenCalledWith(groupsResponse); }); @@ -270,7 +270,7 @@ describe('GroupsLogic', () => { GroupsLogic.actions.getSearchResults(); jest.advanceTimersByTime(TIMEOUT); await nextTick(); - expect(http.post).toHaveBeenCalledWith('/api/workplace_search/groups/search', payload); + expect(http.post).toHaveBeenCalledWith('/internal/workplace_search/groups/search', payload); expect(setSearchResultsSpy).toHaveBeenCalledWith(groups); }); @@ -284,7 +284,7 @@ describe('GroupsLogic', () => { // Account for `breakpoint` that debounces filter value. jest.advanceTimersByTime(TIMEOUT); await nextTick(); - expect(http.post).toHaveBeenCalledWith('/api/workplace_search/groups/search', payload); + expect(http.post).toHaveBeenCalledWith('/internal/workplace_search/groups/search', payload); expect(setSearchResultsSpy).toHaveBeenCalledWith(groups); }); @@ -305,7 +305,7 @@ describe('GroupsLogic', () => { http.get.mockReturnValue(Promise.resolve(users)); GroupsLogic.actions.fetchGroupUsers('123'); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/groups/123/group_users'); + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/groups/123/group_users'); await nextTick(); expect(setGroupUsersSpy).toHaveBeenCalledWith(users); }); @@ -328,7 +328,7 @@ describe('GroupsLogic', () => { http.post.mockReturnValue(Promise.resolve(groups[0])); GroupsLogic.actions.saveNewGroup(); - expect(http.post).toHaveBeenCalledWith('/api/workplace_search/groups', { + expect(http.post).toHaveBeenCalledWith('/internal/workplace_search/groups', { body: JSON.stringify({ group_name: GROUP_NAME }), headers, }); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups_logic.ts index 36061bc18196b..19c16f6147dcc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups_logic.ts @@ -255,7 +255,7 @@ export const GroupsLogic = kea>({ listeners: ({ actions, values }) => ({ initializeGroups: async () => { try { - const response = await HttpLogic.values.http.get('/api/workplace_search/groups'); + const response = await HttpLogic.values.http.get('/internal/workplace_search/groups'); actions.onInitializeGroups(response); } catch (e) { flashAPIErrors(e); @@ -288,13 +288,16 @@ export const GroupsLogic = kea>({ }; try { - const response = await HttpLogic.values.http.post('/api/workplace_search/groups/search', { - body: JSON.stringify({ - page, - search, - }), - headers, - }); + const response = await HttpLogic.values.http.post( + '/internal/workplace_search/groups/search', + { + body: JSON.stringify({ + page, + search, + }), + headers, + } + ); actions.setSearchResults(response); } catch (e) { @@ -305,7 +308,7 @@ export const GroupsLogic = kea>({ actions.setAllGroupLoading(true); try { const response = await HttpLogic.values.http.get( - `/api/workplace_search/groups/${groupId}/group_users` + `/internal/workplace_search/groups/${groupId}/group_users` ); actions.setGroupUsers(response); } catch (e) { @@ -314,7 +317,7 @@ export const GroupsLogic = kea>({ }, saveNewGroup: async () => { try { - const response = await HttpLogic.values.http.post('/api/workplace_search/groups', { + const response = await HttpLogic.values.http.post('/internal/workplace_search/groups', { body: JSON.stringify({ group_name: values.newGroupName }), headers, }); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/oauth_authorize/oauth_authorize_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/oauth_authorize/oauth_authorize_logic.test.ts index 3d31cb7d88225..747feb9bc5880 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/oauth_authorize/oauth_authorize_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/oauth_authorize/oauth_authorize_logic.test.ts @@ -119,7 +119,7 @@ describe('OAuthAuthorizeLogic', () => { OAuthAuthorizeLogic.actions.initializeOAuthPreAuth(entSearchStateParam); expect(clearFlashMessages).toHaveBeenCalled(); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/oauth/authorize', { + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/oauth/authorize', { query: parsedQueryParams, }); await nextTick(); @@ -130,7 +130,7 @@ describe('OAuthAuthorizeLogic', () => { http.get.mockReturnValue(Promise.resolve(successRedirectResponse)); OAuthAuthorizeLogic.actions.initializeOAuthPreAuth(entSearchStateParam); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/oauth/authorize', { + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/oauth/authorize', { query: parsedQueryParams, }); await nextTick(); @@ -143,7 +143,7 @@ describe('OAuthAuthorizeLogic', () => { OAuthAuthorizeLogic.actions.initializeOAuthPreAuth(entSearchStateParam); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/oauth/authorize', { + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/oauth/authorize', { query: parsedQueryParams, }); await nextTick(); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/oauth_authorize/oauth_authorize_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/oauth_authorize/oauth_authorize_logic.ts index b63c17538387d..e21cde02481a0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/oauth_authorize/oauth_authorize_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/oauth_authorize/oauth_authorize_logic.ts @@ -48,7 +48,7 @@ interface OAuthAuthorizeActions { setHasError(): void; } -export const oauthAuthorizeRoute = '/api/workplace_search/oauth/authorize'; +export const oauthAuthorizeRoute = '/internal/workplace_search/oauth/authorize'; export const OAuthAuthorizeLogic = kea>({ path: ['enterprise_search', 'workplace_search', 'oauth_authorize_logic'], diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/onboarding_steps.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/onboarding_steps.tsx index b0cc35fe10dff..b908211b83a43 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/onboarding_steps.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/onboarding_steps.tsx @@ -41,11 +41,31 @@ const USERS_TITLE = i18n.translate( { defaultMessage: 'Users & invitations' } ); +const INVITE_FIRST_USERS_BUTTON = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.overviewOnboardingUsersCard.inviteFirstUsers.button', + { defaultMessage: 'Invite users' } +); + +const INVITE_MORE_USERS_BUTTON = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.overviewOnboardingUsersCard.inviteMoreUsers.button', + { defaultMessage: 'Invite more users' } +); + const ONBOARDING_SOURCES_CARD_DESCRIPTION = i18n.translate( 'xpack.enterpriseSearch.workplaceSearch.overviewOnboardingSourcesCard.description', { defaultMessage: 'Add shared sources for your organization to start searching.' } ); +const ADD_FIRST_SOURCES_BUTTON = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.sourcesOnboardingCard.addFirstSources.button', + { defaultMessage: 'Add sources' } +); + +const ADD_MORE_SOURCES_BUTTON = i18n.translate( + 'xpack.enterpriseSearch.workplaceSearch.sourcesOnboardingCard.addMoreSources.button', + { defaultMessage: 'Add more sources' } +); + const USERS_CARD_DESCRIPTION = i18n.translate( 'xpack.enterpriseSearch.workplaceSearch.overviewUsersCard.title', { defaultMessage: 'Nice, you’ve invited colleagues to search with you.' } @@ -82,13 +102,7 @@ export const OnboardingSteps: React.FC = () => { description={ hasOrgSources ? SOURCES_CARD_DESCRIPTION : ONBOARDING_SOURCES_CARD_DESCRIPTION } - actionTitle={i18n.translate( - 'xpack.enterpriseSearch.workplaceSearch.sourcesOnboardingCard.buttonLabel', - { - defaultMessage: 'Add {label} sources', - values: { label: sourcesCount > 0 ? 'more' : '' }, - } - )} + actionTitle={sourcesCount > 0 ? ADD_MORE_SOURCES_BUTTON : ADD_FIRST_SOURCES_BUTTON} actionPath={ADD_SOURCE_PATH} complete={hasOrgSources} /> @@ -97,13 +111,7 @@ export const OnboardingSteps: React.FC = () => { testSubj="usersButton" icon="user" description={hasUsers ? USERS_CARD_DESCRIPTION : ONBOARDING_USERS_CARD_DESCRIPTION} - actionTitle={i18n.translate( - 'xpack.enterpriseSearch.workplaceSearch.usersOnboardingCard.buttonLabel', - { - defaultMessage: 'Invite {label} users', - values: { label: accountsCount > 0 ? 'more' : '' }, - } - )} + actionTitle={accountsCount > 0 ? INVITE_MORE_USERS_BUTTON : INVITE_FIRST_USERS_BUTTON} actionPath={USERS_AND_ROLES_PATH} complete={hasUsers} /> diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview_logic.test.ts index 1a4a182636283..f10918a1afe2d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview_logic.test.ts @@ -63,7 +63,7 @@ describe('OverviewLogic', () => { await OverviewLogic.actions.initializeOverview(); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/overview'); + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/overview'); expect(setServerDataSpy).toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview_logic.ts index 1ecd344a45124..196de02646804 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/overview_logic.ts @@ -97,7 +97,7 @@ export const OverviewLogic = kea> listeners: ({ actions }) => ({ initializeOverview: async () => { try { - const response = await HttpLogic.values.http.get('/api/workplace_search/overview'); + const response = await HttpLogic.values.http.get('/internal/workplace_search/overview'); actions.setServerData(response); } catch (e) { flashAPIErrors(e); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/role_mappings/role_mappings_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/role_mappings/role_mappings_logic.test.ts index a412411488b8d..3f5a63275f05d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/role_mappings/role_mappings_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/role_mappings/role_mappings_logic.test.ts @@ -343,7 +343,7 @@ describe('RoleMappingsLogic', () => { expect(RoleMappingsLogic.values.dataLoading).toEqual(true); expect(http.post).toHaveBeenCalledWith( - '/api/workplace_search/org/role_mappings/enable_role_based_access' + '/internal/workplace_search/org/role_mappings/enable_role_based_access' ); await nextTick(); expect(setRoleMappingsSpy).toHaveBeenCalledWith(mappingsServerProps); @@ -364,7 +364,7 @@ describe('RoleMappingsLogic', () => { http.get.mockReturnValue(Promise.resolve(mappingsServerProps)); RoleMappingsLogic.actions.initializeRoleMappings(); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/org/role_mappings'); + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/org/role_mappings'); await nextTick(); expect(setRoleMappingsDataSpy).toHaveBeenCalledWith(mappingsServerProps); }); @@ -376,6 +376,16 @@ describe('RoleMappingsLogic', () => { expect(flashAPIErrors).toHaveBeenCalledWith('this is an error'); }); + + it('resets roleMapping state', () => { + mount({ + ...mappingsServerProps, + roleMapping: wsRoleMapping, + }); + RoleMappingsLogic.actions.initializeRoleMappings(); + + expect(RoleMappingsLogic.values.roleMapping).toEqual(null); + }); }); describe('initializeRoleMapping', () => { @@ -440,7 +450,7 @@ describe('RoleMappingsLogic', () => { http.post.mockReturnValue(Promise.resolve(mappingsServerProps)); RoleMappingsLogic.actions.handleSaveMapping(); - expect(http.post).toHaveBeenCalledWith('/api/workplace_search/org/role_mappings', { + expect(http.post).toHaveBeenCalledWith('/internal/workplace_search/org/role_mappings', { body: JSON.stringify({ roleType: 'admin', allGroups: false, @@ -467,7 +477,7 @@ describe('RoleMappingsLogic', () => { RoleMappingsLogic.actions.handleSaveMapping(); expect(http.put).toHaveBeenCalledWith( - `/api/workplace_search/org/role_mappings/${wsRoleMapping.id}`, + `/internal/workplace_search/org/role_mappings/${wsRoleMapping.id}`, { body: JSON.stringify({ roleType: 'admin', @@ -524,7 +534,7 @@ describe('RoleMappingsLogic', () => { RoleMappingsLogic.actions.handleSaveUser(); expect(http.post).toHaveBeenCalledWith( - '/api/workplace_search/org/single_user_role_mapping', + '/internal/workplace_search/org/single_user_role_mapping', { body: JSON.stringify({ roleMapping: { @@ -558,7 +568,7 @@ describe('RoleMappingsLogic', () => { RoleMappingsLogic.actions.handleSaveUser(); expect(http.post).toHaveBeenCalledWith( - '/api/workplace_search/org/single_user_role_mapping', + '/internal/workplace_search/org/single_user_role_mapping', { body: JSON.stringify({ roleMapping: { @@ -614,7 +624,7 @@ describe('RoleMappingsLogic', () => { RoleMappingsLogic.actions.handleDeleteMapping(roleMappingId); expect(http.delete).toHaveBeenCalledWith( - `/api/workplace_search/org/role_mappings/${roleMappingId}` + `/internal/workplace_search/org/role_mappings/${roleMappingId}` ); await nextTick(); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/role_mappings/role_mappings_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/role_mappings/role_mappings_logic.ts index 29b448bc0684a..55f82a07bf405 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/role_mappings/role_mappings_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/role_mappings/role_mappings_logic.ts @@ -168,6 +168,7 @@ export const RoleMappingsLogic = kea roleMapping, + initializeRoleMappings: () => null, resetState: () => null, closeUsersAndRolesFlyout: () => null, }, @@ -354,7 +355,7 @@ export const RoleMappingsLogic = kea ({ enableRoleBasedAccess: async () => { const { http } = HttpLogic.values; - const route = '/api/workplace_search/org/role_mappings/enable_role_based_access'; + const route = '/internal/workplace_search/org/role_mappings/enable_role_based_access'; try { const response = await http.post(route); @@ -365,7 +366,7 @@ export const RoleMappingsLogic = kea { const { http } = HttpLogic.values; - const route = '/api/workplace_search/org/role_mappings'; + const route = '/internal/workplace_search/org/role_mappings'; try { const response = await http.get(route); @@ -392,7 +393,7 @@ export const RoleMappingsLogic = kea { const { http } = HttpLogic.values; - const route = `/api/workplace_search/org/role_mappings/${roleMappingId}`; + const route = `/internal/workplace_search/org/role_mappings/${roleMappingId}`; try { await http.delete(route); @@ -425,8 +426,8 @@ export const RoleMappingsLogic = kea { SearchAuthorizeLogic.actions.initializeSearchAuth(searchOAuth, entSearchStateParam); expect(clearFlashMessages).toHaveBeenCalled(); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/oauth/authorize', { + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/oauth/authorize', { query: preAuthQuery, }); await nextTick(); @@ -84,7 +84,7 @@ describe('SearchAuthorizeLogic', () => { http.get.mockReturnValue(Promise.resolve(successRedirectResponse)); SearchAuthorizeLogic.actions.initializeSearchAuth(searchOAuth, entSearchStateParam); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/oauth/authorize', { + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/oauth/authorize', { query: preAuthQuery, }); await nextTick(); @@ -100,7 +100,7 @@ describe('SearchAuthorizeLogic', () => { SearchAuthorizeLogic.actions.initializeSearchAuth(searchOAuth, entSearchStateParam); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/oauth/authorize', { + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/oauth/authorize', { query: preAuthQuery, }); await nextTick(); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/security/security_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/security/security_logic.test.ts index ecb97cea528b9..bc45609e9e83d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/security/security_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/security/security_logic.test.ts @@ -118,7 +118,7 @@ describe('SecurityLogic', () => { SecurityLogic.actions.initializeSourceRestrictions(); expect(http.get).toHaveBeenCalledWith( - '/api/workplace_search/org/security/source_restrictions' + '/internal/workplace_search/org/security/source_restrictions' ); await nextTick(); expect(setServerPropsSpy).toHaveBeenCalledWith(serverProps); @@ -143,7 +143,7 @@ describe('SecurityLogic', () => { SecurityLogic.actions.saveSourceRestrictions(); expect(http.patch).toHaveBeenCalledWith( - '/api/workplace_search/org/security/source_restrictions', + '/internal/workplace_search/org/security/source_restrictions', { body: JSON.stringify(serverProps), } diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/security/security_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/security/security_logic.ts index 2d5c2d5a212c9..e06504edbf0ac 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/security/security_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/security/security_logic.ts @@ -60,7 +60,7 @@ interface SecurityActions { resetState(): void; } -const route = '/api/workplace_search/org/security/source_restrictions'; +const route = '/internal/workplace_search/org/security/source_restrictions'; export const SecurityLogic = kea>({ path: ['enterprise_search', 'workplace_search', 'security_logic'], diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/components/oauth_application.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/components/oauth_application.tsx index 075d95f726030..b55828f78344c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/components/oauth_application.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/components/oauth_application.tsx @@ -47,7 +47,7 @@ import { SAVE_CHANGES_BUTTON, NON_PLATINUM_OAUTH_TITLE, NON_PLATINUM_OAUTH_DESCRIPTION, - NON_PLATINUM_OAUTH_LINK, + EXPLORE_PLATINUM_FEATURES_LINK, } from '../../../constants'; import { ENT_SEARCH_LICENSE_MANAGEMENT } from '../../../routes'; import { SettingsLogic } from '../settings_logic'; @@ -101,7 +101,7 @@ export const OauthApplication: React.FC = () => { {NON_PLATINUM_OAUTH_DESCRIPTION} - {NON_PLATINUM_OAUTH_LINK} + {EXPLORE_PLATINUM_FEATURES_LINK} ); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/settings_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/settings_logic.test.ts index e56b1df1ab873..ebb790b59c1fa 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/settings_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/settings_logic.test.ts @@ -122,7 +122,7 @@ describe('SettingsLogic', () => { http.get.mockReturnValue(Promise.resolve(configuredSources)); SettingsLogic.actions.initializeSettings(); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/org/settings'); + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/org/settings'); await nextTick(); expect(setServerPropsSpy).toHaveBeenCalledWith(configuredSources); }); @@ -145,7 +145,7 @@ describe('SettingsLogic', () => { http.get.mockReturnValue(Promise.resolve(serverProps)); SettingsLogic.actions.initializeConnectors(); - expect(http.get).toHaveBeenCalledWith('/api/workplace_search/org/settings/connectors'); + expect(http.get).toHaveBeenCalledWith('/internal/workplace_search/org/settings/connectors'); await nextTick(); expect(onInitializeConnectorsSpy).toHaveBeenCalledWith(serverProps); }); @@ -168,7 +168,7 @@ describe('SettingsLogic', () => { SettingsLogic.actions.updateOrgName(); - expect(http.put).toHaveBeenCalledWith('/api/workplace_search/org/settings/customize', { + expect(http.put).toHaveBeenCalledWith('/internal/workplace_search/org/settings/customize', { body: JSON.stringify({ name: NAME }), }); await nextTick(); @@ -194,9 +194,12 @@ describe('SettingsLogic', () => { SettingsLogic.actions.updateOrgIcon(); - expect(http.put).toHaveBeenCalledWith('/api/workplace_search/org/settings/upload_images', { - body: JSON.stringify({ icon: ICON }), - }); + expect(http.put).toHaveBeenCalledWith( + '/internal/workplace_search/org/settings/upload_images', + { + body: JSON.stringify({ icon: ICON }), + } + ); await nextTick(); expect(flashSuccessToast).toHaveBeenCalledWith(ORG_UPDATED_MESSAGE); expect(setIconSpy).toHaveBeenCalledWith(ICON); @@ -220,9 +223,12 @@ describe('SettingsLogic', () => { SettingsLogic.actions.updateOrgLogo(); - expect(http.put).toHaveBeenCalledWith('/api/workplace_search/org/settings/upload_images', { - body: JSON.stringify({ logo: LOGO }), - }); + expect(http.put).toHaveBeenCalledWith( + '/internal/workplace_search/org/settings/upload_images', + { + body: JSON.stringify({ logo: LOGO }), + } + ); await nextTick(); expect(flashSuccessToast).toHaveBeenCalledWith(ORG_UPDATED_MESSAGE); expect(setLogoSpy).toHaveBeenCalledWith(LOGO); @@ -273,7 +279,7 @@ describe('SettingsLogic', () => { expect(clearFlashMessages).toHaveBeenCalled(); expect(http.put).toHaveBeenCalledWith( - '/api/workplace_search/org/settings/oauth_application', + '/internal/workplace_search/org/settings/oauth_application', { body: JSON.stringify({ oauth_application: { name, confidential, redirect_uri: redirectUri }, diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/settings_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/settings_logic.ts index 886f81129ee17..4faaca58ab8a0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/settings_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/settings_logic.ts @@ -84,7 +84,7 @@ interface SettingsValues { iconButtonLoading: boolean; } -const imageRoute = '/api/workplace_search/org/settings/upload_images'; +const imageRoute = '/internal/workplace_search/org/settings/upload_images'; export const SettingsLogic = kea>({ actions: { @@ -197,7 +197,7 @@ export const SettingsLogic = kea> listeners: ({ actions, values }) => ({ initializeSettings: async () => { const { http } = HttpLogic.values; - const route = '/api/workplace_search/org/settings'; + const route = '/internal/workplace_search/org/settings'; try { const response = await http.get(route); @@ -208,7 +208,7 @@ export const SettingsLogic = kea> }, initializeConnectors: async () => { const { http } = HttpLogic.values; - const route = '/api/workplace_search/org/settings/connectors'; + const route = '/internal/workplace_search/org/settings/connectors'; try { const response = await http.get(route); @@ -220,7 +220,7 @@ export const SettingsLogic = kea> updateOrgName: async () => { clearFlashMessages(); const { http } = HttpLogic.values; - const route = '/api/workplace_search/org/settings/customize'; + const route = '/internal/workplace_search/org/settings/customize'; const { orgNameInputValue: name } = values; const body = JSON.stringify({ name }); @@ -265,7 +265,7 @@ export const SettingsLogic = kea> }, updateOauthApplication: async () => { const { http } = HttpLogic.values; - const route = '/api/workplace_search/org/settings/oauth_application'; + const route = '/internal/workplace_search/org/settings/oauth_application'; const oauthApplication = values.oauthApplication || ({} as IOauthApplication); const { name, redirectUri, confidential } = oauthApplication; const body = JSON.stringify({ @@ -284,7 +284,7 @@ export const SettingsLogic = kea> }, deleteSourceConfig: async ({ serviceType, name }) => { const { http } = HttpLogic.values; - const route = `/api/workplace_search/org/settings/connectors/${serviceType}`; + const route = `/internal/workplace_search/org/settings/connectors/${serviceType}`; try { await http.delete(route); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/setup_guide/setup_guide.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/setup_guide/setup_guide.tsx index 05692a0ecab8c..61300bac47734 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/setup_guide/setup_guide.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/setup_guide/setup_guide.tsx @@ -55,7 +55,10 @@ export const SetupGuide: React.FC = () => { - Get started with Workplace Search + diff --git a/x-pack/plugins/enterprise_search/public/plugin.ts b/x-pack/plugins/enterprise_search/public/plugin.ts index 97573069ad9fd..19f2aa212d7fd 100644 --- a/x-pack/plugins/enterprise_search/public/plugin.ts +++ b/x-pack/plugins/enterprise_search/public/plugin.ts @@ -191,7 +191,7 @@ export class EnterpriseSearchPlugin implements Plugin { if (this.hasInitialized) return; // We've already made an initial call try { - this.data = await http.get('/api/enterprise_search/config_data'); + this.data = await http.get('/internal/enterprise_search/config_data'); this.hasInitialized = true; } catch { this.data.errorConnecting = true; diff --git a/x-pack/plugins/enterprise_search/server/__mocks__/router.mock.ts b/x-pack/plugins/enterprise_search/server/__mocks__/router.mock.ts index 5c19ca7062b65..43a08aa90ce6f 100644 --- a/x-pack/plugins/enterprise_search/server/__mocks__/router.mock.ts +++ b/x-pack/plugins/enterprise_search/server/__mocks__/router.mock.ts @@ -97,7 +97,7 @@ export class MockRouter { */ // const mockRouter = new MockRouter({ // method: 'get', -// path: '/api/app_search/test', +// path: '/internal/app_search/test', // }); // // beforeEach(() => { diff --git a/x-pack/plugins/enterprise_search/server/lib/route_config_helpers.ts b/x-pack/plugins/enterprise_search/server/lib/route_config_helpers.ts index ab5bbc994a103..87defff89bad4 100644 --- a/x-pack/plugins/enterprise_search/server/lib/route_config_helpers.ts +++ b/x-pack/plugins/enterprise_search/server/lib/route_config_helpers.ts @@ -38,7 +38,7 @@ interface ConfigWithoutBodyOptions * * Example: * router.put({ - * path: '/api/app_search/engines/{engineName}/example', + * path: '/internal/app_search/engines/{engineName}/example', * validate: { * params: schema.object({ * engineName: schema.string(), @@ -52,7 +52,7 @@ interface ConfigWithoutBodyOptions * This helper applies that pattern, while maintaining existing options: * * router.put(skipBodyValidation({ - * path: '/api/app_search/engines/{engineName}/example', + * path: '/internal/app_search/engines/{engineName}/example', * validate: { * params: schema.object({ * engineName: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/analytics.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/analytics.test.ts index 8e4a7dba165b1..c0313876f4007 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/analytics.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/analytics.test.ts @@ -10,14 +10,14 @@ import { MockRouter, mockRequestHandler, mockDependencies } from '../../__mocks_ import { registerAnalyticsRoutes } from './analytics'; describe('analytics routes', () => { - describe('GET /api/app_search/engines/{engineName}/analytics/queries', () => { + describe('GET /internal/app_search/engines/{engineName}/analytics/queries', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{engineName}/analytics/queries', + path: '/internal/app_search/engines/{engineName}/analytics/queries', }); registerAnalyticsRoutes({ @@ -62,14 +62,14 @@ describe('analytics routes', () => { }); }); - describe('GET /api/app_search/engines/{engineName}/analytics/queries/{query}', () => { + describe('GET /internal/app_search/engines/{engineName}/analytics/queries/{query}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{engineName}/analytics/queries/{query}', + path: '/internal/app_search/engines/{engineName}/analytics/queries/{query}', }); registerAnalyticsRoutes({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/analytics.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/analytics.ts index cce6c59bb90d7..f6a03ad5674eb 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/analytics.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/analytics.ts @@ -25,7 +25,7 @@ export function registerAnalyticsRoutes({ }: RouteDependencies) { router.get( { - path: '/api/app_search/engines/{engineName}/analytics/queries', + path: '/internal/app_search/engines/{engineName}/analytics/queries', validate: { params: schema.object({ engineName: schema.string(), @@ -40,7 +40,7 @@ export function registerAnalyticsRoutes({ router.get( { - path: '/api/app_search/engines/{engineName}/analytics/queries/{query}', + path: '/internal/app_search/engines/{engineName}/analytics/queries/{query}', validate: { params: schema.object({ engineName: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/api_logs.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/api_logs.test.ts index 3152b371c2fbb..9d2fb6d292e31 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/api_logs.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/api_logs.test.ts @@ -10,14 +10,14 @@ import { MockRouter, mockRequestHandler, mockDependencies } from '../../__mocks_ import { registerApiLogsRoutes } from './api_logs'; describe('API logs routes', () => { - describe('GET /api/app_search/engines/{engineName}/api_logs', () => { + describe('GET /internal/app_search/engines/{engineName}/api_logs', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{engineName}/api_logs', + path: '/internal/app_search/engines/{engineName}/api_logs', }); registerApiLogsRoutes({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/api_logs.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/api_logs.ts index d57ecb29294be..e0803ade141d3 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/api_logs.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/api_logs.ts @@ -15,7 +15,7 @@ export function registerApiLogsRoutes({ }: RouteDependencies) { router.get( { - path: '/api/app_search/engines/{engineName}/api_logs', + path: '/internal/app_search/engines/{engineName}/api_logs', validate: { params: schema.object({ engineName: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler.test.ts index d50d7b7cee225..5dff1b934ae5a 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler.test.ts @@ -10,14 +10,14 @@ import { mockDependencies, mockRequestHandler, MockRouter } from '../../__mocks_ import { registerCrawlerRoutes } from './crawler'; describe('crawler routes', () => { - describe('GET /api/app_search/engines/{name}/crawler', () => { + describe('GET /internal/app_search/engines/{name}/crawler', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{name}/crawler', + path: '/internal/app_search/engines/{name}/crawler', }); registerCrawlerRoutes({ @@ -43,14 +43,14 @@ describe('crawler routes', () => { }); }); - describe('GET /api/app_search/engines/{name}/crawler/crawl_requests', () => { + describe('GET /internal/app_search/engines/{name}/crawler/crawl_requests', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{name}/crawler/crawl_requests', + path: '/internal/app_search/engines/{name}/crawler/crawl_requests', }); registerCrawlerRoutes({ @@ -76,14 +76,14 @@ describe('crawler routes', () => { }); }); - describe('POST /api/app_search/engines/{name}/crawler/crawl_requests', () => { + describe('POST /internal/app_search/engines/{name}/crawler/crawl_requests', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/engines/{name}/crawler/crawl_requests', + path: '/internal/app_search/engines/{name}/crawler/crawl_requests', }); registerCrawlerRoutes({ @@ -109,14 +109,14 @@ describe('crawler routes', () => { }); }); - describe('POST /api/app_search/engines/{name}/crawler/crawl_requests/cancel', () => { + describe('POST /internal/app_search/engines/{name}/crawler/crawl_requests/cancel', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/engines/{name}/crawler/crawl_requests/cancel', + path: '/internal/app_search/engines/{name}/crawler/crawl_requests/cancel', }); registerCrawlerRoutes({ @@ -142,14 +142,14 @@ describe('crawler routes', () => { }); }); - describe('POST /api/app_search/engines/{name}/crawler/domains', () => { + describe('POST /internal/app_search/engines/{name}/crawler/domains', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/engines/{name}/crawler/domains', + path: '/internal/app_search/engines/{name}/crawler/domains', }); registerCrawlerRoutes({ @@ -198,14 +198,14 @@ describe('crawler routes', () => { }); }); - describe('DELETE /api/app_search/engines/{name}/crawler/domains/{id}', () => { + describe('DELETE /internal/app_search/engines/{name}/crawler/domains/{id}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'delete', - path: '/api/app_search/engines/{name}/crawler/domains/{id}', + path: '/internal/app_search/engines/{name}/crawler/domains/{id}', }); registerCrawlerRoutes({ @@ -244,14 +244,14 @@ describe('crawler routes', () => { }); }); - describe('PUT /api/app_search/engines/{name}/crawler/domains/{id}', () => { + describe('PUT /internal/app_search/engines/{name}/crawler/domains/{id}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/app_search/engines/{name}/crawler/domains/{id}', + path: '/internal/app_search/engines/{name}/crawler/domains/{id}', }); registerCrawlerRoutes({ @@ -302,14 +302,14 @@ describe('crawler routes', () => { }); }); - describe('GET /api/app_search/engines/{name}/crawler/domains/{id}', () => { + describe('GET /internal/app_search/engines/{name}/crawler/domains/{id}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{name}/crawler/domains/{id}', + path: '/internal/app_search/engines/{name}/crawler/domains/{id}', }); registerCrawlerRoutes({ @@ -340,14 +340,14 @@ describe('crawler routes', () => { }); }); - describe('POST /api/app_search/crawler/validate_url', () => { + describe('POST /internal/app_search/crawler/validate_url', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/crawler/validate_url', + path: '/internal/app_search/crawler/validate_url', }); registerCrawlerRoutes({ @@ -377,14 +377,14 @@ describe('crawler routes', () => { }); }); - describe('POST /api/app_search/engines/{name}/crawler/process_crawls', () => { + describe('POST /internal/app_search/engines/{name}/crawler/process_crawls', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/engines/{name}/crawler/process_crawls', + path: '/internal/app_search/engines/{name}/crawler/process_crawls', }); registerCrawlerRoutes({ @@ -424,14 +424,14 @@ describe('crawler routes', () => { }); }); - describe('GET /api/app_search/engines/{name}/crawler/crawl_schedule', () => { + describe('GET /internal/app_search/engines/{name}/crawler/crawl_schedule', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{name}/crawler/crawl_schedule', + path: '/internal/app_search/engines/{name}/crawler/crawl_schedule', }); registerCrawlerRoutes({ @@ -461,14 +461,14 @@ describe('crawler routes', () => { }); }); - describe('PUT /api/app_search/engines/{name}/crawler/crawl_schedule', () => { + describe('PUT /internal/app_search/engines/{name}/crawler/crawl_schedule', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/app_search/engines/{name}/crawler/crawl_schedule', + path: '/internal/app_search/engines/{name}/crawler/crawl_schedule', }); registerCrawlerRoutes({ @@ -516,14 +516,14 @@ describe('crawler routes', () => { }); }); - describe('DELETE /api/app_search/engines/{name}/crawler/crawl_schedule', () => { + describe('DELETE /internal/app_search/engines/{name}/crawler/crawl_schedule', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'delete', - path: '/api/app_search/engines/{name}/crawler/crawl_schedule', + path: '/internal/app_search/engines/{name}/crawler/crawl_schedule', }); registerCrawlerRoutes({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler.ts index cf90ffdea412a..72a48a013636c 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler.ts @@ -15,7 +15,7 @@ export function registerCrawlerRoutes({ }: RouteDependencies) { router.get( { - path: '/api/app_search/engines/{name}/crawler', + path: '/internal/app_search/engines/{name}/crawler', validate: { params: schema.object({ name: schema.string(), @@ -29,7 +29,7 @@ export function registerCrawlerRoutes({ router.get( { - path: '/api/app_search/engines/{name}/crawler/crawl_requests', + path: '/internal/app_search/engines/{name}/crawler/crawl_requests', validate: { params: schema.object({ name: schema.string(), @@ -43,7 +43,7 @@ export function registerCrawlerRoutes({ router.post( { - path: '/api/app_search/engines/{name}/crawler/crawl_requests', + path: '/internal/app_search/engines/{name}/crawler/crawl_requests', validate: { params: schema.object({ name: schema.string(), @@ -57,7 +57,7 @@ export function registerCrawlerRoutes({ router.post( { - path: '/api/app_search/engines/{name}/crawler/crawl_requests/cancel', + path: '/internal/app_search/engines/{name}/crawler/crawl_requests/cancel', validate: { params: schema.object({ name: schema.string(), @@ -71,7 +71,7 @@ export function registerCrawlerRoutes({ router.post( { - path: '/api/app_search/engines/{name}/crawler/domains', + path: '/internal/app_search/engines/{name}/crawler/domains', validate: { params: schema.object({ name: schema.string(), @@ -96,7 +96,7 @@ export function registerCrawlerRoutes({ router.get( { - path: '/api/app_search/engines/{name}/crawler/domains/{id}', + path: '/internal/app_search/engines/{name}/crawler/domains/{id}', validate: { params: schema.object({ name: schema.string(), @@ -111,7 +111,7 @@ export function registerCrawlerRoutes({ router.delete( { - path: '/api/app_search/engines/{name}/crawler/domains/{id}', + path: '/internal/app_search/engines/{name}/crawler/domains/{id}', validate: { params: schema.object({ name: schema.string(), @@ -129,7 +129,7 @@ export function registerCrawlerRoutes({ router.put( { - path: '/api/app_search/engines/{name}/crawler/domains/{id}', + path: '/internal/app_search/engines/{name}/crawler/domains/{id}', validate: { params: schema.object({ name: schema.string(), @@ -156,7 +156,7 @@ export function registerCrawlerRoutes({ router.post( { - path: '/api/app_search/crawler/validate_url', + path: '/internal/app_search/crawler/validate_url', validate: { body: schema.object({ url: schema.string(), @@ -171,7 +171,7 @@ export function registerCrawlerRoutes({ router.post( { - path: '/api/app_search/engines/{name}/crawler/process_crawls', + path: '/internal/app_search/engines/{name}/crawler/process_crawls', validate: { params: schema.object({ name: schema.string(), @@ -188,7 +188,7 @@ export function registerCrawlerRoutes({ router.get( { - path: '/api/app_search/engines/{name}/crawler/crawl_schedule', + path: '/internal/app_search/engines/{name}/crawler/crawl_schedule', validate: { params: schema.object({ name: schema.string(), @@ -202,7 +202,7 @@ export function registerCrawlerRoutes({ router.put( { - path: '/api/app_search/engines/{name}/crawler/crawl_schedule', + path: '/internal/app_search/engines/{name}/crawler/crawl_schedule', validate: { params: schema.object({ name: schema.string(), @@ -220,7 +220,7 @@ export function registerCrawlerRoutes({ router.delete( { - path: '/api/app_search/engines/{name}/crawler/crawl_schedule', + path: '/internal/app_search/engines/{name}/crawler/crawl_schedule', validate: { params: schema.object({ name: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_crawl_rules.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_crawl_rules.test.ts index ec131c7cd1981..db554d1cec93f 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_crawl_rules.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_crawl_rules.test.ts @@ -10,14 +10,14 @@ import { mockDependencies, mockRequestHandler, MockRouter } from '../../__mocks_ import { registerCrawlerCrawlRulesRoutes } from './crawler_crawl_rules'; describe('crawler crawl rules routes', () => { - describe('POST /api/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules', () => { + describe('POST /internal/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules', + path: '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules', }); registerCrawlerCrawlRulesRoutes({ @@ -53,7 +53,7 @@ describe('crawler crawl rules routes', () => { }); }); - describe('PUT /api/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules/{crawlRuleId}', () => { + describe('PUT /internal/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules/{crawlRuleId}', () => { let mockRouter: MockRouter; beforeEach(() => { @@ -61,7 +61,7 @@ describe('crawler crawl rules routes', () => { mockRouter = new MockRouter({ method: 'put', path: - '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules/{crawlRuleId}', + '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules/{crawlRuleId}', }); registerCrawlerCrawlRulesRoutes({ @@ -98,7 +98,7 @@ describe('crawler crawl rules routes', () => { }); }); - describe('DELETE /api/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules/{crawlRuleId}', () => { + describe('DELETE /internal/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules/{crawlRuleId}', () => { let mockRouter: MockRouter; beforeEach(() => { @@ -106,7 +106,7 @@ describe('crawler crawl rules routes', () => { mockRouter = new MockRouter({ method: 'delete', path: - '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules/{crawlRuleId}', + '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules/{crawlRuleId}', }); registerCrawlerCrawlRulesRoutes({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_crawl_rules.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_crawl_rules.ts index 9367ba4492558..a360129b07523 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_crawl_rules.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_crawl_rules.ts @@ -15,7 +15,7 @@ export function registerCrawlerCrawlRulesRoutes({ }: RouteDependencies) { router.post( { - path: '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules', + path: '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules', validate: { params: schema.object({ engineName: schema.string(), @@ -39,7 +39,7 @@ export function registerCrawlerCrawlRulesRoutes({ router.put( { path: - '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules/{crawlRuleId}', + '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules/{crawlRuleId}', validate: { params: schema.object({ engineName: schema.string(), @@ -65,7 +65,7 @@ export function registerCrawlerCrawlRulesRoutes({ router.delete( { path: - '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules/{crawlRuleId}', + '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/crawl_rules/{crawlRuleId}', validate: { params: schema.object({ engineName: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_entry_points.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_entry_points.test.ts index cdfb397b47c7e..d59a8e32045ec 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_entry_points.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_entry_points.test.ts @@ -10,14 +10,14 @@ import { mockDependencies, mockRequestHandler, MockRouter } from '../../__mocks_ import { registerCrawlerEntryPointRoutes } from './crawler_entry_points'; describe('crawler entry point routes', () => { - describe('POST /api/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points', () => { + describe('POST /internal/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points', + path: '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points', }); registerCrawlerEntryPointRoutes({ @@ -51,7 +51,7 @@ describe('crawler entry point routes', () => { }); }); - describe('PUT /api/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points/{entryPointId}', () => { + describe('PUT /internal/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points/{entryPointId}', () => { let mockRouter: MockRouter; beforeEach(() => { @@ -59,7 +59,7 @@ describe('crawler entry point routes', () => { mockRouter = new MockRouter({ method: 'put', path: - '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points/{entryPointId}', + '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points/{entryPointId}', }); registerCrawlerEntryPointRoutes({ @@ -93,7 +93,7 @@ describe('crawler entry point routes', () => { }); }); - describe('DELETE /api/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points/{entryPointId}', () => { + describe('DELETE /internal/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points/{entryPointId}', () => { let mockRouter: MockRouter; beforeEach(() => { @@ -101,7 +101,7 @@ describe('crawler entry point routes', () => { mockRouter = new MockRouter({ method: 'delete', path: - '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points/{entryPointId}', + '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points/{entryPointId}', }); registerCrawlerEntryPointRoutes({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_entry_points.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_entry_points.ts index 88cb58f70953c..224a79bbf6cb8 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_entry_points.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_entry_points.ts @@ -15,7 +15,7 @@ export function registerCrawlerEntryPointRoutes({ }: RouteDependencies) { router.post( { - path: '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points', + path: '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points', validate: { params: schema.object({ engineName: schema.string(), @@ -37,7 +37,7 @@ export function registerCrawlerEntryPointRoutes({ router.put( { path: - '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points/{entryPointId}', + '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points/{entryPointId}', validate: { params: schema.object({ engineName: schema.string(), @@ -60,7 +60,7 @@ export function registerCrawlerEntryPointRoutes({ router.delete( { path: - '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points/{entryPointId}', + '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/entry_points/{entryPointId}', validate: { params: schema.object({ engineName: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_sitemaps.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_sitemaps.test.ts index 21ff58e2d85ef..88fef87e60470 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_sitemaps.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_sitemaps.test.ts @@ -10,14 +10,14 @@ import { mockDependencies, mockRequestHandler, MockRouter } from '../../__mocks_ import { registerCrawlerSitemapRoutes } from './crawler_sitemaps'; describe('crawler sitemap routes', () => { - describe('POST /api/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps', () => { + describe('POST /internal/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps', + path: '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps', }); registerCrawlerSitemapRoutes({ @@ -51,7 +51,7 @@ describe('crawler sitemap routes', () => { }); }); - describe('PUT /api/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps/{sitemapId}', () => { + describe('PUT /internal/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps/{sitemapId}', () => { let mockRouter: MockRouter; beforeEach(() => { @@ -59,7 +59,7 @@ describe('crawler sitemap routes', () => { mockRouter = new MockRouter({ method: 'put', path: - '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps/{sitemapId}', + '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps/{sitemapId}', }); registerCrawlerSitemapRoutes({ @@ -93,7 +93,7 @@ describe('crawler sitemap routes', () => { }); }); - describe('DELETE /api/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps/{sitemapId}', () => { + describe('DELETE /internal/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps/{sitemapId}', () => { let mockRouter: MockRouter; beforeEach(() => { @@ -101,7 +101,7 @@ describe('crawler sitemap routes', () => { mockRouter = new MockRouter({ method: 'delete', path: - '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps/{sitemapId}', + '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps/{sitemapId}', }); registerCrawlerSitemapRoutes({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_sitemaps.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_sitemaps.ts index ab4c390243d37..c3ae90349b95a 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_sitemaps.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler_sitemaps.ts @@ -15,7 +15,7 @@ export function registerCrawlerSitemapRoutes({ }: RouteDependencies) { router.post( { - path: '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps', + path: '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps', validate: { params: schema.object({ engineName: schema.string(), @@ -36,7 +36,8 @@ export function registerCrawlerSitemapRoutes({ router.put( { - path: '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps/{sitemapId}', + path: + '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps/{sitemapId}', validate: { params: schema.object({ engineName: schema.string(), @@ -58,7 +59,8 @@ export function registerCrawlerSitemapRoutes({ router.delete( { - path: '/api/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps/{sitemapId}', + path: + '/internal/app_search/engines/{engineName}/crawler/domains/{domainId}/sitemaps/{sitemapId}', validate: { params: schema.object({ engineName: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/credentials.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/credentials.test.ts index 18fce922e470d..292d9200f2a4e 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/credentials.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/credentials.test.ts @@ -10,14 +10,14 @@ import { MockRouter, mockRequestHandler, mockDependencies } from '../../__mocks_ import { registerCredentialsRoutes } from './credentials'; describe('credentials routes', () => { - describe('GET /api/app_search/credentials', () => { + describe('GET /internal/app_search/credentials', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/credentials', + path: '/internal/app_search/credentials', }); registerCredentialsRoutes({ @@ -50,14 +50,14 @@ describe('credentials routes', () => { }); }); - describe('POST /api/app_search/credentials', () => { + describe('POST /internal/app_search/credentials', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/credentials', + path: '/internal/app_search/credentials', }); registerCredentialsRoutes({ @@ -162,14 +162,14 @@ describe('credentials routes', () => { }); }); - describe('GET /api/app_search/credentials/details', () => { + describe('GET /internal/app_search/credentials/details', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/credentials/details', + path: '/internal/app_search/credentials/details', }); registerCredentialsRoutes({ @@ -185,14 +185,14 @@ describe('credentials routes', () => { }); }); - describe('PUT /api/app_search/credentials/{name}', () => { + describe('PUT /internal/app_search/credentials/{name}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/app_search/credentials/{name}', + path: '/internal/app_search/credentials/{name}', }); registerCredentialsRoutes({ @@ -297,14 +297,14 @@ describe('credentials routes', () => { }); }); - describe('DELETE /api/app_search/credentials/{name}', () => { + describe('DELETE /internal/app_search/credentials/{name}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'delete', - path: '/api/app_search/credentials/{name}', + path: '/internal/app_search/credentials/{name}', }); registerCredentialsRoutes({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/credentials.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/credentials.ts index 22edb16f0aca6..b1916479a39ac 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/credentials.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/credentials.ts @@ -37,7 +37,7 @@ export function registerCredentialsRoutes({ // Credentials API router.get( { - path: '/api/app_search/credentials', + path: '/internal/app_search/credentials', validate: { query: schema.object({ 'page[current]': schema.number(), @@ -51,7 +51,7 @@ export function registerCredentialsRoutes({ ); router.post( { - path: '/api/app_search/credentials', + path: '/internal/app_search/credentials', validate: { body: tokenSchema, }, @@ -64,7 +64,7 @@ export function registerCredentialsRoutes({ // TODO: It would be great to remove this someday router.get( { - path: '/api/app_search/credentials/details', + path: '/internal/app_search/credentials/details', validate: false, }, enterpriseSearchRequestHandler.createRequest({ @@ -75,7 +75,7 @@ export function registerCredentialsRoutes({ // Single credential API router.put( { - path: '/api/app_search/credentials/{name}', + path: '/internal/app_search/credentials/{name}', validate: { params: schema.object({ name: schema.string(), @@ -89,7 +89,7 @@ export function registerCredentialsRoutes({ ); router.delete( { - path: '/api/app_search/credentials/{name}', + path: '/internal/app_search/credentials/{name}', validate: { params: schema.object({ name: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/curations.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/curations.test.ts index 08e123a98cd31..b930b449e97d1 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/curations.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/curations.test.ts @@ -10,14 +10,14 @@ import { MockRouter, mockRequestHandler, mockDependencies } from '../../__mocks_ import { registerCurationsRoutes } from './curations'; describe('curations routes', () => { - describe('GET /api/app_search/engines/{engineName}/curations', () => { + describe('GET /internal/app_search/engines/{engineName}/curations', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{engineName}/curations', + path: '/internal/app_search/engines/{engineName}/curations', }); registerCurationsRoutes({ @@ -50,14 +50,14 @@ describe('curations routes', () => { }); }); - describe('POST /api/app_search/engines/{engineName}/curations', () => { + describe('POST /internal/app_search/engines/{engineName}/curations', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/engines/{engineName}/curations', + path: '/internal/app_search/engines/{engineName}/curations', }); registerCurationsRoutes({ @@ -107,14 +107,14 @@ describe('curations routes', () => { }); }); - describe('DELETE /api/app_search/engines/{engineName}/curations/{curationId}', () => { + describe('DELETE /internal/app_search/engines/{engineName}/curations/{curationId}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'delete', - path: '/api/app_search/engines/{engineName}/curations/{curationId}', + path: '/internal/app_search/engines/{engineName}/curations/{curationId}', }); registerCurationsRoutes({ @@ -130,14 +130,14 @@ describe('curations routes', () => { }); }); - describe('GET /api/app_search/engines/{engineName}/curations/{curationId}', () => { + describe('GET /internal/app_search/engines/{engineName}/curations/{curationId}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{engineName}/curations/{curationId}', + path: '/internal/app_search/engines/{engineName}/curations/{curationId}', }); registerCurationsRoutes({ @@ -153,14 +153,14 @@ describe('curations routes', () => { }); }); - describe('PUT /api/app_search/engines/{engineName}/curations/{curationId}', () => { + describe('PUT /internal/app_search/engines/{engineName}/curations/{curationId}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/app_search/engines/{engineName}/curations/{curationId}', + path: '/internal/app_search/engines/{engineName}/curations/{curationId}', }); registerCurationsRoutes({ @@ -195,14 +195,14 @@ describe('curations routes', () => { }); }); - describe('GET /api/app_search/engines/{engineName}/curations/find_or_create', () => { + describe('GET /internal/app_search/engines/{engineName}/curations/find_or_create', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{engineName}/curations/find_or_create', + path: '/internal/app_search/engines/{engineName}/curations/find_or_create', }); registerCurationsRoutes({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/curations.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/curations.ts index 83c40b0fbc3d4..b6ef8c8acafa5 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/curations.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/curations.ts @@ -15,7 +15,7 @@ export function registerCurationsRoutes({ }: RouteDependencies) { router.get( { - path: '/api/app_search/engines/{engineName}/curations', + path: '/internal/app_search/engines/{engineName}/curations', validate: { params: schema.object({ engineName: schema.string(), @@ -33,7 +33,7 @@ export function registerCurationsRoutes({ router.post( { - path: '/api/app_search/engines/{engineName}/curations', + path: '/internal/app_search/engines/{engineName}/curations', validate: { params: schema.object({ engineName: schema.string(), @@ -50,7 +50,7 @@ export function registerCurationsRoutes({ router.delete( { - path: '/api/app_search/engines/{engineName}/curations/{curationId}', + path: '/internal/app_search/engines/{engineName}/curations/{curationId}', validate: { params: schema.object({ engineName: schema.string(), @@ -65,7 +65,7 @@ export function registerCurationsRoutes({ router.get( { - path: '/api/app_search/engines/{engineName}/curations/{curationId}', + path: '/internal/app_search/engines/{engineName}/curations/{curationId}', validate: { query: schema.object({ skip_record_analytics: schema.string(), @@ -83,7 +83,7 @@ export function registerCurationsRoutes({ router.put( { - path: '/api/app_search/engines/{engineName}/curations/{curationId}', + path: '/internal/app_search/engines/{engineName}/curations/{curationId}', validate: { params: schema.object({ engineName: schema.string(), @@ -104,7 +104,7 @@ export function registerCurationsRoutes({ router.get( { - path: '/api/app_search/engines/{engineName}/curations/find_or_create', + path: '/internal/app_search/engines/{engineName}/curations/find_or_create', validate: { params: schema.object({ engineName: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/documents.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/documents.test.ts index b584412a7a8f3..efccb5d3f6e3c 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/documents.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/documents.test.ts @@ -10,14 +10,14 @@ import { MockRouter, mockRequestHandler, mockDependencies } from '../../__mocks_ import { registerDocumentsRoutes, registerDocumentRoutes } from './documents'; describe('documents routes', () => { - describe('POST /api/app_search/engines/{engineName}/documents', () => { + describe('POST /internal/app_search/engines/{engineName}/documents', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/engines/{engineName}/documents', + path: '/internal/app_search/engines/{engineName}/documents', }); registerDocumentsRoutes({ @@ -35,14 +35,14 @@ describe('documents routes', () => { }); describe('document routes', () => { - describe('GET /api/app_search/engines/{engineName}/documents/{documentId}', () => { + describe('GET /internal/app_search/engines/{engineName}/documents/{documentId}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{engineName}/documents/{documentId}', + path: '/internal/app_search/engines/{engineName}/documents/{documentId}', }); registerDocumentRoutes({ @@ -58,14 +58,14 @@ describe('document routes', () => { }); }); - describe('DELETE /api/app_search/engines/{engineName}/documents/{documentId}', () => { + describe('DELETE /internal/app_search/engines/{engineName}/documents/{documentId}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'delete', - path: '/api/app_search/engines/{engineName}/documents/{documentId}', + path: '/internal/app_search/engines/{engineName}/documents/{documentId}', }); registerDocumentRoutes({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/documents.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/documents.ts index 929e9f7aef690..f0af2fb351813 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/documents.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/documents.ts @@ -17,7 +17,7 @@ export function registerDocumentsRoutes({ }: RouteDependencies) { router.post( skipBodyValidation({ - path: '/api/app_search/engines/{engineName}/documents', + path: '/internal/app_search/engines/{engineName}/documents', validate: { params: schema.object({ engineName: schema.string(), @@ -36,7 +36,7 @@ export function registerDocumentRoutes({ }: RouteDependencies) { router.get( { - path: '/api/app_search/engines/{engineName}/documents/{documentId}', + path: '/internal/app_search/engines/{engineName}/documents/{documentId}', validate: { params: schema.object({ engineName: schema.string(), @@ -50,7 +50,7 @@ export function registerDocumentRoutes({ ); router.delete( { - path: '/api/app_search/engines/{engineName}/documents/{documentId}', + path: '/internal/app_search/engines/{engineName}/documents/{documentId}', validate: { params: schema.object({ engineName: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/engines.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/engines.test.ts index c653cad5c1c0d..7c8a611cebb3e 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/engines.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/engines.test.ts @@ -10,7 +10,7 @@ import { MockRouter, mockRequestHandler, mockDependencies } from '../../__mocks_ import { registerEnginesRoutes } from './engines'; describe('engine routes', () => { - describe('GET /api/app_search/engines', () => { + describe('GET /internal/app_search/engines', () => { const mockRequest = { query: { type: 'indexed', @@ -25,7 +25,7 @@ describe('engine routes', () => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines', + path: '/internal/app_search/engines', }); registerEnginesRoutes({ @@ -98,14 +98,14 @@ describe('engine routes', () => { }); }); - describe('POST /api/app_search/engines', () => { + describe('POST /internal/app_search/engines', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/engines', + path: '/internal/app_search/engines', }); registerEnginesRoutes({ @@ -176,14 +176,14 @@ describe('engine routes', () => { }); }); - describe('GET /api/app_search/engines/{name}', () => { + describe('GET /internal/app_search/engines/{name}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{name}', + path: '/internal/app_search/engines/{name}', }); registerEnginesRoutes({ @@ -199,14 +199,14 @@ describe('engine routes', () => { }); }); - describe('DELETE /api/app_search/engines/{name}', () => { + describe('DELETE /internal/app_search/engines/{name}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'delete', - path: '/api/app_search/engines/{name}', + path: '/internal/app_search/engines/{name}', }); registerEnginesRoutes({ @@ -237,14 +237,14 @@ describe('engine routes', () => { }); }); - describe('GET /api/app_search/engines/{name}/overview', () => { + describe('GET /internal/app_search/engines/{name}/overview', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{name}/overview', + path: '/internal/app_search/engines/{name}/overview', }); registerEnginesRoutes({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/engines.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/engines.ts index 77b055add7d79..a53379ef44c67 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/engines.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/engines.ts @@ -20,7 +20,7 @@ export function registerEnginesRoutes({ }: RouteDependencies) { router.get( { - path: '/api/app_search/engines', + path: '/internal/app_search/engines', validate: { query: schema.object({ type: schema.oneOf([schema.literal('indexed'), schema.literal('meta')]), @@ -40,7 +40,7 @@ export function registerEnginesRoutes({ router.post( { - path: '/api/app_search/engines', + path: '/internal/app_search/engines', validate: { body: schema.object({ name: schema.string(), @@ -58,7 +58,7 @@ export function registerEnginesRoutes({ // Single engine endpoints router.get( { - path: '/api/app_search/engines/{name}', + path: '/internal/app_search/engines/{name}', validate: { params: schema.object({ name: schema.string(), @@ -71,7 +71,7 @@ export function registerEnginesRoutes({ ); router.delete( { - path: '/api/app_search/engines/{name}', + path: '/internal/app_search/engines/{name}', validate: { params: schema.object({ name: schema.string(), @@ -84,7 +84,7 @@ export function registerEnginesRoutes({ ); router.get( { - path: '/api/app_search/engines/{name}/overview', + path: '/internal/app_search/engines/{name}/overview', validate: { params: schema.object({ name: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/onboarding.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/onboarding.test.ts index 47b480f61341a..8990a9e1eeab4 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/onboarding.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/onboarding.test.ts @@ -10,14 +10,14 @@ import { MockRouter, mockRequestHandler, mockDependencies } from '../../__mocks_ import { registerOnboardingRoutes } from './onboarding'; describe('engine routes', () => { - describe('POST /api/app_search/onboarding_complete', () => { + describe('POST /internal/app_search/onboarding_complete', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/onboarding_complete', + path: '/internal/app_search/onboarding_complete', }); registerOnboardingRoutes({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/onboarding.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/onboarding.ts index 147f935a56aed..b61c49c06b905 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/onboarding.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/onboarding.ts @@ -15,7 +15,7 @@ export function registerOnboardingRoutes({ }: RouteDependencies) { router.post( { - path: '/api/app_search/onboarding_complete', + path: '/internal/app_search/onboarding_complete', validate: { body: schema.object({ seed_sample_engine: schema.maybe(schema.boolean()), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/result_settings.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/result_settings.test.ts index 58f69e4abf968..d82eb06fce68e 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/result_settings.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/result_settings.test.ts @@ -22,10 +22,10 @@ const resultFields = { }; describe('result settings routes', () => { - describe('GET /api/app_search/engines/{name}/result_settings/details', () => { + describe('GET /internal/app_search/engines/{name}/result_settings/details', () => { const mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{engineName}/result_settings/details', + path: '/internal/app_search/engines/{engineName}/result_settings/details', }); beforeEach(() => { @@ -46,10 +46,10 @@ describe('result settings routes', () => { }); }); - describe('PUT /api/app_search/engines/{name}/result_settings', () => { + describe('PUT /internal/app_search/engines/{name}/result_settings', () => { const mockRouter = new MockRouter({ method: 'put', - path: '/api/app_search/engines/{engineName}/result_settings', + path: '/internal/app_search/engines/{engineName}/result_settings', }); beforeEach(() => { diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/result_settings.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/result_settings.ts index d028440908173..0a5bd5af8edf6 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/result_settings.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/result_settings.ts @@ -17,7 +17,7 @@ export function registerResultSettingsRoutes({ }: RouteDependencies) { router.get( { - path: '/api/app_search/engines/{engineName}/result_settings/details', + path: '/internal/app_search/engines/{engineName}/result_settings/details', validate: { params: schema.object({ engineName: schema.string(), @@ -31,7 +31,7 @@ export function registerResultSettingsRoutes({ router.put( skipBodyValidation({ - path: '/api/app_search/engines/{engineName}/result_settings', + path: '/internal/app_search/engines/{engineName}/result_settings', validate: { params: schema.object({ engineName: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/role_mappings.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/role_mappings.test.ts index dfb9765f834b6..ee942a3383845 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/role_mappings.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/role_mappings.test.ts @@ -23,14 +23,14 @@ const roleMappingBaseSchema = { }; describe('role mappings routes', () => { - describe('POST /api/app_search/role_mappings/enable_role_based_access', () => { + describe('POST /internal/app_search/role_mappings/enable_role_based_access', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/role_mappings/enable_role_based_access', + path: '/internal/app_search/role_mappings/enable_role_based_access', }); registerEnableRoleMappingsRoute({ @@ -46,14 +46,14 @@ describe('role mappings routes', () => { }); }); - describe('GET /api/app_search/role_mappings', () => { + describe('GET /internal/app_search/role_mappings', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/role_mappings', + path: '/internal/app_search/role_mappings', }); registerRoleMappingsRoute({ @@ -69,14 +69,14 @@ describe('role mappings routes', () => { }); }); - describe('POST /api/app_search/role_mappings', () => { + describe('POST /internal/app_search/role_mappings', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/role_mappings', + path: '/internal/app_search/role_mappings', }); registerRoleMappingsRoute({ @@ -104,14 +104,14 @@ describe('role mappings routes', () => { }); }); - describe('PUT /api/app_search/role_mappings/{id}', () => { + describe('PUT /internal/app_search/role_mappings/{id}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/app_search/role_mappings/{id}', + path: '/internal/app_search/role_mappings/{id}', }); registerRoleMappingRoute({ @@ -139,14 +139,14 @@ describe('role mappings routes', () => { }); }); - describe('DELETE /api/app_search/role_mappings/{id}', () => { + describe('DELETE /internal/app_search/role_mappings/{id}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'delete', - path: '/api/app_search/role_mappings/{id}', + path: '/internal/app_search/role_mappings/{id}', }); registerRoleMappingRoute({ @@ -162,14 +162,14 @@ describe('role mappings routes', () => { }); }); - describe('POST /api/app_search/single_user_role_mapping', () => { + describe('POST /internal/app_search/single_user_role_mapping', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/single_user_role_mapping', + path: '/internal/app_search/single_user_role_mapping', }); registerUserRoute({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/role_mappings.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/role_mappings.ts index d90a005cb2532..9ae935ea3b052 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/role_mappings.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/role_mappings.ts @@ -23,7 +23,7 @@ export function registerEnableRoleMappingsRoute({ }: RouteDependencies) { router.post( { - path: '/api/app_search/role_mappings/enable_role_based_access', + path: '/internal/app_search/role_mappings/enable_role_based_access', validate: false, }, enterpriseSearchRequestHandler.createRequest({ @@ -38,7 +38,7 @@ export function registerRoleMappingsRoute({ }: RouteDependencies) { router.get( { - path: '/api/app_search/role_mappings', + path: '/internal/app_search/role_mappings', validate: false, }, enterpriseSearchRequestHandler.createRequest({ @@ -48,7 +48,7 @@ export function registerRoleMappingsRoute({ router.post( { - path: '/api/app_search/role_mappings', + path: '/internal/app_search/role_mappings', validate: { body: schema.object(roleMappingBaseSchema), }, @@ -65,7 +65,7 @@ export function registerRoleMappingRoute({ }: RouteDependencies) { router.put( { - path: '/api/app_search/role_mappings/{id}', + path: '/internal/app_search/role_mappings/{id}', validate: { body: schema.object(roleMappingBaseSchema), params: schema.object({ @@ -80,7 +80,7 @@ export function registerRoleMappingRoute({ router.delete( { - path: '/api/app_search/role_mappings/{id}', + path: '/internal/app_search/role_mappings/{id}', validate: { params: schema.object({ id: schema.string(), @@ -96,7 +96,7 @@ export function registerRoleMappingRoute({ export function registerUserRoute({ router, enterpriseSearchRequestHandler }: RouteDependencies) { router.post( { - path: '/api/app_search/single_user_role_mapping', + path: '/internal/app_search/single_user_role_mapping', validate: { body: schema.object({ roleMapping: schema.object({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/schema.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/schema.test.ts index 408838a4de31b..79d445aace90e 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/schema.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/schema.test.ts @@ -10,14 +10,14 @@ import { MockRouter, mockRequestHandler, mockDependencies } from '../../__mocks_ import { registerSchemaRoutes } from './schema'; describe('schema routes', () => { - describe('GET /api/app_search/engines/{engineName}/schema', () => { + describe('GET /internal/app_search/engines/{engineName}/schema', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{engineName}/schema', + path: '/internal/app_search/engines/{engineName}/schema', }); registerSchemaRoutes({ @@ -33,14 +33,14 @@ describe('schema routes', () => { }); }); - describe('POST /api/app_search/engines/{engineName}/schema', () => { + describe('POST /internal/app_search/engines/{engineName}/schema', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/engines/{engineName}/schema', + path: '/internal/app_search/engines/{engineName}/schema', }); registerSchemaRoutes({ @@ -56,14 +56,14 @@ describe('schema routes', () => { }); }); - describe('GET /api/app_search/engines/{engineName}/reindex_job/{reindexJobId}', () => { + describe('GET /internal/app_search/engines/{engineName}/reindex_job/{reindexJobId}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{engineName}/reindex_job/{reindexJobId}', + path: '/internal/app_search/engines/{engineName}/reindex_job/{reindexJobId}', }); registerSchemaRoutes({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/schema.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/schema.ts index 74d07bd2bf75d..98f13e4564cc5 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/schema.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/schema.ts @@ -16,7 +16,7 @@ export function registerSchemaRoutes({ }: RouteDependencies) { router.get( { - path: '/api/app_search/engines/{engineName}/schema', + path: '/internal/app_search/engines/{engineName}/schema', validate: { params: schema.object({ engineName: schema.string(), @@ -30,7 +30,7 @@ export function registerSchemaRoutes({ router.post( skipBodyValidation({ - path: '/api/app_search/engines/{engineName}/schema', + path: '/internal/app_search/engines/{engineName}/schema', validate: { params: schema.object({ engineName: schema.string(), @@ -44,7 +44,7 @@ export function registerSchemaRoutes({ router.get( { - path: '/api/app_search/engines/{engineName}/reindex_job/{reindexJobId}', + path: '/internal/app_search/engines/{engineName}/reindex_job/{reindexJobId}', validate: { params: schema.object({ engineName: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/search.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/search.test.ts index 7c81d20334a5a..972bcaa8891be 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/search.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/search.test.ts @@ -10,14 +10,14 @@ import { MockRouter, mockRequestHandler, mockDependencies } from '../../__mocks_ import { registerSearchRoutes } from './search'; describe('search routes', () => { - describe('GET /api/app_search/engines/{engineName}/search', () => { + describe('GET /internal/app_search/engines/{engineName}/search', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{engineName}/schema', + path: '/internal/app_search/engines/{engineName}/schema', }); registerSearchRoutes({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/search.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/search.ts index 551ad8938abbb..1150866bc1aa4 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/search.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/search.ts @@ -24,7 +24,7 @@ export function registerSearchRoutes({ }: RouteDependencies) { router.post( skipBodyValidation({ - path: '/api/app_search/engines/{engineName}/search', + path: '/internal/app_search/engines/{engineName}/search', validate: { params: schema.object({ engineName: schema.string(), @@ -44,7 +44,7 @@ export function registerSearchRoutes({ // requests through Kibana's server. router.post( skipBodyValidation({ - path: '/api/app_search/search-ui/api/as/v1/engines/{engineName}/search.json', + path: '/internal/app_search/search-ui/api/as/v1/engines/{engineName}/search.json', validate: { params: schema.object({ engineName: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/search_settings.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/search_settings.test.ts index 7ea533af5da75..56e60db543c5d 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/search_settings.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/search_settings.test.ts @@ -60,10 +60,10 @@ describe('search settings routes', () => { jest.clearAllMocks(); }); - describe('GET /api/app_search/engines/{name}/search_settings/details', () => { + describe('GET /internal/app_search/engines/{name}/search_settings/details', () => { const mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{engineName}/search_settings/details', + path: '/internal/app_search/engines/{engineName}/search_settings/details', }); beforeEach(() => { @@ -84,10 +84,10 @@ describe('search settings routes', () => { }); }); - describe('PUT /api/app_search/engines/{name}/search_settings', () => { + describe('PUT /internal/app_search/engines/{name}/search_settings', () => { const mockRouter = new MockRouter({ method: 'put', - path: '/api/app_search/engines/{engineName}/search_settings', + path: '/internal/app_search/engines/{engineName}/search_settings', }); beforeEach(() => { @@ -109,10 +109,10 @@ describe('search settings routes', () => { }); }); - describe('POST /api/app_search/engines/{name}/search_settings/reset', () => { + describe('POST /internal/app_search/engines/{name}/search_settings/reset', () => { const mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/engines/{engineName}/search_settings/reset', + path: '/internal/app_search/engines/{engineName}/search_settings/reset', }); beforeEach(() => { diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/search_settings.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/search_settings.ts index 31a8cc09ed839..2dd097a17bf64 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/search_settings.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/search_settings.ts @@ -17,7 +17,7 @@ export function registerSearchSettingsRoutes({ }: RouteDependencies) { router.get( { - path: '/api/app_search/engines/{engineName}/search_settings/details', + path: '/internal/app_search/engines/{engineName}/search_settings/details', validate: { params: schema.object({ engineName: schema.string(), @@ -31,7 +31,7 @@ export function registerSearchSettingsRoutes({ router.post( { - path: '/api/app_search/engines/{engineName}/search_settings/reset', + path: '/internal/app_search/engines/{engineName}/search_settings/reset', validate: { params: schema.object({ engineName: schema.string(), @@ -45,7 +45,7 @@ export function registerSearchSettingsRoutes({ router.put( skipBodyValidation({ - path: '/api/app_search/engines/{engineName}/search_settings', + path: '/internal/app_search/engines/{engineName}/search_settings', validate: { params: schema.object({ engineName: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/search_ui.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/search_ui.test.ts index ae308c8397536..fa0694fed9d03 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/search_ui.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/search_ui.test.ts @@ -14,10 +14,10 @@ describe('reference application routes', () => { jest.clearAllMocks(); }); - describe('GET /api/app_search/engines/{engineName}/search_settings/details', () => { + describe('GET /internal/app_search/engines/{engineName}/search_settings/details', () => { const mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{engineName}/search_ui/field_config', + path: '/internal/app_search/engines/{engineName}/search_ui/field_config', }); beforeEach(() => { diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/search_ui.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/search_ui.ts index 33684843b218a..2a9d99e6e5882 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/search_ui.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/search_ui.ts @@ -15,7 +15,7 @@ export function registerSearchUIRoutes({ }: RouteDependencies) { router.get( { - path: '/api/app_search/engines/{engineName}/search_ui/field_config', + path: '/internal/app_search/engines/{engineName}/search_ui/field_config', validate: { params: schema.object({ engineName: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/settings.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/settings.test.ts index 6df9a4f16d710..aff9cd17dd001 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/settings.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/settings.test.ts @@ -10,14 +10,14 @@ import { MockRouter, mockRequestHandler, mockDependencies } from '../../__mocks_ import { registerSettingsRoutes } from './settings'; describe('log settings routes', () => { - describe('GET /api/app_search/log_settings', () => { + describe('GET /internal/app_search/log_settings', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/log_settings', + path: '/internal/app_search/log_settings', }); registerSettingsRoutes({ @@ -33,14 +33,14 @@ describe('log settings routes', () => { }); }); - describe('PUT /api/app_search/log_settings', () => { + describe('PUT /internal/app_search/log_settings', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/app_search/log_settings', + path: '/internal/app_search/log_settings', }); registerSettingsRoutes({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/settings.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/settings.ts index 8c6812199051f..b83dfd9d9ef15 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/settings.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/settings.ts @@ -15,7 +15,7 @@ export function registerSettingsRoutes({ }: RouteDependencies) { router.get( { - path: '/api/app_search/log_settings', + path: '/internal/app_search/log_settings', validate: false, }, enterpriseSearchRequestHandler.createRequest({ @@ -25,7 +25,7 @@ export function registerSettingsRoutes({ router.put( { - path: '/api/app_search/log_settings', + path: '/internal/app_search/log_settings', validate: { body: schema.object({ api: schema.maybe( diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/source_engines.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/source_engines.test.ts index 5b51048067c00..67edcc356e902 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/source_engines.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/source_engines.test.ts @@ -10,14 +10,14 @@ import { MockRouter, mockRequestHandler, mockDependencies } from '../../__mocks_ import { registerSourceEnginesRoutes } from './source_engines'; describe('source engine routes', () => { - describe('GET /api/app_search/engines/{name}/source_engines', () => { + describe('GET /internal/app_search/engines/{name}/source_engines', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{name}/source_engines', + path: '/internal/app_search/engines/{name}/source_engines', }); registerSourceEnginesRoutes({ @@ -53,14 +53,14 @@ describe('source engine routes', () => { }); }); - describe('POST /api/app_search/engines/{name}/source_engines/bulk_create', () => { + describe('POST /internal/app_search/engines/{name}/source_engines/bulk_create', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/engines/{name}/source_engines/bulk_create', + path: '/internal/app_search/engines/{name}/source_engines/bulk_create', }); registerSourceEnginesRoutes({ @@ -96,14 +96,14 @@ describe('source engine routes', () => { }); }); - describe('DELETE /api/app_search/engines/{name}/source_engines/{source_engine_name}', () => { + describe('DELETE /internal/app_search/engines/{name}/source_engines/{source_engine_name}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'delete', - path: '/api/app_search/engines/{name}/source_engines/{source_engine_name}', + path: '/internal/app_search/engines/{name}/source_engines/{source_engine_name}', }); registerSourceEnginesRoutes({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/source_engines.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/source_engines.ts index 8e55b0e6f1ac6..1d41a82287b0e 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/source_engines.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/source_engines.ts @@ -15,7 +15,7 @@ export function registerSourceEnginesRoutes({ }: RouteDependencies) { router.get( { - path: '/api/app_search/engines/{name}/source_engines', + path: '/internal/app_search/engines/{name}/source_engines', validate: { params: schema.object({ name: schema.string(), @@ -33,7 +33,7 @@ export function registerSourceEnginesRoutes({ router.post( { - path: '/api/app_search/engines/{name}/source_engines/bulk_create', + path: '/internal/app_search/engines/{name}/source_engines/bulk_create', validate: { params: schema.object({ name: schema.string(), @@ -50,7 +50,7 @@ export function registerSourceEnginesRoutes({ router.delete( { - path: '/api/app_search/engines/{name}/source_engines/{source_engine_name}', + path: '/internal/app_search/engines/{name}/source_engines/{source_engine_name}', validate: { params: schema.object({ name: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/synonyms.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/synonyms.test.ts index 53ceefc736d20..0007b3f27cff0 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/synonyms.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/synonyms.test.ts @@ -10,14 +10,14 @@ import { MockRouter, mockRequestHandler, mockDependencies } from '../../__mocks_ import { registerSynonymsRoutes } from './synonyms'; describe('synonyms routes', () => { - describe('GET /api/app_search/engines/{engineName}/synonyms', () => { + describe('GET /internal/app_search/engines/{engineName}/synonyms', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/app_search/engines/{engineName}/synonyms', + path: '/internal/app_search/engines/{engineName}/synonyms', }); registerSynonymsRoutes({ @@ -50,14 +50,14 @@ describe('synonyms routes', () => { }); }); - describe('POST /api/app_search/engines/{engineName}/synonyms', () => { + describe('POST /internal/app_search/engines/{engineName}/synonyms', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/app_search/engines/{engineName}/synonyms', + path: '/internal/app_search/engines/{engineName}/synonyms', }); registerSynonymsRoutes({ @@ -73,14 +73,14 @@ describe('synonyms routes', () => { }); }); - describe('PUT /api/app_search/engines/{engineName}/synonyms/{synonymId}', () => { + describe('PUT /internal/app_search/engines/{engineName}/synonyms/{synonymId}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/app_search/engines/{engineName}/synonyms/{synonymId}', + path: '/internal/app_search/engines/{engineName}/synonyms/{synonymId}', }); registerSynonymsRoutes({ @@ -96,14 +96,14 @@ describe('synonyms routes', () => { }); }); - describe('DELETE /api/app_search/engines/{engineName}/synonyms/{synonymId}', () => { + describe('DELETE /internal/app_search/engines/{engineName}/synonyms/{synonymId}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'delete', - path: '/api/app_search/engines/{engineName}/synonyms/{synonymId}', + path: '/internal/app_search/engines/{engineName}/synonyms/{synonymId}', }); registerSynonymsRoutes({ diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/synonyms.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/synonyms.ts index d9b0cf1b9289f..0c9682bb983d4 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/synonyms.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/synonyms.ts @@ -16,7 +16,7 @@ export function registerSynonymsRoutes({ }: RouteDependencies) { router.get( { - path: '/api/app_search/engines/{engineName}/synonyms', + path: '/internal/app_search/engines/{engineName}/synonyms', validate: { params: schema.object({ engineName: schema.string(), @@ -34,7 +34,7 @@ export function registerSynonymsRoutes({ router.post( skipBodyValidation({ - path: '/api/app_search/engines/{engineName}/synonyms', + path: '/internal/app_search/engines/{engineName}/synonyms', validate: { params: schema.object({ engineName: schema.string(), @@ -48,7 +48,7 @@ export function registerSynonymsRoutes({ router.put( skipBodyValidation({ - path: '/api/app_search/engines/{engineName}/synonyms/{synonymId}', + path: '/internal/app_search/engines/{engineName}/synonyms/{synonymId}', validate: { params: schema.object({ engineName: schema.string(), @@ -63,7 +63,7 @@ export function registerSynonymsRoutes({ router.delete( { - path: '/api/app_search/engines/{engineName}/synonyms/{synonymId}', + path: '/internal/app_search/engines/{engineName}/synonyms/{synonymId}', validate: { params: schema.object({ engineName: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/config_data.test.ts b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/config_data.test.ts index b3d2733e233b3..9244ba2301132 100644 --- a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/config_data.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/config_data.test.ts @@ -21,7 +21,7 @@ describe('Enterprise Search Config Data API', () => { beforeEach(() => { mockRouter = new MockRouter({ method: 'get', - path: '/api/enterprise_search/config_data', + path: '/internal/enterprise_search/config_data', }); registerConfigDataRoute({ @@ -30,7 +30,7 @@ describe('Enterprise Search Config Data API', () => { }); }); - describe('GET /api/enterprise_search/config_data', () => { + describe('GET /internal/enterprise_search/config_data', () => { it('returns an initial set of config data from Enterprise Search', async () => { const mockData = { ...DEFAULT_INITIAL_APP_DATA, diff --git a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/config_data.ts b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/config_data.ts index e2cbd409bd396..95ab8e3c3a5a9 100644 --- a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/config_data.ts +++ b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/config_data.ts @@ -11,7 +11,7 @@ import { RouteDependencies } from '../../plugin'; export function registerConfigDataRoute({ router, config, log }: RouteDependencies) { router.get( { - path: '/api/enterprise_search/config_data', + path: '/internal/enterprise_search/config_data', validate: false, }, async (context, request, response) => { diff --git a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/telemetry.test.ts b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/telemetry.test.ts index 53ddc21cba399..d8c38204f75a9 100644 --- a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/telemetry.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/telemetry.test.ts @@ -29,7 +29,7 @@ describe('Enterprise Search Telemetry API', () => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/enterprise_search/stats', + path: '/internal/enterprise_search/stats', }); registerTelemetryRoute({ @@ -40,7 +40,7 @@ describe('Enterprise Search Telemetry API', () => { }); }); - describe('PUT /api/enterprise_search/stats', () => { + describe('PUT /internal/enterprise_search/stats', () => { it('increments the saved objects counter for App Search', async () => { (incrementUICounter as jest.Mock).mockImplementation(jest.fn(() => successResponse)); diff --git a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/telemetry.ts b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/telemetry.ts index e15be8fcd0d8b..4b272293c7d5f 100644 --- a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/telemetry.ts +++ b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/telemetry.ts @@ -23,7 +23,7 @@ const productToTelemetryMap = { export function registerTelemetryRoute({ router, getSavedObjectsService }: RouteDependencies) { router.put( { - path: '/api/enterprise_search/stats', + path: '/internal/enterprise_search/stats', validate: { body: schema.object({ product: schema.oneOf([ diff --git a/x-pack/plugins/enterprise_search/server/routes/workplace_search/groups.test.ts b/x-pack/plugins/enterprise_search/server/routes/workplace_search/groups.test.ts index 27e05cee1ba0a..40ee46c7a9ffd 100644 --- a/x-pack/plugins/enterprise_search/server/routes/workplace_search/groups.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/workplace_search/groups.test.ts @@ -17,14 +17,14 @@ import { } from './groups'; describe('groups routes', () => { - describe('GET /api/workplace_search/groups', () => { + describe('GET /internal/workplace_search/groups', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/groups', + path: '/internal/workplace_search/groups', }); registerGroupsRoute({ @@ -40,14 +40,14 @@ describe('groups routes', () => { }); }); - describe('POST /api/workplace_search/groups', () => { + describe('POST /internal/workplace_search/groups', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/workplace_search/groups', + path: '/internal/workplace_search/groups', }); registerGroupsRoute({ @@ -74,14 +74,14 @@ describe('groups routes', () => { }); }); - describe('POST /api/workplace_search/groups/search', () => { + describe('POST /internal/workplace_search/groups/search', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/workplace_search/groups/search', + path: '/internal/workplace_search/groups/search', }); registerSearchGroupsRoute({ @@ -128,14 +128,14 @@ describe('groups routes', () => { }); }); - describe('GET /api/workplace_search/groups/{id}', () => { + describe('GET /internal/workplace_search/groups/{id}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/groups/{id}', + path: '/internal/workplace_search/groups/{id}', }); registerGroupRoute({ @@ -151,14 +151,14 @@ describe('groups routes', () => { }); }); - describe('PUT /api/workplace_search/groups/{id}', () => { + describe('PUT /internal/workplace_search/groups/{id}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/workplace_search/groups/{id}', + path: '/internal/workplace_search/groups/{id}', }); registerGroupRoute({ @@ -187,14 +187,14 @@ describe('groups routes', () => { }); }); - describe('DELETE /api/workplace_search/groups/{id}', () => { + describe('DELETE /internal/workplace_search/groups/{id}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'delete', - path: '/api/workplace_search/groups/{id}', + path: '/internal/workplace_search/groups/{id}', }); registerGroupRoute({ @@ -210,14 +210,14 @@ describe('groups routes', () => { }); }); - describe('GET /api/workplace_search/groups/{id}/group_users', () => { + describe('GET /internal/workplace_search/groups/{id}/group_users', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/groups/{id}/group_users', + path: '/internal/workplace_search/groups/{id}/group_users', }); registerGroupUsersRoute({ @@ -233,14 +233,14 @@ describe('groups routes', () => { }); }); - describe('POST /api/workplace_search/groups/{id}/share', () => { + describe('POST /internal/workplace_search/groups/{id}/share', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/workplace_search/groups/{id}/share', + path: '/internal/workplace_search/groups/{id}/share', }); registerShareGroupRoute({ @@ -268,14 +268,14 @@ describe('groups routes', () => { }); }); - describe('PUT /api/workplace_search/groups/{id}/boosts', () => { + describe('PUT /internal/workplace_search/groups/{id}/boosts', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/workplace_search/groups/{id}/boosts', + path: '/internal/workplace_search/groups/{id}/boosts', }); registerBoostsGroupRoute({ diff --git a/x-pack/plugins/enterprise_search/server/routes/workplace_search/groups.ts b/x-pack/plugins/enterprise_search/server/routes/workplace_search/groups.ts index c6332fa1287a0..c5c161cf7b2f8 100644 --- a/x-pack/plugins/enterprise_search/server/routes/workplace_search/groups.ts +++ b/x-pack/plugins/enterprise_search/server/routes/workplace_search/groups.ts @@ -12,7 +12,7 @@ import { RouteDependencies } from '../../plugin'; export function registerGroupsRoute({ router, enterpriseSearchRequestHandler }: RouteDependencies) { router.get( { - path: '/api/workplace_search/groups', + path: '/internal/workplace_search/groups', validate: false, }, enterpriseSearchRequestHandler.createRequest({ @@ -22,7 +22,7 @@ export function registerGroupsRoute({ router, enterpriseSearchRequestHandler }: router.post( { - path: '/api/workplace_search/groups', + path: '/internal/workplace_search/groups', validate: { body: schema.object({ group_name: schema.string(), @@ -41,7 +41,7 @@ export function registerSearchGroupsRoute({ }: RouteDependencies) { router.post( { - path: '/api/workplace_search/groups/search', + path: '/internal/workplace_search/groups/search', validate: { body: schema.object({ page: schema.object({ @@ -65,7 +65,7 @@ export function registerSearchGroupsRoute({ export function registerGroupRoute({ router, enterpriseSearchRequestHandler }: RouteDependencies) { router.get( { - path: '/api/workplace_search/groups/{id}', + path: '/internal/workplace_search/groups/{id}', validate: { params: schema.object({ id: schema.string(), @@ -79,7 +79,7 @@ export function registerGroupRoute({ router, enterpriseSearchRequestHandler }: R router.put( { - path: '/api/workplace_search/groups/{id}', + path: '/internal/workplace_search/groups/{id}', validate: { params: schema.object({ id: schema.string(), @@ -98,7 +98,7 @@ export function registerGroupRoute({ router, enterpriseSearchRequestHandler }: R router.delete( { - path: '/api/workplace_search/groups/{id}', + path: '/internal/workplace_search/groups/{id}', validate: { params: schema.object({ id: schema.string(), @@ -117,7 +117,7 @@ export function registerGroupUsersRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/groups/{id}/group_users', + path: '/internal/workplace_search/groups/{id}/group_users', validate: { params: schema.object({ id: schema.string(), @@ -136,7 +136,7 @@ export function registerShareGroupRoute({ }: RouteDependencies) { router.post( { - path: '/api/workplace_search/groups/{id}/share', + path: '/internal/workplace_search/groups/{id}/share', validate: { params: schema.object({ id: schema.string(), @@ -158,7 +158,7 @@ export function registerBoostsGroupRoute({ }: RouteDependencies) { router.put( { - path: '/api/workplace_search/groups/{id}/boosts', + path: '/internal/workplace_search/groups/{id}/boosts', validate: { params: schema.object({ id: schema.string(), diff --git a/x-pack/plugins/enterprise_search/server/routes/workplace_search/oauth.test.ts b/x-pack/plugins/enterprise_search/server/routes/workplace_search/oauth.test.ts index b239377f6469d..ab9d5e20cfe92 100644 --- a/x-pack/plugins/enterprise_search/server/routes/workplace_search/oauth.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/workplace_search/oauth.test.ts @@ -14,7 +14,7 @@ import { } from './oauth'; describe('oauth routes', () => { - describe('GET /api/workplace_search/oauth/authorize', () => { + describe('GET /internal/workplace_search/oauth/authorize', () => { let mockRouter: MockRouter; beforeEach(() => { @@ -22,7 +22,7 @@ describe('oauth routes', () => { mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/oauth/authorize', + path: '/internal/workplace_search/oauth/authorize', }); registerOAuthAuthorizeRoute({ @@ -59,7 +59,7 @@ describe('oauth routes', () => { }); }); - describe('POST /api/workplace_search/oauth/authorize', () => { + describe('POST /internal/workplace_search/oauth/authorize', () => { let mockRouter: MockRouter; beforeEach(() => { @@ -67,7 +67,7 @@ describe('oauth routes', () => { mockRouter = new MockRouter({ method: 'post', - path: '/api/workplace_search/oauth/authorize', + path: '/internal/workplace_search/oauth/authorize', }); registerOAuthAuthorizeAcceptRoute({ @@ -100,7 +100,7 @@ describe('oauth routes', () => { }); }); - describe('DELETE /api/workplace_search/oauth/authorize', () => { + describe('DELETE /internal/workplace_search/oauth/authorize', () => { let mockRouter: MockRouter; beforeEach(() => { @@ -108,7 +108,7 @@ describe('oauth routes', () => { mockRouter = new MockRouter({ method: 'delete', - path: '/api/workplace_search/oauth/authorize', + path: '/internal/workplace_search/oauth/authorize', }); registerOAuthAuthorizeDenyRoute({ diff --git a/x-pack/plugins/enterprise_search/server/routes/workplace_search/oauth.ts b/x-pack/plugins/enterprise_search/server/routes/workplace_search/oauth.ts index a94b463499981..a87d22b6b047a 100644 --- a/x-pack/plugins/enterprise_search/server/routes/workplace_search/oauth.ts +++ b/x-pack/plugins/enterprise_search/server/routes/workplace_search/oauth.ts @@ -15,7 +15,7 @@ export function registerOAuthAuthorizeRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/oauth/authorize', + path: '/internal/workplace_search/oauth/authorize', validate: { query: schema.object({ access_type: schema.maybe(schema.string()), @@ -26,7 +26,7 @@ export function registerOAuthAuthorizeRoute({ response_mode: schema.maybe(schema.string()), redirect_uri: schema.maybe(schema.string()), scope: schema.maybe(schema.string()), - state: schema.maybe(schema.string()), + state: schema.nullable(schema.string()), }), }, }, @@ -42,14 +42,14 @@ export function registerOAuthAuthorizeAcceptRoute({ }: RouteDependencies) { router.post( { - path: '/api/workplace_search/oauth/authorize', + path: '/internal/workplace_search/oauth/authorize', validate: { body: schema.object({ client_id: schema.string(), response_type: schema.string(), redirect_uri: schema.maybe(schema.string()), scope: schema.maybe(schema.string()), - state: schema.maybe(schema.string()), + state: schema.nullable(schema.string()), }), }, }, @@ -65,14 +65,14 @@ export function registerOAuthAuthorizeDenyRoute({ }: RouteDependencies) { router.delete( { - path: '/api/workplace_search/oauth/authorize', + path: '/internal/workplace_search/oauth/authorize', validate: { body: schema.object({ client_id: schema.string(), response_type: schema.string(), redirect_uri: schema.maybe(schema.string()), scope: schema.maybe(schema.string()), - state: schema.maybe(schema.string()), + state: schema.nullable(schema.string()), }), }, }, diff --git a/x-pack/plugins/enterprise_search/server/routes/workplace_search/overview.test.ts b/x-pack/plugins/enterprise_search/server/routes/workplace_search/overview.test.ts index bdf885648dff7..0b4010bd1a09f 100644 --- a/x-pack/plugins/enterprise_search/server/routes/workplace_search/overview.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/workplace_search/overview.test.ts @@ -10,14 +10,14 @@ import { MockRouter, mockRequestHandler, mockDependencies } from '../../__mocks_ import { registerOverviewRoute } from './overview'; describe('Overview route', () => { - describe('GET /api/workplace_search/overview', () => { + describe('GET /internal/workplace_search/overview', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/overview', + path: '/internal/workplace_search/overview', }); registerOverviewRoute({ diff --git a/x-pack/plugins/enterprise_search/server/routes/workplace_search/overview.ts b/x-pack/plugins/enterprise_search/server/routes/workplace_search/overview.ts index 6a601da6427e7..74185439c2f37 100644 --- a/x-pack/plugins/enterprise_search/server/routes/workplace_search/overview.ts +++ b/x-pack/plugins/enterprise_search/server/routes/workplace_search/overview.ts @@ -13,7 +13,7 @@ export function registerOverviewRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/overview', + path: '/internal/workplace_search/overview', validate: false, }, enterpriseSearchRequestHandler.createRequest({ diff --git a/x-pack/plugins/enterprise_search/server/routes/workplace_search/role_mappings.test.ts b/x-pack/plugins/enterprise_search/server/routes/workplace_search/role_mappings.test.ts index ef8f1bd63f5d3..4130a6ba12097 100644 --- a/x-pack/plugins/enterprise_search/server/routes/workplace_search/role_mappings.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/workplace_search/role_mappings.test.ts @@ -15,14 +15,14 @@ import { } from './role_mappings'; describe('role mappings routes', () => { - describe('POST /api/workplace_search/org/role_mappings/enable_role_based_access', () => { + describe('POST /internal/workplace_search/org/role_mappings/enable_role_based_access', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/workplace_search/org/role_mappings/enable_role_based_access', + path: '/internal/workplace_search/org/role_mappings/enable_role_based_access', }); registerOrgEnableRoleMappingsRoute({ @@ -38,14 +38,14 @@ describe('role mappings routes', () => { }); }); - describe('GET /api/workplace_search/org/role_mappings', () => { + describe('GET /internal/workplace_search/org/role_mappings', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/org/role_mappings', + path: '/internal/workplace_search/org/role_mappings', }); registerOrgRoleMappingsRoute({ @@ -61,14 +61,14 @@ describe('role mappings routes', () => { }); }); - describe('POST /api/workplace_search/org/role_mappings', () => { + describe('POST /internal/workplace_search/org/role_mappings', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/workplace_search/org/role_mappings', + path: '/internal/workplace_search/org/role_mappings', }); registerOrgRoleMappingsRoute({ @@ -84,14 +84,14 @@ describe('role mappings routes', () => { }); }); - describe('PUT /api/workplace_search/org/role_mappings/{id}', () => { + describe('PUT /internal/workplace_search/org/role_mappings/{id}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/workplace_search/org/role_mappings/{id}', + path: '/internal/workplace_search/org/role_mappings/{id}', }); registerOrgRoleMappingRoute({ @@ -107,14 +107,14 @@ describe('role mappings routes', () => { }); }); - describe('DELETE /api/workplace_search/org/role_mappings/{id}', () => { + describe('DELETE /internal/workplace_search/org/role_mappings/{id}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'delete', - path: '/api/workplace_search/org/role_mappings/{id}', + path: '/internal/workplace_search/org/role_mappings/{id}', }); registerOrgRoleMappingRoute({ @@ -130,14 +130,14 @@ describe('role mappings routes', () => { }); }); - describe('POST /api/workplace_search/org/single_user_role_mapping', () => { + describe('POST /internal/workplace_search/org/single_user_role_mapping', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/workplace_search/org/single_user_role_mapping', + path: '/internal/workplace_search/org/single_user_role_mapping', }); registerOrgUserRoute({ diff --git a/x-pack/plugins/enterprise_search/server/routes/workplace_search/role_mappings.ts b/x-pack/plugins/enterprise_search/server/routes/workplace_search/role_mappings.ts index e6f4919ed2a2f..a08ffb2109683 100644 --- a/x-pack/plugins/enterprise_search/server/routes/workplace_search/role_mappings.ts +++ b/x-pack/plugins/enterprise_search/server/routes/workplace_search/role_mappings.ts @@ -23,7 +23,7 @@ export function registerOrgEnableRoleMappingsRoute({ }: RouteDependencies) { router.post( { - path: '/api/workplace_search/org/role_mappings/enable_role_based_access', + path: '/internal/workplace_search/org/role_mappings/enable_role_based_access', validate: false, }, enterpriseSearchRequestHandler.createRequest({ @@ -38,7 +38,7 @@ export function registerOrgRoleMappingsRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/org/role_mappings', + path: '/internal/workplace_search/org/role_mappings', validate: false, }, enterpriseSearchRequestHandler.createRequest({ @@ -48,7 +48,7 @@ export function registerOrgRoleMappingsRoute({ router.post( { - path: '/api/workplace_search/org/role_mappings', + path: '/internal/workplace_search/org/role_mappings', validate: { body: schema.object(roleMappingBaseSchema), }, @@ -65,7 +65,7 @@ export function registerOrgRoleMappingRoute({ }: RouteDependencies) { router.put( { - path: '/api/workplace_search/org/role_mappings/{id}', + path: '/internal/workplace_search/org/role_mappings/{id}', validate: { body: schema.object(roleMappingBaseSchema), params: schema.object({ @@ -80,7 +80,7 @@ export function registerOrgRoleMappingRoute({ router.delete( { - path: '/api/workplace_search/org/role_mappings/{id}', + path: '/internal/workplace_search/org/role_mappings/{id}', validate: { params: schema.object({ id: schema.string(), @@ -99,7 +99,7 @@ export function registerOrgUserRoute({ }: RouteDependencies) { router.post( { - path: '/api/workplace_search/org/single_user_role_mapping', + path: '/internal/workplace_search/org/single_user_role_mapping', validate: { body: schema.object({ roleMapping: schema.object({ diff --git a/x-pack/plugins/enterprise_search/server/routes/workplace_search/security.test.ts b/x-pack/plugins/enterprise_search/server/routes/workplace_search/security.test.ts index a1615499c56a2..744f0e689cd82 100644 --- a/x-pack/plugins/enterprise_search/server/routes/workplace_search/security.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/workplace_search/security.test.ts @@ -10,7 +10,7 @@ import { MockRouter, mockRequestHandler, mockDependencies } from '../../__mocks_ import { registerSecurityRoute, registerSecuritySourceRestrictionsRoute } from './security'; describe('security routes', () => { - describe('GET /api/workplace_search/org/security', () => { + describe('GET /internal/workplace_search/org/security', () => { let mockRouter: MockRouter; beforeEach(() => { @@ -18,7 +18,7 @@ describe('security routes', () => { mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/org/security', + path: '/internal/workplace_search/org/security', }); registerSecurityRoute({ @@ -36,7 +36,7 @@ describe('security routes', () => { }); }); - describe('GET /api/workplace_search/org/security/source_restrictions', () => { + describe('GET /internal/workplace_search/org/security/source_restrictions', () => { let mockRouter: MockRouter; beforeEach(() => { @@ -44,7 +44,7 @@ describe('security routes', () => { mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/org/security/source_restrictions', + path: '/internal/workplace_search/org/security/source_restrictions', }); registerSecuritySourceRestrictionsRoute({ @@ -62,7 +62,7 @@ describe('security routes', () => { }); }); - describe('PATCH /api/workplace_search/org/security/source_restrictions', () => { + describe('PATCH /internal/workplace_search/org/security/source_restrictions', () => { let mockRouter: MockRouter; beforeEach(() => { @@ -70,7 +70,7 @@ describe('security routes', () => { mockRouter = new MockRouter({ method: 'patch', - path: '/api/workplace_search/org/security/source_restrictions', + path: '/internal/workplace_search/org/security/source_restrictions', }); registerSecuritySourceRestrictionsRoute({ diff --git a/x-pack/plugins/enterprise_search/server/routes/workplace_search/security.ts b/x-pack/plugins/enterprise_search/server/routes/workplace_search/security.ts index b823ca796175e..7c9bf7f462a06 100644 --- a/x-pack/plugins/enterprise_search/server/routes/workplace_search/security.ts +++ b/x-pack/plugins/enterprise_search/server/routes/workplace_search/security.ts @@ -15,7 +15,7 @@ export function registerSecurityRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/org/security', + path: '/internal/workplace_search/org/security', validate: false, }, enterpriseSearchRequestHandler.createRequest({ @@ -30,7 +30,7 @@ export function registerSecuritySourceRestrictionsRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/org/security/source_restrictions', + path: '/internal/workplace_search/org/security/source_restrictions', validate: false, }, enterpriseSearchRequestHandler.createRequest({ @@ -40,7 +40,7 @@ export function registerSecuritySourceRestrictionsRoute({ router.patch( { - path: '/api/workplace_search/org/security/source_restrictions', + path: '/internal/workplace_search/org/security/source_restrictions', validate: { body: schema.object({ isEnabled: schema.boolean(), diff --git a/x-pack/plugins/enterprise_search/server/routes/workplace_search/settings.test.ts b/x-pack/plugins/enterprise_search/server/routes/workplace_search/settings.test.ts index 858bd71c50c44..205b7b244ab45 100644 --- a/x-pack/plugins/enterprise_search/server/routes/workplace_search/settings.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/workplace_search/settings.test.ts @@ -15,14 +15,14 @@ import { } from './settings'; describe('settings routes', () => { - describe('GET /api/workplace_search/org/settings', () => { + describe('GET /internal/workplace_search/org/settings', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/org/settings', + path: '/internal/workplace_search/org/settings', }); registerOrgSettingsRoute({ @@ -38,14 +38,14 @@ describe('settings routes', () => { }); }); - describe('PUT /api/workplace_search/org/settings/customize', () => { + describe('PUT /internal/workplace_search/org/settings/customize', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/workplace_search/org/settings/customize', + path: '/internal/workplace_search/org/settings/customize', }); registerOrgSettingsCustomizeRoute({ @@ -68,14 +68,14 @@ describe('settings routes', () => { }); }); - describe('PUT /api/workplace_search/org/settings/upload_images', () => { + describe('PUT /internal/workplace_search/org/settings/upload_images', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/workplace_search/org/settings/upload_images', + path: '/internal/workplace_search/org/settings/upload_images', }); registerOrgSettingsUploadImagesRoute({ @@ -98,14 +98,14 @@ describe('settings routes', () => { }); }); - describe('PUT /api/workplace_search/org/settings/oauth_application', () => { + describe('PUT /internal/workplace_search/org/settings/oauth_application', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/workplace_search/org/settings/oauth_application', + path: '/internal/workplace_search/org/settings/oauth_application', }); registerOrgSettingsOauthApplicationRoute({ diff --git a/x-pack/plugins/enterprise_search/server/routes/workplace_search/settings.ts b/x-pack/plugins/enterprise_search/server/routes/workplace_search/settings.ts index 83b633a61ba59..5a2a5309ee35d 100644 --- a/x-pack/plugins/enterprise_search/server/routes/workplace_search/settings.ts +++ b/x-pack/plugins/enterprise_search/server/routes/workplace_search/settings.ts @@ -17,7 +17,7 @@ export function registerOrgSettingsRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/org/settings', + path: '/internal/workplace_search/org/settings', validate: false, }, enterpriseSearchRequestHandler.createRequest({ @@ -32,7 +32,7 @@ export function registerOrgSettingsCustomizeRoute({ }: RouteDependencies) { router.put( { - path: '/api/workplace_search/org/settings/customize', + path: '/internal/workplace_search/org/settings/customize', validate: { body: schema.object({ name: schema.string(), @@ -51,7 +51,7 @@ export function registerOrgSettingsUploadImagesRoute({ }: RouteDependencies) { router.put( { - path: '/api/workplace_search/org/settings/upload_images', + path: '/internal/workplace_search/org/settings/upload_images', validate: { body: schema.object({ logo: schema.maybe(schema.nullable(schema.string())), @@ -76,7 +76,7 @@ export function registerOrgSettingsOauthApplicationRoute({ }: RouteDependencies) { router.put( { - path: '/api/workplace_search/org/settings/oauth_application', + path: '/internal/workplace_search/org/settings/oauth_application', validate: { body: schema.object({ oauth_application: schema.object({ diff --git a/x-pack/plugins/enterprise_search/server/routes/workplace_search/sources.test.ts b/x-pack/plugins/enterprise_search/server/routes/workplace_search/sources.test.ts index a68a7716933f8..706bc8a4853a7 100644 --- a/x-pack/plugins/enterprise_search/server/routes/workplace_search/sources.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/workplace_search/sources.test.ts @@ -56,14 +56,14 @@ const mockConfig = { }; describe('sources routes', () => { - describe('GET /api/workplace_search/account/sources', () => { + describe('GET /internal/workplace_search/account/sources', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/account/sources', + path: '/internal/workplace_search/account/sources', }); registerAccountSourcesRoute({ @@ -79,14 +79,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/account/sources/status', () => { + describe('GET /internal/workplace_search/account/sources/status', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/account/sources/status', + path: '/internal/workplace_search/account/sources/status', }); registerAccountSourcesStatusRoute({ @@ -102,14 +102,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/account/sources/{id}', () => { + describe('GET /internal/workplace_search/account/sources/{id}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/account/sources/{id}', + path: '/internal/workplace_search/account/sources/{id}', }); registerAccountSourceRoute({ @@ -125,14 +125,14 @@ describe('sources routes', () => { }); }); - describe('DELETE /api/workplace_search/account/sources/{id}', () => { + describe('DELETE /internal/workplace_search/account/sources/{id}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'delete', - path: '/api/workplace_search/account/sources/{id}', + path: '/internal/workplace_search/account/sources/{id}', }); registerAccountSourceRoute({ @@ -148,14 +148,14 @@ describe('sources routes', () => { }); }); - describe('POST /api/workplace_search/account/create_source', () => { + describe('POST /internal/workplace_search/account/create_source', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/workplace_search/account/create_source', + path: '/internal/workplace_search/account/create_source', }); registerAccountCreateSourceRoute({ @@ -187,14 +187,14 @@ describe('sources routes', () => { }); }); - describe('POST /api/workplace_search/account/sources/{id}/documents', () => { + describe('POST /internal/workplace_search/account/sources/{id}/documents', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/workplace_search/account/sources/{id}/documents', + path: '/internal/workplace_search/account/sources/{id}/documents', }); registerAccountSourceDocumentsRoute({ @@ -227,14 +227,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/account/sources/{id}/federated_summary', () => { + describe('GET /internal/workplace_search/account/sources/{id}/federated_summary', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/account/sources/{id}/federated_summary', + path: '/internal/workplace_search/account/sources/{id}/federated_summary', }); registerAccountSourceFederatedSummaryRoute({ @@ -250,14 +250,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/account/sources/{id}/reauth_prepare', () => { + describe('GET /internal/workplace_search/account/sources/{id}/reauth_prepare', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/account/sources/{id}/reauth_prepare', + path: '/internal/workplace_search/account/sources/{id}/reauth_prepare', }); registerAccountSourceReauthPrepareRoute({ @@ -273,14 +273,14 @@ describe('sources routes', () => { }); }); - describe('PATCH /api/workplace_search/account/sources/{id}/settings', () => { + describe('PATCH /internal/workplace_search/account/sources/{id}/settings', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'patch', - path: '/api/workplace_search/account/sources/{id}/settings', + path: '/internal/workplace_search/account/sources/{id}/settings', }); registerAccountSourceSettingsRoute({ @@ -309,14 +309,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/account/pre_sources/{id}', () => { + describe('GET /internal/workplace_search/account/pre_sources/{id}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/account/pre_sources/{id}', + path: '/internal/workplace_search/account/pre_sources/{id}', }); registerAccountPreSourceRoute({ @@ -332,14 +332,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/account/sources/{serviceType}/prepare', () => { + describe('GET /internal/workplace_search/account/sources/{serviceType}/prepare', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/account/sources/{serviceType}/prepare', + path: '/internal/workplace_search/account/sources/{serviceType}/prepare', }); registerAccountPrepareSourcesRoute({ @@ -355,14 +355,14 @@ describe('sources routes', () => { }); }); - describe('PUT /api/workplace_search/account/sources/{id}/searchable', () => { + describe('PUT /internal/workplace_search/account/sources/{id}/searchable', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/workplace_search/account/sources/{id}/searchable', + path: '/internal/workplace_search/account/sources/{id}/searchable', }); registerAccountSourceSearchableRoute({ @@ -389,14 +389,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/account/sources/{id}/display_settings/config', () => { + describe('GET /internal/workplace_search/account/sources/{id}/display_settings/config', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/account/sources/{id}/display_settings/config', + path: '/internal/workplace_search/account/sources/{id}/display_settings/config', }); registerAccountSourceDisplaySettingsConfig({ @@ -412,14 +412,14 @@ describe('sources routes', () => { }); }); - describe('POST /api/workplace_search/account/sources/{id}/display_settings/config', () => { + describe('POST /internal/workplace_search/account/sources/{id}/display_settings/config', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/workplace_search/account/sources/{id}/display_settings/config', + path: '/internal/workplace_search/account/sources/{id}/display_settings/config', }); registerAccountSourceDisplaySettingsConfig({ @@ -455,14 +455,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/account/sources/{id}/schemas', () => { + describe('GET /internal/workplace_search/account/sources/{id}/schemas', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/account/sources/{id}/schemas', + path: '/internal/workplace_search/account/sources/{id}/schemas', }); registerAccountSourceSchemasRoute({ @@ -478,14 +478,14 @@ describe('sources routes', () => { }); }); - describe('POST /api/workplace_search/account/sources/{id}/schemas', () => { + describe('POST /internal/workplace_search/account/sources/{id}/schemas', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/workplace_search/account/sources/{id}/schemas', + path: '/internal/workplace_search/account/sources/{id}/schemas', }); registerAccountSourceSchemasRoute({ @@ -508,14 +508,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/account/sources/{sourceId}/reindex_job/{jobId}', () => { + describe('GET /internal/workplace_search/account/sources/{sourceId}/reindex_job/{jobId}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/account/sources/{sourceId}/reindex_job/{jobId}', + path: '/internal/workplace_search/account/sources/{sourceId}/reindex_job/{jobId}', }); registerAccountSourceReindexJobRoute({ @@ -540,14 +540,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/account/sources/{sourceId}/download_diagnostics', () => { + describe('GET /internal/workplace_search/account/sources/{sourceId}/download_diagnostics', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/account/sources/{sourceId}/download_diagnostics', + path: '/internal/workplace_search/account/sources/{sourceId}/download_diagnostics', }); registerAccountSourceDownloadDiagnosticsRoute({ @@ -564,14 +564,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/org/sources', () => { + describe('GET /internal/workplace_search/org/sources', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/org/sources', + path: '/internal/workplace_search/org/sources', }); registerOrgSourcesRoute({ @@ -587,14 +587,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/org/sources/status', () => { + describe('GET /internal/workplace_search/org/sources/status', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/org/sources/status', + path: '/internal/workplace_search/org/sources/status', }); registerOrgSourcesStatusRoute({ @@ -610,14 +610,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/org/sources/{id}', () => { + describe('GET /internal/workplace_search/org/sources/{id}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/org/sources/{id}', + path: '/internal/workplace_search/org/sources/{id}', }); registerOrgSourceRoute({ @@ -633,14 +633,14 @@ describe('sources routes', () => { }); }); - describe('DELETE /api/workplace_search/org/sources/{id}', () => { + describe('DELETE /internal/workplace_search/org/sources/{id}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'delete', - path: '/api/workplace_search/org/sources/{id}', + path: '/internal/workplace_search/org/sources/{id}', }); registerOrgSourceRoute({ @@ -656,14 +656,14 @@ describe('sources routes', () => { }); }); - describe('POST /api/workplace_search/org/create_source', () => { + describe('POST /internal/workplace_search/org/create_source', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/workplace_search/org/create_source', + path: '/internal/workplace_search/org/create_source', }); registerOrgCreateSourceRoute({ @@ -695,14 +695,14 @@ describe('sources routes', () => { }); }); - describe('POST /api/workplace_search/org/sources/{id}/documents', () => { + describe('POST /internal/workplace_search/org/sources/{id}/documents', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/workplace_search/org/sources/{id}/documents', + path: '/internal/workplace_search/org/sources/{id}/documents', }); registerOrgSourceDocumentsRoute({ @@ -735,14 +735,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/org/sources/{id}/federated_summary', () => { + describe('GET /internal/workplace_search/org/sources/{id}/federated_summary', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/org/sources/{id}/federated_summary', + path: '/internal/workplace_search/org/sources/{id}/federated_summary', }); registerOrgSourceFederatedSummaryRoute({ @@ -758,14 +758,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/org/sources/{id}/reauth_prepare', () => { + describe('GET /internal/workplace_search/org/sources/{id}/reauth_prepare', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/org/sources/{id}/reauth_prepare', + path: '/internal/workplace_search/org/sources/{id}/reauth_prepare', }); registerOrgSourceReauthPrepareRoute({ @@ -781,14 +781,14 @@ describe('sources routes', () => { }); }); - describe('PATCH /api/workplace_search/org/sources/{id}/settings', () => { + describe('PATCH /internal/workplace_search/org/sources/{id}/settings', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'patch', - path: '/api/workplace_search/org/sources/{id}/settings', + path: '/internal/workplace_search/org/sources/{id}/settings', }); registerOrgSourceSettingsRoute({ @@ -817,14 +817,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/org/pre_sources/{id}', () => { + describe('GET /internal/workplace_search/org/pre_sources/{id}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/org/pre_sources/{id}', + path: '/internal/workplace_search/org/pre_sources/{id}', }); registerOrgPreSourceRoute({ @@ -840,14 +840,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/org/sources/{serviceType}/prepare', () => { + describe('GET /internal/workplace_search/org/sources/{serviceType}/prepare', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/org/sources/{serviceType}/prepare', + path: '/internal/workplace_search/org/sources/{serviceType}/prepare', }); registerOrgPrepareSourcesRoute({ @@ -863,14 +863,14 @@ describe('sources routes', () => { }); }); - describe('PUT /api/workplace_search/org/sources/{id}/searchable', () => { + describe('PUT /internal/workplace_search/org/sources/{id}/searchable', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/workplace_search/org/sources/{id}/searchable', + path: '/internal/workplace_search/org/sources/{id}/searchable', }); registerOrgSourceSearchableRoute({ @@ -897,14 +897,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/org/sources/{id}/display_settings/config', () => { + describe('GET /internal/workplace_search/org/sources/{id}/display_settings/config', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/org/sources/{id}/display_settings/config', + path: '/internal/workplace_search/org/sources/{id}/display_settings/config', }); registerOrgSourceDisplaySettingsConfig({ @@ -920,14 +920,14 @@ describe('sources routes', () => { }); }); - describe('POST /api/workplace_search/org/sources/{id}/display_settings/config', () => { + describe('POST /internal/workplace_search/org/sources/{id}/display_settings/config', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/workplace_search/org/sources/{id}/display_settings/config', + path: '/internal/workplace_search/org/sources/{id}/display_settings/config', }); registerOrgSourceDisplaySettingsConfig({ @@ -963,14 +963,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/org/sources/{id}/schemas', () => { + describe('GET /internal/workplace_search/org/sources/{id}/schemas', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/org/sources/{id}/schemas', + path: '/internal/workplace_search/org/sources/{id}/schemas', }); registerOrgSourceSchemasRoute({ @@ -986,14 +986,14 @@ describe('sources routes', () => { }); }); - describe('POST /api/workplace_search/org/sources/{id}/schemas', () => { + describe('POST /internal/workplace_search/org/sources/{id}/schemas', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/workplace_search/org/sources/{id}/schemas', + path: '/internal/workplace_search/org/sources/{id}/schemas', }); registerOrgSourceSchemasRoute({ @@ -1016,14 +1016,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/org/sources/{sourceId}/reindex_job/{jobId}', () => { + describe('GET /internal/workplace_search/org/sources/{sourceId}/reindex_job/{jobId}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/org/sources/{sourceId}/reindex_job/{jobId}', + path: '/internal/workplace_search/org/sources/{sourceId}/reindex_job/{jobId}', }); registerOrgSourceReindexJobRoute({ @@ -1039,14 +1039,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/org/sources/{sourceId}/download_diagnostics', () => { + describe('GET /internal/workplace_search/org/sources/{sourceId}/download_diagnostics', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/org/sources/{sourceId}/download_diagnostics', + path: '/internal/workplace_search/org/sources/{sourceId}/download_diagnostics', }); registerOrgSourceDownloadDiagnosticsRoute({ @@ -1063,14 +1063,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/org/settings/connectors', () => { + describe('GET /internal/workplace_search/org/settings/connectors', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/org/settings/connectors', + path: '/internal/workplace_search/org/settings/connectors', }); registerOrgSourceOauthConfigurationsRoute({ @@ -1086,14 +1086,14 @@ describe('sources routes', () => { }); }); - describe('POST /api/workplace_search/org/settings/connectors', () => { + describe('POST /internal/workplace_search/org/settings/connectors', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/workplace_search/org/settings/connectors', + path: '/internal/workplace_search/org/settings/connectors', }); registerOrgSourceOauthConfigurationsRoute({ @@ -1116,14 +1116,14 @@ describe('sources routes', () => { }); }); - describe('PUT /api/workplace_search/org/settings/connectors', () => { + describe('PUT /internal/workplace_search/org/settings/connectors', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/workplace_search/org/settings/connectors', + path: '/internal/workplace_search/org/settings/connectors', }); registerOrgSourceOauthConfigurationsRoute({ @@ -1146,14 +1146,14 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/org/settings/connectors/{serviceType}', () => { + describe('GET /internal/workplace_search/org/settings/connectors/{serviceType}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/org/settings/connectors/{serviceType}', + path: '/internal/workplace_search/org/settings/connectors/{serviceType}', }); registerOrgSourceOauthConfigurationRoute({ @@ -1169,14 +1169,14 @@ describe('sources routes', () => { }); }); - describe('POST /api/workplace_search/org/settings/connectors/{serviceType}', () => { + describe('POST /internal/workplace_search/org/settings/connectors/{serviceType}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'post', - path: '/api/workplace_search/org/settings/connectors/{serviceType}', + path: '/internal/workplace_search/org/settings/connectors/{serviceType}', }); registerOrgSourceOauthConfigurationRoute({ @@ -1199,14 +1199,14 @@ describe('sources routes', () => { }); }); - describe('PUT /api/workplace_search/org/settings/connectors/{serviceType}', () => { + describe('PUT /internal/workplace_search/org/settings/connectors/{serviceType}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'put', - path: '/api/workplace_search/org/settings/connectors/{serviceType}', + path: '/internal/workplace_search/org/settings/connectors/{serviceType}', }); registerOrgSourceOauthConfigurationRoute({ @@ -1229,14 +1229,14 @@ describe('sources routes', () => { }); }); - describe('DELETE /api/workplace_search/org/settings/connectors/{serviceType}', () => { + describe('DELETE /internal/workplace_search/org/settings/connectors/{serviceType}', () => { let mockRouter: MockRouter; beforeEach(() => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'delete', - path: '/api/workplace_search/org/settings/connectors/{serviceType}', + path: '/internal/workplace_search/org/settings/connectors/{serviceType}', }); registerOrgSourceOauthConfigurationRoute({ @@ -1252,7 +1252,7 @@ describe('sources routes', () => { }); }); - describe('GET /api/workplace_search/sources/create', () => { + describe('GET /internal/workplace_search/sources/create', () => { const tokenPackage = 'some_encrypted_secrets'; const mockRequest = { @@ -1268,7 +1268,7 @@ describe('sources routes', () => { jest.clearAllMocks(); mockRouter = new MockRouter({ method: 'get', - path: '/api/workplace_search/sources/create', + path: '/internal/workplace_search/sources/create', }); registerOauthConnectorParamsRoute({ diff --git a/x-pack/plugins/enterprise_search/server/routes/workplace_search/sources.ts b/x-pack/plugins/enterprise_search/server/routes/workplace_search/sources.ts index cb56f54a1df6a..28a5d621b117c 100644 --- a/x-pack/plugins/enterprise_search/server/routes/workplace_search/sources.ts +++ b/x-pack/plugins/enterprise_search/server/routes/workplace_search/sources.ts @@ -89,7 +89,7 @@ export function registerAccountSourcesRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/account/sources', + path: '/internal/workplace_search/account/sources', validate: false, }, enterpriseSearchRequestHandler.createRequest({ @@ -104,7 +104,7 @@ export function registerAccountSourcesStatusRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/account/sources/status', + path: '/internal/workplace_search/account/sources/status', validate: false, }, enterpriseSearchRequestHandler.createRequest({ @@ -119,7 +119,7 @@ export function registerAccountSourceRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/account/sources/{id}', + path: '/internal/workplace_search/account/sources/{id}', validate: { params: schema.object({ id: schema.string(), @@ -133,7 +133,7 @@ export function registerAccountSourceRoute({ router.delete( { - path: '/api/workplace_search/account/sources/{id}', + path: '/internal/workplace_search/account/sources/{id}', validate: { params: schema.object({ id: schema.string(), @@ -152,7 +152,7 @@ export function registerAccountCreateSourceRoute({ }: RouteDependencies) { router.post( { - path: '/api/workplace_search/account/create_source', + path: '/internal/workplace_search/account/create_source', validate: { body: schema.object({ service_type: schema.string(), @@ -176,7 +176,7 @@ export function registerAccountSourceDocumentsRoute({ }: RouteDependencies) { router.post( { - path: '/api/workplace_search/account/sources/{id}/documents', + path: '/internal/workplace_search/account/sources/{id}/documents', validate: { body: schema.object({ query: schema.string(), @@ -199,7 +199,7 @@ export function registerAccountSourceFederatedSummaryRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/account/sources/{id}/federated_summary', + path: '/internal/workplace_search/account/sources/{id}/federated_summary', validate: { params: schema.object({ id: schema.string(), @@ -218,7 +218,7 @@ export function registerAccountSourceReauthPrepareRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/account/sources/{id}/reauth_prepare', + path: '/internal/workplace_search/account/sources/{id}/reauth_prepare', validate: { params: schema.object({ id: schema.string(), @@ -240,7 +240,7 @@ export function registerAccountSourceSettingsRoute({ }: RouteDependencies) { router.patch( { - path: '/api/workplace_search/account/sources/{id}/settings', + path: '/internal/workplace_search/account/sources/{id}/settings', validate: { body: sourceSettingsSchema, params: schema.object({ @@ -260,7 +260,7 @@ export function registerAccountPreSourceRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/account/pre_sources/{id}', + path: '/internal/workplace_search/account/pre_sources/{id}', validate: { params: schema.object({ id: schema.string(), @@ -279,7 +279,7 @@ export function registerAccountPrepareSourcesRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/account/sources/{serviceType}/prepare', + path: '/internal/workplace_search/account/sources/{serviceType}/prepare', validate: { params: schema.object({ serviceType: schema.string(), @@ -302,7 +302,7 @@ export function registerAccountSourceSearchableRoute({ }: RouteDependencies) { router.put( { - path: '/api/workplace_search/account/sources/{id}/searchable', + path: '/internal/workplace_search/account/sources/{id}/searchable', validate: { body: schema.object({ searchable: schema.boolean(), @@ -324,7 +324,7 @@ export function registerAccountSourceDisplaySettingsConfig({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/account/sources/{id}/display_settings/config', + path: '/internal/workplace_search/account/sources/{id}/display_settings/config', validate: { params: schema.object({ id: schema.string(), @@ -338,7 +338,7 @@ export function registerAccountSourceDisplaySettingsConfig({ router.post( { - path: '/api/workplace_search/account/sources/{id}/display_settings/config', + path: '/internal/workplace_search/account/sources/{id}/display_settings/config', validate: { body: displaySettingsSchema, params: schema.object({ @@ -358,7 +358,7 @@ export function registerAccountSourceSchemasRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/account/sources/{id}/schemas', + path: '/internal/workplace_search/account/sources/{id}/schemas', validate: { params: schema.object({ id: schema.string(), @@ -372,7 +372,7 @@ export function registerAccountSourceSchemasRoute({ router.post( { - path: '/api/workplace_search/account/sources/{id}/schemas', + path: '/internal/workplace_search/account/sources/{id}/schemas', validate: { body: schemaValuesSchema, params: schema.object({ @@ -392,7 +392,7 @@ export function registerAccountSourceReindexJobRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/account/sources/{sourceId}/reindex_job/{jobId}', + path: '/internal/workplace_search/account/sources/{sourceId}/reindex_job/{jobId}', validate: { params: schema.object({ sourceId: schema.string(), @@ -412,7 +412,7 @@ export function registerAccountSourceDownloadDiagnosticsRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/account/sources/{sourceId}/download_diagnostics', + path: '/internal/workplace_search/account/sources/{sourceId}/download_diagnostics', validate: { params: schema.object({ sourceId: schema.string(), @@ -433,7 +433,7 @@ export function registerOrgSourcesRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/org/sources', + path: '/internal/workplace_search/org/sources', validate: false, }, enterpriseSearchRequestHandler.createRequest({ @@ -448,7 +448,7 @@ export function registerOrgSourcesStatusRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/org/sources/status', + path: '/internal/workplace_search/org/sources/status', validate: false, }, enterpriseSearchRequestHandler.createRequest({ @@ -463,7 +463,7 @@ export function registerOrgSourceRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/org/sources/{id}', + path: '/internal/workplace_search/org/sources/{id}', validate: { params: schema.object({ id: schema.string(), @@ -477,7 +477,7 @@ export function registerOrgSourceRoute({ router.delete( { - path: '/api/workplace_search/org/sources/{id}', + path: '/internal/workplace_search/org/sources/{id}', validate: { params: schema.object({ id: schema.string(), @@ -496,7 +496,7 @@ export function registerOrgCreateSourceRoute({ }: RouteDependencies) { router.post( { - path: '/api/workplace_search/org/create_source', + path: '/internal/workplace_search/org/create_source', validate: { body: schema.object({ service_type: schema.string(), @@ -520,7 +520,7 @@ export function registerOrgSourceDocumentsRoute({ }: RouteDependencies) { router.post( { - path: '/api/workplace_search/org/sources/{id}/documents', + path: '/internal/workplace_search/org/sources/{id}/documents', validate: { body: schema.object({ query: schema.string(), @@ -543,7 +543,7 @@ export function registerOrgSourceFederatedSummaryRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/org/sources/{id}/federated_summary', + path: '/internal/workplace_search/org/sources/{id}/federated_summary', validate: { params: schema.object({ id: schema.string(), @@ -562,7 +562,7 @@ export function registerOrgSourceReauthPrepareRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/org/sources/{id}/reauth_prepare', + path: '/internal/workplace_search/org/sources/{id}/reauth_prepare', validate: { params: schema.object({ id: schema.string(), @@ -584,7 +584,7 @@ export function registerOrgSourceSettingsRoute({ }: RouteDependencies) { router.patch( { - path: '/api/workplace_search/org/sources/{id}/settings', + path: '/internal/workplace_search/org/sources/{id}/settings', validate: { body: sourceSettingsSchema, params: schema.object({ @@ -604,7 +604,7 @@ export function registerOrgPreSourceRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/org/pre_sources/{id}', + path: '/internal/workplace_search/org/pre_sources/{id}', validate: { params: schema.object({ id: schema.string(), @@ -623,7 +623,7 @@ export function registerOrgPrepareSourcesRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/org/sources/{serviceType}/prepare', + path: '/internal/workplace_search/org/sources/{serviceType}/prepare', validate: { params: schema.object({ serviceType: schema.string(), @@ -647,7 +647,7 @@ export function registerOrgSourceSearchableRoute({ }: RouteDependencies) { router.put( { - path: '/api/workplace_search/org/sources/{id}/searchable', + path: '/internal/workplace_search/org/sources/{id}/searchable', validate: { body: schema.object({ searchable: schema.boolean(), @@ -669,7 +669,7 @@ export function registerOrgSourceDisplaySettingsConfig({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/org/sources/{id}/display_settings/config', + path: '/internal/workplace_search/org/sources/{id}/display_settings/config', validate: { params: schema.object({ id: schema.string(), @@ -683,7 +683,7 @@ export function registerOrgSourceDisplaySettingsConfig({ router.post( { - path: '/api/workplace_search/org/sources/{id}/display_settings/config', + path: '/internal/workplace_search/org/sources/{id}/display_settings/config', validate: { body: displaySettingsSchema, params: schema.object({ @@ -703,7 +703,7 @@ export function registerOrgSourceSchemasRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/org/sources/{id}/schemas', + path: '/internal/workplace_search/org/sources/{id}/schemas', validate: { params: schema.object({ id: schema.string(), @@ -717,7 +717,7 @@ export function registerOrgSourceSchemasRoute({ router.post( { - path: '/api/workplace_search/org/sources/{id}/schemas', + path: '/internal/workplace_search/org/sources/{id}/schemas', validate: { body: schemaValuesSchema, params: schema.object({ @@ -737,7 +737,7 @@ export function registerOrgSourceReindexJobRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/org/sources/{sourceId}/reindex_job/{jobId}', + path: '/internal/workplace_search/org/sources/{sourceId}/reindex_job/{jobId}', validate: { params: schema.object({ sourceId: schema.string(), @@ -757,7 +757,7 @@ export function registerOrgSourceDownloadDiagnosticsRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/org/sources/{sourceId}/download_diagnostics', + path: '/internal/workplace_search/org/sources/{sourceId}/download_diagnostics', validate: { params: schema.object({ sourceId: schema.string(), @@ -777,7 +777,7 @@ export function registerOrgSourceOauthConfigurationsRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/org/settings/connectors', + path: '/internal/workplace_search/org/settings/connectors', validate: false, }, enterpriseSearchRequestHandler.createRequest({ @@ -787,7 +787,7 @@ export function registerOrgSourceOauthConfigurationsRoute({ router.post( { - path: '/api/workplace_search/org/settings/connectors', + path: '/internal/workplace_search/org/settings/connectors', validate: { body: oauthConfigSchema, }, @@ -799,7 +799,7 @@ export function registerOrgSourceOauthConfigurationsRoute({ router.put( { - path: '/api/workplace_search/org/settings/connectors', + path: '/internal/workplace_search/org/settings/connectors', validate: { body: oauthConfigSchema, }, @@ -816,7 +816,7 @@ export function registerOrgSourceOauthConfigurationRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/org/settings/connectors/{serviceType}', + path: '/internal/workplace_search/org/settings/connectors/{serviceType}', validate: { params: schema.object({ serviceType: schema.string(), @@ -830,7 +830,7 @@ export function registerOrgSourceOauthConfigurationRoute({ router.post( { - path: '/api/workplace_search/org/settings/connectors/{serviceType}', + path: '/internal/workplace_search/org/settings/connectors/{serviceType}', validate: { params: schema.object({ serviceType: schema.string(), @@ -845,7 +845,7 @@ export function registerOrgSourceOauthConfigurationRoute({ router.put( { - path: '/api/workplace_search/org/settings/connectors/{serviceType}', + path: '/internal/workplace_search/org/settings/connectors/{serviceType}', validate: { params: schema.object({ serviceType: schema.string(), @@ -860,7 +860,7 @@ export function registerOrgSourceOauthConfigurationRoute({ router.delete( { - path: '/api/workplace_search/org/settings/connectors/{serviceType}', + path: '/internal/workplace_search/org/settings/connectors/{serviceType}', validate: { params: schema.object({ serviceType: schema.string(), @@ -880,7 +880,7 @@ export function registerOauthConnectorParamsRoute({ }: RouteDependencies) { router.get( { - path: '/api/workplace_search/sources/create', + path: '/internal/workplace_search/sources/create', validate: { query: schema.object({ kibana_host: schema.string(), diff --git a/x-pack/plugins/event_log/README.md b/x-pack/plugins/event_log/README.md index 33c7fcabc9f46..f637187c1c180 100644 --- a/x-pack/plugins/event_log/README.md +++ b/x-pack/plugins/event_log/README.md @@ -271,6 +271,7 @@ Request Body: |Property|Description|Type| |---|---|---| |ids|The array ids of the saved object.|string array| +|legacyIds|The array legacy ids of the saved object. This filter applies to the rules creted in Kibana versions before 8.0.0.|string array| Response body: @@ -284,7 +285,8 @@ interface EventLogClient { findEventsBySavedObjectIds( type: string, ids: string[], - options?: Partial + options?: Partial, + legacyIds?: string[] ): Promise; } @@ -404,7 +406,8 @@ export interface IEventLogClient { findEventsBySavedObjectIds( type: string, ids: string[], - options?: Partial + options?: Partial, + legacyIds?: string[] ): Promise; } ``` diff --git a/x-pack/plugins/event_log/generated/schemas.ts b/x-pack/plugins/event_log/generated/schemas.ts index 7cecba1efa438..15dc182dbe653 100644 --- a/x-pack/plugins/event_log/generated/schemas.ts +++ b/x-pack/plugins/event_log/generated/schemas.ts @@ -149,10 +149,6 @@ function ecsDate() { return schema.maybe(schema.string({ validate: validateDate })); } -function ecsVersion() { - return schema.maybe(schema.string({ validate: validateVersion })); -} - const ISO_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/; function validateDate(isoDate: string) { @@ -160,6 +156,10 @@ function validateDate(isoDate: string) { return 'string is not a valid ISO date: ' + isoDate; } +function ecsVersion() { + return schema.maybe(schema.string({ validate: validateVersion })); +} + function validateVersion(version: string) { if (semver.valid(version)) return; return 'string is not a valid version: ' + version; diff --git a/x-pack/plugins/event_log/jest.config.js b/x-pack/plugins/event_log/jest.config.js index de892b297deb9..c8bf86db09e0f 100644 --- a/x-pack/plugins/event_log/jest.config.js +++ b/x-pack/plugins/event_log/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/event_log'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/event_log', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/event_log/{common,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/event_log/scripts/create_schemas.js b/x-pack/plugins/event_log/scripts/create_schemas.js index 0a53165630a29..c86722ccd76c6 100755 --- a/x-pack/plugins/event_log/scripts/create_schemas.js +++ b/x-pack/plugins/event_log/scripts/create_schemas.js @@ -283,6 +283,7 @@ const SchemaFileTemplate = ` // the event log import { schema, TypeOf } from '@kbn/config-schema'; +import semver from 'semver'; type DeepWriteable = { -readonly [P in keyof T]: DeepWriteable }; type DeepPartial = { 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 8a33342e71d02..667512ea13f65 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 @@ -17,6 +17,12 @@ const createClusterClientMock = () => { createIndexTemplate: jest.fn(), doesAliasExist: jest.fn(), createIndex: jest.fn(), + getExistingLegacyIndexTemplates: jest.fn(), + setLegacyIndexTemplateToHidden: jest.fn(), + getExistingIndices: jest.fn(), + setIndexToHidden: jest.fn(), + getExistingIndexAliases: jest.fn(), + setIndexAliasToHidden: jest.fn(), queryEventsBySavedObjects: 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 cd87bc8e6e18b..f4140298928b6 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 @@ -16,7 +16,7 @@ import { findOptionsSchema } from '../event_log_client'; import { delay } from '../lib/delay'; import { times } from 'lodash'; import { DeeplyMockedKeys } from '@kbn/utility-types/jest'; -import { RequestEvent } from '@elastic/elasticsearch'; +import { estypes, RequestEvent } from '@elastic/elasticsearch'; type MockedLogger = ReturnType; @@ -215,22 +215,39 @@ describe('doesIndexTemplateExist', () => { }); }); - test('should return true when call cluster returns true', async () => { + test('should return true when call cluster to legacy template API returns true', async () => { clusterClient.indices.existsTemplate.mockResolvedValue(asApiResponse(true)); + clusterClient.indices.existsIndexTemplate.mockResolvedValue(asApiResponse(false)); await expect(clusterClientAdapter.doesIndexTemplateExist('foo')).resolves.toEqual(true); }); - test('should return false when call cluster returns false', async () => { + test('should return true when call cluster to index template API returns true', async () => { + clusterClient.indices.existsTemplate.mockResolvedValue(asApiResponse(false)); + clusterClient.indices.existsIndexTemplate.mockResolvedValue(asApiResponse(true)); + await expect(clusterClientAdapter.doesIndexTemplateExist('foo')).resolves.toEqual(true); + }); + + test('should return false when both call cluster calls returns false', async () => { clusterClient.indices.existsTemplate.mockResolvedValue(asApiResponse(false)); + clusterClient.indices.existsIndexTemplate.mockResolvedValue(asApiResponse(false)); await expect(clusterClientAdapter.doesIndexTemplateExist('foo')).resolves.toEqual(false); }); - test('should throw error when call cluster throws an error', async () => { + test('should throw error when call cluster to legacy template API throws an error', async () => { clusterClient.indices.existsTemplate.mockRejectedValue(new Error('Fail')); await expect( clusterClientAdapter.doesIndexTemplateExist('foo') ).rejects.toThrowErrorMatchingInlineSnapshot( - `"error checking existance of index template: Fail"` + `"error checking existence of index template: Fail"` + ); + }); + + test('should throw error when call cluster to index template API throws an error', async () => { + clusterClient.indices.existsIndexTemplate.mockRejectedValue(new Error('Fail')); + await expect( + clusterClientAdapter.doesIndexTemplateExist('foo') + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"error checking existence of index template: Fail"` ); }); }); @@ -238,7 +255,7 @@ describe('doesIndexTemplateExist', () => { describe('createIndexTemplate', () => { test('should call cluster with given template', async () => { await clusterClientAdapter.createIndexTemplate('foo', { args: true }); - expect(clusterClient.indices.putTemplate).toHaveBeenCalledWith({ + expect(clusterClient.indices.putIndexTemplate).toHaveBeenCalledWith({ name: 'foo', create: true, body: { args: true }, @@ -246,20 +263,274 @@ describe('createIndexTemplate', () => { }); test(`should throw error if index template still doesn't exist after error is thrown`, async () => { - clusterClient.indices.putTemplate.mockRejectedValueOnce(new Error('Fail')); + clusterClient.indices.putIndexTemplate.mockRejectedValueOnce(new Error('Fail')); clusterClient.indices.existsTemplate.mockResolvedValueOnce(asApiResponse(false)); + clusterClient.indices.existsIndexTemplate.mockResolvedValueOnce(asApiResponse(false)); await expect( clusterClientAdapter.createIndexTemplate('foo', { args: true }) ).rejects.toThrowErrorMatchingInlineSnapshot(`"error creating index template: Fail"`); }); test('should not throw error if index template exists after error is thrown', async () => { - clusterClient.indices.putTemplate.mockRejectedValueOnce(new Error('Fail')); + clusterClient.indices.putIndexTemplate.mockRejectedValueOnce(new Error('Fail')); clusterClient.indices.existsTemplate.mockResolvedValueOnce(asApiResponse(true)); await clusterClientAdapter.createIndexTemplate('foo', { args: true }); }); }); +describe('getExistingLegacyIndexTemplates', () => { + test('should call cluster with given index template pattern', async () => { + await clusterClientAdapter.getExistingLegacyIndexTemplates('foo*'); + expect(clusterClient.indices.getTemplate).toHaveBeenCalledWith( + { + name: 'foo*', + }, + { ignore: [404] } + ); + }); + + test('should return templates when found', async () => { + const response = { + 'foo-bar-template': { + order: 0, + index_patterns: ['foo-bar-*'], + settings: { index: { number_of_shards: '1' } }, + mappings: { dynamic: false, properties: {} }, + aliases: {}, + }, + }; + clusterClient.indices.getTemplate.mockResolvedValue( + asApiResponse(response) + ); + await expect(clusterClientAdapter.getExistingLegacyIndexTemplates('foo*')).resolves.toEqual( + response + ); + }); + + test('should throw error when call cluster throws an error', async () => { + clusterClient.indices.getTemplate.mockRejectedValue(new Error('Fail')); + await expect( + clusterClientAdapter.getExistingLegacyIndexTemplates('foo*') + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"error getting existing legacy index templates: Fail"` + ); + }); +}); + +describe('setLegacyIndexTemplateToHidden', () => { + test('should call cluster with given index template name and template', async () => { + const currentTemplate = { + order: 0, + index_patterns: ['foo-bar-*'], + settings: { index: { number_of_shards: '1' } }, + mappings: { dynamic: false, properties: {} }, + aliases: {}, + }; + await clusterClientAdapter.setLegacyIndexTemplateToHidden('foo-bar-template', currentTemplate); + expect(clusterClient.indices.putTemplate).toHaveBeenCalledWith({ + name: 'foo-bar-template', + body: { + order: 0, + index_patterns: ['foo-bar-*'], + settings: { index: { number_of_shards: '1' }, 'index.hidden': true }, + mappings: { dynamic: false, properties: {} }, + aliases: {}, + }, + }); + }); + + test('should throw error when call cluster throws an error', async () => { + clusterClient.indices.putTemplate.mockRejectedValue(new Error('Fail')); + await expect( + clusterClientAdapter.setLegacyIndexTemplateToHidden('foo-bar-template', { + aliases: {}, + index_patterns: [], + mappings: {}, + order: 0, + settings: {}, + }) + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"error setting existing legacy index template foo-bar-template to hidden: Fail"` + ); + }); +}); + +describe('getExistingIndices', () => { + test('should call cluster with given index pattern', async () => { + await clusterClientAdapter.getExistingIndices('foo*'); + expect(clusterClient.indices.getSettings).toHaveBeenCalledWith( + { + index: 'foo*', + }, + { ignore: [404] } + ); + }); + + test('should return indices when found', async () => { + const response = { + 'foo-bar-000001': { + settings: { + index: { + number_of_shards: 1, + uuid: 'Ure4d9edQbCMtcmyy0ObrA', + }, + }, + }, + }; + clusterClient.indices.getSettings.mockResolvedValue( + asApiResponse(response) + ); + await expect(clusterClientAdapter.getExistingIndices('foo*')).resolves.toEqual(response); + }); + + test('should throw error when call cluster throws an error', async () => { + clusterClient.indices.getSettings.mockRejectedValue(new Error('Fail')); + await expect( + clusterClientAdapter.getExistingIndices('foo*') + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"error getting existing indices matching pattern foo*: Fail"` + ); + }); +}); + +describe('setIndexToHidden', () => { + test('should call cluster with given index name', async () => { + await clusterClientAdapter.setIndexToHidden('foo-bar-000001'); + expect(clusterClient.indices.putSettings).toHaveBeenCalledWith({ + index: 'foo-bar-000001', + body: { + settings: { + 'index.hidden': true, + }, + }, + }); + }); + + test('should throw error when call cluster throws an error', async () => { + clusterClient.indices.putSettings.mockRejectedValue(new Error('Fail')); + await expect( + clusterClientAdapter.setIndexToHidden('foo-bar-000001') + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"error setting existing index foo-bar-000001 to hidden: Fail"` + ); + }); +}); + +describe('getExistingIndexAliases', () => { + test('should call cluster with given index pattern', async () => { + await clusterClientAdapter.getExistingIndexAliases('foo*'); + expect(clusterClient.indices.getAlias).toHaveBeenCalledWith( + { + index: 'foo*', + }, + { ignore: [404] } + ); + }); + + test('should return aliases when found', async () => { + const response = { + 'foo-bar-000001': { + aliases: { + 'foo-bar': { + is_write_index: true, + }, + }, + }, + }; + clusterClient.indices.getAlias.mockResolvedValue( + asApiResponse(response) + ); + await expect(clusterClientAdapter.getExistingIndexAliases('foo*')).resolves.toEqual(response); + }); + + test('should throw error when call cluster throws an error', async () => { + clusterClient.indices.getAlias.mockRejectedValue(new Error('Fail')); + await expect( + clusterClientAdapter.getExistingIndexAliases('foo*') + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"error getting existing index aliases matching pattern foo*: Fail"` + ); + }); +}); + +describe('setIndexAliasToHidden', () => { + test('should call cluster with given index name and aliases', async () => { + await clusterClientAdapter.setIndexAliasToHidden('foo-bar-000001', { + aliases: { + 'foo-bar': { + is_write_index: true, + }, + }, + }); + expect(clusterClient.indices.updateAliases).toHaveBeenCalledWith({ + body: { + actions: [ + { + add: { + index: 'foo-bar-000001', + alias: 'foo-bar', + is_hidden: true, + is_write_index: true, + }, + }, + ], + }, + }); + }); + + test('should update multiple aliases at once and preserve existing alias settings', async () => { + await clusterClientAdapter.setIndexAliasToHidden('foo-bar-000001', { + aliases: { + 'foo-bar': { + is_write_index: true, + }, + 'foo-b': { + index_routing: 'index', + routing: 'route', + }, + }, + }); + expect(clusterClient.indices.updateAliases).toHaveBeenCalledWith({ + body: { + actions: [ + { + add: { + index: 'foo-bar-000001', + alias: 'foo-bar', + is_hidden: true, + is_write_index: true, + }, + }, + { + add: { + index: 'foo-bar-000001', + alias: 'foo-b', + is_hidden: true, + index_routing: 'index', + routing: 'route', + }, + }, + ], + }, + }); + }); + + test('should throw error when call cluster throws an error', async () => { + clusterClient.indices.updateAliases.mockRejectedValue(new Error('Fail')); + await expect( + clusterClientAdapter.setIndexAliasToHidden('foo-bar-000001', { + aliases: { + 'foo-bar': { + is_write_index: true, + }, + }, + }) + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"error setting existing index aliases for index foo-bar-000001 to is_hidden: Fail"` + ); + }); +}); + describe('doesAliasExist', () => { test('should call cluster with proper arguments', async () => { await clusterClientAdapter.doesAliasExist('foo'); @@ -338,16 +609,106 @@ describe('queryEventsBySavedObject', () => { }, }) ); - await clusterClientAdapter.queryEventsBySavedObjects( - 'index-name', - 'namespace', - 'saved-object-type', - ['saved-object-id'], - DEFAULT_OPTIONS - ); + await clusterClientAdapter.queryEventsBySavedObjects({ + index: 'index-name', + namespace: 'namespace', + type: 'saved-object-type', + ids: ['saved-object-id'], + findOptions: DEFAULT_OPTIONS, + }); const [query] = clusterClient.search.mock.calls[0]; - expect(query).toMatchInlineSnapshot(` + expect(query).toMatchInlineSnapshot( + { + body: { + from: 0, + query: { + bool: { + filter: [], + must: [ + { + nested: { + path: 'kibana.saved_objects', + query: { + bool: { + must: [ + { + term: { + 'kibana.saved_objects.rel': { + value: 'primary', + }, + }, + }, + { + term: { + 'kibana.saved_objects.type': { + value: 'saved-object-type', + }, + }, + }, + { + term: { + 'kibana.saved_objects.namespace': { + value: 'namespace', + }, + }, + }, + ], + }, + }, + }, + }, + { + bool: { + should: [ + { + bool: { + must: [ + { + nested: { + path: 'kibana.saved_objects', + query: { + bool: { + must: [ + { + terms: { + 'kibana.saved_objects.id': ['saved-object-id'], + }, + }, + ], + }, + }, + }, + }, + { + range: { + 'kibana.version': { + gte: '8.0.0', + }, + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + size: 10, + sort: [ + { + '@timestamp': { + order: 'asc', + }, + }, + ], + }, + index: 'index-name', + track_total_hits: true, + }, + ` Object { "body": Object { "from": 0, @@ -375,13 +736,6 @@ describe('queryEventsBySavedObject', () => { }, }, }, - Object { - "terms": Object { - "kibana.saved_objects.id": Array [ - "saved-object-id", - ], - }, - }, Object { "term": Object { "kibana.saved_objects.namespace": Object { @@ -394,6 +748,43 @@ describe('queryEventsBySavedObject', () => { }, }, }, + Object { + "bool": Object { + "should": Array [ + Object { + "bool": Object { + "must": Array [ + Object { + "nested": Object { + "path": "kibana.saved_objects", + "query": Object { + "bool": Object { + "must": Array [ + Object { + "terms": Object { + "kibana.saved_objects.id": Array [ + "saved-object-id", + ], + }, + }, + ], + }, + }, + }, + }, + Object { + "range": Object { + "kibana.version": Object { + "gte": "8.0.0", + }, + }, + }, + ], + }, + }, + ], + }, + }, ], }, }, @@ -409,7 +800,8 @@ describe('queryEventsBySavedObject', () => { "index": "index-name", "track_total_hits": true, } - `); + ` + ); }); test('should call cluster with proper arguments with default namespace', async () => { @@ -429,80 +821,106 @@ describe('queryEventsBySavedObject', () => { }, }) ); - await clusterClientAdapter.queryEventsBySavedObjects( - 'index-name', - undefined, - 'saved-object-type', - ['saved-object-id'], - DEFAULT_OPTIONS - ); + await clusterClientAdapter.queryEventsBySavedObjects({ + index: 'index-name', + namespace: undefined, + type: 'saved-object-type', + ids: ['saved-object-id'], + findOptions: DEFAULT_OPTIONS, + }); const [query] = clusterClient.search.mock.calls[0]; - expect(query).toMatchInlineSnapshot(` - Object { - "body": Object { - "from": 0, - "query": Object { - "bool": Object { - "filter": Array [], - "must": Array [ - Object { - "nested": Object { - "path": "kibana.saved_objects", - "query": Object { - "bool": Object { - "must": Array [ - Object { - "term": Object { - "kibana.saved_objects.rel": Object { - "value": "primary", - }, + expect(query).toMatchObject({ + body: { + from: 0, + query: { + bool: { + filter: [], + must: [ + { + nested: { + path: 'kibana.saved_objects', + query: { + bool: { + must: [ + { + term: { + 'kibana.saved_objects.rel': { + value: 'primary', }, }, - Object { - "term": Object { - "kibana.saved_objects.type": Object { - "value": "saved-object-type", - }, + }, + { + term: { + 'kibana.saved_objects.type': { + value: 'saved-object-type', }, }, - Object { - "terms": Object { - "kibana.saved_objects.id": Array [ - "saved-object-id", - ], + }, + { + bool: { + must_not: { + exists: { + field: 'kibana.saved_objects.namespace', + }, }, }, - Object { - "bool": Object { - "must_not": Object { - "exists": Object { - "field": "kibana.saved_objects.namespace", + }, + ], + }, + }, + }, + }, + { + bool: { + should: [ + { + bool: { + must: [ + { + nested: { + path: 'kibana.saved_objects', + query: { + bool: { + must: [ + { + terms: { + 'kibana.saved_objects.id': ['saved-object-id'], + }, + }, + ], }, }, }, }, + { + range: { + 'kibana.version': { + gte: '8.0.0', + }, + }, + }, ], }, }, - }, + ], }, - ], - }, - }, - "size": 10, - "sort": Array [ - Object { - "@timestamp": Object { - "order": "asc", }, - }, - ], + ], + }, }, - "index": "index-name", - "track_total_hits": true, - } - `); + size: 10, + sort: [ + { + '@timestamp': { + order: 'asc', + }, + }, + ], + }, + index: 'index-name', + track_total_hits: true, + }); }); test('should call cluster with sort', async () => { @@ -522,13 +940,13 @@ describe('queryEventsBySavedObject', () => { }, }) ); - await clusterClientAdapter.queryEventsBySavedObjects( - 'index-name', - 'namespace', - 'saved-object-type', - ['saved-object-id'], - { ...DEFAULT_OPTIONS, sort_field: 'event.end', sort_order: 'desc' } - ); + await clusterClientAdapter.queryEventsBySavedObjects({ + index: 'index-name', + namespace: 'namespace', + type: 'saved-object-type', + ids: ['saved-object-id'], + findOptions: { ...DEFAULT_OPTIONS, sort_field: 'event.end', sort_order: 'desc' }, + }); const [query] = clusterClient.search.mock.calls[0]; expect(query).toMatchObject({ @@ -559,85 +977,111 @@ describe('queryEventsBySavedObject', () => { const start = '2020-07-08T00:52:28.350Z'; - await clusterClientAdapter.queryEventsBySavedObjects( - 'index-name', - 'namespace', - 'saved-object-type', - ['saved-object-id'], - { ...DEFAULT_OPTIONS, start } - ); + await clusterClientAdapter.queryEventsBySavedObjects({ + index: 'index-name', + namespace: 'namespace', + type: 'saved-object-type', + ids: ['saved-object-id'], + findOptions: { ...DEFAULT_OPTIONS, start }, + }); const [query] = clusterClient.search.mock.calls[0]; - expect(query).toMatchInlineSnapshot(` - Object { - "body": Object { - "from": 0, - "query": Object { - "bool": Object { - "filter": Array [], - "must": Array [ - Object { - "nested": Object { - "path": "kibana.saved_objects", - "query": Object { - "bool": Object { - "must": Array [ - Object { - "term": Object { - "kibana.saved_objects.rel": Object { - "value": "primary", - }, + expect(query).toMatchObject({ + body: { + from: 0, + query: { + bool: { + filter: [], + must: [ + { + nested: { + path: 'kibana.saved_objects', + query: { + bool: { + must: [ + { + term: { + 'kibana.saved_objects.rel': { + value: 'primary', }, }, - Object { - "term": Object { - "kibana.saved_objects.type": Object { - "value": "saved-object-type", - }, + }, + { + term: { + 'kibana.saved_objects.type': { + value: 'saved-object-type', }, }, - Object { - "terms": Object { - "kibana.saved_objects.id": Array [ - "saved-object-id", - ], + }, + { + term: { + 'kibana.saved_objects.namespace': { + value: 'namespace', }, }, - Object { - "term": Object { - "kibana.saved_objects.namespace": Object { - "value": "namespace", + }, + ], + }, + }, + }, + }, + { + bool: { + should: [ + { + bool: { + must: [ + { + nested: { + path: 'kibana.saved_objects', + query: { + bool: { + must: [ + { + terms: { + 'kibana.saved_objects.id': ['saved-object-id'], + }, + }, + ], + }, + }, + }, + }, + { + range: { + 'kibana.version': { + gte: '8.0.0', }, }, }, ], }, }, - }, + ], }, - Object { - "range": Object { - "@timestamp": Object { - "gte": "2020-07-08T00:52:28.350Z", - }, + }, + { + range: { + '@timestamp': { + gte: '2020-07-08T00:52:28.350Z', }, }, - ], - }, - }, - "size": 10, - "sort": Array [ - Object { - "@timestamp": Object { - "order": "asc", }, - }, - ], + ], + }, }, - "index": "index-name", - "track_total_hits": true, - } - `); + size: 10, + sort: [ + { + '@timestamp': { + order: 'asc', + }, + }, + ], + }, + index: 'index-name', + track_total_hits: true, + }); }); test('supports optional date range', async () => { @@ -661,92 +1105,163 @@ describe('queryEventsBySavedObject', () => { const start = '2020-07-08T00:52:28.350Z'; const end = '2020-07-08T00:00:00.000Z'; - await clusterClientAdapter.queryEventsBySavedObjects( - 'index-name', - 'namespace', - 'saved-object-type', - ['saved-object-id'], - { ...DEFAULT_OPTIONS, start, end } - ); + await clusterClientAdapter.queryEventsBySavedObjects({ + index: 'index-name', + namespace: 'namespace', + type: 'saved-object-type', + ids: ['saved-object-id'], + findOptions: { ...DEFAULT_OPTIONS, start, end }, + legacyIds: ['legacy-id'], + }); const [query] = clusterClient.search.mock.calls[0]; - expect(query).toMatchInlineSnapshot(` - Object { - "body": Object { - "from": 0, - "query": Object { - "bool": Object { - "filter": Array [], - "must": Array [ - Object { - "nested": Object { - "path": "kibana.saved_objects", - "query": Object { - "bool": Object { - "must": Array [ - Object { - "term": Object { - "kibana.saved_objects.rel": Object { - "value": "primary", - }, + expect(query).toMatchObject({ + body: { + from: 0, + query: { + bool: { + filter: [], + must: [ + { + nested: { + path: 'kibana.saved_objects', + query: { + bool: { + must: [ + { + term: { + 'kibana.saved_objects.rel': { + value: 'primary', }, }, - Object { - "term": Object { - "kibana.saved_objects.type": Object { - "value": "saved-object-type", + }, + { + term: { + 'kibana.saved_objects.type': { + value: 'saved-object-type', + }, + }, + }, + { + term: { + 'kibana.saved_objects.namespace': { + value: 'namespace', + }, + }, + }, + ], + }, + }, + }, + }, + { + bool: { + should: [ + { + bool: { + must: [ + { + nested: { + path: 'kibana.saved_objects', + query: { + bool: { + must: [ + { + terms: { + 'kibana.saved_objects.id': ['saved-object-id'], + }, + }, + ], + }, }, }, }, - Object { - "terms": Object { - "kibana.saved_objects.id": Array [ - "saved-object-id", - ], + { + range: { + 'kibana.version': { + gte: '8.0.0', + }, }, }, - Object { - "term": Object { - "kibana.saved_objects.namespace": Object { - "value": "namespace", + ], + }, + }, + { + bool: { + must: [ + { + nested: { + path: 'kibana.saved_objects', + query: { + bool: { + must: [ + { + terms: { + 'kibana.saved_objects.id': ['legacy-id'], + }, + }, + ], + }, }, }, }, + { + bool: { + should: [ + { + range: { + 'kibana.version': { + lt: '8.0.0', + }, + }, + }, + { + bool: { + must_not: { + exists: { + field: 'kibana.version', + }, + }, + }, + }, + ], + }, + }, ], }, }, - }, + ], }, - Object { - "range": Object { - "@timestamp": Object { - "gte": "2020-07-08T00:52:28.350Z", - }, + }, + { + range: { + '@timestamp': { + gte: '2020-07-08T00:52:28.350Z', }, }, - Object { - "range": Object { - "@timestamp": Object { - "lte": "2020-07-08T00:00:00.000Z", - }, + }, + { + range: { + '@timestamp': { + lte: '2020-07-08T00:00:00.000Z', }, }, - ], - }, - }, - "size": 10, - "sort": Array [ - Object { - "@timestamp": Object { - "order": "asc", }, - }, - ], + ], + }, }, - "index": "index-name", - "track_total_hits": true, - } - `); + size: 10, + sort: [ + { + '@timestamp': { + order: 'asc', + }, + }, + ], + }, + index: 'index-name', + track_total_hits: true, + }); }); }); 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 a3a48c04370d8..7eb3328dddb6b 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 @@ -7,7 +7,7 @@ import { Subject } from 'rxjs'; import { bufferTime, filter as rxFilter, switchMap } from 'rxjs/operators'; -import { reject, isUndefined, isNumber } from 'lodash'; +import { reject, isUndefined, isNumber, pick } from 'lodash'; import type { PublicMethodsOf } from '@kbn/utility-types'; import { Logger, ElasticsearchClient } from 'src/core/server'; import util from 'util'; @@ -41,9 +41,20 @@ export interface QueryEventsBySavedObjectResult { data: IValidatedEvent[]; } +interface QueryOptionsEventsBySavedObjectFilter { + index: string; + namespace: string | undefined; + type: string; + ids: string[]; + findOptions: FindOptionsType; + legacyIds?: string[]; +} + // eslint-disable-next-line @typescript-eslint/no-explicit-any type AliasAny = any; +const LEGACY_ID_CUTOFF_VERSION = '8.0.0'; + export class ClusterClientAdapter { private readonly logger: Logger; private readonly elasticsearchClientPromise: Promise; @@ -152,17 +163,23 @@ export class ClusterClientAdapter { try { const esClient = await this.elasticsearchClientPromise; - const { body } = await esClient.indices.existsTemplate({ name }); - return body as boolean; + const { body: legacyResult } = await esClient.indices.existsTemplate({ name }); + const { body: indexTemplateResult } = await esClient.indices.existsIndexTemplate({ name }); + return (legacyResult as boolean) || (indexTemplateResult as boolean); } catch (err) { - throw new Error(`error checking existance of index template: ${err.message}`); + throw new Error(`error checking existence of index template: ${err.message}`); } } public async createIndexTemplate(name: string, template: Record): Promise { try { const esClient = await this.elasticsearchClientPromise; - await esClient.indices.putTemplate({ name, body: template, create: true }); + await esClient.indices.putIndexTemplate({ + name, + body: template, + // @ts-expect-error doesn't exist in @elastic/elasticsearch + create: true, + }); } catch (err) { // The error message doesn't have a type attribute we can look to guarantee it's due // to the template already existing (only long message) so we'll check ourselves to see @@ -177,6 +194,128 @@ export class ClusterClientAdapter { + try { + const esClient = await this.elasticsearchClientPromise; + const { body: templates } = await esClient.indices.getTemplate( + { name: indexTemplatePattern }, + { ignore: [404] } + ); + return templates; + } catch (err) { + throw new Error(`error getting existing legacy index templates: ${err.message}`); + } + } + + public async setLegacyIndexTemplateToHidden( + indexTemplateName: string, + currentIndexTemplate: estypes.IndicesTemplateMapping + ): Promise { + try { + const esClient = await this.elasticsearchClientPromise; + await esClient.indices.putTemplate({ + name: indexTemplateName, + body: { + ...currentIndexTemplate, + settings: { + ...currentIndexTemplate.settings, + 'index.hidden': true, + }, + }, + }); + } catch (err) { + throw new Error( + `error setting existing legacy index template ${indexTemplateName} to hidden: ${err.message}` + ); + } + } + + public async getExistingIndices( + indexPattern: string + ): Promise { + try { + const esClient = await this.elasticsearchClientPromise; + const { body: indexSettings } = await esClient.indices.getSettings( + { index: indexPattern }, + { ignore: [404] } + ); + return indexSettings; + } catch (err) { + throw new Error( + `error getting existing indices matching pattern ${indexPattern}: ${err.message}` + ); + } + } + + public async setIndexToHidden(indexName: string): Promise { + try { + const esClient = await this.elasticsearchClientPromise; + await esClient.indices.putSettings({ + index: indexName, + body: { + settings: { + 'index.hidden': true, + }, + }, + }); + } catch (err) { + throw new Error(`error setting existing index ${indexName} to hidden: ${err.message}`); + } + } + + public async getExistingIndexAliases( + indexPattern: string + ): Promise { + try { + const esClient = await this.elasticsearchClientPromise; + const { body: indexAliases } = await esClient.indices.getAlias( + { index: indexPattern }, + { ignore: [404] } + ); + return indexAliases; + } catch (err) { + throw new Error( + `error getting existing index aliases matching pattern ${indexPattern}: ${err.message}` + ); + } + } + + public async setIndexAliasToHidden( + indexName: string, + currentAliases: estypes.IndicesGetAliasIndexAliases + ): Promise { + try { + const esClient = await this.elasticsearchClientPromise; + await esClient.indices.updateAliases({ + body: { + actions: Object.keys(currentAliases.aliases).map((aliasName) => { + const existingAliasOptions = pick(currentAliases.aliases[aliasName], [ + 'is_write_index', + 'filter', + 'index_routing', + 'routing', + 'search_routing', + ]); + return { + add: { + ...existingAliasOptions, + index: indexName, + alias: aliasName, + is_hidden: true, + }, + }; + }), + }, + }); + } catch (err) { + throw new Error( + `error setting existing index aliases for index ${indexName} to is_hidden: ${err.message}` + ); + } + } + public async doesAliasExist(name: string): Promise { try { const esClient = await this.elasticsearchClientPromise; @@ -202,13 +341,12 @@ export class ClusterClientAdapter { + const { index, namespace, type, ids, findOptions, legacyIds } = queryOptions; + // eslint-disable-next-line @typescript-eslint/naming-convention + const { page, per_page: perPage, start, end, sort_field, sort_order, filter } = findOptions; + const defaultNamespaceQuery = { bool: { must_not: { @@ -238,41 +376,125 @@ export class ClusterClientAdapter 0) { + shouldQuery.push({ + bool: { + must: [ + { + nested: { + path: 'kibana.saved_objects', + query: { + bool: { + must: [ + { + terms: { + // default maximum of 65,536 terms, configurable by index.max_terms_count + 'kibana.saved_objects.id': legacyIds, + }, + }, + ], }, }, - { - term: { - 'kibana.saved_objects.type': { - value: type, + }, + }, + { + bool: { + should: [ + { + range: { + 'kibana.version': { + lt: LEGACY_ID_CUTOFF_VERSION, + }, }, }, - }, - { - terms: { - // default maximum of 65,536 terms, configurable by index.max_terms_count - 'kibana.saved_objects.id': ids, + { + bool: { + must_not: { + exists: { + field: 'kibana.version', + }, + }, + }, }, - }, - // @ts-expect-error undefined is not assignable as QueryDslTermQuery value - namespaceQuery, - ], + ], + }, }, - }, + ], }, + }); + } + + musts.push({ + bool: { + should: shouldQuery, }, - ]; + }); + if (start) { musts.push({ range: { diff --git a/x-pack/plugins/event_log/server/es/context.test.ts b/x-pack/plugins/event_log/server/es/context.test.ts index 9589ab3c4aebf..0fe63ffb6217a 100644 --- a/x-pack/plugins/event_log/server/es/context.test.ts +++ b/x-pack/plugins/event_log/server/es/context.test.ts @@ -64,6 +64,7 @@ describe('createEsContext', () => { elasticsearchClientPromise: Promise.resolve(elasticsearchClient), }); elasticsearchClient.indices.existsTemplate.mockResolvedValue(asApiResponse(false)); + elasticsearchClient.indices.existsIndexTemplate.mockResolvedValue(asApiResponse(false)); elasticsearchClient.indices.existsAlias.mockResolvedValue(asApiResponse(false)); const doesAliasExist = await context.esAdapter.doesAliasExist(context.esNames.alias); expect(doesAliasExist).toBeFalsy(); diff --git a/x-pack/plugins/event_log/server/es/documents.test.ts b/x-pack/plugins/event_log/server/es/documents.test.ts index 121fcc42f37e4..6df5a1334f167 100644 --- a/x-pack/plugins/event_log/server/es/documents.test.ts +++ b/x-pack/plugins/event_log/server/es/documents.test.ts @@ -25,10 +25,11 @@ describe('getIndexTemplate()', () => { test('returns the correct details of the index template', () => { const indexTemplate = getIndexTemplate(esNames); expect(indexTemplate.index_patterns).toEqual([esNames.indexPatternWithVersion]); - expect(indexTemplate.settings.number_of_shards).toBeGreaterThanOrEqual(0); - expect(indexTemplate.settings.auto_expand_replicas).toBe('0-1'); - expect(indexTemplate.settings['index.lifecycle.name']).toBe(esNames.ilmPolicy); - expect(indexTemplate.settings['index.lifecycle.rollover_alias']).toBe(esNames.alias); - expect(indexTemplate.mappings).toMatchObject({}); + expect(indexTemplate.template.settings.number_of_shards).toBeGreaterThanOrEqual(0); + expect(indexTemplate.template.settings.auto_expand_replicas).toBe('0-1'); + expect(indexTemplate.template.settings['index.lifecycle.name']).toBe(esNames.ilmPolicy); + expect(indexTemplate.template.settings['index.lifecycle.rollover_alias']).toBe(esNames.alias); + expect(indexTemplate.template.settings['index.hidden']).toBe(true); + expect(indexTemplate.template.mappings).toMatchObject({}); }); }); diff --git a/x-pack/plugins/event_log/server/es/documents.ts b/x-pack/plugins/event_log/server/es/documents.ts index 8594fca603d18..c4ffda5f51ebe 100644 --- a/x-pack/plugins/event_log/server/es/documents.ts +++ b/x-pack/plugins/event_log/server/es/documents.ts @@ -12,13 +12,16 @@ import mappings from '../../generated/mappings.json'; export function getIndexTemplate(esNames: EsNames) { const indexTemplateBody = { index_patterns: [esNames.indexPatternWithVersion], - settings: { - number_of_shards: 1, - auto_expand_replicas: '0-1', - 'index.lifecycle.name': esNames.ilmPolicy, - 'index.lifecycle.rollover_alias': esNames.alias, + template: { + settings: { + number_of_shards: 1, + auto_expand_replicas: '0-1', + 'index.lifecycle.name': esNames.ilmPolicy, + 'index.lifecycle.rollover_alias': esNames.alias, + 'index.hidden': true, + }, + mappings, }, - mappings, }; return indexTemplateBody; diff --git a/x-pack/plugins/event_log/server/es/init.test.ts b/x-pack/plugins/event_log/server/es/init.test.ts index 074ceea1f4a24..bfdf0c17e5035 100644 --- a/x-pack/plugins/event_log/server/es/init.test.ts +++ b/x-pack/plugins/event_log/server/es/init.test.ts @@ -13,6 +13,327 @@ describe('initializeEs', () => { beforeEach(() => { esContext = contextMock.create(); + esContext.esAdapter.getExistingLegacyIndexTemplates.mockResolvedValue({}); + esContext.esAdapter.getExistingIndices.mockResolvedValue({}); + esContext.esAdapter.getExistingIndexAliases.mockResolvedValue({}); + }); + + test(`should update existing index templates if any exist and are not hidden`, async () => { + const testTemplate = { + order: 0, + index_patterns: ['foo-bar-*'], + settings: { + index: { + lifecycle: { + name: 'foo-bar-policy', + rollover_alias: 'foo-bar-1', + }, + number_of_shards: '1', + auto_expand_replicas: '0-1', + }, + }, + mappings: {}, + aliases: {}, + }; + esContext.esAdapter.getExistingLegacyIndexTemplates.mockResolvedValue({ + 'foo-bar-template': testTemplate, + }); + + await initializeEs(esContext); + expect(esContext.esAdapter.getExistingLegacyIndexTemplates).toHaveBeenCalled(); + expect(esContext.esAdapter.setLegacyIndexTemplateToHidden).toHaveBeenCalledWith( + 'foo-bar-template', + testTemplate + ); + }); + + test(`should not update existing index templates if any exist and are already hidden`, async () => { + const testTemplate = { + order: 0, + index_patterns: ['foo-bar-*'], + settings: { + index: { + lifecycle: { + name: 'foo-bar-policy', + rollover_alias: 'foo-bar-1', + }, + hidden: 'true', + number_of_shards: '1', + auto_expand_replicas: '0-1', + }, + }, + mappings: {}, + aliases: {}, + }; + esContext.esAdapter.getExistingLegacyIndexTemplates.mockResolvedValue({ + 'foo-bar-template': testTemplate, + }); + + await initializeEs(esContext); + expect(esContext.esAdapter.getExistingLegacyIndexTemplates).toHaveBeenCalled(); + expect(esContext.esAdapter.setLegacyIndexTemplateToHidden).not.toHaveBeenCalled(); + }); + + test(`should continue initialization if getting existing index templates throws an error`, async () => { + esContext.esAdapter.getExistingLegacyIndexTemplates.mockRejectedValue(new Error('Fail')); + + await initializeEs(esContext); + expect(esContext.esAdapter.getExistingLegacyIndexTemplates).toHaveBeenCalled(); + expect(esContext.logger.error).toHaveBeenCalledWith( + `error getting existing index templates - Fail` + ); + expect(esContext.esAdapter.setLegacyIndexTemplateToHidden).not.toHaveBeenCalled(); + expect(esContext.esAdapter.doesIlmPolicyExist).toHaveBeenCalled(); + }); + + test(`should continue initialization if updating existing index templates throws an error`, async () => { + const testTemplate = { + order: 0, + index_patterns: ['foo-bar-*'], + settings: { + index: { + lifecycle: { + name: 'foo-bar-policy', + rollover_alias: 'foo-bar-1', + }, + number_of_shards: '1', + auto_expand_replicas: '0-1', + }, + }, + mappings: {}, + aliases: {}, + }; + esContext.esAdapter.getExistingLegacyIndexTemplates.mockResolvedValue({ + 'foo-bar-template': testTemplate, + 'another-test-template': testTemplate, + }); + esContext.esAdapter.setLegacyIndexTemplateToHidden.mockRejectedValueOnce(new Error('Fail')); + esContext.esAdapter.setLegacyIndexTemplateToHidden.mockResolvedValueOnce(); + + await initializeEs(esContext); + expect(esContext.esAdapter.getExistingLegacyIndexTemplates).toHaveBeenCalled(); + expect(esContext.esAdapter.setLegacyIndexTemplateToHidden).toHaveBeenCalledWith( + 'foo-bar-template', + testTemplate + ); + expect(esContext.esAdapter.setLegacyIndexTemplateToHidden).toHaveBeenCalledWith( + 'another-test-template', + testTemplate + ); + expect(esContext.logger.error).toHaveBeenCalledTimes(1); + expect(esContext.logger.error).toHaveBeenCalledWith( + `error setting existing \"foo-bar-template\" index template to hidden - Fail` + ); + expect(esContext.esAdapter.doesIlmPolicyExist).toHaveBeenCalled(); + }); + + test(`should update existing index settings if any exist and are not hidden`, async () => { + const testSettings = { + settings: { + index: { + lifecycle: { + name: 'foo-bar-policy', + rollover_alias: 'foo-bar-1', + }, + routing: { + allocation: { + include: { + _tier_preference: 'data_content', + }, + }, + }, + number_of_shards: '1', + auto_expand_replicas: '0-1', + provided_name: '.kibana-event-log-7.15.0-000001', + creation_date: '1630439186791', + number_of_replicas: '0', + uuid: 'Ure4d9edQbCMtcmyy0ObrA', + version: { + created: '7150099', + }, + }, + }, + }; + esContext.esAdapter.getExistingIndices.mockResolvedValue({ + 'foo-bar-000001': testSettings, + }); + + await initializeEs(esContext); + expect(esContext.esAdapter.getExistingIndices).toHaveBeenCalled(); + expect(esContext.esAdapter.setIndexToHidden).toHaveBeenCalledWith('foo-bar-000001'); + }); + + test(`should not update existing index settings if any exist and are already hidden`, async () => { + const testSettings = { + settings: { + index: { + lifecycle: { + name: 'foo-bar-policy', + rollover_alias: 'foo-bar-1', + }, + routing: { + allocation: { + include: { + _tier_preference: 'data_content', + }, + }, + }, + hidden: 'true', + number_of_shards: '1', + auto_expand_replicas: '0-1', + provided_name: '.kibana-event-log-7.15.0-000001', + creation_date: '1630439186791', + number_of_replicas: '0', + uuid: 'Ure4d9edQbCMtcmyy0ObrA', + version: { + created: '7150099', + }, + }, + }, + }; + esContext.esAdapter.getExistingIndices.mockResolvedValue({ + 'foo-bar-000001': testSettings, + }); + + await initializeEs(esContext); + expect(esContext.esAdapter.getExistingIndices).toHaveBeenCalled(); + expect(esContext.esAdapter.setIndexToHidden).not.toHaveBeenCalled(); + }); + + test(`should continue initialization if getting existing index settings throws an error`, async () => { + esContext.esAdapter.getExistingIndices.mockRejectedValue(new Error('Fail')); + + await initializeEs(esContext); + expect(esContext.esAdapter.getExistingIndices).toHaveBeenCalled(); + expect(esContext.logger.error).toHaveBeenCalledWith(`error getting existing indices - Fail`); + expect(esContext.esAdapter.setIndexToHidden).not.toHaveBeenCalled(); + expect(esContext.esAdapter.doesIlmPolicyExist).toHaveBeenCalled(); + }); + + test(`should continue initialization if updating existing index settings throws an error`, async () => { + const testSettings = { + settings: { + index: { + lifecycle: { + name: 'foo-bar-policy', + rollover_alias: 'foo-bar-1', + }, + routing: { + allocation: { + include: { + _tier_preference: 'data_content', + }, + }, + }, + number_of_shards: '1', + auto_expand_replicas: '0-1', + provided_name: '.kibana-event-log-7.15.0-000001', + creation_date: '1630439186791', + number_of_replicas: '0', + uuid: 'Ure4d9edQbCMtcmyy0ObrA', + version: { + created: '7150099', + }, + }, + }, + }; + esContext.esAdapter.getExistingIndices.mockResolvedValue({ + 'foo-bar-000001': testSettings, + 'foo-bar-000002': testSettings, + }); + + esContext.esAdapter.setIndexToHidden.mockRejectedValueOnce(new Error('Fail')); + esContext.esAdapter.setIndexToHidden.mockResolvedValueOnce(); + + await initializeEs(esContext); + expect(esContext.esAdapter.getExistingIndices).toHaveBeenCalled(); + expect(esContext.logger.error).toHaveBeenCalledTimes(1); + expect(esContext.logger.error).toHaveBeenCalledWith( + `error setting existing \"foo-bar-000001\" index to hidden - Fail` + ); + expect(esContext.esAdapter.doesIlmPolicyExist).toHaveBeenCalled(); + }); + + test(`should update existing index aliases if any exist and are not hidden`, async () => { + const testAliases = { + aliases: { + 'foo-bar': { + is_write_index: true, + }, + }, + }; + esContext.esAdapter.getExistingIndexAliases.mockResolvedValue({ + 'foo-bar-000001': testAliases, + }); + + await initializeEs(esContext); + expect(esContext.esAdapter.getExistingIndexAliases).toHaveBeenCalled(); + expect(esContext.esAdapter.setIndexAliasToHidden).toHaveBeenCalledWith( + 'foo-bar-000001', + testAliases + ); + }); + + test(`should not update existing index aliases if any exist and are already hidden`, async () => { + const testAliases = { + aliases: { + 'foo-bar': { + is_write_index: true, + is_hidden: true, + }, + }, + }; + esContext.esAdapter.getExistingIndexAliases.mockResolvedValue({ + 'foo-bar-000001': testAliases, + }); + + await initializeEs(esContext); + expect(esContext.esAdapter.getExistingIndexAliases).toHaveBeenCalled(); + expect(esContext.esAdapter.setIndexAliasToHidden).not.toHaveBeenCalled(); + }); + + test(`should continue initialization if getting existing index aliases throws an error`, async () => { + esContext.esAdapter.getExistingIndexAliases.mockRejectedValue(new Error('Fail')); + + await initializeEs(esContext); + expect(esContext.esAdapter.getExistingIndexAliases).toHaveBeenCalled(); + expect(esContext.logger.error).toHaveBeenCalledWith( + `error getting existing index aliases - Fail` + ); + expect(esContext.esAdapter.setIndexAliasToHidden).not.toHaveBeenCalled(); + expect(esContext.esAdapter.doesIlmPolicyExist).toHaveBeenCalled(); + }); + + test(`should continue initialization if updating existing index aliases throws an error`, async () => { + const testAliases = { + aliases: { + 'foo-bar': { + is_write_index: true, + }, + }, + }; + esContext.esAdapter.getExistingIndexAliases.mockResolvedValue({ + 'foo-bar-000001': testAliases, + 'foo-bar-000002': testAliases, + }); + esContext.esAdapter.setIndexAliasToHidden.mockRejectedValueOnce(new Error('Fail')); + esContext.esAdapter.setIndexAliasToHidden.mockResolvedValueOnce(); + + await initializeEs(esContext); + expect(esContext.esAdapter.getExistingIndexAliases).toHaveBeenCalled(); + expect(esContext.esAdapter.setIndexAliasToHidden).toHaveBeenCalledWith( + 'foo-bar-000001', + testAliases + ); + expect(esContext.esAdapter.setIndexAliasToHidden).toHaveBeenCalledWith( + 'foo-bar-000002', + testAliases + ); + expect(esContext.logger.error).toHaveBeenCalledTimes(1); + expect(esContext.logger.error).toHaveBeenCalledWith( + `error setting existing \"foo-bar-000001\" index aliases - Fail` + ); + expect(esContext.esAdapter.doesIlmPolicyExist).toHaveBeenCalled(); }); test(`should create ILM policy if it doesn't exist`, async () => { diff --git a/x-pack/plugins/event_log/server/es/init.ts b/x-pack/plugins/event_log/server/es/init.ts index 484dfdc95a72c..bc1b36ab3e375 100644 --- a/x-pack/plugins/event_log/server/es/init.ts +++ b/x-pack/plugins/event_log/server/es/init.ts @@ -5,6 +5,9 @@ * 2.0. */ +import { IndicesAlias, IndicesIndexStatePrefixedSettings } from '@elastic/elasticsearch/api/types'; +import { estypes } from '@elastic/elasticsearch'; +import { asyncForEach } from '@kbn/std'; import { getIlmPolicy, getIndexTemplate } from './documents'; import { EsContext } from './context'; @@ -25,6 +28,7 @@ export async function initializeEs(esContext: EsContext): Promise { async function initializeEsResources(esContext: EsContext) { const steps = new EsInitializationSteps(esContext); + await steps.setExistingAssetsToHidden(); await steps.createIlmPolicyIfNotExists(); await steps.createIndexTemplateIfNotExists(); await steps.createInitialIndexIfNotExists(); @@ -35,6 +39,121 @@ class EsInitializationSteps { this.esContext = esContext; } + async setExistingIndexTemplatesToHidden() { + let indexTemplates: estypes.IndicesGetTemplateResponse = {}; + try { + // look up existing index templates and update index.hidden to true if that + // setting is currently false or undefined + + // since we are updating to the new index template API and converting new event log + // indices to hidden in the same PR, we only need to use the legacy template API to + // look for and update existing event log indices. + indexTemplates = await this.esContext.esAdapter.getExistingLegacyIndexTemplates( + this.esContext.esNames.indexPattern + ); + } catch (err) { + // errors when trying to get existing index templates + // should not block the rest of initialization, log the error and move on + this.esContext.logger.error(`error getting existing index templates - ${err.message}`); + } + + asyncForEach(Object.keys(indexTemplates), async (indexTemplateName: string) => { + try { + const hidden: string | boolean = indexTemplates[indexTemplateName]?.settings?.index?.hidden; + // Check to see if this index template is hidden + if (hidden !== true && hidden !== 'true') { + this.esContext.logger.debug( + `setting existing "${indexTemplateName}" index template to hidden.` + ); + + await this.esContext.esAdapter.setLegacyIndexTemplateToHidden( + indexTemplateName, + indexTemplates[indexTemplateName] + ); + } + } catch (err) { + // errors when trying to update existing index templates to hidden + // should not block the rest of initialization, log the error and move on + this.esContext.logger.error( + `error setting existing "${indexTemplateName}" index template to hidden - ${err.message}` + ); + } + }); + } + + async setExistingIndicesToHidden() { + let indices: estypes.IndicesGetSettingsResponse = {}; + try { + // look up existing indices and update index.hidden to true if that + // setting is currently false or undefined + indices = await this.esContext.esAdapter.getExistingIndices( + this.esContext.esNames.indexPattern + ); + } catch (err) { + // errors when trying to get existing indices + // should not block the rest of initialization, log the error and move on + this.esContext.logger.error(`error getting existing indices - ${err.message}`); + } + asyncForEach(Object.keys(indices), async (indexName: string) => { + try { + const hidden: string | boolean | undefined = (indices[indexName] + ?.settings as IndicesIndexStatePrefixedSettings)?.index?.hidden; + + // Check to see if this index template is hidden + if (hidden !== true && hidden !== 'true') { + this.esContext.logger.debug(`setting existing ${indexName} index to hidden.`); + await this.esContext.esAdapter.setIndexToHidden(indexName); + } + } catch (err) { + // errors when trying to update existing indices to hidden + // should not block the rest of initialization, log the error and move on + this.esContext.logger.error( + `error setting existing "${indexName}" index to hidden - ${err.message}` + ); + } + }); + } + + async setExistingIndexAliasesToHidden() { + let indexAliases: estypes.IndicesGetAliasResponse = {}; + try { + // Look up existing index aliases and update index.is_hidden to true if that + // setting is currently false or undefined + indexAliases = await this.esContext.esAdapter.getExistingIndexAliases( + this.esContext.esNames.indexPattern + ); + } catch (err) { + // errors when trying to get existing index aliases + // should not block the rest of initialization, log the error and move on + this.esContext.logger.error(`error getting existing index aliases - ${err.message}`); + } + asyncForEach(Object.keys(indexAliases), async (indexName: string) => { + try { + const aliases = indexAliases[indexName]?.aliases; + const hasNotHiddenAliases: boolean = Object.keys(aliases).some((alias: string) => { + return (aliases[alias] as IndicesAlias)?.is_hidden !== true; + }); + + if (hasNotHiddenAliases) { + this.esContext.logger.debug(`setting existing "${indexName}" index aliases to hidden.`); + await this.esContext.esAdapter.setIndexAliasToHidden(indexName, indexAliases[indexName]); + } + } catch (err) { + // errors when trying to set existing index aliases to is_hidden + // should not block the rest of initialization, log the error and move on + this.esContext.logger.error( + `error setting existing "${indexName}" index aliases - ${err.message}` + ); + } + }); + } + + async setExistingAssetsToHidden(): Promise { + await this.setExistingIndexTemplatesToHidden(); + await this.setExistingIndicesToHidden(); + await this.setExistingIndexAliasesToHidden(); + } + async createIlmPolicyIfNotExists(): Promise { const exists = await this.esContext.esAdapter.doesIlmPolicyExist( this.esContext.esNames.ilmPolicy @@ -67,6 +186,7 @@ class EsInitializationSteps { aliases: { [this.esContext.esNames.alias]: { is_write_index: true, + is_hidden: true, }, }, }); 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 1f58592ea44fa..6babfef9bd8a8 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 @@ -111,21 +111,27 @@ describe('EventLogStart', () => { esContext.esAdapter.queryEventsBySavedObjects.mockResolvedValue(result); expect( - await eventLogClient.findEventsBySavedObjectIds('saved-object-type', ['saved-object-id']) + await eventLogClient.findEventsBySavedObjectIds( + 'saved-object-type', + ['saved-object-id'], + undefined, + ['legacy-id'] + ) ).toEqual(result); - expect(esContext.esAdapter.queryEventsBySavedObjects).toHaveBeenCalledWith( - esContext.esNames.indexPattern, - undefined, - 'saved-object-type', - ['saved-object-id'], - { + expect(esContext.esAdapter.queryEventsBySavedObjects).toHaveBeenCalledWith({ + index: esContext.esNames.indexPattern, + namespace: undefined, + type: 'saved-object-type', + ids: ['saved-object-id'], + findOptions: { page: 1, per_page: 10, sort_field: '@timestamp', sort_order: 'asc', - } - ); + }, + legacyIds: ['legacy-id'], + }); }); test('fetches all events in time frame that reference the saved object', async () => { @@ -189,26 +195,32 @@ describe('EventLogStart', () => { const end = moment().add(1, 'days').toISOString(); expect( - await eventLogClient.findEventsBySavedObjectIds('saved-object-type', ['saved-object-id'], { - start, - end, - }) + await eventLogClient.findEventsBySavedObjectIds( + 'saved-object-type', + ['saved-object-id'], + { + start, + end, + }, + ['legacy-id'] + ) ).toEqual(result); - expect(esContext.esAdapter.queryEventsBySavedObjects).toHaveBeenCalledWith( - esContext.esNames.indexPattern, - undefined, - 'saved-object-type', - ['saved-object-id'], - { + expect(esContext.esAdapter.queryEventsBySavedObjects).toHaveBeenCalledWith({ + index: esContext.esNames.indexPattern, + namespace: undefined, + type: 'saved-object-type', + ids: ['saved-object-id'], + findOptions: { page: 1, per_page: 10, sort_field: '@timestamp', sort_order: 'asc', start, end, - } - ); + }, + legacyIds: ['legacy-id'], + }); }); test('validates that the start date is valid', async () => { 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 5214db1169deb..39b78296e3875 100644 --- a/x-pack/plugins/event_log/server/event_log_client.ts +++ b/x-pack/plugins/event_log/server/event_log_client.ts @@ -83,7 +83,8 @@ export class EventLogClient implements IEventLogClient { async findEventsBySavedObjectIds( type: string, ids: string[], - options?: Partial + options?: Partial, + legacyIds?: string[] ): Promise { const findOptions = findOptionsSchema.validate(options ?? {}); @@ -93,12 +94,13 @@ export class EventLogClient implements IEventLogClient { // verify the user has the required permissions to view this saved objects await this.savedObjectGetter(type, ids); - return await this.esContext.esAdapter.queryEventsBySavedObjects( - this.esContext.esNames.indexPattern, + return await this.esContext.esAdapter.queryEventsBySavedObjects({ + index: this.esContext.esNames.indexPattern, namespace, type, ids, - findOptions - ); + findOptions, + legacyIds, + }); } } diff --git a/x-pack/plugins/event_log/server/routes/find_by_ids.test.ts b/x-pack/plugins/event_log/server/routes/find_by_ids.test.ts index 5259191a98f2b..4685306e869da 100644 --- a/x-pack/plugins/event_log/server/routes/find_by_ids.test.ts +++ b/x-pack/plugins/event_log/server/routes/find_by_ids.test.ts @@ -41,7 +41,7 @@ describe('find_by_ids', () => { eventLogClient, { params: { type: 'action' }, - body: { ids: ['1'] }, + body: { ids: ['1'], legacyIds: ['2'] }, }, ['ok'] ); @@ -50,9 +50,10 @@ describe('find_by_ids', () => { expect(eventLogClient.findEventsBySavedObjectIds).toHaveBeenCalledTimes(1); - const [type, ids] = eventLogClient.findEventsBySavedObjectIds.mock.calls[0]; + const [type, ids, , legacyIds] = eventLogClient.findEventsBySavedObjectIds.mock.calls[0]; expect(type).toEqual(`action`); expect(ids).toEqual(['1']); + expect(legacyIds).toEqual(['2']); expect(res.ok).toHaveBeenCalledWith({ body: result, diff --git a/x-pack/plugins/event_log/server/routes/find_by_ids.ts b/x-pack/plugins/event_log/server/routes/find_by_ids.ts index 130887e5d30a7..378b9516631ad 100644 --- a/x-pack/plugins/event_log/server/routes/find_by_ids.ts +++ b/x-pack/plugins/event_log/server/routes/find_by_ids.ts @@ -23,6 +23,7 @@ const paramSchema = schema.object({ const bodySchema = schema.object({ ids: schema.arrayOf(schema.string(), { defaultValue: [] }), + legacyIds: schema.arrayOf(schema.string(), { defaultValue: [] }), }); export const findByIdsRoute = (router: EventLogRouter, systemLogger: Logger) => { @@ -46,13 +47,13 @@ export const findByIdsRoute = (router: EventLogRouter, systemLogger: Logger) => const eventLogClient = context.eventLog.getEventLogClient(); const { params: { type }, - body: { ids }, + body: { ids, legacyIds }, query, } = req; try { return res.ok({ - body: await eventLogClient.findEventsBySavedObjectIds(type, ids, query), + body: await eventLogClient.findEventsBySavedObjectIds(type, ids, query, legacyIds), }); } catch (err) { const call = `findEventsBySavedObjectIds(${type}, [${ids}], ${JSON.stringify(query)})`; diff --git a/x-pack/plugins/event_log/server/types.ts b/x-pack/plugins/event_log/server/types.ts index 0e5e62b591290..0750e89473b8e 100644 --- a/x-pack/plugins/event_log/server/types.ts +++ b/x-pack/plugins/event_log/server/types.ts @@ -45,7 +45,8 @@ export interface IEventLogClient { findEventsBySavedObjectIds( type: string, ids: string[], - options?: Partial + options?: Partial, + legacyIds?: string[] ): Promise; } diff --git a/x-pack/plugins/features/jest.config.js b/x-pack/plugins/features/jest.config.js index c39da2a15d2a2..7d333047c491f 100644 --- a/x-pack/plugins/features/jest.config.js +++ b/x-pack/plugins/features/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/features'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/features', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/features/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/features/kibana.json b/x-pack/plugins/features/kibana.json index 867f9ced7ed88..550b3899061d4 100644 --- a/x-pack/plugins/features/kibana.json +++ b/x-pack/plugins/features/kibana.json @@ -7,7 +7,6 @@ "version": "8.0.0", "kibanaVersion": "kibana", "requiredPlugins": ["licensing"], - "optionalPlugins": ["visTypeTimelion"], "configPath": ["xpack", "features"], "server": true, "ui": true, diff --git a/x-pack/plugins/features/server/__snapshots__/oss_features.test.ts.snap b/x-pack/plugins/features/server/__snapshots__/oss_features.test.ts.snap index 954701f0087f4..85eb1f5b71e71 100644 --- a/x-pack/plugins/features/server/__snapshots__/oss_features.test.ts.snap +++ b/x-pack/plugins/features/server/__snapshots__/oss_features.test.ts.snap @@ -551,7 +551,6 @@ Array [ "index-pattern", "search", "visualization", - "timelion-sheet", "canvas-workpad", "lens", "map", @@ -584,7 +583,6 @@ Array [ "index-pattern", "search", "visualization", - "timelion-sheet", "canvas-workpad", "lens", "map", @@ -857,54 +855,6 @@ Array [ ] `; -exports[`buildOSSFeatures with a basic license returns the timelion feature augmented with appropriate sub feature privileges 1`] = ` -Array [ - Object { - "privilege": Object { - "app": Array [ - "timelion", - "kibana", - ], - "catalogue": Array [ - "timelion", - ], - "savedObject": Object { - "all": Array [ - "timelion-sheet", - ], - "read": Array [ - "index-pattern", - ], - }, - "ui": Array [ - "save", - ], - }, - "privilegeId": "all", - }, - Object { - "privilege": Object { - "app": Array [ - "timelion", - "kibana", - ], - "catalogue": Array [ - "timelion", - ], - "savedObject": Object { - "all": Array [], - "read": Array [ - "index-pattern", - "timelion-sheet", - ], - }, - "ui": Array [], - }, - "privilegeId": "read", - }, -] -`; - exports[`buildOSSFeatures with a basic license returns the visualize feature augmented with appropriate sub feature privileges 1`] = ` Array [ Object { @@ -1081,7 +1031,6 @@ Array [ "index-pattern", "search", "visualization", - "timelion-sheet", "canvas-workpad", "lens", "map", @@ -1114,7 +1063,6 @@ Array [ "index-pattern", "search", "visualization", - "timelion-sheet", "canvas-workpad", "lens", "map", @@ -1387,54 +1335,6 @@ Array [ ] `; -exports[`buildOSSFeatures with a enterprise license returns the timelion feature augmented with appropriate sub feature privileges 1`] = ` -Array [ - Object { - "privilege": Object { - "app": Array [ - "timelion", - "kibana", - ], - "catalogue": Array [ - "timelion", - ], - "savedObject": Object { - "all": Array [ - "timelion-sheet", - ], - "read": Array [ - "index-pattern", - ], - }, - "ui": Array [ - "save", - ], - }, - "privilegeId": "all", - }, - Object { - "privilege": Object { - "app": Array [ - "timelion", - "kibana", - ], - "catalogue": Array [ - "timelion", - ], - "savedObject": Object { - "all": Array [], - "read": Array [ - "index-pattern", - "timelion-sheet", - ], - }, - "ui": Array [], - }, - "privilegeId": "read", - }, -] -`; - exports[`buildOSSFeatures with a enterprise license returns the visualize feature augmented with appropriate sub feature privileges 1`] = ` Array [ Object { diff --git a/x-pack/plugins/features/server/oss_features.test.ts b/x-pack/plugins/features/server/oss_features.test.ts index 39bb12d90ea1c..7a1c5951192ec 100644 --- a/x-pack/plugins/features/server/oss_features.test.ts +++ b/x-pack/plugins/features/server/oss_features.test.ts @@ -11,52 +11,10 @@ import { KibanaFeature } from '.'; import { LicenseType, LICENSE_TYPE } from '../../licensing/server'; describe('buildOSSFeatures', () => { - it('returns features including timelion', () => { - expect( - buildOSSFeatures({ - savedObjectTypes: ['foo', 'bar'], - includeTimelion: true, - includeReporting: false, - }).map((f) => f.id) - ).toMatchInlineSnapshot(` -Array [ - "discover", - "visualize", - "dashboard", - "dev_tools", - "advancedSettings", - "indexPatterns", - "savedObjectsManagement", - "timelion", -] -`); - }); - - it('returns features excluding timelion', () => { - expect( - buildOSSFeatures({ - savedObjectTypes: ['foo', 'bar'], - includeTimelion: false, - includeReporting: false, - }).map((f) => f.id) - ).toMatchInlineSnapshot(` -Array [ - "discover", - "visualize", - "dashboard", - "dev_tools", - "advancedSettings", - "indexPatterns", - "savedObjectsManagement", -] -`); - }); - it('returns features including reporting subfeatures', () => { expect( buildOSSFeatures({ savedObjectTypes: ['foo', 'bar'], - includeTimelion: false, includeReporting: true, }).map(({ id, subFeatures }) => ({ id, subFeatures })) ).toMatchSnapshot(); @@ -66,7 +24,6 @@ Array [ expect( buildOSSFeatures({ savedObjectTypes: ['foo', 'bar'], - includeTimelion: false, includeReporting: false, }).map(({ id, subFeatures }) => ({ id, subFeatures })) ).toMatchSnapshot(); @@ -74,7 +31,6 @@ Array [ const features = buildOSSFeatures({ savedObjectTypes: ['foo', 'bar'], - includeTimelion: true, includeReporting: false, }); features.forEach((featureConfig) => { diff --git a/x-pack/plugins/features/server/oss_features.ts b/x-pack/plugins/features/server/oss_features.ts index 14265948c2dee..7c8432b8d9ec7 100644 --- a/x-pack/plugins/features/server/oss_features.ts +++ b/x-pack/plugins/features/server/oss_features.ts @@ -11,13 +11,11 @@ import type { KibanaFeatureConfig, SubFeatureConfig } from '../common'; export interface BuildOSSFeaturesParams { savedObjectTypes: string[]; - includeTimelion: boolean; includeReporting: boolean; } export const buildOSSFeatures = ({ savedObjectTypes, - includeTimelion, includeReporting, }: BuildOSSFeaturesParams): KibanaFeatureConfig[] => { return [ @@ -203,7 +201,6 @@ export const buildOSSFeatures = ({ 'index-pattern', 'search', 'visualization', - 'timelion-sheet', 'canvas-workpad', 'lens', 'map', @@ -221,7 +218,6 @@ export const buildOSSFeatures = ({ 'index-pattern', 'search', 'visualization', - 'timelion-sheet', 'canvas-workpad', 'lens', 'map', @@ -450,39 +446,9 @@ export const buildOSSFeatures = ({ }, }, }, - ...(includeTimelion ? [timelionFeature] : []), ] as KibanaFeatureConfig[]; }; -const timelionFeature: KibanaFeatureConfig = { - id: 'timelion', - name: 'Timelion', - order: 350, - category: DEFAULT_APP_CATEGORIES.kibana, - app: ['timelion', 'kibana'], - catalogue: ['timelion'], - privileges: { - all: { - app: ['timelion', 'kibana'], - catalogue: ['timelion'], - savedObject: { - all: ['timelion-sheet'], - read: ['index-pattern'], - }, - ui: ['save'], - }, - read: { - app: ['timelion', 'kibana'], - catalogue: ['timelion'], - savedObject: { - all: [], - read: ['index-pattern', 'timelion-sheet'], - }, - ui: [], - }, - }, -}; - const reportingPrivilegeGroupName = i18n.translate( 'xpack.features.ossFeatures.reporting.reportingTitle', { diff --git a/x-pack/plugins/features/server/plugin.test.ts b/x-pack/plugins/features/server/plugin.test.ts index ba809187a549e..e5940bc73ae97 100644 --- a/x-pack/plugins/features/server/plugin.test.ts +++ b/x-pack/plugins/features/server/plugin.test.ts @@ -46,36 +46,7 @@ describe('Features Plugin', () => { it('returns OSS + registered kibana features', async () => { const plugin = new FeaturesPlugin(initContext); - const { registerKibanaFeature } = await plugin.setup(coreSetup, {}); - registerKibanaFeature({ - id: 'baz', - name: 'baz', - app: [], - category: { id: 'foo', label: 'foo' }, - privileges: null, - }); - - const { getKibanaFeatures } = plugin.start(coreStart); - - expect(getKibanaFeatures().map((f) => f.id)).toMatchInlineSnapshot(` - Array [ - "baz", - "discover", - "visualize", - "dashboard", - "dev_tools", - "advancedSettings", - "indexPatterns", - "savedObjectsManagement", - ] - `); - }); - - it('returns OSS + registered kibana features with timelion when available', async () => { - const plugin = new FeaturesPlugin(initContext); - const { registerKibanaFeature: registerFeature } = await plugin.setup(coreSetup, { - visTypeTimelion: { uiEnabled: true }, - }); + const { registerKibanaFeature: registerFeature } = await plugin.setup(coreSetup); registerFeature({ id: 'baz', name: 'baz', @@ -96,7 +67,6 @@ describe('Features Plugin', () => { "advancedSettings", "indexPatterns", "savedObjectsManagement", - "timelion", ] `); }); @@ -105,7 +75,7 @@ describe('Features Plugin', () => { typeRegistry.isHidden.mockReturnValueOnce(true); typeRegistry.isHidden.mockReturnValueOnce(false); const plugin = new FeaturesPlugin(initContext); - await plugin.setup(coreSetup, {}); + await plugin.setup(coreSetup); const { getKibanaFeatures } = plugin.start(coreStart); const soTypes = @@ -120,7 +90,7 @@ describe('Features Plugin', () => { it('returns registered elasticsearch features', async () => { const plugin = new FeaturesPlugin(initContext); - const { registerElasticsearchFeature } = await plugin.setup(coreSetup, {}); + const { registerElasticsearchFeature } = await plugin.setup(coreSetup); registerElasticsearchFeature({ id: 'baz', privileges: [ @@ -142,7 +112,7 @@ describe('Features Plugin', () => { it('registers a capabilities provider', async () => { const plugin = new FeaturesPlugin(initContext); - await plugin.setup(coreSetup, {}); + await plugin.setup(coreSetup); expect(coreSetup.capabilities.registerProvider).toHaveBeenCalledTimes(1); expect(coreSetup.capabilities.registerProvider).toHaveBeenCalledWith(expect.any(Function)); diff --git a/x-pack/plugins/features/server/plugin.ts b/x-pack/plugins/features/server/plugin.ts index b1f540031f6dc..c1fbc4b8a5edb 100644 --- a/x-pack/plugins/features/server/plugin.ts +++ b/x-pack/plugins/features/server/plugin.ts @@ -81,10 +81,6 @@ export interface PluginStartContract { getKibanaFeatures(): KibanaFeature[]; } -interface TimelionSetupContract { - uiEnabled: boolean; -} - /** * Represents Features Plugin instance that will be managed by the Kibana plugin system. */ @@ -93,19 +89,13 @@ export class FeaturesPlugin Plugin, RecursiveReadonly> { private readonly logger: Logger; private readonly featureRegistry: FeatureRegistry = new FeatureRegistry(); - private isTimelionEnabled: boolean = false; private isReportingEnabled: boolean = false; constructor(private readonly initializerContext: PluginInitializerContext) { this.logger = this.initializerContext.logger.get(); } - public setup( - core: CoreSetup, - { visTypeTimelion }: { visTypeTimelion?: TimelionSetupContract } - ): RecursiveReadonly { - this.isTimelionEnabled = visTypeTimelion !== undefined && visTypeTimelion.uiEnabled; - + public setup(core: CoreSetup): RecursiveReadonly { defineRoutes({ router: core.http.createRouter(), featureRegistry: this.featureRegistry, @@ -160,14 +150,8 @@ export class FeaturesPlugin new Set([...savedObjectVisibleTypes, ...savedObjectImportableAndExportableHiddenTypes]) ); - this.logger.debug( - `Registering OSS features with SO types: ${savedObjectTypes.join(', ')}. "includeTimelion": ${ - this.isTimelionEnabled - }.` - ); const features = buildOSSFeatures({ savedObjectTypes, - includeTimelion: this.isTimelionEnabled, includeReporting: this.isReportingEnabled, }); diff --git a/x-pack/plugins/file_upload/jest.config.js b/x-pack/plugins/file_upload/jest.config.js index b9a58c259b317..92b3c27c74f11 100644 --- a/x-pack/plugins/file_upload/jest.config.js +++ b/x-pack/plugins/file_upload/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/file_upload'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/file_upload', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/file_upload/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/file_upload/server/utils/runtime_field_utils.ts b/x-pack/plugins/file_upload/server/utils/runtime_field_utils.ts index 921741110d2a3..aba6effe175c0 100644 --- a/x-pack/plugins/file_upload/server/utils/runtime_field_utils.ts +++ b/x-pack/plugins/file_upload/server/utils/runtime_field_utils.ts @@ -6,7 +6,7 @@ */ import { estypes } from '@elastic/elasticsearch'; -import { RUNTIME_FIELD_TYPES } from '../../../../../src/plugins/data/common/index_patterns'; +import { RUNTIME_FIELD_TYPES } from '../../../../../src/plugins/data/common'; type RuntimeType = typeof RUNTIME_FIELD_TYPES[number]; diff --git a/x-pack/plugins/fleet/common/openapi/bundled.json b/x-pack/plugins/fleet/common/openapi/bundled.json index 4dc67a6771531..c58d064006a2b 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.json +++ b/x-pack/plugins/fleet/common/openapi/bundled.json @@ -2410,6 +2410,16 @@ }, "description": { "type": "string" + }, + "monitoring_enabled": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "metrics", + "logs" + ] + } } } }, diff --git a/x-pack/plugins/fleet/common/openapi/bundled.yaml b/x-pack/plugins/fleet/common/openapi/bundled.yaml index f2a12c0edb8a6..5a5b9838885ae 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.yaml +++ b/x-pack/plugins/fleet/common/openapi/bundled.yaml @@ -1513,6 +1513,13 @@ components: type: string description: type: string + monitoring_enabled: + type: array + items: + type: string + enum: + - metrics + - logs new_package_policy: title: New package policy type: object 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 06048c81d979a..1184e41c5fded 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 @@ -7,3 +7,10 @@ properties: type: string description: type: string + monitoring_enabled: + type: array + items: + type: string + enum: + - metrics + - logs diff --git a/x-pack/plugins/fleet/common/services/full_agent_policy_to_yaml.ts b/x-pack/plugins/fleet/common/services/full_agent_policy_to_yaml.ts index a2c1dcd83dd20..f4193d619e168 100644 --- a/x-pack/plugins/fleet/common/services/full_agent_policy_to_yaml.ts +++ b/x-pack/plugins/fleet/common/services/full_agent_policy_to_yaml.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { safeDump } from 'js-yaml'; +import type { safeDump } from 'js-yaml'; import type { FullAgentPolicy } from '../types'; @@ -25,8 +25,8 @@ const POLICY_KEYS_ORDER = [ 'input', ]; -export const fullAgentPolicyToYaml = (policy: FullAgentPolicy): string => { - return safeDump(policy, { +export const fullAgentPolicyToYaml = (policy: FullAgentPolicy, toYaml: typeof safeDump): string => { + return toYaml(policy, { skipInvalid: true, sortKeys: (keyA: string, keyB: string) => { const indexA = POLICY_KEYS_ORDER.indexOf(keyA); diff --git a/x-pack/plugins/fleet/common/services/validate_package_policy.test.ts b/x-pack/plugins/fleet/common/services/validate_package_policy.test.ts index 3e4f156da3379..30bd9f071feb8 100644 --- a/x-pack/plugins/fleet/common/services/validate_package_policy.test.ts +++ b/x-pack/plugins/fleet/common/services/validate_package_policy.test.ts @@ -5,6 +5,8 @@ * 2.0. */ +import { safeLoad } from 'js-yaml'; + import { installationStatuses } from '../constants'; import type { PackageInfo, NewPackagePolicy, RegistryPolicyTemplate } from '../types'; @@ -371,13 +373,13 @@ describe('Fleet - validatePackagePolicy()', () => { }; it('returns no errors for valid package policy', () => { - expect(validatePackagePolicy(validPackagePolicy, mockPackage)).toEqual( + expect(validatePackagePolicy(validPackagePolicy, mockPackage, safeLoad)).toEqual( noErrorsValidationResults ); }); it('returns errors for invalid package policy', () => { - expect(validatePackagePolicy(invalidPackagePolicy, mockPackage)).toEqual({ + expect(validatePackagePolicy(invalidPackagePolicy, mockPackage, safeLoad)).toEqual({ name: ['Name is required'], description: null, namespace: null, @@ -423,7 +425,11 @@ describe('Fleet - validatePackagePolicy()', () => { enabled: false, })); expect( - validatePackagePolicy({ ...validPackagePolicy, inputs: disabledInputs }, mockPackage) + validatePackagePolicy( + { ...validPackagePolicy, inputs: disabledInputs }, + mockPackage, + safeLoad + ) ).toEqual(noErrorsValidationResults); }); @@ -439,7 +445,8 @@ describe('Fleet - validatePackagePolicy()', () => { expect( validatePackagePolicy( { ...invalidPackagePolicy, inputs: inputsWithDisabledStreams }, - mockPackage + mockPackage, + safeLoad ) ).toEqual({ name: ['Name is required'], @@ -485,10 +492,14 @@ describe('Fleet - validatePackagePolicy()', () => { it('returns no errors for packages with no package policies', () => { expect( - validatePackagePolicy(validPackagePolicy, { - ...mockPackage, - policy_templates: undefined, - }) + validatePackagePolicy( + validPackagePolicy, + { + ...mockPackage, + policy_templates: undefined, + }, + safeLoad + ) ).toEqual({ name: null, description: null, @@ -496,10 +507,14 @@ describe('Fleet - validatePackagePolicy()', () => { inputs: null, }); expect( - validatePackagePolicy(validPackagePolicy, { - ...mockPackage, - policy_templates: [], - }) + validatePackagePolicy( + validPackagePolicy, + { + ...mockPackage, + policy_templates: [], + }, + safeLoad + ) ).toEqual({ name: null, description: null, @@ -510,10 +525,14 @@ describe('Fleet - validatePackagePolicy()', () => { it('returns no errors for packages with no inputs', () => { expect( - validatePackagePolicy(validPackagePolicy, { - ...mockPackage, - policy_templates: [{} as RegistryPolicyTemplate], - }) + validatePackagePolicy( + validPackagePolicy, + { + ...mockPackage, + policy_templates: [{} as RegistryPolicyTemplate], + }, + safeLoad + ) ).toEqual({ name: null, description: null, @@ -521,10 +540,14 @@ describe('Fleet - validatePackagePolicy()', () => { inputs: null, }); expect( - validatePackagePolicy(validPackagePolicy, { - ...mockPackage, - policy_templates: [({ inputs: [] } as unknown) as RegistryPolicyTemplate], - }) + validatePackagePolicy( + validPackagePolicy, + { + ...mockPackage, + policy_templates: [({ inputs: [] } as unknown) as RegistryPolicyTemplate], + }, + safeLoad + ) ).toEqual({ name: null, description: null, @@ -539,7 +562,8 @@ describe('Fleet - validatePackagePolicy()', () => { expect( validatePackagePolicy( INVALID_AWS_POLICY as NewPackagePolicy, - (AWS_PACKAGE as unknown) as PackageInfo + (AWS_PACKAGE as unknown) as PackageInfo, + safeLoad ) ).toMatchSnapshot(); }); @@ -549,7 +573,8 @@ describe('Fleet - validatePackagePolicy()', () => { validationHasErrors( validatePackagePolicy( VALID_AWS_POLICY as NewPackagePolicy, - (AWS_PACKAGE as unknown) as PackageInfo + (AWS_PACKAGE as unknown) as PackageInfo, + safeLoad ) ) ).toBe(false); diff --git a/x-pack/plugins/fleet/common/services/validate_package_policy.ts b/x-pack/plugins/fleet/common/services/validate_package_policy.ts index 67df65b2f12bf..12bef2dfd7c27 100644 --- a/x-pack/plugins/fleet/common/services/validate_package_policy.ts +++ b/x-pack/plugins/fleet/common/services/validate_package_policy.ts @@ -7,7 +7,6 @@ import { getFlattenedObject } from '@kbn/std'; import { i18n } from '@kbn/i18n'; -import { safeLoad } from 'js-yaml'; import { keyBy } from 'lodash'; import type { @@ -47,7 +46,8 @@ export type PackagePolicyValidationResults = { */ export const validatePackagePolicy = ( packagePolicy: NewPackagePolicy, - packageInfo: PackageInfo + packageInfo: PackageInfo, + safeLoadYaml: (yaml: string) => any ): PackagePolicyValidationResults => { const hasIntegrations = doesPackageHaveIntegrations(packageInfo); const validationResults: PackagePolicyValidationResults = { @@ -75,7 +75,12 @@ export const validatePackagePolicy = ( const packageVars = Object.entries(packagePolicy.vars || {}); if (packageVars.length) { validationResults.vars = packageVars.reduce((results, [name, varEntry]) => { - results[name] = validatePackagePolicyConfig(varEntry, packageVarsByName[name], name); + results[name] = validatePackagePolicyConfig( + varEntry, + packageVarsByName[name], + name, + safeLoadYaml + ); return results; }, {} as ValidationEntry); } @@ -139,7 +144,8 @@ export const validatePackagePolicy = ( ? validatePackagePolicyConfig( configEntry, inputVarDefsByPolicyTemplateAndType[inputKey][name], - name + name, + safeLoadYaml ) : null; return results; @@ -162,7 +168,12 @@ export const validatePackagePolicy = ( (results, [name, configEntry]) => { results[name] = streamVarDefs && streamVarDefs[name] && input.enabled && stream.enabled - ? validatePackagePolicyConfig(configEntry, streamVarDefs[name], name) + ? validatePackagePolicyConfig( + configEntry, + streamVarDefs[name], + name, + safeLoadYaml + ) : null; return results; }, @@ -191,7 +202,8 @@ export const validatePackagePolicy = ( export const validatePackagePolicyConfig = ( configEntry: PackagePolicyConfigRecordEntry, varDef: RegistryVarsEntry, - varName: string + varName: string, + safeLoadYaml: (yaml: string) => any ): string[] | null => { const errors = []; const { value } = configEntry; @@ -223,7 +235,7 @@ export const validatePackagePolicyConfig = ( if (varDef.type === 'yaml') { try { - parsedValue = safeLoad(value); + parsedValue = safeLoadYaml(value); } catch (e) { errors.push( i18n.translate('xpack.fleet.packagePolicyValidation.invalidYamlFormatErrorMessage', { diff --git a/x-pack/plugins/fleet/dev_docs/data_model.md b/x-pack/plugins/fleet/dev_docs/data_model.md new file mode 100644 index 0000000000000..ec9fa031d09d3 --- /dev/null +++ b/x-pack/plugins/fleet/dev_docs/data_model.md @@ -0,0 +1,212 @@ +# Fleet Data Model + +The Fleet plugin has 3 sources of data that it reads and writes to, these large categories are: +- **Package Registry**: read-only data source for retrieving packages published by Elastic +- **`.fleet-*` Indices**: read & write data source for interacting with Elastic Agent policies, actions, and enrollment tokens +- **Saved Objects**: read & write data source for storing installed packages, configured policies, outputs, and other settings + +## Package Registry + +The package registry hosts all of the packages available for installation by Fleet. The Fleet plugin in Kibana interacts +with the registry exclusively through read-only JSON APIs for listing, searching, and download packages. Read more about +the available APIs in the [package-registry repository](https://github.com/elastic/package-registry). + +By default, the Fleet plugin will use Elastic's nightly 'snapshot' registry on the `master` branch, the 'staging' +registry on Kibana nightly snapshot builds, and the 'prod' registry for release builds. The registry that will be used +can be configured by setting the `xpack.fleet.registryUrl` in the `kibana.yml` file. + +The code that integrates with this registry API is contained in the +[`x-pack/plugins/fleet/server/services/epm/registry`](../server/services/epm/registry) directory. + +## `.fleet-*` Indices + +For any data that needs to be accessible by Fleet Service instances to push updates to, we write and read data +directly to a handful of `.fleet-` Elasticsearch indices. Fleet Server instances are configured with an API key that +has access only to these indices. + +In prior alpha versions of Fleet, this data was also stored in Saved Objects because Elastic Agent instances were +communicating directly with Kibana for policy updates. Once Fleet Server was introduced, that data was migrated to these +Elasticsearch indices to be readable by Fleet Server. + +### `.fleet-agents` index + +Each document in this index tracks an individual Elastic Agent's enrollment in the Fleet, which policy it is current +assigned to, its check in status, which packages are currently installed, and other metadata about the Agent. + +All of the code that interacts with this index is currently located in +[`x-pack/plugins/fleet/server/services/agents/crud.ts`](../server/services/agents/crud.ts) and the schema of these +documents is maintained by the `FleetServerAgent` TypeScript interface. + +Prior to Fleet Server, this data was stored in the `fleet-agents` Saved Object type which is now obsolete. + +### `.fleet-actions` index + +Each document in this index represents an action that was initiated by a user and needs to be processed by Fleet Server +and sent to any agents that it applies to. Actions can apply to one or more agents. There are different types of actions +that can be created such as policy changes, unenrollments, upgrades, etc. See the `AgentActionType` type for a complete +list. + +The total schema for actions is represented by the `FleetServerAgentAction` type. + +### `.fleet-actions-results` + +### `.fleet-servers` + +### `.fleet-artifacts` + +### `.fleet-entrollment-api-keys` + +### `.fleet-policies` + +### `.fleet-policies-leader` + +## Saved Object types + +The Fleet plugin leverages several Saved Object types to track metadata on install packages, agent policies, and more. +This document is intended to outline what each type is for, the primary places it's accessed from in the codebase, and +any caveats regarding the history of that saved object type. + +At this point in time, all types are currently: +- `hidden: false` +- `namespaceType: agnostic` +- `management.importableAndExportable: false` + +### `ingest_manager_settings` + +- Constant in code: `GLOBAL_SETTINGS_SAVED_OBJECT_TYPE` +- Introduced in ? +- Migrations: 7.10.0, 7.13.0 +- [Code Link](../server/saved_objects/index.ts#57) + +Tracks the Fleet server host addresses and whether or not the cluster has been shown the "add data" and +"fleet migration" notices in the UI. + +Can be accessed via the APIs exposed in the [server's settings service](../server/services/settings.ts). + + +### `ingest-agent-policies` + +- Constant in code: `AGENT_POLICY_SAVED_OBJECT_TYPE` +- Introduced in ? +- [Code Link](../server/saved_objects/index.ts#136) +- Migrations: 7.10.0, 7.12.0 +- References to other objects: + - `package_policies` - array of IDs that point to the specific integration instances for this agent policy (`ingest-package-policies`) + +The overall policy for a group of agents. Each policy consists of specific integration configurations for a group of +enrolled agents. + +### `ingest-package-policies` + +- Constant in code: `PACKAGE_POLICY_SAVED_OBJECT_TYPE` +- Introduced in ? +- [Code Link](../server/saved_objects/index.ts#212) +- Migrations: 7.10.0, 7.11.0, 7.12.0, 7.13.0, 7.14.0, 7.15.0 +- References to other objects: + - `policy_id` - ID that points to an agent policy (`ingest-agent-policies`) + - `output_id` - ID that points to an output (`ingest-outputs`) + +Contains the configuration for a specific instance of a package integration as configured for an agent policy. + +### `ingest-outputs` + +- Constant in code: `OUTPUT_SAVED_OBJECT_TYPE` +- Introduced in ? +- [Code Link](../server/saved_objects/index.ts#190) +- Migrations: 7.13.0 + +Contains configuration for ingest outputs that can be shared across multiple `ingest-package-policies`. Currently the UI +only exposes a single Elasticsearch output that will be used for all package policies, but in the future this may be +used for other types of outputs like separate monitoring clusters, Logstash, etc. + +### `epm-packages` + +- Constant in code: `PACKAGES_SAVED_OBJECT_TYPE` +- Introduced in ? +- [Code Link](../server/saved_objects/index.ts#279) +- Migrations: 7.14.0, 7.14.1 +- References to other objects: + - `installed_es` - array of assets installed into Elasticsearch + - `installed_es.id` - ID in Elasticsearch of an asset (eg. `logs-system.application-1.1.2`) + - `installed_es.type` - type of Elasticsearch asset (eg. `ingest_pipeline`) + - `installed_kibana` - array of assets that were installed into Kibana + - `installed_kibana.id` - Saved Object ID (eg. `system-01c54730-fee6-11e9-8405-516218e3d268`) + - `installed_kibana.type` - Saved Object type name (eg. `dashboard`) + - One caveat with this array is that the IDs are currently space-specific so if a package's assets were installed in + one space, they may not be visible in other spaces. We also do not keep track of which space these assets were + installed into. + - `package_assets` - array of original file contents of the package as it was installed + - `package_assets.id` - Saved Object ID for a `epm-package-assets` type + - `package_assets.type` - Saved Object type for the asset. As of now, only `epm-packages-assets` are supported. + +Contains metadata on an installed integration package including references to all assets installed in Kibana and +Elasticsearch. This allows for easy cleanup when a package is removed or upgraded. + +### `epm-packages-assets` + +- Constant in code: `ASSETS_SAVED_OBJECT_TYPE` +- Introduced in ? +- [Code Link](../server/saved_objects/index.ts#328) +- Migrations: +- References to other objects: + +Contains the raw file contents of a package, where each document represents one file from the original package. Storing +these as Saved Objects allows Fleet to install package contents when the package registry is down or unavailable. Also +allows for installing packages that were uploaded manually and are not from a package registry. The `asset_path` field +represents the relative file path of the file from the package contents +(eg. `system-1.1.2/data_stream/application/agent/stream/httpjson.yml.hbs`). + +### `fleet-preconfiguration-deletion-record` + +- Constant in code: `PRECONFIGURATION_DELETION_RECORD_SAVED_OBJECT_TYPE` +- Introduced in ? +- [Code Link](../server/saved_objects/index.ts#328) +- Migrations: +- References to other objects: + - `id` - references the policy ID from the preconfiguration API + +Used as "tombstone record" to indicate that a package that was installed by default through preconfiguration was +explicitly deleted by user. Used to avoid recreating a preconfiguration policy that a user explicitly does not want. + +### `fleet-agents` + +**DEPRECATED in favor of `.fleet-agents` index.** + +- Constant in code: `AGENT_SAVED_OBJECT_TYPE` +- Introduced in ? +- [Code Link](../server/saved_objects/index.ts#76) +- Migrations: 7.10.0, 7.12.0 +- References to other objects: + - `policy_id` - ID that points to the policy (`ingest-agent-policies`) this agent is assigned to. + - `access_api_key_id` + - `default_api_key_id` + +Tracks an individual Elastic Agent's enrollment in the Fleet, which policy it is current assigned to, its check in +status, which packages are currently installed, and other metadata about the Agent. + +### `fleet-agent-actions` + +**DEPRECATED in favor of `.fleet-agent-actions` index.** + +- Constant in code: `AGENT_ACTION_SAVED_OBJECT_TYPE` +- Introduced in ? +- [Code Link](../server/saved_objects/index.ts#113) +- Migrations: 7.10.0 +- References to other objects: + - `agent_id` - ID that points to the agent for this action (`fleet-agents`) + - `policy_id`- ID that points to the policy for this action (`ingest-agent-policies`) + + +### `fleet-enrollment-api-keys` + +**DEPRECATED in favor of `.fleet-enrollment-api-keys` index.** + +- Constant in code: `ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE` +- Introduced in ? +- [Code Link](../server/saved_objects/index.ts#166) +- Migrations: 7.10.0 +- References to other objects: + - `api_key_id` + - `policy_id` - ID that points to an agent policy (`ingest-agent-policies`) + +Contains an enrollment key that can be used to enroll a new agent in a specific agent policy. \ No newline at end of file diff --git a/x-pack/plugins/fleet/jest.config.js b/x-pack/plugins/fleet/jest.config.js index f55b9b45140bf..5443318d52c8d 100644 --- a/x-pack/plugins/fleet/jest.config.js +++ b/x-pack/plugins/fleet/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/fleet'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/fleet', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/fleet/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/layouts/default/default_page_title.tsx b/x-pack/plugins/fleet/public/applications/fleet/layouts/default/default_page_title.tsx index e525a059b7837..3d0a7717d1e1a 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/layouts/default/default_page_title.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/layouts/default/default_page_title.tsx @@ -30,7 +30,7 @@ export const DefaultPageTitle: FunctionComponent = () => {

    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 d8f13da64257b..08b0507f7c621 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 @@ -101,7 +101,7 @@ export const AgentPolicyActionMenu = memo<{ > , ]; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_copy_provider.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_copy_provider.tsx index ef623d30b8847..68f05624a8664 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_copy_provider.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_copy_provider.tsx @@ -34,7 +34,7 @@ export const AgentPolicyCopyProvider: React.FunctionComponent = ({ childr onSuccess = () => undefined ) => { if (!agentPolicyToCopy) { - throw new Error('No agent policy specified to copy'); + throw new Error('No agent policy specified to duplicate'); } setIsModalOpen(true); setAgentPolicy(agentPolicyToCopy); @@ -63,7 +63,7 @@ export const AgentPolicyCopyProvider: React.FunctionComponent = ({ childr if (data) { notifications.toasts.addSuccess( i18n.translate('xpack.fleet.copyAgentPolicy.successNotificationTitle', { - defaultMessage: 'Agent policy copied', + defaultMessage: 'Agent policy duplicated', }) ); if (onSuccessCallback.current) { @@ -72,7 +72,7 @@ export const AgentPolicyCopyProvider: React.FunctionComponent = ({ childr } else { notifications.toasts.addDanger( i18n.translate('xpack.fleet.copyAgentPolicy.failureNotificationTitle', { - defaultMessage: "Error copying agent policy '{id}'", + defaultMessage: "Error duplicating agent policy '{id}'", values: { id: agentPolicy!.id }, }) ); @@ -80,7 +80,7 @@ export const AgentPolicyCopyProvider: React.FunctionComponent = ({ childr } catch (e) { notifications.toasts.addDanger( i18n.translate('xpack.fleet.copyAgentPolicy.fatalErrorNotificationTitle', { - defaultMessage: 'Error copying agent policy', + defaultMessage: 'Error duplicating agent policy', }) ); } @@ -98,7 +98,7 @@ export const AgentPolicyCopyProvider: React.FunctionComponent = ({ childr = ({ childr confirmButtonText={ } confirmButtonDisabled={isLoading || !newAgentPolicy.name.trim()} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_form.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_form.tsx index f89bd5ef48d72..8229aced234fa 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_form.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_form.tsx @@ -420,14 +420,14 @@ export const AgentPolicyForm: React.FunctionComponent = ({ <> {' '} voi ) : ( - {fullAgentPolicyToYaml(yamlData!.item)} + {fullAgentPolicyToYaml(yamlData!.item, safeDump)} ); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.tsx index 47ecfd6bd121c..5e00bce5d6c69 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.tsx @@ -20,9 +20,11 @@ import { EuiFlexItem, EuiSpacer, EuiLink, + EuiErrorBoundary, } from '@elastic/eui'; import type { EuiStepProps } from '@elastic/eui/src/components/steps/step'; import type { ApplicationStart } from 'kibana/public'; +import { safeLoad } from 'js-yaml'; import { toMountPoint } from '../../../../../../../../../src/plugins/kibana_react/public'; import type { @@ -191,7 +193,8 @@ export const CreatePackagePolicyPage: React.FunctionComponent = () => { if (packageInfo) { const newValidationResult = validatePackagePolicy( newPackagePolicy || packagePolicy, - packageInfo + packageInfo, + safeLoad ); setValidationResults(newValidationResult); // eslint-disable-next-line no-console @@ -501,70 +504,75 @@ export const CreatePackagePolicyPage: React.FunctionComponent = () => { return ( - {formState === 'CONFIRM' && agentPolicy && ( - setFormState('VALID')} - /> - )} - {packageInfo && ( - - )} - - - - - - - {!isLoadingAgentPolicyStep && agentPolicy && packageInfo && formState === 'INVALID' ? ( - - ) : null} - - - - - {/* eslint-disable-next-line @elastic/eui/href-or-on-click */} - - - - - - - - - - - - - + + {formState === 'CONFIRM' && agentPolicy && ( + setFormState('VALID')} + /> + )} + {packageInfo && ( + + )} + + + + + + + {!isLoadingAgentPolicyStep && + agentPolicy && + packageInfo && + formState === 'INVALID' ? ( + + ) : null} + + + + + {/* eslint-disable-next-line @elastic/eui/href-or-on-click */} + + + + + + + + + + + + + + ); }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/services/has_invalid_but_required_var.ts b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/services/has_invalid_but_required_var.ts index bf75b05f41b8d..e41b98c05e41c 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/services/has_invalid_but_required_var.ts +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/services/has_invalid_but_required_var.ts @@ -5,6 +5,8 @@ * 2.0. */ +import { safeLoad } from 'js-yaml'; + import type { PackagePolicyConfigRecord, RegistryVarsEntry } from '../../../../types'; import { validatePackagePolicyConfig } from './'; @@ -25,7 +27,8 @@ export const hasInvalidButRequiredVar = ( validatePackagePolicyConfig( packagePolicyVars[registryVar.name], registryVar, - registryVar.name + registryVar.name, + safeLoad )?.length) ) ) diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_define_package_policy.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_define_package_policy.tsx index fde09c3dbea3a..e84831a3006f4 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_define_package_policy.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_define_package_policy.tsx @@ -20,6 +20,8 @@ import { EuiLink, } from '@elastic/eui'; +import styled from 'styled-components'; + import type { AgentPolicy, PackageInfo, @@ -35,6 +37,15 @@ import { isAdvancedVar } from './services'; import type { PackagePolicyValidationResults } from './services'; import { PackagePolicyInputVarField } from './components'; +// on smaller screens, fields should be displayed in one column +const FormGroupResponsiveFields = styled(EuiDescribedFormGroup)` + @media (max-width: 767px) { + .euiFlexGroup--responsive { + align-items: flex-start; + } + } +`; + export const StepDefinePackagePolicy: React.FunctionComponent<{ agentPolicy: AgentPolicy; packageInfo: PackageInfo; @@ -113,7 +124,7 @@ export const StepDefinePackagePolicy: React.FunctionComponent<{ }, [packagePolicy, agentPolicy, packageInfo, updatePackagePolicy, integrationToEnable]); return validationResults ? ( - ) : null}
    - + ) : ( ); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/no_package_policies.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/no_package_policies.tsx index e19cb7b1ca5e8..80b0c0a114f22 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/no_package_policies.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/no_package_policies.tsx @@ -39,7 +39,7 @@ export const NoPackagePolicies = memo<{ policyId: string }>(({ policyId }) => { fill onClick={() => application.navigateToApp(INTEGRATIONS_PLUGIN_ID, { - path: pagePathGetters.integrations_all()[1], + path: pagePathGetters.integrations_all({})[1], state: { forAgentPolicyId: policyId }, }) } diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/package_policies_table.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/package_policies_table.tsx index eb5f8e6c6a9b8..d3a6bb7561d39 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/package_policies_table.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/package_policies_table.tsx @@ -266,11 +266,12 @@ export const PackagePoliciesTable: React.FunctionComponent = ({ : [ { application.navigateToApp(INTEGRATIONS_PLUGIN_ID, { - path: pagePathGetters.integrations_all()[1], + path: pagePathGetters.integrations_all({})[1], state: { forAgentPolicyId: agentPolicy.id }, }); }} 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 ea027f95eb9e8..040070bcff7c4 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 @@ -9,6 +9,7 @@ import React, { useState, useEffect, useCallback, useMemo, memo } from 'react'; import { useRouteMatch } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; +import { safeLoad } from 'js-yaml'; import { EuiButtonEmpty, EuiButton, @@ -24,6 +25,7 @@ import { EuiFlyoutBody, EuiFlyoutHeader, EuiTitle, + EuiErrorBoundary, } from '@elastic/eui'; import styled from 'styled-components'; @@ -201,7 +203,9 @@ export const EditPackagePolicyForm = memo<{ if (packageData?.response) { setPackageInfo(packageData.response); - setValidationResults(validatePackagePolicy(newPackagePolicy, packageData.response)); + setValidationResults( + validatePackagePolicy(newPackagePolicy, packageData.response, safeLoad) + ); setFormState('VALID'); } } @@ -239,7 +243,8 @@ export const EditPackagePolicyForm = memo<{ if (packageInfo) { const newValidationResult = validatePackagePolicy( newPackagePolicy || packagePolicy, - packageInfo + packageInfo, + safeLoad ); setValidationResults(newValidationResult); // eslint-disable-next-line no-console @@ -506,93 +511,95 @@ export const EditPackagePolicyForm = memo<{ return ( - {isLoadingData ? ( - - ) : loadingError || !agentPolicy || !packageInfo ? ( - - } - error={ - loadingError || - i18n.translate('xpack.fleet.editPackagePolicy.errorLoadingDataMessage', { - defaultMessage: 'There was an error loading this integration information', - }) - } - /> - ) : ( - <> - + {isLoadingData ? ( + + ) : loadingError || !agentPolicy || !packageInfo ? ( + + } + error={ + loadingError || + i18n.translate('xpack.fleet.editPackagePolicy.errorLoadingDataMessage', { + defaultMessage: 'There was an error loading this integration information', + }) + } /> - {formState === 'CONFIRM' && ( - setFormState('VALID')} + ) : ( + <> + - )} - {isUpgrade && dryRunData && ( - <> - - - - )} - {configurePackage} - {/* Extra space to accomodate the EuiBottomBar height */} - - - - - - {agentPolicy && packageInfo && formState === 'INVALID' ? ( - - ) : null} - - - - - - - - - - - - - - - - - - - )} + {formState === 'CONFIRM' && ( + setFormState('VALID')} + /> + )} + {isUpgrade && dryRunData && ( + <> + + + + )} + {configurePackage} + {/* Extra space to accomodate the EuiBottomBar height */} + + + + + + {agentPolicy && packageInfo && formState === 'INVALID' ? ( + + ) : null} + + + + + + + + + + + + + + + + + + + )} + ); }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/actions_menu.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/actions_menu.tsx index 01627159f39bc..0e36c99432cf5 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/actions_menu.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/actions_menu.tsx @@ -86,7 +86,7 @@ export const AgentDetailsActionMenu: React.FunctionComponent<{ )} = ({ defaultMessage="Assign policy" /> } - buttonColor="danger" + buttonColor="primary" >

    = () => { /> - setModalOpen(true)}> + setModalOpen(true)}> = () => { { // BWC < 7.15 Fleet was using a hash router: redirect old routes using hash const shouldRedirectHash = location.pathname === '' && location.hash.length > 0; if (!shouldRedirectHash) { - return ; + return ; } const pathname = location.hash.replace(/^#/, ''); diff --git a/x-pack/plugins/fleet/public/applications/integrations/hooks/use_breadcrumbs.tsx b/x-pack/plugins/fleet/public/applications/integrations/hooks/use_breadcrumbs.tsx index 63c8f1cbd318c..ded9312ce8750 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/hooks/use_breadcrumbs.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/hooks/use_breadcrumbs.tsx @@ -27,7 +27,7 @@ const breadcrumbGetters: { BASE_BREADCRUMB, { text: i18n.translate('xpack.fleet.breadcrumbs.allIntegrationsPageTitle', { - defaultMessage: 'Browse', + defaultMessage: 'Browse integrations', }), }, ], @@ -35,7 +35,7 @@ const breadcrumbGetters: { BASE_BREADCRUMB, { text: i18n.translate('xpack.fleet.breadcrumbs.installedIntegrationsPageTitle', { - defaultMessage: 'Manage', + defaultMessage: 'Installed integrations', }), }, ], diff --git a/x-pack/plugins/fleet/public/applications/integrations/layouts/default.tsx b/x-pack/plugins/fleet/public/applications/integrations/layouts/default.tsx index a8260baa980e4..e4de48a85c35a 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/layouts/default.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/layouts/default.tsx @@ -86,7 +86,7 @@ export const DefaultLayout: React.FunctionComponent = memo(({ section, ch name: ( ), isSelected: section === 'browse', @@ -96,7 +96,7 @@ export const DefaultLayout: React.FunctionComponent = memo(({ section, ch name: ( ), isSelected: section === 'manage', diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid.tsx index e017de9206375..6bbd479c5c2ba 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid.tsx @@ -7,7 +7,6 @@ import type { ReactNode } from 'react'; import React, { Fragment, useCallback, useState } from 'react'; -import type { Query } from '@elastic/eui'; import { EuiFlexGrid, EuiFlexGroup, @@ -34,7 +33,9 @@ interface ListProps { controls?: ReactNode; title: string; list: PackageList; - setSelectedCategory?: (category: string) => void; + initialSearch?: string; + setSelectedCategory: (category: string) => void; + onSearchChange: (search: string) => void; showMissingIntegrationMessage?: boolean; } @@ -43,33 +44,28 @@ export function PackageListGrid({ controls, title, list, - setSelectedCategory = () => {}, + initialSearch, + onSearchChange, + setSelectedCategory, showMissingIntegrationMessage = false, }: ListProps) { - const initialQuery = EuiSearchBar.Query.MATCH_ALL; - - const [query, setQuery] = useState(initialQuery); - const [searchTerm, setSearchTerm] = useState(''); + const [searchTerm, setSearchTerm] = useState(initialSearch || ''); const localSearchRef = useLocalSearch(list); const onQueryChange = ({ - // eslint-disable-next-line @typescript-eslint/no-shadow - query, queryText: userInput, error, }: { - query: Query | null; queryText: string; error: { message: string } | null; }) => { if (!error) { - setQuery(query); + onSearchChange(userInput); setSearchTerm(userInput); } }; const resetQuery = () => { - setQuery(initialQuery); setSearchTerm(''); }; @@ -99,7 +95,7 @@ export function PackageListGrid({ {controlsContent} - parseFloat(props.theme.eui.euiSize) * 6 + parseFloat(props.theme.eui.euiSizeXL) * 2}px; - height: 1px; - z-index: 1; -`; - const Panel = styled(EuiPanel)` padding: ${(props) => props.theme.eui.spacerSizes.xl}; - margin-bottom: -100%; + 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; @@ -44,20 +37,16 @@ export function IconPanel({ const iconType = usePackageIconType({ packageName, integrationName, version, icons }); return ( - - - - - + + + ); } export function LoadingIconPanel() { return ( - - - - - + + + ); } 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 26869f8fea574..f0630f89c8984 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 @@ -79,6 +79,13 @@ const FlexItemWithMinWidth = styled(EuiFlexItem)` min-width: 0px; `; +// to limit size of iconpanel, making the header too big +const FlexItemWithMaxHeight = styled(EuiFlexItem)` + @media (min-width: 768px) { + max-height: 60px; + } +`; + function Breadcrumbs({ packageTitle }: { packageTitle: string }) { useBreadcrumbs('integration_details_overview', { pkgTitle: packageTitle }); return null; @@ -173,7 +180,7 @@ export function Detail() { - + {isLoading || !packageInfo ? ( ) : ( @@ -184,7 +191,7 @@ export function Detail() { icons={integrationInfo?.icons || packageInfo.icons} /> )} - + diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/package_policies.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/package_policies.tsx index 677ca545029fe..07a61410e9a6b 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/package_policies.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/package_policies.tsx @@ -45,16 +45,25 @@ import { PackagePolicyActionsMenu, } from '../../../../../components'; -import type { PackagePolicyAndAgentPolicy } from './use_package_policies_with_agent_policy'; import { usePackagePoliciesWithAgentPolicy } from './use_package_policies_with_agent_policy'; import { Persona } from './persona'; +interface PackagePoliciesPanelProps { + name: string; + version: string; +} + +interface InMemoryPackagePolicyAndAgentPolicy { + packagePolicy: InMemoryPackagePolicy; + agentPolicy: GetAgentPoliciesResponseItem; +} + const AddAgentButton = styled(EuiButtonIcon)` margin-left: ${(props) => props.theme.eui.euiSizeS}; `; const IntegrationDetailsLink = memo<{ - packagePolicy: PackagePolicyAndAgentPolicy['packagePolicy']; + packagePolicy: InMemoryPackagePolicyAndAgentPolicy['packagePolicy']; }>(({ packagePolicy }) => { const { getHref } = useLink(); return ( @@ -71,10 +80,6 @@ const IntegrationDetailsLink = memo<{ ); }); -interface PackagePoliciesPanelProps { - name: string; - version: string; -} export const PackagePoliciesPage = ({ name, version }: PackagePoliciesPanelProps) => { const { search } = useLocation(); const history = useHistory(); @@ -109,12 +114,12 @@ export const PackagePoliciesPage = ({ name, version }: PackagePoliciesPanelProps const updatableIntegrationRecord = updatableIntegrations.get( packagePolicy.package?.name ?? '' ); - const hasUpgrade = !!updatableIntegrationRecord && updatableIntegrationRecord.policiesToUpgrade.some( - ({ id }) => id === packagePolicy.policy_id + ({ pkgPolicyId }) => pkgPolicyId === packagePolicy.id ); + return { agentPolicy, packagePolicy: { @@ -143,7 +148,7 @@ export const PackagePoliciesPage = ({ name, version }: PackagePoliciesPanelProps }, [history]); const handleTableOnChange = useCallback( - ({ page }: CriteriaWithPagination) => { + ({ page }: CriteriaWithPagination) => { setPagination({ currentPage: page.index + 1, pageSize: page.size, @@ -196,7 +201,7 @@ export const PackagePoliciesPage = ({ name, version }: PackagePoliciesPanelProps }; }, [name, version, getHref, agentEnrollmentFlyoutExtension]); - const columns: Array> = useMemo( + const columns: Array> = useMemo( () => [ { field: 'packagePolicy.name', @@ -213,16 +218,6 @@ export const PackagePoliciesPage = ({ name, version }: PackagePoliciesPanelProps defaultMessage: 'Version', }), render(_version, { agentPolicy, packagePolicy }) { - const updatableIntegrationRecord = updatableIntegrations.get( - packagePolicy.package?.name ?? '' - ); - - const hasUpgrade = - !!updatableIntegrationRecord && - updatableIntegrationRecord.policiesToUpgrade.some( - ({ pkgPolicyId }) => pkgPolicyId === packagePolicy.id - ); - return ( @@ -235,7 +230,7 @@ export const PackagePoliciesPage = ({ name, version }: PackagePoliciesPanelProps - {hasUpgrade && ( + {packagePolicy.hasUpgrade && ( @@ -358,7 +353,7 @@ export const PackagePoliciesPage = ({ name, version }: PackagePoliciesPanelProps }, }, ], - [getHref, updatableIntegrations, viewDataStep] + [getHref, viewDataStep] ); const noItemsMessage = useMemo(() => { 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 b260bba493e71..5e94fbda2c22a 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 @@ -5,13 +5,17 @@ * 2.0. */ -import React, { memo, useState, useMemo } from 'react'; -import { Switch, Route, useLocation, useHistory } from 'react-router-dom'; +import React, { memo, useMemo } from 'react'; +import { Switch, Route, useLocation, useHistory, useParams } from 'react-router-dom'; import semverLt from 'semver/functions/lt'; import { i18n } from '@kbn/i18n'; import { installationStatuses } from '../../../../../../../common/constants'; -import { INTEGRATIONS_ROUTING_PATHS } from '../../../../constants'; +import { + INTEGRATIONS_ROUTING_PATHS, + INTEGRATIONS_SEARCH_QUERYPARAM, + pagePathGetters, +} from '../../../../constants'; import { useGetCategories, useGetPackages, useBreadcrumbs } from '../../../../hooks'; import { doesPackageHaveIntegrations } from '../../../../services'; import { DefaultLayout } from '../../../../layouts'; @@ -20,6 +24,22 @@ import { PackageListGrid } from '../../components/package_list_grid'; import { CategoryFacets } from './category_facets'; +export interface CategoryParams { + category?: string; +} + +function getParams(params: CategoryParams, search: string) { + const { category } = params; + const selectedCategory = category || ''; + const queryParams = new URLSearchParams(search); + const searchParam = queryParams.get(INTEGRATIONS_SEARCH_QUERYPARAM) || ''; + return { selectedCategory, searchParam }; +} + +function categoryExists(category: string, categories: CategorySummaryItem[]) { + return categories.some((c) => c.id === category); +} + export const EPMHomePage: React.FC = memo(() => { return ( @@ -69,7 +89,28 @@ const InstalledPackages: React.FC = memo(() => { const { data: allPackages, isLoading: isLoadingPackages } = useGetPackages({ experimental: true, }); - const [selectedCategory, setSelectedCategory] = useState(''); + + const { selectedCategory, searchParam } = getParams( + useParams(), + useLocation().search + ); + const history = useHistory(); + function setSelectedCategory(categoryId: string) { + const url = pagePathGetters.integrations_installed({ + category: categoryId, + searchTerm: searchParam, + })[1]; + history.push(url); + } + function setSearchTerm(search: string) { + // Use .replace so the browser's back button is tied to single keystroke + history.replace( + pagePathGetters.integrations_installed({ + category: selectedCategory, + searchTerm: search, + })[1] + ); + } const allInstalledPackages = useMemo( () => @@ -114,21 +155,28 @@ const InstalledPackages: React.FC = memo(() => { [allInstalledPackages.length, updatablePackages.length] ); - const controls = useMemo( - () => ( - setSelectedCategory(id)} - /> - ), - [categories, selectedCategory] + if (!categoryExists(selectedCategory, categories)) { + history.replace( + pagePathGetters.integrations_installed({ category: '', searchTerm: searchParam })[1] + ); + return null; + } + + const controls = ( + setSelectedCategory(id)} + /> ); return ( @@ -137,10 +185,25 @@ const InstalledPackages: React.FC = memo(() => { const AvailablePackages: React.FC = memo(() => { useBreadcrumbs('integrations_all'); + const { selectedCategory, searchParam } = getParams( + useParams(), + useLocation().search + ); const history = useHistory(); - const queryParams = new URLSearchParams(useLocation().search); - const initialCategory = queryParams.get('category') || ''; - const [selectedCategory, setSelectedCategory] = useState(initialCategory); + function setSelectedCategory(categoryId: string) { + const url = pagePathGetters.integrations_all({ + category: categoryId, + searchTerm: searchParam, + })[1]; + history.push(url); + } + function setSearchTerm(search: string) { + // Use .replace so the browser's back button is tied to single keystroke + history.replace( + pagePathGetters.integrations_all({ category: selectedCategory, searchTerm: search })[1] + ); + } + const { data: allCategoryPackagesRes, isLoading: isLoadingAllPackages } = useGetPackages({ category: '', }); @@ -182,16 +245,17 @@ const AvailablePackages: React.FC = memo(() => { [allPackages?.length, categoriesRes] ); + if (!categoryExists(selectedCategory, categories)) { + history.replace(pagePathGetters.integrations_all({ category: '', searchTerm: searchParam })[1]); + return null; + } + const controls = categories ? ( { - // clear category query param in the url - if (queryParams.get('category')) { - history.push({}); - } setSelectedCategory(id); }} /> @@ -202,8 +266,10 @@ const AvailablePackages: React.FC = memo(() => { isLoading={isLoadingCategoryPackages} title={title} controls={controls} + initialSearch={searchParam} list={packages} setSelectedCategory={setSelectedCategory} + onSearchChange={setSearchTerm} showMissingIntegrationMessage /> ); diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/advanced_agent_authentication_settings.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/advanced_agent_authentication_settings.tsx index 178c1716d3355..26e7fc909402e 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/advanced_agent_authentication_settings.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/advanced_agent_authentication_settings.tsx @@ -179,7 +179,7 @@ export const AdvancedAgentAuthenticationSettings: FunctionComponent = ({ return ( <> setIsAuthenticationSettingsOpen(!isAuthenticationSettingsOpen)} > diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/standalone_instructions.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/standalone_instructions.tsx index 59898b9190c00..d7b9ae2aef08a 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/standalone_instructions.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/standalone_instructions.tsx @@ -21,6 +21,7 @@ import { import type { EuiContainedStepProps } from '@elastic/eui/src/components/steps/steps'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; +import { safeDump } from 'js-yaml'; import { useStartServices, useLink, sendGetOneAgentPolicyFull } from '../../hooks'; import { fullAgentPolicyToYaml, agentPolicyRouteService } from '../../services'; @@ -71,7 +72,7 @@ export const StandaloneInstructions = React.memo(({ agentPolicy, agentPol fetchFullPolicy(); }, [selectedPolicyId, notifications.toasts]); - const yaml = useMemo(() => fullAgentPolicyToYaml(fullAgentPolicy), [fullAgentPolicy]); + const yaml = useMemo(() => fullAgentPolicyToYaml(fullAgentPolicy, safeDump), [fullAgentPolicy]); const steps = [ DownloadStep(), !agentPolicy diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps.tsx index 1cfdc45fb7dba..42746229e5ace 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps.tsx @@ -42,7 +42,7 @@ export const DownloadStep = () => { diff --git a/x-pack/plugins/fleet/public/components/agent_policy_package_badges.tsx b/x-pack/plugins/fleet/public/components/agent_policy_package_badges.tsx index 418e274022461..02518945cf7a5 100644 --- a/x-pack/plugins/fleet/public/components/agent_policy_package_badges.tsx +++ b/x-pack/plugins/fleet/public/components/agent_policy_package_badges.tsx @@ -91,7 +91,7 @@ export const AgentPolicyPackageBadges: React.FunctionComponent = ({ color="hollow" isDisabled={excludeFleetServer && pkg.name === FLEET_SERVER_PACKAGE} > - + props.theme.eui.euiBorderThin}; background-color: ${(props) => props.theme.eui.euiPageBackgroundColor}; + + @media (max-width: 767px) { + .euiFlexItem { + margin-bottom: 0 !important; + } + } `; const Wrapper = styled.div<{ maxWidth?: number }>` diff --git a/x-pack/plugins/fleet/public/components/new_enrollment_key_modal.tsx b/x-pack/plugins/fleet/public/components/new_enrollment_key_modal.tsx index 0752c1ab34889..362c6e6bdb061 100644 --- a/x-pack/plugins/fleet/public/components/new_enrollment_key_modal.tsx +++ b/x-pack/plugins/fleet/public/components/new_enrollment_key_modal.tsx @@ -86,13 +86,18 @@ export const NewEnrollmentTokenModal: React.FunctionComponent = ({

    diff --git a/x-pack/plugins/fleet/public/components/package_policy_actions_menu.test.tsx b/x-pack/plugins/fleet/public/components/package_policy_actions_menu.test.tsx new file mode 100644 index 0000000000000..63a3a93b7e894 --- /dev/null +++ b/x-pack/plugins/fleet/public/components/package_policy_actions_menu.test.tsx @@ -0,0 +1,121 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { act } from '@testing-library/react'; + +import type { AgentPolicy, InMemoryPackagePolicy } from '../types'; +import { createIntegrationsTestRendererMock } from '../mock'; + +import { PackagePolicyActionsMenu } from './package_policy_actions_menu'; + +function renderMenu({ + agentPolicy, + packagePolicy, + showAddAgent = false, + defaultIsOpen = true, +}: { + agentPolicy: AgentPolicy; + packagePolicy: InMemoryPackagePolicy; + showAddAgent?: boolean; + defaultIsOpen?: boolean; +}) { + const renderer = createIntegrationsTestRendererMock(); + + const utils = renderer.render( + + ); + + return { utils }; +} + +function createMockAgentPolicy(props: Partial = {}): AgentPolicy { + return { + id: 'some-uuid1', + namespace: 'default', + monitoring_enabled: [], + name: 'Test Policy', + description: '', + is_default: false, + is_preconfigured: false, + status: 'active', + is_managed: false, + revision: 1, + updated_at: '', + updated_by: 'elastic', + package_policies: [], + ...props, + }; +} + +function createMockPackagePolicy( + props: Partial = {} +): InMemoryPackagePolicy { + return { + id: 'some-uuid2', + name: 'mock-package-policy', + description: '', + created_at: '', + created_by: '', + updated_at: '', + updated_by: '', + policy_id: '', + enabled: true, + output_id: '', + namespace: 'default', + inputs: [], + revision: 1, + hasUpgrade: false, + ...props, + }; +} + +test('Should disable upgrade button if package does not have upgrade', async () => { + const agentPolicy = createMockAgentPolicy(); + const packagePolicy = createMockPackagePolicy({ hasUpgrade: false }); + const { utils } = renderMenu({ agentPolicy, packagePolicy }); + await act(async () => { + const upgradeButton = utils.getByText('Upgrade integration policy').closest('button'); + expect(upgradeButton).toBeDisabled(); + }); +}); + +test('Should enable upgrade button if package has upgrade', async () => { + const agentPolicy = createMockAgentPolicy(); + const packagePolicy = createMockPackagePolicy({ hasUpgrade: true }); + const { utils } = renderMenu({ agentPolicy, packagePolicy }); + await act(async () => { + const upgradeButton = utils.getByText('Upgrade integration policy').closest('button'); + expect(upgradeButton).not.toBeDisabled(); + }); +}); + +test('Should not be able to delete integration from a managed policy', async () => { + const agentPolicy = createMockAgentPolicy({ is_managed: true }); + const packagePolicy = createMockPackagePolicy(); + const { utils } = renderMenu({ agentPolicy, packagePolicy }); + await act(async () => { + expect(utils.queryByText('Delete integration')).toBeNull(); + }); +}); + +test('Should be able to delete integration from a non-managed policy', async () => { + const agentPolicy = createMockAgentPolicy({ is_managed: false }); + const packagePolicy = createMockPackagePolicy(); + const { utils } = renderMenu({ agentPolicy, packagePolicy }); + await act(async () => { + expect(utils.queryByText('Delete integration')).not.toBeNull(); + }); +}); diff --git a/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx b/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx index a87cd7e39bfb2..eefa3c870f283 100644 --- a/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx +++ b/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx @@ -24,13 +24,21 @@ export const PackagePolicyActionsMenu: React.FunctionComponent<{ packagePolicy: InMemoryPackagePolicy; viewDataStep?: EuiStepProps; showAddAgent?: boolean; + defaultIsOpen?: boolean; upgradePackagePolicyHref: string; -}> = ({ agentPolicy, packagePolicy, viewDataStep, showAddAgent, upgradePackagePolicyHref }) => { +}> = ({ + agentPolicy, + packagePolicy, + viewDataStep, + showAddAgent, + upgradePackagePolicyHref, + defaultIsOpen = false, +}) => { const [isEnrollmentFlyoutOpen, setIsEnrollmentFlyoutOpen] = useState(false); const { getHref } = useLink(); const hasWriteCapabilities = useCapabilities().write; const refreshAgentPolicy = useAgentPolicyRefresh(); - const [isActionsMenuOpen, setIsActionsMenuOpen] = useState(false); + const [isActionsMenuOpen, setIsActionsMenuOpen] = useState(defaultIsOpen); const onEnrollmentFlyoutClose = useMemo(() => { return () => setIsEnrollmentFlyoutOpen(false); @@ -84,10 +92,11 @@ export const PackagePolicyActionsMenu: React.FunctionComponent<{ disabled={!packagePolicy.hasUpgrade} icon="refresh" href={upgradePackagePolicyHref} + key="packagePolicyUpgrade" > , // FIXME: implement Copy package policy action @@ -135,7 +144,7 @@ export const PackagePolicyActionsMenu: React.FunctionComponent<{ setIsActionsMenuOpen(isOpen)} + onChange={(open) => setIsActionsMenuOpen(open)} /> ); diff --git a/x-pack/plugins/fleet/public/constants/page_paths.ts b/x-pack/plugins/fleet/public/constants/page_paths.ts index 828ec135cd93a..93ef0d56b17a6 100644 --- a/x-pack/plugins/fleet/public/constants/page_paths.ts +++ b/x-pack/plugins/fleet/public/constants/page_paths.ts @@ -11,14 +11,14 @@ export type StaticPage = | 'base' | 'overview' | 'integrations' - | 'integrations_all' - | 'integrations_installed' | 'policies' | 'policies_list' | 'enrollment_tokens' | 'data_streams'; export type DynamicPage = + | 'integrations_all' + | 'integrations_installed' | 'integration_details_overview' | 'integration_details_policies' | 'integration_details_assets' @@ -65,10 +65,11 @@ export const FLEET_ROUTING_PATHS = { add_integration_to_policy: '/integrations/:pkgkey/add-integration/:integration?', }; +export const INTEGRATIONS_SEARCH_QUERYPARAM = 'q'; export const INTEGRATIONS_ROUTING_PATHS = { integrations: '/:tabId', - integrations_all: '/browse', - integrations_installed: '/installed', + integrations_all: '/browse/:category?', + integrations_installed: '/installed/:category?', integration_details: '/detail/:pkgkey/:panel?', integration_details_overview: '/detail/:pkgkey/overview', integration_details_policies: '/detail/:pkgkey/policies', @@ -87,8 +88,16 @@ export const pagePathGetters: { base: () => [FLEET_BASE_PATH, '/'], overview: () => [FLEET_BASE_PATH, '/'], integrations: () => [INTEGRATIONS_BASE_PATH, '/'], - integrations_all: () => [INTEGRATIONS_BASE_PATH, '/browse'], - integrations_installed: () => [INTEGRATIONS_BASE_PATH, '/installed'], + integrations_all: ({ searchTerm, category }: { searchTerm?: string; category?: string }) => { + const categoryPath = category ? `/${category}` : ``; + const queryParams = searchTerm ? `?${INTEGRATIONS_SEARCH_QUERYPARAM}=${searchTerm}` : ``; + return [INTEGRATIONS_BASE_PATH, `/browse${categoryPath}${queryParams}`]; + }, + integrations_installed: ({ query, category }: { query?: string; category?: string }) => { + const categoryPath = category ? `/${category}` : ``; + const queryParams = query ? `?${INTEGRATIONS_SEARCH_QUERYPARAM}=${query}` : ``; + return [INTEGRATIONS_BASE_PATH, `/installed${categoryPath}${queryParams}`]; + }, integration_details_overview: ({ pkgkey, integration }) => [ INTEGRATIONS_BASE_PATH, `/detail/${pkgkey}/overview${integration ? `?integration=${integration}` : ''}`, diff --git a/x-pack/plugins/fleet/public/search_provider.test.ts b/x-pack/plugins/fleet/public/search_provider.test.ts index 8eee18710d477..ef6bda44d512b 100644 --- a/x-pack/plugins/fleet/public/search_provider.test.ts +++ b/x-pack/plugins/fleet/public/search_provider.test.ts @@ -10,7 +10,7 @@ import { NEVER } from 'rxjs'; import { coreMock } from 'src/core/public/mocks'; -import { createPackageSearchProvider } from './search_provider'; +import { createPackageSearchProvider, toSearchResult } from './search_provider'; import type { GetPackagesResponse } from './types'; jest.mock('./hooks/use_request/epm', () => { @@ -286,4 +286,42 @@ describe('Package search provider', () => { }); }); }); + + describe('toSearchResult', () => { + let startMock: ReturnType; + + beforeEach(() => { + startMock = coreMock.createStart(); + }); + + it('uses svg icon if available', () => { + const pkg = { + ...testResponse[0], + icons: [{ type: 'image/svg+xml', src: '/img_nginx.svg', path: '' }], + }; + const { icon } = toSearchResult(pkg, startMock.application, startMock.http.basePath); + expect(icon).toMatchInlineSnapshot(`"/api/fleet/epm/packages/test/test/img_nginx.svg"`); + }); + + it('prepends base path to svg URL', () => { + startMock = coreMock.createStart({ basePath: '/foo' }); + const pkg = { + ...testResponse[0], + icons: [{ type: 'image/svg+xml', src: '/img_nginx.svg', path: '' }], + }; + const { icon } = toSearchResult(pkg, startMock.application, startMock.http.basePath); + expect(icon).toMatchInlineSnapshot(`"/foo/api/fleet/epm/packages/test/test/img_nginx.svg"`); + }); + + // ICON_TYPES is empty in EUI: https://github.com/elastic/eui/issues/5138 + it.skip('uses eui icon type as fallback', () => { + const pkg = { + ...testResponse[0], + name: 'elasticsearch', + icons: [{ type: 'image/jpg', src: '/img_nginx.svg', path: '' }], + }; + const { icon } = toSearchResult(pkg, startMock.application, startMock.http.basePath); + expect(icon).toMatchInlineSnapshot(`"logoElasticsearch"`); + }); + }); }); diff --git a/x-pack/plugins/fleet/public/search_provider.ts b/x-pack/plugins/fleet/public/search_provider.ts index 5f53c0a8e44ba..403abf89715c8 100644 --- a/x-pack/plugins/fleet/public/search_provider.ts +++ b/x-pack/plugins/fleet/public/search_provider.ts @@ -4,21 +4,23 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { CoreSetup, CoreStart, ApplicationStart } from 'src/core/public'; +import type { CoreSetup, CoreStart, ApplicationStart, IBasePath } from 'src/core/public'; import type { Observable } from 'rxjs'; import { from, of, combineLatest } from 'rxjs'; import { map, shareReplay, takeUntil } from 'rxjs/operators'; +import { ICON_TYPES } from '@elastic/eui'; + import type { GlobalSearchResultProvider, GlobalSearchProviderResult, } from '../../global_search/public'; -import { INTEGRATIONS_PLUGIN_ID } from '../common'; +import { epmRouteService, INTEGRATIONS_PLUGIN_ID } from '../common'; import { sendGetPackages } from './hooks'; -import type { GetPackagesResponse } from './types'; +import type { GetPackagesResponse, PackageListItem } from './types'; import { pagePathGetters } from './constants'; const packageType = 'integration'; @@ -34,16 +36,31 @@ const createPackages$ = () => shareReplay(1) ); -const toSearchResult = ( - pkg: GetPackagesResponse['response'][number], - application: ApplicationStart -) => { +const getEuiIconType = (pkg: PackageListItem, basePath: IBasePath): string | undefined => { + const pkgIcon = pkg.icons?.find((icon) => icon.type === 'image/svg+xml'); + if (!pkgIcon) { + // If no valid SVG is available, attempt to fallback to built-in EUI icons + return ICON_TYPES.find((key) => key.toLowerCase() === `logo${pkg.name}`); + } + + return basePath.prepend( + epmRouteService.getFilePath(`/package/${pkg.name}/${pkg.version}${pkgIcon.src}`) + ); +}; + +/** Exported for testing only @internal */ +export const toSearchResult = ( + pkg: PackageListItem, + application: ApplicationStart, + basePath: IBasePath +): GlobalSearchProviderResult => { const pkgkey = `${pkg.name}-${pkg.version}`; return { id: pkgkey, type: packageType, title: pkg.title, score: 80, + icon: getEuiIconType(pkg, basePath), url: { // prettier-ignore path: `${application.getUrlForApp(INTEGRATIONS_PLUGIN_ID)}${pagePathGetters.integration_details_overview({ pkgkey })[1]}`, @@ -95,13 +112,13 @@ export const createPackageSearchProvider = (core: CoreSetup): GlobalSearchResult return packagesResponse .flatMap( includeAllPackages - ? (pkg) => toSearchResult(pkg, coreStart.application) + ? (pkg) => toSearchResult(pkg, coreStart.application, coreStart.http.basePath) : (pkg) => { if (!term || !pkg.title.toLowerCase().includes(term)) { return []; } - return toSearchResult(pkg, coreStart.application); + return toSearchResult(pkg, coreStart.application, coreStart.http.basePath); } ) .slice(0, maxResults); diff --git a/x-pack/plugins/fleet/server/index.test.ts b/x-pack/plugins/fleet/server/index.test.ts new file mode 100644 index 0000000000000..924fecc311073 --- /dev/null +++ b/x-pack/plugins/fleet/server/index.test.ts @@ -0,0 +1,79 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { applyDeprecations, configDeprecationFactory } from '@kbn/config'; + +import { config } from '.'; + +const applyConfigDeprecations = (settings: Record = {}) => { + if (!config.deprecations) { + throw new Error('Config is not valid no deprecations'); + } + const deprecations = config.deprecations(configDeprecationFactory); + const deprecationMessages: string[] = []; + const migrated = applyDeprecations( + settings, + deprecations.map((deprecation) => ({ + deprecation, + path: '', + })), + () => ({ message }) => deprecationMessages.push(message) + ); + return { + messages: deprecationMessages, + migrated: migrated.config, + }; +}; + +describe('Config depreciation test', () => { + it('should migrate old xpack.ingestManager.fleet settings to xpack.fleet.agents', () => { + const { migrated } = applyConfigDeprecations({ + xpack: { + ingestManager: { + fleet: { enabled: true, elasticsearch: { host: 'http://testes.fr:9200' } }, + }, + }, + }); + + expect(migrated).toMatchInlineSnapshot(` + Object { + "xpack": Object { + "fleet": Object { + "agents": Object { + "elasticsearch": Object { + "hosts": Array [ + "http://testes.fr:9200", + ], + }, + "enabled": true, + }, + }, + }, + } + `); + }); + + it('should support mixing xpack.ingestManager config and xpack.fleet config', () => { + const { migrated } = applyConfigDeprecations({ + xpack: { + ingestManager: { registryUrl: 'http://registrytest.fr' }, + fleet: { registryProxyUrl: 'http://registryProxy.fr' }, + }, + }); + + expect(migrated).toMatchInlineSnapshot(` + Object { + "xpack": Object { + "fleet": Object { + "registryProxyUrl": "http://registryProxy.fr", + "registryUrl": "http://registrytest.fr", + }, + }, + } + `); + }); +}); diff --git a/x-pack/plugins/fleet/server/index.ts b/x-pack/plugins/fleet/server/index.ts index 8841c897fcb2a..21cdf659f2f5a 100644 --- a/x-pack/plugins/fleet/server/index.ts +++ b/x-pack/plugins/fleet/server/index.ts @@ -38,9 +38,37 @@ export const config: PluginConfigDescriptor = { epm: true, agents: true, }, - deprecations: ({ renameFromRoot, unused }) => [ - renameFromRoot('xpack.ingestManager', 'xpack.fleet'), - renameFromRoot('xpack.fleet.fleet', 'xpack.fleet.agents'), + deprecations: ({ renameFromRoot, unused, unusedFromRoot }) => [ + // Fleet plugin was named ingestManager before + renameFromRoot('xpack.ingestManager.enabled', 'xpack.fleet.enabled'), + renameFromRoot('xpack.ingestManager.registryUrl', 'xpack.fleet.registryUrl'), + renameFromRoot('xpack.ingestManager.registryProxyUrl', 'xpack.fleet.registryProxyUrl'), + renameFromRoot('xpack.ingestManager.fleet', 'xpack.ingestManager.agents'), + renameFromRoot('xpack.ingestManager.agents.enabled', 'xpack.fleet.agents.enabled'), + renameFromRoot('xpack.ingestManager.agents.elasticsearch', 'xpack.fleet.agents.elasticsearch'), + renameFromRoot( + 'xpack.ingestManager.agents.tlsCheckDisabled', + 'xpack.fleet.agents.tlsCheckDisabled' + ), + renameFromRoot( + 'xpack.ingestManager.agents.pollingRequestTimeout', + 'xpack.fleet.agents.pollingRequestTimeout' + ), + renameFromRoot( + 'xpack.ingestManager.agents.maxConcurrentConnections', + 'xpack.fleet.agents.maxConcurrentConnections' + ), + renameFromRoot('xpack.ingestManager.agents.kibana', 'xpack.fleet.agents.kibana'), + renameFromRoot( + 'xpack.ingestManager.agents.agentPolicyRolloutRateLimitIntervalMs', + 'xpack.fleet.agents.agentPolicyRolloutRateLimitIntervalMs' + ), + renameFromRoot( + 'xpack.ingestManager.agents.agentPolicyRolloutRateLimitRequestPerInterval', + 'xpack.fleet.agents.agentPolicyRolloutRateLimitRequestPerInterval' + ), + unusedFromRoot('xpack.ingestManager'), + // Unused settings before Fleet server exists unused('agents.kibana'), unused('agents.maxConcurrentConnections'), unused('agents.agentPolicyRolloutRateLimitIntervalMs'), @@ -48,6 +76,7 @@ export const config: PluginConfigDescriptor = { unused('agents.pollingRequestTimeout'), unused('agents.tlsCheckDisabled'), unused('agents.fleetServerEnabled'), + // Renaming elasticsearch.host => elasticsearch.hosts (fullConfig, fromPath, addDeprecation) => { const oldValue = fullConfig?.xpack?.fleet?.agents?.elasticsearch?.host; if (oldValue) { diff --git a/x-pack/plugins/fleet/server/routes/agent_policy/handlers.ts b/x-pack/plugins/fleet/server/routes/agent_policy/handlers.ts index 57401a525b5d7..a7cf606e92c0b 100644 --- a/x-pack/plugins/fleet/server/routes/agent_policy/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/agent_policy/handlers.ts @@ -8,6 +8,7 @@ import type { TypeOf } from '@kbn/config-schema'; import type { RequestHandler, ResponseHeaders } from 'src/core/server'; import bluebird from 'bluebird'; +import { safeDump } from 'js-yaml'; import { fullAgentPolicyToYaml } from '../../../common/services'; import { appContextService, agentPolicyService, packagePolicyService } from '../../services'; @@ -269,7 +270,7 @@ export const downloadFullAgentPolicy: RequestHandler< standalone: request.query.standalone === true, }); if (fullAgentPolicy) { - const body = fullAgentPolicyToYaml(fullAgentPolicy); + const body = fullAgentPolicyToYaml(fullAgentPolicy, safeDump); const headers: ResponseHeaders = { 'content-type': 'text/x-yaml', 'content-disposition': `attachment; filename="elastic-agent.yml"`, diff --git a/x-pack/plugins/fleet/server/services/artifacts/mocks.ts b/x-pack/plugins/fleet/server/services/artifacts/mocks.ts index 8bc1768da23a2..2799e1807123d 100644 --- a/x-pack/plugins/fleet/server/services/artifacts/mocks.ts +++ b/x-pack/plugins/fleet/server/services/artifacts/mocks.ts @@ -12,7 +12,12 @@ import { ResponseError } from '@elastic/elasticsearch/lib/errors'; import { elasticsearchServiceMock } from '../../../../../../src/core/server/mocks'; import type { SearchHit, ESSearchResponse } from '../../../../../../src/core/types/elasticsearch'; -import type { Artifact, ArtifactElasticsearchProperties, ArtifactsClientInterface } from './types'; +import type { + Artifact, + ArtifactElasticsearchProperties, + ArtifactsClientInterface, + NewArtifact, +} from './types'; import { newArtifactToElasticsearchProperties } from './mappings'; export const createArtifactsClientMock = (): jest.Mocked => { @@ -77,10 +82,12 @@ export const generateEsRequestErrorApiResponseMock = ( ); }; -export const generateArtifactEsGetSingleHitMock = (): SearchHit => { +export const generateArtifactEsGetSingleHitMock = ( + artifact?: NewArtifact +): SearchHit => { const { id, created, ...newArtifact } = generateArtifactMock(); const _source = { - ...newArtifactToElasticsearchProperties(newArtifact), + ...newArtifactToElasticsearchProperties(artifact ?? newArtifact), created, }; diff --git a/x-pack/plugins/fleet/server/services/epm/archive/storage.ts b/x-pack/plugins/fleet/server/services/epm/archive/storage.ts index dde6459addcbc..d3bc4afae6229 100644 --- a/x-pack/plugins/fleet/server/services/epm/archive/storage.ts +++ b/x-pack/plugins/fleet/server/services/epm/archive/storage.ts @@ -23,6 +23,8 @@ import type { } from '../../../../common'; import { pkgToPkgKey } from '../registry'; +import { appContextService } from '../../app_context'; + import { getArchiveEntry, setArchiveEntry, setArchiveFilelist, setPackageInfo } from './index'; import type { ArchiveEntry } from './index'; import { parseAndVerifyPolicyTemplates, parseAndVerifyStreams } from './validation'; @@ -165,6 +167,7 @@ export const getEsPackage = async ( references: PackageAssetReference[], savedObjectsClient: SavedObjectsClientContract ) => { + const logger = appContextService.getLogger(); const pkgKey = pkgToPkgKey({ name: pkgName, version: pkgVersion }); const bulkRes = await savedObjectsClient.bulkGet( references.map((reference) => ({ @@ -172,8 +175,27 @@ export const getEsPackage = async ( fields: ['asset_path', 'data_utf8', 'data_base64'], })) ); + const errors = bulkRes.saved_objects.filter((so) => so.error || !so.attributes); const assets = bulkRes.saved_objects.map((so) => so.attributes); + if (errors.length) { + const resolvedErrors = errors.map((so) => + so.error + ? { type: so.type, id: so.id, error: so.error } + : !so.attributes + ? { type: so.type, id: so.id, error: { error: `No attributes retrieved` } } + : { type: so.type, id: so.id, error: { error: `Unknown` } } + ); + + logger.warn( + `Failed to retrieve ${pkgName}-${pkgVersion} package from ES storage. bulkGet failed for assets: ${JSON.stringify( + resolvedErrors + )}` + ); + + return undefined; + } + const paths: string[] = []; const entries: ArchiveEntry[] = assets.map(packageAssetToArchiveEntry); entries.forEach(({ path, buffer }) => { diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/__snapshots__/template.test.ts.snap b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/__snapshots__/template.test.ts.snap index eff35a30ba2d6..0425573c5afaa 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/__snapshots__/template.test.ts.snap +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/__snapshots__/template.test.ts.snap @@ -8,25 +8,7 @@ exports[`EPM template tests loading base.yml: base.yml 1`] = ` ], "template": { "settings": { - "index": { - "lifecycle": { - "name": "logs" - }, - "codec": "best_compression", - "mapping": { - "total_fields": { - "limit": "10000" - } - }, - "refresh_interval": "5s", - "number_of_shards": "1", - "number_of_routing_shards": "30", - "query": { - "default_field": [ - "long.nested.foo" - ] - } - } + "index": {} }, "mappings": { "dynamic_templates": [ @@ -123,30 +105,7 @@ exports[`EPM template tests loading coredns.logs.yml: coredns.logs.yml 1`] = ` ], "template": { "settings": { - "index": { - "lifecycle": { - "name": "logs" - }, - "codec": "best_compression", - "mapping": { - "total_fields": { - "limit": "10000" - } - }, - "refresh_interval": "5s", - "number_of_shards": "1", - "number_of_routing_shards": "30", - "query": { - "default_field": [ - "coredns.id", - "coredns.query.class", - "coredns.query.name", - "coredns.query.type", - "coredns.response.code", - "coredns.response.flags" - ] - } - } + "index": {} }, "mappings": { "dynamic_templates": [ @@ -239,58 +198,7 @@ exports[`EPM template tests loading system.yml: system.yml 1`] = ` ], "template": { "settings": { - "index": { - "lifecycle": { - "name": "metrics" - }, - "codec": "best_compression", - "mapping": { - "total_fields": { - "limit": "10000" - } - }, - "refresh_interval": "5s", - "number_of_shards": "1", - "number_of_routing_shards": "30", - "query": { - "default_field": [ - "system.diskio.name", - "system.diskio.serial_number", - "system.filesystem.device_name", - "system.filesystem.type", - "system.filesystem.mount_point", - "system.network.name", - "system.process.state", - "system.process.cmdline", - "system.process.cgroup.id", - "system.process.cgroup.path", - "system.process.cgroup.cpu.id", - "system.process.cgroup.cpu.path", - "system.process.cgroup.cpuacct.id", - "system.process.cgroup.cpuacct.path", - "system.process.cgroup.memory.id", - "system.process.cgroup.memory.path", - "system.process.cgroup.blkio.id", - "system.process.cgroup.blkio.path", - "system.raid.name", - "system.raid.status", - "system.raid.level", - "system.raid.sync_action", - "system.socket.remote.host", - "system.socket.remote.etld_plus_one", - "system.socket.remote.host_error", - "system.socket.process.cmdline", - "system.users.id", - "system.users.seat", - "system.users.path", - "system.users.type", - "system.users.service", - "system.users.state", - "system.users.scope", - "system.users.remote_host" - ] - } - } + "index": {} }, "mappings": { "dynamic_templates": [ diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/default_settings.test.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/default_settings.test.ts new file mode 100644 index 0000000000000..5e7a3b35c544a --- /dev/null +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/default_settings.test.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { loggerMock } from '@kbn/logging/mocks'; +import type { Logger } from 'src/core/server'; + +import { appContextService } from '../../../app_context'; + +import { buildDefaultSettings } from './default_settings'; + +jest.mock('../../../app_context'); + +const mockedAppContextService = appContextService as jest.Mocked; +let mockedLogger: jest.Mocked; +describe('buildDefaultSettings', () => { + beforeEach(() => { + mockedLogger = loggerMock.create(); + mockedAppContextService.getLogger.mockReturnValue(mockedLogger); + }); + + it('should generate default settings', () => { + const settings = buildDefaultSettings({ + templateName: 'test_template', + packageName: 'test_package', + type: 'logs', + fields: [ + { + name: 'field1Keyword', + type: 'keyword', + }, + { + name: 'field2Boolean', + type: 'boolean', + }, + ], + }); + + expect(settings).toMatchInlineSnapshot(` + Object { + "index": Object { + "codec": "best_compression", + "lifecycle": Object { + "name": "logs", + }, + "mapping": Object { + "total_fields": Object { + "limit": "10000", + }, + }, + "number_of_routing_shards": "30", + "number_of_shards": "1", + "query": Object { + "default_field": Array [ + "field1Keyword", + ], + }, + "refresh_interval": "5s", + }, + } + `); + }); + + it('should log a warning if there is too many default fields', () => { + const fields = []; + for (let i = 0; i < 20000; i++) { + fields.push({ name: `field${i}`, type: 'keyword' }); + } + buildDefaultSettings({ + type: 'logs', + templateName: 'test_template', + packageName: 'test_package', + fields, + }); + + expect(mockedLogger.warn).toBeCalledWith( + 'large amount of default fields detected for index template test_template in package test_package, applying the first 1024 fields' + ); + }); +}); diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/default_settings.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/default_settings.ts new file mode 100644 index 0000000000000..2dced977229e1 --- /dev/null +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/default_settings.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 { appContextService } from '../../../app_context'; +import type { Field, Fields } from '../../fields/field'; + +const QUERY_DEFAULT_FIELD_TYPES = ['keyword', 'text']; +const QUERY_DEFAULT_FIELD_LIMIT = 1024; + +const flattenFieldsToNameAndType = ( + fields: Fields, + path: string = '' +): Array> => { + let newFields: Array> = []; + fields.forEach((field) => { + const fieldName = path ? `${path}.${field.name}` : field.name; + newFields.push({ + name: fieldName, + type: field.type, + }); + if (field.fields && field.fields.length) { + newFields = newFields.concat(flattenFieldsToNameAndType(field.fields, fieldName)); + } + }); + return newFields; +}; + +export function buildDefaultSettings({ + templateName, + packageName, + fields, + ilmPolicy, + type, +}: { + type: string; + templateName: string; + packageName: string; + ilmPolicy?: string | undefined; + fields: Field[]; +}) { + const logger = appContextService.getLogger(); + // Find all field names to set `index.query.default_field` to, which will be + // the first 1024 keyword or text fields + const defaultFields = flattenFieldsToNameAndType(fields).filter( + (field) => field.type && QUERY_DEFAULT_FIELD_TYPES.includes(field.type) + ); + if (defaultFields.length > QUERY_DEFAULT_FIELD_LIMIT) { + logger.warn( + `large amount of default fields detected for index template ${templateName} in package ${packageName}, applying the first ${QUERY_DEFAULT_FIELD_LIMIT} fields` + ); + } + const defaultFieldNames = (defaultFields.length > QUERY_DEFAULT_FIELD_LIMIT + ? defaultFields.slice(0, QUERY_DEFAULT_FIELD_LIMIT) + : defaultFields + ).map((field) => field.name); + + return { + index: { + // ILM Policy must be added here, for now point to the default global ILM policy name + lifecycle: { + name: ilmPolicy ? ilmPolicy : type, + }, + // What should be our default for the compression? + codec: 'best_compression', + mapping: { + total_fields: { + limit: '10000', + }, + }, + // This is the default from Beats? So far seems to be a good value + refresh_interval: '5s', + // Default in the stack now, still good to have it in + number_of_shards: '1', + // We are setting 30 because it can be devided by several numbers. Useful when shrinking. + number_of_routing_shards: '30', + + // All the default fields which should be queried have to be added here. + // So far we add all keyword and text fields here if there are any, otherwise + // this setting is skipped. + ...(defaultFieldNames.length + ? { + query: { + default_field: defaultFieldNames, + }, + } + : {}), + }, + }; +} 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 e8dac60ddba1a..9dae415838890 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 @@ -5,6 +5,7 @@ * 2.0. */ +import { merge } from 'lodash'; import Boom from '@hapi/boom'; import type { ElasticsearchClient, SavedObjectsClientContract } from 'src/core/server'; @@ -14,6 +15,7 @@ import type { IndexTemplateEntry, RegistryElasticsearch, InstallablePackage, + IndexTemplate, } from '../../../../types'; import { loadFieldsFromYaml, processFields } from '../../fields/field'; import type { Field } from '../../fields/field'; @@ -32,6 +34,7 @@ import { getTemplate, getTemplatePriority, } from './template'; +import { buildDefaultSettings } from './default_settings'; export const installTemplates = async ( installablePackage: InstallablePackage, @@ -210,8 +213,9 @@ function buildComponentTemplates(params: { templateName: string; registryElasticsearch: RegistryElasticsearch | undefined; packageName: string; + defaultSettings: IndexTemplate['template']['settings']; }) { - const { templateName, registryElasticsearch, packageName } = params; + const { templateName, registryElasticsearch, packageName, defaultSettings } = params; const mappingsTemplateName = `${templateName}${mappingsSuffix}`; const settingsTemplateName = `${templateName}${settingsSuffix}`; const userSettingsTemplateName = `${templateName}${userSettingsSuffix}`; @@ -228,14 +232,12 @@ function buildComponentTemplates(params: { }; } - if (registryElasticsearch && registryElasticsearch['index_template.settings']) { - templatesMap[settingsTemplateName] = { - template: { - settings: registryElasticsearch['index_template.settings'], - }, - _meta, - }; - } + templatesMap[settingsTemplateName] = { + template: { + settings: merge(defaultSettings, registryElasticsearch?.['index_template.settings'] ?? {}), + }, + _meta, + }; // return empty/stub template templatesMap[userSettingsTemplateName] = { @@ -253,9 +255,15 @@ async function installDataStreamComponentTemplates(params: { registryElasticsearch: RegistryElasticsearch | undefined; esClient: ElasticsearchClient; packageName: string; + defaultSettings: IndexTemplate['template']['settings']; }) { - const { templateName, registryElasticsearch, esClient, packageName } = params; - const templates = buildComponentTemplates({ templateName, registryElasticsearch, packageName }); + const { templateName, registryElasticsearch, esClient, packageName, defaultSettings } = params; + const templates = buildComponentTemplates({ + templateName, + registryElasticsearch, + packageName, + defaultSettings, + }); const templateNames = Object.keys(templates); const templateEntries = Object.entries(templates); @@ -362,11 +370,20 @@ export async function installTemplate({ await esClient.indices.putIndexTemplate(updateIndexTemplateParams, { ignore: [404] }); } + const defaultSettings = buildDefaultSettings({ + templateName, + packageName, + fields, + type: dataStream.type, + ilmPolicy: dataStream.ilm_policy, + }); + const composedOfTemplates = await installDataStreamComponentTemplates({ templateName, registryElasticsearch: dataStream.elasticsearch, esClient, packageName, + defaultSettings, }); const template = getTemplate({ @@ -378,7 +395,6 @@ export async function installTemplate({ packageName, composedOfTemplates, templatePriority, - ilmPolicy: dataStream.ilm_policy, hidden: dataStream.hidden, }); 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 c999a135e2116..44d633d5f6e53 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 @@ -40,9 +40,6 @@ const DEFAULT_IGNORE_ABOVE = 1024; const DEFAULT_TEMPLATE_PRIORITY = 200; const DATASET_IS_PREFIX_TEMPLATE_PRIORITY = 150; -const QUERY_DEFAULT_FIELD_TYPES = ['keyword', 'text']; -const QUERY_DEFAULT_FIELD_LIMIT = 1024; - const META_PROP_KEYS = ['metric_type', 'unit']; /** @@ -59,7 +56,6 @@ export function getTemplate({ packageName, composedOfTemplates, templatePriority, - ilmPolicy, hidden, }: { type: string; @@ -70,7 +66,6 @@ export function getTemplate({ packageName: string; composedOfTemplates: string[]; templatePriority: number; - ilmPolicy?: string | undefined; hidden?: boolean; }): IndexTemplate { const template = getBaseTemplate( @@ -81,7 +76,6 @@ export function getTemplate({ packageName, composedOfTemplates, templatePriority, - ilmPolicy, hidden ); if (pipelineName) { @@ -370,11 +364,8 @@ function getBaseTemplate( packageName: string, composedOfTemplates: string[], templatePriority: number, - ilmPolicy?: string | undefined, hidden?: boolean ): IndexTemplate { - const logger = appContextService.getLogger(); - // Meta information to identify Ingest Manager's managed templates and indices const _meta = { package: { @@ -384,57 +375,13 @@ function getBaseTemplate( managed: true, }; - // Find all field names to set `index.query.default_field` to, which will be - // the first 1024 keyword or text fields - const defaultFields = flattenFieldsToNameAndType(fields).filter( - (field) => field.type && QUERY_DEFAULT_FIELD_TYPES.includes(field.type) - ); - if (defaultFields.length > QUERY_DEFAULT_FIELD_LIMIT) { - logger.warn( - `large amount of default fields detected for index template ${templateIndexPattern} in package ${packageName}, applying the first ${QUERY_DEFAULT_FIELD_LIMIT} fields` - ); - } - const defaultFieldNames = (defaultFields.length > QUERY_DEFAULT_FIELD_LIMIT - ? defaultFields.slice(0, QUERY_DEFAULT_FIELD_LIMIT) - : defaultFields - ).map((field) => field.name); - return { priority: templatePriority, // To be completed with the correct index patterns index_patterns: [templateIndexPattern], template: { settings: { - index: { - // ILM Policy must be added here, for now point to the default global ILM policy name - lifecycle: { - name: ilmPolicy ? ilmPolicy : type, - }, - // What should be our default for the compression? - codec: 'best_compression', - // W - mapping: { - total_fields: { - limit: '10000', - }, - }, - // This is the default from Beats? So far seems to be a good value - refresh_interval: '5s', - // Default in the stack now, still good to have it in - number_of_shards: '1', - // We are setting 30 because it can be devided by several numbers. Useful when shrinking. - number_of_routing_shards: '30', - // All the default fields which should be queried have to be added here. - // So far we add all keyword and text fields here if there are any, otherwise - // this setting is skipped. - ...(defaultFieldNames.length - ? { - query: { - default_field: defaultFieldNames, - }, - } - : {}), - }, + index: {}, }, mappings: { // All the dynamic field mappings 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 e493095bc4b36..0e23981b95fcd 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/get.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/get.ts @@ -217,7 +217,10 @@ export async function getPackageFromSource(options: { installedPkg.package_assets, savedObjectsClient ); - logger.debug(`retrieved installed package ${pkgName}-${pkgVersion} from ES`); + + if (res) { + logger.debug(`retrieved installed package ${pkgName}-${pkgVersion} from ES`); + } } // for packages not in cache or package storage and installed from registry, check registry if (!res && pkgInstallSource === 'registry') { diff --git a/x-pack/plugins/fleet/server/services/package_policy.ts b/x-pack/plugins/fleet/server/services/package_policy.ts index 8ff3c20b7aa15..598dd16b2928e 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.ts @@ -16,6 +16,7 @@ import type { SavedObjectsClientContract, } from 'src/core/server'; import uuid from 'uuid'; +import { safeLoad } from 'js-yaml'; import type { AuthenticatedUser } from '../../../security/server'; import { @@ -988,7 +989,7 @@ export function overridePackageInputs( inputs, }; - const validationResults = validatePackagePolicy(resultingPackagePolicy, packageInfo); + const validationResults = validatePackagePolicy(resultingPackagePolicy, packageInfo, safeLoad); if (validationHasErrors(validationResults)) { const responseFormattedValidationErrors = Object.entries(getFlattenedObject(validationResults)) diff --git a/x-pack/plugins/global_search/jest.config.js b/x-pack/plugins/global_search/jest.config.js index ed945fcb8e605..ba4c8130c375c 100644 --- a/x-pack/plugins/global_search/jest.config.js +++ b/x-pack/plugins/global_search/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/global_search'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/global_search', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/global_search/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/global_search/public/services/search_service.test.ts b/x-pack/plugins/global_search/public/services/search_service.test.ts index 4b3c06f03dcc8..b0e6a72290438 100644 --- a/x-pack/plugins/global_search/public/services/search_service.test.ts +++ b/x-pack/plugins/global_search/public/services/search_service.test.ts @@ -272,6 +272,43 @@ describe('SearchService', () => { }); }); + it('catches errors from providers', async () => { + const { registerResultProvider } = service.setup({ + config: createConfig(), + }); + + getTestScheduler().run(({ expectObservable, hot }) => { + registerResultProvider( + createProvider('A', { + source: hot('a---c-|', { + a: [providerResult('A1'), providerResult('A2')], + c: [providerResult('A3')], + }), + }) + ); + registerResultProvider( + createProvider('B', { + source: hot( + '-b-# ', + { + b: [providerResult('B1')], + }, + new Error('something went bad') + ), + }) + ); + + const { find } = service.start(startDeps()); + const results = find({ term: 'foobar' }, {}); + + expectObservable(results).toBe('ab--c-|', { + a: expectedBatch('A1', 'A2'), + b: expectedBatch('B1'), + c: expectedBatch('A3'), + }); + }); + }); + it('return mixed server/client providers results', async () => { const { registerResultProvider } = service.setup({ config: createConfig(), @@ -304,6 +341,33 @@ describe('SearchService', () => { }); }); + it('catches errors from the server', async () => { + const { registerResultProvider } = service.setup({ + config: createConfig(), + }); + + getTestScheduler().run(({ expectObservable, hot }) => { + fetchServerResultsMock.mockReturnValue(hot('#', {}, new Error('fetch error'))); + + registerResultProvider( + createProvider('A', { + source: hot('a-b-|', { + a: [providerResult('P1')], + b: [providerResult('P2')], + }), + }) + ); + + const { find } = service.start(startDeps()); + const results = find({ term: 'foobar' }, {}); + + expectObservable(results).toBe('a-b-|', { + a: expectedBatch('P1'), + b: expectedBatch('P2'), + }); + }); + }); + it('handles the `aborted$` option', async () => { const { registerResultProvider } = service.setup({ config: createConfig(), diff --git a/x-pack/plugins/global_search/public/services/search_service.ts b/x-pack/plugins/global_search/public/services/search_service.ts index bf06aa04061ed..85f4d4143a609 100644 --- a/x-pack/plugins/global_search/public/services/search_service.ts +++ b/x-pack/plugins/global_search/public/services/search_service.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { merge, Observable, timer, throwError } from 'rxjs'; -import { map, takeUntil } from 'rxjs/operators'; +import { merge, Observable, timer, throwError, EMPTY } from 'rxjs'; +import { map, takeUntil, catchError } from 'rxjs/operators'; import { uniq } from 'lodash'; import { duration } from 'moment'; import { i18n } from '@kbn/i18n'; @@ -177,16 +177,16 @@ export class SearchService { const serverResults$ = fetchServerResults(this.http!, params, { preference, aborted$, - }); + }).pipe(catchError(() => EMPTY)); const providersResults$ = [...this.providers.values()].map((provider) => provider.find(params, providerOptions).pipe( + catchError(() => EMPTY), takeInArray(this.maxProviderResults), takeUntil(aborted$), map((results) => results.map((r) => processResult(r))) ) ); - return merge(...providersResults$, serverResults$).pipe( map((results) => ({ results, diff --git a/x-pack/plugins/global_search/server/services/search_service.test.ts b/x-pack/plugins/global_search/server/services/search_service.test.ts index 246fbd675aba2..45824fde26afe 100644 --- a/x-pack/plugins/global_search/server/services/search_service.test.ts +++ b/x-pack/plugins/global_search/server/services/search_service.test.ts @@ -178,6 +178,44 @@ describe('SearchService', () => { }); }); + it('catches errors from providers', async () => { + const { registerResultProvider } = service.setup({ + config: createConfig(), + basePath, + }); + + getTestScheduler().run(({ expectObservable, hot }) => { + registerResultProvider( + createProvider('A', { + source: hot('a---c-|', { + a: [result('A1'), result('A2')], + c: [result('A3')], + }), + }) + ); + registerResultProvider( + createProvider('B', { + source: hot( + '-b-# ', + { + b: [result('B1')], + }, + new Error('something went bad') + ), + }) + ); + + const { find } = service.start({ core: coreStart, licenseChecker }); + const results = find({ term: 'foobar' }, {}, request); + + expectObservable(results).toBe('ab--c-|', { + a: expectedBatch('A1', 'A2'), + b: expectedBatch('B1'), + c: expectedBatch('A3'), + }); + }); + }); + it('handles the `aborted$` option', async () => { const { registerResultProvider } = service.setup({ config: createConfig(), diff --git a/x-pack/plugins/global_search/server/services/search_service.ts b/x-pack/plugins/global_search/server/services/search_service.ts index a6c2a7ee234d6..22bac036544ab 100644 --- a/x-pack/plugins/global_search/server/services/search_service.ts +++ b/x-pack/plugins/global_search/server/services/search_service.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { Observable, timer, merge, throwError } from 'rxjs'; -import { map, takeUntil } from 'rxjs/operators'; +import { Observable, timer, merge, throwError, EMPTY } from 'rxjs'; +import { map, takeUntil, catchError } from 'rxjs/operators'; import { uniq } from 'lodash'; import { i18n } from '@kbn/i18n'; import { KibanaRequest, CoreStart, IBasePath } from 'src/core/server'; @@ -174,6 +174,7 @@ export class SearchService { const providersResults$ = [...this.providers.values()].map((provider) => provider.find(params, findOptions, context).pipe( + catchError(() => EMPTY), takeInArray(this.maxProviderResults), takeUntil(aborted$), map((results) => results.map((r) => processResult(r))) diff --git a/x-pack/plugins/global_search_bar/jest.config.js b/x-pack/plugins/global_search_bar/jest.config.js index 73cf5402a83a9..e00903df125c9 100644 --- a/x-pack/plugins/global_search_bar/jest.config.js +++ b/x-pack/plugins/global_search_bar/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/global_search_bar'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/global_search_bar', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/global_search_bar/public/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/global_search_bar/public/components/search_bar.tsx b/x-pack/plugins/global_search_bar/public/components/search_bar.tsx index 5234b4e7b0ad5..c459b2c045681 100644 --- a/x-pack/plugins/global_search_bar/public/components/search_bar.tsx +++ b/x-pack/plugins/global_search_bar/public/components/search_bar.tsx @@ -135,8 +135,8 @@ const resultToOption = ( ): EuiSelectableTemplateSitewideOption => { const { id, title, url, icon, type, meta = {} } = result; const { tagIds = [], categoryLabel = '' } = meta as { tagIds: string[]; categoryLabel: string }; - // only displaying icons for applications - const useIcon = type === 'application'; + // only displaying icons for applications and integrations + const useIcon = type === 'application' || type === 'integration'; const option: EuiSelectableTemplateSitewideOption = { key: id, label: title, diff --git a/x-pack/plugins/global_search_bar/public/plugin.tsx b/x-pack/plugins/global_search_bar/public/plugin.tsx index 954e4241966a0..dfce09bd12edc 100644 --- a/x-pack/plugins/global_search_bar/public/plugin.tsx +++ b/x-pack/plugins/global_search_bar/public/plugin.tsx @@ -23,7 +23,7 @@ export interface GlobalSearchBarPluginStartDeps { } export class GlobalSearchBarPlugin implements Plugin<{}, {}> { - public async setup() { + public setup() { return {}; } diff --git a/x-pack/plugins/global_search_providers/jest.config.js b/x-pack/plugins/global_search_providers/jest.config.js index b45fb5cdaa401..231b444585b03 100644 --- a/x-pack/plugins/global_search_providers/jest.config.js +++ b/x-pack/plugins/global_search_providers/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/global_search_providers'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/global_search_providers', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/global_search_providers/{public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/graph/README.md b/x-pack/plugins/graph/README.md index 99becabf70002..a0d7eb25ff987 100644 --- a/x-pack/plugins/graph/README.md +++ b/x-pack/plugins/graph/README.md @@ -17,18 +17,18 @@ Graph shows only up in the side bar if your server is running on a platinum or t ### Client `public/` -Currently most of the state handling is done by a central angular controller. This controller will be broken up into a redux/saga setup step by step. +Currently state handled by react/redux/saga and the core mutable `GraphWorkspace` instance, which managing the nodes and edges state. It should be rewritten in typescript and integrated into redux store. -* `angular/` contains all code using javascript and angular. Rewriting this code in typescript and react is currently ongoing. When the migration is finished, this folder will go away +* `apps/` contains all graph app routes * `components/` contains react components for various parts of the interface. Components can hold local UI state (e.g. current form data), everything else should be passed in from the caller. Styles should reside in a component-specific stylesheet -* `services/` contains functions that encapsule other parts of Kibana. Stateful dependencies are passed in from the outside. Components should not rely on services directly but have callbacks passed in. Once the migration to redux/saga is complete, only sagas will use services. +* `services/` contains the core workspace logic and functions that encapsule other parts of Kibana. Stateful dependencies are passed in from the outside. Components should not rely on services directly but have callbacks passed in. Once the migration to redux/saga is complete, only sagas will use services * `helpers/` contains side effect free helper functions that can be imported and used from components and services * `state_management/` contains reducers, action creators, selectors and sagas. It also exports the central store creator * Each file covers one functional area (e.g. handling of fields, handling of url templates...) * Generally there is no file separation between reducers, action creators, selectors and sagas of the same functional area * Sagas may contain cross-references between multiple functional areas (e.g. the loading saga sets fields and meta data). Because of this it is possible that circular imports occur. In this case the sagas are moved to a separate file `.sagas.ts`. -* `types/` contains type definitions for unmigrated functions in `angular/` and business objects -* `app.js` is the central entrypoint of the app. It initializes router, state management and root components. This will become `app.tsx` when the migration is complete +* `types/` contains type definitions for unmigrated `GraphWorkspace` methods +* `router.tsx` is the central entrypoint of the app ### Server `server/` diff --git a/x-pack/plugins/graph/jest.config.js b/x-pack/plugins/graph/jest.config.js index 8a4f3db30b04a..bd9c9d0938686 100644 --- a/x-pack/plugins/graph/jest.config.js +++ b/x-pack/plugins/graph/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/graph'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/graph', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/graph/{common,public,server}/**/*.{js,ts,tsx}'], }; diff --git a/x-pack/plugins/graph/kibana.json b/x-pack/plugins/graph/kibana.json index 463893e2425ac..410a5e2c160d6 100644 --- a/x-pack/plugins/graph/kibana.json +++ b/x-pack/plugins/graph/kibana.json @@ -4,12 +4,29 @@ "kibanaVersion": "kibana", "server": true, "ui": true, - "requiredPlugins": ["licensing", "data", "navigation", "savedObjects", "kibanaLegacy"], - "optionalPlugins": ["home", "features"], - "configPath": ["xpack", "graph"], - "requiredBundles": ["kibanaUtils", "kibanaReact", "home"], + "requiredPlugins": [ + "licensing", + "data", + "navigation", + "savedObjects", + "kibanaLegacy" + ], + "optionalPlugins": [ + "home", + "features", + "spaces" + ], + "configPath": [ + "xpack", + "graph" + ], + "requiredBundles": [ + "kibanaUtils", + "kibanaReact", + "home" + ], "owner": { - "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" + "name": "Data Discovery", + "githubTeam": "kibana-data-discovery" } -} +} \ No newline at end of file diff --git a/x-pack/plugins/graph/public/_main.scss b/x-pack/plugins/graph/public/_main.scss index 22a849b0b2a60..6b32de32c06d0 100644 --- a/x-pack/plugins/graph/public/_main.scss +++ b/x-pack/plugins/graph/public/_main.scss @@ -21,7 +21,6 @@ */ .gphNoUserSelect { - padding-right: $euiSizeXS; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; diff --git a/x-pack/plugins/graph/public/application.ts b/x-pack/plugins/graph/public/application.ts index 7461a7b5fc172..fc6c6170509d9 100644 --- a/x-pack/plugins/graph/public/application.ts +++ b/x-pack/plugins/graph/public/application.ts @@ -31,6 +31,7 @@ import './index.scss'; import { SavedObjectsStart } from '../../../../src/plugins/saved_objects/public'; import { GraphSavePolicy } from './types'; import { graphRouter } from './router'; +import { SpacesApi } from '../../spaces/public'; /** * These are dependencies of the Graph app besides the base dependencies @@ -63,6 +64,7 @@ export interface GraphDependencies { setHeaderActionMenu: AppMountParameters['setHeaderActionMenu']; uiSettings: IUiSettingsClient; history: ScopedHistory; + spaces?: SpacesApi; } export type GraphServices = Omit; diff --git a/x-pack/plugins/graph/public/apps/workspace_route.tsx b/x-pack/plugins/graph/public/apps/workspace_route.tsx index f4158238c33c6..55f481bf504f1 100644 --- a/x-pack/plugins/graph/public/apps/workspace_route.tsx +++ b/x-pack/plugins/graph/public/apps/workspace_route.tsx @@ -8,7 +8,7 @@ import React, { useMemo, useRef, useState } from 'react'; import { I18nProvider } from '@kbn/i18n/react'; import { Provider } from 'react-redux'; -import { useHistory, useLocation } from 'react-router-dom'; +import { useHistory } from 'react-router-dom'; import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; import { showSaveModal } from '../../../../../src/plugins/saved_objects/public'; import { Workspace } from '../types'; @@ -40,6 +40,7 @@ export const WorkspaceRoute = ({ getBasePath, addBasePath, setHeaderActionMenu, + spaces, indexPatterns: getIndexPatternProvider, }, }: WorkspaceRouteProps) => { @@ -56,7 +57,6 @@ export const WorkspaceRoute = ({ */ const [renderCounter, setRenderCounter] = useState(0); const history = useHistory(); - const urlQuery = new URLSearchParams(useLocation().search).get('query'); const indexPatternProvider = useMemo( () => createCachedIndexPatternProvider(getIndexPatternProvider.get), @@ -114,22 +114,27 @@ export const WorkspaceRoute = ({ }) ); - const { savedWorkspace, indexPatterns } = useWorkspaceLoader({ + const loaded = useWorkspaceLoader({ workspaceRef, store, savedObjectsClient, - toastNotifications, + spaces, + coreStart, }); - if (!savedWorkspace || !indexPatterns) { + if (!loaded) { return null; } + const { savedWorkspace, indexPatterns, sharingSavedObjectProps } = loaded; + return ( diff --git a/x-pack/plugins/graph/public/components/_sidebar.scss b/x-pack/plugins/graph/public/components/_sidebar.scss index 831032231fe8c..f835eeac10c0a 100644 --- a/x-pack/plugins/graph/public/components/_sidebar.scss +++ b/x-pack/plugins/graph/public/components/_sidebar.scss @@ -25,7 +25,7 @@ border-radius: $euiBorderRadius; margin-bottom: $euiSizeXS; - & > span { + .kuiIcon { padding-right: $euiSizeXS; } } diff --git a/x-pack/plugins/graph/public/components/workspace_layout/workspace_layout.test.tsx b/x-pack/plugins/graph/public/components/workspace_layout/workspace_layout.test.tsx new file mode 100644 index 0000000000000..c535c9e32d335 --- /dev/null +++ b/x-pack/plugins/graph/public/components/workspace_layout/workspace_layout.test.tsx @@ -0,0 +1,63 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { shallow } from 'enzyme'; +import { WorkspaceLayoutComponent } from '.'; +import { coreMock } from 'src/core/public/mocks'; +import { spacesPluginMock } from '../../../../spaces/public/mocks'; +import { NavigationPublicPluginStart as NavigationStart } from '../../../../../../src/plugins/navigation/public'; +import { GraphSavePolicy, GraphWorkspaceSavedObject, IndexPatternProvider } from '../../types'; +import { OverlayStart, Capabilities } from 'kibana/public'; +import { SharingSavedObjectProps } from '../../helpers/use_workspace_loader'; + +jest.mock('react-router-dom', () => { + const useLocation = () => ({ + search: '?query={}', + }); + return { + useLocation, + }; +}); + +describe('workspace_layout', () => { + const defaultProps = { + renderCounter: 1, + loading: false, + savedWorkspace: { id: 'test' } as GraphWorkspaceSavedObject, + hasFields: true, + overlays: {} as OverlayStart, + workspaceInitialized: true, + indexPatterns: [], + indexPatternProvider: {} as IndexPatternProvider, + capabilities: {} as Capabilities, + coreStart: coreMock.createStart(), + graphSavePolicy: 'configAndDataWithConsent' as GraphSavePolicy, + navigation: {} as NavigationStart, + canEditDrillDownUrls: true, + setHeaderActionMenu: jest.fn(), + sharingSavedObjectProps: { + outcome: 'exactMatch', + aliasTargetId: '', + } as SharingSavedObjectProps, + spaces: spacesPluginMock.createStartContract(), + }; + it('should display conflict notification if outcome is conflict', () => { + shallow( + + ); + expect(defaultProps.spaces.ui.components.getLegacyUrlConflict).toHaveBeenCalledWith({ + currentObjectId: 'test', + objectNoun: 'Graph', + otherObjectId: 'conflictId', + otherObjectPath: '#/workspace/conflictId?query={}', + }); + }); +}); diff --git a/x-pack/plugins/graph/public/components/workspace_layout/workspace_layout.tsx b/x-pack/plugins/graph/public/components/workspace_layout/workspace_layout.tsx index 70e5b82ec6526..5426ae9228518 100644 --- a/x-pack/plugins/graph/public/components/workspace_layout/workspace_layout.tsx +++ b/x-pack/plugins/graph/public/components/workspace_layout/workspace_layout.tsx @@ -9,6 +9,7 @@ import React, { Fragment, memo, useCallback, useRef, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiSpacer } from '@elastic/eui'; import { connect } from 'react-redux'; +import { useLocation } from 'react-router-dom'; import { SearchBar } from '../search_bar'; import { GraphState, @@ -33,6 +34,8 @@ import { GraphServices } from '../../application'; import { ControlPanel } from '../control_panel'; import { GraphVisualization } from '../graph_visualization'; import { colorChoices } from '../../helpers/style_choices'; +import { SharingSavedObjectProps } from '../../helpers/use_workspace_loader'; +import { getEditUrl } from '../../services/url'; /** * Each component, which depends on `worksapce` @@ -51,6 +54,7 @@ type WorkspaceLayoutProps = Pick< | 'coreStart' | 'canEditDrillDownUrls' | 'overlays' + | 'spaces' > & { renderCounter: number; workspace?: Workspace; @@ -58,7 +62,7 @@ type WorkspaceLayoutProps = Pick< indexPatterns: IndexPatternSavedObject[]; savedWorkspace: GraphWorkspaceSavedObject; indexPatternProvider: IndexPatternProvider; - urlQuery: string | null; + sharingSavedObjectProps?: SharingSavedObjectProps; }; interface WorkspaceLayoutStateProps { @@ -66,7 +70,7 @@ interface WorkspaceLayoutStateProps { hasFields: boolean; } -const WorkspaceLayoutComponent = ({ +export const WorkspaceLayoutComponent = ({ renderCounter, workspace, loading, @@ -81,8 +85,9 @@ const WorkspaceLayoutComponent = ({ graphSavePolicy, navigation, canEditDrillDownUrls, - urlQuery, setHeaderActionMenu, + sharingSavedObjectProps, + spaces, }: WorkspaceLayoutProps & WorkspaceLayoutStateProps) => { const [currentIndexPattern, setCurrentIndexPattern] = useState(); const [showInspect, setShowInspect] = useState(false); @@ -90,6 +95,10 @@ const WorkspaceLayoutComponent = ({ const [mergeCandidates, setMergeCandidates] = useState([]); const [control, setControl] = useState('none'); const selectedNode = useRef(undefined); + + const search = useLocation().search; + const urlQuery = new URLSearchParams(search).get('query'); + const isInitialized = Boolean(workspaceInitialized || savedWorkspace.id); const selectSelected = useCallback((node: WorkspaceNode) => { @@ -154,6 +163,27 @@ const WorkspaceLayoutComponent = ({ [] ); + const getLegacyUrlConflictCallout = useCallback(() => { + // This function returns a callout component *if* we have encountered a "legacy URL conflict" scenario + const currentObjectId = savedWorkspace.id; + if (spaces && sharingSavedObjectProps?.outcome === 'conflict' && currentObjectId) { + // We have resolved to one object, but another object has a legacy URL alias associated with this ID/page. We should display a + // callout with a warning for the user, and provide a way for them to navigate to the other object. + const otherObjectId = sharingSavedObjectProps?.aliasTargetId!; // This is always defined if outcome === 'conflict' + const otherObjectPath = + getEditUrl(coreStart.http.basePath.prepend, { id: otherObjectId }) + search; + return spaces.ui.components.getLegacyUrlConflict({ + objectNoun: i18n.translate('xpack.graph.legacyUrlConflict.objectNoun', { + defaultMessage: 'Graph', + }), + currentObjectId, + otherObjectId, + otherObjectPath, + }); + } + return null; + }, [savedWorkspace.id, sharingSavedObjectProps, spaces, coreStart.http, search]); + return ( - {isInitialized && }
    + {getLegacyUrlConflictCallout()} {!isInitialized && (
    { const store = useStore(); const location = useLocation(); const history = useHistory(); - - // register things for legacy angular UI const allSavingDisabled = props.graphSavePolicy === 'none'; // ===== Menubar configuration ========= diff --git a/x-pack/plugins/graph/public/helpers/saved_workspace_utils.ts b/x-pack/plugins/graph/public/helpers/saved_workspace_utils.ts index 336708173d321..6e37bfcf41d1a 100644 --- a/x-pack/plugins/graph/public/helpers/saved_workspace_utils.ts +++ b/x-pack/plugins/graph/public/helpers/saved_workspace_utils.ts @@ -82,28 +82,38 @@ export function findSavedWorkspace( }); } +export function getEmptyWorkspace() { + return { + savedObject: { + displayName: 'graph workspace', + getEsType: () => savedWorkspaceType, + ...defaultsProps, + } as GraphWorkspaceSavedObject, + }; +} + export async function getSavedWorkspace( savedObjectsClient: SavedObjectsClientContract, - id?: string + id: string ) { - const savedObject = { - id, - displayName: 'graph workspace', - getEsType: () => savedWorkspaceType, - } as { [key: string]: any }; - - if (!id) { - assign(savedObject, defaultsProps); - return Promise.resolve(savedObject); - } + const resolveResult = await savedObjectsClient.resolve>( + savedWorkspaceType, + id + ); - const resp = await savedObjectsClient.get>(savedWorkspaceType, id); - savedObject._source = cloneDeep(resp.attributes); + const resp = resolveResult.saved_object; if (!resp._version) { throw new SavedObjectNotFound(savedWorkspaceType, id || ''); } + const savedObject = { + id, + displayName: 'graph workspace', + getEsType: () => savedWorkspaceType, + _source: cloneDeep(resp.attributes), + } as GraphWorkspaceSavedObject; + // assign the defaults to the response defaults(savedObject._source, defaultsProps); @@ -120,7 +130,15 @@ export async function getSavedWorkspace( injectReferences(savedObject, resp.references); } - return savedObject as GraphWorkspaceSavedObject; + const sharingSavedObjectProps = { + outcome: resolveResult.outcome, + aliasTargetId: resolveResult.alias_target_id, + }; + + return { + savedObject, + sharingSavedObjectProps, + }; } export function deleteSavedWorkspace( diff --git a/x-pack/plugins/graph/public/helpers/use_workspace_loader.test.tsx b/x-pack/plugins/graph/public/helpers/use_workspace_loader.test.tsx new file mode 100644 index 0000000000000..db80289d0d32d --- /dev/null +++ b/x-pack/plugins/graph/public/helpers/use_workspace_loader.test.tsx @@ -0,0 +1,95 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React from 'react'; +import { mount } from 'enzyme'; +import { useWorkspaceLoader, UseWorkspaceLoaderProps } from './use_workspace_loader'; +import { coreMock } from 'src/core/public/mocks'; +import { spacesPluginMock } from '../../../spaces/public/mocks'; +import { createMockGraphStore } from '../state_management/mocks'; +import { Workspace } from '../types'; +import { SavedObjectsClientCommon } from 'src/plugins/data/common'; +import { act } from 'react-dom/test-utils'; + +jest.mock('react-router-dom', () => { + const useLocation = () => ({ + search: '?query={}', + }); + + const replaceFn = jest.fn(); + + const useHistory = () => ({ + replace: replaceFn, + }); + return { + useHistory, + useLocation, + useParams: () => ({ + id: '1', + }), + }; +}); + +const mockSavedObjectsClient = ({ + resolve: jest.fn().mockResolvedValue({ + saved_object: { id: 10, _version: '7.15.0', attributes: { wsState: '{}' } }, + outcome: 'exactMatch', + }), + find: jest.fn().mockResolvedValue({ title: 'test' }), +} as unknown) as SavedObjectsClientCommon; + +async function setup(props: UseWorkspaceLoaderProps) { + const returnVal = {}; + function TestComponent() { + Object.assign(returnVal, useWorkspaceLoader(props)); + return null; + } + await act(async () => { + const promise = Promise.resolve(); + mount(); + await act(() => promise); + }); + return returnVal; +} + +describe('use_workspace_loader', () => { + const defaultProps = { + workspaceRef: { current: {} as Workspace }, + store: createMockGraphStore({}).store, + savedObjectsClient: mockSavedObjectsClient, + coreStart: coreMock.createStart(), + spaces: spacesPluginMock.createStartContract(), + }; + + it('should not redirect if outcome is exactMatch', async () => { + await act(async () => { + await setup((defaultProps as unknown) as UseWorkspaceLoaderProps); + }); + expect(defaultProps.spaces.ui.redirectLegacyUrl).not.toHaveBeenCalled(); + expect(defaultProps.store.dispatch).toHaveBeenCalled(); + }); + it('should redirect if outcome is aliasMatch', async () => { + const props = { + ...defaultProps, + spaces: spacesPluginMock.createStartContract(), + savedObjectsClient: { + ...mockSavedObjectsClient, + resolve: jest.fn().mockResolvedValue({ + saved_object: { id: 10, _version: '7.15.0', attributes: { wsState: '{}' } }, + outcome: 'aliasMatch', + alias_target_id: 'aliasTargetId', + }), + }, + }; + await act(async () => { + await setup((props as unknown) as UseWorkspaceLoaderProps); + }); + expect(props.spaces.ui.redirectLegacyUrl).toHaveBeenCalledWith( + '#/workspace/aliasTargetId?query={}', + 'Graph' + ); + }); +}); diff --git a/x-pack/plugins/graph/public/helpers/use_workspace_loader.ts b/x-pack/plugins/graph/public/helpers/use_workspace_loader.ts index 8b91546d52446..b9abf31e084fe 100644 --- a/x-pack/plugins/graph/public/helpers/use_workspace_loader.ts +++ b/x-pack/plugins/graph/public/helpers/use_workspace_loader.ts @@ -5,35 +5,48 @@ * 2.0. */ -import { SavedObjectsClientContract, ToastsStart } from 'kibana/public'; +import { SavedObjectsClientContract } from 'kibana/public'; import { useEffect, useState } from 'react'; import { useHistory, useLocation, useParams } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; +import { CoreStart } from 'kibana/public'; import { GraphStore } from '../state_management'; import { GraphWorkspaceSavedObject, IndexPatternSavedObject, Workspace } from '../types'; -import { getSavedWorkspace } from './saved_workspace_utils'; - -interface UseWorkspaceLoaderProps { +import { getEmptyWorkspace, getSavedWorkspace } from './saved_workspace_utils'; +import { getEditUrl } from '../services/url'; +import { SpacesApi } from '../../../spaces/public'; +export interface UseWorkspaceLoaderProps { store: GraphStore; workspaceRef: React.MutableRefObject; savedObjectsClient: SavedObjectsClientContract; - toastNotifications: ToastsStart; + coreStart: CoreStart; + spaces?: SpacesApi; } interface WorkspaceUrlParams { id?: string; } +export interface SharingSavedObjectProps { + outcome?: 'aliasMatch' | 'exactMatch' | 'conflict'; + aliasTargetId?: string; +} + +interface WorkspaceLoadedState { + savedWorkspace: GraphWorkspaceSavedObject; + indexPatterns: IndexPatternSavedObject[]; + sharingSavedObjectProps?: SharingSavedObjectProps; +} export const useWorkspaceLoader = ({ + coreStart, + spaces, workspaceRef, store, savedObjectsClient, - toastNotifications, }: UseWorkspaceLoaderProps) => { - const [indexPatterns, setIndexPatterns] = useState(); - const [savedWorkspace, setSavedWorkspace] = useState(); - const history = useHistory(); - const location = useLocation(); + const [state, setState] = useState(); + const { replace: historyReplace } = useHistory(); + const { search } = useLocation(); const { id } = useParams(); /** @@ -41,7 +54,7 @@ export const useWorkspaceLoader = ({ * on changes in id parameter and URL query only. */ useEffect(() => { - const urlQuery = new URLSearchParams(location.search).get('query'); + const urlQuery = new URLSearchParams(search).get('query'); function loadWorkspace( fetchedSavedWorkspace: GraphWorkspaceSavedObject, @@ -71,24 +84,43 @@ export const useWorkspaceLoader = ({ .then((response) => response.savedObjects); } - async function fetchSavedWorkspace() { - return (id + async function fetchSavedWorkspace(): Promise<{ + savedObject: GraphWorkspaceSavedObject; + sharingSavedObjectProps?: SharingSavedObjectProps; + }> { + return id ? await getSavedWorkspace(savedObjectsClient, id).catch(function (e) { - toastNotifications.addError(e, { + coreStart.notifications.toasts.addError(e, { title: i18n.translate('xpack.graph.missingWorkspaceErrorMessage', { defaultMessage: "Couldn't load graph with ID", }), }); - history.replace('/home'); + historyReplace('/home'); // return promise that never returns to prevent the controller from loading return new Promise(() => {}); }) - : await getSavedWorkspace(savedObjectsClient)) as GraphWorkspaceSavedObject; + : getEmptyWorkspace(); } async function initializeWorkspace() { const fetchedIndexPatterns = await fetchIndexPatterns(); - const fetchedSavedWorkspace = await fetchSavedWorkspace(); + const { + savedObject: fetchedSavedWorkspace, + sharingSavedObjectProps: fetchedSharingSavedObjectProps, + } = await fetchSavedWorkspace(); + + if (spaces && fetchedSharingSavedObjectProps?.outcome === 'aliasMatch') { + // We found this object by a legacy URL alias from its old ID; redirect the user to the page with its new ID, preserving any URL hash + const newObjectId = fetchedSharingSavedObjectProps?.aliasTargetId!; // This is always defined if outcome === 'aliasMatch' + const newPath = getEditUrl(coreStart.http.basePath.prepend, { id: newObjectId }) + search; + spaces.ui.redirectLegacyUrl( + newPath, + i18n.translate('xpack.graph.legacyUrlConflict.objectNoun', { + defaultMessage: 'Graph', + }) + ); + return null; + } /** * Deal with situation of request to open saved workspace. Otherwise clean up store, @@ -99,22 +131,25 @@ export const useWorkspaceLoader = ({ } else if (workspaceRef.current) { clearStore(); } - - setIndexPatterns(fetchedIndexPatterns); - setSavedWorkspace(fetchedSavedWorkspace); + setState({ + savedWorkspace: fetchedSavedWorkspace, + indexPatterns: fetchedIndexPatterns, + sharingSavedObjectProps: fetchedSharingSavedObjectProps, + }); } initializeWorkspace(); }, [ id, - location, + search, store, - history, + historyReplace, savedObjectsClient, - setSavedWorkspace, - toastNotifications, + setState, + coreStart, workspaceRef, + spaces, ]); - return { savedWorkspace, indexPatterns }; + return state; }; diff --git a/x-pack/plugins/graph/public/plugin.ts b/x-pack/plugins/graph/public/plugin.ts index 1ff9afe505a3b..1c44714a2c498 100644 --- a/x-pack/plugins/graph/public/plugin.ts +++ b/x-pack/plugins/graph/public/plugin.ts @@ -7,6 +7,7 @@ import { i18n } from '@kbn/i18n'; import { BehaviorSubject } from 'rxjs'; +import { SpacesApi } from '../../spaces/public'; import { AppNavLinkStatus, AppUpdater, @@ -44,6 +45,7 @@ export interface GraphPluginStartDependencies { savedObjects: SavedObjectsStart; kibanaLegacy: KibanaLegacyStart; home?: HomePublicPluginStart; + spaces?: SpacesApi; } export class GraphPlugin @@ -110,6 +112,7 @@ export class GraphPlugin overlays: coreStart.overlays, savedObjects: pluginsStart.savedObjects, uiSettings: core.uiSettings, + spaces: pluginsStart.spaces, }); }, }); diff --git a/x-pack/plugins/graph/public/services/url.ts b/x-pack/plugins/graph/public/services/url.ts index e45d1f0d662be..b33fdc82d8642 100644 --- a/x-pack/plugins/graph/public/services/url.ts +++ b/x-pack/plugins/graph/public/services/url.ts @@ -18,13 +18,13 @@ export function getNewPath() { return '/workspace'; } -export function getEditPath({ id }: GraphWorkspaceSavedObject) { +export function getEditPath({ id }: Pick) { return `/workspace/${id}`; } export function getEditUrl( addBasePath: (url: string) => string, - workspace: GraphWorkspaceSavedObject + workspace: Pick ) { return addBasePath(`#${getEditPath(workspace)}`); } diff --git a/x-pack/plugins/graph/public/services/workspace/graph_client_workspace.js b/x-pack/plugins/graph/public/services/workspace/graph_client_workspace.js index c849a25cb19bb..a1c85f8eaf80f 100644 --- a/x-pack/plugins/graph/public/services/workspace/graph_client_workspace.js +++ b/x-pack/plugins/graph/public/services/workspace/graph_client_workspace.js @@ -559,7 +559,7 @@ function GraphWorkspace(options) { } if (self.changeHandler) { // Hook to allow any client to respond to position changes - // e.g. angular adjusts and repaints node positions on screen. + // e.g. react adjusts and repaints node positions on screen. self.changeHandler(); } }); diff --git a/x-pack/plugins/graph/public/state_management/fields.ts b/x-pack/plugins/graph/public/state_management/fields.ts index 3a117fa6fe50a..34b1a74510e1a 100644 --- a/x-pack/plugins/graph/public/state_management/fields.ts +++ b/x-pack/plugins/graph/public/state_management/fields.ts @@ -65,7 +65,7 @@ export const hasFieldsSelector = createSelector( ); /** - * Saga making notifying angular when fields are selected to re-calculate the state of the save button. + * Saga making notifying react when fields are selected to re-calculate the state of the save button. * * Won't be necessary once the workspace is moved to redux */ diff --git a/x-pack/plugins/graph/public/state_management/legacy.test.ts b/x-pack/plugins/graph/public/state_management/legacy.test.ts index 5a05efdc478fc..fd5d31404f75b 100644 --- a/x-pack/plugins/graph/public/state_management/legacy.test.ts +++ b/x-pack/plugins/graph/public/state_management/legacy.test.ts @@ -80,7 +80,7 @@ describe('legacy sync sagas', () => { expect(env.mockedDeps.notifyReact).toHaveBeenCalled(); }); - it('notifies angular when fields are selected', () => { + it('notifies react when fields are selected', () => { env.store.dispatch(selectField('field1')); expect(env.mockedDeps.notifyReact).toHaveBeenCalled(); }); diff --git a/x-pack/plugins/graph/server/saved_objects/graph_workspace.ts b/x-pack/plugins/graph/server/saved_objects/graph_workspace.ts index b935302fd3a88..beb7dbf921e20 100644 --- a/x-pack/plugins/graph/server/saved_objects/graph_workspace.ts +++ b/x-pack/plugins/graph/server/saved_objects/graph_workspace.ts @@ -10,7 +10,8 @@ import { graphMigrations } from './migrations'; export const graphWorkspace: SavedObjectsType = { name: 'graph-workspace', - namespaceType: 'single', + namespaceType: 'multiple-isolated', + convertToMultiNamespaceTypeVersion: '8.0.0', hidden: false, management: { icon: 'graphApp', diff --git a/x-pack/plugins/graph/tsconfig.json b/x-pack/plugins/graph/tsconfig.json index d655f28c4e46e..6a5623b311d5e 100644 --- a/x-pack/plugins/graph/tsconfig.json +++ b/x-pack/plugins/graph/tsconfig.json @@ -24,6 +24,7 @@ { "path": "../../../src/plugins/kibana_legacy/tsconfig.json"}, { "path": "../../../src/plugins/home/tsconfig.json"}, { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_react/tsconfig.json" } + { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, + { "path": "../spaces/tsconfig.json" } ] } diff --git a/x-pack/plugins/grokdebugger/jest.config.js b/x-pack/plugins/grokdebugger/jest.config.js index 3785cec03b410..56cd0339a7afd 100644 --- a/x-pack/plugins/grokdebugger/jest.config.js +++ b/x-pack/plugins/grokdebugger/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/grokdebugger'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/grokdebugger', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/grokdebugger/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/index_lifecycle_management/jest.config.js b/x-pack/plugins/index_lifecycle_management/jest.config.js index 94bbdbdc71e74..ec594e214106d 100644 --- a/x-pack/plugins/index_lifecycle_management/jest.config.js +++ b/x-pack/plugins/index_lifecycle_management/jest.config.js @@ -9,4 +9,10 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/index_lifecycle_management'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/index_lifecycle_management', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/index_lifecycle_management/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/index_management/jest.config.js b/x-pack/plugins/index_management/jest.config.js index 8c7eef134d9bf..8cd0af1f81147 100644 --- a/x-pack/plugins/index_management/jest.config.js +++ b/x-pack/plugins/index_management/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/index_management'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/index_management', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/index_management/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/infra/common/http_api/metrics_api.ts b/x-pack/plugins/infra/common/http_api/metrics_api.ts index 94d26abc701fe..c2449707647d7 100644 --- a/x-pack/plugins/infra/common/http_api/metrics_api.ts +++ b/x-pack/plugins/infra/common/http_api/metrics_api.ts @@ -78,7 +78,9 @@ export const MetricsAPISeriesRT = rt.intersection([ ]); export const MetricsAPIResponseRT = rt.type({ - series: rt.array(MetricsAPISeriesRT), + series: rt.array( + rt.intersection([MetricsAPISeriesRT, rt.partial({ metricsets: rt.array(rt.string) })]) + ), info: MetricsAPIPageInfoRT, }); diff --git a/x-pack/plugins/infra/jest.config.js b/x-pack/plugins/infra/jest.config.js index ccc2f5b693a20..5631bc25a1452 100644 --- a/x-pack/plugins/infra/jest.config.js +++ b/x-pack/plugins/infra/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/infra'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/infra', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/infra/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/infra/public/alerting/inventory/index.ts b/x-pack/plugins/infra/public/alerting/inventory/index.ts index 7d370c7106cb7..5e3c8a219ae47 100644 --- a/x-pack/plugins/infra/public/alerting/inventory/index.ts +++ b/x-pack/plugins/infra/public/alerting/inventory/index.ts @@ -31,7 +31,7 @@ export function createInventoryMetricAlertType(): ObservabilityRuleTypeModel import('./components/expression')), validate: validateMetricThreshold, diff --git a/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx b/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx index 969845ada1be0..47ba580c272bd 100644 --- a/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx +++ b/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion.tsx @@ -17,6 +17,7 @@ import { EuiFieldText, EuiButtonIcon, EuiFormRow, + EuiComboBox, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { isNumber, isFinite } from 'lodash'; @@ -112,7 +113,7 @@ export const Criterion: React.FC = ({ const fieldOptions = useMemo(() => { return fields.map((field) => { - return { value: field.name, text: field.name }; + return { label: field.name }; }); }, [fields]); @@ -129,8 +130,14 @@ export const Criterion: React.FC = ({ }, [fieldInfo]); const handleFieldChange = useCallback( - (e) => { - const fieldName = e.target.value; + ([selectedOption]) => { + if (!selectedOption) { + updateCriterion(idx, { field: '' }); + return; + } + + const fieldName = selectedOption.label; + const nextFieldInfo = getFieldInfo(fields, fieldName); // If the field information we're dealing with has changed, reset the comparator and value. if ( @@ -146,10 +153,14 @@ export const Criterion: React.FC = ({ } else { updateCriterion(idx, { field: fieldName }); } + + setIsFieldPopoverOpen(false); }, [fieldInfo, fields, idx, updateCriterion] ); + const selectedField = criterion.field ? [{ label: criterion.field }] : []; + return ( @@ -181,13 +192,19 @@ export const Criterion: React.FC = ({ >
    {criterionFieldTitle} - 0} error={errors.field}> - 0} + error={errors.field} + > +
    diff --git a/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion_preview_chart.tsx b/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion_preview_chart.tsx index 4fa96ea6828d4..0ad6378a22960 100644 --- a/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion_preview_chart.tsx +++ b/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion_preview_chart.tsx @@ -197,14 +197,11 @@ const CriterionPreviewChart: React.FC = ({ const hasData = series.length > 0; const { yMin, yMax, xMin, xMax } = getDomain(filteredSeries, isStacked); const chartDomain = { - max: - showThreshold && threshold && threshold.value - ? Math.max(yMax, threshold.value) * 1.1 - : yMax * 1.1, // Add 10% headroom. - min: showThreshold && threshold && threshold.value ? Math.min(yMin, threshold.value) : yMin, + max: showThreshold && threshold ? Math.max(yMax, threshold.value) * 1.1 : yMax * 1.1, // Add 10% headroom. + min: showThreshold && threshold ? Math.min(yMin, threshold.value) : yMin, }; - if (showThreshold && threshold && threshold.value && chartDomain.min === threshold.value) { + if (showThreshold && threshold && chartDomain.min === threshold.value) { chartDomain.min = chartDomain.min * 0.9; // Allow some padding so the threshold annotation has better visibility } @@ -246,7 +243,7 @@ const CriterionPreviewChart: React.FC = ({ }} color={!isGrouped ? colorTransformer(Color.color0) : undefined} /> - {showThreshold && threshold && threshold.value ? ( + {showThreshold && threshold ? ( = ({ }} /> ) : null} - {showThreshold && threshold && threshold.value && isBelow ? ( + {showThreshold && threshold && isBelow ? ( = ({ ]} /> ) : null} - {showThreshold && threshold && threshold.value && isAbove ? ( + {showThreshold && threshold && isAbove ? ( = ({ comparator, value, updateThreshold, setThresholdPopoverOpenState(!isThresholdPopoverOpen)} /> diff --git a/x-pack/plugins/infra/public/alerting/log_threshold/log_threshold_alert_type.ts b/x-pack/plugins/infra/public/alerting/log_threshold/log_threshold_alert_type.ts index b944b36fb9d1a..c6b2385f93c65 100644 --- a/x-pack/plugins/infra/public/alerting/log_threshold/log_threshold_alert_type.ts +++ b/x-pack/plugins/infra/public/alerting/log_threshold/log_threshold_alert_type.ts @@ -23,7 +23,7 @@ export function createLogThresholdAlertType(): ObservabilityRuleTypeModel import('./components/expression_editor/editor')), validate: validateExpression, diff --git a/x-pack/plugins/infra/public/alerting/metric_threshold/index.ts b/x-pack/plugins/infra/public/alerting/metric_threshold/index.ts index 2dd35c20a5632..679019eb2e520 100644 --- a/x-pack/plugins/infra/public/alerting/metric_threshold/index.ts +++ b/x-pack/plugins/infra/public/alerting/metric_threshold/index.ts @@ -29,7 +29,7 @@ export function createMetricThresholdAlertType(): ObservabilityRuleTypeModel import('./components/expression')), validate: validateMetricThreshold, diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/bottom_drawer.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/bottom_drawer.tsx index fe0fbeecf8408..31bc09f9d4dd8 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/bottom_drawer.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/bottom_drawer.tsx @@ -5,11 +5,12 @@ * 2.0. */ -import React, { useCallback, useState } from 'react'; +import React, { useCallback, useState, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiFlexGroup, EuiFlexItem, EuiButtonEmpty, EuiSpacer } from '@elastic/eui'; import { euiStyled } from '../../../../../../../../src/plugins/kibana_react/common'; import { useUiTracker } from '../../../../../../observability/public'; +import { useWaffleOptionsContext } from '../hooks/use_waffle_options'; import { InfraFormatter } from '../../../../lib/lib'; import { Timeline } from './timeline/timeline'; @@ -28,13 +29,20 @@ export const BottomDrawer: React.FC<{ formatter: InfraFormatter; width: number; }> = ({ measureRef, width, interval, formatter, children }) => { - const [isOpen, setIsOpen] = useState(false); + const { timelineOpen, changeTimelineOpen } = useWaffleOptionsContext(); + + const [isOpen, setIsOpen] = useState(Boolean(timelineOpen)); + + useEffect(() => { + if (isOpen !== timelineOpen) setIsOpen(Boolean(timelineOpen)); + }, [isOpen, timelineOpen]); const trackDrawerOpen = useUiTracker({ app: 'infra_metrics' }); const onClick = useCallback(() => { if (!isOpen) trackDrawerOpen({ metric: 'open_timeline_drawer__inventory' }); setIsOpen(!isOpen); - }, [isOpen, trackDrawerOpen]); + changeTimelineOpen(!isOpen); + }, [isOpen, trackDrawerOpen, changeTimelineOpen]); return ( diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/conditional_tooltip.test.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/conditional_tooltip.test.tsx index ac4fac394dacc..d8b578769a1cb 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/conditional_tooltip.test.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/conditional_tooltip.test.tsx @@ -130,6 +130,7 @@ const mockedUseWaffleOptionsContexReturnValue: ReturnType {}), changeLegend: jest.fn(() => {}), changeSort: jest.fn(() => {}), + changeTimelineOpen: jest.fn(() => {}), setWaffleOptionsState: jest.fn(() => {}), boundsOverride: { max: 1, min: 0 }, autoBounds: true, diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_options.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_options.ts index 0ba8398fa4c42..8767be4f8a27e 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_options.ts +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_options.ts @@ -44,6 +44,7 @@ export const DEFAULT_WAFFLE_OPTIONS_STATE: WaffleOptionsState = { legend: DEFAULT_LEGEND, source: 'default', sort: { by: 'name', direction: 'desc' }, + timelineOpen: false, }; export const useWaffleOptions = () => { @@ -134,6 +135,11 @@ export const useWaffleOptions = () => { setCustomMetrics(state.customMetrics); }, [state, inventoryPrefill]); + const changeTimelineOpen = useCallback( + (timelineOpen: boolean) => setState((previous) => ({ ...previous, timelineOpen })), + [setState] + ); + return { ...DEFAULT_WAFFLE_OPTIONS_STATE, ...state, @@ -149,6 +155,7 @@ export const useWaffleOptions = () => { changeCustomMetrics, changeLegend, changeSort, + changeTimelineOpen, setWaffleOptionsState: setState, }; }; @@ -188,7 +195,7 @@ export const WaffleOptionsStateRT = rt.intersection([ customMetrics: rt.array(SnapshotCustomMetricInputRT), sort: WaffleSortOptionRT, }), - rt.partial({ source: rt.string, legend: WaffleLegendOptionsRT }), + rt.partial({ source: rt.string, legend: WaffleLegendOptionsRT, timelineOpen: rt.boolean }), ]); export type WaffleSortOption = rt.TypeOf; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_view_state.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_view_state.ts index 91f1859899177..02a2144f1282e 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_view_state.ts +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_view_state.ts @@ -39,6 +39,7 @@ export const useWaffleViewState = () => { region, legend, sort, + timelineOpen, setWaffleOptionsState, } = useWaffleOptionsContext(); const { currentTime, isAutoReloading, setWaffleTimeState } = useWaffleTimeContext(); @@ -60,6 +61,7 @@ export const useWaffleViewState = () => { autoReload: isAutoReloading, filterQuery, legend, + timelineOpen, }; const onViewChange = useCallback( @@ -77,6 +79,7 @@ export const useWaffleViewState = () => { accountId: newState.accountId, region: newState.region, legend: newState.legend, + timelineOpen: newState.timelineOpen, }); if (newState.time) { diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/create_timerange.test.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/create_timerange.test.ts new file mode 100644 index 0000000000000..5640a1d928436 --- /dev/null +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/create_timerange.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 { createTimerange } from './create_timerange'; +import { Aggregators } from '../types'; +import moment from 'moment'; + +describe('createTimerange(interval, aggType, timeframe)', () => { + describe('without timeframe', () => { + describe('Basic Metric Aggs', () => { + it('should return a second range for last 1 second', () => { + const subject = createTimerange(1000, Aggregators.COUNT); + expect(subject.end - subject.start).toEqual(1000); + }); + it('should return a minute range for last 1 minute', () => { + const subject = createTimerange(60000, Aggregators.COUNT); + expect(subject.end - subject.start).toEqual(60000); + }); + it('should return 5 minute range for last 5 minutes', () => { + const subject = createTimerange(300000, Aggregators.COUNT); + expect(subject.end - subject.start).toEqual(300000); + }); + it('should return a hour range for last 1 hour', () => { + const subject = createTimerange(3600000, Aggregators.COUNT); + expect(subject.end - subject.start).toEqual(3600000); + }); + it('should return a day range for last 1 day', () => { + const subject = createTimerange(86400000, Aggregators.COUNT); + expect(subject.end - subject.start).toEqual(86400000); + }); + }); + describe('Rate Aggs', () => { + it('should return a 20 second range for last 1 second', () => { + const subject = createTimerange(1000, Aggregators.RATE); + expect(subject.end - subject.start).toEqual(1000 * 5); + }); + it('should return a 5 minute range for last 1 minute', () => { + const subject = createTimerange(60000, Aggregators.RATE); + expect(subject.end - subject.start).toEqual(60000 * 5); + }); + it('should return 25 minute range for last 5 minutes', () => { + const subject = createTimerange(300000, Aggregators.RATE); + expect(subject.end - subject.start).toEqual(300000 * 5); + }); + it('should return 5 hour range for last hour', () => { + const subject = createTimerange(3600000, Aggregators.RATE); + expect(subject.end - subject.start).toEqual(3600000 * 5); + }); + it('should return a 5 day range for last day', () => { + const subject = createTimerange(86400000, Aggregators.RATE); + expect(subject.end - subject.start).toEqual(86400000 * 5); + }); + }); + }); + describe('with full timeframe', () => { + describe('Basic Metric Aggs', () => { + it('should return 5 minute range when given 4 minute timeframe', () => { + const end = moment(); + const timeframe = { + start: end.clone().subtract(4, 'minutes').valueOf(), + end: end.valueOf(), + }; + const subject = createTimerange(300000, Aggregators.COUNT, timeframe); + expect(subject.end - subject.start).toEqual(300000); + }); + it('should return 6 minute range when given 6 minute timeframe', () => { + const end = moment(); + const timeframe = { + start: end.clone().subtract(6, 'minutes').valueOf(), + end: end.valueOf(), + }; + const subject = createTimerange(300000, Aggregators.COUNT, timeframe); + expect(subject.end - subject.start).toEqual(360000); + }); + }); + describe('Rate Aggs', () => { + it('should return 25 minute range when given 4 minute timeframe', () => { + const end = moment(); + const timeframe = { + start: end.clone().subtract(4, 'minutes').valueOf(), + end: end.valueOf(), + }; + const subject = createTimerange(300000, Aggregators.RATE, timeframe); + expect(subject.end - subject.start).toEqual(300000 * 5); + }); + it('should return 25 minute range when given 6 minute timeframe', () => { + const end = moment(); + const timeframe = { + start: end.clone().subtract(6, 'minutes').valueOf(), + end: end.valueOf(), + }; + const subject = createTimerange(300000, Aggregators.RATE, timeframe); + expect(subject.end - subject.start).toEqual(300000 * 5); + }); + }); + }); + describe('with partial timeframe', () => { + describe('Basic Metric Aggs', () => { + it('should return 5 minute range for last 5 minutes', () => { + const end = moment(); + const timeframe = { + end: end.valueOf(), + }; + const subject = createTimerange(300000, Aggregators.AVERAGE, timeframe); + expect(subject).toEqual({ + start: end.clone().subtract(5, 'minutes').valueOf(), + end: end.valueOf(), + }); + }); + }); + describe('Rate Aggs', () => { + it('should return 25 minute range for last 5 minutes', () => { + const end = moment(); + const timeframe = { + end: end.valueOf(), + }; + const subject = createTimerange(300000, Aggregators.RATE, timeframe); + expect(subject).toEqual({ + start: end + .clone() + .subtract(300 * 5, 'seconds') + .valueOf(), + end: end.valueOf(), + }); + }); + }); + }); +}); diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/create_timerange.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/create_timerange.ts new file mode 100644 index 0000000000000..cca63aca14d09 --- /dev/null +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/create_timerange.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 moment from 'moment'; +import { Aggregators } from '../types'; + +export const createTimerange = ( + interval: number, + aggType: Aggregators, + timeframe?: { end: number; start?: number } +) => { + const to = moment(timeframe ? timeframe.end : Date.now()).valueOf(); + + // Rate aggregations need 5 buckets worth of data + const minimumBuckets = aggType === Aggregators.RATE ? 5 : 1; + + const calculatedFrom = to - interval * minimumBuckets; + + // Use either the timeframe.start when the start is less then calculatedFrom + // OR use the calculatedFrom + const from = + timeframe && timeframe.start && timeframe.start <= calculatedFrom + ? timeframe.start + : calculatedFrom; + + return { start: from, end: to }; +}; diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_alert.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_alert.ts index 9a8f2267e7efe..a099b83fdb423 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_alert.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_alert.ts @@ -13,7 +13,6 @@ import { TOO_MANY_BUCKETS_PREVIEW_EXCEPTION, } from '../../../../../common/alerting/metrics'; import { getIntervalInSeconds } from '../../../../utils/get_interval_in_seconds'; -import { roundTimestamp } from '../../../../utils/round_timestamp'; import { InfraSource } from '../../../../../common/source_configuration/source_configuration'; import { InfraDatabaseSearchResponse } from '../../../adapters/framework/adapter_types'; import { createAfterKeyHandler } from '../../../../utils/create_afterkey_handler'; @@ -22,6 +21,7 @@ import { DOCUMENT_COUNT_I18N } from '../../common/messages'; import { UNGROUPED_FACTORY_KEY } from '../../common/utils'; import { MetricExpressionParams, Comparator, Aggregators } from '../types'; import { getElasticsearchMetricQuery } from './metric_query'; +import { createTimerange } from './create_timerange'; interface AggregationWithoutIntervals { aggregatedValue: { value: number; values?: Array<{ key: number; value: number }> }; @@ -135,23 +135,12 @@ const getMetric: ( const interval = `${timeSize}${timeUnit}`; const intervalAsSeconds = getIntervalInSeconds(interval); const intervalAsMS = intervalAsSeconds * 1000; - - const to = moment(timeframe ? timeframe.end : Date.now()).valueOf(); - - // Rate aggregations need 5 buckets worth of data - const minimumBuckets = aggType === Aggregators.RATE ? 5 : 1; - - const minimumFrom = to - intervalAsMS * minimumBuckets; - - const from = roundTimestamp( - timeframe && timeframe.start && timeframe.start <= minimumFrom ? timeframe.start : minimumFrom, - timeUnit - ); + const calculatedTimerange = createTimerange(intervalAsMS, aggType, timeframe); const searchBody = getElasticsearchMetricQuery( params, timefield, - { start: from, end: to }, + calculatedTimerange, hasGroupBy ? groupBy : undefined, filterQuery ); @@ -160,8 +149,8 @@ const getMetric: ( // Rate aggs always drop partial buckets; guard against this boolean being passed as false shouldDropPartialBuckets || aggType === Aggregators.RATE ? { - from, - to, + from: calculatedTimerange.start, + to: calculatedTimerange.end, bucketSizeInMillis: intervalAsMS, } : null; @@ -191,10 +180,7 @@ const getMetric: ( bucket, aggType, dropPartialBucketsOptions, - { - start: from, - end: to, - }, + calculatedTimerange, bucket.doc_count ), }), @@ -212,7 +198,7 @@ const getMetric: ( (result.aggregations! as unknown) as Aggregation, aggType, dropPartialBucketsOptions, - { start: from, end: to }, + calculatedTimerange, isNumber(result.hits.total) ? result.hits.total : result.hits.total.value ), }; diff --git a/x-pack/plugins/infra/server/lib/metrics/index.ts b/x-pack/plugins/infra/server/lib/metrics/index.ts index a2d9ad2b401d4..131f6944b0484 100644 --- a/x-pack/plugins/infra/server/lib/metrics/index.ts +++ b/x-pack/plugins/infra/server/lib/metrics/index.ts @@ -91,12 +91,14 @@ export const query = async ( return { series: groupings.buckets.map((bucket) => { const keys = Object.values(bucket.key); - return convertHistogramBucketsToTimeseries( + const metricsetNames = bucket.metricsets.buckets.map((m) => m.key); + const timeseries = convertHistogramBucketsToTimeseries( keys, options, bucket.histogram.buckets, bucketSize * 1000 ); + return { ...timeseries, metricsets: metricsetNames }; }), info: { afterKey: returnAfterKey ? afterKey : null, diff --git a/x-pack/plugins/infra/server/lib/metrics/lib/__snapshots__/create_aggregations.test.ts.snap b/x-pack/plugins/infra/server/lib/metrics/lib/__snapshots__/create_aggregations.test.ts.snap index c7acfb147aa7e..d35d7ce1a4b81 100644 --- a/x-pack/plugins/infra/server/lib/metrics/lib/__snapshots__/create_aggregations.test.ts.snap +++ b/x-pack/plugins/infra/server/lib/metrics/lib/__snapshots__/create_aggregations.test.ts.snap @@ -20,6 +20,11 @@ Object { "offset": "-60000ms", }, }, + "metricsets": Object { + "terms": Object { + "field": "metricset.name", + }, + }, } `; @@ -45,6 +50,11 @@ Object { "offset": "0s", }, }, + "metricsets": Object { + "terms": Object { + "field": "metricset.name", + }, + }, }, "composite": Object { "size": 20, @@ -82,5 +92,10 @@ Object { "offset": "0s", }, }, + "metricsets": Object { + "terms": Object { + "field": "metricset.name", + }, + }, } `; diff --git a/x-pack/plugins/infra/server/lib/metrics/lib/create_aggregations.ts b/x-pack/plugins/infra/server/lib/metrics/lib/create_aggregations.ts index 1fb87499b8f44..65cd4ebe2d501 100644 --- a/x-pack/plugins/infra/server/lib/metrics/lib/create_aggregations.ts +++ b/x-pack/plugins/infra/server/lib/metrics/lib/create_aggregations.ts @@ -25,6 +25,11 @@ export const createAggregations = (options: MetricsAPIRequest) => { }, aggregations: createMetricsAggregations(options), }, + metricsets: { + terms: { + field: 'metricset.name', + }, + }, }; if (Array.isArray(options.groupBy) && options.groupBy.length) { diff --git a/x-pack/plugins/infra/server/lib/metrics/types.ts b/x-pack/plugins/infra/server/lib/metrics/types.ts index e1f5ecd45e363..b18486f88cc4c 100644 --- a/x-pack/plugins/infra/server/lib/metrics/types.ts +++ b/x-pack/plugins/infra/server/lib/metrics/types.ts @@ -63,6 +63,14 @@ export const HistogramResponseRT = rt.type({ histogram: rt.type({ buckets: rt.array(HistogramBucketRT), }), + metricsets: rt.type({ + buckets: rt.array( + rt.type({ + key: rt.string, + doc_count: rt.number, + }) + ), + }), }); const GroupingBucketRT = rt.intersection([ diff --git a/x-pack/plugins/infra/server/routes/snapshot/lib/get_nodes.ts b/x-pack/plugins/infra/server/routes/snapshot/lib/get_nodes.ts index 0fef75faed07e..f59756e0c5b25 100644 --- a/x-pack/plugins/infra/server/routes/snapshot/lib/get_nodes.ts +++ b/x-pack/plugins/infra/server/routes/snapshot/lib/get_nodes.ts @@ -10,7 +10,7 @@ import { ESSearchClient } from '../../../lib/metrics/types'; import { InfraSource } from '../../../lib/sources'; import { transformRequestToMetricsAPIRequest } from './transform_request_to_metrics_api_request'; import { queryAllData } from './query_all_data'; -import { transformMetricsApiResponseToSnapshotResponse } from './trasform_metrics_ui_response'; +import { transformMetricsApiResponseToSnapshotResponse } from './transform_metrics_ui_response'; import { copyMissingMetrics } from './copy_missing_metrics'; import { LogQueryFields } from '../../../services/log_queries/get_log_query_fields'; diff --git a/x-pack/plugins/infra/server/routes/snapshot/lib/transform_metrics_ui_response.test.ts b/x-pack/plugins/infra/server/routes/snapshot/lib/transform_metrics_ui_response.test.ts new file mode 100644 index 0000000000000..159f6d0b646ec --- /dev/null +++ b/x-pack/plugins/infra/server/routes/snapshot/lib/transform_metrics_ui_response.test.ts @@ -0,0 +1,73 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { transformMetricsApiResponseToSnapshotResponse } from './transform_metrics_ui_response'; + +jest.mock('./apply_metadata_to_last_path', () => ({ + applyMetadataToLastPath: (series: any) => [{ label: series.id }], +})); + +const now = 1630597319235; + +describe('transformMetricsApiResponseToSnapshotResponse', () => { + test('filters out nodes from APM which report no data', () => { + const result = transformMetricsApiResponseToSnapshotResponse( + { + // @ts-ignore + metrics: [{ id: 'cpu' }], + }, + { + includeTimeseries: false, + nodeType: 'host', + }, + {}, + { + info: { + interval: 60, + }, + series: [ + { + metricsets: ['app'], + id: 'apm-node-with-no-data', + columns: [], + rows: [ + { + timestamp: now, + cpu: null, + }, + ], + }, + { + metricsets: ['app'], + id: 'apm-node-with-data', + columns: [], + rows: [ + { + timestamp: now, + cpu: 1.0, + }, + ], + }, + { + metricsets: ['cpu'], + id: 'metricbeat-node', + columns: [], + rows: [ + { + timestamp: now, + cpu: 1.0, + }, + ], + }, + ], + } + ); + const nodeNames = result.nodes.map((n) => n.name); + expect(nodeNames).toEqual(expect.arrayContaining(['metricbeat-node', 'apm-node-with-data'])); + expect(nodeNames).not.toEqual(expect.arrayContaining(['apm-node'])); + }); +}); diff --git a/x-pack/plugins/infra/server/routes/snapshot/lib/transform_metrics_ui_response.ts b/x-pack/plugins/infra/server/routes/snapshot/lib/transform_metrics_ui_response.ts new file mode 100644 index 0000000000000..a76093f78e08c --- /dev/null +++ b/x-pack/plugins/infra/server/routes/snapshot/lib/transform_metrics_ui_response.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 { get, max, sum, last, isNumber } from 'lodash'; +import { SnapshotMetricType } from '../../../../common/inventory_models/types'; +import { + MetricsAPIResponse, + SnapshotNodeResponse, + MetricsAPIRequest, + MetricsExplorerColumnType, + MetricsAPIRow, + SnapshotRequest, + SnapshotNodePath, + SnapshotNodeMetric, + SnapshotNode, +} from '../../../../common/http_api'; +import { META_KEY } from './constants'; +import { InfraSource } from '../../../lib/sources'; +import { applyMetadataToLastPath } from './apply_metadata_to_last_path'; + +const getMetricValue = (row: MetricsAPIRow) => { + if (!isNumber(row.metric_0)) return null; + const value = row.metric_0; + return isFinite(value) ? value : null; +}; + +const calculateMax = (rows: MetricsAPIRow[]) => { + return max(rows.map(getMetricValue)) || 0; +}; + +const calculateAvg = (rows: MetricsAPIRow[]): number => { + return sum(rows.map(getMetricValue)) / rows.length || 0; +}; + +const getLastValue = (rows: MetricsAPIRow[]) => { + const row = last(rows); + if (!row) return null; + return getMetricValue(row); +}; + +export const transformMetricsApiResponseToSnapshotResponse = ( + options: MetricsAPIRequest, + snapshotRequest: SnapshotRequest, + source: InfraSource, + metricsApiResponse: MetricsAPIResponse +): SnapshotNodeResponse => { + const nodes = metricsApiResponse.series + .map((series) => { + const node = { + metrics: options.metrics + .filter((m) => m.id !== META_KEY) + .map((metric) => { + const name = metric.id as SnapshotMetricType; + const timeseries = { + id: name, + columns: [ + { name: 'timestamp', type: 'date' as MetricsExplorerColumnType }, + { name: 'metric_0', type: 'number' as MetricsExplorerColumnType }, + ], + rows: series.rows.map((row) => { + return { timestamp: row.timestamp, metric_0: get(row, metric.id, null) }; + }), + }; + const maxValue = calculateMax(timeseries.rows); + const avg = calculateAvg(timeseries.rows); + const value = getLastValue(timeseries.rows); + const nodeMetric: SnapshotNodeMetric = { name, max: maxValue, value, avg }; + if (snapshotRequest.includeTimeseries) { + nodeMetric.timeseries = timeseries; + } + return nodeMetric; + }), + path: + series.keys?.map((key) => { + return { value: key, label: key } as SnapshotNodePath; + }) ?? [], + name: '', + }; + + const isNoData = node.metrics.every((m) => m.value === null); + const isAPMNode = series.metricsets?.includes('app'); + if (isNoData && isAPMNode) return null; + + const path = applyMetadataToLastPath(series, node, snapshotRequest, source); + const lastPath = last(path); + const name = lastPath?.label ?? 'N/A'; + + return { ...node, path, name }; + }) + .filter((n) => n !== null) as SnapshotNode[]; + return { nodes, interval: `${metricsApiResponse.info.interval}s` }; +}; diff --git a/x-pack/plugins/infra/server/routes/snapshot/lib/trasform_metrics_ui_response.ts b/x-pack/plugins/infra/server/routes/snapshot/lib/trasform_metrics_ui_response.ts deleted file mode 100644 index 21b3e07e83588..0000000000000 --- a/x-pack/plugins/infra/server/routes/snapshot/lib/trasform_metrics_ui_response.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 { get, max, sum, last, isNumber } from 'lodash'; -import { SnapshotMetricType } from '../../../../common/inventory_models/types'; -import { - MetricsAPIResponse, - SnapshotNodeResponse, - MetricsAPIRequest, - MetricsExplorerColumnType, - MetricsAPIRow, - SnapshotRequest, - SnapshotNodePath, - SnapshotNodeMetric, -} from '../../../../common/http_api'; -import { META_KEY } from './constants'; -import { InfraSource } from '../../../lib/sources'; -import { applyMetadataToLastPath } from './apply_metadata_to_last_path'; - -const getMetricValue = (row: MetricsAPIRow) => { - if (!isNumber(row.metric_0)) return null; - const value = row.metric_0; - return isFinite(value) ? value : null; -}; - -const calculateMax = (rows: MetricsAPIRow[]) => { - return max(rows.map(getMetricValue)) || 0; -}; - -const calculateAvg = (rows: MetricsAPIRow[]): number => { - return sum(rows.map(getMetricValue)) / rows.length || 0; -}; - -const getLastValue = (rows: MetricsAPIRow[]) => { - const row = last(rows); - if (!row) return null; - return getMetricValue(row); -}; - -export const transformMetricsApiResponseToSnapshotResponse = ( - options: MetricsAPIRequest, - snapshotRequest: SnapshotRequest, - source: InfraSource, - metricsApiResponse: MetricsAPIResponse -): SnapshotNodeResponse => { - const nodes = metricsApiResponse.series.map((series) => { - const node = { - metrics: options.metrics - .filter((m) => m.id !== META_KEY) - .map((metric) => { - const name = metric.id as SnapshotMetricType; - const timeseries = { - id: name, - columns: [ - { name: 'timestamp', type: 'date' as MetricsExplorerColumnType }, - { name: 'metric_0', type: 'number' as MetricsExplorerColumnType }, - ], - rows: series.rows.map((row) => { - return { timestamp: row.timestamp, metric_0: get(row, metric.id, null) }; - }), - }; - const maxValue = calculateMax(timeseries.rows); - const avg = calculateAvg(timeseries.rows); - const value = getLastValue(timeseries.rows); - const nodeMetric: SnapshotNodeMetric = { name, max: maxValue, value, avg }; - if (snapshotRequest.includeTimeseries) { - nodeMetric.timeseries = timeseries; - } - return nodeMetric; - }), - path: - series.keys?.map((key) => { - return { value: key, label: key } as SnapshotNodePath; - }) ?? [], - name: '', - }; - - const path = applyMetadataToLastPath(series, node, snapshotRequest, source); - const lastPath = last(path); - const name = (lastPath && lastPath.label) || 'N/A'; - return { ...node, path, name }; - }); - return { nodes, interval: `${metricsApiResponse.info.interval}s` }; -}; diff --git a/x-pack/plugins/ingest_pipelines/jest.config.js b/x-pack/plugins/ingest_pipelines/jest.config.js index ba22288685801..e3e76e54a610d 100644 --- a/x-pack/plugins/ingest_pipelines/jest.config.js +++ b/x-pack/plugins/ingest_pipelines/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/ingest_pipelines'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/ingest_pipelines', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/ingest_pipelines/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/lens/common/expressions/counter_rate/counter_rate.test.ts b/x-pack/plugins/lens/common/expressions/counter_rate/counter_rate.test.ts index 3e1a5ad8e3964..5e41e1e4f95f8 100644 --- a/x-pack/plugins/lens/common/expressions/counter_rate/counter_rate.test.ts +++ b/x-pack/plugins/lens/common/expressions/counter_rate/counter_rate.test.ts @@ -12,10 +12,10 @@ import { functionWrapper } from 'src/plugins/expressions/common/expression_funct describe('lens_counter_rate', () => { const fn = functionWrapper(counterRate); - const runFn = (input: Datatable, args: CounterRateArgs) => fn(input, args) as Datatable; + const runFn = (input: Datatable, args: CounterRateArgs) => fn(input, args) as Promise; - it('calculates counter rate', () => { - const result = runFn( + it('calculates counter rate', async () => { + const result = await runFn( { type: 'datatable', columns: [{ id: 'val', name: 'val', meta: { type: 'number' } }], @@ -31,8 +31,8 @@ describe('lens_counter_rate', () => { expect(result.rows.map((row) => row.output)).toEqual([undefined, 0, 2, 3, 2]); }); - it('calculates counter rate with decreasing values in input', () => { - const result = runFn( + it('calculates counter rate with decreasing values in input', async () => { + const result = await runFn( { type: 'datatable', columns: [{ id: 'val', name: 'val', meta: { type: 'number' } }], @@ -48,8 +48,8 @@ describe('lens_counter_rate', () => { expect(result.rows.map((row) => row.output)).toEqual([undefined, 6, 5, 4]); }); - it('skips null or undefined values until there is real data', () => { - const result = runFn( + it('skips null or undefined values until there is real data', async () => { + const result = await runFn( { type: 'datatable', columns: [{ id: 'val', name: 'val', meta: { type: 'number' } }], @@ -85,8 +85,8 @@ describe('lens_counter_rate', () => { ]); }); - it('treats 0 as real data', () => { - const result = runFn( + it('treats 0 as real data', async () => { + const result = await runFn( { type: 'datatable', columns: [{ id: 'val', name: 'val', meta: { type: 'number' } }], @@ -123,8 +123,8 @@ describe('lens_counter_rate', () => { ]); }); - it('calculates counter rate for multiple series', () => { - const result = runFn( + it('calculates counter rate for multiple series', async () => { + const result = await runFn( { type: 'datatable', columns: [ @@ -157,8 +157,8 @@ describe('lens_counter_rate', () => { ]); }); - it('treats missing split column as separate series', () => { - const result = runFn( + it('treats missing split column as separate series', async () => { + const result = await runFn( { type: 'datatable', columns: [ @@ -190,8 +190,8 @@ describe('lens_counter_rate', () => { ]); }); - it('treats null like undefined and empty string for split columns', () => { - const result = runFn( + it('treats null like undefined and empty string for split columns', async () => { + const result = await runFn( { type: 'datatable', columns: [ @@ -225,8 +225,8 @@ describe('lens_counter_rate', () => { ]); }); - it('calculates counter rate for multiple series by multiple split columns', () => { - const result = runFn( + it('calculates counter rate for multiple series by multiple split columns', async () => { + const result = await runFn( { type: 'datatable', columns: [ @@ -259,8 +259,8 @@ describe('lens_counter_rate', () => { ]); }); - it('splits separate series by the string representation of the cell values', () => { - const result = runFn( + it('splits separate series by the string representation of the cell values', async () => { + const result = await runFn( { type: 'datatable', columns: [ @@ -280,8 +280,8 @@ describe('lens_counter_rate', () => { expect(result.rows.map((row) => row.output)).toEqual([undefined, 2 - 1, undefined, 11 - 10]); }); - it('casts values to number before calculating counter rate', () => { - const result = runFn( + it('casts values to number before calculating counter rate', async () => { + const result = await runFn( { type: 'datatable', columns: [{ id: 'val', name: 'val', meta: { type: 'number' } }], @@ -292,8 +292,8 @@ describe('lens_counter_rate', () => { expect(result.rows.map((row) => row.output)).toEqual([undefined, 7 - 5, 3, 2]); }); - it('casts values to number before calculating counter rate for NaN like values', () => { - const result = runFn( + it('casts values to number before calculating counter rate for NaN like values', async () => { + const result = await runFn( { type: 'datatable', columns: [{ id: 'val', name: 'val', meta: { type: 'number' } }], @@ -304,8 +304,8 @@ describe('lens_counter_rate', () => { expect(result.rows.map((row) => row.output)).toEqual([undefined, 7 - 5, NaN, 2, 5 - 2]); }); - it('copies over meta information from the source column', () => { - const result = runFn( + it('copies over meta information from the source column', async () => { + const result = await runFn( { type: 'datatable', columns: [ @@ -346,8 +346,8 @@ describe('lens_counter_rate', () => { }); }); - it('sets output name on output column if specified', () => { - const result = runFn( + it('sets output name on output column if specified', async () => { + const result = await runFn( { type: 'datatable', columns: [ @@ -370,7 +370,7 @@ describe('lens_counter_rate', () => { }); }); - it('returns source table if input column does not exist', () => { + it('returns source table if input column does not exist', async () => { const input: Datatable = { type: 'datatable', columns: [ @@ -384,12 +384,16 @@ describe('lens_counter_rate', () => { ], rows: [{ val: 5 }], }; - expect(runFn(input, { inputColumnId: 'nonexisting', outputColumnId: 'output' })).toBe(input); + expect(await runFn(input, { inputColumnId: 'nonexisting', outputColumnId: 'output' })).toBe( + input + ); }); - it('throws an error if output column exists already', () => { - expect(() => - runFn( + it('throws an error if output column exists already', async () => { + let error: Error | undefined; + + try { + await runFn( { type: 'datatable', columns: [ @@ -404,7 +408,13 @@ describe('lens_counter_rate', () => { rows: [{ val: 5 }], }, { inputColumnId: 'val', outputColumnId: 'val' } - ) - ).toThrow(); + ); + } catch (e) { + error = e; + } + + expect(error).toMatchInlineSnapshot( + `[Error: Specified outputColumnId val already exists. Please pick another column id.]` + ); }); }); diff --git a/x-pack/plugins/lens/common/expressions/counter_rate/counter_rate_fn.ts b/x-pack/plugins/lens/common/expressions/counter_rate/counter_rate_fn.ts new file mode 100644 index 0000000000000..6412b508b9649 --- /dev/null +++ b/x-pack/plugins/lens/common/expressions/counter_rate/counter_rate_fn.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 { + buildResultColumns, + getBucketIdentifier, +} from '../../../../../../src/plugins/expressions/common'; +import type { CounterRateExpressionFunction } from './types'; + +export const counterRateFn: CounterRateExpressionFunction['fn'] = ( + input, + { by, inputColumnId, outputColumnId, outputColumnName } +) => { + const resultColumns = buildResultColumns(input, outputColumnId, inputColumnId, outputColumnName); + + if (!resultColumns) { + return input; + } + const previousValues: Partial> = {}; + + return { + ...input, + columns: resultColumns, + rows: input.rows.map((row) => { + const newRow = { ...row }; + + const bucketIdentifier = getBucketIdentifier(row, by); + const previousValue = previousValues[bucketIdentifier]; + const currentValue = newRow[inputColumnId]; + if (currentValue != null && previousValue != null) { + const currentValueAsNumber = Number(currentValue); + if (currentValueAsNumber >= previousValue) { + newRow[outputColumnId] = currentValueAsNumber - previousValue; + } else { + newRow[outputColumnId] = currentValueAsNumber; + } + } else { + newRow[outputColumnId] = undefined; + } + + if (currentValue != null) { + previousValues[bucketIdentifier] = Number(currentValue); + } else { + previousValues[bucketIdentifier] = undefined; + } + + return newRow; + }), + }; +}; diff --git a/x-pack/plugins/lens/common/expressions/counter_rate/index.ts b/x-pack/plugins/lens/common/expressions/counter_rate/index.ts index 41f5547dff969..f58b65814768d 100644 --- a/x-pack/plugins/lens/common/expressions/counter_rate/index.ts +++ b/x-pack/plugins/lens/common/expressions/counter_rate/index.ts @@ -6,14 +6,8 @@ */ import { i18n } from '@kbn/i18n'; -import { - getBucketIdentifier, - buildResultColumns, -} from '../../../../../../src/plugins/expressions/common'; -import type { - ExpressionFunctionDefinition, - Datatable, -} from '../../../../../../src/plugins/expressions/common'; + +import type { CounterRateExpressionFunction } from './types'; export interface CounterRateArgs { by?: string[]; @@ -22,13 +16,6 @@ export interface CounterRateArgs { outputColumnName?: string; } -export type ExpressionFunctionCounterRate = ExpressionFunctionDefinition< - 'lens_counter_rate', - Datatable, - CounterRateArgs, - Datatable ->; - /** * Calculates the counter rate of a specified column in the data table. * @@ -59,7 +46,7 @@ export type ExpressionFunctionCounterRate = ExpressionFunctionDefinition< * before comparison. If the values are objects, the return value of their `toString` method will be used for comparison. * Missing values (`null` and `undefined`) will be treated as empty strings. */ -export const counterRate: ExpressionFunctionCounterRate = { +export const counterRate: CounterRateExpressionFunction = { name: 'lens_counter_rate', type: 'datatable', @@ -101,46 +88,9 @@ export const counterRate: ExpressionFunctionCounterRate = { }, }, - fn(input, { by, inputColumnId, outputColumnId, outputColumnName }) { - const resultColumns = buildResultColumns( - input, - outputColumnId, - inputColumnId, - outputColumnName - ); - - if (!resultColumns) { - return input; - } - const previousValues: Partial> = {}; - return { - ...input, - columns: resultColumns, - rows: input.rows.map((row) => { - const newRow = { ...row }; - - const bucketIdentifier = getBucketIdentifier(row, by); - const previousValue = previousValues[bucketIdentifier]; - const currentValue = newRow[inputColumnId]; - if (currentValue != null && previousValue != null) { - const currentValueAsNumber = Number(currentValue); - if (currentValueAsNumber >= previousValue) { - newRow[outputColumnId] = currentValueAsNumber - previousValue; - } else { - newRow[outputColumnId] = currentValueAsNumber; - } - } else { - newRow[outputColumnId] = undefined; - } - - if (currentValue != null) { - previousValues[bucketIdentifier] = Number(currentValue); - } else { - previousValues[bucketIdentifier] = undefined; - } - - return newRow; - }), - }; + async fn(...args) { + /** Build optimization: prevent adding extra code into initial bundle **/ + const { counterRateFn } = await import('./counter_rate_fn'); + return counterRateFn(...args); }, }; diff --git a/x-pack/plugins/lens/common/expressions/counter_rate/types.ts b/x-pack/plugins/lens/common/expressions/counter_rate/types.ts new file mode 100644 index 0000000000000..f9e1cbbb43de3 --- /dev/null +++ b/x-pack/plugins/lens/common/expressions/counter_rate/types.ts @@ -0,0 +1,16 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { Datatable, ExpressionFunctionDefinition } from '../../../../../../src/plugins/expressions'; +import { CounterRateArgs } from './index'; + +export type CounterRateExpressionFunction = ExpressionFunctionDefinition< + 'lens_counter_rate', + Datatable, + CounterRateArgs, + Datatable | Promise +>; diff --git a/x-pack/plugins/lens/common/expressions/datatable/datatable.ts b/x-pack/plugins/lens/common/expressions/datatable/datatable.ts index 32f6c1c089543..d9f1f9c1196ff 100644 --- a/x-pack/plugins/lens/common/expressions/datatable/datatable.ts +++ b/x-pack/plugins/lens/common/expressions/datatable/datatable.ts @@ -6,35 +6,16 @@ */ import { i18n } from '@kbn/i18n'; -import { cloneDeep } from 'lodash'; -import type { - ExecutionContext, - DatatableColumnMeta, - ExpressionFunctionDefinition, -} from '../../../../../../src/plugins/expressions/common'; -import type { FormatFactory, LensMultiTable } from '../../types'; +import type { ExecutionContext } from '../../../../../../src/plugins/expressions/common'; +import type { FormatFactory } from '../../types'; import type { ColumnConfigArg } from './datatable_column'; -import { getSortingCriteria } from './sorting'; -import { computeSummaryRowForColumn } from './summary'; -import { transposeTable } from './transpose_helpers'; +import type { DatatableExpressionFunction } from './types'; export interface SortingState { columnId: string | undefined; direction: 'asc' | 'desc' | 'none'; } -export interface DatatableProps { - data: LensMultiTable; - untransposedData?: LensMultiTable; - args: DatatableArgs; -} - -export interface DatatableRender { - type: 'render'; - as: 'lens_datatable_renderer'; - value: DatatableProps; -} - export interface DatatableArgs { title: string; description?: string; @@ -43,18 +24,9 @@ export interface DatatableArgs { sortingDirection: SortingState['direction']; } -function isRange(meta: { params?: { id?: string } } | undefined) { - return meta?.params?.id === 'range'; -} - export const getDatatable = ( getFormatFactory: (context: ExecutionContext) => FormatFactory | Promise -): ExpressionFunctionDefinition< - 'lens_datatable', - LensMultiTable, - DatatableArgs, - Promise -> => ({ +): DatatableExpressionFunction => ({ name: 'lens_datatable', type: 'render', inputTypes: ['lens_multitable'], @@ -86,73 +58,9 @@ export const getDatatable = ( help: '', }, }, - async fn(data, args, context) { - let untransposedData: LensMultiTable | undefined; - // do the sorting at this level to propagate it also at CSV download - const [firstTable] = Object.values(data.tables); - const [layerId] = Object.keys(context.inspectorAdapters.tables || {}); - const formatters: Record> = {}; - const formatFactory = await getFormatFactory(context); - - firstTable.columns.forEach((column) => { - formatters[column.id] = formatFactory(column.meta?.params); - }); - - const hasTransposedColumns = args.columns.some((c) => c.isTransposed); - if (hasTransposedColumns) { - // store original shape of data separately - untransposedData = cloneDeep(data); - // transposes table and args inplace - transposeTable(args, firstTable, formatters); - } - - const { sortingColumnId: sortBy, sortingDirection: sortDirection } = args; - - const columnsReverseLookup = firstTable.columns.reduce< - Record - >((memo, { id, name, meta }, i) => { - memo[id] = { name, index: i, meta }; - return memo; - }, {}); - - const columnsWithSummary = args.columns.filter((c) => c.summaryRow); - for (const column of columnsWithSummary) { - column.summaryRowValue = computeSummaryRowForColumn( - column, - firstTable, - formatters, - formatFactory({ id: 'number' }) - ); - } - - if (sortBy && columnsReverseLookup[sortBy] && sortDirection !== 'none') { - // Sort on raw values for these types, while use the formatted value for the rest - const sortingCriteria = getSortingCriteria( - isRange(columnsReverseLookup[sortBy]?.meta) - ? 'range' - : columnsReverseLookup[sortBy]?.meta?.type, - sortBy, - formatters[sortBy], - sortDirection - ); - // replace the table here - context.inspectorAdapters.tables[layerId].rows = (firstTable.rows || []) - .slice() - .sort(sortingCriteria); - // replace also the local copy - firstTable.rows = context.inspectorAdapters.tables[layerId].rows; - } else { - args.sortingColumnId = undefined; - args.sortingDirection = 'none'; - } - return { - type: 'render', - as: 'lens_datatable_renderer', - value: { - data, - untransposedData, - args, - }, - }; + async fn(...args) { + /** Build optimization: prevent adding extra code into initial bundle **/ + const { datatableFn } = await import('./datatable_fn'); + return datatableFn(getFormatFactory)(...args); }, }); diff --git a/x-pack/plugins/lens/common/expressions/datatable/datatable_fn.ts b/x-pack/plugins/lens/common/expressions/datatable/datatable_fn.ts new file mode 100644 index 0000000000000..cb03ec7f9dda6 --- /dev/null +++ b/x-pack/plugins/lens/common/expressions/datatable/datatable_fn.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 { cloneDeep } from 'lodash'; +import { FormatFactory, LensMultiTable } from '../../types'; +import { transposeTable } from './transpose_helpers'; +import { computeSummaryRowForColumn } from './summary'; +import { getSortingCriteria } from './sorting'; +import type { + DatatableColumnMeta, + ExecutionContext, +} from '../../../../../../src/plugins/expressions'; +import type { DatatableExpressionFunction } from './types'; + +function isRange(meta: { params?: { id?: string } } | undefined) { + return meta?.params?.id === 'range'; +} + +export const datatableFn = ( + getFormatFactory: (context: ExecutionContext) => FormatFactory | Promise +): DatatableExpressionFunction['fn'] => async (data, args, context) => { + let untransposedData: LensMultiTable | undefined; + // do the sorting at this level to propagate it also at CSV download + const [firstTable] = Object.values(data.tables); + const [layerId] = Object.keys(context.inspectorAdapters.tables || {}); + const formatters: Record> = {}; + const formatFactory = await getFormatFactory(context); + + firstTable.columns.forEach((column) => { + formatters[column.id] = formatFactory(column.meta?.params); + }); + + const hasTransposedColumns = args.columns.some((c) => c.isTransposed); + if (hasTransposedColumns) { + // store original shape of data separately + untransposedData = cloneDeep(data); + // transposes table and args inplace + transposeTable(args, firstTable, formatters); + } + + const { sortingColumnId: sortBy, sortingDirection: sortDirection } = args; + + const columnsReverseLookup = firstTable.columns.reduce< + Record + >((memo, { id, name, meta }, i) => { + memo[id] = { name, index: i, meta }; + return memo; + }, {}); + + const columnsWithSummary = args.columns.filter((c) => c.summaryRow); + for (const column of columnsWithSummary) { + column.summaryRowValue = computeSummaryRowForColumn( + column, + firstTable, + formatters, + formatFactory({ id: 'number' }) + ); + } + + if (sortBy && columnsReverseLookup[sortBy] && sortDirection !== 'none') { + // Sort on raw values for these types, while use the formatted value for the rest + const sortingCriteria = getSortingCriteria( + isRange(columnsReverseLookup[sortBy]?.meta) + ? 'range' + : columnsReverseLookup[sortBy]?.meta?.type, + sortBy, + formatters[sortBy], + sortDirection + ); + // replace the table here + context.inspectorAdapters.tables[layerId].rows = (firstTable.rows || []) + .slice() + .sort(sortingCriteria); + // replace also the local copy + firstTable.rows = context.inspectorAdapters.tables[layerId].rows; + } else { + args.sortingColumnId = undefined; + args.sortingDirection = 'none'; + } + return { + type: 'render', + as: 'lens_datatable_renderer', + value: { + data, + untransposedData, + args, + }, + }; +}; diff --git a/x-pack/plugins/lens/common/expressions/datatable/index.ts b/x-pack/plugins/lens/common/expressions/datatable/index.ts index 2602aae252ca9..cf9fb1d0b4791 100644 --- a/x-pack/plugins/lens/common/expressions/datatable/index.ts +++ b/x-pack/plugins/lens/common/expressions/datatable/index.ts @@ -10,3 +10,5 @@ export * from './datatable'; export * from './summary'; export * from './transpose_helpers'; export * from './utils'; + +export type { DatatableProps } from './types'; diff --git a/x-pack/plugins/lens/common/expressions/datatable/types.ts b/x-pack/plugins/lens/common/expressions/datatable/types.ts new file mode 100644 index 0000000000000..340f3eb0576b0 --- /dev/null +++ b/x-pack/plugins/lens/common/expressions/datatable/types.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 type { ExpressionFunctionDefinition } from '../../../../../../src/plugins/expressions'; +import type { LensMultiTable } from '../../types'; +import type { DatatableArgs } from './datatable'; + +export interface DatatableProps { + data: LensMultiTable; + untransposedData?: LensMultiTable; + args: DatatableArgs; +} + +export interface DatatableRender { + type: 'render'; + as: 'lens_datatable_renderer'; + value: DatatableProps; +} + +export type DatatableExpressionFunction = ExpressionFunctionDefinition< + 'lens_datatable', + LensMultiTable, + DatatableArgs, + Promise +>; diff --git a/x-pack/plugins/lens/common/expressions/format_column/format_column.test.ts b/x-pack/plugins/lens/common/expressions/format_column/format_column.test.ts index 4428225b349da..fbf3ff9c05b19 100644 --- a/x-pack/plugins/lens/common/expressions/format_column/format_column.test.ts +++ b/x-pack/plugins/lens/common/expressions/format_column/format_column.test.ts @@ -10,7 +10,9 @@ import { functionWrapper } from 'src/plugins/expressions/common/expression_funct import { FormatColumnArgs, formatColumn } from './index'; describe('format_column', () => { - const fn: (input: Datatable, args: FormatColumnArgs) => Datatable = functionWrapper(formatColumn); + const fn: (input: Datatable, args: FormatColumnArgs) => Promise = functionWrapper( + formatColumn + ); let datatable: Datatable; @@ -33,17 +35,17 @@ describe('format_column', () => { }; }); - it('overwrites format', () => { + it('overwrites format', async () => { datatable.columns[0].meta.params = { id: 'myformatter', params: {} }; - const result = fn(datatable, { columnId: 'test', format: 'otherformatter' }); + const result = await fn(datatable, { columnId: 'test', format: 'otherformatter' }); expect(result.columns[0].meta.params).toEqual({ id: 'otherformatter', }); }); - it('overwrites format with well known pattern', () => { + it('overwrites format with well known pattern', async () => { datatable.columns[0].meta.params = { id: 'myformatter', params: {} }; - const result = fn(datatable, { columnId: 'test', format: 'number' }); + const result = await fn(datatable, { columnId: 'test', format: 'number' }); expect(result.columns[0].meta.params).toEqual({ id: 'number', params: { @@ -52,9 +54,9 @@ describe('format_column', () => { }); }); - it('uses number of decimals if provided', () => { + it('uses number of decimals if provided', async () => { datatable.columns[0].meta.params = { id: 'myformatter', params: {} }; - const result = fn(datatable, { columnId: 'test', format: 'number', decimals: 5 }); + const result = await fn(datatable, { columnId: 'test', format: 'number', decimals: 5 }); expect(result.columns[0].meta.params).toEqual({ id: 'number', params: { @@ -63,9 +65,9 @@ describe('format_column', () => { }); }); - it('has special handling for 0 decimals', () => { + it('has special handling for 0 decimals', async () => { datatable.columns[0].meta.params = { id: 'myformatter', params: {} }; - const result = fn(datatable, { columnId: 'test', format: 'number', decimals: 0 }); + const result = await fn(datatable, { columnId: 'test', format: 'number', decimals: 0 }); expect(result.columns[0].meta.params).toEqual({ id: 'number', params: { @@ -75,8 +77,8 @@ describe('format_column', () => { }); describe('parent format', () => { - it('should ignore parent format if it is not specifying an id', () => { - const result = fn(datatable, { + it('should ignore parent format if it is not specifying an id', async () => { + const result = await fn(datatable, { columnId: 'test', format: '', parentFormat: JSON.stringify({ some: 'key' }), @@ -84,8 +86,8 @@ describe('format_column', () => { expect(result.columns[0].meta.params).toEqual(datatable.columns[0].meta.params); }); - it('set parent format with params', () => { - const result = fn(datatable, { + it('set parent format with params', async () => { + const result = await fn(datatable, { columnId: 'test', format: '', parentFormat: JSON.stringify({ id: 'wrapper', params: { wrapperParam: 123 } }), @@ -99,9 +101,9 @@ describe('format_column', () => { }); }); - it('retain inner formatter params', () => { + it('retain inner formatter params', async () => { datatable.columns[0].meta.params = { id: 'myformatter', params: { innerParam: 456 } }; - const result = fn(datatable, { + const result = await fn(datatable, { columnId: 'test', format: '', parentFormat: JSON.stringify({ id: 'wrapper', params: { wrapperParam: 123 } }), @@ -118,12 +120,12 @@ describe('format_column', () => { }); }); - it('overwrite existing wrapper param', () => { + it('overwrite existing wrapper param', async () => { datatable.columns[0].meta.params = { id: 'wrapper', params: { wrapperParam: 0, id: 'myformatter', params: { innerParam: 456 } }, }; - const result = fn(datatable, { + const result = await fn(datatable, { columnId: 'test', format: '', parentFormat: JSON.stringify({ id: 'wrapper', params: { wrapperParam: 123 } }), @@ -140,12 +142,12 @@ describe('format_column', () => { }); }); - it('overwrites format with well known pattern including decimals', () => { + it('overwrites format with well known pattern including decimals', async () => { datatable.columns[0].meta.params = { id: 'previousWrapper', params: { id: 'myformatter', params: { innerParam: 456 } }, }; - const result = fn(datatable, { + const result = await fn(datatable, { columnId: 'test', format: 'number', decimals: 5, @@ -164,10 +166,10 @@ describe('format_column', () => { }); }); - it('does not touch other column meta data', () => { + it('does not touch other column meta data', async () => { const extraColumn: DatatableColumn = { id: 'test2', name: 'test2', meta: { type: 'number' } }; datatable.columns.push(extraColumn); - const result = fn(datatable, { columnId: 'test', format: 'number' }); + const result = await fn(datatable, { columnId: 'test', format: 'number' }); expect(result.columns[1]).toEqual(extraColumn); }); }); diff --git a/x-pack/plugins/lens/common/expressions/format_column/format_column_fn.ts b/x-pack/plugins/lens/common/expressions/format_column/format_column_fn.ts new file mode 100644 index 0000000000000..37540ee0950af --- /dev/null +++ b/x-pack/plugins/lens/common/expressions/format_column/format_column_fn.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 { supportedFormats } from './supported_formats'; +import type { DatatableColumn } from '../../../../../../src/plugins/expressions'; +import type { FormatColumnArgs } from './index'; +import type { FormatColumnExpressionFunction } from './types'; + +function isNestedFormat(params: DatatableColumn['meta']['params']) { + // if there is a nested params object with an id, it's a nested format + return !!params?.params?.id; +} + +function withParams(col: DatatableColumn, params: Record) { + return { ...col, meta: { ...col.meta, params } }; +} + +export const formatColumnFn: FormatColumnExpressionFunction['fn'] = ( + input, + { format, columnId, decimals, parentFormat }: FormatColumnArgs +) => ({ + ...input, + columns: input.columns.map((col) => { + if (col.id === columnId) { + if (!parentFormat) { + if (supportedFormats[format]) { + return withParams(col, { + id: format, + params: { pattern: supportedFormats[format].decimalsToPattern(decimals) }, + }); + } else if (format) { + return withParams(col, { id: format }); + } else { + return col; + } + } + + const parsedParentFormat = JSON.parse(parentFormat); + const parentFormatId = parsedParentFormat.id; + const parentFormatParams = parsedParentFormat.params ?? {}; + + if (!parentFormatId) { + return col; + } + + if (format && supportedFormats[format]) { + return withParams(col, { + id: parentFormatId, + params: { + id: format, + params: { + pattern: supportedFormats[format].decimalsToPattern(decimals), + }, + ...parentFormatParams, + }, + }); + } + if (parentFormatParams) { + // if original format is already a nested one, we are just replacing the wrapper params + // otherwise wrapping it inside parentFormatId/parentFormatParams + const isNested = isNestedFormat(col.meta.params); + const innerParams = isNested + ? col.meta.params?.params + : { id: col.meta.params?.id, params: col.meta.params?.params }; + + const formatId = isNested ? col.meta.params?.id : parentFormatId; + + return withParams(col, { + ...col.meta.params, + id: formatId, + params: { + ...innerParams, + ...parentFormatParams, + }, + }); + } + } + return col; + }), +}); diff --git a/x-pack/plugins/lens/common/expressions/format_column/index.ts b/x-pack/plugins/lens/common/expressions/format_column/index.ts index c874eac1ede1f..0fc99ff8f7089 100644 --- a/x-pack/plugins/lens/common/expressions/format_column/index.ts +++ b/x-pack/plugins/lens/common/expressions/format_column/index.ts @@ -5,11 +5,7 @@ * 2.0. */ -import type { - ExpressionFunctionDefinition, - Datatable, - DatatableColumn, -} from '../../../../../../src/plugins/expressions/common'; +import type { FormatColumnExpressionFunction } from './types'; export interface FormatColumnArgs { format: string; @@ -18,42 +14,7 @@ export interface FormatColumnArgs { parentFormat?: string; } -export const supportedFormats: Record< - string, - { decimalsToPattern: (decimals?: number) => string } -> = { - number: { - decimalsToPattern: (decimals = 2) => { - if (decimals === 0) { - return `0,0`; - } - return `0,0.${'0'.repeat(decimals)}`; - }, - }, - percent: { - decimalsToPattern: (decimals = 2) => { - if (decimals === 0) { - return `0,0%`; - } - return `0,0.${'0'.repeat(decimals)}%`; - }, - }, - bytes: { - decimalsToPattern: (decimals = 2) => { - if (decimals === 0) { - return `0,0b`; - } - return `0,0.${'0'.repeat(decimals)}b`; - }, - }, -}; - -export const formatColumn: ExpressionFunctionDefinition< - 'lens_format_column', - Datatable, - FormatColumnArgs, - Datatable -> = { +export const formatColumn: FormatColumnExpressionFunction = { name: 'lens_format_column', type: 'datatable', help: '', @@ -78,75 +39,9 @@ export const formatColumn: ExpressionFunctionDefinition< }, }, inputTypes: ['datatable'], - fn(input, { format, columnId, decimals, parentFormat }: FormatColumnArgs) { - return { - ...input, - columns: input.columns.map((col) => { - if (col.id === columnId) { - if (!parentFormat) { - if (supportedFormats[format]) { - return withParams(col, { - id: format, - params: { pattern: supportedFormats[format].decimalsToPattern(decimals) }, - }); - } else if (format) { - return withParams(col, { id: format }); - } else { - return col; - } - } - - const parsedParentFormat = JSON.parse(parentFormat); - const parentFormatId = parsedParentFormat.id; - const parentFormatParams = parsedParentFormat.params ?? {}; - - if (!parentFormatId) { - return col; - } - - if (format && supportedFormats[format]) { - return withParams(col, { - id: parentFormatId, - params: { - id: format, - params: { - pattern: supportedFormats[format].decimalsToPattern(decimals), - }, - ...parentFormatParams, - }, - }); - } - if (parentFormatParams) { - // if original format is already a nested one, we are just replacing the wrapper params - // otherwise wrapping it inside parentFormatId/parentFormatParams - const isNested = isNestedFormat(col.meta.params); - const innerParams = isNested - ? col.meta.params?.params - : { id: col.meta.params?.id, params: col.meta.params?.params }; - - const formatId = isNested ? col.meta.params?.id : parentFormatId; - - return withParams(col, { - ...col.meta.params, - id: formatId, - params: { - ...innerParams, - ...parentFormatParams, - }, - }); - } - } - return col; - }), - }; + async fn(...args) { + /** Build optimization: prevent adding extra code into initial bundle **/ + const { formatColumnFn } = await import('./format_column_fn'); + return formatColumnFn(...args); }, }; - -function isNestedFormat(params: DatatableColumn['meta']['params']) { - // if there is a nested params object with an id, it's a nested format - return !!params?.params?.id; -} - -function withParams(col: DatatableColumn, params: Record) { - return { ...col, meta: { ...col.meta, params } }; -} diff --git a/x-pack/plugins/lens/common/expressions/format_column/supported_formats.ts b/x-pack/plugins/lens/common/expressions/format_column/supported_formats.ts new file mode 100644 index 0000000000000..d00d2f7dfc22f --- /dev/null +++ b/x-pack/plugins/lens/common/expressions/format_column/supported_formats.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. + */ + +export const supportedFormats: Record< + string, + { decimalsToPattern: (decimals?: number) => string } +> = { + number: { + decimalsToPattern: (decimals = 2) => { + if (decimals === 0) { + return `0,0`; + } + return `0,0.${'0'.repeat(decimals)}`; + }, + }, + percent: { + decimalsToPattern: (decimals = 2) => { + if (decimals === 0) { + return `0,0%`; + } + return `0,0.${'0'.repeat(decimals)}%`; + }, + }, + bytes: { + decimalsToPattern: (decimals = 2) => { + if (decimals === 0) { + return `0,0b`; + } + return `0,0.${'0'.repeat(decimals)}b`; + }, + }, +}; diff --git a/x-pack/plugins/lens/common/expressions/format_column/types.ts b/x-pack/plugins/lens/common/expressions/format_column/types.ts new file mode 100644 index 0000000000000..589422b253b93 --- /dev/null +++ b/x-pack/plugins/lens/common/expressions/format_column/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 { + Datatable, + ExpressionFunctionDefinition, +} from '../../../../../../src/plugins/expressions'; +import type { FormatColumnArgs } from './index'; + +export type FormatColumnExpressionFunction = ExpressionFunctionDefinition< + 'lens_format_column', + Datatable, + FormatColumnArgs, + Datatable | Promise +>; diff --git a/x-pack/plugins/lens/common/expressions/merge_tables/index.ts b/x-pack/plugins/lens/common/expressions/merge_tables/index.ts index e190da19886df..7ede2236e8b07 100644 --- a/x-pack/plugins/lens/common/expressions/merge_tables/index.ts +++ b/x-pack/plugins/lens/common/expressions/merge_tables/index.ts @@ -15,7 +15,7 @@ import { toAbsoluteDates } from '../../../../../../src/plugins/data/common'; import type { ExpressionValueSearchContext } from '../../../../../../src/plugins/data/common'; import type { LensMultiTable } from '../../types'; -import { Adapters } from '../../../../../../src/plugins/inspector/common'; +import type { Adapters } from '../../../../../../src/plugins/inspector/common'; interface MergeTables { layerIds: string[]; diff --git a/x-pack/plugins/lens/common/expressions/metric_chart/metric_chart.ts b/x-pack/plugins/lens/common/expressions/metric_chart/metric_chart.ts index 6c05502bb2b03..0a867e4155c22 100644 --- a/x-pack/plugins/lens/common/expressions/metric_chart/metric_chart.ts +++ b/x-pack/plugins/lens/common/expressions/metric_chart/metric_chart.ts @@ -9,17 +9,17 @@ import type { ExpressionFunctionDefinition } from '../../../../../../src/plugins import type { LensMultiTable } from '../../types'; import type { MetricConfig } from './types'; -export interface MetricChartProps { - data: LensMultiTable; - args: MetricConfig; -} - -export interface MetricRender { +interface MetricRender { type: 'render'; as: 'lens_metric_chart_renderer'; value: MetricChartProps; } +export interface MetricChartProps { + data: LensMultiTable; + args: MetricConfig; +} + export const metricChart: ExpressionFunctionDefinition< 'lens_metric_chart', LensMultiTable, diff --git a/x-pack/plugins/lens/common/expressions/pie_chart/index.ts b/x-pack/plugins/lens/common/expressions/pie_chart/index.ts index e82294f8aff25..1c1f6fdae4578 100644 --- a/x-pack/plugins/lens/common/expressions/pie_chart/index.ts +++ b/x-pack/plugins/lens/common/expressions/pie_chart/index.ts @@ -5,5 +5,12 @@ * 2.0. */ -export * from './types'; -export * from './pie_chart'; +export { pie } from './pie_chart'; + +export type { + SharedPieLayerState, + PieLayerState, + PieVisualizationState, + PieExpressionArgs, + PieExpressionProps, +} from './types'; diff --git a/x-pack/plugins/lens/common/expressions/pie_chart/pie_chart.ts b/x-pack/plugins/lens/common/expressions/pie_chart/pie_chart.ts index 7d228f04c25e7..ed0391a16af25 100644 --- a/x-pack/plugins/lens/common/expressions/pie_chart/pie_chart.ts +++ b/x-pack/plugins/lens/common/expressions/pie_chart/pie_chart.ts @@ -7,11 +7,12 @@ import { Position } from '@elastic/charts'; import { i18n } from '@kbn/i18n'; + import type { ExpressionFunctionDefinition } from '../../../../../../src/plugins/expressions/common'; import type { LensMultiTable } from '../../types'; import type { PieExpressionProps, PieExpressionArgs } from './types'; -export interface PieRender { +interface PieRender { type: 'render'; as: 'lens_pie_renderer'; value: PieExpressionProps; diff --git a/x-pack/plugins/lens/common/expressions/rename_columns/index.ts b/x-pack/plugins/lens/common/expressions/rename_columns/index.ts index 4cb8ff75f486d..86ab16e06ec01 100644 --- a/x-pack/plugins/lens/common/expressions/rename_columns/index.ts +++ b/x-pack/plugins/lens/common/expressions/rename_columns/index.ts @@ -5,4 +5,4 @@ * 2.0. */ -export * from './rename_columns'; +export { renameColumns } from './rename_columns'; diff --git a/x-pack/plugins/lens/common/expressions/rename_columns/rename_columns.test.ts b/x-pack/plugins/lens/common/expressions/rename_columns/rename_columns.test.ts index f3db64c1d2257..3bfed88625c89 100644 --- a/x-pack/plugins/lens/common/expressions/rename_columns/rename_columns.test.ts +++ b/x-pack/plugins/lens/common/expressions/rename_columns/rename_columns.test.ts @@ -10,7 +10,7 @@ import { Datatable } from '../../../../../../src/plugins/expressions/common'; import { createMockExecutionContext } from '../../../../../../src/plugins/expressions/common/mocks'; describe('rename_columns', () => { - it('should rename columns of a given datatable', () => { + it('should rename columns of a given datatable', async () => { const input: Datatable = { type: 'datatable', columns: [ @@ -36,7 +36,7 @@ describe('rename_columns', () => { }, }; - const result = renameColumns.fn( + const result = await renameColumns.fn( input, { idMap: JSON.stringify(idMap) }, createMockExecutionContext() @@ -83,7 +83,7 @@ describe('rename_columns', () => { `); }); - it('should keep columns which are not mapped', () => { + it('should keep columns which are not mapped', async () => { const input: Datatable = { type: 'datatable', columns: [ @@ -102,7 +102,7 @@ describe('rename_columns', () => { b: { id: 'c', label: 'Catamaran' }, }; - const result = renameColumns.fn( + const result = await renameColumns.fn( input, { idMap: JSON.stringify(idMap) }, createMockExecutionContext() @@ -149,7 +149,7 @@ describe('rename_columns', () => { `); }); - it('should rename date histograms', () => { + it('should rename date histograms', async () => { const input: Datatable = { type: 'datatable', columns: [ @@ -168,7 +168,7 @@ describe('rename_columns', () => { b: { id: 'c', label: 'Apple', operationType: 'date_histogram', sourceField: 'banana' }, }; - const result = renameColumns.fn( + const result = await renameColumns.fn( input, { idMap: JSON.stringify(idMap) }, createMockExecutionContext() diff --git a/x-pack/plugins/lens/common/expressions/rename_columns/rename_columns.ts b/x-pack/plugins/lens/common/expressions/rename_columns/rename_columns.ts index 517bd683d80ae..d425d5c80d18d 100644 --- a/x-pack/plugins/lens/common/expressions/rename_columns/rename_columns.ts +++ b/x-pack/plugins/lens/common/expressions/rename_columns/rename_columns.ts @@ -6,27 +6,9 @@ */ import { i18n } from '@kbn/i18n'; -import { - ExpressionFunctionDefinition, - Datatable, - DatatableColumn, -} from '../../../../../../src/plugins/expressions/common'; +import type { RenameColumnsExpressionFunction } from './types'; -interface RemapArgs { - idMap: string; -} - -type OriginalColumn = { id: string; label: string } & ( - | { operationType: 'date_histogram'; sourceField: string } - | { operationType: string; sourceField: never } -); - -export const renameColumns: ExpressionFunctionDefinition< - 'lens_rename_columns', - Datatable, - RemapArgs, - Datatable -> = { +export const renameColumns: RenameColumnsExpressionFunction = { name: 'lens_rename_columns', type: 'datatable', help: i18n.translate('xpack.lens.functions.renameColumns.help', { @@ -42,53 +24,9 @@ export const renameColumns: ExpressionFunctionDefinition< }, }, inputTypes: ['datatable'], - fn(data, { idMap: encodedIdMap }) { - const idMap = JSON.parse(encodedIdMap) as Record; - - return { - type: 'datatable', - rows: data.rows.map((row) => { - const mappedRow: Record = {}; - Object.entries(idMap).forEach(([fromId, toId]) => { - mappedRow[toId.id] = row[fromId]; - }); - - Object.entries(row).forEach(([id, value]) => { - if (id in idMap) { - mappedRow[idMap[id].id] = value; - } else { - mappedRow[id] = value; - } - }); - - return mappedRow; - }), - columns: data.columns.map((column) => { - const mappedItem = idMap[column.id]; - - if (!mappedItem) { - return column; - } - - return { - ...column, - id: mappedItem.id, - name: getColumnName(mappedItem, column), - }; - }), - }; + async fn(...args) { + /** Build optimization: prevent adding extra code into initial bundle **/ + const { renameColumnFn } = await import('./rename_columns_fn'); + return renameColumnFn(...args); }, }; - -function getColumnName(originalColumn: OriginalColumn, newColumn: DatatableColumn) { - if (originalColumn?.operationType === 'date_histogram') { - const fieldName = originalColumn.sourceField; - - // HACK: This is a hack, and introduces some fragility into - // column naming. Eventually, this should be calculated and - // built more systematically. - return newColumn.name.replace(fieldName, originalColumn.label); - } - - return originalColumn.label; -} diff --git a/x-pack/plugins/lens/common/expressions/rename_columns/rename_columns_fn.ts b/x-pack/plugins/lens/common/expressions/rename_columns/rename_columns_fn.ts new file mode 100644 index 0000000000000..ee0c7ed1eebec --- /dev/null +++ b/x-pack/plugins/lens/common/expressions/rename_columns/rename_columns_fn.ts @@ -0,0 +1,62 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { DatatableColumn } from '../../../../../../src/plugins/expressions/common'; +import type { OriginalColumn, RenameColumnsExpressionFunction } from './types'; + +function getColumnName(originalColumn: OriginalColumn, newColumn: DatatableColumn) { + if (originalColumn?.operationType === 'date_histogram') { + const fieldName = originalColumn.sourceField; + + // HACK: This is a hack, and introduces some fragility into + // column naming. Eventually, this should be calculated and + // built more systematically. + return newColumn.name.replace(fieldName, originalColumn.label); + } + + return originalColumn.label; +} + +export const renameColumnFn: RenameColumnsExpressionFunction['fn'] = ( + data, + { idMap: encodedIdMap } +) => { + const idMap = JSON.parse(encodedIdMap) as Record; + + return { + type: 'datatable', + rows: data.rows.map((row) => { + const mappedRow: Record = {}; + Object.entries(idMap).forEach(([fromId, toId]) => { + mappedRow[toId.id] = row[fromId]; + }); + + Object.entries(row).forEach(([id, value]) => { + if (id in idMap) { + mappedRow[idMap[id].id] = value; + } else { + mappedRow[id] = value; + } + }); + + return mappedRow; + }), + columns: data.columns.map((column) => { + const mappedItem = idMap[column.id]; + + if (!mappedItem) { + return column; + } + + return { + ...column, + id: mappedItem.id, + name: getColumnName(mappedItem, column), + }; + }), + }; +}; diff --git a/x-pack/plugins/lens/common/expressions/rename_columns/types.ts b/x-pack/plugins/lens/common/expressions/rename_columns/types.ts new file mode 100644 index 0000000000000..685ccfb89e4ca --- /dev/null +++ b/x-pack/plugins/lens/common/expressions/rename_columns/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 { Datatable, ExpressionFunctionDefinition } from '../../../../../../src/plugins/expressions'; + +export type OriginalColumn = { id: string; label: string } & ( + | { operationType: 'date_histogram'; sourceField: string } + | { operationType: string; sourceField: never } +); + +export type RenameColumnsExpressionFunction = ExpressionFunctionDefinition< + 'lens_rename_columns', + Datatable, + { + idMap: string; + }, + Datatable | Promise +>; diff --git a/x-pack/plugins/lens/common/expressions/time_scale/index.ts b/x-pack/plugins/lens/common/expressions/time_scale/index.ts index 92fec01a9ecbc..b5bd7dbcbb074 100644 --- a/x-pack/plugins/lens/common/expressions/time_scale/index.ts +++ b/x-pack/plugins/lens/common/expressions/time_scale/index.ts @@ -5,5 +5,5 @@ * 2.0. */ -export * from './time_scale'; -export * from './types'; +export { getTimeScale } from './time_scale'; +export type { TimeScaleUnit, TimeScaleArgs } from './types'; diff --git a/x-pack/plugins/lens/common/expressions/time_scale/time_scale.test.ts b/x-pack/plugins/lens/common/expressions/time_scale/time_scale.test.ts index 9f299d9e3d74f..d51f2594b4267 100644 --- a/x-pack/plugins/lens/common/expressions/time_scale/time_scale.test.ts +++ b/x-pack/plugins/lens/common/expressions/time_scale/time_scale.test.ts @@ -6,8 +6,8 @@ */ import moment from 'moment'; -import { Datatable } from 'src/plugins/expressions/public'; -import { TimeRange } from 'src/plugins/data/public'; +import type { Datatable } from 'src/plugins/expressions/public'; +import type { TimeRange } from 'src/plugins/data/public'; import { functionWrapper } from 'src/plugins/expressions/common/expression_functions/specs/tests/utils'; // mock the specific inner variable: @@ -22,7 +22,8 @@ jest.mock('../../../../../../src/plugins/data/common/query/timefilter/get_time', }; }); -import { getTimeScale, TimeScaleArgs } from './time_scale'; +import { getTimeScale } from './time_scale'; +import type { TimeScaleArgs } from './types'; describe('time_scale', () => { let timeScaleWrapped: (input: Datatable, args: TimeScaleArgs) => Promise; diff --git a/x-pack/plugins/lens/common/expressions/time_scale/time_scale.ts b/x-pack/plugins/lens/common/expressions/time_scale/time_scale.ts index 711b770fb140f..21bef6de980ac 100644 --- a/x-pack/plugins/lens/common/expressions/time_scale/time_scale.ts +++ b/x-pack/plugins/lens/common/expressions/time_scale/time_scale.ts @@ -5,46 +5,12 @@ * 2.0. */ -import moment from 'moment-timezone'; -import { i18n } from '@kbn/i18n'; -import type { - ExpressionFunctionDefinition, - Datatable, -} from '../../../../../../src/plugins/expressions/common'; -import { - getDateHistogramMetaDataByDatatableColumn, - parseInterval, - calculateBounds, -} from '../../../../../../src/plugins/data/common'; -import { - buildResultColumns, - ExecutionContext, -} from '../../../../../../src/plugins/expressions/common'; -import type { TimeScaleUnit } from './types'; - -export interface TimeScaleArgs { - dateColumnId: string; - inputColumnId: string; - outputColumnId: string; - targetUnit: TimeScaleUnit; - outputColumnName?: string; -} - -const unitInMs: Record = { - s: 1000, - m: 1000 * 60, - h: 1000 * 60 * 60, - d: 1000 * 60 * 60 * 24, -}; +import type { ExecutionContext } from '../../../../../../src/plugins/expressions/common'; +import type { TimeScaleExpressionFunction } from './types'; export const getTimeScale = ( getTimezone: (context: ExecutionContext) => string | Promise -): ExpressionFunctionDefinition< - 'lens_time_scale', - Datatable, - TimeScaleArgs, - Promise -> => ({ +): TimeScaleExpressionFunction => ({ name: 'lens_time_scale', type: 'datatable', help: '', @@ -76,84 +42,9 @@ export const getTimeScale = ( }, }, inputTypes: ['datatable'], - async fn( - input, - { dateColumnId, inputColumnId, outputColumnId, outputColumnName, targetUnit }: TimeScaleArgs, - context - ) { - const dateColumnDefinition = input.columns.find((column) => column.id === dateColumnId); - - if (!dateColumnDefinition) { - throw new Error( - i18n.translate('xpack.lens.functions.timeScale.dateColumnMissingMessage', { - defaultMessage: 'Specified dateColumnId {columnId} does not exist.', - values: { - columnId: dateColumnId, - }, - }) - ); - } - - const resultColumns = buildResultColumns( - input, - outputColumnId, - inputColumnId, - outputColumnName, - { allowColumnOverwrite: true } - ); - - if (!resultColumns) { - return input; - } - - const targetUnitInMs = unitInMs[targetUnit]; - const timeInfo = getDateHistogramMetaDataByDatatableColumn(dateColumnDefinition, { - timeZone: await getTimezone(context), - }); - const intervalDuration = timeInfo?.interval && parseInterval(timeInfo.interval); - - if (!timeInfo || !intervalDuration) { - throw new Error( - i18n.translate('xpack.lens.functions.timeScale.timeInfoMissingMessage', { - defaultMessage: 'Could not fetch date histogram information', - }) - ); - } - // the datemath plugin always parses dates by using the current default moment time zone. - // to use the configured time zone, we are switching just for the bounds calculation. - const defaultTimezone = moment().zoneName(); - moment.tz.setDefault(timeInfo.timeZone); - - const timeBounds = timeInfo.timeRange && calculateBounds(timeInfo.timeRange); - - const result = { - ...input, - columns: resultColumns, - rows: input.rows.map((row) => { - const newRow = { ...row }; - - let startOfBucket = moment(row[dateColumnId]); - let endOfBucket = startOfBucket.clone().add(intervalDuration); - if (timeBounds && timeBounds.min) { - startOfBucket = moment.max(startOfBucket, timeBounds.min); - } - if (timeBounds && timeBounds.max) { - endOfBucket = moment.min(endOfBucket, timeBounds.max); - } - const bucketSize = endOfBucket.diff(startOfBucket); - const factor = bucketSize / targetUnitInMs; - - const currentValue = newRow[inputColumnId]; - if (currentValue != null) { - newRow[outputColumnId] = Number(currentValue) / factor; - } - - return newRow; - }), - }; - // reset default moment timezone - moment.tz.setDefault(defaultTimezone); - - return result; + async fn(...args) { + /** Build optimization: prevent adding extra code into initial bundle **/ + const { timeScaleFn } = await import('./time_scale_fn'); + return timeScaleFn(getTimezone)(...args); }, }); diff --git a/x-pack/plugins/lens/common/expressions/time_scale/time_scale_fn.ts b/x-pack/plugins/lens/common/expressions/time_scale/time_scale_fn.ts new file mode 100644 index 0000000000000..e6113afebca22 --- /dev/null +++ b/x-pack/plugins/lens/common/expressions/time_scale/time_scale_fn.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 moment from 'moment-timezone'; +import { i18n } from '@kbn/i18n'; +import { + buildResultColumns, + ExecutionContext, +} from '../../../../../../src/plugins/expressions/common'; +import { + calculateBounds, + getDateHistogramMetaDataByDatatableColumn, + parseInterval, +} from '../../../../../../src/plugins/data/common'; +import type { TimeScaleExpressionFunction, TimeScaleUnit, TimeScaleArgs } from './types'; + +const unitInMs: Record = { + s: 1000, + m: 1000 * 60, + h: 1000 * 60 * 60, + d: 1000 * 60 * 60 * 24, +}; + +export const timeScaleFn = ( + getTimezone: (context: ExecutionContext) => string | Promise +): TimeScaleExpressionFunction['fn'] => async ( + input, + { dateColumnId, inputColumnId, outputColumnId, outputColumnName, targetUnit }: TimeScaleArgs, + context +) => { + const dateColumnDefinition = input.columns.find((column) => column.id === dateColumnId); + + if (!dateColumnDefinition) { + throw new Error( + i18n.translate('xpack.lens.functions.timeScale.dateColumnMissingMessage', { + defaultMessage: 'Specified dateColumnId {columnId} does not exist.', + values: { + columnId: dateColumnId, + }, + }) + ); + } + + const resultColumns = buildResultColumns(input, outputColumnId, inputColumnId, outputColumnName, { + allowColumnOverwrite: true, + }); + + if (!resultColumns) { + return input; + } + + const targetUnitInMs = unitInMs[targetUnit]; + const timeInfo = getDateHistogramMetaDataByDatatableColumn(dateColumnDefinition, { + timeZone: await getTimezone(context), + }); + const intervalDuration = timeInfo?.interval && parseInterval(timeInfo.interval); + + if (!timeInfo || !intervalDuration) { + throw new Error( + i18n.translate('xpack.lens.functions.timeScale.timeInfoMissingMessage', { + defaultMessage: 'Could not fetch date histogram information', + }) + ); + } + // the datemath plugin always parses dates by using the current default moment time zone. + // to use the configured time zone, we are switching just for the bounds calculation. + const defaultTimezone = moment().zoneName(); + moment.tz.setDefault(timeInfo.timeZone); + + const timeBounds = timeInfo.timeRange && calculateBounds(timeInfo.timeRange); + + const result = { + ...input, + columns: resultColumns, + rows: input.rows.map((row) => { + const newRow = { ...row }; + + let startOfBucket = moment(row[dateColumnId]); + let endOfBucket = startOfBucket.clone().add(intervalDuration); + if (timeBounds && timeBounds.min) { + startOfBucket = moment.max(startOfBucket, timeBounds.min); + } + if (timeBounds && timeBounds.max) { + endOfBucket = moment.min(endOfBucket, timeBounds.max); + } + const bucketSize = endOfBucket.diff(startOfBucket); + const factor = bucketSize / targetUnitInMs; + + const currentValue = newRow[inputColumnId]; + if (currentValue != null) { + newRow[outputColumnId] = Number(currentValue) / factor; + } + + return newRow; + }), + }; + // reset default moment timezone + moment.tz.setDefault(defaultTimezone); + + return result; +}; diff --git a/x-pack/plugins/lens/common/expressions/time_scale/types.ts b/x-pack/plugins/lens/common/expressions/time_scale/types.ts index 4ee00ce53e68b..58c5e5723a7c1 100644 --- a/x-pack/plugins/lens/common/expressions/time_scale/types.ts +++ b/x-pack/plugins/lens/common/expressions/time_scale/types.ts @@ -5,4 +5,24 @@ * 2.0. */ +import type { + Datatable, + ExpressionFunctionDefinition, +} from '../../../../../../src/plugins/expressions'; + export type TimeScaleUnit = 's' | 'm' | 'h' | 'd'; + +export interface TimeScaleArgs { + dateColumnId: string; + inputColumnId: string; + outputColumnId: string; + targetUnit: TimeScaleUnit; + outputColumnName?: string; +} + +export type TimeScaleExpressionFunction = ExpressionFunctionDefinition< + 'lens_time_scale', + Datatable, + TimeScaleArgs, + Promise +>; diff --git a/x-pack/plugins/lens/jest.config.js b/x-pack/plugins/lens/jest.config.js index 615e540eaedce..f1164df4eab86 100644 --- a/x-pack/plugins/lens/jest.config.js +++ b/x-pack/plugins/lens/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/lens'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/lens', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/lens/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/lens/kibana.json b/x-pack/plugins/lens/kibana.json index 2ec7a1962da82..f82f3366448da 100644 --- a/x-pack/plugins/lens/kibana.json +++ b/x-pack/plugins/lens/kibana.json @@ -24,7 +24,8 @@ "usageCollection", "taskManager", "globalSearch", - "savedObjectsTagging" + "savedObjectsTagging", + "spaces" ], "configPath": [ "xpack", diff --git a/x-pack/plugins/lens/public/app_plugin/app.test.tsx b/x-pack/plugins/lens/public/app_plugin/app.test.tsx index 8cb4a7c4c8433..5617b5b0edeea 100644 --- a/x-pack/plugins/lens/public/app_plugin/app.test.tsx +++ b/x-pack/plugins/lens/public/app_plugin/app.test.tsx @@ -383,6 +383,9 @@ describe('Lens App', () => { savedObjectId: savedObjectId || 'aaa', })); services.attributeService.unwrapAttributes = jest.fn().mockResolvedValue({ + sharingSavedObjectProps: { + outcome: 'exactMatch', + }, savedObjectId: initialSavedObjectId ?? 'aaa', references: [], state: { @@ -1256,4 +1259,32 @@ describe('Lens App', () => { expect(defaultLeave).not.toHaveBeenCalled(); }); }); + it('should display a conflict callout if saved object conflicts', async () => { + const history = createMemoryHistory(); + const { services } = await mountWith({ + props: { + ...makeDefaultProps(), + history: { + ...history, + location: { + ...history.location, + search: '?_g=test', + }, + }, + }, + preloadedState: { + persistedDoc: defaultDoc, + sharingSavedObjectProps: { + outcome: 'conflict', + aliasTargetId: '2', + }, + }, + }); + expect(services.spaces.ui.components.getLegacyUrlConflict).toHaveBeenCalledWith({ + currentObjectId: '1234', + objectNoun: 'Lens visualization', + otherObjectId: '2', + otherObjectPath: '#/edit/2?_g=test', + }); + }); }); diff --git a/x-pack/plugins/lens/public/app_plugin/app.tsx b/x-pack/plugins/lens/public/app_plugin/app.tsx index 63cb7d3002542..ae2edaa1b98d3 100644 --- a/x-pack/plugins/lens/public/app_plugin/app.tsx +++ b/x-pack/plugins/lens/public/app_plugin/app.tsx @@ -38,6 +38,7 @@ import { runSaveLensVisualization, } from './save_modal_container'; import { getLensInspectorService, LensInspector } from '../lens_inspector_service'; +import { getEditPath } from '../../common'; export type SaveProps = Omit & { returnToOrigin: boolean; @@ -70,6 +71,8 @@ export function App({ notifications, savedObjectsTagging, getOriginatingAppName, + spaces, + http, // Temporarily required until the 'by value' paradigm is default. dashboardFeatureFlag, } = lensAppServices; @@ -82,6 +85,7 @@ export function App({ const { persistedDoc, + sharingSavedObjectProps, isLinkedToOriginatingApp, searchSessionId, isLoading, @@ -166,6 +170,28 @@ export function App({ }); }, [onAppLeave, lastKnownDoc, isSaveable, persistedDoc, application.capabilities.visualize.save]); + const getLegacyUrlConflictCallout = useCallback(() => { + // This function returns a callout component *if* we have encountered a "legacy URL conflict" scenario + if (spaces && sharingSavedObjectProps?.outcome === 'conflict' && persistedDoc?.savedObjectId) { + // We have resolved to one object, but another object has a legacy URL alias associated with this ID/page. We should display a + // callout with a warning for the user, and provide a way for them to navigate to the other object. + const currentObjectId = persistedDoc.savedObjectId; + const otherObjectId = sharingSavedObjectProps?.aliasTargetId!; // This is always defined if outcome === 'conflict' + const otherObjectPath = http.basePath.prepend( + `${getEditPath(otherObjectId)}${history.location.search}` + ); + return spaces.ui.components.getLegacyUrlConflict({ + objectNoun: i18n.translate('xpack.lens.appName', { + defaultMessage: 'Lens visualization', + }), + currentObjectId, + otherObjectId, + otherObjectPath, + }); + } + return null; + }, [persistedDoc, sharingSavedObjectProps, spaces, http, history]); + // Sync Kibana breadcrumbs any time the saved document's title changes useEffect(() => { const isByValueMode = getIsByValueMode(); @@ -273,6 +299,8 @@ export function App({ title={persistedDoc?.title} lensInspector={lensInspector} /> + + {getLegacyUrlConflictCallout()} {(!isLoading || persistedDoc) && ( Promise + attributeService: LensAttributeService ): Promise { const { data, @@ -55,6 +55,7 @@ export async function getLensServices( savedObjectsTagging, usageCollection, fieldFormats, + spaces, } = startDependencies; const storage = new Storage(localStorage); @@ -70,7 +71,7 @@ export async function getLensServices( stateTransfer, usageCollection, savedObjectsTagging, - attributeService: await attributeService(), + attributeService, http: coreStart.http, chrome: coreStart.chrome, overlays: coreStart.overlays, @@ -87,6 +88,7 @@ export async function getLensServices( }, // Temporarily required until the 'by value' paradigm is default. dashboardFeatureFlag: startDependencies.dashboard.dashboardFeatureFlagConfig, + spaces, }; } @@ -95,8 +97,8 @@ export async function mountApp( params: AppMountParameters, mountProps: { createEditorFrame: EditorFrameStart['createInstance']; - attributeService: () => Promise; - getPresentationUtilContext: () => Promise; + attributeService: LensAttributeService; + getPresentationUtilContext: () => FC; } ) { const { createEditorFrame, attributeService, getPresentationUtilContext } = mountProps; @@ -203,7 +205,9 @@ export async function mountApp( trackUiEvent('loaded'); const initialInput = getInitialInput(props.id, props.editByValue); - lensStore.dispatch(loadInitial({ redirectCallback, initialInput, emptyState })); + lensStore.dispatch( + loadInitial({ redirectCallback, initialInput, emptyState, history: props.history }) + ); return ( @@ -248,7 +252,7 @@ export async function mountApp( params.element.classList.add('lnsAppWrapper'); - const PresentationUtilContext = await getPresentationUtilContext(); + const PresentationUtilContext = getPresentationUtilContext(); render( diff --git a/x-pack/plugins/lens/public/app_plugin/shared/saved_modal_lazy.tsx b/x-pack/plugins/lens/public/app_plugin/shared/saved_modal_lazy.tsx index f1a537fe65928..e1df6ca60dd6e 100644 --- a/x-pack/plugins/lens/public/app_plugin/shared/saved_modal_lazy.tsx +++ b/x-pack/plugins/lens/public/app_plugin/shared/saved_modal_lazy.tsx @@ -8,11 +8,11 @@ import React, { Suspense, useEffect, useState } from 'react'; import { EuiLoadingSpinner, EuiOverlayMask } from '@elastic/eui'; -import { CoreStart } from 'kibana/public'; +import type { CoreStart } from 'kibana/public'; import type { SaveModalContainerProps } from '../save_modal_container'; -import type { LensAttributeService } from '../../lens_attribute_service'; import type { LensPluginStartDependencies } from '../../plugin'; import type { LensAppServices } from '../types'; + const SaveModal = React.lazy(() => import('../save_modal_container')); function LoadingSpinnerWithOverlay() { @@ -33,16 +33,20 @@ const LensSavedModalLazy = (props: SaveModalContainerProps) => { export function getSaveModalComponent( coreStart: CoreStart, - startDependencies: LensPluginStartDependencies, - attributeService: () => Promise + startDependencies: LensPluginStartDependencies ) { return (props: Omit) => { const [lensServices, setLensServices] = useState(); useEffect(() => { async function loadLensService() { - const { getLensServices } = await import('../../async_services'); - const lensServicesT = await getLensServices(coreStart, startDependencies, attributeService); + const { getLensServices, getLensAttributeService } = await import('../../async_services'); + + const lensServicesT = await getLensServices( + coreStart, + startDependencies, + getLensAttributeService(coreStart, startDependencies) + ); setLensServices(lensServicesT); } diff --git a/x-pack/plugins/lens/public/app_plugin/types.ts b/x-pack/plugins/lens/public/app_plugin/types.ts index 4ccf441799b1c..8a3a848ffa204 100644 --- a/x-pack/plugins/lens/public/app_plugin/types.ts +++ b/x-pack/plugins/lens/public/app_plugin/types.ts @@ -7,6 +7,7 @@ import type { History } from 'history'; import type { OnSaveProps } from 'src/plugins/saved_objects/public'; +import { SpacesApi } from '../../../spaces/public'; import type { ApplicationStart, AppMountParameters, @@ -116,6 +117,8 @@ export interface LensAppServices { savedObjectsTagging?: SavedObjectTaggingPluginStart; getOriginatingAppName: () => string | undefined; presentationUtil: PresentationUtilPluginStart; + spaces: SpacesApi; + // Temporarily required until the 'by value' paradigm is default. dashboardFeatureFlag: DashboardFeatureFlagConfig; } diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.test.tsx b/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.test.tsx index a0d137b90e84c..c156b870e7aa3 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.test.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.test.tsx @@ -151,7 +151,7 @@ describe('DatatableComponent', () => { dispatchEvent={onDispatchEvent} getType={jest.fn()} rowHasRowClickTriggerActions={[false, false, false]} - renderMode="display" + renderMode="view" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={({ get: jest.fn() } as unknown) as IUiSettingsClient} /> @@ -427,7 +427,7 @@ describe('DatatableComponent', () => { formatFactory={() => ({ convert: (x) => x } as IFieldFormat)} dispatchEvent={onDispatchEvent} getType={jest.fn()} - renderMode="display" + renderMode="view" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={({ get: jest.fn() } as unknown) as IUiSettingsClient} /> @@ -457,7 +457,7 @@ describe('DatatableComponent', () => { formatFactory={() => ({ convert: (x) => x } as IFieldFormat)} dispatchEvent={onDispatchEvent} getType={jest.fn()} - renderMode="display" + renderMode="view" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={({ get: jest.fn() } as unknown) as IUiSettingsClient} /> @@ -485,7 +485,7 @@ describe('DatatableComponent', () => { formatFactory={() => ({ convert: (x) => x } as IFieldFormat)} dispatchEvent={onDispatchEvent} getType={jest.fn()} - renderMode="display" + renderMode="view" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={({ get: jest.fn() } as unknown) as IUiSettingsClient} /> @@ -546,7 +546,7 @@ describe('DatatableComponent', () => { formatFactory={() => ({ convert: (x) => x } as IFieldFormat)} dispatchEvent={onDispatchEvent} getType={jest.fn()} - renderMode="display" + renderMode="view" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={({ get: jest.fn() } as unknown) as IUiSettingsClient} /> @@ -581,7 +581,7 @@ describe('DatatableComponent', () => { formatFactory={() => ({ convert: (x) => x } as IFieldFormat)} dispatchEvent={onDispatchEvent} getType={jest.fn()} - renderMode="display" + renderMode="view" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={({ get: jest.fn() } as unknown) as IUiSettingsClient} /> @@ -616,7 +616,7 @@ describe('DatatableComponent', () => { formatFactory={() => ({ convert: (x) => x } as IFieldFormat)} dispatchEvent={onDispatchEvent} getType={jest.fn()} - renderMode="display" + renderMode="view" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={({ get: jest.fn() } as unknown) as IUiSettingsClient} /> @@ -650,7 +650,7 @@ describe('DatatableComponent', () => { formatFactory={() => ({ convert: (x) => x } as IFieldFormat)} dispatchEvent={onDispatchEvent} getType={jest.fn()} - renderMode="display" + renderMode="view" paletteService={chartPluginMock.createPaletteRegistry()} uiSettings={({ get: jest.fn() } as unknown) as IUiSettingsClient} /> diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.tsx b/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.tsx index ac1324385dbd1..6f00dc37fcd52 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.tsx @@ -20,7 +20,7 @@ import { } from '@elastic/eui'; import type { LensFilterEvent, LensTableRowContextMenuEvent } from '../../types'; import type { FormatFactory } from '../../../common'; -import { LensGridDirection } from '../../../common/expressions'; +import type { LensGridDirection } from '../../../common/expressions'; import { VisualizationContainer } from '../../visualization_container'; import { EmptyPlaceholder, findMinMaxByColumnId } from '../../shared_components'; import { LensIconChartDatatable } from '../../assets/chart_datatable'; diff --git a/x-pack/plugins/lens/public/datatable_visualization/expression.test.tsx b/x-pack/plugins/lens/public/datatable_visualization/expression.test.tsx index b2a25cba329df..74c33a2b02a5b 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/expression.test.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/expression.test.tsx @@ -9,7 +9,7 @@ import type { DatatableProps } from '../../common/expressions'; import type { LensMultiTable } from '../../common'; import { createMockExecutionContext } from '../../../../../src/plugins/expressions/common/mocks'; import type { FormatFactory } from '../../common'; -import { getDatatable } from './expression'; +import { getDatatable } from '../../common/expressions'; function sampleArgs() { const indexPatternId = 'indexPatternId'; diff --git a/x-pack/plugins/lens/public/datatable_visualization/expression.tsx b/x-pack/plugins/lens/public/datatable_visualization/expression.tsx index 4e541bce9a8c2..03691d56ee56a 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/expression.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/expression.tsx @@ -18,9 +18,7 @@ import { DatatableComponent } from './components/table_basic'; import type { ILensInterpreterRenderHandlers } from '../types'; import type { FormatFactory } from '../../common'; -import { DatatableProps } from '../../common/expressions'; - -export { datatableColumn, getDatatable } from '../../common/expressions'; +import type { DatatableProps } from '../../common/expressions'; export const getDatatableRenderer = (dependencies: { formatFactory: FormatFactory; diff --git a/x-pack/plugins/lens/public/datatable_visualization/index.ts b/x-pack/plugins/lens/public/datatable_visualization/index.ts index 3349f229a6048..51f1f54cc03ce 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/index.ts +++ b/x-pack/plugins/lens/public/datatable_visualization/index.ts @@ -23,23 +23,14 @@ export interface DatatableVisualizationPluginSetupPlugins { } export class DatatableVisualization { - constructor() {} - setup( core: CoreSetup, { expressions, formatFactory, editorFrame, charts }: DatatableVisualizationPluginSetupPlugins ) { editorFrame.registerVisualization(async () => { - const { - getDatatable, - datatableColumn, - getDatatableRenderer, - getDatatableVisualization, - } = await import('../async_services'); + const { getDatatableRenderer, getDatatableVisualization } = await import('../async_services'); const palettes = await charts.palettes.getPalettes(); - expressions.registerFunction(() => datatableColumn); - expressions.registerFunction(() => getDatatable(() => formatFactory)); expressions.registerRenderer(() => getDatatableRenderer({ formatFactory, @@ -50,6 +41,7 @@ export class DatatableVisualization { uiSettings: core.uiSettings, }) ); + return getDatatableVisualization({ paletteService: palettes }); }); } diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.tsx index 010e4d73c4791..28c0567d784ea 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.tsx @@ -382,7 +382,7 @@ export const ChartSwitch = memo(function ChartSwitch(props: Props) { 'xpack.lens.chartSwitch.dataLossDescription', { defaultMessage: - 'Selecting this visualization type will result in a partial loss of currently applied configuration selections.', + 'Selecting this visualization type will remove incompatible configuration options and multiple layers, if present', } )} iconProps={{ 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 31705d6b92933..c34e3c4137368 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 @@ -79,7 +79,7 @@ export interface WorkspacePanelProps { interface WorkspaceState { expressionBuildError?: Array<{ shortMessage: string; - longMessage: string; + longMessage: React.ReactNode; fixAction?: DatasourceFixAction; }>; expandError: boolean; @@ -416,10 +416,10 @@ export const VisualizationWrapper = ({ localState: WorkspaceState & { configurationValidationError?: Array<{ shortMessage: string; - longMessage: string; + longMessage: React.ReactNode; fixAction?: DatasourceFixAction; }>; - missingRefsErrors?: Array<{ shortMessage: string; longMessage: string }>; + missingRefsErrors?: Array<{ shortMessage: string; longMessage: React.ReactNode }>; }; ExpressionRendererComponent: ReactExpressionRendererType; application: ApplicationStart; @@ -454,7 +454,7 @@ export const VisualizationWrapper = ({ validationError: | { shortMessage: string; - longMessage: string; + longMessage: React.ReactNode; fixAction?: DatasourceFixAction; } | undefined @@ -499,7 +499,7 @@ export const VisualizationWrapper = ({ .map((validationError) => ( <>

    diff --git a/x-pack/plugins/lens/public/editor_frame_service/service.tsx b/x-pack/plugins/lens/public/editor_frame_service/service.tsx index e1b1c637fa24b..d97cfd3cbca23 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/service.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/service.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { CoreSetup, CoreStart } from 'kibana/public'; +import { CoreStart } from 'kibana/public'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/public'; import { ExpressionsSetup, ExpressionsStart } from '../../../../../src/plugins/expressions/public'; import { EmbeddableSetup, EmbeddableStart } from '../../../../../src/plugins/embeddable/public'; @@ -22,7 +22,6 @@ import { EditorFrameStart, } from '../types'; import { Document } from '../persistence/saved_object_store'; -import { mergeTables } from '../../common/expressions'; import { UiActionsStart } from '../../../../../src/plugins/ui_actions/public'; import { ChartsPluginSetup } from '../../../../../src/plugins/charts/public'; import { DashboardStart } from '../../../../../src/plugins/dashboard/public'; @@ -59,8 +58,6 @@ async function collectAsyncDefinitions( } export class EditorFrameService { - constructor() {} - private readonly datasources: Array Promise)> = []; private readonly visualizations: Array Promise)> = []; @@ -81,12 +78,7 @@ export class EditorFrameService { return await persistedStateToExpression(resolvedDatasources, resolvedVisualizations, doc); }; - public setup( - core: CoreSetup, - plugins: EditorFrameSetupPlugins - ): EditorFrameSetup { - plugins.expressions.registerFunction(() => mergeTables); - + public setup(): EditorFrameSetup { return { registerDatasource: (datasource) => { this.datasources.push(datasource as Datasource); diff --git a/x-pack/plugins/lens/public/editor_frame_service/types.ts b/x-pack/plugins/lens/public/editor_frame_service/types.ts index ebfd098b5fb19..9435faf374420 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/types.ts +++ b/x-pack/plugins/lens/public/editor_frame_service/types.ts @@ -11,6 +11,6 @@ export type TableInspectorAdapter = Record; export interface ErrorMessage { shortMessage: string; - longMessage: string; + longMessage: React.ReactNode; type?: 'fixable' | 'critical'; } diff --git a/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx b/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx index 74aac932a6861..be20118ba2941 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx +++ b/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx @@ -11,6 +11,7 @@ import { LensByReferenceInput, LensSavedObjectAttributes, LensEmbeddableInput, + ResolvedLensSavedObjectAttributes, } from './embeddable'; import { ReactExpressionRendererProps } from 'src/plugins/expressions/public'; import { Query, TimeRange, Filter, IndexPatternsContract } from 'src/plugins/data/public'; @@ -68,12 +69,17 @@ const options = { const attributeServiceMockFromSavedVis = (document: Document): LensAttributeService => { const core = coreMock.createStart(); const service = new AttributeService< - LensSavedObjectAttributes, + ResolvedLensSavedObjectAttributes, LensByValueInput, LensByReferenceInput >('lens', jest.fn(), core.i18n.Context, core.notifications.toasts, options); service.unwrapAttributes = jest.fn((input: LensByValueInput | LensByReferenceInput) => { - return Promise.resolve({ ...document } as LensSavedObjectAttributes); + return Promise.resolve({ + ...document, + sharingSavedObjectProps: { + outcome: 'exactMatch', + }, + } as ResolvedLensSavedObjectAttributes); }); service.wrapAttributes = jest.fn(); return service; @@ -86,7 +92,7 @@ describe('embeddable', () => { let trigger: { exec: jest.Mock }; let basePath: IBasePath; let attributeService: AttributeService< - LensSavedObjectAttributes, + ResolvedLensSavedObjectAttributes, LensByValueInput, LensByReferenceInput >; @@ -223,6 +229,50 @@ describe('embeddable', () => { expect(expressionRenderer).toHaveBeenCalledTimes(0); }); + it('should not render the vis if loaded saved object conflicts', async () => { + attributeService.unwrapAttributes = jest.fn( + (input: LensByValueInput | LensByReferenceInput) => { + return Promise.resolve({ + ...savedVis, + sharingSavedObjectProps: { + outcome: 'conflict', + errorJSON: '{targetType: "lens", sourceId: "1", targetSpace: "space"}', + aliasTargetId: '2', + }, + } as ResolvedLensSavedObjectAttributes); + } + ); + const embeddable = new Embeddable( + { + timefilter: dataPluginMock.createSetupContract().query.timefilter.timefilter, + attributeService, + inspector: inspectorPluginMock.createStartContract(), + expressionRenderer, + basePath, + indexPatternService: {} as IndexPatternsContract, + capabilities: { + canSaveDashboards: true, + canSaveVisualizations: true, + }, + getTrigger, + documentToExpression: () => + Promise.resolve({ + ast: { + type: 'expression', + chain: [ + { type: 'function', function: 'my', arguments: {} }, + { type: 'function', function: 'expression', arguments: {} }, + ], + }, + errors: undefined, + }), + }, + {} as LensEmbeddableInput + ); + await embeddable.initializeSavedVis({} as LensEmbeddableInput); + expect(expressionRenderer).toHaveBeenCalledTimes(0); + }); + it('should initialize output with deduped list of index patterns', async () => { attributeService = attributeServiceMockFromSavedVis({ ...savedVis, @@ -516,7 +566,8 @@ describe('embeddable', () => { timeRange, query, filters, - renderMode: 'noInteractivity', + renderMode: 'view', + disableTriggers: true, } as LensEmbeddableInput; const embeddable = new Embeddable( @@ -549,7 +600,12 @@ describe('embeddable', () => { await embeddable.initializeSavedVis(input); embeddable.render(mountpoint); - expect(expressionRenderer.mock.calls[0][0].renderMode).toEqual('noInteractivity'); + expect(expressionRenderer.mock.calls[0][0]).toEqual( + expect.objectContaining({ + interactive: false, + renderMode: 'view', + }) + ); }); it('should merge external context with query and filters of the saved object', async () => { diff --git a/x-pack/plugins/lens/public/embeddable/embeddable.tsx b/x-pack/plugins/lens/public/embeddable/embeddable.tsx index 172274b1f90bc..d10423c76686c 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable.tsx +++ b/x-pack/plugins/lens/public/embeddable/embeddable.tsx @@ -41,7 +41,11 @@ import { ReferenceOrValueEmbeddable, } from '../../../../../src/plugins/embeddable/public'; import { Document, injectFilterReferences } from '../persistence'; -import { ExpressionWrapper, ExpressionWrapperProps } from './expression_wrapper'; +import { + ExpressionWrapper, + ExpressionWrapperProps, + savedObjectConflictError, +} from './expression_wrapper'; import { UiActionsStart } from '../../../../../src/plugins/ui_actions/public'; import { isLensBrushEvent, @@ -58,8 +62,12 @@ import { IBasePath } from '../../../../../src/core/public'; import { LensAttributeService } from '../lens_attribute_service'; import type { ErrorMessage } from '../editor_frame_service/types'; import { getLensInspectorService, LensInspector } from '../lens_inspector_service'; +import { SharingSavedObjectProps } from '../types'; export type LensSavedObjectAttributes = Omit; +export interface ResolvedLensSavedObjectAttributes extends LensSavedObjectAttributes { + sharingSavedObjectProps?: SharingSavedObjectProps; +} interface LensBaseEmbeddableInput extends EmbeddableInput { filters?: Filter[]; @@ -76,7 +84,7 @@ interface LensBaseEmbeddableInput extends EmbeddableInput { } export type LensByValueInput = { - attributes: LensSavedObjectAttributes; + attributes: ResolvedLensSavedObjectAttributes; } & LensBaseEmbeddableInput; export type LensByReferenceInput = SavedObjectEmbeddableInput & LensBaseEmbeddableInput; @@ -253,15 +261,18 @@ export class Embeddable } async initializeSavedVis(input: LensEmbeddableInput) { - const attributes: - | LensSavedObjectAttributes + const attrs: + | ResolvedLensSavedObjectAttributes | false = await this.deps.attributeService.unwrapAttributes(input).catch((e: Error) => { this.onFatalError(e); return false; }); - if (!attributes || this.isDestroyed) { + if (!attrs || this.isDestroyed) { return; } + + const { sharingSavedObjectProps, ...attributes } = attrs; + this.savedVis = { ...attributes, type: this.type, @@ -269,8 +280,12 @@ export class Embeddable }; const { ast, errors } = await this.deps.documentToExpression(this.savedVis); this.errors = errors; + if (sharingSavedObjectProps?.outcome === 'conflict') { + const conflictError = savedObjectConflictError(sharingSavedObjectProps.errorJSON!); + this.errors = this.errors ? [...this.errors, conflictError] : [conflictError]; + } this.expression = ast ? toExpression(ast) : null; - if (errors) { + if (this.errors) { this.logError('validation'); } await this.initializeOutput(); @@ -346,6 +361,7 @@ export class Embeddable searchSessionId={this.externalSearchContext.searchSessionId} handleEvent={this.handleEvent} onData$={this.updateActiveData} + interactive={!input.disableTriggers} renderMode={input.renderMode} syncColors={input.syncColors} hasCompatibleActions={this.hasCompatibleActions} diff --git a/x-pack/plugins/lens/public/embeddable/embeddable_component.tsx b/x-pack/plugins/lens/public/embeddable/embeddable_component.tsx index e8095f6c741a4..7f65e50bf4429 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable_component.tsx +++ b/x-pack/plugins/lens/public/embeddable/embeddable_component.tsx @@ -6,8 +6,8 @@ */ import React, { FC, useEffect } from 'react'; -import { CoreStart } from 'kibana/public'; -import { UiActionsStart } from 'src/plugins/ui_actions/public'; +import type { CoreStart } from 'kibana/public'; +import type { UiActionsStart } from 'src/plugins/ui_actions/public'; import type { Start as InspectorStartContract } from 'src/plugins/inspector/public'; import { EuiLoadingChart } from '@elastic/eui'; import { diff --git a/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts b/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts index 5620f053cebf2..954905c51a4b7 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts +++ b/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts @@ -21,7 +21,7 @@ import { UiActionsStart } from '../../../../../src/plugins/ui_actions/public'; import { Start as InspectorStart } from '../../../../../src/plugins/inspector/public'; import { Document } from '../persistence/saved_object_store'; import { LensAttributeService } from '../lens_attribute_service'; -import { DOC_TYPE } from '../../common'; +import { DOC_TYPE } from '../../common/constants'; import { ErrorMessage } from '../editor_frame_service/types'; import { extract, inject } from '../../common/embeddable_factory'; diff --git a/x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx b/x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx index d57e1c450fea2..c827fe74cc52b 100644 --- a/x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx +++ b/x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx @@ -5,10 +5,20 @@ * 2.0. */ -import React from 'react'; +import React, { useState } from 'react'; import { I18nProvider } from '@kbn/i18n/react'; import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiFlexGroup, EuiFlexItem, EuiText, EuiIcon, EuiEmptyPrompt } from '@elastic/eui'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiText, + EuiIcon, + EuiEmptyPrompt, + EuiButtonEmpty, + EuiCallOut, + EuiSpacer, + EuiLink, +} from '@elastic/eui'; import { ExpressionRendererEvent, ReactExpressionRendererType, @@ -18,6 +28,7 @@ import type { KibanaExecutionContext } from 'src/core/public'; import { ExecutionContextSearch } from 'src/plugins/data/public'; import { DefaultInspectorAdapters, RenderMode } from 'src/plugins/expressions'; import classNames from 'classnames'; +import { i18n } from '@kbn/i18n'; import { getOriginalRequestErrorMessages } from '../editor_frame_service/error_helper'; import { ErrorMessage } from '../editor_frame_service/types'; import { LensInspector } from '../lens_inspector_service'; @@ -27,6 +38,7 @@ export interface ExpressionWrapperProps { expression: string | null; errors: ErrorMessage[] | undefined; variables?: Record; + interactive?: boolean; searchContext: ExecutionContextSearch; searchSessionId?: string; handleEvent: (event: ExpressionRendererEvent) => void; @@ -102,6 +114,7 @@ export function ExpressionWrapper({ searchContext, variables, handleEvent, + interactive, searchSessionId, onData$, renderMode, @@ -126,6 +139,7 @@ export function ExpressionWrapper({ padding="s" variables={variables} expression={expression} + interactive={interactive} searchContext={searchContext} searchSessionId={searchSessionId} onData$={onData$} @@ -158,3 +172,52 @@ export function ExpressionWrapper({ ); } + +const SavedObjectConflictMessage = ({ json }: { json: string }) => { + const [expandError, setExpandError] = useState(false); + return ( + <> + + {i18n.translate('xpack.lens.embeddable.legacyURLConflict.documentationLinkText', { + defaultMessage: 'legacy URL alias', + })} + + ), + }} + /> + + {expandError ? ( + + ) : ( + setExpandError(true)}> + {i18n.translate('xpack.lens.embeddable.legacyURLConflict.expandError', { + defaultMessage: `Show more`, + })} + + )} + + ); +}; + +export const savedObjectConflictError = (json: string): ErrorMessage => ({ + shortMessage: i18n.translate('xpack.lens.embeddable.legacyURLConflict.shortMessage', { + defaultMessage: `You've encountered a URL conflict`, + }), + longMessage: , +}); diff --git a/x-pack/plugins/lens/public/expressions.ts b/x-pack/plugins/lens/public/expressions.ts new file mode 100644 index 0000000000000..27f3179a2d0c8 --- /dev/null +++ b/x-pack/plugins/lens/public/expressions.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 type { ExpressionsSetup } from 'src/plugins/expressions/public'; + +import { + axisExtentConfig, + yAxisConfig, + axisTitlesVisibilityConfig, +} from '../common/expressions/xy_chart/axis_config'; +import { gridlinesConfig } from '../common/expressions/xy_chart/grid_lines_config'; +import { labelsOrientationConfig } from '../common/expressions/xy_chart/labels_orientation_config'; +import { layerConfig } from '../common/expressions/xy_chart/layer_config'; +import { legendConfig } from '../common/expressions/xy_chart/legend_config'; +import { tickLabelsConfig } from '../common/expressions/xy_chart/tick_labels_config'; +import { xyChart } from '../common/expressions/xy_chart/xy_chart'; + +import { getDatatable } from '../common/expressions/datatable/datatable'; +import { datatableColumn } from '../common/expressions/datatable/datatable_column'; + +import { heatmap } from '../common/expressions/heatmap_chart/heatmap_chart'; +import { heatmapGridConfig } from '../common/expressions/heatmap_chart/heatmap_grid'; +import { heatmapLegendConfig } from '../common/expressions/heatmap_chart/heatmap_legend'; + +import { mergeTables } from '../common/expressions/merge_tables'; +import { renameColumns } from '../common/expressions/rename_columns/rename_columns'; +import { pie } from '../common/expressions/pie_chart/pie_chart'; +import { formatColumn } from '../common/expressions/format_column'; +import { counterRate } from '../common/expressions/counter_rate'; +import { getTimeScale } from '../common/expressions/time_scale/time_scale'; +import { metricChart } from '../common/expressions/metric_chart/metric_chart'; + +export const setupExpressions = ( + expressions: ExpressionsSetup, + formatFactory: Parameters[0], + getTimeZone: Parameters[0] +) => + [ + pie, + xyChart, + mergeTables, + counterRate, + metricChart, + yAxisConfig, + layerConfig, + formatColumn, + legendConfig, + renameColumns, + gridlinesConfig, + datatableColumn, + tickLabelsConfig, + axisTitlesVisibilityConfig, + heatmap, + heatmapLegendConfig, + heatmapGridConfig, + axisExtentConfig, + labelsOrientationConfig, + getDatatable(formatFactory), + getTimeScale(getTimeZone), + ].forEach((expressionFn) => expressions.registerFunction(expressionFn)); diff --git a/x-pack/plugins/lens/public/heatmap_visualization/dimension_editor.tsx b/x-pack/plugins/lens/public/heatmap_visualization/dimension_editor.tsx index ca4a65e6fb10f..8adcf3ef79122 100644 --- a/x-pack/plugins/lens/public/heatmap_visualization/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/heatmap_visualization/dimension_editor.tsx @@ -64,7 +64,7 @@ export function HeatmapDimensionEditor( { setIsPaletteOpen(!isPaletteOpen); diff --git a/x-pack/plugins/lens/public/heatmap_visualization/expression.tsx b/x-pack/plugins/lens/public/heatmap_visualization/expression.tsx index 98ce4b399ae8d..84c8f987f524d 100644 --- a/x-pack/plugins/lens/public/heatmap_visualization/expression.tsx +++ b/x-pack/plugins/lens/public/heatmap_visualization/expression.tsx @@ -17,8 +17,6 @@ import type { ChartsPluginSetup, PaletteRegistry } from '../../../../../src/plug import { HeatmapChartReportable } from './chart_component'; import type { HeatmapExpressionProps } from './types'; -export { heatmapGridConfig, heatmapLegendConfig, heatmap } from '../../common/expressions'; - export const getHeatmapRenderer = (dependencies: { formatFactory: FormatFactory; chartsThemeService: ChartsPluginSetup['theme']; diff --git a/x-pack/plugins/lens/public/heatmap_visualization/index.ts b/x-pack/plugins/lens/public/heatmap_visualization/index.ts index 5fb4524939f11..3ac3f769e4b5f 100644 --- a/x-pack/plugins/lens/public/heatmap_visualization/index.ts +++ b/x-pack/plugins/lens/public/heatmap_visualization/index.ts @@ -20,28 +20,15 @@ export interface HeatmapVisualizationPluginSetupPlugins { } export class HeatmapVisualization { - constructor() {} - setup( core: CoreSetup, { expressions, formatFactory, editorFrame, charts }: HeatmapVisualizationPluginSetupPlugins ) { editorFrame.registerVisualization(async () => { const timeZone = getTimeZone(core.uiSettings); - - const { - getHeatmapVisualization, - heatmap, - heatmapLegendConfig, - heatmapGridConfig, - getHeatmapRenderer, - } = await import('../async_services'); + const { getHeatmapVisualization, getHeatmapRenderer } = await import('../async_services'); const palettes = await charts.palettes.getPalettes(); - expressions.registerFunction(() => heatmap); - expressions.registerFunction(() => heatmapLegendConfig); - expressions.registerFunction(() => heatmapGridConfig); - expressions.registerRenderer( getHeatmapRenderer({ formatFactory, diff --git a/x-pack/plugins/lens/public/heatmap_visualization/utils.ts b/x-pack/plugins/lens/public/heatmap_visualization/utils.ts index a21c07b874bff..3f860be646f35 100644 --- a/x-pack/plugins/lens/public/heatmap_visualization/utils.ts +++ b/x-pack/plugins/lens/public/heatmap_visualization/utils.ts @@ -14,9 +14,12 @@ import type { HeatmapVisualizationState } from './types'; export function getSafePaletteParams( paletteService: PaletteRegistry, currentData: Datatable | undefined, - accessor: string, + accessor: string | undefined, activePalette?: HeatmapVisualizationState['palette'] ) { + if (currentData == null || accessor == null) { + return { displayStops: [], activePalette: {} as HeatmapVisualizationState['palette'] }; + } const finalActivePalette: HeatmapVisualizationState['palette'] = activePalette ?? { type: 'palette', name: DEFAULT_PALETTE_NAME, diff --git a/x-pack/plugins/lens/public/heatmap_visualization/visualization.test.ts b/x-pack/plugins/lens/public/heatmap_visualization/visualization.test.ts index 5e7ee1b8b097b..91b90e11470fc 100644 --- a/x-pack/plugins/lens/public/heatmap_visualization/visualization.test.ts +++ b/x-pack/plugins/lens/public/heatmap_visualization/visualization.test.ts @@ -98,7 +98,12 @@ describe('heatmap', () => { }; }); - test('resolves configuration from complete state', () => { + afterEach(() => { + // some tests manipulate it, so restore a pristine version + frame = createMockFramePublicAPI(); + }); + + test('resolves configuration from complete state and available data', () => { const state: HeatmapVisualizationState = { ...exampleState(), layerId: 'first', @@ -107,6 +112,8 @@ describe('heatmap', () => { valueAccessor: 'v-accessor', }; + frame.activeData = { first: { type: 'datatable', columns: [], rows: [] } }; + expect( getHeatmapVisualization({ paletteService, @@ -204,6 +211,63 @@ describe('heatmap', () => { ], }); }); + + test("resolves configuration when there's no access to active data in frame", () => { + const state: HeatmapVisualizationState = { + ...exampleState(), + layerId: 'first', + xAccessor: 'x-accessor', + yAccessor: 'y-accessor', + valueAccessor: 'v-accessor', + }; + + frame.activeData = undefined; + + expect( + getHeatmapVisualization({ + paletteService, + }).getConfiguration({ state, frame, layerId: 'first' }) + ).toEqual({ + groups: [ + { + layerId: 'first', + groupId: GROUP_ID.X, + groupLabel: 'Horizontal axis', + accessors: [{ columnId: 'x-accessor' }], + filterOperations: filterOperationsAxis, + supportsMoreColumns: false, + required: true, + dataTestSubj: 'lnsHeatmap_xDimensionPanel', + }, + { + layerId: 'first', + groupId: GROUP_ID.Y, + groupLabel: 'Vertical axis', + accessors: [{ columnId: 'y-accessor' }], + filterOperations: filterOperationsAxis, + supportsMoreColumns: false, + required: false, + dataTestSubj: 'lnsHeatmap_yDimensionPanel', + }, + { + layerId: 'first', + groupId: GROUP_ID.CELL, + groupLabel: 'Cell value', + accessors: [ + { + columnId: 'v-accessor', + triggerIcon: 'none', + }, + ], + filterOperations: isCellValueSupported, + supportsMoreColumns: false, + required: true, + dataTestSubj: 'lnsHeatmap_cellPanel', + enableDimensionEditor: true, + }, + ], + }); + }); }); describe('#setDimension', () => { diff --git a/x-pack/plugins/lens/public/heatmap_visualization/visualization.tsx b/x-pack/plugins/lens/public/heatmap_visualization/visualization.tsx index 62e3138f397da..674af79db6c90 100644 --- a/x-pack/plugins/lens/public/heatmap_visualization/visualization.tsx +++ b/x-pack/plugins/lens/public/heatmap_visualization/visualization.tsx @@ -158,16 +158,12 @@ export const getHeatmapVisualization = ({ return { groups: [] }; } - const { displayStops, activePalette } = state.valueAccessor - ? getSafePaletteParams( - paletteService, - frame.activeData?.[state.layerId], - state.valueAccessor, - state?.palette && state.palette.accessor === state.valueAccessor - ? state.palette - : undefined - ) - : { displayStops: [], activePalette: {} as HeatmapVisualizationState['palette'] }; + const { displayStops, activePalette } = getSafePaletteParams( + paletteService, + frame.activeData?.[state.layerId], + state.valueAccessor, + state?.palette && state.palette.accessor === state.valueAccessor ? state.palette : undefined + ); return { groups: [ @@ -199,11 +195,21 @@ export const getHeatmapVisualization = ({ }), accessors: state.valueAccessor ? [ - { - columnId: state.valueAccessor, - triggerIcon: 'colorBy', - palette: getStopsForFixedMode(displayStops, activePalette?.params?.colorStops), - }, + // When data is not available and the range type is numeric, return a placeholder while refreshing + displayStops.length && + (frame.activeData || activePalette?.params?.rangeType !== 'number') + ? { + columnId: state.valueAccessor, + triggerIcon: 'colorBy', + palette: getStopsForFixedMode( + displayStops, + activePalette?.params?.colorStops + ), + } + : { + columnId: state.valueAccessor, + triggerIcon: 'none', + }, ] : [], filterOperations: isCellValueSupported, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/time_scaling.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/time_scaling.tsx index 7c611230683d3..8a670e7562573 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/time_scaling.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/time_scaling.tsx @@ -5,9 +5,16 @@ * 2.0. */ -import { EuiToolTip } from '@elastic/eui'; -import { EuiIcon } from '@elastic/eui'; -import { EuiFormRow, EuiSelect, EuiFlexItem, EuiFlexGroup, EuiButtonIcon } from '@elastic/eui'; +import { + EuiToolTip, + EuiIcon, + EuiFormRow, + EuiSelect, + EuiFlexItem, + EuiFlexGroup, + EuiButtonIcon, +} from '@elastic/eui'; + import { i18n } from '@kbn/i18n'; import React from 'react'; import { @@ -17,7 +24,7 @@ import { } from '../operations'; import type { TimeScaleUnit } from '../../../common/expressions'; import { unitSuffixesLong } from '../../../common/suffix_formatter'; -import { IndexPatternLayer } from '../types'; +import type { IndexPatternLayer } from '../types'; export function setTimeScaling( columnId: string, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/index.ts b/x-pack/plugins/lens/public/indexpattern_datasource/index.ts index 9ff80f51bea97..5f4afc9df6179 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/index.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/index.ts @@ -20,7 +20,6 @@ import type { FieldFormatsStart, FieldFormatsSetup, } from '../../../../../src/plugins/field_formats/public'; -import { getTimeZone } from '../utils'; export interface IndexPatternDatasourceSetupPlugins { expressions: ExpressionsSetup; @@ -38,8 +37,6 @@ export interface IndexPatternDatasourceStartPlugins { } export class IndexPatternDatasource { - constructor() {} - setup( core: CoreSetup, { @@ -50,15 +47,9 @@ export class IndexPatternDatasource { }: IndexPatternDatasourceSetupPlugins ) { editorFrame.registerDatasource(async () => { - const { - getIndexPatternDatasource, - renameColumns, - formatColumn, - counterRate, - getTimeScale, - getSuffixFormatter, - suffixFormatterId, - } = await import('../async_services'); + const { getIndexPatternDatasource, getSuffixFormatter, suffixFormatterId } = await import( + '../async_services' + ); if (!fieldFormatsSetup.has(suffixFormatterId)) { const startServices = createStartServicesGetter(core.getStartServices); @@ -69,11 +60,6 @@ export class IndexPatternDatasource { fieldFormatsSetup.register([suffixFormatter]); } - expressions.registerFunction(getTimeScale(() => getTimeZone(core.uiSettings))); - expressions.registerFunction(counterRate); - expressions.registerFunction(renameColumns); - expressions.registerFunction(formatColumn); - const [ coreStart, { indexPatternFieldEditor, uiActions, data, fieldFormats }, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx index 8f66bcf7fe49c..6a45e3c987f3d 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx @@ -70,19 +70,13 @@ export function columnToOperation(column: IndexPatternColumn, uniqueLabel?: stri }; } -export { - CounterRateArgs, - ExpressionFunctionCounterRate, - counterRate, -} from '../../common/expressions'; -export { FormatColumnArgs, supportedFormats, formatColumn } from '../../common/expressions'; +export type { FormatColumnArgs, TimeScaleArgs, CounterRateArgs } from '../../common/expressions'; + export { getSuffixFormatter, unitSuffixesLong, suffixFormatterId, } from '../../common/suffix_formatter'; -export { getTimeScale, TimeScaleArgs } from '../../common/expressions'; -export { renameColumns } from '../../common/expressions'; export function getIndexPatternDatasource({ core, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern_suggestions.ts b/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern_suggestions.ts index cff036db4813b..b0793bf912bb2 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern_suggestions.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern_suggestions.ts @@ -8,7 +8,7 @@ import { flatten, minBy, pick, mapValues, partition } from 'lodash'; import { i18n } from '@kbn/i18n'; import { generateId } from '../id_generator'; -import { DatasourceSuggestion, TableChangeType } from '../types'; +import type { DatasourceSuggestion, TableChangeType } from '../types'; import { columnToOperation } from './indexpattern'; import { insertNewColumn, @@ -23,7 +23,7 @@ import { getReferencedColumnIds, } from './operations'; import { hasField } from './utils'; -import { +import type { IndexPattern, IndexPatternPrivateState, IndexPatternLayer, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.tsx index ceb02ab724ac5..29e7de18ca4ad 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/ranges.tsx @@ -21,7 +21,7 @@ import { RangeEditor } from './range_editor'; import { OperationDefinition } from '../index'; import { FieldBasedIndexPatternColumn } from '../column_types'; import { updateColumnParam } from '../../layer_helpers'; -import { supportedFormats } from '../../../../../common/expressions'; +import { supportedFormats } from '../../../../../common/expressions/format_column/supported_formats'; import { MODES, AUTO_BARS, DEFAULT_INTERVAL, MIN_HISTOGRAM_BARS, SLICES } from './constants'; import { IndexPattern, IndexPatternField } from '../../../types'; import { getInvalidFieldMessage, isValidNumber } from '../helpers'; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/types.ts b/x-pack/plugins/lens/public/indexpattern_datasource/types.ts index 72acc114ca4b2..588b259520272 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/types.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/types.ts @@ -9,6 +9,7 @@ import type { IndexPatternColumn, IncompleteColumn } from './operations'; import type { IndexPatternAggRestrictions } from '../../../../../src/plugins/data/public'; import type { FieldSpec } from '../../../../../src/plugins/data/common'; import type { DragDropIdentifier } from '../drag_drop/providers'; +import type { FieldFormatParams } from '../../../../../src/plugins/field_formats/common'; export { FieldBasedIndexPatternColumn, @@ -51,7 +52,7 @@ export interface IndexPattern { string, { id: string; - params: unknown; + params: FieldFormatParams; } >; hasRestrictions: boolean; diff --git a/x-pack/plugins/lens/public/lens_attribute_service.ts b/x-pack/plugins/lens/public/lens_attribute_service.ts index 39a1903c6d0c4..fb4ef4fee72ef 100644 --- a/x-pack/plugins/lens/public/lens_attribute_service.ts +++ b/x-pack/plugins/lens/public/lens_attribute_service.ts @@ -5,51 +5,72 @@ * 2.0. */ -import { CoreStart } from '../../../../src/core/public'; -import { LensPluginStartDependencies } from './plugin'; -import { AttributeService } from '../../../../src/plugins/embeddable/public'; -import { - LensSavedObjectAttributes, +import type { CoreStart } from '../../../../src/core/public'; +import type { LensPluginStartDependencies } from './plugin'; +import type { AttributeService } from '../../../../src/plugins/embeddable/public'; +import type { + ResolvedLensSavedObjectAttributes, LensByValueInput, LensByReferenceInput, } from './embeddable/embeddable'; -import { SavedObjectIndexStore, Document } from './persistence'; +import { SavedObjectIndexStore } from './persistence'; import { checkForDuplicateTitle, OnSaveProps } from '../../../../src/plugins/saved_objects/public'; -import { DOC_TYPE } from '../common'; +import { DOC_TYPE } from '../common/constants'; export type LensAttributeService = AttributeService< - LensSavedObjectAttributes, + ResolvedLensSavedObjectAttributes, LensByValueInput, LensByReferenceInput >; -function documentToAttributes(doc: Document): LensSavedObjectAttributes { - delete doc.savedObjectId; - delete doc.type; - return { ...doc }; -} - export function getLensAttributeService( core: CoreStart, startDependencies: LensPluginStartDependencies ): LensAttributeService { const savedObjectStore = new SavedObjectIndexStore(core.savedObjects.client); return startDependencies.embeddable.getAttributeService< - LensSavedObjectAttributes, + ResolvedLensSavedObjectAttributes, LensByValueInput, LensByReferenceInput >(DOC_TYPE, { - saveMethod: async (attributes: LensSavedObjectAttributes, savedObjectId?: string) => { + saveMethod: async (attributes: ResolvedLensSavedObjectAttributes, savedObjectId?: string) => { + const { sharingSavedObjectProps, ...attributesToSave } = attributes; const savedDoc = await savedObjectStore.save({ - ...attributes, + ...attributesToSave, savedObjectId, type: DOC_TYPE, }); return { id: savedDoc.savedObjectId }; }, - unwrapMethod: async (savedObjectId: string): Promise => { - const attributes = documentToAttributes(await savedObjectStore.load(savedObjectId)); - return attributes; + unwrapMethod: async (savedObjectId: string): Promise => { + const { + saved_object: savedObject, + outcome, + alias_target_id: aliasTargetId, + } = await savedObjectStore.load(savedObjectId); + const { attributes, references, type, id } = savedObject; + const document = { + ...attributes, + references, + }; + + const sharingSavedObjectProps = { + aliasTargetId, + outcome, + errorJSON: + outcome === 'conflict' + ? JSON.stringify({ + targetType: type, + sourceId: id, + targetSpace: (await startDependencies.spaces.getActiveSpace()).id, + }) + : undefined, + }; + + return { + sharingSavedObjectProps, + ...document, + }; }, checkForDuplicateTitle: (props: OnSaveProps) => { const savedObjectsClient = core.savedObjects.client; diff --git a/x-pack/plugins/lens/public/metric_visualization/expression.test.tsx b/x-pack/plugins/lens/public/metric_visualization/expression.test.tsx index 36ae3904f073c..a3ac5b5837772 100644 --- a/x-pack/plugins/lens/public/metric_visualization/expression.test.tsx +++ b/x-pack/plugins/lens/public/metric_visualization/expression.test.tsx @@ -5,8 +5,8 @@ * 2.0. */ -import { MetricChart, metricChart } from './expression'; -import { MetricConfig } from '../../common/expressions'; +import { MetricChart } from './expression'; +import { MetricConfig, metricChart } from '../../common/expressions'; import React from 'react'; import { shallow } from 'enzyme'; import { createMockExecutionContext } from '../../../../../src/plugins/expressions/common/mocks'; diff --git a/x-pack/plugins/lens/public/metric_visualization/expression.tsx b/x-pack/plugins/lens/public/metric_visualization/expression.tsx index 41b487e790a08..8838e6df777c9 100644 --- a/x-pack/plugins/lens/public/metric_visualization/expression.tsx +++ b/x-pack/plugins/lens/public/metric_visualization/expression.tsx @@ -19,9 +19,7 @@ import { EmptyPlaceholder } from '../shared_components'; import { LensIconChartMetric } from '../assets/chart_metric'; import type { FormatFactory } from '../../common'; import type { MetricChartProps } from '../../common/expressions'; - -export { metricChart } from '../../common/expressions'; -export type { MetricState, MetricConfig } from '../../common/expressions'; +export type { MetricChartProps, MetricState, MetricConfig } from '../../common/expressions'; export const getMetricChartRenderer = ( formatFactory: FormatFactory diff --git a/x-pack/plugins/lens/public/metric_visualization/index.ts b/x-pack/plugins/lens/public/metric_visualization/index.ts index 29138979ab858..20c25b285bd5b 100644 --- a/x-pack/plugins/lens/public/metric_visualization/index.ts +++ b/x-pack/plugins/lens/public/metric_visualization/index.ts @@ -17,18 +17,12 @@ export interface MetricVisualizationPluginSetupPlugins { } export class MetricVisualization { - constructor() {} - setup( _core: CoreSetup | null, { expressions, formatFactory, editorFrame }: MetricVisualizationPluginSetupPlugins ) { editorFrame.registerVisualization(async () => { - const { metricVisualization, metricChart, getMetricChartRenderer } = await import( - '../async_services' - ); - - expressions.registerFunction(() => metricChart); + const { metricVisualization, getMetricChartRenderer } = await import('../async_services'); expressions.registerRenderer(() => getMetricChartRenderer(formatFactory)); return metricVisualization; diff --git a/x-pack/plugins/lens/public/metric_visualization/metric_suggestions.ts b/x-pack/plugins/lens/public/metric_visualization/metric_suggestions.ts index de79f5f0a4cbc..3d6b2683b4ad2 100644 --- a/x-pack/plugins/lens/public/metric_visualization/metric_suggestions.ts +++ b/x-pack/plugins/lens/public/metric_visualization/metric_suggestions.ts @@ -6,7 +6,7 @@ */ import { SuggestionRequest, VisualizationSuggestion, TableSuggestion } from '../types'; -import { MetricState } from '../../common/expressions'; +import type { MetricState } from '../../common/expressions'; import { layerTypes } from '../../common'; import { LensIconChartMetric } from '../assets/chart_metric'; diff --git a/x-pack/plugins/lens/public/mocks.tsx b/x-pack/plugins/lens/public/mocks.tsx index b2c8d3948b285..8fbd263fe909e 100644 --- a/x-pack/plugins/lens/public/mocks.tsx +++ b/x-pack/plugins/lens/public/mocks.tsx @@ -24,11 +24,12 @@ import { LensAppServices } from './app_plugin/types'; import { DOC_TYPE, layerTypes } from '../common'; import { DataPublicPluginStart, esFilters, UI_SETTINGS } from '../../../../src/plugins/data/public'; import { inspectorPluginMock } from '../../../../src/plugins/inspector/public/mocks'; +import { spacesPluginMock } from '../../spaces/public/mocks'; import { dashboardPluginMock } from '../../../../src/plugins/dashboard/public/mocks'; import type { LensByValueInput, - LensSavedObjectAttributes, LensByReferenceInput, + ResolvedLensSavedObjectAttributes, } from './embeddable/embeddable'; import { mockAttributeService, @@ -352,7 +353,7 @@ export function makeDefaultServices( function makeAttributeService(): LensAttributeService { const attributeServiceMock = mockAttributeService< - LensSavedObjectAttributes, + ResolvedLensSavedObjectAttributes, LensByValueInput, LensByReferenceInput >( @@ -365,7 +366,12 @@ export function makeDefaultServices( core ); - attributeServiceMock.unwrapAttributes = jest.fn().mockResolvedValue(doc); + attributeServiceMock.unwrapAttributes = jest.fn().mockResolvedValue({ + ...doc, + sharingSavedObjectProps: { + outcome: 'exactMatch', + }, + }); attributeServiceMock.wrapAttributes = jest.fn().mockResolvedValue({ savedObjectId: ((doc as unknown) as LensByReferenceInput).savedObjectId, }); @@ -404,6 +410,7 @@ export function makeDefaultServices( remove: jest.fn(), clear: jest.fn(), }, + spaces: spacesPluginMock.createStartContract(), }; } diff --git a/x-pack/plugins/lens/public/persistence/saved_object_store.test.ts b/x-pack/plugins/lens/public/persistence/saved_object_store.test.ts index ab0708d99f082..29fc88a81d182 100644 --- a/x-pack/plugins/lens/public/persistence/saved_object_store.test.ts +++ b/x-pack/plugins/lens/public/persistence/saved_object_store.test.ts @@ -5,17 +5,14 @@ * 2.0. */ -import { SavedObjectsClientContract, SavedObjectsBulkUpdateObject } from 'kibana/public'; +import { SavedObjectsClientContract } from 'kibana/public'; import { SavedObjectIndexStore } from './saved_object_store'; describe('LensStore', () => { function testStore(testId?: string) { const client = { create: jest.fn(() => Promise.resolve({ id: testId || 'testid' })), - bulkUpdate: jest.fn(([{ id }]: SavedObjectsBulkUpdateObject[]) => - Promise.resolve({ savedObjects: [{ id }, { id }] }) - ), - get: jest.fn(), + resolve: jest.fn(), }; return { @@ -81,7 +78,7 @@ describe('LensStore', () => { }); test('updates and returns a visualization document', async () => { - const { client, store } = testStore(); + const { client, store } = testStore('Gandalf'); const doc = await store.save({ savedObjectId: 'Gandalf', title: 'Even the very wise cannot see all ends.', @@ -108,23 +105,11 @@ describe('LensStore', () => { }, }); - expect(client.bulkUpdate).toHaveBeenCalledTimes(1); - expect(client.bulkUpdate).toHaveBeenCalledWith([ - { - type: 'lens', - id: 'Gandalf', - references: [], - attributes: { - title: null, - visualizationType: null, - state: null, - }, - }, - { - type: 'lens', - id: 'Gandalf', - references: [], - attributes: { + expect(client.create).toHaveBeenCalledTimes(1); + expect(client.create.mock.calls).toEqual([ + [ + 'lens', + { title: 'Even the very wise cannot see all ends.', visualizationType: 'line', state: { @@ -134,7 +119,8 @@ describe('LensStore', () => { filters: [], }, }, - }, + { references: [], id: 'Gandalf', overwrite: true }, + ], ]); }); }); @@ -142,15 +128,18 @@ describe('LensStore', () => { describe('load', () => { test('throws if an error is returned', async () => { const { client, store } = testStore(); - client.get = jest.fn(async () => ({ - id: 'Paul', - type: 'lens', - attributes: { - title: 'Hope clouds observation.', - visualizationType: 'dune', - state: '{ "datasource": { "giantWorms": true } }', + client.resolve = jest.fn(async () => ({ + outcome: 'exactMatch', + saved_object: { + id: 'Paul', + type: 'lens', + attributes: { + title: 'Hope clouds observation.', + visualizationType: 'dune', + state: '{ "datasource": { "giantWorms": true } }', + }, + error: new Error('shoot dang!'), }, - error: new Error('shoot dang!'), })); await expect(store.load('Paul')).rejects.toThrow('shoot dang!'); diff --git a/x-pack/plugins/lens/public/persistence/saved_object_store.ts b/x-pack/plugins/lens/public/persistence/saved_object_store.ts index c87548daf53dc..b8615b8852b1a 100644 --- a/x-pack/plugins/lens/public/persistence/saved_object_store.ts +++ b/x-pack/plugins/lens/public/persistence/saved_object_store.ts @@ -9,9 +9,11 @@ import { SavedObjectAttributes, SavedObjectsClientContract, SavedObjectReference, + ResolvedSimpleSavedObject, } from 'kibana/public'; import { Query } from '../../../../../src/plugins/data/public'; import { DOC_TYPE, PersistableFilter } from '../../common'; +import { LensSavedObjectAttributes } from '../async_services'; export interface Document { savedObjectId?: string; @@ -37,7 +39,7 @@ export interface DocumentSaver { } export interface DocumentLoader { - load: (savedObjectId: string) => Promise; + load: (savedObjectId: string) => Promise; } export type SavedObjectStore = DocumentLoader & DocumentSaver; @@ -55,50 +57,33 @@ export class SavedObjectIndexStore implements SavedObjectStore { // remove this workaround when SavedObjectAttributes is updated. const attributes = (rest as unknown) as SavedObjectAttributes; - const result = await (savedObjectId - ? this.safeUpdate(savedObjectId, attributes, references) - : this.client.create(DOC_TYPE, attributes, { - references, - })); + const result = await this.client.create( + DOC_TYPE, + attributes, + savedObjectId + ? { + references, + overwrite: true, + id: savedObjectId, + } + : { + references, + } + ); return { ...vis, savedObjectId: result.id }; }; - // As Lens is using an object to store its attributes, using the update API - // will merge the new attribute object with the old one, not overwriting deleted - // keys. As Lens is using objects as maps in various places, this is a problem because - // deleted subtrees make it back into the object after a load. - // This function fixes this by doing two updates - one to empty out the document setting - // every key to null, and a second one to load the new content. - private async safeUpdate( - savedObjectId: string, - attributes: SavedObjectAttributes, - references: SavedObjectReference[] - ) { - const resetAttributes: SavedObjectAttributes = {}; - Object.keys(attributes).forEach((key) => { - resetAttributes[key] = null; - }); - return ( - await this.client.bulkUpdate([ - { type: DOC_TYPE, id: savedObjectId, attributes: resetAttributes, references }, - { type: DOC_TYPE, id: savedObjectId, attributes, references }, - ]) - ).savedObjects[1]; - } - - async load(savedObjectId: string): Promise { - const { type, attributes, references, error } = await this.client.get(DOC_TYPE, savedObjectId); + async load(savedObjectId: string): Promise> { + const resolveResult = await this.client.resolve( + DOC_TYPE, + savedObjectId + ); - if (error) { - throw error; + if (resolveResult.saved_object.error) { + throw resolveResult.saved_object.error; } - return { - ...(attributes as SavedObjectAttributes), - references, - savedObjectId, - type, - } as Document; + return resolveResult; } } diff --git a/x-pack/plugins/lens/public/pie_visualization/expression.tsx b/x-pack/plugins/lens/public/pie_visualization/expression.tsx index c1b9f4c799e64..d26289450bd0f 100644 --- a/x-pack/plugins/lens/public/pie_visualization/expression.tsx +++ b/x-pack/plugins/lens/public/pie_visualization/expression.tsx @@ -19,8 +19,6 @@ import type { FormatFactory } from '../../common'; import type { PieExpressionProps } from '../../common/expressions'; import type { ChartsPluginSetup, PaletteRegistry } from '../../../../../src/plugins/charts/public'; -export { pie } from '../../common/expressions'; - export const getPieRenderer = (dependencies: { formatFactory: FormatFactory; chartsThemeService: ChartsPluginSetup['theme']; @@ -44,6 +42,7 @@ export const getPieRenderer = (dependencies: { {...config} formatFactory={dependencies.formatFactory} chartsThemeService={dependencies.chartsThemeService} + interactive={handlers.isInteractive()} paletteService={dependencies.paletteService} onClickValue={onClickValue} renderMode={handlers.getRenderMode()} diff --git a/x-pack/plugins/lens/public/pie_visualization/index.ts b/x-pack/plugins/lens/public/pie_visualization/index.ts index 6d34de85f1801..b4670b3b9c9dd 100644 --- a/x-pack/plugins/lens/public/pie_visualization/index.ts +++ b/x-pack/plugins/lens/public/pie_visualization/index.ts @@ -24,18 +24,14 @@ export interface PieVisualizationPluginStartPlugins { } export class PieVisualization { - constructor() {} - setup( core: CoreSetup, { expressions, formatFactory, editorFrame, charts }: PieVisualizationPluginSetupPlugins ) { editorFrame.registerVisualization(async () => { - const { getPieVisualization, pie, getPieRenderer } = await import('../async_services'); + const { getPieVisualization, getPieRenderer } = await import('../async_services'); const palettes = await charts.palettes.getPalettes(); - expressions.registerFunction(() => pie); - expressions.registerRenderer( getPieRenderer({ formatFactory, diff --git a/x-pack/plugins/lens/public/pie_visualization/render_function.test.tsx b/x-pack/plugins/lens/public/pie_visualization/render_function.test.tsx index 93f16c49061e4..209d7ff652ea1 100644 --- a/x-pack/plugins/lens/public/pie_visualization/render_function.test.tsx +++ b/x-pack/plugins/lens/public/pie_visualization/render_function.test.tsx @@ -77,7 +77,7 @@ describe('PieVisualization component', () => { onClickValue: jest.fn(), chartsThemeService, paletteService: chartPluginMock.createPaletteRegistry(), - renderMode: 'display' as const, + renderMode: 'view' as const, syncColors: false, }; } @@ -302,10 +302,10 @@ describe('PieVisualization component', () => { `); }); - test('does not set click listener on noInteractivity render mode', () => { + test('does not set click listener on non-interactive mode', () => { const defaultArgs = getDefaultArgs(); const component = shallow( - + ); expect(component.find(Settings).first().prop('onElementClick')).toBeUndefined(); }); diff --git a/x-pack/plugins/lens/public/pie_visualization/render_function.tsx b/x-pack/plugins/lens/public/pie_visualization/render_function.tsx index 41b96ff4324ae..e79066b0145d2 100644 --- a/x-pack/plugins/lens/public/pie_visualization/render_function.tsx +++ b/x-pack/plugins/lens/public/pie_visualization/render_function.tsx @@ -55,6 +55,7 @@ export function PieComponent( props: PieExpressionProps & { formatFactory: FormatFactory; chartsThemeService: ChartsPluginSetup['theme']; + interactive?: boolean; paletteService: PaletteRegistry; onClickValue: (data: LensFilterEvent['data']) => void; renderMode: RenderMode; @@ -242,7 +243,7 @@ export function PieComponent( reportDescription={props.args.description} className="lnsPieExpression__container" > - ; + ); } @@ -252,7 +253,7 @@ export function PieComponent( { meta: { type: 'number' }, } ) - ).toEqual(-100); + ).toEqual(0); }); - it('returns epsilon when metric is 0 without fallback', () => { + it('returns 0 when metric value is 0', () => { expect( getSliceValue( { a: 'Cat', b: 'Home', c: 0 }, @@ -46,7 +46,20 @@ describe('render helpers', () => { meta: { type: 'number' }, } ) - ).toEqual(Number.EPSILON); + ).toEqual(0); + }); + + it('returns 0 when metric value is infinite', () => { + expect( + getSliceValue( + { a: 'Cat', b: 'Home', c: Number.POSITIVE_INFINITY }, + { + id: 'c', + name: 'C', + meta: { type: 'number' }, + } + ) + ).toEqual(0); }); }); diff --git a/x-pack/plugins/lens/public/pie_visualization/render_helpers.ts b/x-pack/plugins/lens/public/pie_visualization/render_helpers.ts index 4a5587feaf271..d2858efa90153 100644 --- a/x-pack/plugins/lens/public/pie_visualization/render_helpers.ts +++ b/x-pack/plugins/lens/public/pie_visualization/render_helpers.ts @@ -10,10 +10,8 @@ import { Datatable, DatatableColumn } from 'src/plugins/expressions/public'; import { LensFilterEvent } from '../types'; export function getSliceValue(d: Datum, metricColumn: DatatableColumn) { - if (typeof d[metricColumn.id] === 'number' && d[metricColumn.id] !== 0) { - return d[metricColumn.id]; - } - return Number.EPSILON; + const value = d[metricColumn.id]; + return Number.isFinite(value) && value >= 0 ? value : 0; } export function getFilterContext( diff --git a/x-pack/plugins/lens/public/plugin.ts b/x-pack/plugins/lens/public/plugin.ts index 95f2e13cbc464..5326927d2c6c5 100644 --- a/x-pack/plugins/lens/public/plugin.ts +++ b/x-pack/plugins/lens/public/plugin.ts @@ -5,27 +5,34 @@ * 2.0. */ -import { AppMountParameters, CoreSetup, CoreStart } from 'kibana/public'; +import type { AppMountParameters, CoreSetup, CoreStart } from 'kibana/public'; import type { Start as InspectorStartContract } from 'src/plugins/inspector/public'; import type { FieldFormatsSetup, FieldFormatsStart } from 'src/plugins/field_formats/public'; -import { UsageCollectionSetup, UsageCollectionStart } from 'src/plugins/usage_collection/public'; -import { DataPublicPluginSetup, DataPublicPluginStart } from '../../../../src/plugins/data/public'; -import { EmbeddableSetup, EmbeddableStart } from '../../../../src/plugins/embeddable/public'; -import { DashboardStart } from '../../../../src/plugins/dashboard/public'; -import { +import type { + UsageCollectionSetup, + UsageCollectionStart, +} from 'src/plugins/usage_collection/public'; +import type { + DataPublicPluginSetup, + DataPublicPluginStart, +} from '../../../../src/plugins/data/public'; +import type { EmbeddableSetup, EmbeddableStart } from '../../../../src/plugins/embeddable/public'; +import type { DashboardStart } from '../../../../src/plugins/dashboard/public'; +import type { SpacesPluginStart } from '../../spaces/public'; +import type { ExpressionsServiceSetup, ExpressionsSetup, ExpressionsStart, } from '../../../../src/plugins/expressions/public'; -import { +import type { VisualizationsSetup, VisualizationsStart, } from '../../../../src/plugins/visualizations/public'; -import { NavigationPublicPluginStart } from '../../../../src/plugins/navigation/public'; -import { UrlForwardingSetup } from '../../../../src/plugins/url_forwarding/public'; -import { GlobalSearchPluginSetup } from '../../global_search/public'; -import { ChartsPluginSetup, ChartsPluginStart } from '../../../../src/plugins/charts/public'; -import { PresentationUtilPluginStart } from '../../../../src/plugins/presentation_util/public'; +import type { NavigationPublicPluginStart } from '../../../../src/plugins/navigation/public'; +import type { UrlForwardingSetup } from '../../../../src/plugins/url_forwarding/public'; +import type { GlobalSearchPluginSetup } from '../../global_search/public'; +import type { ChartsPluginSetup, ChartsPluginStart } from '../../../../src/plugins/charts/public'; +import type { PresentationUtilPluginStart } from '../../../../src/plugins/presentation_util/public'; import { EmbeddableStateTransfer } from '../../../../src/plugins/embeddable/public'; import type { EditorFrameService as EditorFrameServiceType } from './editor_frame_service'; import { IndexPatternFieldEditorStart } from '../../../../src/plugins/index_pattern_field_editor/public'; @@ -50,29 +57,33 @@ import type { PieVisualizationPluginSetupPlugins, } from './pie_visualization'; import type { HeatmapVisualization as HeatmapVisualizationType } from './heatmap_visualization'; -import { AppNavLinkStatus } from '../../../../src/core/public'; import type { SavedObjectTaggingPluginStart } from '../../saved_objects_tagging/public'; +import { AppNavLinkStatus } from '../../../../src/core/public'; + import { UiActionsStart, ACTION_VISUALIZE_FIELD, VISUALIZE_FIELD_TRIGGER, } from '../../../../src/plugins/ui_actions/public'; -import { APP_ID, FormatFactory, getEditPath, NOT_INTERNATIONALIZED_PRODUCT_NAME } from '../common'; -import type { EditorFrameStart, VisualizationType } from './types'; +import { APP_ID, getEditPath, NOT_INTERNATIONALIZED_PRODUCT_NAME } from '../common/constants'; +import type { FormatFactory } from '../common/types'; +import type { VisualizationType } from './types'; import { getLensAliasConfig } from './vis_type_alias'; import { visualizeFieldAction } from './trigger_actions/visualize_field_actions'; -import { getSearchProvider } from './search_provider'; -import { LensAttributeService } from './lens_attribute_service'; -import { LensEmbeddableInput } from './embeddable'; +import type { LensEmbeddableInput } from './embeddable'; import { EmbeddableFactory, LensEmbeddableStartServices } from './embeddable/embeddable_factory'; import { EmbeddableComponentProps, getEmbeddableComponent, } from './embeddable/embeddable_component'; import { getSaveModalComponent } from './app_plugin/shared/saved_modal_lazy'; -import { SaveModalContainerProps } from './app_plugin/save_modal_container'; +import type { SaveModalContainerProps } from './app_plugin/save_modal_container'; + +import { createStartServicesGetter } from '../../../../src/plugins/kibana_utils/public'; +import { setupExpressions } from './expressions'; +import { getSearchProvider } from './search_provider'; export interface LensPluginSetupDependencies { urlForwarding: UrlForwardingSetup; @@ -100,6 +111,7 @@ export interface LensPluginStartDependencies { presentationUtil: PresentationUtilPluginStart; indexPatternFieldEditor: IndexPatternFieldEditorStart; inspector: InspectorStartContract; + spaces: SpacesPluginStart; usageCollection?: UsageCollectionStart; } @@ -152,8 +164,6 @@ export interface LensPublicStart { export class LensPlugin { private datatableVisualization: DatatableVisualizationType | undefined; private editorFrameService: EditorFrameServiceType | undefined; - private createEditorFrame: EditorFrameStart['createInstance'] | null = null; - private attributeService: (() => Promise) | null = null; private indexpatternDatasource: IndexPatternDatasourceType | undefined; private xyVisualization: XyVisualizationType | undefined; private metricVisualization: MetricVisualizationType | undefined; @@ -176,37 +186,32 @@ export class LensPlugin { usageCollection, }: LensPluginSetupDependencies ) { - this.attributeService = async () => { - const { getLensAttributeService } = await import('./async_services'); - const [coreStart, startDependencies] = await core.getStartServices(); - return getLensAttributeService(coreStart, startDependencies); - }; + const startServices = createStartServicesGetter(core.getStartServices); const getStartServices = async (): Promise => { - const [coreStart, deps] = await core.getStartServices(); + const { getLensAttributeService } = await import('./async_services'); + const { core: coreStart, plugins } = startServices(); - this.initParts( + await this.initParts( core, data, - embeddable, charts, expressions, - usageCollection, fieldFormats, - deps.fieldFormats.deserialize + plugins.fieldFormats.deserialize ); return { - attributeService: await this.attributeService!(), + attributeService: getLensAttributeService(coreStart, plugins), capabilities: coreStart.application.capabilities, coreHttp: coreStart.http, - timefilter: deps.data.query.timefilter.timefilter, - expressionRenderer: deps.expressions.ReactExpressionRenderer, + timefilter: plugins.data.query.timefilter.timefilter, + expressionRenderer: plugins.expressions.ReactExpressionRenderer, documentToExpression: this.editorFrameService!.documentToExpression, - indexPatternService: deps.data.indexPatterns, - uiActions: deps.uiActions, + indexPatternService: plugins.data.indexPatterns, + uiActions: plugins.uiActions, usageCollection, - inspector: deps.inspector, + inspector: plugins.inspector, }; }; @@ -216,17 +221,22 @@ export class LensPlugin { visualizations.registerAlias(getLensAliasConfig()); - const getPresentationUtilContext = async () => { - const [, deps] = await core.getStartServices(); - const { ContextProvider } = deps.presentationUtil; - return ContextProvider; - }; + setupExpressions( + expressions, + () => startServices().plugins.fieldFormats.deserialize, + async () => { + const { getTimeZone } = await import('./utils'); + return getTimeZone(core.uiSettings); + } + ); + + const getPresentationUtilContext = () => + startServices().plugins.presentationUtil.ContextProvider; const ensureDefaultIndexPattern = async () => { - const [, deps] = await core.getStartServices(); // make sure a default index pattern exists // if not, the page will be redirected to management and visualize won't be rendered - await deps.data.indexPatterns.ensureDefaultIndexPattern(); + await startServices().plugins.data.indexPatterns.ensureDefaultIndexPattern(); }; core.application.register({ @@ -234,25 +244,27 @@ export class LensPlugin { title: NOT_INTERNATIONALIZED_PRODUCT_NAME, navLinkStatus: AppNavLinkStatus.hidden, mount: async (params: AppMountParameters) => { - const [, deps] = await core.getStartServices(); + const { core: coreStart, plugins: deps } = startServices(); await this.initParts( core, data, - embeddable, charts, expressions, - usageCollection, fieldFormats, deps.fieldFormats.deserialize ); - const { mountApp, stopReportManager } = await import('./async_services'); + const { mountApp, stopReportManager, getLensAttributeService } = await import( + './async_services' + ); + const frameStart = this.editorFrameService!.start(coreStart, deps); + this.stopReportManager = stopReportManager; await ensureDefaultIndexPattern(); return mountApp(core, params, { - createEditorFrame: this.createEditorFrame!, - attributeService: this.attributeService!, + createEditorFrame: frameStart.createInstance, + attributeService: getLensAttributeService(coreStart, deps), getPresentationUtilContext, }); }, @@ -278,10 +290,8 @@ export class LensPlugin { private async initParts( core: CoreSetup, data: DataPublicPluginSetup, - embeddable: EmbeddableSetup | undefined, charts: ChartsPluginSetup, expressions: ExpressionsServiceSetup, - usageCollection: UsageCollectionSetup | undefined, fieldFormats: FieldFormatsSetup, formatFactory: FormatFactory ) { @@ -301,13 +311,9 @@ export class LensPlugin { this.metricVisualization = new MetricVisualization(); this.pieVisualization = new PieVisualization(); this.heatmapVisualization = new HeatmapVisualization(); - const editorFrameSetupInterface = this.editorFrameService.setup(core, { - data, - embeddable, - charts, - expressions, - usageCollection, - }); + + const editorFrameSetupInterface = this.editorFrameService.setup(); + const dependencies: IndexPatternDatasourceSetupPlugins & XyVisualizationPluginSetupPlugins & DatatableVisualizationPluginSetupPlugins & @@ -326,9 +332,6 @@ export class LensPlugin { this.metricVisualization.setup(core, dependencies); this.pieVisualization.setup(core, dependencies); this.heatmapVisualization.setup(core, dependencies); - const [coreStart, startDependencies] = await core.getStartServices(); - const frameStart = this.editorFrameService.start(coreStart, startDependencies); - this.createEditorFrame = frameStart.createInstance; } start(core: CoreStart, startDependencies: LensPluginStartDependencies): LensPublicStart { @@ -343,7 +346,7 @@ export class LensPlugin { return { EmbeddableComponent: getEmbeddableComponent(core, startDependencies), - SaveModalComponent: getSaveModalComponent(core, startDependencies, this.attributeService!), + SaveModalComponent: getSaveModalComponent(core, startDependencies), navigateToPrefilledEditor: ( input, { openInNewTab = false, originatingApp = '', originatingPath } = {} diff --git a/x-pack/plugins/lens/public/search_provider.ts b/x-pack/plugins/lens/public/search_provider.ts index 4bc18f2653a0b..a0d41da2d9740 100644 --- a/x-pack/plugins/lens/public/search_provider.ts +++ b/x-pack/plugins/lens/public/search_provider.ts @@ -5,12 +5,13 @@ * 2.0. */ -import { ApplicationStart } from 'kibana/public'; +import type { ApplicationStart } from 'kibana/public'; import { from, of } from 'rxjs'; import { i18n } from '@kbn/i18n'; import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public'; -import { GlobalSearchResultProvider } from '../../global_search/public'; -import { getFullPath } from '../common'; +import { getFullPath } from '../common/constants'; + +import type { GlobalSearchResultProvider } from '../../global_search/public'; /** * Global search provider adding a Lens entry. diff --git a/x-pack/plugins/lens/public/shared_components/coloring/palette_configuration.test.tsx b/x-pack/plugins/lens/public/shared_components/coloring/palette_configuration.test.tsx index ad1755bdbe85c..33f6ac379cd80 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/palette_configuration.test.tsx +++ b/x-pack/plugins/lens/public/shared_components/coloring/palette_configuration.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { EuiColorPalettePickerPaletteProps } from '@elastic/eui'; +import { EuiButtonGroup, EuiColorPalettePickerPaletteProps } from '@elastic/eui'; import { mountWithIntl } from '@kbn/test/jest'; import { chartPluginMock } from 'src/plugins/charts/public/mocks'; import type { PaletteOutput, PaletteRegistry } from 'src/plugins/charts/public'; @@ -14,6 +14,8 @@ import { ReactWrapper } from 'enzyme'; import type { CustomPaletteParams } from '../../../common'; import { applyPaletteParams } from './utils'; import { CustomizablePalette } from './palette_configuration'; +import { CUSTOM_PALETTE } from './constants'; +import { act } from 'react-dom/test-utils'; // mocking random id generator function jest.mock('@elastic/eui', () => { @@ -128,71 +130,165 @@ describe('palette panel', () => { }); }); - describe('reverse option', () => { - beforeEach(() => { - props = { - activePalette: { type: 'palette', name: 'positive' }, - palettes: paletteRegistry, - setPalette: jest.fn(), - dataBounds: { min: 0, max: 100 }, - }; + it('should restore the reverse initial state on transitioning', () => { + const instance = mountWithIntl(); + + changePaletteIn(instance, 'negative'); + + expect(props.setPalette).toHaveBeenCalledWith({ + type: 'palette', + name: 'negative', + params: expect.objectContaining({ + name: 'negative', + reverse: false, + }), }); + }); + + it('should rewrite the min/max range values on palette change', () => { + const instance = mountWithIntl(); + + changePaletteIn(instance, 'custom'); - function toggleReverse(instance: ReactWrapper, checked: boolean) { - return instance - .find('[data-test-subj="lnsPalettePanel_dynamicColoring_reverse"]') - .first() - .prop('onClick')!({} as React.MouseEvent); - } - - it('should reverse the colorStops on click', () => { - const instance = mountWithIntl(); - - toggleReverse(instance, true); - - expect(props.setPalette).toHaveBeenCalledWith( - expect.objectContaining({ - params: expect.objectContaining({ - reverse: true, - }), - }) - ); + expect(props.setPalette).toHaveBeenCalledWith({ + type: 'palette', + name: 'custom', + params: expect.objectContaining({ + rangeMin: 0, + rangeMax: 50, + }), }); }); + }); - describe('custom stops', () => { - beforeEach(() => { - props = { - activePalette: { type: 'palette', name: 'positive' }, - palettes: paletteRegistry, - setPalette: jest.fn(), - dataBounds: { min: 0, max: 100 }, - }; + describe('reverse option', () => { + beforeEach(() => { + props = { + activePalette: { type: 'palette', name: 'positive' }, + palettes: paletteRegistry, + setPalette: jest.fn(), + dataBounds: { min: 0, max: 100 }, + }; + }); + + function toggleReverse(instance: ReactWrapper, checked: boolean) { + return instance + .find('[data-test-subj="lnsPalettePanel_dynamicColoring_reverse"]') + .first() + .prop('onClick')!({} as React.MouseEvent); + } + + it('should reverse the colorStops on click', () => { + const instance = mountWithIntl(); + + toggleReverse(instance, true); + + expect(props.setPalette).toHaveBeenCalledWith( + expect.objectContaining({ + params: expect.objectContaining({ + reverse: true, + }), + }) + ); + }); + + it('should transition a predefined palette to a custom one on reverse click', () => { + const instance = mountWithIntl(); + + toggleReverse(instance, true); + + expect(props.setPalette).toHaveBeenCalledWith( + expect.objectContaining({ + params: expect.objectContaining({ + name: CUSTOM_PALETTE, + }), + }) + ); + }); + }); + + describe('percentage / number modes', () => { + beforeEach(() => { + props = { + activePalette: { type: 'palette', name: 'positive' }, + palettes: paletteRegistry, + setPalette: jest.fn(), + dataBounds: { min: 5, max: 200 }, + }; + }); + + it('should switch mode and range boundaries on click', () => { + const instance = mountWithIntl(); + act(() => { + instance + .find('[data-test-subj="lnsPalettePanel_dynamicColoring_custom_range_groups"]') + .find(EuiButtonGroup) + .prop('onChange')!('number'); }); - it('should be visible for predefined palettes', () => { - const instance = mountWithIntl(); - expect( - instance.find('[data-test-subj="lnsPalettePanel_dynamicColoring_custom_stops"]').exists() - ).toEqual(true); + + act(() => { + instance + .find('[data-test-subj="lnsPalettePanel_dynamicColoring_custom_range_groups"]') + .find(EuiButtonGroup) + .prop('onChange')!('percent'); }); - it('should be visible for custom palettes', () => { - const instance = mountWithIntl( - { + beforeEach(() => { + props = { + activePalette: { type: 'palette', name: 'positive' }, + palettes: paletteRegistry, + setPalette: jest.fn(), + dataBounds: { min: 0, max: 100 }, + }; + }); + it('should be visible for predefined palettes', () => { + const instance = mountWithIntl(); + expect( + instance.find('[data-test-subj="lnsPalettePanel_dynamicColoring_custom_stops"]').exists() + ).toEqual(true); + }); + + it('should be visible for custom palettes', () => { + const instance = mountWithIntl( + - ); - expect( - instance.find('[data-test-subj="lnsPalettePanel_dynamicColoring_custom_stops"]').exists() - ).toEqual(true); - }); + }, + }} + /> + ); + expect( + instance.find('[data-test-subj="lnsPalettePanel_dynamicColoring_custom_stops"]').exists() + ).toEqual(true); }); }); }); diff --git a/x-pack/plugins/lens/public/shared_components/coloring/palette_configuration.tsx b/x-pack/plugins/lens/public/shared_components/coloring/palette_configuration.tsx index bc6a590db0cb7..0493a212f46de 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/palette_configuration.tsx +++ b/x-pack/plugins/lens/public/shared_components/coloring/palette_configuration.tsx @@ -75,11 +75,14 @@ export function CustomizablePalette({ showContinuity = true, }: { palettes: PaletteRegistry; - activePalette: PaletteOutput; + activePalette?: PaletteOutput; setPalette: (palette: PaletteOutput) => void; - dataBounds: { min: number; max: number }; + dataBounds?: { min: number; max: number }; showContinuity?: boolean; }) { + if (!dataBounds || !activePalette) { + return null; + } const isCurrentPaletteCustom = activePalette.params?.name === CUSTOM_PALETTE; const colorStopsToShow = roundStopValues( @@ -106,18 +109,24 @@ export function CustomizablePalette({ ...activePalette.params, name: newPalette.name, colorStops: undefined, + reverse: false, // restore the reverse flag }; + const newColorStops = getColorStops(palettes, [], activePalette, dataBounds); if (isNewPaletteCustom) { - newParams.colorStops = getColorStops(palettes, [], activePalette, dataBounds); + newParams.colorStops = newColorStops; } newParams.stops = getPaletteStops(palettes, newParams, { prevPalette: isNewPaletteCustom || isCurrentPaletteCustom ? undefined : newPalette.name, dataBounds, + mapFromMinValue: true, }); + newParams.rangeMin = newColorStops[0].stop; + newParams.rangeMax = newColorStops[newColorStops.length - 1].stop; + setPalette({ ...newPalette, params: newParams, @@ -266,18 +275,18 @@ export function CustomizablePalette({ ) as RequiredPaletteParamTypes['rangeType']; const params: CustomPaletteParams = { rangeType: newRangeType }; + const { min: newMin, max: newMax } = getDataMinMax(newRangeType, dataBounds); + const { min: oldMin, max: oldMax } = getDataMinMax( + activePalette.params?.rangeType, + dataBounds + ); + const newColorStops = remapStopsByNewInterval(colorStopsToShow, { + oldInterval: oldMax - oldMin, + newInterval: newMax - newMin, + newMin, + oldMin, + }); if (isCurrentPaletteCustom) { - const { min: newMin, max: newMax } = getDataMinMax(newRangeType, dataBounds); - const { min: oldMin, max: oldMax } = getDataMinMax( - activePalette.params?.rangeType, - dataBounds - ); - const newColorStops = remapStopsByNewInterval(colorStopsToShow, { - oldInterval: oldMax - oldMin, - newInterval: newMax - newMin, - newMin, - oldMin, - }); const stops = getPaletteStops( palettes, { ...activePalette.params, colorStops: newColorStops, ...params }, @@ -285,8 +294,6 @@ export function CustomizablePalette({ ); params.colorStops = newColorStops; params.stops = stops; - params.rangeMin = newColorStops[0].stop; - params.rangeMax = newColorStops[newColorStops.length - 1].stop; } else { params.stops = getPaletteStops( palettes, @@ -294,6 +301,11 @@ export function CustomizablePalette({ { prevPalette: activePalette.name, dataBounds } ); } + // why not use newMin/newMax here? + // That's because there's the concept of continuity to accomodate, where in some scenarios it has to + // take into account the stop value rather than the data value + params.rangeMin = newColorStops[0].stop; + params.rangeMax = newColorStops[newColorStops.length - 1].stop; setPalette(mergePaletteParams(activePalette, params)); }} /> @@ -309,28 +321,20 @@ export function CustomizablePalette({ className="lnsPalettePanel__reverseButton" data-test-subj="lnsPalettePanel_dynamicColoring_reverse" onClick={() => { - const params: CustomPaletteParams = { reverse: !activePalette.params?.reverse }; - if (isCurrentPaletteCustom) { - params.colorStops = reversePalette(colorStopsToShow); - params.stops = getPaletteStops( - palettes, - { - ...(activePalette?.params || {}), - colorStops: params.colorStops, - }, - { dataBounds } - ); - } else { - params.stops = reversePalette( - activePalette?.params?.stops || - getPaletteStops( - palettes, - { ...activePalette.params, ...params }, - { prevPalette: activePalette.name, dataBounds } - ) - ); - } - setPalette(mergePaletteParams(activePalette, params)); + // when reversing a palette, the palette is automatically transitioned to a custom palette + const newParams = getSwitchToCustomParams( + palettes, + activePalette, + { + colorStops: reversePalette(colorStopsToShow), + steps: activePalette.params?.steps || DEFAULT_COLOR_STEPS, + reverse: !activePalette.params?.reverse, // Store the reverse state + rangeMin: colorStopsToShow[0]?.stop, + rangeMax: colorStopsToShow[colorStopsToShow.length - 1]?.stop, + }, + dataBounds + ); + setPalette(newParams); }} > diff --git a/x-pack/plugins/lens/public/shared_components/coloring/palette_picker.tsx b/x-pack/plugins/lens/public/shared_components/coloring/palette_picker.tsx index 2a415cd178925..b21b732820eaa 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/palette_picker.tsx +++ b/x-pack/plugins/lens/public/shared_components/coloring/palette_picker.tsx @@ -83,7 +83,7 @@ export function PalettePicker({ value: id, title, type: FIXED_PROGRESSION, - palette: activePalette?.params?.reverse ? colors.reverse() : colors, + palette: colors, 'data-test-subj': `${id}-palette`, }; }); diff --git a/x-pack/plugins/lens/public/shared_components/coloring/utils.test.ts b/x-pack/plugins/lens/public/shared_components/coloring/utils.test.ts index 97dc2e45c96dc..07d93ca5c40c6 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/utils.test.ts +++ b/x-pack/plugins/lens/public/shared_components/coloring/utils.test.ts @@ -8,6 +8,7 @@ import { chartPluginMock } from 'src/plugins/charts/public/mocks'; import { applyPaletteParams, + getColorStops, getContrastColor, getDataMinMax, getPaletteStops, @@ -59,6 +60,78 @@ describe('applyPaletteParams', () => { }); }); +describe('getColorStops', () => { + const paletteRegistry = chartPluginMock.createPaletteRegistry(); + it('should return the same colorStops if a custom palette is passed, avoiding recomputation', () => { + const colorStops = [ + { stop: 0, color: 'red' }, + { stop: 100, color: 'blue' }, + ]; + expect( + getColorStops( + paletteRegistry, + colorStops, + { name: 'custom', type: 'palette' }, + { min: 0, max: 100 } + ) + ).toBe(colorStops); + }); + + it('should get a fresh list of colors', () => { + expect( + getColorStops( + paletteRegistry, + [ + { stop: 0, color: 'red' }, + { stop: 100, color: 'blue' }, + ], + { name: 'mocked', type: 'palette' }, + { min: 0, max: 100 } + ) + ).toEqual([ + { color: 'blue', stop: 0 }, + { color: 'yellow', stop: 50 }, + ]); + }); + + it('should get a fresh list of colors even if custom palette but empty colorStops', () => { + expect( + getColorStops(paletteRegistry, [], { name: 'mocked', type: 'palette' }, { min: 0, max: 100 }) + ).toEqual([ + { color: 'blue', stop: 0 }, + { color: 'yellow', stop: 50 }, + ]); + }); + + it('should correctly map the new colorStop to the current data bound and minValue', () => { + expect( + getColorStops( + paletteRegistry, + [], + { name: 'mocked', type: 'palette', params: { rangeType: 'number' } }, + { min: 100, max: 1000 } + ) + ).toEqual([ + { color: 'blue', stop: 100 }, + { color: 'yellow', stop: 550 }, + ]); + }); + + it('should reverse the colors', () => { + expect( + getColorStops( + paletteRegistry, + [], + { name: 'mocked', type: 'palette', params: { reverse: true } }, + { min: 100, max: 1000 } + ) + ).toEqual([ + { color: 'yellow', stop: 0 }, + { color: 'blue', stop: 50 }, + ]); + }); +}); + describe('remapStopsByNewInterval', () => { it('should correctly remap the current palette from 0..1 to 0...100', () => { expect( diff --git a/x-pack/plugins/lens/public/shared_components/coloring/utils.ts b/x-pack/plugins/lens/public/shared_components/coloring/utils.ts index b2969565f5390..413e3708e9c9b 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/utils.ts +++ b/x-pack/plugins/lens/public/shared_components/coloring/utils.ts @@ -269,11 +269,10 @@ export function getColorStops( palettes: PaletteRegistry, colorStops: Required['stops'], activePalette: PaletteOutput, - dataBounds: { min: number; max: number }, - defaultPalette?: string + dataBounds: { min: number; max: number } ) { // just forward the current stops if custom - if (activePalette?.name === CUSTOM_PALETTE) { + if (activePalette?.name === CUSTOM_PALETTE && colorStops?.length) { return colorStops; } // for predefined palettes create some stops, then drop the last one. diff --git a/x-pack/plugins/lens/public/state_management/index.ts b/x-pack/plugins/lens/public/state_management/index.ts index a23a040de2361..1d8f4fdffa730 100644 --- a/x-pack/plugins/lens/public/state_management/index.ts +++ b/x-pack/plugins/lens/public/state_management/index.ts @@ -6,7 +6,7 @@ */ import { configureStore, getDefaultMiddleware, DeepPartial } from '@reduxjs/toolkit'; -import logger from 'redux-logger'; +import { createLogger } from 'redux-logger'; import { useDispatch, useSelector, TypedUseSelectorHook } from 'react-redux'; import { lensSlice } from './lens_slice'; import { timeRangeMiddleware } from './time_range_middleware'; @@ -50,7 +50,14 @@ export const makeConfigureStore = ( optimizingMiddleware(), timeRangeMiddleware(storeDeps.lensServices.data), ]; - if (process.env.NODE_ENV === 'development') middleware.push(logger); + if (process.env.NODE_ENV === 'development') { + middleware.push( + createLogger({ + // @ts-ignore + predicate: () => window.ELASTIC_LENS_LOGGER, + }) + ); + } return configureStore({ reducer, diff --git a/x-pack/plugins/lens/public/state_management/init_middleware/__snapshots__/load_initial.test.tsx.snap b/x-pack/plugins/lens/public/state_management/init_middleware/__snapshots__/load_initial.test.tsx.snap new file mode 100644 index 0000000000000..32d221e14730b --- /dev/null +++ b/x-pack/plugins/lens/public/state_management/init_middleware/__snapshots__/load_initial.test.tsx.snap @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`init_middleware should initialize all datasources with state from doc 1`] = ` +Object { + "lens": Object { + "activeDatasourceId": "testDatasource", + "datasourceStates": Object { + "testDatasource": Object { + "isLoading": false, + "state": undefined, + }, + "testDatasource2": Object { + "isLoading": false, + "state": undefined, + }, + }, + "filters": Array [], + "isFullscreenDatasource": false, + "isLinkedToOriginatingApp": false, + "isLoading": false, + "isSaveable": false, + "persistedDoc": Object { + "exactMatchDoc": Object { + "expression": "definitely a valid expression", + "references": Array [ + Object { + "id": "1", + "name": "index-pattern-0", + "type": "index-pattern", + }, + ], + "savedObjectId": "1234", + "sharingSavedObjectProps": Object { + "outcome": "exactMatch", + }, + "state": Object { + "datasourceStates": Object { + "testDatasource": "datasource", + }, + "filters": Array [ + Object { + "query": Object { + "match_phrase": Object { + "src": "test", + }, + }, + }, + ], + "query": "kuery", + "visualization": Object {}, + }, + "title": "An extremely cool default document!", + "visualizationType": "testVis", + }, + "references": Array [], + "savedObjectId": "1234", + "state": Object { + "datasourceStates": Object { + "testDatasource": Object { + "datasource1": "", + }, + "testDatasource2": Object { + "datasource2": "", + }, + }, + "filters": Array [], + "query": Object { + "language": "lucene", + "query": "", + }, + "visualization": Object {}, + }, + "title": "", + "type": "lens", + "visualizationType": "testVis", + }, + "query": Object { + "language": "lucene", + "query": "", + }, + "resolvedDateRange": Object { + "fromDate": "2021-01-10T04:00:00.000Z", + "toDate": "2021-01-10T08:00:00.000Z", + }, + "searchSessionId": "sessionId-2", + "sharingSavedObjectProps": Object { + "aliasTargetId": undefined, + "outcome": undefined, + }, + "visualization": Object { + "activeId": "testVis", + "state": Object {}, + }, + }, +} +`; diff --git a/x-pack/plugins/lens/public/state_management/init_middleware/index.ts b/x-pack/plugins/lens/public/state_management/init_middleware/index.ts index bf13ca69e82c0..256684c5dbc25 100644 --- a/x-pack/plugins/lens/public/state_management/init_middleware/index.ts +++ b/x-pack/plugins/lens/public/state_management/init_middleware/index.ts @@ -19,13 +19,7 @@ export const initMiddleware = (storeDeps: LensStoreDeps) => (store: MiddlewareAP ); return (next: Dispatch) => (action: PayloadAction) => { if (lensSlice.actions.loadInitial.match(action)) { - return loadInitial( - store, - storeDeps, - action.payload.redirectCallback, - action.payload.initialInput, - action.payload.emptyState - ); + return loadInitial(store, storeDeps, action.payload); } else if (lensSlice.actions.navigateAway.match(action)) { return unsubscribeFromExternalContext(); } diff --git a/x-pack/plugins/lens/public/state_management/init_middleware/load_initial.test.tsx b/x-pack/plugins/lens/public/state_management/init_middleware/load_initial.test.tsx index 79402b698af98..8093100c5f1e8 100644 --- a/x-pack/plugins/lens/public/state_management/init_middleware/load_initial.test.tsx +++ b/x-pack/plugins/lens/public/state_management/init_middleware/load_initial.test.tsx @@ -10,13 +10,15 @@ import { defaultDoc, createMockVisualization, createMockDatasource, - DatasourceMock, } from '../../mocks'; +import { Location, History } from 'history'; import { act } from 'react-dom/test-utils'; import { loadInitial } from './load_initial'; import { LensEmbeddableInput } from '../../embeddable'; import { getPreloadedState } from '../lens_slice'; import { LensAppState } from '..'; +import { LensAppServices } from '../../app_plugin/types'; +import { DatasourceMap, VisualizationMap } from '../../types'; const defaultSavedObjectId = '1234'; const preloadedState = { @@ -27,123 +29,185 @@ const preloadedState = { }, }; -describe('Mounter', () => { - const mockDatasource: DatasourceMock = createMockDatasource('testDatasource'); - const mockDatasource2: DatasourceMock = createMockDatasource('testDatasource2'); - const datasourceMap = { - testDatasource2: mockDatasource2, - testDatasource: mockDatasource, - }; - const mockVisualization = { - ...createMockVisualization(), - id: 'testVis', - visualizationTypes: [ - { - icon: 'empty', - id: 'testVis', - label: 'TEST1', - groupLabel: 'testVisGroup', - }, - ], +const exactMatchDoc = { + ...defaultDoc, + sharingSavedObjectProps: { + outcome: 'exactMatch', + }, +}; + +const getDefaultLensServices = () => { + const lensServices = makeDefaultServices(); + lensServices.attributeService.unwrapAttributes = jest.fn().mockResolvedValue(exactMatchDoc); + return lensServices; +}; + +const getStoreDeps = (deps?: { + lensServices?: LensAppServices; + datasourceMap?: DatasourceMap; + visualizationMap?: VisualizationMap; +}) => { + const lensServices = deps?.lensServices || getDefaultLensServices(); + const datasourceMap = deps?.datasourceMap || { + testDatasource2: createMockDatasource('testDatasource2'), + testDatasource: createMockDatasource('testDatasource'), }; - const mockVisualization2 = { - ...createMockVisualization(), - id: 'testVis2', - visualizationTypes: [ - { - icon: 'empty', - id: 'testVis2', - label: 'TEST2', - groupLabel: 'testVis2Group', - }, - ], + const visualizationMap = deps?.visualizationMap || { + testVis: { + ...createMockVisualization(), + id: 'testVis', + visualizationTypes: [ + { + icon: 'empty', + id: 'testVis', + label: 'TEST1', + groupLabel: 'testVisGroup', + }, + ], + }, + testVis2: { + ...createMockVisualization(), + id: 'testVis2', + visualizationTypes: [ + { + icon: 'empty', + id: 'testVis2', + label: 'TEST2', + groupLabel: 'testVis2Group', + }, + ], + }, }; - const visualizationMap = { - testVis: mockVisualization, - testVis2: mockVisualization2, + return { + datasourceMap, + visualizationMap, + lensServices, }; +}; +describe('init_middleware', () => { it('should initialize initial datasource', async () => { - const services = makeDefaultServices(); - services.attributeService.unwrapAttributes = jest.fn().mockResolvedValue(defaultDoc); + const storeDeps = getStoreDeps(); + const { lensServices, datasourceMap } = storeDeps; const lensStore = await makeLensStore({ - data: services.data, + data: lensServices.data, preloadedState, }); await act(async () => { - await loadInitial( - lensStore, - { - lensServices: services, - datasourceMap, - visualizationMap, - }, - jest.fn(), - ({ savedObjectId: defaultSavedObjectId } as unknown) as LensEmbeddableInput - ); + await loadInitial(lensStore, storeDeps, { + redirectCallback: jest.fn(), + initialInput: ({ savedObjectId: defaultSavedObjectId } as unknown) as LensEmbeddableInput, + }); }); - expect(mockDatasource.initialize).toHaveBeenCalled(); + expect(datasourceMap.testDatasource.initialize).toHaveBeenCalled(); }); - it('should have initialized only the initial datasource and visualization', async () => { - const services = makeDefaultServices(); - services.attributeService.unwrapAttributes = jest.fn().mockResolvedValue(defaultDoc); + it('should have initialized the initial datasource and visualization', async () => { + const storeDeps = getStoreDeps(); + const { lensServices, datasourceMap, visualizationMap } = storeDeps; - const lensStore = await makeLensStore({ data: services.data, preloadedState }); + const lensStore = await makeLensStore({ data: lensServices.data, preloadedState }); await act(async () => { - await loadInitial( - lensStore, - { - lensServices: services, - datasourceMap, - visualizationMap, + await loadInitial(lensStore, storeDeps, { redirectCallback: jest.fn() }); + }); + expect(datasourceMap.testDatasource.initialize).toHaveBeenCalled(); + expect(datasourceMap.testDatasource2.initialize).not.toHaveBeenCalled(); + expect(visualizationMap.testVis.initialize).toHaveBeenCalled(); + expect(visualizationMap.testVis2.initialize).not.toHaveBeenCalled(); + }); + + it('should initialize all datasources with state from doc', async () => { + const datasource1State = { datasource1: '' }; + const datasource2State = { datasource2: '' }; + const services = makeDefaultServices(); + services.attributeService.unwrapAttributes = jest.fn().mockResolvedValue({ + exactMatchDoc, + visualizationType: 'testVis', + title: '', + state: { + datasourceStates: { + testDatasource: datasource1State, + testDatasource2: datasource2State, }, - jest.fn() - ); + visualization: {}, + query: { query: '', language: 'lucene' }, + filters: [], + }, + references: [], }); - expect(mockDatasource.initialize).toHaveBeenCalled(); - expect(mockDatasource2.initialize).not.toHaveBeenCalled(); - expect(mockVisualization.initialize).toHaveBeenCalled(); - expect(mockVisualization2.initialize).not.toHaveBeenCalled(); - }); + const storeDeps = getStoreDeps({ + lensServices: services, + visualizationMap: { + testVis: { + ...createMockVisualization(), + id: 'testVis', + visualizationTypes: [ + { + icon: 'empty', + id: 'testVis', + label: 'TEST1', + groupLabel: 'testVisGroup', + }, + ], + }, + }, + datasourceMap: { + testDatasource: createMockDatasource('testDatasource'), + testDatasource2: createMockDatasource('testDatasource2'), + testDatasource3: createMockDatasource('testDatasource3'), + }, + }); + const { datasourceMap } = storeDeps; - // it('should initialize all datasources with state from doc', async () => {}) - // it('should pass the datasource api for each layer to the visualization', async () => {}) - // it('should create a separate datasource public api for each layer', async () => {}) - // it('should not initialize visualization before datasource is initialized', async () => {}) - // it('should pass the public frame api into visualization initialize', async () => {}) - // it('should fetch suggestions of currently active datasource when initializes from visualization trigger', async () => {}) - // it.skip('should pass the datasource api for each layer to the visualization', async () => {}) - // it('displays errors from the frame in a toast', async () => { + const lensStore = await makeLensStore({ + data: services.data, + preloadedState, + }); + + await act(async () => { + await loadInitial(lensStore, storeDeps, { + redirectCallback: jest.fn(), + initialInput: ({ savedObjectId: defaultSavedObjectId } as unknown) as LensEmbeddableInput, + }); + }); + expect(datasourceMap.testDatasource.initialize).toHaveBeenCalled(); + + expect(datasourceMap.testDatasource.initialize).toHaveBeenCalledWith( + datasource1State, + [], + undefined, + { + isFullEditor: true, + } + ); + expect(datasourceMap.testDatasource2.initialize).toHaveBeenCalledWith( + datasource2State, + [], + undefined, + { + isFullEditor: true, + } + ); + expect(datasourceMap.testDatasource3.initialize).not.toHaveBeenCalled(); + expect(lensStore.getState()).toMatchSnapshot(); + }); describe('loadInitial', () => { it('does not load a document if there is no initial input', async () => { - const services = makeDefaultServices(); - const lensStore = makeLensStore({ data: services.data, preloadedState }); - await loadInitial( - lensStore, - { - lensServices: services, - datasourceMap, - visualizationMap, - }, - jest.fn() - ); - expect(services.attributeService.unwrapAttributes).not.toHaveBeenCalled(); + const storeDeps = getStoreDeps(); + const { lensServices } = storeDeps; + + const lensStore = makeLensStore({ data: lensServices.data, preloadedState }); + await loadInitial(lensStore, storeDeps, { redirectCallback: jest.fn() }); + expect(lensServices.attributeService.unwrapAttributes).not.toHaveBeenCalled(); }); it('cleans datasource and visualization state properly when reloading', async () => { - const services = makeDefaultServices(); - const storeDeps = { - lensServices: services, - datasourceMap, - visualizationMap, - }; - services.attributeService.unwrapAttributes = jest.fn().mockResolvedValue(defaultDoc); + const storeDeps = getStoreDeps(); const lensStore = await makeLensStore({ - data: services.data, + data: storeDeps.lensServices.data, preloadedState: { ...preloadedState, visualization: { @@ -168,9 +232,13 @@ describe('Mounter', () => { }); const emptyState = getPreloadedState(storeDeps) as LensAppState; - services.attributeService.unwrapAttributes = jest.fn(); + storeDeps.lensServices.attributeService.unwrapAttributes = jest.fn(); await act(async () => { - await loadInitial(lensStore, storeDeps, jest.fn(), undefined, emptyState); + await loadInitial(lensStore, storeDeps, { + redirectCallback: jest.fn(), + initialInput: undefined, + emptyState, + }); }); expect(lensStore.getState()).toEqual({ @@ -188,28 +256,26 @@ describe('Mounter', () => { }); it('loads a document and uses query and filters if initial input is provided', async () => { - const services = makeDefaultServices(); - services.attributeService.unwrapAttributes = jest.fn().mockResolvedValue(defaultDoc); + const storeDeps = getStoreDeps(); + const { lensServices } = storeDeps; + const emptyState = getPreloadedState(storeDeps) as LensAppState; - const lensStore = await makeLensStore({ data: services.data, preloadedState }); + const lensStore = await makeLensStore({ data: lensServices.data, preloadedState }); await act(async () => { - await loadInitial( - lensStore, - { - lensServices: services, - datasourceMap, - visualizationMap, - }, - jest.fn(), - ({ savedObjectId: defaultSavedObjectId } as unknown) as LensEmbeddableInput - ); + await loadInitial(lensStore, storeDeps, { + redirectCallback: jest.fn(), + initialInput: ({ + savedObjectId: defaultSavedObjectId, + } as unknown) as LensEmbeddableInput, + emptyState, + }); }); - expect(services.attributeService.unwrapAttributes).toHaveBeenCalledWith({ + expect(lensServices.attributeService.unwrapAttributes).toHaveBeenCalledWith({ savedObjectId: defaultSavedObjectId, }); - expect(services.data.query.filterManager.setAppFilters).toHaveBeenCalledWith([ + expect(lensServices.data.query.filterManager.setAppFilters).toHaveBeenCalledWith([ { query: { match_phrase: { src: 'test' } } }, ]); @@ -224,97 +290,117 @@ describe('Mounter', () => { }); it('does not load documents on sequential renders unless the id changes', async () => { - const services = makeDefaultServices(); - const lensStore = makeLensStore({ data: services.data, preloadedState }); + const storeDeps = getStoreDeps(); + const { lensServices } = storeDeps; + const lensStore = makeLensStore({ data: lensServices.data, preloadedState }); await act(async () => { - await loadInitial( - lensStore, - { - lensServices: services, - datasourceMap, - visualizationMap, - }, - jest.fn(), - ({ savedObjectId: defaultSavedObjectId } as unknown) as LensEmbeddableInput - ); + await loadInitial(lensStore, storeDeps, { + redirectCallback: jest.fn(), + initialInput: ({ + savedObjectId: defaultSavedObjectId, + } as unknown) as LensEmbeddableInput, + }); }); await act(async () => { - await loadInitial( - lensStore, - { - lensServices: services, - datasourceMap, - visualizationMap, - }, - jest.fn(), - ({ savedObjectId: defaultSavedObjectId } as unknown) as LensEmbeddableInput - ); + await loadInitial(lensStore, storeDeps, { + redirectCallback: jest.fn(), + initialInput: ({ + savedObjectId: defaultSavedObjectId, + } as unknown) as LensEmbeddableInput, + }); }); - expect(services.attributeService.unwrapAttributes).toHaveBeenCalledTimes(1); + expect(lensServices.attributeService.unwrapAttributes).toHaveBeenCalledTimes(1); await act(async () => { - await loadInitial( - lensStore, - { - lensServices: services, - datasourceMap, - visualizationMap, - }, - jest.fn(), - ({ savedObjectId: '5678' } as unknown) as LensEmbeddableInput - ); + await loadInitial(lensStore, storeDeps, { + redirectCallback: jest.fn(), + initialInput: ({ savedObjectId: '5678' } as unknown) as LensEmbeddableInput, + }); }); - expect(services.attributeService.unwrapAttributes).toHaveBeenCalledTimes(2); + expect(lensServices.attributeService.unwrapAttributes).toHaveBeenCalledTimes(2); }); it('handles document load errors', async () => { const services = makeDefaultServices(); - const redirectCallback = jest.fn(); + services.attributeService.unwrapAttributes = jest.fn().mockRejectedValue('failed to load'); - const lensStore = makeLensStore({ data: services.data, preloadedState }); + const storeDeps = getStoreDeps({ lensServices: services }); + const { lensServices } = storeDeps; - services.attributeService.unwrapAttributes = jest.fn().mockRejectedValue('failed to load'); + const redirectCallback = jest.fn(); + + const lensStore = makeLensStore({ data: lensServices.data, preloadedState }); await act(async () => { - await loadInitial( - lensStore, - { - lensServices: services, - datasourceMap, - visualizationMap, - }, + await loadInitial(lensStore, storeDeps, { redirectCallback, - ({ savedObjectId: defaultSavedObjectId } as unknown) as LensEmbeddableInput - ); + initialInput: ({ + savedObjectId: defaultSavedObjectId, + } as unknown) as LensEmbeddableInput, + }); }); - expect(services.attributeService.unwrapAttributes).toHaveBeenCalledWith({ + expect(lensServices.attributeService.unwrapAttributes).toHaveBeenCalledWith({ savedObjectId: defaultSavedObjectId, }); - expect(services.notifications.toasts.addDanger).toHaveBeenCalled(); + expect(lensServices.notifications.toasts.addDanger).toHaveBeenCalled(); expect(redirectCallback).toHaveBeenCalled(); }); - it('adds to the recently accessed list on load', async () => { + it('redirects if saved object is an aliasMatch', async () => { const services = makeDefaultServices(); - const lensStore = makeLensStore({ data: services.data, preloadedState }); + services.attributeService.unwrapAttributes = jest.fn().mockResolvedValue({ + ...defaultDoc, + sharingSavedObjectProps: { + outcome: 'aliasMatch', + aliasTargetId: 'id2', + }, + }); + + const storeDeps = getStoreDeps({ lensServices: services }); + const lensStore = makeLensStore({ data: storeDeps.lensServices.data, preloadedState }); + await act(async () => { - await loadInitial( - lensStore, - { - lensServices: services, - datasourceMap, - visualizationMap, - }, - jest.fn(), - ({ savedObjectId: defaultSavedObjectId } as unknown) as LensEmbeddableInput - ); + await loadInitial(lensStore, storeDeps, { + redirectCallback: jest.fn(), + initialInput: ({ + savedObjectId: defaultSavedObjectId, + } as unknown) as LensEmbeddableInput, + history: { + location: { + search: '?search', + } as Location, + } as History, + }); + }); + expect(storeDeps.lensServices.attributeService.unwrapAttributes).toHaveBeenCalledWith({ + savedObjectId: defaultSavedObjectId, + }); + + expect(storeDeps.lensServices.spaces.ui.redirectLegacyUrl).toHaveBeenCalledWith( + '#/edit/id2?search', + 'Lens visualization' + ); + }); + + it('adds to the recently accessed list on load', async () => { + const storeDeps = getStoreDeps(); + const { lensServices } = storeDeps; + + const lensStore = makeLensStore({ data: lensServices.data, preloadedState }); + await act(async () => { + await loadInitial(lensStore, storeDeps, { + redirectCallback: jest.fn(), + initialInput: ({ + savedObjectId: defaultSavedObjectId, + } as unknown) as LensEmbeddableInput, + }); }); - expect(services.chrome.recentlyAccessed.add).toHaveBeenCalledWith( + expect(lensServices.chrome.recentlyAccessed.add).toHaveBeenCalledWith( '/app/lens#/edit/1234', 'An extremely cool default document!', '1234' diff --git a/x-pack/plugins/lens/public/state_management/init_middleware/load_initial.ts b/x-pack/plugins/lens/public/state_management/init_middleware/load_initial.ts index 0be2bc9cfc00e..8ae6e58019c91 100644 --- a/x-pack/plugins/lens/public/state_management/init_middleware/load_initial.ts +++ b/x-pack/plugins/lens/public/state_management/init_middleware/load_initial.ts @@ -8,8 +8,10 @@ import { MiddlewareAPI } from '@reduxjs/toolkit'; import { isEqual } from 'lodash'; import { i18n } from '@kbn/i18n'; +import { History } from 'history'; import { LensAppState, setState } from '..'; import { updateLayer, updateVisualizationState, LensStoreDeps } from '..'; +import { SharingSavedObjectProps } from '../../types'; import { LensEmbeddableInput, LensByReferenceInput } from '../../embeddable/embeddable'; import { getInitialDatasourceId } from '../../utils'; import { initializeDatasources } from '../../editor_frame_service/editor_frame'; @@ -19,22 +21,50 @@ import { switchToSuggestion, } from '../../editor_frame_service/editor_frame/suggestion_helpers'; import { LensAppServices } from '../../app_plugin/types'; -import { getFullPath, LENS_EMBEDDABLE_TYPE } from '../../../common/constants'; +import { getEditPath, getFullPath, LENS_EMBEDDABLE_TYPE } from '../../../common/constants'; import { Document, injectFilterReferences } from '../../persistence'; export const getPersisted = async ({ initialInput, lensServices, + history, }: { initialInput: LensEmbeddableInput; lensServices: LensAppServices; -}): Promise<{ doc: Document } | undefined> => { - const { notifications, attributeService } = lensServices; + history?: History; +}): Promise< + { doc: Document; sharingSavedObjectProps: Omit } | undefined +> => { + const { notifications, spaces, attributeService } = lensServices; let doc: Document; try { - const attributes = await attributeService.unwrapAttributes(initialInput); - + const result = await attributeService.unwrapAttributes(initialInput); + if (!result) { + return { + doc: ({ + ...initialInput, + type: LENS_EMBEDDABLE_TYPE, + } as unknown) as Document, + sharingSavedObjectProps: { + outcome: 'exactMatch', + }, + }; + } + const { sharingSavedObjectProps, ...attributes } = result; + if (spaces && sharingSavedObjectProps?.outcome === 'aliasMatch' && history) { + // We found this object by a legacy URL alias from its old ID; redirect the user to the page with its new ID, preserving any URL hash + const newObjectId = sharingSavedObjectProps?.aliasTargetId; // This is always defined if outcome === 'aliasMatch' + const newPath = lensServices.http.basePath.prepend( + `${getEditPath(newObjectId)}${history.location.search}` + ); + await spaces.ui.redirectLegacyUrl( + newPath, + i18n.translate('xpack.lens.legacyUrlConflict.objectNoun', { + defaultMessage: 'Lens visualization', + }) + ); + } doc = { ...initialInput, ...attributes, @@ -43,6 +73,10 @@ export const getPersisted = async ({ return { doc, + sharingSavedObjectProps: { + aliasTargetId: sharingSavedObjectProps?.aliasTargetId, + outcome: sharingSavedObjectProps?.outcome, + }, }; } catch (e) { notifications.toasts.addDanger( @@ -62,9 +96,17 @@ export function loadInitial( embeddableEditorIncomingState, initialContext, }: LensStoreDeps, - redirectCallback: (savedObjectId?: string) => void, - initialInput?: LensEmbeddableInput, - emptyState?: LensAppState + { + redirectCallback, + initialInput, + emptyState, + history, + }: { + redirectCallback: (savedObjectId?: string) => void; + initialInput?: LensEmbeddableInput; + emptyState?: LensAppState; + history?: History; + } ) { const { getState, dispatch } = store; const { attributeService, notifications, data, dashboardFeatureFlag } = lensServices; @@ -146,11 +188,11 @@ export function loadInitial( redirectCallback(); }); } - getPersisted({ initialInput, lensServices }) + getPersisted({ initialInput, lensServices, history }) .then( (persisted) => { if (persisted) { - const { doc } = persisted; + const { doc, sharingSavedObjectProps } = persisted; if (attributeService.inputIsRefType(initialInput)) { lensServices.chrome.recentlyAccessed.add( getFullPath(initialInput.savedObjectId), @@ -190,6 +232,7 @@ export function loadInitial( dispatch( setState({ + sharingSavedObjectProps, query: doc.state.query, searchSessionId: dashboardFeatureFlag.allowByValueEmbeddables && 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 85cb79f6ea5da..6cf0529b34575 100644 --- a/x-pack/plugins/lens/public/state_management/lens_slice.ts +++ b/x-pack/plugins/lens/public/state_management/lens_slice.ts @@ -6,6 +6,7 @@ */ import { createSlice, current, PayloadAction } from '@reduxjs/toolkit'; +import { History } from 'history'; import { LensEmbeddableInput } from '..'; import { TableInspectorAdapter } from '../editor_frame_service/types'; import { getInitialDatasourceId, getResolvedDateRange } from '../utils'; @@ -301,6 +302,7 @@ export const lensSlice = createSlice({ initialInput?: LensEmbeddableInput; redirectCallback: (savedObjectId?: string) => void; emptyState: LensAppState; + history: History; }> ) => state, }, diff --git a/x-pack/plugins/lens/public/state_management/types.ts b/x-pack/plugins/lens/public/state_management/types.ts index 7321f72386b42..33f311a982f05 100644 --- a/x-pack/plugins/lens/public/state_management/types.ts +++ b/x-pack/plugins/lens/public/state_management/types.ts @@ -13,8 +13,7 @@ import { Document } from '../persistence'; import { TableInspectorAdapter } from '../editor_frame_service/types'; import { DateRange } from '../../common'; import { LensAppServices } from '../app_plugin/types'; -import { DatasourceMap, VisualizationMap } from '../types'; - +import { DatasourceMap, VisualizationMap, SharingSavedObjectProps } from '../types'; export interface VisualizationState { activeId: string | null; state: unknown; @@ -44,6 +43,7 @@ export interface LensAppState extends EditorFrameState { savedQuery?: SavedQuery; searchSessionId: string; resolvedDateRange: DateRange; + sharingSavedObjectProps?: Omit; } export type DispatchSetState = ( diff --git a/x-pack/plugins/lens/public/trigger_actions/visualize_field_actions.ts b/x-pack/plugins/lens/public/trigger_actions/visualize_field_actions.ts index 9e7507b01bc59..4e105ed9db499 100644 --- a/x-pack/plugins/lens/public/trigger_actions/visualize_field_actions.ts +++ b/x-pack/plugins/lens/public/trigger_actions/visualize_field_actions.ts @@ -11,7 +11,7 @@ import { ACTION_VISUALIZE_LENS_FIELD, VisualizeFieldContext, } from '../../../../../src/plugins/ui_actions/public'; -import { ApplicationStart } from '../../../../../src/core/public'; +import type { ApplicationStart } from '../../../../../src/core/public'; export const visualizeFieldAction = (application: ApplicationStart) => createAction({ diff --git a/x-pack/plugins/lens/public/types.ts b/x-pack/plugins/lens/public/types.ts index 399e226a711db..844541cd2ad3e 100644 --- a/x-pack/plugins/lens/public/types.ts +++ b/x-pack/plugins/lens/public/types.ts @@ -256,7 +256,7 @@ export interface Datasource { ) => | Array<{ shortMessage: string; - longMessage: string; + longMessage: React.ReactNode; fixAction?: { label: string; newState: () => Promise }; }> | undefined; @@ -729,7 +729,7 @@ export interface Visualization { ) => | Array<{ shortMessage: string; - longMessage: string; + longMessage: React.ReactNode; }> | undefined; @@ -813,3 +813,9 @@ export interface ILensInterpreterRenderHandlers extends IInterpreterRenderHandle | LensTableRowContextMenuEvent ) => void; } + +export interface SharingSavedObjectProps { + outcome?: 'aliasMatch' | 'exactMatch' | 'conflict'; + aliasTargetId?: string; + errorJSON?: string; +} diff --git a/x-pack/plugins/lens/public/utils.ts b/x-pack/plugins/lens/public/utils.ts index b7dd3ed3733cf..993be9a06a2d9 100644 --- a/x-pack/plugins/lens/public/utils.ts +++ b/x-pack/plugins/lens/public/utils.ts @@ -4,16 +4,20 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - +import { uniq } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { IndexPattern, IndexPatternsContract, TimefilterContract } from 'src/plugins/data/public'; -import { IUiSettingsClient } from 'kibana/public'; import moment from 'moment-timezone'; -import { SavedObjectReference } from 'kibana/public'; -import { uniq } from 'lodash'; -import { Document } from './persistence/saved_object_store'; -import { Datasource, DatasourceMap } from './types'; -import { DatasourceStates } from './state_management'; + +import type { + IndexPattern, + IndexPatternsContract, + TimefilterContract, +} from 'src/plugins/data/public'; +import type { IUiSettingsClient } from 'kibana/public'; +import type { SavedObjectReference } from 'kibana/public'; +import type { Document } from './persistence/saved_object_store'; +import type { Datasource, DatasourceMap } from './types'; +import type { DatasourceStates } from './state_management'; export function getVisualizeGeoFieldMessage(fieldType: string) { return i18n.translate('xpack.lens.visualizeGeoFieldMessage', { diff --git a/x-pack/plugins/lens/public/vis_type_alias.ts b/x-pack/plugins/lens/public/vis_type_alias.ts index 5b48ef8b31923..96332e07069b0 100644 --- a/x-pack/plugins/lens/public/vis_type_alias.ts +++ b/x-pack/plugins/lens/public/vis_type_alias.ts @@ -6,8 +6,8 @@ */ import { i18n } from '@kbn/i18n'; -import { VisTypeAlias } from 'src/plugins/visualizations/public'; -import { getBasePath, getEditPath } from '../common'; +import type { VisTypeAlias } from 'src/plugins/visualizations/public'; +import { getBasePath, getEditPath } from '../common/constants'; export const getLensAliasConfig = (): VisTypeAlias => ({ aliasPath: getBasePath(), diff --git a/x-pack/plugins/lens/public/xy_visualization/__snapshots__/expression.test.tsx.snap b/x-pack/plugins/lens/public/xy_visualization/__snapshots__/expression.test.tsx.snap index 69307d3d90cab..6326d8680757e 100644 --- a/x-pack/plugins/lens/public/xy_visualization/__snapshots__/expression.test.tsx.snap +++ b/x-pack/plugins/lens/public/xy_visualization/__snapshots__/expression.test.tsx.snap @@ -5,6 +5,7 @@ exports[`xy_expression XYChart component it renders area 1`] = ` renderer="canvas" > { defaultProps = { formatFactory: getFormatSpy, timeZone: 'UTC', - renderMode: 'display', + renderMode: 'view', chartsThemeService, chartsActiveCursorService, paletteService, @@ -973,7 +974,6 @@ describe('xy_expression', () => { }} /> ); - wrapper.find(Settings).first().prop('onBrushEnd')!({ x: [1585757732783, 1585758880838] }); expect(onSelectRange).toHaveBeenCalledWith({ @@ -1064,16 +1064,32 @@ describe('xy_expression', () => { }); }); - test('onBrushEnd is not set on noInteractivity mode', () => { + test('onBrushEnd is not set on non-interactive mode', () => { const { args, data } = sampleArgs(); const wrapper = mountWithIntl( - + ); expect(wrapper.find(Settings).first().prop('onBrushEnd')).toBeUndefined(); }); + test('allowBrushingLastHistogramBucket is true for date histogram data', () => { + const { args } = sampleArgs(); + + const wrapper = mountWithIntl( + + ); + expect(wrapper.find(Settings).at(0).prop('allowBrushingLastHistogramBucket')).toEqual(true); + }); + test('onElementClick returns correct context data', () => { const geometry: GeometryValue = { x: 5, y: 1, accessor: 'y1', mark: null, datum: {} }; const series = { @@ -1334,11 +1350,41 @@ describe('xy_expression', () => { }); }); - test('onElementClick is not triggering event on noInteractivity mode', () => { + test('allowBrushingLastHistogramBucket should be fakse for ordinal data', () => { + const { args, data } = sampleArgs(); + + const wrapper = mountWithIntl( + + ); + + expect(wrapper.find(Settings).at(0).prop('allowBrushingLastHistogramBucket')).toEqual(false); + }); + + test('onElementClick is not triggering event on non-interactive mode', () => { const { args, data } = sampleArgs(); const wrapper = mountWithIntl( - + ); expect(wrapper.find(Settings).first().prop('onElementClick')).toBeUndefined(); diff --git a/x-pack/plugins/lens/public/xy_visualization/expression.tsx b/x-pack/plugins/lens/public/xy_visualization/expression.tsx index f8dff65969d57..026d9da71beea 100644 --- a/x-pack/plugins/lens/public/xy_visualization/expression.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/expression.tsx @@ -74,18 +74,6 @@ type SeriesSpec = InferPropType & InferPropType & InferPropType; -export { - legendConfig, - yAxisConfig, - tickLabelsConfig, - gridlinesConfig, - axisTitlesVisibilityConfig, - axisExtentConfig, - layerConfig, - xyChart, - labelsOrientationConfig, -} from '../../common/expressions'; - export type XYChartRenderProps = XYChartProps & { chartsThemeService: ChartsPluginSetup['theme']; chartsActiveCursorService: ChartsPluginStart['activeCursor']; @@ -93,6 +81,7 @@ export type XYChartRenderProps = XYChartProps & { formatFactory: FormatFactory; timeZone: string; minInterval: number | undefined; + interactive?: boolean; onClickValue: (data: LensFilterEvent['data']) => void; onSelectRange: (data: LensBrushEvent['data']) => void; renderMode: RenderMode; @@ -160,6 +149,7 @@ export const getXyChartRenderer = (dependencies: { paletteService={dependencies.paletteService} timeZone={dependencies.timeZone} minInterval={calculateMinInterval(config)} + interactive={handlers.isInteractive()} onClickValue={onClickValue} onSelectRange={onSelectRange} renderMode={handlers.getRenderMode()} @@ -233,7 +223,7 @@ export function XYChart({ minInterval, onClickValue, onSelectRange, - renderMode, + interactive = true, syncColors, }: XYChartRenderProps) { const { @@ -526,10 +516,11 @@ export function XYChart({ boundary: document.getElementById('app-fixed-viewport') ?? undefined, headerFormatter: (d) => safeXAccessorLabelRenderer(d.value), }} + allowBrushingLastHistogramBucket={Boolean(isTimeViz)} rotation={shouldRotate ? 90 : 0} xDomain={xDomain} - onBrushEnd={renderMode !== 'noInteractivity' ? brushHandler : undefined} - onElementClick={renderMode !== 'noInteractivity' ? clickHandler : undefined} + onBrushEnd={interactive ? brushHandler : undefined} + onElementClick={interactive ? clickHandler : undefined} legendAction={getLegendAction( filteredLayers, data.tables, diff --git a/x-pack/plugins/lens/public/xy_visualization/index.ts b/x-pack/plugins/lens/public/xy_visualization/index.ts index 6823ffedc9d90..f9d48ffaaae37 100644 --- a/x-pack/plugins/lens/public/xy_visualization/index.ts +++ b/x-pack/plugins/lens/public/xy_visualization/index.ts @@ -21,37 +21,14 @@ export interface XyVisualizationPluginSetupPlugins { } export class XyVisualization { - constructor() {} - setup( core: CoreSetup, { expressions, formatFactory, editorFrame }: XyVisualizationPluginSetupPlugins ) { editorFrame.registerVisualization(async () => { - const { - legendConfig, - yAxisConfig, - tickLabelsConfig, - gridlinesConfig, - axisTitlesVisibilityConfig, - axisExtentConfig, - labelsOrientationConfig, - layerConfig, - xyChart, - getXyChartRenderer, - getXyVisualization, - } = await import('../async_services'); + const { getXyChartRenderer, getXyVisualization } = await import('../async_services'); const [, { charts, fieldFormats }] = await core.getStartServices(); const palettes = await charts.palettes.getPalettes(); - expressions.registerFunction(() => legendConfig); - expressions.registerFunction(() => yAxisConfig); - expressions.registerFunction(() => tickLabelsConfig); - expressions.registerFunction(() => axisExtentConfig); - expressions.registerFunction(() => labelsOrientationConfig); - expressions.registerFunction(() => gridlinesConfig); - expressions.registerFunction(() => axisTitlesVisibilityConfig); - expressions.registerFunction(() => layerConfig); - expressions.registerFunction(() => xyChart); expressions.registerRenderer( getXyChartRenderer({ diff --git a/x-pack/plugins/lens/public/xy_visualization/types.ts b/x-pack/plugins/lens/public/xy_visualization/types.ts index 9d32c2f71c530..4729cfb96f324 100644 --- a/x-pack/plugins/lens/public/xy_visualization/types.ts +++ b/x-pack/plugins/lens/public/xy_visualization/types.ts @@ -17,8 +17,8 @@ import { LensIconChartBarHorizontalStacked } from '../assets/chart_bar_horizonta import { LensIconChartBarHorizontalPercentage } from '../assets/chart_bar_horizontal_percentage'; import { LensIconChartLine } from '../assets/chart_line'; -import { VisualizationType } from '../types'; -import { +import type { VisualizationType } from '../types'; +import type { SeriesType, ValueLabelConfig, LegendConfig, diff --git a/x-pack/plugins/lens/public/xy_visualization/visualization.tsx b/x-pack/plugins/lens/public/xy_visualization/visualization.tsx index 0a4b18f554f31..026c2827cedbd 100644 --- a/x-pack/plugins/lens/public/xy_visualization/visualization.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/visualization.tsx @@ -383,7 +383,7 @@ export const getXyVisualization = ({ const errors: Array<{ shortMessage: string; - longMessage: string; + longMessage: React.ReactNode; }> = []; // check if the layers in the state are compatible with this type of chart @@ -488,7 +488,7 @@ function validateLayersForDimension( | { valid: true } | { valid: false; - payload: { shortMessage: string; longMessage: string }; + payload: { shortMessage: string; longMessage: React.ReactNode }; } { // Multiple layers must be consistent: // * either a dimension is missing in ALL of them diff --git a/x-pack/plugins/lens/readme.md b/x-pack/plugins/lens/readme.md index a180473ed31a4..927c4bbef290c 100644 --- a/x-pack/plugins/lens/readme.md +++ b/x-pack/plugins/lens/readme.md @@ -20,6 +20,9 @@ Run all tests from the `x-pack` root directory - Run `node scripts/functional_tests_server` - Run `node ../scripts/functional_test_runner.js --config ./test/api_integration/config.ts --grep=Lens` +## Developing tips + +Lens state is kept in the Redux Store. To enable redux logger, open Chrome Developer Tools and type in the console: `window.ELASTIC_LENS_LOGGER=true`. ## UI Terminology diff --git a/x-pack/plugins/lens/server/embeddable/lens_embeddable_factory.ts b/x-pack/plugins/lens/server/embeddable/lens_embeddable_factory.ts index 86a3a600b58ab..4423d9e659119 100644 --- a/x-pack/plugins/lens/server/embeddable/lens_embeddable_factory.ts +++ b/x-pack/plugins/lens/server/embeddable/lens_embeddable_factory.ts @@ -9,6 +9,7 @@ import { EmbeddableRegistryDefinition } from 'src/plugins/embeddable/server'; import type { SerializableRecord } from '@kbn/utility-types'; import { DOC_TYPE } from '../../common'; import { + commonMakeReversePaletteAsCustom, commonRemoveTimezoneDateHistogramParam, commonRenameOperationsForFormula, commonUpdateVisLayerType, @@ -17,6 +18,7 @@ import { LensDocShape713, LensDocShape715, LensDocShapePre712, + VisState716, VisStatePre715, } from '../migrations/types'; import { extract, inject } from '../../common/embeddable_factory'; @@ -50,6 +52,14 @@ export const lensEmbeddableFactory = (): EmbeddableRegistryDefinition => { attributes: migratedLensState, } as unknown) as SerializableRecord; }, + '7.16.0': (state) => { + const lensState = (state as unknown) as { attributes: LensDocShape715 }; + const migratedLensState = commonMakeReversePaletteAsCustom(lensState.attributes); + return ({ + ...lensState, + attributes: migratedLensState, + } as unknown) as SerializableRecord; + }, }, extract, inject, diff --git a/x-pack/plugins/lens/server/migrations/common_migrations.ts b/x-pack/plugins/lens/server/migrations/common_migrations.ts index fda4300e03ea9..5755416957440 100644 --- a/x-pack/plugins/lens/server/migrations/common_migrations.ts +++ b/x-pack/plugins/lens/server/migrations/common_migrations.ts @@ -6,6 +6,7 @@ */ import { cloneDeep } from 'lodash'; +import { PaletteOutput } from 'src/plugins/charts/common'; import { LensDocShapePre712, OperationTypePre712, @@ -15,8 +16,9 @@ import { LensDocShape715, VisStatePost715, VisStatePre715, + VisState716, } from './types'; -import { layerTypes } from '../../common'; +import { CustomPaletteParams, layerTypes } from '../../common'; export const commonRenameOperationsForFormula = ( attributes: LensDocShapePre712 @@ -98,3 +100,56 @@ export const commonUpdateVisLayerType = ( } return newAttributes as LensDocShape715; }; + +function moveDefaultPaletteToPercentCustomInPlace(palette?: PaletteOutput) { + if (palette?.params?.reverse && palette.params.name !== 'custom' && palette.params.stops) { + // change to palette type to custom and migrate to a percentage type of mode + palette.name = 'custom'; + palette.params.name = 'custom'; + // we can make strong assumptions here: + // because it was a default palette reversed it means that stops were the default ones + // so when migrating, because there's no access to active data, we could leverage the + // percent rangeType to define colorStops in percent. + // + // Stops should be defined, but reversed, as the previous code was rewriting them on reverse. + // + // The only change the user should notice should be the mode changing from number to percent + // but the final result *must* be identical + palette.params.rangeType = 'percent'; + const steps = palette.params.stops.length; + palette.params.rangeMin = 0; + palette.params.rangeMax = 80; + palette.params.steps = steps; + palette.params.colorStops = palette.params.stops.map(({ color }, index) => ({ + color, + stop: (index * 100) / steps, + })); + palette.params.stops = palette.params.stops.map(({ color }, index) => ({ + color, + stop: ((1 + index) * 100) / steps, + })); + } +} + +export const commonMakeReversePaletteAsCustom = ( + attributes: LensDocShape715 +): LensDocShape715 => { + const newAttributes = cloneDeep(attributes); + const vizState = (newAttributes as LensDocShape715).state.visualization; + if ( + attributes.visualizationType !== 'lnsDatatable' && + attributes.visualizationType !== 'lnsHeatmap' + ) { + return newAttributes; + } + if ('columns' in vizState) { + for (const column of vizState.columns) { + if (column.colorMode && column.colorMode !== 'none') { + moveDefaultPaletteToPercentCustomInPlace(column.palette); + } + } + } else { + moveDefaultPaletteToPercentCustomInPlace(vizState.palette); + } + return newAttributes; +}; diff --git a/x-pack/plugins/lens/server/migrations/saved_object_migrations.test.ts b/x-pack/plugins/lens/server/migrations/saved_object_migrations.test.ts index afc6e6c6a590c..c16c5b5169ac5 100644 --- a/x-pack/plugins/lens/server/migrations/saved_object_migrations.test.ts +++ b/x-pack/plugins/lens/server/migrations/saved_object_migrations.test.ts @@ -12,8 +12,9 @@ import { SavedObjectMigrationFn, SavedObjectUnsanitizedDoc, } from 'src/core/server'; -import { LensDocShape715, VisStatePost715, VisStatePre715 } from './types'; -import { layerTypes } from '../../common'; +import { LensDocShape715, VisState716, VisStatePost715, VisStatePre715 } from './types'; +import { CustomPaletteParams, layerTypes } from '../../common'; +import { PaletteOutput } from 'src/plugins/charts/common'; describe('Lens migrations', () => { describe('7.7.0 missing dimensions in XY', () => { @@ -1129,4 +1130,276 @@ describe('Lens migrations', () => { } }); }); + + describe('7.16.0 move reversed default palette to custom palette', () => { + const context = ({ log: { warning: () => {} } } as unknown) as SavedObjectMigrationContext; + const example = ({ + type: 'lens', + id: 'mocked-saved-object-id', + attributes: { + savedObjectId: '1', + title: 'MyRenamedOps', + description: '', + visualizationType: null, + state: { + datasourceMetaData: { + filterableIndexPatterns: [], + }, + datasourceStates: { + indexpattern: { + currentIndexPatternId: 'logstash-*', + layers: { + '2': { + columns: { + '3': { + label: '@timestamp', + dataType: 'date', + operationType: 'date_histogram', + sourceField: '@timestamp', + isBucketed: true, + scale: 'interval', + params: { interval: 'auto', timeZone: 'Europe/Berlin' }, + }, + '4': { + label: '@timestamp', + dataType: 'date', + operationType: 'date_histogram', + sourceField: '@timestamp', + isBucketed: true, + scale: 'interval', + params: { interval: 'auto' }, + }, + '5': { + label: '@timestamp', + dataType: 'date', + operationType: 'my_unexpected_operation', + isBucketed: true, + scale: 'interval', + params: { timeZone: 'do not delete' }, + }, + }, + columnOrder: ['3', '4', '5'], + }, + }, + }, + }, + visualization: {}, + query: { query: '', language: 'kuery' }, + filters: [], + }, + }, + } as unknown) as SavedObjectUnsanitizedDoc>; + + it('should just return the same document for XY, partition and metric visualization types', () => { + for (const vizType of ['lnsXY', 'lnsPie', 'lnsMetric']) { + const exampleCopy = cloneDeep(example); + exampleCopy.attributes.visualizationType = vizType; + // add datatable state here, even with another viz (manual change?) + (exampleCopy.attributes as LensDocShape715).state.visualization = ({ + columns: [ + { palette: { type: 'palette', name: 'temperature' }, colorMode: 'cell' }, + { palette: { type: 'palette', name: 'temperature' }, colorMode: 'text' }, + { + palette: { type: 'palette', name: 'temperature', params: { reverse: false } }, + colorMode: 'cell', + }, + ], + } as unknown) as VisState716; + const result = migrations['7.16.0'](exampleCopy, context) as ReturnType< + SavedObjectMigrationFn + >; + expect(result).toEqual(exampleCopy); + } + }); + + it('should not change non reversed default palettes in datatable', () => { + const datatableExample = cloneDeep(example); + datatableExample.attributes.visualizationType = 'lnsDatatable'; + (datatableExample.attributes as LensDocShape715).state.visualization = ({ + columns: [ + { palette: { type: 'palette', name: 'temperature' }, colorMode: 'cell' }, + { palette: { type: 'palette', name: 'temperature' }, colorMode: 'text' }, + { + palette: { type: 'palette', name: 'temperature', params: { reverse: false } }, + colorMode: 'cell', + }, + ], + } as unknown) as VisState716; + const result = migrations['7.16.0'](datatableExample, context) as ReturnType< + SavedObjectMigrationFn + >; + expect(result).toEqual(datatableExample); + }); + + it('should not change custom palettes in datatable', () => { + const datatableExample = cloneDeep(example); + datatableExample.attributes.visualizationType = 'lnsDatatable'; + (datatableExample.attributes as LensDocShape715).state.visualization = ({ + columns: [ + { palette: { type: 'palette', name: 'custom' }, colorMode: 'cell' }, + { palette: { type: 'palette', name: 'custom' }, colorMode: 'text' }, + { + palette: { type: 'palette', name: 'custom', params: { reverse: true } }, + colorMode: 'cell', + }, + ], + } as unknown) as VisState716; + const result = migrations['7.16.0'](datatableExample, context) as ReturnType< + SavedObjectMigrationFn + >; + expect(result).toEqual(datatableExample); + }); + + it('should not change a datatable with no conditional coloring', () => { + const datatableExample = cloneDeep(example); + datatableExample.attributes.visualizationType = 'lnsDatatable'; + (datatableExample.attributes as LensDocShape715).state.visualization = ({ + columns: [{ colorMode: 'none' }, {}], + } as unknown) as VisState716; + const result = migrations['7.16.0'](datatableExample, context) as ReturnType< + SavedObjectMigrationFn + >; + expect(result).toEqual(datatableExample); + }); + + it('should not change default palette if the colorMode is set to "none" in datatable', () => { + const datatableExample = cloneDeep(example); + datatableExample.attributes.visualizationType = 'lnsDatatable'; + (datatableExample.attributes as LensDocShape715).state.visualization = ({ + columns: [ + { palette: { type: 'palette', name: 'temperature' }, colorMode: 'none' }, + { palette: { type: 'palette', name: 'temperature' }, colorMode: 'none' }, + { + palette: { type: 'palette', name: 'temperature', params: { reverse: true } }, + colorMode: 'cell', + }, + ], + } as unknown) as VisState716; + const result = migrations['7.16.0'](datatableExample, context) as ReturnType< + SavedObjectMigrationFn + >; + expect(result).toEqual(datatableExample); + }); + + it('should change a default palette reversed in datatable', () => { + const datatableExample = cloneDeep(example); + datatableExample.attributes.visualizationType = 'lnsDatatable'; + (datatableExample.attributes as LensDocShape715).state.visualization = ({ + columns: [ + { + colorMode: 'cell', + palette: { + type: 'palette', + name: 'temperature1', + params: { + reverse: true, + rangeType: 'number', + stops: [ + { color: 'red', stop: 10 }, + { color: 'blue', stop: 20 }, + { color: 'pink', stop: 50 }, + { color: 'green', stop: 60 }, + { color: 'yellow', stop: 70 }, + ], + }, + }, + }, + { + colorMode: 'text', + palette: { + type: 'palette', + name: 'temperature2', + params: { + reverse: true, + rangeType: 'number', + stops: [ + { color: 'red', stop: 10 }, + { color: 'blue', stop: 20 }, + { color: 'pink', stop: 50 }, + { color: 'green', stop: 60 }, + { color: 'yellow', stop: 70 }, + ], + }, + }, + }, + ], + } as unknown) as VisState716; + const result = migrations['7.16.0'](datatableExample, context) as ReturnType< + SavedObjectMigrationFn + >; + const state = (result.attributes as LensDocShape715< + Extract + >).state.visualization; + for (const column of state.columns) { + expect(column.palette!.name).toBe('custom'); + expect(column.palette!.params!.name).toBe('custom'); + expect(column.palette!.params!.rangeMin).toBe(0); + expect(column.palette!.params!.rangeMax).toBe(80); + expect(column.palette!.params!.reverse).toBeTruthy(); // still true + expect(column.palette!.params!.rangeType).toBe('percent'); + expect(column.palette!.params!.stops).toEqual([ + { color: 'red', stop: 20 }, + { color: 'blue', stop: 40 }, + { color: 'pink', stop: 60 }, + { color: 'green', stop: 80 }, + { color: 'yellow', stop: 100 }, + ]); + expect(column.palette!.params!.colorStops).toEqual([ + { color: 'red', stop: 0 }, + { color: 'blue', stop: 20 }, + { color: 'pink', stop: 40 }, + { color: 'green', stop: 60 }, + { color: 'yellow', stop: 80 }, + ]); + } + }); + + it('should change a default palette reversed in heatmap', () => { + const datatableExample = cloneDeep(example); + datatableExample.attributes.visualizationType = 'lnsHeatmap'; + (datatableExample.attributes as LensDocShape715).state.visualization = ({ + palette: { + type: 'palette', + name: 'temperature1', + params: { + reverse: true, + rangeType: 'number', + stops: [ + { color: 'red', stop: 10 }, + { color: 'blue', stop: 20 }, + { color: 'pink', stop: 50 }, + { color: 'green', stop: 60 }, + { color: 'yellow', stop: 70 }, + ], + }, + }, + } as unknown) as VisState716; + const result = migrations['7.16.0'](datatableExample, context) as ReturnType< + SavedObjectMigrationFn + >; + const state = (result.attributes as LensDocShape715< + Extract }> + >).state.visualization; + expect(state.palette!.name).toBe('custom'); + expect(state.palette!.params!.name).toBe('custom'); + expect(state.palette!.params!.rangeMin).toBe(0); + expect(state.palette!.params!.rangeMax).toBe(80); + expect(state.palette!.params!.reverse).toBeTruthy(); // still true + expect(state.palette!.params!.rangeType).toBe('percent'); + expect(state.palette!.params!.stops).toEqual([ + { color: 'red', stop: 20 }, + { color: 'blue', stop: 40 }, + { color: 'pink', stop: 60 }, + { color: 'green', stop: 80 }, + { color: 'yellow', stop: 100 }, + ]); + expect(state.palette!.params!.colorStops).toEqual([ + { color: 'red', stop: 0 }, + { color: 'blue', stop: 20 }, + { color: 'pink', stop: 40 }, + { color: 'green', stop: 60 }, + { color: 'yellow', stop: 80 }, + ]); + }); + }); }); diff --git a/x-pack/plugins/lens/server/migrations/saved_object_migrations.ts b/x-pack/plugins/lens/server/migrations/saved_object_migrations.ts index 7d08e76841cf5..901f0b5d6e684 100644 --- a/x-pack/plugins/lens/server/migrations/saved_object_migrations.ts +++ b/x-pack/plugins/lens/server/migrations/saved_object_migrations.ts @@ -23,11 +23,13 @@ import { LensDocShape715, VisStatePost715, VisStatePre715, + VisState716, } from './types'; import { commonRenameOperationsForFormula, commonRemoveTimezoneDateHistogramParam, commonUpdateVisLayerType, + commonMakeReversePaletteAsCustom, } from './common_migrations'; interface LensDocShapePre710 { @@ -430,6 +432,14 @@ const addLayerTypeToVisualization: SavedObjectMigrationFn< return { ...newDoc, attributes: commonUpdateVisLayerType(newDoc.attributes) }; }; +const moveDefaultReversedPaletteToCustom: SavedObjectMigrationFn< + LensDocShape715, + LensDocShape715 +> = (doc) => { + const newDoc = cloneDeep(doc); + return { ...newDoc, attributes: commonMakeReversePaletteAsCustom(newDoc.attributes) }; +}; + export const migrations: SavedObjectMigrationMap = { '7.7.0': removeInvalidAccessors, // The order of these migrations matter, since the timefield migration relies on the aggConfigs @@ -442,4 +452,5 @@ export const migrations: SavedObjectMigrationMap = { '7.13.1': renameOperationsForFormula, // duplicate this migration in case a broken by value panel is added to the library '7.14.0': removeTimezoneDateHistogramParam, '7.15.0': addLayerTypeToVisualization, + '7.16.0': moveDefaultReversedPaletteToCustom, }; diff --git a/x-pack/plugins/lens/server/migrations/types.ts b/x-pack/plugins/lens/server/migrations/types.ts index 09b460ff8b8cd..2e6e66aed9949 100644 --- a/x-pack/plugins/lens/server/migrations/types.ts +++ b/x-pack/plugins/lens/server/migrations/types.ts @@ -5,8 +5,9 @@ * 2.0. */ +import type { PaletteOutput } from 'src/plugins/charts/common'; import { Query, Filter } from 'src/plugins/data/public'; -import type { LayerType } from '../../common'; +import type { CustomPaletteParams, LayerType } from '../../common'; export type OperationTypePre712 = | 'avg' @@ -192,3 +193,16 @@ export interface LensDocShape715 { filters: Filter[]; }; } + +export type VisState716 = + // Datatable + | { + columns: Array<{ + palette?: PaletteOutput; + colorMode?: 'none' | 'cell' | 'text'; + }>; + } + // Heatmap + | { + palette?: PaletteOutput; + }; diff --git a/x-pack/plugins/lens/server/saved_objects.ts b/x-pack/plugins/lens/server/saved_objects.ts index 0266378981fd6..4e376b23b3374 100644 --- a/x-pack/plugins/lens/server/saved_objects.ts +++ b/x-pack/plugins/lens/server/saved_objects.ts @@ -13,7 +13,8 @@ export function setupSavedObjects(core: CoreSetup) { core.savedObjects.registerType({ name: 'lens', hidden: false, - namespaceType: 'single', + namespaceType: 'multiple-isolated', + convertToMultiNamespaceTypeVersion: '8.0.0', management: { icon: 'lensApp', defaultSearchField: 'title', diff --git a/x-pack/plugins/lens/tsconfig.json b/x-pack/plugins/lens/tsconfig.json index 04d3838df2063..16287ae596df3 100644 --- a/x-pack/plugins/lens/tsconfig.json +++ b/x-pack/plugins/lens/tsconfig.json @@ -15,6 +15,7 @@ "../../../typings/**/*" ], "references": [ + { "path": "../spaces/tsconfig.json" }, { "path": "../../../src/core/tsconfig.json" }, { "path": "../task_manager/tsconfig.json" }, { "path": "../global_search/tsconfig.json"}, diff --git a/x-pack/plugins/license_api_guard/jest.config.js b/x-pack/plugins/license_api_guard/jest.config.js index e0f348ceabd85..c6c1bc1bd501a 100644 --- a/x-pack/plugins/license_api_guard/jest.config.js +++ b/x-pack/plugins/license_api_guard/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/license_api_guard'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/license_api_guard', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/license_api_guard/server/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/license_management/jest.config.js b/x-pack/plugins/license_management/jest.config.js index b0ce5947f3cec..59634448ee26c 100644 --- a/x-pack/plugins/license_management/jest.config.js +++ b/x-pack/plugins/license_management/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/license_management'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/license_management', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/license_management/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/licensing/jest.config.js b/x-pack/plugins/licensing/jest.config.js index d497f6c7fb05b..5c5276534ebed 100644 --- a/x-pack/plugins/licensing/jest.config.js +++ b/x-pack/plugins/licensing/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/licensing'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/licensing', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/licensing/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/lists/common/schemas/response/found_exception_list_schema.mock.ts b/x-pack/plugins/lists/common/schemas/response/found_exception_list_schema.mock.ts index e3611120348f4..e5e41b5fe4a85 100644 --- a/x-pack/plugins/lists/common/schemas/response/found_exception_list_schema.mock.ts +++ b/x-pack/plugins/lists/common/schemas/response/found_exception_list_schema.mock.ts @@ -12,6 +12,6 @@ import { getExceptionListSchemaMock } from './exception_list_schema.mock'; export const getFoundExceptionListSchemaMock = (): FoundExceptionListSchema => ({ data: [getExceptionListSchemaMock()], page: 1, - per_page: 1, + per_page: 20, total: 1, }); diff --git a/x-pack/plugins/lists/jest.config.js b/x-pack/plugins/lists/jest.config.js index c05b17f57cf7e..cb9832920183f 100644 --- a/x-pack/plugins/lists/jest.config.js +++ b/x-pack/plugins/lists/jest.config.js @@ -6,6 +6,9 @@ */ module.exports = { + collectCoverageFrom: ['/x-pack/plugins/lists/{common,public,server}/**/*.{ts,tsx}'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/lists', + coverageReporters: ['text', 'html'], preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/lists'], diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/builder.stories.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/builder.stories.tsx index da320e871072c..3eaf2bea96760 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/builder.stories.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/builder.stories.tsx @@ -11,10 +11,7 @@ import { HttpStart } from 'kibana/public'; import { AutocompleteStart } from '../../../../../../../src/plugins/data/public'; import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/common'; -import { - fields, - getField, -} from '../../../../../../../src/plugins/data/common/index_patterns/fields/fields.mocks'; +import { fields, getField } from '../../../../../../../src/plugins/data/common/mocks'; import { getEntryMatchAnyMock } from '../../../../common/schemas/types/entry_match_any.mock'; import { getEntryMatchMock } from '../../../../common/schemas/types/entry_match.mock'; import { getEntryExistsMock } from '../../../../common/schemas/types/entry_exists.mock'; diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.stories.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.stories.tsx index 9bf2ca0fc017a..080f6095dc18a 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.stories.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.stories.tsx @@ -15,7 +15,7 @@ import { } from '@kbn/securitysolution-io-ts-list-types'; import { AutocompleteStart } from '../../../../../../../src/plugins/data/public'; -import { fields } from '../../../../../../../src/plugins/data/common/index_patterns/fields/fields.mocks'; +import { fields } from '../../../../../../../src/plugins/data/common/mocks'; import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/common'; import { BuilderEntryItem, EntryItemProps } from './entry_renderer'; diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx index f692ad96988cf..f25a30471ee9e 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx @@ -22,10 +22,7 @@ import { import { useFindLists } from '@kbn/securitysolution-list-hooks'; import { FieldSpec } from 'src/plugins/data/common'; -import { - fields, - getField, -} from '../../../../../../../src/plugins/data/common/index_patterns/fields/fields.mocks'; +import { fields, getField } from '../../../../../../../src/plugins/data/common/mocks'; import { dataPluginMock } from '../../../../../../../src/plugins/data/public/mocks'; import { coreMock } from '../../../../../../../src/core/public/mocks'; import { getFoundListSchemaMock } from '../../../../common/schemas/response/found_list_schema.mock'; diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.test.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.test.tsx index b896f2a44f67b..ccda52e280586 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.test.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { mount } from 'enzyme'; import { dataPluginMock } from 'src/plugins/data/public/mocks'; -import { fields } from '../../../../../../../src/plugins/data/common/index_patterns/fields/fields.mocks'; +import { fields } from '../../../../../../../src/plugins/data/common/mocks'; import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/common'; import { getExceptionListItemSchemaMock } from '../../../../common/schemas/response/exception_list_item_schema.mock'; import { getEntryMatchMock } from '../../../../common/schemas/types/entry_match.mock'; diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx index 532f3457ca645..d9dfbfeee299d 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx @@ -12,10 +12,7 @@ import { coreMock } from 'src/core/public/mocks'; import { dataPluginMock } from 'src/plugins/data/public/mocks'; import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/common'; -import { - fields, - getField, -} from '../../../../../../../src/plugins/data/common/index_patterns/fields/fields.mocks'; +import { fields, getField } from '../../../../../../../src/plugins/data/common/mocks'; import { getExceptionListItemSchemaMock } from '../../../../common/schemas/response/exception_list_item_schema.mock'; import { getEntryMatchAnyMock } from '../../../../common/schemas/types/entry_match_any.mock'; import { getEmptyValue } from '../../../common/empty_value'; diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts b/x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts index 8592408dde56e..bff7f389c6ac9 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts +++ b/x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts @@ -57,10 +57,7 @@ import { IndexPatternBase, IndexPatternFieldBase } from '@kbn/es-query'; import { ENTRIES_WITH_IDS } from '../../../../common/constants.mock'; import { getEntryExistsMock } from '../../../../common/schemas/types/entry_exists.mock'; import { getExceptionListItemSchemaMock } from '../../../../common/schemas/response/exception_list_item_schema.mock'; -import { - fields, - getField, -} from '../../../../../../../src/plugins/data/common/index_patterns/fields/fields.mocks'; +import { fields, getField } from '../../../../../../../src/plugins/data/common/mocks'; import { FieldSpec } from '../../../../../../../src/plugins/data/common'; import { getEntryNestedMock } from '../../../../common/schemas/types/entry_nested.mock'; import { getEntryMatchMock } from '../../../../common/schemas/types/entry_match.mock'; diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/logic_buttons.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/logic_buttons.tsx index 30fda556f0df8..3846b844bb55a 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/logic_buttons.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/logic_buttons.tsx @@ -41,7 +41,6 @@ export const BuilderLogicButtons: React.FC = ({ { errorMessage: 'Uh oh', filterOptions: {}, http: mockKibanaHttpService, - namespaceTypes: ['single', 'agnostic'], - notifications: mockKibanaNotificationsService, - pagination: { + initialPagination: { page: 1, perPage: 20, total: 0, }, + namespaceTypes: ['single', 'agnostic'], + notifications: mockKibanaNotificationsService, showEventFilters: false, showTrustedApps: false, }) @@ -62,7 +62,8 @@ describe('useExceptionLists', () => { perPage: 20, total: 0, }, - null, + expect.any(Function), + expect.any(Function), ]); }); }); @@ -77,13 +78,13 @@ describe('useExceptionLists', () => { errorMessage: 'Uh oh', filterOptions: {}, http: mockKibanaHttpService, - namespaceTypes: ['single', 'agnostic'], - notifications: mockKibanaNotificationsService, - pagination: { + initialPagination: { page: 1, perPage: 20, total: 0, }, + namespaceTypes: ['single', 'agnostic'], + notifications: mockKibanaNotificationsService, showEventFilters: false, showTrustedApps: false, }) @@ -100,10 +101,11 @@ describe('useExceptionLists', () => { expectedListItemsResult, { page: 1, - perPage: 1, + perPage: 20, total: 1, }, - result.current[3], + expect.any(Function), + expect.any(Function), ]); }); }); @@ -117,13 +119,13 @@ describe('useExceptionLists', () => { errorMessage: 'Uh oh', filterOptions: {}, http: mockKibanaHttpService, - namespaceTypes: ['single', 'agnostic'], - notifications: mockKibanaNotificationsService, - pagination: { + initialPagination: { page: 1, perPage: 20, total: 0, }, + namespaceTypes: ['single', 'agnostic'], + notifications: mockKibanaNotificationsService, showEventFilters: false, showTrustedApps: true, }) @@ -153,13 +155,13 @@ describe('useExceptionLists', () => { errorMessage: 'Uh oh', filterOptions: {}, http: mockKibanaHttpService, - namespaceTypes: ['single', 'agnostic'], - notifications: mockKibanaNotificationsService, - pagination: { + initialPagination: { page: 1, perPage: 20, total: 0, }, + namespaceTypes: ['single', 'agnostic'], + notifications: mockKibanaNotificationsService, showEventFilters: false, showTrustedApps: false, }) @@ -189,13 +191,13 @@ describe('useExceptionLists', () => { errorMessage: 'Uh oh', filterOptions: {}, http: mockKibanaHttpService, - namespaceTypes: ['single', 'agnostic'], - notifications: mockKibanaNotificationsService, - pagination: { + initialPagination: { page: 1, perPage: 20, total: 0, }, + namespaceTypes: ['single', 'agnostic'], + notifications: mockKibanaNotificationsService, showEventFilters: true, showTrustedApps: false, }) @@ -225,13 +227,13 @@ describe('useExceptionLists', () => { errorMessage: 'Uh oh', filterOptions: {}, http: mockKibanaHttpService, - namespaceTypes: ['single', 'agnostic'], - notifications: mockKibanaNotificationsService, - pagination: { + initialPagination: { page: 1, perPage: 20, total: 0, }, + namespaceTypes: ['single', 'agnostic'], + notifications: mockKibanaNotificationsService, showEventFilters: false, showTrustedApps: false, }) @@ -264,13 +266,13 @@ describe('useExceptionLists', () => { name: 'Sample Endpoint', }, http: mockKibanaHttpService, - namespaceTypes: ['single', 'agnostic'], - notifications: mockKibanaNotificationsService, - pagination: { + initialPagination: { page: 1, perPage: 20, total: 0, }, + namespaceTypes: ['single', 'agnostic'], + notifications: mockKibanaNotificationsService, showEventFilters: false, showTrustedApps: false, }) @@ -302,9 +304,9 @@ describe('useExceptionLists', () => { errorMessage, filterOptions, http, + initialPagination, namespaceTypes, notifications, - pagination, showEventFilters, showTrustedApps, }) => @@ -312,9 +314,9 @@ describe('useExceptionLists', () => { errorMessage, filterOptions, http, + initialPagination, namespaceTypes, notifications, - pagination, showEventFilters, showTrustedApps, }), @@ -323,13 +325,13 @@ describe('useExceptionLists', () => { errorMessage: 'Uh oh', filterOptions: {}, http: mockKibanaHttpService, - namespaceTypes: ['single'], - notifications: mockKibanaNotificationsService, - pagination: { + initialPagination: { page: 1, perPage: 20, total: 0, }, + namespaceTypes: ['single'], + notifications: mockKibanaNotificationsService, showEventFilters: false, showTrustedApps: false, }, @@ -344,13 +346,13 @@ describe('useExceptionLists', () => { errorMessage: 'Uh oh', filterOptions: {}, http: mockKibanaHttpService, - namespaceTypes: ['single', 'agnostic'], - notifications: mockKibanaNotificationsService, - pagination: { + initialPagination: { page: 1, perPage: 20, total: 0, }, + namespaceTypes: ['single', 'agnostic'], + notifications: mockKibanaNotificationsService, showEventFilters: false, showTrustedApps: false, }); @@ -372,13 +374,13 @@ describe('useExceptionLists', () => { errorMessage: 'Uh oh', filterOptions: {}, http: mockKibanaHttpService, - namespaceTypes: ['single', 'agnostic'], - notifications: mockKibanaNotificationsService, - pagination: { + initialPagination: { page: 1, perPage: 20, total: 0, }, + namespaceTypes: ['single', 'agnostic'], + notifications: mockKibanaNotificationsService, showEventFilters: false, showTrustedApps: false, }) @@ -390,8 +392,8 @@ describe('useExceptionLists', () => { expect(typeof result.current[3]).toEqual('function'); - if (result.current[3] != null) { - result.current[3](); + if (result.current[4] != null) { + result.current[4](); } // NOTE: Only need one call here because hook already initilaized await waitForNextUpdate(); @@ -411,13 +413,13 @@ describe('useExceptionLists', () => { errorMessage: 'Uh oh', filterOptions: {}, http: mockKibanaHttpService, - namespaceTypes: ['single', 'agnostic'], - notifications: mockKibanaNotificationsService, - pagination: { + initialPagination: { page: 1, perPage: 20, total: 0, }, + namespaceTypes: ['single', 'agnostic'], + notifications: mockKibanaNotificationsService, showEventFilters: false, showTrustedApps: false, }) diff --git a/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list_items_by_list.ts b/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list_items_by_list.ts index aa2bd55e24999..23c389f2a5331 100644 --- a/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list_items_by_list.ts +++ b/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list_items_by_list.ts @@ -7,6 +7,7 @@ import type { ListId, NamespaceType } from '@kbn/securitysolution-io-ts-list-types'; import { getSavedObjectType } from '@kbn/securitysolution-list-utils'; +import { asyncForEach } from '@kbn/std'; import { SavedObjectsClientContract } from '../../../../../../src/core/server/'; @@ -80,7 +81,7 @@ export const deleteFoundExceptionListItems = async ({ namespaceType: NamespaceType; }): Promise => { const savedObjectType = getSavedObjectType({ namespaceType }); - ids.forEach(async (id) => { + await asyncForEach(ids, async (id) => { try { await savedObjectsClient.delete(savedObjectType, id); } catch (err) { diff --git a/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.test.ts b/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.test.ts index c3856fde9b2c3..78098fde59827 100644 --- a/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.test.ts +++ b/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.test.ts @@ -6,6 +6,7 @@ */ import { getListItemResponseMock } from '../../../common/schemas/response/list_item_schema.mock'; +import { createListIfItDoesNotExist } from '../lists/create_list_if_it_does_not_exist'; import { LinesResult, @@ -23,6 +24,10 @@ jest.mock('./create_list_items_bulk', () => ({ createListItemsBulk: jest.fn(), })); +jest.mock('../lists/create_list_if_it_does_not_exist', () => ({ + createListIfItDoesNotExist: jest.fn(), +})); + describe('write_lines_to_bulk_list_items', () => { beforeEach(() => { jest.clearAllMocks(); @@ -61,6 +66,17 @@ describe('write_lines_to_bulk_list_items', () => { expect.objectContaining({ value: ['127.0.0.1', '127.0.0.2'] }) ); }); + + it('creates a list with a decoded file name', async () => { + const options = getImportListItemsToStreamOptionsMock(); + const promise = importListItemsToStream({ ...options, listId: undefined }); + options.stream.push(`--\nContent-Disposition: attachment; filename="%22Filename%22.txt"`); + options.stream.push(null); + await promise; + expect(createListIfItDoesNotExist).toBeCalledWith( + expect.objectContaining({ id: `"Filename".txt`, name: `"Filename".txt` }) + ); + }); }); describe('writeBufferToItems', () => { diff --git a/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.ts b/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.ts index 89a6bdbc77878..edd78e350054d 100644 --- a/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.ts +++ b/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.ts @@ -17,6 +17,7 @@ import type { Type, } from '@kbn/securitysolution-io-ts-list-types'; import { Version } from '@kbn/securitysolution-io-ts-types'; +import { i18n } from '@kbn/i18n'; import { createListIfItDoesNotExist } from '../lists/create_list_if_it_does_not_exist'; import { ConfigType } from '../../config'; @@ -59,17 +60,20 @@ export const importListItemsToStream = ({ let list: ListSchema | null = null; readBuffer.on('fileName', async (fileNameEmitted: string) => { readBuffer.pause(); - fileName = fileNameEmitted; + fileName = decodeURIComponent(fileNameEmitted); if (listId == null) { list = await createListIfItDoesNotExist({ - description: `File uploaded from file system of ${fileNameEmitted}`, + description: i18n.translate('xpack.lists.services.items.fileUploadFromFileSystem', { + defaultMessage: 'File uploaded from file system of {fileName}', + values: { fileName }, + }), deserializer, esClient, - id: fileNameEmitted, + id: fileName, immutable: false, listIndex, meta, - name: fileNameEmitted, + name: fileName, serializer, type, user, diff --git a/x-pack/plugins/lists/server/services/lists/delete_list.test.ts b/x-pack/plugins/lists/server/services/lists/delete_list.test.ts index 9ceecbc299bab..f379fd977f51a 100644 --- a/x-pack/plugins/lists/server/services/lists/delete_list.test.ts +++ b/x-pack/plugins/lists/server/services/lists/delete_list.test.ts @@ -61,7 +61,7 @@ describe('delete_list', () => { const deleteQuery = { id: LIST_ID, index: LIST_INDEX, - refresh: false, + refresh: 'wait_for', }; expect(options.esClient.delete).toHaveBeenNthCalledWith(1, deleteQuery); }); diff --git a/x-pack/plugins/lists/server/services/lists/delete_list.ts b/x-pack/plugins/lists/server/services/lists/delete_list.ts index b9a55e107ab76..517723fc227de 100644 --- a/x-pack/plugins/lists/server/services/lists/delete_list.ts +++ b/x-pack/plugins/lists/server/services/lists/delete_list.ts @@ -42,7 +42,7 @@ export const deleteList = async ({ await esClient.delete({ id, index: listIndex, - refresh: false, + refresh: 'wait_for', }); return list; } diff --git a/x-pack/plugins/logstash/jest.config.js b/x-pack/plugins/logstash/jest.config.js index 98d7f8ccae9c7..7296aa46adbb0 100644 --- a/x-pack/plugins/logstash/jest.config.js +++ b/x-pack/plugins/logstash/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/logstash'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/logstash', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/logstash/{common,public,server}/**/*.{js,ts,tsx}', + ], }; diff --git a/x-pack/plugins/maps/common/constants.ts b/x-pack/plugins/maps/common/constants.ts index 5cfed7d6a58b5..b6b3e636fffeb 100644 --- a/x-pack/plugins/maps/common/constants.ts +++ b/x-pack/plugins/maps/common/constants.ts @@ -9,7 +9,6 @@ import { i18n } from '@kbn/i18n'; import { FeatureCollection } from 'geojson'; export const EMS_APP_NAME = 'kibana'; -export const EMS_CATALOGUE_PATH = 'ems/catalogue'; export const EMS_FILES_CATALOGUE_PATH = 'ems/files'; export const EMS_FILES_API_PATH = 'ems/files'; diff --git a/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts b/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts index d1690ddfff43d..f2c13a81045ee 100644 --- a/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts +++ b/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts @@ -7,11 +7,12 @@ /* eslint-disable @typescript-eslint/consistent-type-definitions */ -import { Query } from 'src/plugins/data/public'; +import type { Query } from 'src/plugins/data/common'; import { SortDirection } from 'src/plugins/data/common/search'; import { RENDER_AS, SCALING_TYPES } from '../constants'; -import { MapExtent, MapQuery } from './map_descriptor'; +import { MapExtent } from './map_descriptor'; import { Filter, TimeRange } from '../../../../../src/plugins/data/common'; +import { ESTermSourceDescriptor } from './source_descriptor_types'; export type Timeslice = { from: number; @@ -19,12 +20,11 @@ export type Timeslice = { }; // Global map state passed to every layer. -export type MapFilters = { +export type DataFilters = { buffer?: MapExtent; // extent with additional buffer extent?: MapExtent; // map viewport filters: Filter[]; - query?: MapQuery; - refreshTimerLastTriggeredAt?: string; + query?: Query; searchSessionId?: string; timeFilters: TimeRange; timeslice?: Timeslice; @@ -50,9 +50,7 @@ type ESGeoLineSourceSyncMeta = { sortField: string; }; -type ESTermSourceSyncMeta = { - size: number; -}; +export type ESTermSourceSyncMeta = Pick; export type VectorSourceSyncMeta = | ESSearchSourceSyncMeta @@ -61,24 +59,24 @@ export type VectorSourceSyncMeta = | ESTermSourceSyncMeta | null; -export type VectorSourceRequestMeta = MapFilters & { +export type VectorSourceRequestMeta = DataFilters & { applyGlobalQuery: boolean; applyGlobalTime: boolean; + applyForceRefresh: boolean; fieldNames: string[]; geogridPrecision?: number; - timesiceMaskField?: string; - sourceQuery?: MapQuery; + timesliceMaskField?: string; + sourceQuery?: Query; sourceMeta: VectorSourceSyncMeta; + isForceRefresh: boolean; }; -export type VectorJoinSourceRequestMeta = Omit & { - sourceQuery?: Query; -}; +export type VectorJoinSourceRequestMeta = Omit; -export type VectorStyleRequestMeta = MapFilters & { +export type VectorStyleRequestMeta = DataFilters & { dynamicStyleFields: string[]; isTimeAware: boolean; - sourceQuery: MapQuery; + sourceQuery: Query; timeFilters: TimeRange; }; @@ -108,7 +106,7 @@ export type VectorTileLayerMeta = { }; // Partial because objects are justified downstream in constructors -export type DataMeta = Partial< +export type DataRequestMeta = Partial< VectorSourceRequestMeta & VectorJoinSourceRequestMeta & VectorStyleRequestMeta & @@ -135,8 +133,8 @@ export type StyleMetaData = { export type DataRequestDescriptor = { dataId: string; - dataMetaAtStart?: DataMeta | null; + dataRequestMetaAtStart?: DataRequestMeta | null; dataRequestToken?: symbol; data?: object; - dataMeta?: DataMeta; + dataRequestMeta?: DataRequestMeta; }; diff --git a/x-pack/plugins/maps/common/descriptor_types/map_descriptor.ts b/x-pack/plugins/maps/common/descriptor_types/map_descriptor.ts index 20d811fab62f7..8cb43713face4 100644 --- a/x-pack/plugins/maps/common/descriptor_types/map_descriptor.ts +++ b/x-pack/plugins/maps/common/descriptor_types/map_descriptor.ts @@ -10,7 +10,6 @@ import { ReactNode } from 'react'; import { GeoJsonProperties } from 'geojson'; import { Geometry } from 'geojson'; -import { Query } from '../../../../../src/plugins/data/common'; import { DRAW_SHAPE, ES_SPATIAL_RELATIONS } from '../constants'; export type MapExtent = { @@ -20,10 +19,6 @@ export type MapExtent = { maxLat: number; }; -export type MapQuery = Query & { - queryLastTriggeredAt?: string; -}; - export type MapCenter = { lat: number; lon: number; diff --git a/x-pack/plugins/maps/common/descriptor_types/source_descriptor_types.ts b/x-pack/plugins/maps/common/descriptor_types/source_descriptor_types.ts index 9a2af711ea2c7..285c4043e46c7 100644 --- a/x-pack/plugins/maps/common/descriptor_types/source_descriptor_types.ts +++ b/x-pack/plugins/maps/common/descriptor_types/source_descriptor_types.ts @@ -42,6 +42,7 @@ export type AbstractESSourceDescriptor = AbstractSourceDescriptor & { geoField?: string; applyGlobalQuery: boolean; applyGlobalTime: boolean; + applyForceRefresh: boolean; }; type AbstractAggDescriptor = { diff --git a/x-pack/plugins/maps/common/index.ts b/x-pack/plugins/maps/common/index.ts index 7c551b3ed9eb4..c1b5d26fca292 100644 --- a/x-pack/plugins/maps/common/index.ts +++ b/x-pack/plugins/maps/common/index.ts @@ -5,8 +5,24 @@ * 2.0. */ -// TODO: https://github.com/elastic/kibana/issues/109853 -/* eslint-disable @kbn/eslint/no_export_all */ +export { + AGG_TYPE, + COLOR_MAP_TYPE, + ES_GEO_FIELD_TYPE, + FIELD_ORIGIN, + INITIAL_LOCATION, + LABEL_BORDER_SIZES, + MAP_SAVED_OBJECT_TYPE, + SOURCE_TYPES, + STYLE_TYPE, + SYMBOLIZE_AS_TYPES, +} from './constants'; -export * from './constants'; -export * from './types'; +export { + EMSFileSourceDescriptor, + ESTermSourceDescriptor, + LayerDescriptor, + TooltipFeature, + VectorLayerDescriptor, + VectorStyleDescriptor, +} from './descriptor_types'; diff --git a/x-pack/plugins/maps/jest.config.js b/x-pack/plugins/maps/jest.config.js index 9e620095af880..c9bd7bf4cd0d4 100644 --- a/x-pack/plugins/maps/jest.config.js +++ b/x-pack/plugins/maps/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/maps'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/maps', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/maps/{common,public,server}/**/*.{js,ts,tsx}'], }; diff --git a/x-pack/plugins/maps/kibana.json b/x-pack/plugins/maps/kibana.json index e2cc415820db5..bfd501dbcb295 100644 --- a/x-pack/plugins/maps/kibana.json +++ b/x-pack/plugins/maps/kibana.json @@ -34,7 +34,7 @@ "ui": true, "server": true, "extraPublicDirs": [ - "common/constants" + "common" ], "requiredBundles": [ "kibanaReact", diff --git a/x-pack/plugins/maps/public/actions/data_request_actions.ts b/x-pack/plugins/maps/public/actions/data_request_actions.ts index 50df95a52c4d4..48b0a416b5f0f 100644 --- a/x-pack/plugins/maps/public/actions/data_request_actions.ts +++ b/x-pack/plugins/maps/public/actions/data_request_actions.ts @@ -45,22 +45,28 @@ import { } from './map_action_constants'; import { ILayer } from '../classes/layers/layer'; import { IVectorLayer } from '../classes/layers/vector_layer'; -import { DataMeta, MapExtent, MapFilters } from '../../common/descriptor_types'; +import { DataRequestMeta, MapExtent, DataFilters } from '../../common/descriptor_types'; import { DataRequestAbortError } from '../classes/util/data_request'; import { scaleBounds, turfBboxToBounds } from '../../common/elasticsearch_util'; const FIT_TO_BOUNDS_SCALE_FACTOR = 0.1; export type DataRequestContext = { - startLoading(dataId: string, requestToken: symbol, requestMeta?: DataMeta): void; - stopLoading(dataId: string, requestToken: symbol, data: object, resultsMeta?: DataMeta): void; + startLoading(dataId: string, requestToken: symbol, requestMeta?: DataRequestMeta): void; + stopLoading( + dataId: string, + requestToken: symbol, + data: object, + resultsMeta?: DataRequestMeta + ): void; onLoadError(dataId: string, requestToken: symbol, errorMessage: string): void; onJoinError(errorMessage: string): void; updateSourceData(newData: unknown): void; isRequestStillActive(dataId: string, requestToken: symbol): boolean; registerCancelCallback(requestToken: symbol, callback: () => void): void; - dataFilters: MapFilters; - forceRefresh: boolean; + dataFilters: DataFilters; + forceRefreshDueToDrawing: boolean; // Boolean signaling data request triggered by a user updating layer features via drawing tools. When true, layer will re-load regardless of "source.applyForceRefresh" flag. + isForceRefresh: boolean; // Boolean signaling data request triggered by auto-refresh timer or user clicking refresh button. When true, layer will re-load only when "source.applyForceRefresh" flag is set to true. }; export function clearDataRequests(layer: ILayer) { @@ -112,13 +118,14 @@ function getDataRequestContext( dispatch: ThunkDispatch, getState: () => MapStoreState, layerId: string, - forceRefresh: boolean = false + forceRefreshDueToDrawing: boolean, + isForceRefresh: boolean ): DataRequestContext { return { dataFilters: getDataFilters(getState()), - startLoading: (dataId: string, requestToken: symbol, meta: DataMeta) => + startLoading: (dataId: string, requestToken: symbol, meta: DataRequestMeta) => dispatch(startDataLoad(layerId, dataId, requestToken, meta)), - stopLoading: (dataId: string, requestToken: symbol, data: object, meta: DataMeta) => + stopLoading: (dataId: string, requestToken: symbol, data: object, meta: DataRequestMeta) => dispatch(endDataLoad(layerId, dataId, requestToken, data, meta)), onLoadError: (dataId: string, requestToken: symbol, errorMessage: string) => dispatch(onDataLoadError(layerId, dataId, requestToken, errorMessage)), @@ -136,17 +143,18 @@ function getDataRequestContext( }, registerCancelCallback: (requestToken: symbol, callback: () => void) => dispatch(registerCancelCallback(requestToken, callback)), - forceRefresh, + forceRefreshDueToDrawing, + isForceRefresh, }; } -export function syncDataForAllLayers() { +export function syncDataForAllLayers(isForceRefresh: boolean) { return async ( dispatch: ThunkDispatch, getState: () => MapStoreState ) => { const syncPromises = getLayerList(getState()).map((layer) => { - return dispatch(syncDataForLayer(layer)); + return dispatch(syncDataForLayer(layer, isForceRefresh)); }); await Promise.all(syncPromises); }; @@ -162,19 +170,20 @@ function syncDataForAllJoinLayers() { return 'hasJoins' in layer ? (layer as IVectorLayer).hasJoins() : false; }) .map((layer) => { - return dispatch(syncDataForLayer(layer)); + return dispatch(syncDataForLayer(layer, false)); }); await Promise.all(syncPromises); }; } -export function syncDataForLayer(layer: ILayer, forceRefresh: boolean = false) { +export function syncDataForLayerDueToDrawing(layer: ILayer) { return async (dispatch: Dispatch, getState: () => MapStoreState) => { const dataRequestContext = getDataRequestContext( dispatch, getState, layer.getId(), - forceRefresh + true, + false ); if (!layer.isVisible() || !layer.showAtZoomLevel(dataRequestContext.dataFilters.zoom)) { return; @@ -183,14 +192,30 @@ export function syncDataForLayer(layer: ILayer, forceRefresh: boolean = false) { }; } -export function syncDataForLayerId(layerId: string | null) { +export function syncDataForLayer(layer: ILayer, isForceRefresh: boolean) { + return async (dispatch: Dispatch, getState: () => MapStoreState) => { + const dataRequestContext = getDataRequestContext( + dispatch, + getState, + layer.getId(), + false, + isForceRefresh + ); + if (!layer.isVisible() || !layer.showAtZoomLevel(dataRequestContext.dataFilters.zoom)) { + return; + } + await layer.syncData(dataRequestContext); + }; +} + +export function syncDataForLayerId(layerId: string | null, isForceRefresh: boolean) { return async ( dispatch: ThunkDispatch, getState: () => MapStoreState ) => { const layer = getLayerById(layerId, getState()); if (layer) { - dispatch(syncDataForLayer(layer)); + dispatch(syncDataForLayer(layer, isForceRefresh)); } }; } @@ -204,7 +229,12 @@ function setLayerDataLoadErrorStatus(layerId: string, errorMessage: string | nul }; } -function startDataLoad(layerId: string, dataId: string, requestToken: symbol, meta: DataMeta) { +function startDataLoad( + layerId: string, + dataId: string, + requestToken: symbol, + meta: DataRequestMeta +) { return ( dispatch: ThunkDispatch, getState: () => MapStoreState @@ -237,7 +267,7 @@ function endDataLoad( dataId: string, requestToken: symbol, data: object, - meta: DataMeta + meta: DataRequestMeta ) { return ( dispatch: ThunkDispatch, @@ -342,7 +372,7 @@ export function fitToLayerExtent(layerId: string) { if (targetLayer) { try { const bounds = await targetLayer.getBounds( - getDataRequestContext(dispatch, getState, layerId) + getDataRequestContext(dispatch, getState, layerId, false, false) ); if (bounds) { await dispatch(setGotoWithBounds(scaleBounds(bounds, FIT_TO_BOUNDS_SCALE_FACTOR))); @@ -374,7 +404,9 @@ export function fitToDataBounds(onNoBounds?: () => void) { if (!(await layer.isFittable())) { return null; } - return layer.getBounds(getDataRequestContext(dispatch, getState, layer.getId())); + return layer.getBounds( + getDataRequestContext(dispatch, getState, layer.getId(), false, false) + ); }); let bounds; @@ -442,7 +474,7 @@ export function autoFitToBounds() { // Ensure layer syncing occurs when setGotoWithBounds is not triggered. function onNoBounds() { if (localSetQueryCallId === lastSetQueryCallId) { - dispatch(syncDataForAllLayers()); + dispatch(syncDataForAllLayers(false)); } } dispatch(fitToDataBounds(onNoBounds)); diff --git a/x-pack/plugins/maps/public/actions/layer_actions.ts b/x-pack/plugins/maps/public/actions/layer_actions.ts index edd21090143bf..d5bb061ccf430 100644 --- a/x-pack/plugins/maps/public/actions/layer_actions.ts +++ b/x-pack/plugins/maps/public/actions/layer_actions.ts @@ -80,7 +80,7 @@ export function rollbackToTrackedLayerStateForSelectedLayer() { // syncDataForLayer may not trigger endDataLoad if no re-fetch is required dispatch(updateStyleMeta(layerId)); - dispatch(syncDataForLayerId(layerId)); + dispatch(syncDataForLayerId(layerId, false)); }; } @@ -149,7 +149,7 @@ export function addLayer(layerDescriptor: LayerDescriptor) { type: ADD_LAYER, layer: layerDescriptor, }); - dispatch(syncDataForLayerId(layerDescriptor.id)); + dispatch(syncDataForLayerId(layerDescriptor.id, false)); const layer = createLayerInstance(layerDescriptor); const features = await layer.getLicensedFeatures(); @@ -226,7 +226,7 @@ export function setLayerVisibility(layerId: string, makeVisible: boolean) { visibility: makeVisible, }); if (makeVisible) { - dispatch(syncDataForLayerId(layerId)); + dispatch(syncDataForLayerId(layerId, false)); } }; } @@ -330,7 +330,7 @@ function updateMetricsProp(layerId: string, value: unknown) { value, }); await dispatch(updateStyleProperties(layerId, previousFields as IESAggField[])); - dispatch(syncDataForLayerId(layerId)); + dispatch(syncDataForLayerId(layerId, false)); }; } @@ -356,7 +356,7 @@ export function updateSourceProp( if (newLayerType) { dispatch(updateLayerType(layerId, newLayerType)); } - dispatch(syncDataForLayerId(layerId)); + dispatch(syncDataForLayerId(layerId, false)); }; } @@ -459,7 +459,7 @@ export function setLayerQuery(id: string, query: Query) { newValue: query, }); - dispatch(syncDataForLayerId(id)); + dispatch(syncDataForLayerId(id, false)); }; } @@ -563,7 +563,7 @@ export function updateLayerStyle(layerId: string, styleDescriptor: StyleDescript dispatch(updateStyleMeta(layerId)); // Style update may require re-fetch, for example ES search may need to retrieve field used for dynamic styling - dispatch(syncDataForLayerId(layerId)); + dispatch(syncDataForLayerId(layerId, false)); }; } @@ -589,7 +589,7 @@ export function setJoinsForLayer(layer: ILayer, joins: JoinDescriptor[]) { joins, }); await dispatch(updateStyleProperties(layer.getId(), previousFields)); - dispatch(syncDataForLayerId(layer.getId())); + dispatch(syncDataForLayerId(layer.getId(), false)); }; } diff --git a/x-pack/plugins/maps/public/actions/map_actions.test.ts b/x-pack/plugins/maps/public/actions/map_actions.test.ts index d222d8e5b0466..935ca332baa22 100644 --- a/x-pack/plugins/maps/public/actions/map_actions.test.ts +++ b/x-pack/plugins/maps/public/actions/map_actions.test.ts @@ -277,7 +277,6 @@ describe('map_actions', () => { const query = { language: 'kuery', query: '', - queryLastTriggeredAt: '2020-08-14T15:07:12.276Z', }; const timeFilters = { from: 'now-1y', to: 'now' }; const filters = [ @@ -327,7 +326,6 @@ describe('map_actions', () => { const newQuery = { language: 'kuery', query: 'foobar', - queryLastTriggeredAt: '2020-08-14T15:07:12.276Z', }; const setQueryAction = await setQuery({ query: newQuery, @@ -384,7 +382,6 @@ describe('map_actions', () => { }); await setQueryAction(dispatchMock, getStoreMock); - // Only checking calls length instead of calls because queryLastTriggeredAt changes on this run expect(dispatchMock.mock.calls.length).toEqual(2); }); }); diff --git a/x-pack/plugins/maps/public/actions/map_actions.ts b/x-pack/plugins/maps/public/actions/map_actions.ts index c1db14347460f..ba52203ce486b 100644 --- a/x-pack/plugins/maps/public/actions/map_actions.ts +++ b/x-pack/plugins/maps/public/actions/map_actions.ts @@ -51,7 +51,11 @@ import { UPDATE_MAP_SETTING, UPDATE_EDIT_STATE, } from './map_action_constants'; -import { autoFitToBounds, syncDataForAllLayers, syncDataForLayer } from './data_request_actions'; +import { + autoFitToBounds, + syncDataForAllLayers, + syncDataForLayerDueToDrawing, +} from './data_request_actions'; import { addLayer, addLayerWithoutDataSync } from './layer_actions'; import { MapSettings } from '../reducers/map'; import { DrawState, MapCenterAndZoom, MapExtent, Timeslice } from '../../common/descriptor_types'; @@ -172,7 +176,7 @@ export function mapExtentChanged(mapExtentState: MapExtentState) { }); } - dispatch(syncDataForAllLayers()); + dispatch(syncDataForAllLayers(false)); }; } @@ -212,10 +216,6 @@ export function clearGoto() { return { type: CLEAR_GOTO }; } -function generateQueryTimestamp() { - return new Date().toISOString(); -} - export function setQuery({ query, timeFilters, @@ -240,11 +240,6 @@ export function setQuery({ getState: () => MapStoreState ) => { const prevQuery = getQuery(getState()); - const prevTriggeredAt = - prevQuery && prevQuery.queryLastTriggeredAt - ? prevQuery.queryLastTriggeredAt - : generateQueryTimestamp(); - const prevTimeFilters = getTimeFilters(getState()); function getNextTimeslice() { @@ -261,11 +256,7 @@ export function setQuery({ const nextQueryContext = { timeFilters: timeFilters ? timeFilters : prevTimeFilters, timeslice: getNextTimeslice(), - query: { - ...(query ? query : prevQuery), - // ensure query changes to trigger re-fetch when "Refresh" clicked - queryLastTriggeredAt: forceRefresh ? generateQueryTimestamp() : prevTriggeredAt, - }, + query: query ? query : prevQuery, filters: filters ? filters : getFilters(getState()), searchSessionId: searchSessionId ? searchSessionId : getSearchSessionId(getState()), searchSessionMapBuffer, @@ -280,7 +271,7 @@ export function setQuery({ searchSessionMapBuffer: getSearchSessionMapBuffer(getState()), }; - if (_.isEqual(nextQueryContext, prevQueryContext)) { + if (!forceRefresh && _.isEqual(nextQueryContext, prevQueryContext)) { // do nothing if query context has not changed return; } @@ -293,7 +284,7 @@ export function setQuery({ if (getMapSettings(getState()).autoFitToDataBounds) { dispatch(autoFitToBounds()); } else { - await dispatch(syncDataForAllLayers()); + await dispatch(syncDataForAllLayers(forceRefresh)); } }; } @@ -372,7 +363,7 @@ export function addNewFeatureToIndex(geometry: Geometry | Position[]) { try { await layer.addFeature(geometry); - await dispatch(syncDataForLayer(layer, true)); + await dispatch(syncDataForLayerDueToDrawing(layer)); } catch (e) { getToasts().addError(e, { title: i18n.translate('xpack.maps.mapActions.addFeatureError', { @@ -399,7 +390,7 @@ export function deleteFeatureFromIndex(featureId: string) { } try { await layer.deleteFeature(featureId); - await dispatch(syncDataForLayer(layer, true)); + await dispatch(syncDataForLayerDueToDrawing(layer)); } catch (e) { getToasts().addError(e, { title: i18n.translate('xpack.maps.mapActions.removeFeatureError', { diff --git a/x-pack/plugins/maps/public/actions/ui_actions.ts b/x-pack/plugins/maps/public/actions/ui_actions.ts index 27e11a938e22b..70e24283ef48f 100644 --- a/x-pack/plugins/maps/public/actions/ui_actions.ts +++ b/x-pack/plugins/maps/public/actions/ui_actions.ts @@ -12,7 +12,7 @@ import { getFlyoutDisplay } from '../selectors/ui_selectors'; import { FLYOUT_STATE } from '../reducers/ui'; import { setQuery, trackMapSettings } from './map_actions'; import { setSelectedLayer } from './layer_actions'; -import { DRAW_MODE } from '../../common'; +import { DRAW_MODE } from '../../common/constants'; import { UPDATE_EDIT_STATE } from './map_action_constants'; export const UPDATE_FLYOUT = 'UPDATE_FLYOUT'; diff --git a/x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts b/x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts index ca3ef1e1e53c5..e54c846883c20 100644 --- a/x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts +++ b/x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts @@ -6,7 +6,7 @@ */ import { IField } from '../field'; -import { IndexPattern } from '../../../../../../../src/plugins/data/common/index_patterns/index_patterns'; +import { IndexPattern } from '../../../../../../../src/plugins/data/common'; import { IESAggSource } from '../../sources/es_agg_source'; import { FIELD_ORIGIN } from '../../../../common/constants'; diff --git a/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts b/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts index 37941af81f9df..141f6aea5d301 100644 --- a/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts +++ b/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { IndexPattern } from 'src/plugins/data/common/index_patterns/index_patterns'; +import { IndexPattern } from 'src/plugins/data/common'; import { i18n } from '@kbn/i18n'; import { AGG_TYPE } from '../../../../common/constants'; import { IESAggField, CountAggFieldParams } from './agg_field_types'; diff --git a/x-pack/plugins/maps/public/classes/layers/__fixtures__/mock_sync_context.ts b/x-pack/plugins/maps/public/classes/layers/__fixtures__/mock_sync_context.ts index 16aca6760c4d5..b81ba6c854629 100644 --- a/x-pack/plugins/maps/public/classes/layers/__fixtures__/mock_sync_context.ts +++ b/x-pack/plugins/maps/public/classes/layers/__fixtures__/mock_sync_context.ts @@ -7,21 +7,22 @@ import sinon from 'sinon'; import { DataRequestContext } from '../../../actions'; -import { DataMeta, MapFilters } from '../../../../common/descriptor_types'; +import { DataRequestMeta, DataFilters } from '../../../../common/descriptor_types'; export class MockSyncContext implements DataRequestContext { - dataFilters: MapFilters; + dataFilters: DataFilters; isRequestStillActive: (dataId: string, requestToken: symbol) => boolean; onLoadError: (dataId: string, requestToken: symbol, errorMessage: string) => void; registerCancelCallback: (requestToken: symbol, callback: () => void) => void; - startLoading: (dataId: string, requestToken: symbol, meta: DataMeta) => void; - stopLoading: (dataId: string, requestToken: symbol, data: object, meta: DataMeta) => void; + startLoading: (dataId: string, requestToken: symbol, meta: DataRequestMeta) => void; + stopLoading: (dataId: string, requestToken: symbol, data: object, meta: DataRequestMeta) => void; onJoinError: (errorMessage: string) => void; updateSourceData: (newData: unknown) => void; - forceRefresh: boolean; + forceRefreshDueToDrawing: boolean; + isForceRefresh: boolean; - constructor({ dataFilters }: { dataFilters: Partial }) { - const mapFilters: MapFilters = { + constructor({ dataFilters }: { dataFilters: Partial }) { + const mapFilters: DataFilters = { filters: [], timeFilters: { from: 'now', @@ -41,6 +42,7 @@ export class MockSyncContext implements DataRequestContext { this.stopLoading = sinon.spy(); this.onJoinError = sinon.spy(); this.updateSourceData = sinon.spy(); - this.forceRefresh = false; + this.forceRefreshDueToDrawing = false; + this.isForceRefresh = false; } } diff --git a/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.test.tsx b/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.test.tsx index 4c81ee67e1daf..d4138ccfaf319 100644 --- a/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.test.tsx +++ b/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.test.tsx @@ -63,6 +63,7 @@ describe('getSource', () => { ...documentSourceDescriptor, applyGlobalQuery: false, applyGlobalTime: false, + applyForceRefresh: false, }), layerDescriptor: BlendedVectorLayer.createDescriptor( { @@ -86,6 +87,7 @@ describe('getSource', () => { geoField: sourceDescriptor.geoField, applyGlobalQuery: sourceDescriptor.applyGlobalQuery, applyGlobalTime: sourceDescriptor.applyGlobalTime, + applyForceRefresh: sourceDescriptor.applyForceRefresh, }; expect(abstractEsSourceDescriptor).toEqual({ type: sourceDescriptor.type, @@ -94,6 +96,7 @@ describe('getSource', () => { indexPatternId: 'myIndexPattern', applyGlobalQuery: false, applyGlobalTime: false, + applyForceRefresh: false, } as AbstractESSourceDescriptor); }); }); diff --git a/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts b/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts index 5db22ff5354a8..d2734265f3bc3 100644 --- a/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts +++ b/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts @@ -60,6 +60,7 @@ function getClusterSource(documentSource: IESSource, documentStyle: IVectorStyle }); clusterSourceDescriptor.applyGlobalQuery = documentSource.getApplyGlobalQuery(); clusterSourceDescriptor.applyGlobalTime = documentSource.getApplyGlobalTime(); + clusterSourceDescriptor.applyForceRefresh = documentSource.getApplyForceRefresh(); clusterSourceDescriptor.metrics = [ { type: AGG_TYPE.COUNT, @@ -290,16 +291,18 @@ export class BlendedVectorLayer extends VectorLayer implements IVectorLayer { async syncData(syncContext: DataRequestContext) { const dataRequestId = ACTIVE_COUNT_DATA_ID; const requestToken = Symbol(`layer-active-count:${this.getId()}`); - const searchFilters: VectorSourceRequestMeta = await this._getSearchFilters( + const requestMeta: VectorSourceRequestMeta = await this._getVectorSourceRequestMeta( + syncContext.isForceRefresh, syncContext.dataFilters, this.getSource(), this.getCurrentStyle() ); const source = this.getSource(); - const canSkipFetch = await canSkipSourceUpdate({ + + const canSkipSourceFetch = await canSkipSourceUpdate({ source, prevDataRequest: this.getDataRequest(dataRequestId), - nextMeta: searchFilters, + nextRequestMeta: requestMeta, extentAware: source.isFilterByMapBounds(), getUpdateDueToTimeslice: (timeslice?: Timeslice) => { return this._getUpdateDueToTimesliceFromSourceRequestMeta(source, timeslice); @@ -308,7 +311,7 @@ export class BlendedVectorLayer extends VectorLayer implements IVectorLayer { let activeSource; let activeStyle; - if (canSkipFetch) { + if (canSkipSourceFetch) { // Even when source fetch is skipped, need to call super._syncData to sync StyleMeta and formatters if (this._isClustered) { activeSource = this._clusterSource; @@ -320,12 +323,12 @@ export class BlendedVectorLayer extends VectorLayer implements IVectorLayer { } else { let isSyncClustered; try { - syncContext.startLoading(dataRequestId, requestToken, searchFilters); + syncContext.startLoading(dataRequestId, requestToken, requestMeta); isSyncClustered = !(await this._documentSource.canLoadAllDocuments( - searchFilters, + requestMeta, syncContext.registerCancelCallback.bind(null, requestToken) )); - syncContext.stopLoading(dataRequestId, requestToken, { isSyncClustered }, searchFilters); + syncContext.stopLoading(dataRequestId, requestToken, { isSyncClustered }, requestMeta); } catch (error) { if (!(error instanceof DataRequestAbortError) || !isSearchSourceAbortError(error)) { syncContext.onLoadError(dataRequestId, requestToken, error.message); diff --git a/x-pack/plugins/maps/public/classes/layers/build_vector_request_meta.ts b/x-pack/plugins/maps/public/classes/layers/build_vector_request_meta.ts new file mode 100644 index 0000000000000..4d52dacc63782 --- /dev/null +++ b/x-pack/plugins/maps/public/classes/layers/build_vector_request_meta.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 _ from 'lodash'; +import type { Query } from 'src/plugins/data/common'; +import { DataFilters, VectorSourceRequestMeta } from '../../../common/descriptor_types'; +import { IVectorSource } from '../sources/vector_source'; +import { ITermJoinSource } from '../sources/term_join_source'; + +export function buildVectorRequestMeta( + source: IVectorSource | ITermJoinSource, + fieldNames: string[], + dataFilters: DataFilters, + sourceQuery: Query | null | undefined, + isForceRefresh: boolean +): VectorSourceRequestMeta { + return { + ...dataFilters, + fieldNames: _.uniq(fieldNames).sort(), + geogridPrecision: source.getGeoGridPrecision(dataFilters.zoom), + sourceQuery: sourceQuery ? sourceQuery : undefined, + applyGlobalQuery: source.getApplyGlobalQuery(), + applyGlobalTime: source.getApplyGlobalTime(), + sourceMeta: source.getSyncMeta(), + applyForceRefresh: source.isESSource() ? source.getApplyForceRefresh() : false, + isForceRefresh, + }; +} diff --git a/x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/create_choropleth_layer_descriptor.ts b/x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/create_choropleth_layer_descriptor.ts index a4955a965d77c..6b91e4812a1d6 100644 --- a/x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/create_choropleth_layer_descriptor.ts +++ b/x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/create_choropleth_layer_descriptor.ts @@ -64,6 +64,7 @@ function createChoroplethLayerDescriptor({ metrics: [metricsDescriptor], applyGlobalQuery: true, applyGlobalTime: true, + applyForceRefresh: true, }, }, ], @@ -148,6 +149,8 @@ export function createEsChoroplethLayerDescriptor({ scalingType: SCALING_TYPES.LIMIT, tooltipProperties: [leftJoinField], applyGlobalQuery: false, + applyGlobalTime: false, + applyForceRefresh: false, }), leftField: leftJoinField, rightIndexPatternId, diff --git a/x-pack/plugins/maps/public/classes/layers/create_region_map_layer_descriptor.ts b/x-pack/plugins/maps/public/classes/layers/create_region_map_layer_descriptor.ts index 229532c09f955..408460de28aeb 100644 --- a/x-pack/plugins/maps/public/classes/layers/create_region_map_layer_descriptor.ts +++ b/x-pack/plugins/maps/public/classes/layers/create_region_map_layer_descriptor.ts @@ -92,6 +92,7 @@ export function createRegionMapLayerDescriptor({ metrics: [metricsDescriptor], applyGlobalQuery: true, applyGlobalTime: true, + applyForceRefresh: true, }; if (termsSize !== undefined) { termSourceDescriptor.size = termsSize; diff --git a/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.ts b/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.ts index d12c8432a4191..d65d114205163 100644 --- a/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.ts +++ b/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.ts @@ -10,11 +10,12 @@ import { FeatureCollection } from 'geojson'; import { AbstractLayer } from '../layer'; import { HeatmapStyle } from '../../styles/heatmap/heatmap_style'; import { EMPTY_FEATURE_COLLECTION, LAYER_TYPE } from '../../../../common/constants'; -import { HeatmapLayerDescriptor, MapQuery } from '../../../../common/descriptor_types'; +import { HeatmapLayerDescriptor } from '../../../../common/descriptor_types'; import { ESGeoGridSource } from '../../sources/es_geo_grid_source'; import { addGeoJsonMbSource, getVectorSourceBounds, syncVectorSource } from '../vector_layer'; import { DataRequestContext } from '../../../actions'; import { DataRequestAbortError } from '../../util/data_request'; +import { buildVectorRequestMeta } from '../build_vector_request_meta'; const SCALED_PROPERTY_NAME = '__kbn_heatmap_weight__'; // unique name to store scaled value for weighting @@ -94,21 +95,18 @@ export class HeatmapLayer extends AbstractLayer { return; } - const sourceQuery = this.getQuery() as MapQuery; try { await syncVectorSource({ layerId: this.getId(), layerName: await this.getDisplayName(this.getSource()), prevDataRequest: this.getSourceDataRequest(), - requestMeta: { - ...syncContext.dataFilters, - fieldNames: this.getSource().getFieldNames(), - geogridPrecision: this.getSource().getGeoGridPrecision(syncContext.dataFilters.zoom), - sourceQuery: sourceQuery ? sourceQuery : undefined, - applyGlobalQuery: this.getSource().getApplyGlobalQuery(), - applyGlobalTime: this.getSource().getApplyGlobalTime(), - sourceMeta: this.getSource().getSyncMeta(), - }, + requestMeta: buildVectorRequestMeta( + this.getSource(), + this.getSource().getFieldNames(), + syncContext.dataFilters, + this.getQuery(), + syncContext.isForceRefresh + ), syncContext, source: this.getSource(), getUpdateDueToTimeslice: () => { @@ -194,7 +192,7 @@ export class HeatmapLayer extends AbstractLayer { layerId: this.getId(), syncContext, source: this.getSource(), - sourceQuery: this.getQuery() as MapQuery, + sourceQuery: this.getQuery(), }); } diff --git a/x-pack/plugins/maps/public/classes/layers/layer.test.ts b/x-pack/plugins/maps/public/classes/layers/layer.test.ts index d3d8a94e175eb..dcc183c5c1741 100644 --- a/x-pack/plugins/maps/public/classes/layers/layer.test.ts +++ b/x-pack/plugins/maps/public/classes/layers/layer.test.ts @@ -84,6 +84,7 @@ describe('cloneDescriptor', () => { type: SOURCE_TYPES.ES_TERM_SOURCE, applyGlobalQuery: true, applyGlobalTime: true, + applyForceRefresh: true, }, }, ], diff --git a/x-pack/plugins/maps/public/classes/layers/new_vector_layer_wizard/config.tsx b/x-pack/plugins/maps/public/classes/layers/new_vector_layer_wizard/config.tsx index 5a82cf881e34d..0c3d1dc41d640 100644 --- a/x-pack/plugins/maps/public/classes/layers/new_vector_layer_wizard/config.tsx +++ b/x-pack/plugins/maps/public/classes/layers/new_vector_layer_wizard/config.tsx @@ -11,7 +11,7 @@ import { LayerWizard, RenderWizardArguments } from '../../layers/layer_wizard_re import { NewVectorLayerEditor } from './wizard'; import { DrawLayerIcon } from '../../layers/icons/draw_layer_icon'; import { getFileUpload } from '../../../kibana_services'; -import { LAYER_WIZARD_CATEGORY } from '../../../../common'; +import { LAYER_WIZARD_CATEGORY } from '../../../../common/constants'; const ADD_VECTOR_DRAWING_LAYER = 'ADD_VECTOR_DRAWING_LAYER'; diff --git a/x-pack/plugins/maps/public/classes/layers/new_vector_layer_wizard/create_new_index_pattern.ts b/x-pack/plugins/maps/public/classes/layers/new_vector_layer_wizard/create_new_index_pattern.ts index 2e57014824a3c..596d2ce86bbe2 100644 --- a/x-pack/plugins/maps/public/classes/layers/new_vector_layer_wizard/create_new_index_pattern.ts +++ b/x-pack/plugins/maps/public/classes/layers/new_vector_layer_wizard/create_new_index_pattern.ts @@ -6,11 +6,8 @@ */ import { getHttp } from '../../../kibana_services'; -import { - CreateDocSourceResp, - INDEX_SOURCE_API_PATH, - IndexSourceMappings, -} from '../../../../common'; +import { CreateDocSourceResp, IndexSourceMappings } from '../../../../common/types'; +import { INDEX_SOURCE_API_PATH } from '../../../../common/constants'; export const createNewIndexAndPattern = async ({ indexName, diff --git a/x-pack/plugins/maps/public/classes/layers/solution_layers/observability/create_layer_descriptor.test.ts b/x-pack/plugins/maps/public/classes/layers/solution_layers/observability/create_layer_descriptor.test.ts index 74ab35e6cb360..8955342824a77 100644 --- a/x-pack/plugins/maps/public/classes/layers/solution_layers/observability/create_layer_descriptor.test.ts +++ b/x-pack/plugins/maps/public/classes/layers/solution_layers/observability/create_layer_descriptor.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { emsWorldLayerId } from '../../../../../common'; +import { emsWorldLayerId } from '../../../../../common/constants'; jest.mock('../../../../kibana_services', () => { return { @@ -61,6 +61,7 @@ describe('createLayerDescriptor', () => { type: 'avg', }, ], + applyForceRefresh: true, term: 'client.geo.country_iso_code', type: 'ES_TERM_SOURCE', whereQuery: { @@ -201,6 +202,7 @@ describe('createLayerDescriptor', () => { ], requestType: 'heatmap', resolution: 'MOST_FINE', + applyForceRefresh: true, type: 'ES_GEO_GRID', }, style: { @@ -245,6 +247,7 @@ describe('createLayerDescriptor', () => { ], requestType: 'point', resolution: 'MOST_FINE', + applyForceRefresh: true, type: 'ES_GEO_GRID', }, style: { diff --git a/x-pack/plugins/maps/public/classes/layers/solution_layers/observability/create_layer_descriptor.ts b/x-pack/plugins/maps/public/classes/layers/solution_layers/observability/create_layer_descriptor.ts index 0b57afb38d585..d55040172f830 100644 --- a/x-pack/plugins/maps/public/classes/layers/solution_layers/observability/create_layer_descriptor.ts +++ b/x-pack/plugins/maps/public/classes/layers/solution_layers/observability/create_layer_descriptor.ts @@ -179,6 +179,7 @@ export function createLayerDescriptor({ whereQuery: apmSourceQuery, applyGlobalQuery: true, applyGlobalTime: true, + applyForceRefresh: true, }, }, ], diff --git a/x-pack/plugins/maps/public/classes/layers/solution_layers/security/create_layer_descriptors.test.ts b/x-pack/plugins/maps/public/classes/layers/solution_layers/security/create_layer_descriptors.test.ts index a3a3e8b20f678..cc6a7dfd9e796 100644 --- a/x-pack/plugins/maps/public/classes/layers/solution_layers/security/create_layer_descriptors.test.ts +++ b/x-pack/plugins/maps/public/classes/layers/solution_layers/security/create_layer_descriptors.test.ts @@ -47,6 +47,7 @@ describe('createLayerDescriptor', () => { geoField: 'client.geo.location', id: '12345', indexPatternId: 'id', + applyForceRefresh: true, scalingType: 'TOP_HITS', sortField: '', sortOrder: 'desc', @@ -156,6 +157,7 @@ describe('createLayerDescriptor', () => { geoField: 'server.geo.location', id: '12345', indexPatternId: 'id', + applyForceRefresh: true, scalingType: 'TOP_HITS', sortField: '', sortOrder: 'desc', @@ -274,6 +276,7 @@ describe('createLayerDescriptor', () => { type: 'sum', }, ], + applyForceRefresh: true, sourceGeoField: 'client.geo.location', type: 'ES_PEW_PEW', }, @@ -386,6 +389,7 @@ describe('createLayerDescriptor', () => { geoField: 'source.geo.location', id: '12345', indexPatternId: 'id', + applyForceRefresh: true, scalingType: 'TOP_HITS', sortField: '', sortOrder: 'desc', @@ -495,6 +499,7 @@ describe('createLayerDescriptor', () => { geoField: 'destination.geo.location', id: '12345', indexPatternId: 'id', + applyForceRefresh: true, scalingType: 'TOP_HITS', sortField: '', sortOrder: 'desc', @@ -613,6 +618,7 @@ describe('createLayerDescriptor', () => { type: 'sum', }, ], + applyForceRefresh: true, sourceGeoField: 'source.geo.location', type: 'ES_PEW_PEW', }, @@ -724,6 +730,7 @@ describe('createLayerDescriptor', () => { filterByMapBounds: true, geoField: 'client.geo.location', id: '12345', + applyForceRefresh: true, indexPatternId: 'id', scalingType: 'TOP_HITS', sortField: '', @@ -835,6 +842,7 @@ describe('createLayerDescriptor', () => { id: '12345', indexPatternId: 'id', scalingType: 'TOP_HITS', + applyForceRefresh: true, sortField: '', sortOrder: 'desc', tooltipProperties: [ @@ -952,6 +960,7 @@ describe('createLayerDescriptor', () => { type: 'sum', }, ], + applyForceRefresh: true, sourceGeoField: 'client.geo.location', type: 'ES_PEW_PEW', }, diff --git a/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx b/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx index 6277411fa053a..0d365cc5fc8c4 100644 --- a/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx +++ b/x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx @@ -38,7 +38,6 @@ import { } from '../../../../common/descriptor_types'; import { MVTSingleLayerVectorSourceConfig } from '../../sources/mvt_single_layer_vector_source/types'; import { canSkipSourceUpdate } from '../../util/can_skip_fetch'; -import { isRefreshOnlyQuery } from '../../util/is_refresh_only_query'; import { CustomIconAndTooltipContent } from '../layer'; export class TiledVectorLayer extends VectorLayer { @@ -113,9 +112,11 @@ export class TiledVectorLayer extends VectorLayer { stopLoading, onLoadError, dataFilters, + isForceRefresh, }: DataRequestContext) { const requestToken: symbol = Symbol(`layer-${this.getId()}-${SOURCE_DATA_REQUEST_ID}`); - const searchFilters: VectorSourceRequestMeta = await this._getSearchFilters( + const requestMeta: VectorSourceRequestMeta = await this._getVectorSourceRequestMeta( + isForceRefresh, dataFilters, this.getSource(), this._style as IVectorStyle @@ -132,7 +133,7 @@ export class TiledVectorLayer extends VectorLayer { extentAware: false, // spatial extent knowledge is already fully automated by tile-loading based on pan-zooming source: this.getSource(), prevDataRequest, - nextMeta: searchFilters, + nextRequestMeta: requestMeta, getUpdateDueToTimeslice: (timeslice?: Timeslice) => { // TODO use meta features to determine if tiles already contain features for timeslice. return true; @@ -145,18 +146,17 @@ export class TiledVectorLayer extends VectorLayer { } } - startLoading(SOURCE_DATA_REQUEST_ID, requestToken, searchFilters); + startLoading(SOURCE_DATA_REQUEST_ID, requestToken, requestMeta); try { - const prevMeta = prevDataRequest ? prevDataRequest.getMeta() : undefined; const prevData = prevDataRequest ? (prevDataRequest.getData() as MVTSingleLayerVectorSourceConfig) : undefined; const urlToken = - !prevData || isRefreshOnlyQuery(prevMeta ? prevMeta.query : undefined, searchFilters.query) + !prevData || (requestMeta.isForceRefresh && requestMeta.applyForceRefresh) ? uuid() : prevData.urlToken; - const newUrlTemplateAndMeta = await this._source.getUrlTemplateWithMeta(searchFilters); + const newUrlTemplateAndMeta = await this._source.getUrlTemplateWithMeta(requestMeta); let urlTemplate; if (newUrlTemplateAndMeta.refreshTokenParamName) { diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/utils.tsx b/x-pack/plugins/maps/public/classes/layers/vector_layer/utils.tsx index 346e59f60af32..6bc72f09e9387 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/utils.tsx +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/utils.tsx @@ -7,6 +7,7 @@ import { FeatureCollection } from 'geojson'; import type { Map as MbMap } from '@kbn/mapbox-gl'; +import type { Query } from 'src/plugins/data/common'; import { EMPTY_FEATURE_COLLECTION, SOURCE_BOUNDS_DATA_REQUEST_ID, @@ -14,9 +15,8 @@ import { VECTOR_SHAPE_TYPE, } from '../../../../common/constants'; import { - DataMeta, + DataRequestMeta, MapExtent, - MapQuery, Timeslice, VectorSourceRequestMeta, } from '../../../../common/descriptor_types'; @@ -77,15 +77,17 @@ export async function syncVectorSource({ } = syncContext; const dataRequestId = SOURCE_DATA_REQUEST_ID; const requestToken = Symbol(`${layerId}-${dataRequestId}`); - const canSkipFetch = syncContext.forceRefresh + + const canSkipFetch = syncContext.forceRefreshDueToDrawing ? false : await canSkipSourceUpdate({ source, prevDataRequest, - nextMeta: requestMeta, + nextRequestMeta: requestMeta, extentAware: source.isFilterByMapBounds(), getUpdateDueToTimeslice, }); + if (canSkipFetch) { return { refreshed: false, @@ -113,11 +115,11 @@ export async function syncVectorSource({ ) { layerFeatureCollection.features.push(...getCentroidFeatures(layerFeatureCollection)); } - const responseMeta: DataMeta = meta ? { ...meta } : {}; + const responseMeta: DataRequestMeta = meta ? { ...meta } : {}; if (requestMeta.applyGlobalTime && (await source.isTimeAware())) { - const timesiceMaskField = await source.getTimesliceMaskFieldName(); - if (timesiceMaskField) { - responseMeta.timesiceMaskField = timesiceMaskField; + const timesliceMaskField = await source.getTimesliceMaskFieldName(); + if (timesliceMaskField) { + responseMeta.timesliceMaskField = timesliceMaskField; } } stopLoading(dataRequestId, requestToken, layerFeatureCollection, responseMeta); @@ -142,7 +144,7 @@ export async function getVectorSourceBounds({ layerId: string; syncContext: DataRequestContext; source: IVectorSource; - sourceQuery: MapQuery | null; + sourceQuery: Query | null; }): Promise { const { startLoading, stopLoading, registerCancelCallback, dataFilters } = syncContext; diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx b/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx index 54e0c00141cd3..c4903ddb325b2 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx @@ -11,6 +11,7 @@ import type { AnyLayer as MbLayer, GeoJSONSource as MbGeoJSONSource, } from '@kbn/mapbox-gl'; +import type { Query } from 'src/plugins/data/common'; import { Feature, FeatureCollection, GeoJsonProperties, Geometry, Position } from 'geojson'; import _ from 'lodash'; import { EuiIcon } from '@elastic/eui'; @@ -48,14 +49,13 @@ import { } from '../../util/mb_filter_expressions'; import { DynamicStylePropertyOptions, - MapFilters, - MapQuery, + DataFilters, StyleMetaDescriptor, Timeslice, - VectorJoinSourceRequestMeta, VectorLayerDescriptor, VectorSourceRequestMeta, VectorStyleRequestMeta, + VectorJoinSourceRequestMeta, } from '../../../../common/descriptor_types'; import { ISource } from '../../sources/source'; import { IVectorSource } from '../../sources/vector_source'; @@ -70,6 +70,7 @@ import { PropertiesMap } from '../../../../common/elasticsearch_util'; import { ITermJoinSource } from '../../sources/term_join_source'; import { addGeoJsonMbSource, getVectorSourceBounds, syncVectorSource } from './utils'; import { JoinState, performInnerJoins } from './perform_inner_joins'; +import { buildVectorRequestMeta } from '../build_vector_request_meta'; export interface VectorLayerArguments { source: IVectorSource; @@ -266,7 +267,7 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { layerId: this.getId(), syncContext, source: this.getSource(), - sourceQuery: this.getQuery() as MapQuery, + sourceQuery: this.getQuery(), }); } @@ -332,29 +333,31 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { onLoadError, registerCancelCallback, dataFilters, + isForceRefresh, }: { join: InnerJoin } & DataRequestContext): Promise { const joinSource = join.getRightJoinSource(); const sourceDataId = join.getSourceDataRequestId(); const requestToken = Symbol(`layer-join-refresh:${this.getId()} - ${sourceDataId}`); - const searchFilters: VectorJoinSourceRequestMeta = { - ...dataFilters, - fieldNames: joinSource.getFieldNames(), - sourceQuery: joinSource.getWhereQuery(), - applyGlobalQuery: joinSource.getApplyGlobalQuery(), - applyGlobalTime: joinSource.getApplyGlobalTime(), - sourceMeta: joinSource.getSyncMeta(), - }; - const prevDataRequest = this.getDataRequest(sourceDataId); + const joinRequestMeta: VectorJoinSourceRequestMeta = buildVectorRequestMeta( + joinSource, + joinSource.getFieldNames(), + dataFilters, + joinSource.getWhereQuery(), + isForceRefresh + ) as VectorJoinSourceRequestMeta; + + const prevDataRequest = this.getDataRequest(sourceDataId); const canSkipFetch = await canSkipSourceUpdate({ source: joinSource, prevDataRequest, - nextMeta: searchFilters, + nextRequestMeta: joinRequestMeta, extentAware: false, // join-sources are term-aggs that are spatially unaware (e.g. ESTermSource/TableSource). getUpdateDueToTimeslice: () => { return true; }, }); + if (canSkipFetch) { return { dataHasChanged: false, @@ -364,10 +367,10 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { } try { - startLoading(sourceDataId, requestToken, searchFilters); + startLoading(sourceDataId, requestToken, joinRequestMeta); const leftSourceName = await this._source.getDisplayName(); const propertiesMap = await joinSource.getPropertiesMap( - searchFilters, + joinRequestMeta, leftSourceName, join.getLeftField().getName(), registerCancelCallback.bind(null, requestToken) @@ -396,8 +399,9 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { return await Promise.all(joinSyncs); } - async _getSearchFilters( - dataFilters: MapFilters, + async _getVectorSourceRequestMeta( + isForceRefresh: boolean, + dataFilters: DataFilters, source: IVectorSource, style: IVectorStyle ): Promise { @@ -411,17 +415,7 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { if (timesliceMaskFieldName) { fieldNames.push(timesliceMaskFieldName); } - - const sourceQuery = this.getQuery() as MapQuery; - return { - ...dataFilters, - fieldNames: _.uniq(fieldNames).sort(), - geogridPrecision: source.getGeoGridPrecision(dataFilters.zoom), - sourceQuery: sourceQuery ? sourceQuery : undefined, - applyGlobalQuery: source.getApplyGlobalQuery(), - applyGlobalTime: source.getApplyGlobalTime(), - sourceMeta: source.getSyncMeta(), - }; + return buildVectorRequestMeta(source, fieldNames, dataFilters, this.getQuery(), isForceRefresh); } async _syncSourceStyleMeta( @@ -429,7 +423,7 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { source: IVectorSource, style: IVectorStyle ) { - const sourceQuery = this.getQuery() as MapQuery; + const sourceQuery = this.getQuery(); return this._syncStyleMeta({ source, style, @@ -481,7 +475,7 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { dataRequestId: string; dynamicStyleProps: Array>; source: IVectorSource | ITermJoinSource; - sourceQuery?: MapQuery; + sourceQuery?: Query; style: IVectorStyle; } & DataRequestContext) { if (!source.isESSource() || dynamicStyleProps.length === 0) { @@ -641,7 +635,12 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { layerId: this.getId(), layerName: await this.getDisplayName(source), prevDataRequest: this.getSourceDataRequest(), - requestMeta: await this._getSearchFilters(syncContext.dataFilters, source, style), + requestMeta: await this._getVectorSourceRequestMeta( + syncContext.isForceRefresh, + syncContext.dataFilters, + source, + style + ), syncContext, source, getUpdateDueToTimeslice: (timeslice?: Timeslice) => { @@ -995,9 +994,9 @@ export class VectorLayer extends AbstractLayer implements IVectorLayer { } const prevMeta = this.getSourceDataRequest()?.getMeta(); - return prevMeta !== undefined && prevMeta.timesiceMaskField !== undefined + return prevMeta !== undefined && prevMeta.timesliceMaskField !== undefined ? { - timesiceMaskField: prevMeta.timesiceMaskField, + timesliceMaskField: prevMeta.timesliceMaskField, timeslice, } : undefined; diff --git a/x-pack/plugins/maps/public/classes/layers/vector_tile_layer/vector_tile_layer.test.ts b/x-pack/plugins/maps/public/classes/layers/vector_tile_layer/vector_tile_layer.test.ts index 20627f42b3d2d..fe3c6d27ef588 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_tile_layer/vector_tile_layer.test.ts +++ b/x-pack/plugins/maps/public/classes/layers/vector_tile_layer/vector_tile_layer.test.ts @@ -7,7 +7,7 @@ import { ITileLayerArguments } from '../tile_layer/tile_layer'; import { SOURCE_TYPES } from '../../../../common/constants'; -import { MapFilters, XYZTMSSourceDescriptor } from '../../../../common/descriptor_types'; +import { DataFilters, XYZTMSSourceDescriptor } from '../../../../common/descriptor_types'; import { ITMSSource, AbstractTMSSource } from '../../sources/tms_source'; import { ILayer } from '../layer'; import { VectorTileLayer } from './vector_tile_layer'; @@ -63,7 +63,7 @@ describe('VectorTileLayer', () => { onLoadError: (requestId: string, token: string, message: string) => { actualErrorMessage = message; }, - dataFilters: ({ foo: 'bar' } as unknown) as MapFilters, + dataFilters: ({ foo: 'bar' } as unknown) as DataFilters, } as unknown) as DataRequestContext; await layer.syncData(mockContext); diff --git a/x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.test.ts b/x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.test.ts index 360f00b486a38..7db3652011e9a 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.test.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.test.ts @@ -40,6 +40,7 @@ class TestESAggSource extends AbstractESAggSource { metrics, applyGlobalQuery: true, applyGlobalTime: true, + applyForceRefresh: true, }, [] ); diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.test.ts b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.test.ts index efbb755f2a1f7..41d5715e47b8e 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.test.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.test.ts @@ -155,15 +155,16 @@ describe('ESGeoGridSource', () => { extent, applyGlobalQuery: true, applyGlobalTime: true, + applyForceRefresh: true, fieldNames: [], buffer: extent, sourceQuery: { query: '', language: 'KQL', - queryLastTriggeredAt: '2019-04-25T20:53:22.331Z', }, sourceMeta: null, zoom: 0, + isForceRefresh: false, }; describe('getGeoJsonWithMeta', () => { @@ -315,7 +316,7 @@ describe('ESGeoGridSource', () => { expect(urlTemplateWithMeta.minSourceZoom).toBe(0); expect(urlTemplateWithMeta.maxSourceZoom).toBe(24); expect(urlTemplateWithMeta.urlTemplate).toEqual( - "rootdir/api/maps/mvt/getGridTile/{z}/{x}/{y}.pbf?geometryFieldName=bar&index=undefined&requestBody=(foobar:ES_DSL_PLACEHOLDER,params:('0':('0':index,'1':(fields:())),'1':('0':size,'1':0),'2':('0':filter,'1':!()),'3':('0':query),'4':('0':index,'1':(fields:())),'5':('0':query,'1':(language:KQL,query:'',queryLastTriggeredAt:'2019-04-25T20:53:22.331Z')),'6':('0':aggs,'1':(gridSplit:(aggs:(gridCentroid:(geo_centroid:(field:bar))),geotile_grid:(bounds:!n,field:bar,precision:!n,shard_size:65535,size:65535))))))&requestType=heatmap&geoFieldType=geo_point" + "rootdir/api/maps/mvt/getGridTile/{z}/{x}/{y}.pbf?geometryFieldName=bar&index=undefined&requestBody=(foobar:ES_DSL_PLACEHOLDER,params:('0':('0':index,'1':(fields:())),'1':('0':size,'1':0),'2':('0':filter,'1':!()),'3':('0':query),'4':('0':index,'1':(fields:())),'5':('0':query,'1':(language:KQL,query:'')),'6':('0':aggs,'1':(gridSplit:(aggs:(gridCentroid:(geo_centroid:(field:bar))),geotile_grid:(bounds:!n,field:bar,precision:!n,shard_size:65535,size:65535))))))&requestType=heatmap&geoFieldType=geo_point" ); }); @@ -327,7 +328,7 @@ describe('ESGeoGridSource', () => { expect( urlTemplateWithMeta.urlTemplate.startsWith( - "rootdir/api/maps/mvt/getGridTile/{z}/{x}/{y}.pbf?geometryFieldName=bar&index=undefined&requestBody=(foobar:ES_DSL_PLACEHOLDER,params:('0':('0':index,'1':(fields:())),'1':('0':size,'1':0),'2':('0':filter,'1':!()),'3':('0':query),'4':('0':index,'1':(fields:())),'5':('0':query,'1':(language:KQL,query:'',queryLastTriggeredAt:'2019-04-25T20:53:22.331Z')),'6':('0':aggs,'1':(gridSplit:(aggs:(gridCentroid:(geo_centroid:(field:bar))),geotile_grid:(bounds:!n,field:bar,precision:!n,shard_size:65535,size:65535))))))&requestType=heatmap&geoFieldType=geo_point&searchSessionId=1" + "rootdir/api/maps/mvt/getGridTile/{z}/{x}/{y}.pbf?geometryFieldName=bar&index=undefined&requestBody=(foobar:ES_DSL_PLACEHOLDER,params:('0':('0':index,'1':(fields:())),'1':('0':size,'1':0),'2':('0':filter,'1':!()),'3':('0':query),'4':('0':index,'1':(fields:())),'5':('0':query,'1':(language:KQL,query:'')),'6':('0':aggs,'1':(gridSplit:(aggs:(gridCentroid:(geo_centroid:(field:bar))),geotile_grid:(bounds:!n,field:bar,precision:!n,shard_size:65535,size:65535))))))&requestType=heatmap&geoFieldType=geo_point&searchSessionId=1" ) ).toBe(true); diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx index f0cec4abf0b14..e65e6ff4c463b 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx @@ -49,7 +49,7 @@ import { } from '../../../../common/descriptor_types'; import { ImmutableSourceProperty, SourceEditorArgs } from '../source'; import { ISearchSource } from '../../../../../../../src/plugins/data/common/search/search_source'; -import { IndexPattern } from '../../../../../../../src/plugins/data/common/index_patterns/index_patterns'; +import { IndexPattern } from '../../../../../../../src/plugins/data/common'; import { Adapters } from '../../../../../../../src/plugins/inspector/common/adapters'; import { isValidStringConfig } from '../../util/valid_string_config'; import { ITiledSingleLayerMvtParams } from '../tiled_single_layer_vector_source/tiled_single_layer_vector_source'; diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.test.ts b/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.test.ts index 0c15afff6b051..4a818d898a190 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.test.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.test.ts @@ -20,7 +20,7 @@ describe('getSourceTooltipContent', () => { const sourceDataRequest = new DataRequest({ data: {}, dataId: 'source', - dataMeta: { + dataRequestMeta: { areResultsTrimmed: false, areEntitiesTrimmed: false, entityCount: 70, @@ -39,7 +39,7 @@ describe('getSourceTooltipContent', () => { const sourceDataRequest = new DataRequest({ data: {}, dataId: 'source', - dataMeta: { + dataRequestMeta: { areResultsTrimmed: true, areEntitiesTrimmed: true, entityCount: 1000, @@ -58,7 +58,7 @@ describe('getSourceTooltipContent', () => { const sourceDataRequest = new DataRequest({ data: {}, dataId: 'source', - dataMeta: { + dataRequestMeta: { areResultsTrimmed: false, areEntitiesTrimmed: false, entityCount: 70, @@ -77,7 +77,7 @@ describe('getSourceTooltipContent', () => { const sourceDataRequest = new DataRequest({ data: {}, dataId: 'source', - dataMeta: { + dataRequestMeta: { areResultsTrimmed: true, areEntitiesTrimmed: true, entityCount: 1000, diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/create_layer_descriptor.test.ts b/x-pack/plugins/maps/public/classes/sources/es_search_source/create_layer_descriptor.test.ts index e7711a6e28e01..0c68bf6d832ad 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/create_layer_descriptor.test.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/create_layer_descriptor.test.ts @@ -41,6 +41,7 @@ test('Should create layer descriptor', () => { geoField: 'myGeoField', id: '12345', indexPatternId: 'myIndexPattern', + applyForceRefresh: true, scalingType: 'CLUSTERS', sortField: '', sortOrder: 'desc', diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.test.ts b/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.test.ts index 1a5ea8bb14e0e..5bff5d69aeab7 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.test.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.test.ts @@ -102,11 +102,12 @@ describe('ESSearchSource', () => { sourceQuery: { query: 'tooltipField: foobar', language: 'KQL', - queryLastTriggeredAt: '2019-04-25T20:53:22.331Z', }, sourceMeta: null, applyGlobalQuery: true, applyGlobalTime: true, + applyForceRefresh: true, + isForceRefresh: false, }; it('Should only include required props', async () => { @@ -116,7 +117,7 @@ describe('ESSearchSource', () => { }); const urlTemplateWithMeta = await esSearchSource.getUrlTemplateWithMeta(searchFilters); expect(urlTemplateWithMeta.urlTemplate).toBe( - `rootdir/api/maps/mvt/getTile/{z}/{x}/{y}.pbf?geometryFieldName=bar&index=foobar-title-*&requestBody=(foobar:ES_DSL_PLACEHOLDER,params:('0':('0':index,'1':(fields:(),title:'foobar-title-*')),'1':('0':size,'1':1000),'2':('0':filter,'1':!()),'3':('0':query),'4':('0':index,'1':(fields:(),title:'foobar-title-*')),'5':('0':query,'1':(language:KQL,query:'tooltipField: foobar',queryLastTriggeredAt:'2019-04-25T20:53:22.331Z')),'6':('0':fieldsFromSource,'1':!(tooltipField,styleField)),'7':('0':source,'1':!(tooltipField,styleField))))&geoFieldType=geo_shape` + `rootdir/api/maps/mvt/getTile/{z}/{x}/{y}.pbf?geometryFieldName=bar&index=foobar-title-*&requestBody=(foobar:ES_DSL_PLACEHOLDER,params:('0':('0':index,'1':(fields:(),title:'foobar-title-*')),'1':('0':size,'1':1000),'2':('0':filter,'1':!()),'3':('0':query),'4':('0':index,'1':(fields:(),title:'foobar-title-*')),'5':('0':query,'1':(language:KQL,query:'tooltipField: foobar')),'6':('0':fieldsFromSource,'1':!(tooltipField,styleField)),'7':('0':source,'1':!(tooltipField,styleField))))&geoFieldType=geo_shape` ); }); @@ -130,7 +131,7 @@ describe('ESSearchSource', () => { searchSessionId: '1', }); expect(urlTemplateWithMeta.urlTemplate).toBe( - `rootdir/api/maps/mvt/getTile/{z}/{x}/{y}.pbf?geometryFieldName=bar&index=foobar-title-*&requestBody=(foobar:ES_DSL_PLACEHOLDER,params:('0':('0':index,'1':(fields:(),title:'foobar-title-*')),'1':('0':size,'1':1000),'2':('0':filter,'1':!()),'3':('0':query),'4':('0':index,'1':(fields:(),title:'foobar-title-*')),'5':('0':query,'1':(language:KQL,query:'tooltipField: foobar',queryLastTriggeredAt:'2019-04-25T20:53:22.331Z')),'6':('0':fieldsFromSource,'1':!(tooltipField,styleField)),'7':('0':source,'1':!(tooltipField,styleField))))&geoFieldType=geo_shape&searchSessionId=1` + `rootdir/api/maps/mvt/getTile/{z}/{x}/{y}.pbf?geometryFieldName=bar&index=foobar-title-*&requestBody=(foobar:ES_DSL_PLACEHOLDER,params:('0':('0':index,'1':(fields:(),title:'foobar-title-*')),'1':('0':size,'1':1000),'2':('0':filter,'1':!()),'3':('0':query),'4':('0':index,'1':(fields:(),title:'foobar-title-*')),'5':('0':query,'1':(language:KQL,query:'tooltipField: foobar')),'6':('0':fieldsFromSource,'1':!(tooltipField,styleField)),'7':('0':source,'1':!(tooltipField,styleField))))&geoFieldType=geo_shape&searchSessionId=1` ); }); }); diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx b/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx index 1ca7ddb586293..2b847d218434d 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx @@ -48,7 +48,7 @@ import { DEFAULT_FILTER_BY_MAP_BOUNDS } from './constants'; import { ESDocField } from '../../fields/es_doc_field'; import { registerSource } from '../source_registry'; import { - DataMeta, + DataRequestMeta, ESSearchSourceDescriptor, Timeslice, VectorSourceRequestMeta, @@ -853,7 +853,7 @@ export class ESSearchSource extends AbstractESSource implements ITiledSingleLaye return indexPattern.timeFieldName ? indexPattern.timeFieldName : null; } - getUpdateDueToTimeslice(prevMeta: DataMeta, timeslice?: Timeslice): boolean { + getUpdateDueToTimeslice(prevMeta: DataRequestMeta, timeslice?: Timeslice): boolean { if (this._isTopHits() || this._descriptor.scalingType === SCALING_TYPES.MVT) { return true; } diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/__snapshots__/scaling_form.test.tsx.snap b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/__snapshots__/scaling_form.test.tsx.snap index 99ce13ce326d6..749d55aeb5da7 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/__snapshots__/scaling_form.test.tsx.snap +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/__snapshots__/scaling_form.test.tsx.snap @@ -34,6 +34,7 @@ exports[`scaling form should disable clusters option when clustering is not supp } delay="regular" + display="inlineBlock" position="left" > } delay="regular" + display="inlineBlock" position="left" > >; registerCancelCallback: (callback: () => void) => void; - sourceQuery?: MapQuery; + sourceQuery?: Query; timeFilters: TimeRange; searchSessionId?: string; }): Promise; @@ -88,6 +88,8 @@ export class AbstractESSource extends AbstractVectorSource implements IESSource typeof descriptor.applyGlobalQuery !== 'undefined' ? descriptor.applyGlobalQuery : true, applyGlobalTime: typeof descriptor.applyGlobalTime !== 'undefined' ? descriptor.applyGlobalTime : true, + applyForceRefresh: + typeof descriptor.applyForceRefresh !== 'undefined' ? descriptor.applyForceRefresh : true, }; } @@ -108,11 +110,11 @@ export class AbstractESSource extends AbstractVectorSource implements IESSource return this._descriptor.applyGlobalTime; } - isFieldAware(): boolean { - return true; + getApplyForceRefresh(): boolean { + return this._descriptor.applyForceRefresh; } - isRefreshTimerAware(): boolean { + isFieldAware(): boolean { return true; } @@ -197,7 +199,7 @@ export class AbstractESSource extends AbstractVectorSource implements IESSource } async makeSearchSource( - searchFilters: VectorSourceRequestMeta | VectorJoinSourceRequestMeta | BoundsFilters, + searchFilters: VectorSourceRequestMeta | VectorJoinSourceRequestMeta | BoundsRequestMeta, limit: number, initialSearchContext?: object ): Promise { @@ -253,7 +255,7 @@ export class AbstractESSource extends AbstractVectorSource implements IESSource } async getBoundsForFilters( - boundsFilters: BoundsFilters, + boundsFilters: BoundsRequestMeta, registerCancelCallback: (callback: () => void) => void ): Promise { const searchSource = await this.makeSearchSource(boundsFilters, 0); @@ -421,7 +423,7 @@ export class AbstractESSource extends AbstractVectorSource implements IESSource style: IVectorStyle; dynamicStyleProps: Array>; registerCancelCallback: (callback: () => void) => void; - sourceQuery?: MapQuery; + sourceQuery?: Query; timeFilters: TimeRange; searchSessionId?: string; }): Promise { diff --git a/x-pack/plugins/maps/public/classes/sources/es_term_source/es_term_source.test.js b/x-pack/plugins/maps/public/classes/sources/es_term_source/es_term_source.test.js index 1f4a1ab7c9afa..362b2b341714f 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_term_source/es_term_source.test.js +++ b/x-pack/plugins/maps/public/classes/sources/es_term_source/es_term_source.test.js @@ -109,3 +109,20 @@ describe('extractPropertiesMap', () => { expect(properties[minPropName]).toBe(0); }); }); + +describe('getSyncMeta', () => { + it('should contain meta requiring source re-fetch when changed', () => { + const source = new ESTermSource({ + id: '1234', + indexPatternTitle: indexPatternTitle, + term: termFieldName, + indexPatternId: 'foobar', + size: 10, + }); + expect(source.getSyncMeta()).toEqual({ + indexPatternId: 'foobar', + size: 10, + term: 'myTermField', + }); + }); +}); diff --git a/x-pack/plugins/maps/public/classes/sources/es_term_source/es_term_source.ts b/x-pack/plugins/maps/public/classes/sources/es_term_source/es_term_source.ts index caae4385aeec6..93342d1167aeb 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_term_source/es_term_source.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_term_source/es_term_source.ts @@ -25,8 +25,8 @@ import { } from '../../../../common/elasticsearch_util'; import { ESTermSourceDescriptor, + ESTermSourceSyncMeta, VectorJoinSourceRequestMeta, - VectorSourceSyncMeta, } from '../../../../common/descriptor_types'; import { Adapters } from '../../../../../../../src/plugins/inspector/common/adapters'; import { PropertiesMap } from '../../../../common/elasticsearch_util'; @@ -171,12 +171,12 @@ export class ESTermSource extends AbstractESAggSource implements ITermJoinSource return this.getMetricFields().map((esAggMetricField) => esAggMetricField.getName()); } - getSyncMeta(): VectorSourceSyncMeta | null { - return this._descriptor.size !== undefined - ? { - size: this._descriptor.size, - } - : null; + getSyncMeta(): ESTermSourceSyncMeta | null { + return { + indexPatternId: this._descriptor.indexPatternId, + size: this._descriptor.size, + term: this._descriptor.term, + }; } getRightFields(): IField[] { diff --git a/x-pack/plugins/maps/public/classes/sources/geojson_file_source/geojson_file.test.ts b/x-pack/plugins/maps/public/classes/sources/geojson_file_source/geojson_file.test.ts index 6f7d5aa91e2b8..9e21f16d7f30a 100644 --- a/x-pack/plugins/maps/public/classes/sources/geojson_file_source/geojson_file.test.ts +++ b/x-pack/plugins/maps/public/classes/sources/geojson_file_source/geojson_file.test.ts @@ -6,7 +6,7 @@ */ import { GeoJsonFileSource } from './geojson_file_source'; -import { BoundsFilters } from '../vector_source'; +import { BoundsRequestMeta } from '../vector_source'; import { FIELD_ORIGIN } from '../../../../common/constants'; describe('GeoJsonFileSource', () => { @@ -20,7 +20,7 @@ describe('GeoJsonFileSource', () => { it('should get null bounds', async () => { const geojsonFileSource = new GeoJsonFileSource({}); expect( - await geojsonFileSource.getBoundsForFilters(({} as unknown) as BoundsFilters, () => {}) + await geojsonFileSource.getBoundsForFilters(({} as unknown) as BoundsRequestMeta, () => {}) ).toEqual(null); }); @@ -51,7 +51,7 @@ describe('GeoJsonFileSource', () => { expect(geojsonFileSource.isBoundsAware()).toBe(true); expect( - await geojsonFileSource.getBoundsForFilters(({} as unknown) as BoundsFilters, () => {}) + await geojsonFileSource.getBoundsForFilters(({} as unknown) as BoundsRequestMeta, () => {}) ).toEqual({ maxLat: 3, maxLon: 2, diff --git a/x-pack/plugins/maps/public/classes/sources/geojson_file_source/geojson_file_source.ts b/x-pack/plugins/maps/public/classes/sources/geojson_file_source/geojson_file_source.ts index 592c2f852f0e7..4de29fde1253c 100644 --- a/x-pack/plugins/maps/public/classes/sources/geojson_file_source/geojson_file_source.ts +++ b/x-pack/plugins/maps/public/classes/sources/geojson_file_source/geojson_file_source.ts @@ -6,7 +6,7 @@ */ import { Feature, FeatureCollection } from 'geojson'; -import { AbstractVectorSource, BoundsFilters, GeoJsonWithMeta } from '../vector_source'; +import { AbstractVectorSource, BoundsRequestMeta, GeoJsonWithMeta } from '../vector_source'; import { EMPTY_FEATURE_COLLECTION, FIELD_ORIGIN, SOURCE_TYPES } from '../../../../common/constants'; import { InlineFieldDescriptor, @@ -103,7 +103,7 @@ export class GeoJsonFileSource extends AbstractVectorSource { } async getBoundsForFilters( - boundsFilters: BoundsFilters, + boundsFilters: BoundsRequestMeta, registerCancelCallback: (callback: () => void) => void ): Promise { const featureCollection = (this._descriptor as GeojsonFileSourceDescriptor).__featureCollection; diff --git a/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/__snapshots__/mvt_single_layer_source_settings.test.tsx.snap b/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/__snapshots__/mvt_single_layer_source_settings.test.tsx.snap index c82618a500a33..7926011be4ecc 100644 --- a/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/__snapshots__/mvt_single_layer_source_settings.test.tsx.snap +++ b/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/__snapshots__/mvt_single_layer_source_settings.test.tsx.snap @@ -28,6 +28,7 @@ exports[`should not render fields-editor when there is no layername 1`] = ` anchorClassName="eui-alignMiddle" content="Zoom levels where the layer is present in the tiles. This does not correspond directly to visibility. Layer data from lower levels can always be displayed at higher zoom levels (but not vice versa)." delay="regular" + display="inlineBlock" position="top" > @@ -84,6 +85,7 @@ exports[`should render with fields 1`] = ` anchorClassName="eui-alignMiddle" content="Zoom levels where the layer is present in the tiles. This does not correspond directly to visibility. Layer data from lower levels can always be displayed at higher zoom levels (but not vice versa)." delay="regular" + display="inlineBlock" position="top" > @@ -132,6 +134,7 @@ exports[`should render with fields 1`] = ` } delay="regular" + display="inlineBlock" position="top" > @@ -182,6 +185,7 @@ exports[`should render without fields 1`] = ` anchorClassName="eui-alignMiddle" content="Zoom levels where the layer is present in the tiles. This does not correspond directly to visibility. Layer data from lower levels can always be displayed at higher zoom levels (but not vice versa)." delay="regular" + display="inlineBlock" position="top" > diff --git a/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/mvt_single_layer_vector_source.tsx b/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/mvt_single_layer_vector_source.tsx index 6911cbabdf971..d041e0d3ad5de 100644 --- a/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/mvt_single_layer_vector_source.tsx +++ b/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/mvt_single_layer_vector_source.tsx @@ -10,7 +10,7 @@ import uuid from 'uuid/v4'; import React from 'react'; import { GeoJsonProperties, Geometry, Position } from 'geojson'; import { AbstractSource, ImmutableSourceProperty, SourceEditorArgs } from '../source'; -import { BoundsFilters, GeoJsonWithMeta } from '../vector_source'; +import { BoundsRequestMeta, GeoJsonWithMeta } from '../vector_source'; import { ITiledSingleLayerVectorSource } from '../tiled_single_layer_vector_source'; import { FIELD_ORIGIN, @@ -190,7 +190,7 @@ export class MVTSingleLayerVectorSource } async getBoundsForFilters( - boundsFilters: BoundsFilters, + boundsFilters: BoundsRequestMeta, registerCancelCallback: (callback: () => void) => void ): Promise { return null; diff --git a/x-pack/plugins/maps/public/classes/sources/source.ts b/x-pack/plugins/maps/public/classes/sources/source.ts index 0ecbde06cf3e2..5b2fc16d18b41 100644 --- a/x-pack/plugins/maps/public/classes/sources/source.ts +++ b/x-pack/plugins/maps/public/classes/sources/source.ts @@ -16,7 +16,7 @@ import { FieldFormatter, LAYER_TYPE, MAX_ZOOM, MIN_ZOOM } from '../../../common/ import { AbstractSourceDescriptor, Attribution, - DataMeta, + DataRequestMeta, Timeslice, } from '../../../common/descriptor_types'; import { LICENSED_FEATURES } from '../../licensed_features'; @@ -47,7 +47,6 @@ export interface ISource { isFilterByMapBounds(): boolean; isGeoGridPrecisionAware(): boolean; isQueryAware(): boolean; - isRefreshTimerAware(): boolean; isTimeAware(): Promise; getImmutableProperties(): Promise; getAttributionProvider(): (() => Promise) | null; @@ -60,6 +59,7 @@ export interface ISource { getFieldNames(): string[]; getApplyGlobalQuery(): boolean; getApplyGlobalTime(): boolean; + getApplyForceRefresh(): boolean; getIndexPatternIds(): string[]; getQueryableIndexPatternIds(): string[]; getGeoGridPrecision(zoom: number): number; @@ -69,7 +69,7 @@ export interface ISource { getMinZoom(): number; getMaxZoom(): number; getLicensedFeatures(): Promise; - getUpdateDueToTimeslice(prevMeta: DataMeta, timeslice?: Timeslice): boolean; + getUpdateDueToTimeslice(prevMeta: DataRequestMeta, timeslice?: Timeslice): boolean; } export class AbstractSource implements ISource { @@ -115,10 +115,6 @@ export class AbstractSource implements ISource { return false; } - isRefreshTimerAware(): boolean { - return false; - } - isGeoGridPrecisionAware(): boolean { return false; } @@ -143,6 +139,10 @@ export class AbstractSource implements ISource { return false; } + getApplyForceRefresh(): boolean { + return false; + } + getIndexPatternIds(): string[] { return []; } @@ -201,7 +201,7 @@ export class AbstractSource implements ISource { return []; } - getUpdateDueToTimeslice(prevMeta: DataMeta, timeslice?: Timeslice): boolean { + getUpdateDueToTimeslice(prevMeta: DataRequestMeta, timeslice?: Timeslice): boolean { return true; } } diff --git a/x-pack/plugins/maps/public/classes/sources/table_source/table_source.test.ts b/x-pack/plugins/maps/public/classes/sources/table_source/table_source.test.ts index 337cc2d601abd..62404cbe942e3 100644 --- a/x-pack/plugins/maps/public/classes/sources/table_source/table_source.test.ts +++ b/x-pack/plugins/maps/public/classes/sources/table_source/table_source.test.ts @@ -5,11 +5,11 @@ * 2.0. */ +import type { Query } from 'src/plugins/data/common'; import { TableSource } from './table_source'; import { FIELD_ORIGIN } from '../../../../common/constants'; import { - MapFilters, - MapQuery, + DataFilters, VectorJoinSourceRequestMeta, VectorSourceSyncMeta, } from '../../../../common/descriptor_types'; @@ -178,12 +178,12 @@ describe('TableSource', () => { try { await tableSource.getGeoJsonWithMeta( 'foobar', - ({} as unknown) as MapFilters & { + ({} as unknown) as DataFilters & { applyGlobalQuery: boolean; applyGlobalTime: boolean; fieldNames: string[]; geogridPrecision?: number; - sourceQuery?: MapQuery; + sourceQuery?: Query; sourceMeta: VectorSourceSyncMeta; }, () => {}, diff --git a/x-pack/plugins/maps/public/classes/sources/table_source/table_source.ts b/x-pack/plugins/maps/public/classes/sources/table_source/table_source.ts index 372fb4983d7cc..8730ea7e3d02b 100644 --- a/x-pack/plugins/maps/public/classes/sources/table_source/table_source.ts +++ b/x-pack/plugins/maps/public/classes/sources/table_source/table_source.ts @@ -6,11 +6,11 @@ */ import uuid from 'uuid'; +import type { Query } from 'src/plugins/data/common'; import { FIELD_ORIGIN, SOURCE_TYPES, VECTOR_SHAPE_TYPE } from '../../../../common/constants'; import { MapExtent, - MapFilters, - MapQuery, + DataFilters, TableSourceDescriptor, VectorJoinSourceRequestMeta, VectorSourceSyncMeta, @@ -19,10 +19,9 @@ import { Adapters } from '../../../../../../../src/plugins/inspector/common/adap import { ITermJoinSource } from '../term_join_source'; import { BucketProperties, PropertiesMap } from '../../../../common/elasticsearch_util'; import { IField } from '../../fields/field'; -import { Query } from '../../../../../../../src/plugins/data/common/query'; import { AbstractVectorSource, - BoundsFilters, + BoundsRequestMeta, GeoJsonWithMeta, IVectorSource, SourceTooltipConfig, @@ -156,7 +155,7 @@ export class TableSource extends AbstractVectorSource implements ITermJoinSource } async getBoundsForFilters( - boundsFilters: BoundsFilters, + boundsFilters: BoundsRequestMeta, registerCancelCallback: (callback: () => void) => void ): Promise { return null; @@ -187,12 +186,12 @@ export class TableSource extends AbstractVectorSource implements ITermJoinSource // Could be useful to implement, e.g. to preview raw csv data async getGeoJsonWithMeta( layerName: string, - searchFilters: MapFilters & { + searchFilters: DataFilters & { applyGlobalQuery: boolean; applyGlobalTime: boolean; fieldNames: string[]; geogridPrecision?: number; - sourceQuery?: MapQuery; + sourceQuery?: Query; sourceMeta: VectorSourceSyncMeta; }, registerCancelCallback: (callback: () => void) => void, diff --git a/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx b/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx index 05f0124310bd8..bf0752d54c426 100644 --- a/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx +++ b/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx @@ -5,6 +5,7 @@ * 2.0. */ +import type { Query } from 'src/plugins/data/common'; import { FeatureCollection, GeoJsonProperties, Geometry, Position } from 'geojson'; import { Filter, TimeRange } from 'src/plugins/data/public'; import { VECTOR_SHAPE_TYPE } from '../../../../common/constants'; @@ -14,7 +15,6 @@ import { IField } from '../../fields/field'; import { ESSearchSourceResponseMeta, MapExtent, - MapQuery, Timeslice, VectorSourceRequestMeta, VectorSourceSyncMeta, @@ -34,12 +34,12 @@ export interface GeoJsonWithMeta { meta?: GeoJsonFetchMeta; } -export interface BoundsFilters { +export interface BoundsRequestMeta { applyGlobalQuery: boolean; applyGlobalTime: boolean; filters: Filter[]; - query?: MapQuery; - sourceQuery?: MapQuery; + query?: Query; + sourceQuery?: Query; timeFilters: TimeRange; timeslice?: Timeslice; } @@ -47,7 +47,7 @@ export interface BoundsFilters { export interface IVectorSource extends ISource { getTooltipProperties(properties: GeoJsonProperties): Promise; getBoundsForFilters( - boundsFilters: BoundsFilters, + layerDataFilters: BoundsRequestMeta, registerCancelCallback: (callback: () => void) => void ): Promise; getGeoJsonWithMeta( @@ -103,7 +103,7 @@ export class AbstractVectorSource extends AbstractSource implements IVectorSourc } async getBoundsForFilters( - boundsFilters: BoundsFilters, + boundsFilters: BoundsRequestMeta, registerCancelCallback: (callback: () => void) => void ): Promise { return null; diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/__snapshots__/dynamic_color_property.test.tsx.snap b/x-pack/plugins/maps/public/classes/styles/vector/properties/__snapshots__/dynamic_color_property.test.tsx.snap index 3f1cddf944374..5b43c5fb95560 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/__snapshots__/dynamic_color_property.test.tsx.snap +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/__snapshots__/dynamic_color_property.test.tsx.snap @@ -33,6 +33,7 @@ exports[`renderLegendDetailRow categorical Should render categorical legend with @@ -113,6 +114,7 @@ exports[`renderLegendDetailRow ordinal Should render custom ordinal legend with @@ -176,6 +178,7 @@ exports[`renderLegendDetailRow ordinal Should render interpolate bands 1`] = ` @@ -305,6 +308,7 @@ exports[`renderLegendDetailRow ordinal Should render percentile bands 1`] = ` @@ -412,6 +416,7 @@ exports[`renderLegendDetailRow ordinal Should render single band when interpolat diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/__snapshots__/dynamic_icon_property.test.tsx.snap b/x-pack/plugins/maps/public/classes/styles/vector/properties/__snapshots__/dynamic_icon_property.test.tsx.snap index 631a6117a111d..11a4fafda29e1 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/__snapshots__/dynamic_icon_property.test.tsx.snap +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/__snapshots__/dynamic_icon_property.test.tsx.snap @@ -12,6 +12,7 @@ exports[`renderLegendDetailRow Should render categorical legend with breaks 1`] diff --git a/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.js b/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.js deleted file mode 100644 index da3cbb9055d43..0000000000000 --- a/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.js +++ /dev/null @@ -1,629 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { canSkipSourceUpdate, updateDueToExtent } from './can_skip_fetch'; -import { DataRequest } from './data_request'; - -describe('updateDueToExtent', () => { - it('should be false when buffers are the same', async () => { - const oldBuffer = { - maxLat: 12.5, - maxLon: 102.5, - minLat: 2.5, - minLon: 92.5, - }; - const newBuffer = { - maxLat: 12.5, - maxLon: 102.5, - minLat: 2.5, - minLon: 92.5, - }; - expect(updateDueToExtent({ buffer: oldBuffer }, { buffer: newBuffer })).toBe(false); - }); - - it('should be false when the new buffer is contained in the old buffer', async () => { - const oldBuffer = { - maxLat: 12.5, - maxLon: 102.5, - minLat: 2.5, - minLon: 92.5, - }; - const newBuffer = { - maxLat: 10, - maxLon: 100, - minLat: 5, - minLon: 95, - }; - expect(updateDueToExtent({ buffer: oldBuffer }, { buffer: newBuffer })).toBe(false); - }); - - it('should be true when the new buffer is contained in the old buffer and the past results were truncated', async () => { - const oldBuffer = { - maxLat: 12.5, - maxLon: 102.5, - minLat: 2.5, - minLon: 92.5, - }; - const newBuffer = { - maxLat: 10, - maxLon: 100, - minLat: 5, - minLon: 95, - }; - expect( - updateDueToExtent({ buffer: oldBuffer, areResultsTrimmed: true }, { buffer: newBuffer }) - ).toBe(true); - }); - - it('should be true when meta has no old buffer', async () => { - expect(updateDueToExtent()).toBe(true); - }); - - it('should be true when the new buffer is not contained in the old buffer', async () => { - const oldBuffer = { - maxLat: 12.5, - maxLon: 102.5, - minLat: 2.5, - minLon: 92.5, - }; - const newBuffer = { - maxLat: 7.5, - maxLon: 92.5, - minLat: -2.5, - minLon: 82.5, - }; - expect(updateDueToExtent({ buffer: oldBuffer }, { buffer: newBuffer })).toBe(true); - }); -}); - -describe('canSkipSourceUpdate', () => { - const SOURCE_DATA_REQUEST_ID = 'foo'; - const getUpdateDueToTimeslice = () => { - return true; - }; - - describe('isQueryAware', () => { - const queryAwareSourceMock = { - isTimeAware: () => { - return false; - }, - isRefreshTimerAware: () => { - return false; - }, - isFilterByMapBounds: () => { - return false; - }, - isFieldAware: () => { - return false; - }, - isQueryAware: () => { - return true; - }, - isGeoGridPrecisionAware: () => { - return false; - }, - }; - const prevFilters = []; - const prevQuery = { - language: 'kuery', - query: 'machine.os.keyword : "win 7"', - queryLastTriggeredAt: '2019-04-25T20:53:22.331Z', - }; - - describe('applyGlobalQuery is false', () => { - const prevApplyGlobalQuery = false; - - const prevDataRequest = new DataRequest({ - dataId: SOURCE_DATA_REQUEST_ID, - dataMeta: { - applyGlobalQuery: prevApplyGlobalQuery, - filters: prevFilters, - query: prevQuery, - }, - data: {}, - }); - - it('can skip update when filter changes', async () => { - const nextMeta = { - applyGlobalQuery: prevApplyGlobalQuery, - filters: [prevQuery], - query: prevQuery, - }; - - const canSkipUpdate = await canSkipSourceUpdate({ - source: queryAwareSourceMock, - prevDataRequest, - nextMeta, - extentAware: queryAwareSourceMock.isFilterByMapBounds(), - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(true); - }); - - it('can skip update when query changes', async () => { - const nextMeta = { - applyGlobalQuery: prevApplyGlobalQuery, - filters: prevFilters, - query: { - ...prevQuery, - query: 'a new query string', - }, - }; - - const canSkipUpdate = await canSkipSourceUpdate({ - source: queryAwareSourceMock, - prevDataRequest, - nextMeta, - extentAware: queryAwareSourceMock.isFilterByMapBounds(), - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(true); - }); - - it('can not skip update when query is refreshed', async () => { - const nextMeta = { - applyGlobalQuery: prevApplyGlobalQuery, - filters: prevFilters, - query: { - ...prevQuery, - queryLastTriggeredAt: 'sometime layer when Refresh button is clicked', - }, - }; - - const canSkipUpdate = await canSkipSourceUpdate({ - source: queryAwareSourceMock, - prevDataRequest, - nextMeta, - extentAware: queryAwareSourceMock.isFilterByMapBounds(), - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(false); - }); - - it('can not skip update when applyGlobalQuery changes', async () => { - const nextMeta = { - applyGlobalQuery: !prevApplyGlobalQuery, - filters: prevFilters, - query: prevQuery, - }; - - const canSkipUpdate = await canSkipSourceUpdate({ - source: queryAwareSourceMock, - prevDataRequest, - nextMeta, - extentAware: queryAwareSourceMock.isFilterByMapBounds(), - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(false); - }); - }); - - describe('applyGlobalQuery is true', () => { - const prevApplyGlobalQuery = true; - - const prevDataRequest = new DataRequest({ - dataId: SOURCE_DATA_REQUEST_ID, - dataMeta: { - applyGlobalQuery: prevApplyGlobalQuery, - filters: prevFilters, - query: prevQuery, - }, - data: {}, - }); - - it('can not skip update when filter changes', async () => { - const nextMeta = { - applyGlobalQuery: prevApplyGlobalQuery, - filters: [prevQuery], - query: prevQuery, - }; - - const canSkipUpdate = await canSkipSourceUpdate({ - source: queryAwareSourceMock, - prevDataRequest, - nextMeta, - extentAware: queryAwareSourceMock.isFilterByMapBounds(), - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(false); - }); - - it('can not skip update when query changes', async () => { - const nextMeta = { - applyGlobalQuery: prevApplyGlobalQuery, - filters: prevFilters, - query: { - ...prevQuery, - query: 'a new query string', - }, - }; - - const canSkipUpdate = await canSkipSourceUpdate({ - source: queryAwareSourceMock, - prevDataRequest, - nextMeta, - extentAware: queryAwareSourceMock.isFilterByMapBounds(), - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(false); - }); - - it('can not skip update when query is refreshed', async () => { - const nextMeta = { - applyGlobalQuery: prevApplyGlobalQuery, - filters: prevFilters, - query: { - ...prevQuery, - queryLastTriggeredAt: 'sometime layer when Refresh button is clicked', - }, - }; - - const canSkipUpdate = await canSkipSourceUpdate({ - source: queryAwareSourceMock, - prevDataRequest, - nextMeta, - extentAware: queryAwareSourceMock.isFilterByMapBounds(), - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(false); - }); - - it('can not skip update when applyGlobalQuery changes', async () => { - const nextMeta = { - applyGlobalQuery: !prevApplyGlobalQuery, - filters: prevFilters, - query: prevQuery, - }; - - const canSkipUpdate = await canSkipSourceUpdate({ - source: queryAwareSourceMock, - prevDataRequest, - nextMeta, - extentAware: queryAwareSourceMock.isFilterByMapBounds(), - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(false); - }); - }); - }); - - describe('isTimeAware', () => { - function createSourceMock() { - return { - isTimeAware: () => { - return true; - }, - isRefreshTimerAware: () => { - return false; - }, - isFilterByMapBounds: () => { - return false; - }, - isFieldAware: () => { - return false; - }, - isQueryAware: () => { - return false; - }, - isGeoGridPrecisionAware: () => { - return false; - }, - }; - } - - describe('applyGlobalTime', () => { - it('can not skip update when applyGlobalTime changes', async () => { - const canSkipUpdate = await canSkipSourceUpdate({ - source: createSourceMock(), - prevDataRequest: new DataRequest({ - dataId: SOURCE_DATA_REQUEST_ID, - dataMeta: { - applyGlobalTime: true, - }, - data: {}, - }), - nextMeta: { - applyGlobalTime: false, - }, - extentAware: false, - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(false); - }); - - it('can skip update when applyGlobalTime does not change', async () => { - const canSkipUpdate = await canSkipSourceUpdate({ - source: createSourceMock(), - prevDataRequest: new DataRequest({ - dataId: SOURCE_DATA_REQUEST_ID, - dataMeta: { - applyGlobalTime: true, - }, - data: {}, - }), - nextMeta: { - applyGlobalTime: true, - }, - extentAware: false, - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(true); - }); - }); - - describe('timeFilters', () => { - it('can not skip update when time range changes', async () => { - const canSkipUpdate = await canSkipSourceUpdate({ - source: createSourceMock(), - prevDataRequest: new DataRequest({ - dataId: SOURCE_DATA_REQUEST_ID, - dataMeta: { - applyGlobalTime: true, - timeFilters: { - from: 'now-15m', - to: 'now', - }, - }, - data: {}, - }), - nextMeta: { - applyGlobalTime: true, - timeFilters: { - from: 'now-7d', - to: 'now', - }, - }, - extentAware: false, - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(false); - }); - - it('can skip update when time range does not change', async () => { - const canSkipUpdate = await canSkipSourceUpdate({ - source: createSourceMock(), - prevDataRequest: new DataRequest({ - dataId: SOURCE_DATA_REQUEST_ID, - dataMeta: { - applyGlobalTime: true, - timeFilters: { - from: 'now-15m', - to: 'now', - }, - }, - data: {}, - }), - nextMeta: { - applyGlobalTime: true, - timeFilters: { - from: 'now-15m', - to: 'now', - }, - }, - extentAware: false, - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(true); - }); - - it('can skip update when time range changes but applyGlobalTime is false', async () => { - const canSkipUpdate = await canSkipSourceUpdate({ - source: createSourceMock(), - prevDataRequest: new DataRequest({ - dataId: SOURCE_DATA_REQUEST_ID, - dataMeta: { - applyGlobalTime: false, - timeFilters: { - from: 'now-15m', - to: 'now', - }, - }, - data: {}, - }), - nextMeta: { - applyGlobalTime: false, - timeFilters: { - from: 'now-7d', - to: 'now', - }, - }, - extentAware: false, - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(true); - }); - }); - - describe('timeslice', () => { - const mockSource = createSourceMock(); - it('can not skip update when timeslice changes (undefined => provided)', async () => { - const canSkipUpdate = await canSkipSourceUpdate({ - source: mockSource, - prevDataRequest: new DataRequest({ - dataId: SOURCE_DATA_REQUEST_ID, - dataMeta: { - applyGlobalTime: true, - timeFilters: { - from: 'now-7d', - to: 'now', - }, - }, - data: {}, - }), - nextMeta: { - applyGlobalTime: true, - timeFilters: { - from: 'now-7d', - to: 'now', - }, - timeslice: { - from: 0, - to: 1000, - }, - }, - extentAware: false, - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(false); - }); - - it('can not skip update when timeslice changes', async () => { - const canSkipUpdate = await canSkipSourceUpdate({ - source: mockSource, - prevDataRequest: new DataRequest({ - dataId: SOURCE_DATA_REQUEST_ID, - dataMeta: { - applyGlobalTime: true, - timeFilters: { - from: 'now-7d', - to: 'now', - }, - timeslice: { - from: 0, - to: 1000, - }, - }, - data: {}, - }), - nextMeta: { - applyGlobalTime: true, - timeFilters: { - from: 'now-7d', - to: 'now', - }, - timeslice: { - from: 1000, - to: 2000, - }, - }, - extentAware: false, - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(false); - }); - - it('can not skip update when timeslice changes (provided => undefined)', async () => { - const canSkipUpdate = await canSkipSourceUpdate({ - source: mockSource, - prevDataRequest: new DataRequest({ - dataId: SOURCE_DATA_REQUEST_ID, - dataMeta: { - applyGlobalTime: true, - timeFilters: { - from: 'now-7d', - to: 'now', - }, - timeslice: { - from: 0, - to: 1000, - }, - }, - data: {}, - }), - nextMeta: { - applyGlobalTime: true, - timeFilters: { - from: 'now-7d', - to: 'now', - }, - }, - extentAware: false, - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(false); - }); - - it('can skip update when timeslice does not change', async () => { - const canSkipUpdate = await canSkipSourceUpdate({ - source: mockSource, - prevDataRequest: new DataRequest({ - dataId: SOURCE_DATA_REQUEST_ID, - dataMeta: { - applyGlobalTime: true, - timeFilters: { - from: 'now-7d', - to: 'now', - }, - timeslice: { - from: 0, - to: 1000, - }, - }, - data: {}, - }), - nextMeta: { - applyGlobalTime: true, - timeFilters: { - from: 'now-7d', - to: 'now', - }, - timeslice: { - from: 0, - to: 1000, - }, - }, - extentAware: false, - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(true); - }); - - it('can skip update when timeslice changes but applyGlobalTime is false', async () => { - const canSkipUpdate = await canSkipSourceUpdate({ - source: mockSource, - prevDataRequest: new DataRequest({ - dataId: SOURCE_DATA_REQUEST_ID, - dataMeta: { - applyGlobalTime: false, - timeFilters: { - from: 'now-7d', - to: 'now', - }, - timeslice: { - from: 0, - to: 1000, - }, - }, - data: {}, - }), - nextMeta: { - applyGlobalTime: false, - timeFilters: { - from: 'now-7d', - to: 'now', - }, - timeslice: { - from: 1000, - to: 2000, - }, - }, - extentAware: false, - getUpdateDueToTimeslice, - }); - - expect(canSkipUpdate).toBe(true); - }); - }); - }); -}); diff --git a/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts b/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts new file mode 100644 index 0000000000000..16d25469025f4 --- /dev/null +++ b/x-pack/plugins/maps/public/classes/util/can_skip_fetch.test.ts @@ -0,0 +1,642 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { canSkipSourceUpdate, updateDueToExtent } from './can_skip_fetch'; +import { DataRequest } from './data_request'; +import { Filter } from 'src/plugins/data/common'; +import { ISource } from '../sources/source'; + +describe('updateDueToExtent', () => { + it('should be false when buffers are the same', async () => { + const oldBuffer = { + maxLat: 12.5, + maxLon: 102.5, + minLat: 2.5, + minLon: 92.5, + }; + const newBuffer = { + maxLat: 12.5, + maxLon: 102.5, + minLat: 2.5, + minLon: 92.5, + }; + expect(updateDueToExtent({ buffer: oldBuffer }, { buffer: newBuffer })).toBe(false); + }); + + it('should be false when the new buffer is contained in the old buffer', async () => { + const oldBuffer = { + maxLat: 12.5, + maxLon: 102.5, + minLat: 2.5, + minLon: 92.5, + }; + const newBuffer = { + maxLat: 10, + maxLon: 100, + minLat: 5, + minLon: 95, + }; + expect(updateDueToExtent({ buffer: oldBuffer }, { buffer: newBuffer })).toBe(false); + }); + + it('should be true when the new buffer is contained in the old buffer and the past results were truncated', async () => { + const oldBuffer = { + maxLat: 12.5, + maxLon: 102.5, + minLat: 2.5, + minLon: 92.5, + }; + const newBuffer = { + maxLat: 10, + maxLon: 100, + minLat: 5, + minLon: 95, + }; + expect( + updateDueToExtent({ buffer: oldBuffer, areResultsTrimmed: true }, { buffer: newBuffer }) + ).toBe(true); + }); + + it('should be true when meta has no old buffer', async () => { + expect(updateDueToExtent()).toBe(true); + }); + + it('should be true when the new buffer is not contained in the old buffer', async () => { + const oldBuffer = { + maxLat: 12.5, + maxLon: 102.5, + minLat: 2.5, + minLon: 92.5, + }; + const newBuffer = { + maxLat: 7.5, + maxLon: 92.5, + minLat: -2.5, + minLon: 82.5, + }; + expect(updateDueToExtent({ buffer: oldBuffer }, { buffer: newBuffer })).toBe(true); + }); +}); + +describe('canSkipSourceUpdate', () => { + const SOURCE_DATA_REQUEST_ID = 'foo'; + const getUpdateDueToTimeslice = () => { + return true; + }; + + describe('isQueryAware', () => { + const queryAwareSourceMock = { + isTimeAware: () => { + return false; + }, + isFilterByMapBounds: () => { + return false; + }, + isFieldAware: () => { + return false; + }, + isQueryAware: () => { + return true; + }, + isGeoGridPrecisionAware: () => { + return false; + }, + }; + const prevFilters: Filter[] = []; + const prevQuery = { + language: 'kuery', + query: 'machine.os.keyword : "win 7"', + }; + + describe('applyGlobalQuery is false', () => { + const prevApplyGlobalQuery = false; + + const prevDataRequest = new DataRequest({ + dataId: SOURCE_DATA_REQUEST_ID, + dataRequestMeta: { + applyGlobalQuery: prevApplyGlobalQuery, + filters: prevFilters, + query: prevQuery, + }, + data: {}, + }); + + it('can skip update when filter changes', async () => { + const nextRequestMeta = { + applyGlobalQuery: prevApplyGlobalQuery, + filters: [({} as unknown) as Filter], + query: prevQuery, + }; + + const canSkipUpdate = await canSkipSourceUpdate({ + source: (queryAwareSourceMock as unknown) as ISource, + prevDataRequest, + nextRequestMeta, + extentAware: queryAwareSourceMock.isFilterByMapBounds(), + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(true); + }); + + it('can skip update when query changes', async () => { + const nextRequestMeta = { + applyGlobalQuery: prevApplyGlobalQuery, + filters: prevFilters, + query: { + ...prevQuery, + query: 'a new query string', + }, + }; + + const canSkipUpdate = await canSkipSourceUpdate({ + source: (queryAwareSourceMock as unknown) as ISource, + prevDataRequest, + nextRequestMeta, + extentAware: queryAwareSourceMock.isFilterByMapBounds(), + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(true); + }); + + it('Should not skip refresh update when applyForceRefresh is true', async () => { + const nextRequestMeta = { + applyGlobalQuery: prevApplyGlobalQuery, + filters: prevFilters, + query: prevQuery, + isForceRefresh: true, + applyForceRefresh: true, + }; + + const canSkipUpdate = await canSkipSourceUpdate({ + source: (queryAwareSourceMock as unknown) as ISource, + prevDataRequest, + nextRequestMeta, + extentAware: queryAwareSourceMock.isFilterByMapBounds(), + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(false); + }); + + it('Should skip refresh update when applyForceRefresh is false', async () => { + const nextRequestMeta = { + applyGlobalQuery: prevApplyGlobalQuery, + filters: prevFilters, + query: prevQuery, + isForceRefresh: true, + applyForceRefresh: false, + }; + + const canSkipUpdate = await canSkipSourceUpdate({ + source: (queryAwareSourceMock as unknown) as ISource, + prevDataRequest, + nextRequestMeta, + extentAware: queryAwareSourceMock.isFilterByMapBounds(), + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(true); + }); + + it('can not skip update when applyGlobalQuery changes', async () => { + const nextRequestMeta = { + applyGlobalQuery: !prevApplyGlobalQuery, + filters: prevFilters, + query: prevQuery, + }; + + const canSkipUpdate = await canSkipSourceUpdate({ + source: (queryAwareSourceMock as unknown) as ISource, + prevDataRequest, + nextRequestMeta, + extentAware: queryAwareSourceMock.isFilterByMapBounds(), + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(false); + }); + }); + + describe('applyGlobalQuery is true', () => { + const prevApplyGlobalQuery = true; + + const prevDataRequest = new DataRequest({ + dataId: SOURCE_DATA_REQUEST_ID, + dataRequestMeta: { + applyGlobalQuery: prevApplyGlobalQuery, + filters: prevFilters, + query: prevQuery, + }, + data: {}, + }); + + it('can not skip update when filter changes', async () => { + const nextRequestMeta = { + applyGlobalQuery: prevApplyGlobalQuery, + filters: [({} as unknown) as Filter], + query: prevQuery, + }; + + const canSkipUpdate = await canSkipSourceUpdate({ + source: (queryAwareSourceMock as unknown) as ISource, + prevDataRequest, + nextRequestMeta, + extentAware: queryAwareSourceMock.isFilterByMapBounds(), + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(false); + }); + + it('can not skip update when query changes', async () => { + const nextRequestMeta = { + applyGlobalQuery: prevApplyGlobalQuery, + filters: prevFilters, + query: { + ...prevQuery, + query: 'a new query string', + }, + }; + + const canSkipUpdate = await canSkipSourceUpdate({ + source: (queryAwareSourceMock as unknown) as ISource, + prevDataRequest, + nextRequestMeta, + extentAware: queryAwareSourceMock.isFilterByMapBounds(), + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(false); + }); + + it('can not skip update when query is refreshed', async () => { + const nextRequestMeta = { + applyGlobalQuery: prevApplyGlobalQuery, + filters: prevFilters, + query: prevQuery, + isForceRefresh: true, + applyForceRefresh: true, + }; + + const canSkipUpdate = await canSkipSourceUpdate({ + source: (queryAwareSourceMock as unknown) as ISource, + prevDataRequest, + nextRequestMeta, + extentAware: queryAwareSourceMock.isFilterByMapBounds(), + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(false); + }); + + it('can not skip update when applyGlobalQuery changes', async () => { + const nextRequestMeta = { + applyGlobalQuery: !prevApplyGlobalQuery, + filters: prevFilters, + query: prevQuery, + }; + + const canSkipUpdate = await canSkipSourceUpdate({ + source: (queryAwareSourceMock as unknown) as ISource, + prevDataRequest, + nextRequestMeta, + extentAware: queryAwareSourceMock.isFilterByMapBounds(), + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(false); + }); + }); + }); + + describe('isTimeAware', () => { + function createSourceMock() { + return { + isTimeAware: () => { + return true; + }, + isFilterByMapBounds: () => { + return false; + }, + isFieldAware: () => { + return false; + }, + isQueryAware: () => { + return false; + }, + isGeoGridPrecisionAware: () => { + return false; + }, + }; + } + + describe('applyGlobalTime', () => { + it('can not skip update when applyGlobalTime changes', async () => { + const canSkipUpdate = await canSkipSourceUpdate({ + source: (createSourceMock() as unknown) as ISource, + prevDataRequest: new DataRequest({ + dataId: SOURCE_DATA_REQUEST_ID, + dataRequestMeta: { + applyGlobalTime: true, + }, + data: {}, + }), + nextRequestMeta: { + applyGlobalTime: false, + }, + extentAware: false, + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(false); + }); + + it('can skip update when applyGlobalTime does not change', async () => { + const canSkipUpdate = await canSkipSourceUpdate({ + source: (createSourceMock() as unknown) as ISource, + prevDataRequest: new DataRequest({ + dataId: SOURCE_DATA_REQUEST_ID, + dataRequestMeta: { + applyGlobalTime: true, + }, + data: {}, + }), + nextRequestMeta: { + applyGlobalTime: true, + }, + extentAware: false, + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(true); + }); + }); + + describe('timeFilters', () => { + it('can not skip update when time range changes', async () => { + const canSkipUpdate = await canSkipSourceUpdate({ + source: (createSourceMock() as unknown) as ISource, + prevDataRequest: new DataRequest({ + dataId: SOURCE_DATA_REQUEST_ID, + dataRequestMeta: { + applyGlobalTime: true, + timeFilters: { + from: 'now-15m', + to: 'now', + }, + }, + data: {}, + }), + nextRequestMeta: { + applyGlobalTime: true, + timeFilters: { + from: 'now-7d', + to: 'now', + }, + }, + extentAware: false, + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(false); + }); + + it('can skip update when time range does not change', async () => { + const canSkipUpdate = await canSkipSourceUpdate({ + source: (createSourceMock() as unknown) as ISource, + prevDataRequest: new DataRequest({ + dataId: SOURCE_DATA_REQUEST_ID, + dataRequestMeta: { + applyGlobalTime: true, + timeFilters: { + from: 'now-15m', + to: 'now', + }, + }, + data: {}, + }), + nextRequestMeta: { + applyGlobalTime: true, + timeFilters: { + from: 'now-15m', + to: 'now', + }, + }, + extentAware: false, + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(true); + }); + + it('can skip update when time range changes but applyGlobalTime is false', async () => { + const canSkipUpdate = await canSkipSourceUpdate({ + source: (createSourceMock() as unknown) as ISource, + prevDataRequest: new DataRequest({ + dataId: SOURCE_DATA_REQUEST_ID, + dataRequestMeta: { + applyGlobalTime: false, + timeFilters: { + from: 'now-15m', + to: 'now', + }, + }, + data: {}, + }), + nextRequestMeta: { + applyGlobalTime: false, + timeFilters: { + from: 'now-7d', + to: 'now', + }, + }, + extentAware: false, + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(true); + }); + }); + + describe('timeslice', () => { + const mockSource = createSourceMock(); + it('can not skip update when timeslice changes (undefined => provided)', async () => { + const canSkipUpdate = await canSkipSourceUpdate({ + source: (mockSource as unknown) as ISource, + prevDataRequest: new DataRequest({ + dataId: SOURCE_DATA_REQUEST_ID, + dataRequestMeta: { + applyGlobalTime: true, + timeFilters: { + from: 'now-7d', + to: 'now', + }, + }, + data: {}, + }), + nextRequestMeta: { + applyGlobalTime: true, + timeFilters: { + from: 'now-7d', + to: 'now', + }, + timeslice: { + from: 0, + to: 1000, + }, + }, + extentAware: false, + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(false); + }); + + it('can not skip update when timeslice changes', async () => { + const canSkipUpdate = await canSkipSourceUpdate({ + source: (mockSource as unknown) as ISource, + prevDataRequest: new DataRequest({ + dataId: SOURCE_DATA_REQUEST_ID, + dataRequestMeta: { + applyGlobalTime: true, + timeFilters: { + from: 'now-7d', + to: 'now', + }, + timeslice: { + from: 0, + to: 1000, + }, + }, + data: {}, + }), + nextRequestMeta: { + applyGlobalTime: true, + timeFilters: { + from: 'now-7d', + to: 'now', + }, + timeslice: { + from: 1000, + to: 2000, + }, + }, + extentAware: false, + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(false); + }); + + it('can not skip update when timeslice changes (provided => undefined)', async () => { + const canSkipUpdate = await canSkipSourceUpdate({ + source: (mockSource as unknown) as ISource, + prevDataRequest: new DataRequest({ + dataId: SOURCE_DATA_REQUEST_ID, + dataRequestMeta: { + applyGlobalTime: true, + timeFilters: { + from: 'now-7d', + to: 'now', + }, + timeslice: { + from: 0, + to: 1000, + }, + }, + data: {}, + }), + nextRequestMeta: { + applyGlobalTime: true, + timeFilters: { + from: 'now-7d', + to: 'now', + }, + }, + extentAware: false, + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(false); + }); + + it('can skip update when timeslice does not change', async () => { + const canSkipUpdate = await canSkipSourceUpdate({ + source: (mockSource as unknown) as ISource, + prevDataRequest: new DataRequest({ + dataId: SOURCE_DATA_REQUEST_ID, + dataRequestMeta: { + applyGlobalTime: true, + timeFilters: { + from: 'now-7d', + to: 'now', + }, + timeslice: { + from: 0, + to: 1000, + }, + }, + data: {}, + }), + nextRequestMeta: { + applyGlobalTime: true, + timeFilters: { + from: 'now-7d', + to: 'now', + }, + timeslice: { + from: 0, + to: 1000, + }, + }, + extentAware: false, + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(true); + }); + + it('can skip update when timeslice changes but applyGlobalTime is false', async () => { + const canSkipUpdate = await canSkipSourceUpdate({ + source: (mockSource as unknown) as ISource, + prevDataRequest: new DataRequest({ + dataId: SOURCE_DATA_REQUEST_ID, + dataRequestMeta: { + applyGlobalTime: false, + timeFilters: { + from: 'now-7d', + to: 'now', + }, + timeslice: { + from: 0, + to: 1000, + }, + }, + data: {}, + }), + nextRequestMeta: { + applyGlobalTime: false, + timeFilters: { + from: 'now-7d', + to: 'now', + }, + timeslice: { + from: 1000, + to: 2000, + }, + }, + extentAware: false, + getUpdateDueToTimeslice, + }); + + expect(canSkipUpdate).toBe(true); + }); + }); + }); +}); diff --git a/x-pack/plugins/maps/public/classes/util/can_skip_fetch.ts b/x-pack/plugins/maps/public/classes/util/can_skip_fetch.ts index b6f03ef3d1c63..69a5c73ba2933 100644 --- a/x-pack/plugins/maps/public/classes/util/can_skip_fetch.ts +++ b/x-pack/plugins/maps/public/classes/util/can_skip_fetch.ts @@ -8,15 +8,14 @@ import _ from 'lodash'; import turfBboxPolygon from '@turf/bbox-polygon'; import turfBooleanContains from '@turf/boolean-contains'; -import { isRefreshOnlyQuery } from './is_refresh_only_query'; import { ISource } from '../sources/source'; -import { DataMeta, Timeslice } from '../../../common/descriptor_types'; +import { DataRequestMeta, Timeslice } from '../../../common/descriptor_types'; import { DataRequest } from './data_request'; const SOURCE_UPDATE_REQUIRED = true; const NO_SOURCE_UPDATE_REQUIRED = false; -export function updateDueToExtent(prevMeta: DataMeta = {}, nextMeta: DataMeta = {}) { +export function updateDueToExtent(prevMeta: DataRequestMeta = {}, nextMeta: DataRequestMeta = {}) { const { buffer: previousBuffer } = prevMeta; const { buffer: newBuffer } = nextMeta; @@ -54,30 +53,28 @@ export function updateDueToExtent(prevMeta: DataMeta = {}, nextMeta: DataMeta = export async function canSkipSourceUpdate({ source, prevDataRequest, - nextMeta, + nextRequestMeta, extentAware, getUpdateDueToTimeslice, }: { source: ISource; prevDataRequest: DataRequest | undefined; - nextMeta: DataMeta; + nextRequestMeta: DataRequestMeta; extentAware: boolean; getUpdateDueToTimeslice: (timeslice?: Timeslice) => boolean; }): Promise { + const mustForceRefresh = nextRequestMeta.isForceRefresh && nextRequestMeta.applyForceRefresh; + if (mustForceRefresh) { + // Cannot skip + return false; + } + const timeAware = await source.isTimeAware(); - const refreshTimerAware = await source.isRefreshTimerAware(); const isFieldAware = source.isFieldAware(); const isQueryAware = source.isQueryAware(); const isGeoGridPrecisionAware = source.isGeoGridPrecisionAware(); - if ( - !timeAware && - !refreshTimerAware && - !extentAware && - !isFieldAware && - !isQueryAware && - !isGeoGridPrecisionAware - ) { + if (!timeAware && !extentAware && !isFieldAware && !isQueryAware && !isGeoGridPrecisionAware) { return !!prevDataRequest && prevDataRequest.hasDataOrRequestInProgress(); } @@ -93,26 +90,18 @@ export async function canSkipSourceUpdate({ let updateDueToTime = false; let updateDueToTimeslice = false; if (timeAware) { - updateDueToApplyGlobalTime = prevMeta.applyGlobalTime !== nextMeta.applyGlobalTime; - if (nextMeta.applyGlobalTime) { - updateDueToTime = !_.isEqual(prevMeta.timeFilters, nextMeta.timeFilters); - if (!_.isEqual(prevMeta.timeslice, nextMeta.timeslice)) { - updateDueToTimeslice = getUpdateDueToTimeslice(nextMeta.timeslice); + updateDueToApplyGlobalTime = prevMeta.applyGlobalTime !== nextRequestMeta.applyGlobalTime; + if (nextRequestMeta.applyGlobalTime) { + updateDueToTime = !_.isEqual(prevMeta.timeFilters, nextRequestMeta.timeFilters); + if (!_.isEqual(prevMeta.timeslice, nextRequestMeta.timeslice)) { + updateDueToTimeslice = getUpdateDueToTimeslice(nextRequestMeta.timeslice); } } } - let updateDueToRefreshTimer = false; - if (refreshTimerAware && nextMeta.refreshTimerLastTriggeredAt) { - updateDueToRefreshTimer = !_.isEqual( - prevMeta.refreshTimerLastTriggeredAt, - nextMeta.refreshTimerLastTriggeredAt - ); - } - let updateDueToFields = false; if (isFieldAware) { - updateDueToFields = !_.isEqual(prevMeta.fieldNames, nextMeta.fieldNames); + updateDueToFields = !_.isEqual(prevMeta.fieldNames, nextRequestMeta.fieldNames); } let updateDueToQuery = false; @@ -120,42 +109,41 @@ export async function canSkipSourceUpdate({ let updateDueToSourceQuery = false; let updateDueToApplyGlobalQuery = false; if (isQueryAware) { - updateDueToApplyGlobalQuery = prevMeta.applyGlobalQuery !== nextMeta.applyGlobalQuery; - updateDueToSourceQuery = !_.isEqual(prevMeta.sourceQuery, nextMeta.sourceQuery); - - if (nextMeta.applyGlobalQuery) { - updateDueToQuery = !_.isEqual(prevMeta.query, nextMeta.query); - updateDueToFilters = !_.isEqual(prevMeta.filters, nextMeta.filters); - } else { - // Global filters and query are not applied to layer search request so no re-fetch required. - // Exception is "Refresh" query. - updateDueToQuery = isRefreshOnlyQuery(prevMeta.query, nextMeta.query); + updateDueToApplyGlobalQuery = prevMeta.applyGlobalQuery !== nextRequestMeta.applyGlobalQuery; + updateDueToSourceQuery = !_.isEqual(prevMeta.sourceQuery, nextRequestMeta.sourceQuery); + + if (nextRequestMeta.applyGlobalQuery) { + updateDueToQuery = !_.isEqual(prevMeta.query, nextRequestMeta.query); + updateDueToFilters = !_.isEqual(prevMeta.filters, nextRequestMeta.filters); } } let updateDueToSearchSessionId = false; - if (timeAware || isQueryAware) { - updateDueToSearchSessionId = prevMeta.searchSessionId !== nextMeta.searchSessionId; + if ((timeAware || isQueryAware) && nextRequestMeta.applyForceRefresh) { + // If the force-refresh flag is turned off, we should ignore refreshes on the dashboard-context + updateDueToSearchSessionId = prevMeta.searchSessionId !== nextRequestMeta.searchSessionId; } let updateDueToPrecisionChange = false; let updateDueToExtentChange = false; if (isGeoGridPrecisionAware) { - updateDueToPrecisionChange = !_.isEqual(prevMeta.geogridPrecision, nextMeta.geogridPrecision); + updateDueToPrecisionChange = !_.isEqual( + prevMeta.geogridPrecision, + nextRequestMeta.geogridPrecision + ); } if (extentAware) { - updateDueToExtentChange = updateDueToExtent(prevMeta, nextMeta); + updateDueToExtentChange = updateDueToExtent(prevMeta, nextRequestMeta); } - const updateDueToSourceMetaChange = !_.isEqual(prevMeta.sourceMeta, nextMeta.sourceMeta); + const updateDueToSourceMetaChange = !_.isEqual(prevMeta.sourceMeta, nextRequestMeta.sourceMeta); return ( !updateDueToApplyGlobalTime && !updateDueToTime && !updateDueToTimeslice && - !updateDueToRefreshTimer && !updateDueToExtentChange && !updateDueToFields && !updateDueToQuery && @@ -173,7 +161,7 @@ export function canSkipStyleMetaUpdate({ nextMeta, }: { prevDataRequest: DataRequest | undefined; - nextMeta: DataMeta; + nextMeta: DataRequestMeta; }): boolean { if (!prevDataRequest) { return false; @@ -208,7 +196,7 @@ export function canSkipFormattersUpdate({ nextMeta, }: { prevDataRequest: DataRequest | undefined; - nextMeta: DataMeta; + nextMeta: DataRequestMeta; }): boolean { if (!prevDataRequest) { return false; diff --git a/x-pack/plugins/maps/public/classes/util/data_request.ts b/x-pack/plugins/maps/public/classes/util/data_request.ts index 0eb50af6107e0..3977fd3c9e0a9 100644 --- a/x-pack/plugins/maps/public/classes/util/data_request.ts +++ b/x-pack/plugins/maps/public/classes/util/data_request.ts @@ -7,7 +7,7 @@ /* eslint-disable max-classes-per-file */ -import { DataRequestDescriptor, DataMeta } from '../../../common/descriptor_types'; +import { DataRequestDescriptor, DataRequestMeta } from '../../../common/descriptor_types'; export class DataRequest { private readonly _descriptor: DataRequestDescriptor; @@ -26,11 +26,11 @@ export class DataRequest { return !!this._descriptor.dataRequestToken; } - getMeta(): DataMeta { - if (this._descriptor.dataMetaAtStart) { - return this._descriptor.dataMetaAtStart; - } else if (this._descriptor.dataMeta) { - return this._descriptor.dataMeta; + getMeta(): DataRequestMeta { + if (this._descriptor.dataRequestMetaAtStart) { + return this._descriptor.dataRequestMetaAtStart; + } else if (this._descriptor.dataRequestMeta) { + return this._descriptor.dataRequestMeta; } else { return {}; } diff --git a/x-pack/plugins/maps/public/classes/util/is_refresh_only_query.ts b/x-pack/plugins/maps/public/classes/util/is_refresh_only_query.ts deleted file mode 100644 index 57a11c1d161dc..0000000000000 --- a/x-pack/plugins/maps/public/classes/util/is_refresh_only_query.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 { MapQuery } from '../../../common/descriptor_types'; - -// Refresh only query is query where timestamps are different but query is the same. -// Triggered by clicking "Refresh" button in QueryBar -export function isRefreshOnlyQuery( - prevQuery: MapQuery | undefined, - newQuery: MapQuery | undefined -): boolean { - if (!prevQuery || !newQuery) { - return false; - } - return ( - prevQuery.queryLastTriggeredAt !== newQuery.queryLastTriggeredAt && - prevQuery.language === newQuery.language && - prevQuery.query === newQuery.query - ); -} diff --git a/x-pack/plugins/maps/public/classes/util/mb_filter_expressions.ts b/x-pack/plugins/maps/public/classes/util/mb_filter_expressions.ts index eb58963929716..68efd416718fd 100644 --- a/x-pack/plugins/maps/public/classes/util/mb_filter_expressions.ts +++ b/x-pack/plugins/maps/public/classes/util/mb_filter_expressions.ts @@ -15,7 +15,7 @@ import { import { Timeslice } from '../../../common/descriptor_types'; export interface TimesliceMaskConfig { - timesiceMaskField: string; + timesliceMaskField: string; timeslice: Timeslice; } @@ -34,15 +34,15 @@ function getFilterExpression( } if (timesliceMaskConfig) { - allFilters.push(['has', timesliceMaskConfig.timesiceMaskField]); + allFilters.push(['has', timesliceMaskConfig.timesliceMaskField]); allFilters.push([ '>=', - ['get', timesliceMaskConfig.timesiceMaskField], + ['get', timesliceMaskConfig.timesliceMaskField], timesliceMaskConfig.timeslice.from, ]); allFilters.push([ '<', - ['get', timesliceMaskConfig.timesiceMaskField], + ['get', timesliceMaskConfig.timesliceMaskField], timesliceMaskConfig.timeslice.to, ]); } diff --git a/x-pack/plugins/maps/public/components/force_refresh_checkbox.tsx b/x-pack/plugins/maps/public/components/force_refresh_checkbox.tsx new file mode 100644 index 0000000000000..b705d1a6dce21 --- /dev/null +++ b/x-pack/plugins/maps/public/components/force_refresh_checkbox.tsx @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiFormRow, EuiSwitch, EuiSwitchEvent, EuiToolTip } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +interface Props { + applyForceRefresh: boolean; + setApplyForceRefresh: (applyGlobalTime: boolean) => void; +} + +export function ForceRefreshCheckbox({ applyForceRefresh, setApplyForceRefresh }: Props) { + const onChange = (event: EuiSwitchEvent) => { + setApplyForceRefresh(event.target.checked); + }; + + return ( + + + + + + ); +} diff --git a/x-pack/plugins/maps/public/components/global_filter_checkbox.tsx b/x-pack/plugins/maps/public/components/global_filter_checkbox.tsx index bddb1cfd9cfcd..96805e0c6b5ec 100644 --- a/x-pack/plugins/maps/public/components/global_filter_checkbox.tsx +++ b/x-pack/plugins/maps/public/components/global_filter_checkbox.tsx @@ -6,7 +6,8 @@ */ import React from 'react'; -import { EuiFormRow, EuiSwitch, EuiSwitchEvent } from '@elastic/eui'; +import { EuiFormRow, EuiSwitch, EuiSwitchEvent, EuiToolTip } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; interface Props { applyGlobalQuery: boolean; @@ -21,13 +22,20 @@ export function GlobalFilterCheckbox({ applyGlobalQuery, label, setApplyGlobalQu return ( - + + + ); } diff --git a/x-pack/plugins/maps/public/components/global_time_checkbox.tsx b/x-pack/plugins/maps/public/components/global_time_checkbox.tsx index 675426dbb3f76..70d6859b8b02a 100644 --- a/x-pack/plugins/maps/public/components/global_time_checkbox.tsx +++ b/x-pack/plugins/maps/public/components/global_time_checkbox.tsx @@ -6,8 +6,8 @@ */ import React from 'react'; -import { EuiFormRow, EuiSwitch, EuiSwitchEvent } from '@elastic/eui'; - +import { EuiFormRow, EuiSwitch, EuiSwitchEvent, EuiToolTip } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; interface Props { applyGlobalTime: boolean; label: string; @@ -21,13 +21,20 @@ export function GlobalTimeCheckbox({ applyGlobalTime, label, setApplyGlobalTime return ( - + + + ); } diff --git a/x-pack/plugins/maps/public/connected_components/add_layer_panel/index.ts b/x-pack/plugins/maps/public/connected_components/add_layer_panel/index.ts index 67f0c3664acda..ed10b135899d5 100644 --- a/x-pack/plugins/maps/public/connected_components/add_layer_panel/index.ts +++ b/x-pack/plugins/maps/public/connected_components/add_layer_panel/index.ts @@ -22,7 +22,7 @@ import { import { MapStoreState } from '../../reducers/store'; import { LayerDescriptor } from '../../../common/descriptor_types'; import { hasPreviewLayers, isLoadingPreviewLayers } from '../../selectors/map_selectors'; -import { DRAW_MODE } from '../../../common'; +import { DRAW_MODE } from '../../../common/constants'; function mapStateToProps(state: MapStoreState) { return { diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx index 6e258e679b96f..548344466cac9 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx @@ -15,8 +15,10 @@ import { EuiSpacer, EuiText, EuiTextColor, - EuiTextAlign, EuiButtonEmpty, + EuiHorizontalRule, + EuiFlexGroup, + EuiFlexItem, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; @@ -27,6 +29,7 @@ import { getIndexPatternService, getData } from '../../../kibana_services'; import { GlobalFilterCheckbox } from '../../../components/global_filter_checkbox'; import { GlobalTimeCheckbox } from '../../../components/global_time_checkbox'; import { ILayer } from '../../../classes/layers/layer'; +import { ForceRefreshCheckbox } from '../../../components/force_refresh_checkbox'; export interface Props { layer: ILayer; @@ -113,6 +116,10 @@ export class FilterEditor extends Component { this.props.updateSourceProp(this.props.layer.getId(), 'applyGlobalTime', applyGlobalTime); }; + _onRespondToForceRefreshChange = (applyForceRefresh: boolean) => { + this.props.updateSourceProp(this.props.layer.getId(), 'applyForceRefresh', applyForceRefresh); + }; + _renderQueryPopover() { const layerQuery = this.props.layer.getQuery(); const { SearchBar } = getData().ui; @@ -153,7 +160,7 @@ export class FilterEditor extends Component { const query = this.props.layer.getQuery(); if (!query || !query.query) { return ( - +

    { return ( {query.query} - ); @@ -183,7 +189,7 @@ export class FilterEditor extends Component { defaultMessage: 'Edit filter', }) : i18n.translate('xpack.maps.layerPanel.filterEditor.addFilterButtonLabel', { - defaultMessage: 'Add filter', + defaultMessage: 'Set filter', }); const openButtonIcon = query && query.query ? 'pencil' : 'plusInCircleFilled'; @@ -209,6 +215,7 @@ export class FilterEditor extends Component { setApplyGlobalTime={this._onApplyGlobalTimeChange} /> ) : null; + return ( @@ -222,21 +229,28 @@ export class FilterEditor extends Component { - {this._renderQuery()} - - {this._renderQueryPopover()} + + {this._renderQueryPopover()} + {this._renderQuery()} + + + {globalTimeCheckbox} + ); } diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/__snapshots__/join_editor.test.tsx.snap b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/__snapshots__/join_editor.test.tsx.snap index 92330c1d1ddce..0a79b21175d1e 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/__snapshots__/join_editor.test.tsx.snap +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/__snapshots__/join_editor.test.tsx.snap @@ -9,6 +9,7 @@ exports[`Should render callout when joins are disabled 1`] = ` { } setApplyGlobalQuery={this._onApplyGlobalQueryChange} label={i18n.translate('xpack.maps.layerPanel.join.applyGlobalQueryCheckboxLabel', { - defaultMessage: `Apply global filter to join`, + defaultMessage: `Apply global search to join`, })} /> ); diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_feature_control/draw_feature_control.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_feature_control/draw_feature_control.tsx index 7b408df3a8134..0ebd145545a6c 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_feature_control/draw_feature_control.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_feature_control/draw_feature_control.tsx @@ -16,7 +16,7 @@ import * as jsts from 'jsts'; import { MapMouseEvent } from '@kbn/mapbox-gl'; import { getToasts } from '../../../../kibana_services'; import { DrawControl } from '../'; -import { DRAW_MODE, DRAW_SHAPE } from '../../../../../common'; +import { DRAW_MODE, DRAW_SHAPE } from '../../../../../common/constants'; import { ILayer } from '../../../../classes/layers/layer'; import { EXCLUDE_CENTROID_FEATURES, diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_filter_control/index.ts b/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_filter_control/index.ts index 795f6cf031f24..bf20314718bf7 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_filter_control/index.ts +++ b/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/draw_filter_control/index.ts @@ -11,7 +11,7 @@ import { connect } from 'react-redux'; import { DrawFilterControl } from './draw_filter_control'; import { setDrawMode, updateDrawState } from '../../../../actions'; import { getDrawState, getGeoFieldNames } from '../../../../selectors/map_selectors'; -import { DRAW_MODE } from '../../../../../common'; +import { DRAW_MODE } from '../../../../../common/constants'; import { MapStoreState } from '../../../../reducers/store'; import { getDrawMode } from '../../../../selectors/ui_selectors'; diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/index.ts b/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/index.ts index 847b0f2e429e2..b0f1941caec08 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/index.ts +++ b/x-pack/plugins/maps/public/connected_components/mb_map/draw_control/index.ts @@ -11,7 +11,7 @@ import { connect } from 'react-redux'; import { updateEditShape } from '../../../actions'; import { MapStoreState } from '../../../reducers/store'; import { DrawControl } from './draw_control'; -import { DRAW_SHAPE } from '../../../../common'; +import { DRAW_SHAPE } from '../../../../common/constants'; function mapDispatchToProps(dispatch: ThunkDispatch) { return { diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/index.ts b/x-pack/plugins/maps/public/connected_components/mb_map/index.ts index 9936d412de9e6..d46d4f53de47f 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/index.ts +++ b/x-pack/plugins/maps/public/connected_components/mb_map/index.ts @@ -32,7 +32,7 @@ import { import { getDrawMode, getIsFullScreen } from '../../selectors/ui_selectors'; import { getInspectorAdapters } from '../../reducers/non_serializable_instances'; import { MapStoreState } from '../../reducers/store'; -import { DRAW_MODE } from '../../../common'; +import { DRAW_MODE } from '../../../common/constants'; import { TileMetaFeature } from '../../../common/descriptor_types'; import type { MapExtentState } from '../../reducers/map/types'; diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/index.ts b/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/index.ts index 009a512023309..a9281898902e4 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/index.ts +++ b/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/index.ts @@ -23,7 +23,7 @@ import { getGeoFieldNames, } from '../../../selectors/map_selectors'; import { getDrawMode } from '../../../selectors/ui_selectors'; -import { DRAW_MODE } from '../../../../common'; +import { DRAW_MODE } from '../../../../common/constants'; import { MapStoreState } from '../../../reducers/store'; function mapStateToProps(state: MapStoreState) { diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/__snapshots__/layer_control.test.tsx.snap b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/__snapshots__/layer_control.test.tsx.snap index 05c2ad69af771..047f0087c559f 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/__snapshots__/layer_control.test.tsx.snap +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/__snapshots__/layer_control.test.tsx.snap @@ -37,6 +37,7 @@ exports[`LayerControl is rendered 1`] = ` @@ -146,7 +176,13 @@ exports[`TrustedAppDeletionDialog renders correctly when deletion is in progress

    - Remove trusted application + Delete " + + trusted app 3 + + "
    -

    - You are removing trusted application " - + - ". -

    + Warning + +
    +
    +
    +

    + Deleting this entry will remove it from all associated policies. +

    +
    +
    +
    +
    +

    This action cannot be undone. Are you sure you wish to continue?

    @@ -207,7 +267,7 @@ exports[`TrustedAppDeletionDialog renders correctly when deletion is in progress - Remove trusted application + Delete @@ -255,7 +315,13 @@ exports[`TrustedAppDeletionDialog renders correctly when dialog started 1`] = `
    - Remove trusted application + Delete " + + trusted app 3 + + "
    -

    - You are removing trusted application " - + - ". -

    + Warning + +
    +
    +
    +

    + Deleting this entry will remove it from all associated policies. +

    +
    +
    +
    +
    +

    This action cannot be undone. Are you sure you wish to continue?

    @@ -311,7 +401,7 @@ exports[`TrustedAppDeletionDialog renders correctly when dialog started 1`] = ` - Remove trusted application + Delete diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_group/index.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_group/index.tsx index 0fa3560670a0c..f514501afc2f0 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_group/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_group/index.tsx @@ -98,7 +98,6 @@ export const ConditionGroup = memo(
    { const getAllValidationErrors = (): HTMLElement[] => { return Array.from(renderResult.container.querySelectorAll('.euiFormErrorText')); }; + const getAllValidationWarnings = (): HTMLElement[] => { + return Array.from(renderResult.container.querySelectorAll('.euiFormHelpText')); + }; beforeEach(() => { resetHTMLElementOffsetWidth = forceHTMLElementOffsetWidth(); @@ -192,7 +195,7 @@ describe('When using the Trusted App Form', () => { expect(getConditionRemoveButton(defaultCondition).disabled).toBe(true); }); - it('should display 2 options for Field', () => { + it('should display 3 options for Field for Windows', () => { const conditionFieldSelect = getConditionFieldSelect(getCondition()); reactTestingLibrary.act(() => { fireEvent.click(conditionFieldSelect, { button: 1 }); @@ -202,6 +205,7 @@ describe('When using the Trusted App Form', () => { '.euiSuperSelect__listbox button.euiSuperSelect__item' ) ).map((button) => button.textContent); + expect(options.length).toEqual(3); expect(options).toEqual([ 'Hashmd5, sha1, or sha256', 'PathThe full path of the application', @@ -411,5 +415,48 @@ describe('When using the Trusted App Form', () => { }, }); }); + + it('should not validate form to true if name input is empty', () => { + const props = { + name: 'some name', + description: '', + effectScope: { + type: 'global', + }, + os: OperatingSystem.WINDOWS, + entries: [ + { field: ConditionEntryField.PATH, operator: 'included', type: 'wildcard', value: 'x' }, + ], + } as NewTrustedApp; + + formProps.trustedApp = props; + render(); + + formProps.trustedApp = { + ...props, + name: '', + }; + rerender(); + + expect(getAllValidationErrors()).toHaveLength(0); + expect(getAllValidationWarnings()).toHaveLength(1); + expect(formProps.onChange).toHaveBeenLastCalledWith({ + isValid: false, + item: { + name: '', + description: '', + os: OperatingSystem.WINDOWS, + effectScope: { type: 'global' }, + entries: [ + { + field: ConditionEntryField.PATH, + operator: 'included', + type: 'wildcard', + value: 'x', + }, + ], + }, + }); + }); }); }); diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/create_trusted_app_form.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/create_trusted_app_form.tsx index 562427e27592b..b8c0fe52f67a1 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/create_trusted_app_form.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/create_trusted_app_form.tsx @@ -161,8 +161,6 @@ const validateFormValues = (values: MaybeImmutable): ValidationRe } else if ( !isPathValid({ os: values.os, field: entry.field, type: entry.type, value: entry.value }) ) { - // show soft warnings and thus allow entry - isValid = true; addResultToValidation( validation, 'entries', diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_app_card/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_app_card/__snapshots__/index.test.tsx.snap deleted file mode 100644 index cbeea78f51040..0000000000000 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_app_card/__snapshots__/index.test.tsx.snap +++ /dev/null @@ -1,249 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`trusted_app_card TrustedAppCard should render correctly 1`] = ` - - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - - Edit - - - Remove - - -`; - -exports[`trusted_app_card TrustedAppCard should trim long texts 1`] = ` - - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - - - Edit - - - Remove - - -`; diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_app_card/index.stories.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_app_card/index.stories.tsx deleted file mode 100644 index e2e426caa1654..0000000000000 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_app_card/index.stories.tsx +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { ThemeProvider } from 'styled-components'; -import { storiesOf, addDecorator } from '@storybook/react'; -import { action } from '@storybook/addon-actions'; -import euiLightVars from '@elastic/eui/dist/eui_theme_light.json'; - -import { KibanaContextProvider } from '../../../../../../../../../../src/plugins/kibana_react/public'; -import { - ConditionEntryField, - TrustedApp, - WindowsConditionEntry, -} from '../../../../../../../common/endpoint/types'; - -import { createSampleTrustedApp } from '../../../test_utils'; - -import { TrustedAppCard } from '.'; - -addDecorator((storyFn) => ( - 'MMM D, YYYY @ HH:mm:ss.SSS' } }}> - ({ eui: euiLightVars, darkMode: false })}> - {storyFn()} - - -)); - -const PATH_CONDITION: WindowsConditionEntry = { - field: ConditionEntryField.PATH, - operator: 'included', - type: 'match', - value: '/some/path/on/file/system', -}; - -const SIGNER_CONDITION: WindowsConditionEntry = { - field: ConditionEntryField.SIGNER, - operator: 'included', - type: 'match', - value: 'Elastic', -}; - -storiesOf('TrustedApps/TrustedAppCard', module) - .add('default', () => { - const trustedApp: TrustedApp = createSampleTrustedApp(5); - trustedApp.created_at = '2020-09-17T14:52:33.899Z'; - trustedApp.entries = [PATH_CONDITION]; - - return ( - - ); - }) - .add('multiple entries', () => { - const trustedApp: TrustedApp = createSampleTrustedApp(5); - trustedApp.created_at = '2020-09-17T14:52:33.899Z'; - trustedApp.entries = [PATH_CONDITION, SIGNER_CONDITION]; - - return ( - - ); - }) - .add('longs texts', () => { - const trustedApp: TrustedApp = createSampleTrustedApp(5, true); - trustedApp.created_at = '2020-09-17T14:52:33.899Z'; - trustedApp.entries = [PATH_CONDITION, SIGNER_CONDITION]; - - return ( - - ); - }); diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_app_card/index.test.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_app_card/index.test.tsx deleted file mode 100644 index 0b1d8e0d7ac98..0000000000000 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_app_card/index.test.tsx +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { shallow } from 'enzyme'; -import React from 'react'; - -import { TrustedAppCard } from '.'; -import { createSampleTrustedApp } from '../../../test_utils'; - -describe('trusted_app_card', () => { - describe('TrustedAppCard', () => { - it('should render correctly', () => { - const element = shallow( - {}} - onEdit={() => {}} - /> - ); - - expect(element).toMatchSnapshot(); - }); - - it('should trim long texts', () => { - const element = shallow( - {}} - onEdit={() => {}} - /> - ); - - expect(element).toMatchSnapshot(); - }); - }); -}); diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_app_card/index.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_app_card/index.tsx deleted file mode 100644 index 419d8aaedfe03..0000000000000 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_app_card/index.tsx +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { memo, useCallback, useMemo } from 'react'; -import { isEmpty } from 'lodash/fp'; -import { EuiTableFieldDataColumnType } from '@elastic/eui'; - -import { - Immutable, - TrustedApp, - MacosLinuxConditionEntry, - WindowsConditionEntry, -} from '../../../../../../../common/endpoint/types'; - -import { FormattedDate } from '../../../../../../common/components/formatted_date'; -import { ConditionsTable } from '../../../../../../common/components/conditions_table'; -import { TextFieldValue } from '../../../../../../common/components/text_field_value'; -import { - ItemDetailsAction, - ItemDetailsCard, - ItemDetailsCardProps, - ItemDetailsPropertySummary, -} from '../../../../../../common/components/item_details_card'; - -import { - OS_TITLES, - PROPERTY_TITLES, - ENTRY_PROPERTY_TITLES, - CARD_DELETE_BUTTON_LABEL, - CONDITION_FIELD_TITLE, - OPERATOR_TITLES, - CARD_EDIT_BUTTON_LABEL, -} from '../../translations'; - -type Entry = MacosLinuxConditionEntry | WindowsConditionEntry; - -const getEntriesColumnDefinitions = (): Array> => [ - { - field: 'field', - name: ENTRY_PROPERTY_TITLES.field, - sortable: false, - truncateText: true, - textOnly: true, - width: '30%', - render(field: Entry['field'], _entry: Entry) { - return CONDITION_FIELD_TITLE[field]; - }, - }, - { - field: 'operator', - name: ENTRY_PROPERTY_TITLES.operator, - sortable: false, - truncateText: true, - width: '20%', - render(_field: Entry['operator'], entry: Entry) { - return entry.type === 'wildcard' ? OPERATOR_TITLES.matches : OPERATOR_TITLES.is; - }, - }, - { - field: 'value', - name: ENTRY_PROPERTY_TITLES.value, - sortable: false, - width: '60%', - 'data-test-subj': 'conditionValue', - render(field: Entry['value'], entry: Entry) { - return ( - - ); - }, - }, -]; - -export type TrustedAppCardProps = Pick & { - trustedApp: Immutable; - onDelete: (trustedApp: Immutable) => void; - onEdit: (trustedApp: Immutable) => void; -}; - -export const TrustedAppCard = memo( - ({ trustedApp, onDelete, onEdit, ...otherProps }) => { - const handleDelete = useCallback(() => onDelete(trustedApp), [onDelete, trustedApp]); - const handleEdit = useCallback(() => onEdit(trustedApp), [onEdit, trustedApp]); - - return ( - - - } - /> - } - /> - - } - /> - - } - /> - - } - /> - - } - /> - {!isEmpty(trustedApp.description) && ( - - } - /> - )} - - getEntriesColumnDefinitions(), [])} - items={useMemo(() => [...trustedApp.entries], [trustedApp.entries])} - badge="and" - className="trustedAppsConditionsTable" - responsive - /> - - - {CARD_EDIT_BUTTON_LABEL} - - - - {CARD_DELETE_BUTTON_LABEL} - - - ); - } -); - -TrustedAppCard.displayName = 'TrustedAppCard'; diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/__snapshots__/index.test.tsx.snap index 1355594831a24..236a93d63bcee 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/__snapshots__/index.test.tsx.snap @@ -372,35 +372,6 @@ exports[`TrustedAppsGrid renders correctly when failed loading data for the seco `; exports[`TrustedAppsGrid renders correctly when loaded data 1`] = ` -.c2 { - background-color: #f5f7fa; - padding: 16px; -} - -.c5 { - padding: 12px 24px 24px 0; -} - -.c5.c5.c5 { - margin-left: 0; -} - -.c5 .trustedAppsConditionsTable { - margin-left: 16px; -} - -.c3.c3.c3 { - width: 40%; - margin-top: 0; - margin-bottom: 8px; -} - -.c4.c4.c4 { - width: 60%; - margin-top: 0; - margin-bottom: 8px; -} - .c1 { position: relative; padding-top: 4px; @@ -414,6 +385,10 @@ exports[`TrustedAppsGrid renders correctly when loaded data 1`] = ` position: relative; } +.c3.artifactEntryCard + .c2.artifactEntryCard { + margin-top: 24px; +} + .c0 .trusted-app + .trusted-app { margin-top: 24px; } @@ -432,3194 +407,4074 @@ exports[`TrustedAppsGrid renders correctly when loaded data 1`] = ` class="body-content undefined" >
    -
    -
    - Name -
    -
    - - +

    trusted app 0 - - -

    -
    - OS -
    -
    - - - Windows - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    - - - someone - - -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - - someone - - -
    -
    - Description -
    -
    - +
    +
    - - Trusted App 0 - - - - -
    -
    -
    -
    -
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - + + +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    -
    - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 0 +

    -
    -
    +
    -
    -
    - Name -
    -
    - - - trusted app 1 - - -
    -
    - OS -
    -
    - - - Mac - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    + - - someone + + + + OS -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 1 + + + Windows -
    -
    + +
    +
    +
    +
    +
    -
    +
    +

    + trusted app 1 +

    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - +
    +
    + Created +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    -
    -
    -
    -
    -
    -
    -
    -
    - Name -
    -
    - - - trusted app 2 - - -
    -
    - OS -
    -
    - - - Linux - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    - - - someone - - -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - - someone - - -
    -
    - Description -
    -
    - - - Trusted App 2 - - -
    -
    + +
    +
    +
    -
    +
    + + + + Created by + + + +
    +
    -
    +
    - +
    +
    + someone
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    -
    -
    -
    - +
    -
    -
    -
    - + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 1 +

    -
    -
    +
    -
    -
    - Name -
    -
    - - - trusted app 3 - - -
    -
    - OS -
    -
    - - - Windows - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    + - - someone + + + + OS -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 3 + + + macos -
    -
    + +
    +
    + +
    +
    -
    +
    +

    + trusted app 2 +

    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - + + +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    -
    - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    -
    - +
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - Name -
    -
    - - - trusted app 4 - - -
    -
    - OS -
    -
    - - - Mac - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    - - - someone - - -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - - someone - - -
    -
    - Description -
    -
    - - - Trusted App 4 - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    + +
    +
    +
    -
    -
    -
    -
    + someone
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    -
    -
    -
    - +
    -
    -
    -
    - + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 2 +

    - -
    +
    -
    -
    - Name -
    -
    - - - trusted app 5 - - -
    -
    - OS -
    -
    - - - Linux - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    + - - someone + + + + OS -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 5 + + + Linux -
    -
    + +
    +
    + +
    +
    -
    +
    +

    + trusted app 3 +

    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - + + +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    -
    - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    -
    - +
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - Name -
    -
    - - - trusted app 6 - - -
    -
    - OS -
    -
    - - - Windows - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    - - - someone - - -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - - someone - - -
    -
    - Description -
    -
    - - - Trusted App 6 - - -
    -
    -
    -
    -
    -
    -
    -
    -
    +
    - +
    +
    + someone
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    +
    +
    + +
    +
    -
    - -
    -
    -
    -
    - -
    + Applied globally
    +
    +
    +

    + Trusted App 3 +

    +
    -
    -
    +
    -
    -
    - Name -
    -
    - - - trusted app 7 - - -
    -
    - OS -
    -
    - - - Mac - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    + - - someone + + + + OS -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 7 + + + Windows -
    -
    + +
    +
    +
    +
    +
    -
    +
    +

    + trusted app 4 +

    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - + + +
    +
    +
    + +
    +
    +
    +
    +
    -
    - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    + Created +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    -
    -
    -
    -
    -
    -
    -
    -
    - Name -
    -
    - - - trusted app 8 - - -
    -
    - OS -
    -
    - +
    +
    - - Linux - - - -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 4 +

    +
    +
    +
    +
    +
    +
    + - - someone + + + + OS - -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 8 + + + macos -
    - +
    +
    +
    +
    +
    +
    -
    +
    +

    + trusted app 5 +

    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - + + +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    -
    - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 5 +

    -
    -
    +
    -
    -
    - Name -
    -
    - - - trusted app 9 - - -
    -
    - OS -
    -
    - - - Windows - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    + - - someone + + + + OS -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 9 + + + Linux -
    -
    + +
    +
    + +
    +
    -
    +
    +

    + trusted app 6 +

    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    +
    - - Remove - - - +
    +
    + Created +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    -
    - - - -
    -
    -
    -
    -
    - +
    +
    + + + + Created by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + Updated by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 6 +

    -
    -
    -
    +
    + +
    +
    +
    +
    - - -
  • +
  • +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Last updated +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    - +
    +
    + + +
    +
    +
    +
    +
    +
    + + + + Created by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + Updated by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 7 +

    +
    +
    +
    +
    +
    +
    + + + - 5 + OS - - -
  • - … -
  • -
  • - -
  • - - - +
    +
    +
    +
    - - - - - -`; - -exports[`TrustedAppsGrid renders correctly when loading data for the first time 1`] = ` -.c1 { - position: relative; - padding-top: 4px; -} - -.c1 .body { - min-height: 40px; -} - -.c1 .body-content { - position: relative; -} - -.c0 .trusted-app + .trusted-app { - margin-top: 24px; -} - -
    -
    +
    +
    +
    +
    +
    +
    +

    + trusted app 8 +

    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Last updated +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + Created by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + Updated by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 8 +

    +
    +
    +
    +
    +
    +
    + + + + + + OS + + + + + IS + + + + Linux + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    + trusted app 9 +

    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Last updated +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + Created by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + Updated by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 9 +

    +
    +
    +
    +
    +
    +
    + + + + + + OS + + + + + IS + + + + Windows + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +`; + +exports[`TrustedAppsGrid renders correctly when loading data for the first time 1`] = ` +.c1 { + position: relative; + padding-top: 4px; +} + +.c1 .body { + min-height: 40px; +} + +.c1 .body-content { + position: relative; +} + +.c0 .trusted-app + .trusted-app { + margin-top: 24px; +} + +
    +
    @@ -3639,35 +4494,6 @@ exports[`TrustedAppsGrid renders correctly when loading data for the first time `; exports[`TrustedAppsGrid renders correctly when loading data for the second time 1`] = ` -.c2 { - background-color: #f5f7fa; - padding: 16px; -} - -.c5 { - padding: 12px 24px 24px 0; -} - -.c5.c5.c5 { - margin-left: 0; -} - -.c5 .trustedAppsConditionsTable { - margin-left: 16px; -} - -.c3.c3.c3 { - width: 40%; - margin-top: 0; - margin-bottom: 8px; -} - -.c4.c4.c4 { - width: 60%; - margin-top: 0; - margin-bottom: 8px; -} - .c1 { position: relative; padding-top: 4px; @@ -3681,6 +4507,10 @@ exports[`TrustedAppsGrid renders correctly when loading data for the second time position: relative; } +.c3.artifactEntryCard + .c2.artifactEntryCard { + margin-top: 24px; +} + .c0 .trusted-app + .trusted-app { margin-top: 24px; } @@ -3702,6179 +4532,7914 @@ exports[`TrustedAppsGrid renders correctly when loading data for the second time class="body-content undefined" >
    +
    +
    +
    +
    +
    +

    + trusted app 0 +

    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Last updated +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + Created by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + Updated by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 0 +

    +
    +
    +
    +
    +
    +
    + + + + + + OS + + + + + IS + + + + Windows + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    + trusted app 1 +

    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Last updated +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + Created by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + Updated by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 1 +

    +
    +
    +
    +
    +
    +
    + + + + + + OS + + + + + IS + + + + macos + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    + trusted app 2 +

    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Last updated +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + Created by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + Updated by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 2 +

    +
    +
    +
    +
    +
    +
    + + + + + + OS + + + + + IS + + + + Linux + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    + trusted app 3 +

    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Last updated +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + Created by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + Updated by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 3 +

    +
    +
    +
    +
    +
    +
    + + + + + + OS + + + + + IS + + + + Windows + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    + trusted app 4 +

    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Last updated +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + Created by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + Updated by + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 4 +

    +
    +
    +
    +
    -
    -
    - Name -
    -
    - - - trusted app 0 - - -
    -
    - OS -
    -
    - - - Windows - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    + - - someone + + + + OS -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 0 + + + macos -
    -
    + +
    +
    +
    +
    +
    -
    +
    +

    + trusted app 5 +

    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - + + +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    -
    - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 5 +

    -
    -
    +
    -
    -
    - Name -
    -
    - - - trusted app 1 - - -
    -
    - OS -
    -
    - - - Mac - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    - - - someone - - -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    + - - someone + + + + OS -
    -
    - Description -
    -
    - - Trusted App 1 + + IS + + + + Linux -
    -
    + +
    +
    +
    +
    +
    -
    +
    +

    + trusted app 6 +

    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    +
    - - Remove - - - +
    +
    + Created +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    -
    -
    -
    -
    -
    -
    -
    -
    - Name -
    -
    - - - trusted app 2 - - -
    -
    - OS -
    -
    - - - Linux - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    - - - someone - - -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - - someone - - -
    -
    - Description -
    -
    - - - Trusted App 2 - - -
    -
    + +
    +
    +
    -
    +
    + + + + Created by + + + +
    +
    -
    +
    - +
    +
    + someone
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    -
    -
    -
    - +
    -
    -
    -
    - + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 6 +

    -
    -
    +
    -
    -
    - Name -
    -
    - - - trusted app 3 - - -
    -
    - OS -
    -
    - - - Windows - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    + - - someone + + + + OS -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 3 + + + Windows -
    -
    + +
    +
    +
    +
    +
    -
    +
    +

    + trusted app 7 +

    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Last updated +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Created +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    -
    - +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally
    +
    +
    +

    + Trusted App 7 +

    +
    -
    -
    +
    -
    -
    - Name -
    -
    - - - trusted app 4 - - -
    -
    - OS -
    -
    - - - Mac - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    + - - someone + + + + OS -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 4 + + + macos -
    -
    + +
    +
    +
    +
    +
    -
    +
    +

    + trusted app 8 +

    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    +
    - - Remove - - - +
    +
    + Created +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    -
    -
    -
    -
    -
    -
    -
    -
    - Name -
    -
    - - - trusted app 5 - - -
    -
    - OS -
    -
    - - - Linux - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    - - - someone - - -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - - someone - - -
    -
    - Description -
    -
    - - - Trusted App 5 - - -
    -
    + +
    +
    +
    -
    +
    + + + + Created by + + + +
    +
    -
    +
    - +
    +
    + someone
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    -
    -
    -
    - +
    -
    -
    -
    - + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 8 +

    -
    -
    +
    -
    -
    - Name -
    -
    - - - trusted app 6 - - -
    -
    - OS -
    -
    - - - Windows - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    + - - someone + + + + OS -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 6 + + + Linux -
    -
    + +
    +
    +
    +
    +
    -
    +
    +

    + trusted app 9 +

    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - + + +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    -
    - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 9 +

    +
    +
    +
    +
    +
    +
    + + + + + + OS + + + + + IS + + + + Windows + + + +
    +
    +
    +
    +
    +
    -
    -
    - Name -
    -
    + + Rows per page + : + 10 + + + +
    +
    +
    +
    +
    + + + + + +
    +
    +
    + + + +`; + +exports[`TrustedAppsGrid renders correctly when new page and page size set (not loading yet) 1`] = ` +.c1 { + position: relative; + padding-top: 4px; +} + +.c1 .body { + min-height: 40px; +} + +.c1 .body-content { + position: relative; +} + +.c3.artifactEntryCard + .c2.artifactEntryCard { + margin-top: 24px; +} + +.c0 .trusted-app + .trusted-app { + margin-top: 24px; +} + +
    +
    +
    +
    +
    +
    +
    -
    +
    +

    + trusted app 0 +

    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Last updated +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Created +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 0 +

    -
    -
    +
    -
    -
    - Name -
    -
    - - - trusted app 8 - - -
    -
    - OS -
    -
    - - - Linux - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    + - - someone + + + + OS -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 8 + + + Windows -
    -
    + +
    +
    +
    +
    +
    -
    +
    +

    + trusted app 1 +

    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - + + +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    -
    - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 1 +

    -
    -
    +
    -
    -
    - Name -
    -
    - - - trusted app 9 - - -
    -
    - OS -
    -
    - - - Windows - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    + - - someone + + + + OS -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 9 + + + macos -
    -
    + +
    +
    +
    +
    +
    -
    +
    +

    + trusted app 2 +

    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - + + +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    -
    - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    -
    - +
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    +
    +
    +
    +
    +
    -
    +
    +
    - 3 - - - - -
  • +
  • +
    +
    +
    +
    +
    +

    -

    +
    +
    +
    +
    +
    + + + - 4 + OS - - -
  • - -
  • -
  • - … -
  • -
  • - -
  • - - - +
    +
    +
    +
    - - - - - -`; - -exports[`TrustedAppsGrid renders correctly when new page and page size set (not loading yet) 1`] = ` -.c2 { - background-color: #f5f7fa; - padding: 16px; -} - -.c5 { - padding: 12px 24px 24px 0; -} - -.c5.c5.c5 { - margin-left: 0; -} - -.c5 .trustedAppsConditionsTable { - margin-left: 16px; -} - -.c3.c3.c3 { - width: 40%; - margin-top: 0; - margin-bottom: 8px; -} - -.c4.c4.c4 { - width: 60%; - margin-top: 0; - margin-bottom: 8px; -} - -.c1 { - position: relative; - padding-top: 4px; -} - -.c1 .body { - min-height: 40px; -} - -.c1 .body-content { - position: relative; -} - -.c0 .trusted-app + .trusted-app { - margin-top: 24px; -} - -
    -
    -
    -
    -
    -
    -
    - Name -
    -
    - - - trusted app 0 - - -
    -
    - OS -
    -
    - - - Windows - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    - - - someone - - -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - + trusted app 3 + +
    +
    - - someone - - - -
    - Description -
    -
    +
    +
    +
    + +
    +
    +
    +
    +
    + Last updated +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    - - - Trusted App 0 - - - - + +
    +
    +
    -
    +
    + + + + Created by + + + +
    +
    -
    +
    - +
    +
    + someone
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    -
    -
    -
    - +
    -
    -
    -
    - + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 3 +

    -
    -
    +
    -
    -
    - Name -
    -
    - - - trusted app 1 - - -
    -
    - OS -
    -
    - - - Mac - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    + - - someone + + + + OS -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 1 + + + Windows -
    -
    + +
    +
    +
    +
    +
    -
    +
    +

    + trusted app 4 +

    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    +
    - - Remove - - - +
    +
    + Created +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    -
    -
    -
    -
    -
    -
    -
    -
    - Name -
    -
    - - - trusted app 2 - - -
    -
    - OS -
    -
    - - - Linux - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    - - - someone - - -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - - someone - - -
    -
    - Description -
    -
    - - - Trusted App 2 - - -
    -
    + +
    +
    +
    -
    +
    + + + + Created by + + + +
    +
    -
    +
    +
    + +
    +
    +
    -
    -
    -
    -
    + someone
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    -
    -
    -
    - +
    -
    -
    -
    - + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 4 +

    -
    -
    +
    -
    -
    - Name -
    -
    - - - trusted app 3 - - -
    -
    - OS -
    -
    - - - Windows - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    + - - someone + + + + OS -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 3 + + + macos -
    -
    + +
    +
    + +
    +
    -
    +
    +

    + trusted app 5 +

    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - + + +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    -
    - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 5 +

    -
    -
    +
    -
    -
    - Name -
    -
    - - - trusted app 4 - - -
    -
    - OS -
    -
    - - - Mac - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    + - - someone + + + + OS -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 4 + + + Linux -
    -
    + +
    +
    + +
    +
    -
    +
    +

    + trusted app 6 +

    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    +
    - - Remove - - - +
    +
    + Created +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    -
    -
    - -
    -
    -
    -
    -
    - Name -
    -
    - - - trusted app 5 - - -
    -
    - OS -
    -
    - - - Linux - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    - - - someone - - -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - - someone - - -
    -
    - Description -
    -
    - - - Trusted App 5 - - -
    -
    + +
    +
    +
    -
    +
    + + + + Created by + + + +
    +
    -
    +
    - +
    +
    + someone
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    -
    -
    -
    - +
    -
    -
    -
    - + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 6 +

    -
    -
    +
    -
    -
    - Name -
    -
    - - - trusted app 6 - - -
    -
    - OS -
    -
    - - - Windows - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    + - - someone + + + + OS -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 6 + + + Windows -
    -
    + +
    +
    + +
    +
    -
    +
    +

    + trusted app 7 +

    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + Last updated +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Created +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 7 +

    -
    -
    +
    -
    -
    - Name -
    -
    - - - trusted app 7 - - -
    -
    - OS -
    -
    + - - Mac - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    - - - someone + + + + OS -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 7 + + + macos -
    -
    + +
    +
    +
    +
    +
    -
    +
    +

    + trusted app 8 +

    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    +
    - - Remove - - - +
    +
    + Created +
    +
    +
    +
    + + 1 minute ago + +
    +
    +
    +
    +
    -
    -
    -
    -
    -
    -
    -
    -
    - Name -
    -
    - - - trusted app 8 - - -
    -
    - OS -
    -
    - - - Linux - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    - - - someone - - -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - - someone - - -
    -
    - Description -
    -
    - - - Trusted App 8 - - -
    -
    + +
    +
    +
    -
    +
    + + + + Created by + + + +
    +
    -
    +
    - +
    +
    + someone
    - - - - - - - - - - - - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    -
    -
    -
    - +
    -
    -
    -
    - + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 8 +

    -
    -
    +
    -
    -
    - Name -
    -
    - - - trusted app 9 - - -
    -
    - OS -
    -
    - - - Windows - - -
    -
    - Date created -
    -
    - 1 minute ago -
    -
    - Created by -
    -
    + - - someone + + + + OS -
    -
    - Date modified -
    -
    - 1 minute ago -
    -
    - Modified by -
    -
    - - someone + + IS - -
    -
    - Description -
    -
    - - - Trusted App 9 + + + Linux -
    -
    + +
    +
    + +
    +
    -
    +
    +

    + trusted app 9 +

    +
    +
    -
    +
    + +
    +
    + class="euiText euiText--small" + > + Last updated +
    +
    +
    + class="euiText euiText--small" + > + + 1 minute ago + +
    - - - - - - - - - - + + +
    +
    +
    + +
    +
    +
    +
    +
    + Created +
    +
    +
    +
    -
    - - -
    -
    - - - Field - - - - - - Operator - - - - - - Value - - -
    -
    - - No items found - -
    -
    + + 1 minute ago + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    -
    - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + someone +
    +
    +
    +
    +
    +
    + +
    +
    +
    + Applied globally +
    +
    +
    +
    +
    +
    +
    +

    + Trusted App 9 +

    +
    +
    +
    +
    +
    +
    + + + + + + OS + + + + + IS + + + + Windows + + + +
    diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/index.test.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/index.test.tsx index 74f3f0524b304..d5eca75f9c2b5 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/index.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/index.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { render } from '@testing-library/react'; +import { render, act } from '@testing-library/react'; import React from 'react'; import { Provider } from 'react-redux'; @@ -18,7 +18,6 @@ import { createUserChangedUrlAction, createGlobalNoMiddlewareStore, } from '../../../test_utils'; - import { TrustedAppsGrid } from '.'; import { EuiThemeProvider } from '../../../../../../../../../../src/plugins/kibana_react/common'; @@ -26,6 +25,8 @@ jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => ({ htmlIdGenerator: () => () => 'mockId', })); +jest.mock('../../../../../../common/lib/kibana'); + const now = 111111; const renderList = (store: ReturnType) => { @@ -129,7 +130,15 @@ describe('TrustedAppsGrid', () => { ); store.dispatch = jest.fn(); - (await renderList(store).findAllByTestId('trustedAppDeleteButton'))[0].click(); + const renderResult = renderList(store); + + await act(async () => { + (await renderResult.findAllByTestId('trustedAppCard-header-actions-button'))[0].click(); + }); + + await act(async () => { + (await renderResult.findByTestId('deleteTrustedAppAction')).click(); + }); expect(store.dispatch).toBeCalledWith({ type: 'trustedAppDeletionDialogStarted', diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/index.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/index.tsx index 8d8b52ac62358..ba09d0c7ee0cc 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/index.tsx @@ -5,10 +5,13 @@ * 2.0. */ -import React, { memo, useCallback } from 'react'; +import React, { memo, useCallback, useMemo } from 'react'; import { useHistory } from 'react-router-dom'; import styled from 'styled-components'; +import { i18n } from '@kbn/i18n'; +import { useDispatch } from 'react-redux'; +import { Dispatch } from 'redux'; import { Pagination } from '../../../state'; import { @@ -17,28 +20,31 @@ import { getListItems, getListPagination, isListLoading, + getMapOfPoliciesById, } from '../../../store/selectors'; -import { - useTrustedAppsNavigateCallback, - useTrustedAppsSelector, - useTrustedAppsStoreActionCallback, -} from '../../hooks'; +import { useTrustedAppsNavigateCallback, useTrustedAppsSelector } from '../../hooks'; -import { TrustedAppCard, TrustedAppCardProps } from '../trusted_app_card'; -import { getTrustedAppsListPath } from '../../../../../common/routing'; +import { getPolicyDetailPath, getTrustedAppsListPath } from '../../../../../common/routing'; import { PaginatedContent, PaginatedContentProps, } from '../../../../../components/paginated_content'; -import { TrustedApp } from '../../../../../../../common/endpoint/types'; +import { PolicyDetailsRouteState, TrustedApp } from '../../../../../../../common/endpoint/types'; +import { + ArtifactEntryCard, + ArtifactEntryCardProps, +} from '../../../../../components/artifact_entry_card'; +import { AppAction } from '../../../../../../common/store/actions'; +import { APP_ID } from '../../../../../../../common/constants'; +import { useAppUrl } from '../../../../../../common/lib/kibana'; export interface PaginationBarProps { pagination: Pagination; onChange: (pagination: { size: number; index: number }) => void; } -type TrustedAppCardType = typeof TrustedAppCard; +type ArtifactEntryCardType = typeof ArtifactEntryCard; const RootWrapper = styled.div` .trusted-app + .trusted-app { @@ -46,52 +52,140 @@ const RootWrapper = styled.div` } `; +const BACK_TO_TRUSTED_APPS_LABEL = i18n.translate( + 'xpack.securitySolution.trustedapps.grid.policyDetailsLinkBackLabel', + { defaultMessage: 'Back to trusted Applications' } +); + +const EDIT_TRUSTED_APP_ACTION_LABEL = i18n.translate( + 'xpack.securitySolution.trustedapps.grid.cardAction.edit', + { + defaultMessage: 'Edit trusted application', + } +); + +const DELETE_TRUSTED_APP_ACTION_LABEL = i18n.translate( + 'xpack.securitySolution.trustedapps.grid.cardAction.delete', + { + defaultMessage: 'Delete trusted application', + } +); + export const TrustedAppsGrid = memo(() => { const history = useHistory(); + const dispatch = useDispatch>(); + const { getAppUrl } = useAppUrl(); + const pagination = useTrustedAppsSelector(getListPagination); const listItems = useTrustedAppsSelector(getListItems); const isLoading = useTrustedAppsSelector(isListLoading); const error = useTrustedAppsSelector(getListErrorMessage); const location = useTrustedAppsSelector(getCurrentLocation); - - const handleTrustedAppDelete = useTrustedAppsStoreActionCallback((trustedApp) => ({ - type: 'trustedAppDeletionDialogStarted', - payload: { entry: trustedApp }, - })); - - const handleTrustedAppEdit: TrustedAppCardProps['onEdit'] = useCallback( - (trustedApp) => { - history.push( - getTrustedAppsListPath({ - ...location, - show: 'edit', - id: trustedApp.id, - }) - ); - }, - [history, location] - ); + const policyListById = useTrustedAppsSelector(getMapOfPoliciesById); const handlePaginationChange: PaginatedContentProps< TrustedApp, - TrustedAppCardType + ArtifactEntryCardType >['onChange'] = useTrustedAppsNavigateCallback(({ pageIndex, pageSize }) => ({ page_index: pageIndex, page_size: pageSize, })); + const artifactCardPropsPerItem = useMemo(() => { + const cachedCardProps: Record = {}; + + // Casting `listItems` below to remove the `Immutable<>` from it in order to prevent errors + // with common component's props + for (const trustedApp of listItems as TrustedApp[]) { + let policies: ArtifactEntryCardProps['policies']; + + if (trustedApp.effectScope.type === 'policy' && trustedApp.effectScope.policies.length) { + policies = trustedApp.effectScope.policies.reduce< + Required['policies'] + >((policyToNavOptionsMap, policyId) => { + const currentPagePath = getTrustedAppsListPath({ + ...location, + }); + + const policyDetailsPath = getPolicyDetailPath(policyId); + + const routeState: PolicyDetailsRouteState = { + backLink: { + label: BACK_TO_TRUSTED_APPS_LABEL, + navigateTo: [ + APP_ID, + { + path: currentPagePath, + }, + ], + href: getAppUrl({ path: currentPagePath }), + }, + }; + + policyToNavOptionsMap[policyId] = { + navigateAppId: APP_ID, + navigateOptions: { + path: policyDetailsPath, + state: routeState, + }, + href: getAppUrl({ path: policyDetailsPath }), + children: policyListById[policyId]?.name ?? policyId, + }; + return policyToNavOptionsMap; + }, {}); + } + + cachedCardProps[trustedApp.id] = { + item: trustedApp, + policies, + 'data-test-subj': 'trustedAppCard', + actions: [ + { + icon: 'controlsHorizontal', + onClick: () => { + history.push( + getTrustedAppsListPath({ + ...location, + show: 'edit', + id: trustedApp.id, + }) + ); + }, + 'data-test-subj': 'editTrustedAppAction', + children: EDIT_TRUSTED_APP_ACTION_LABEL, + }, + { + icon: 'trash', + onClick: () => { + dispatch({ + type: 'trustedAppDeletionDialogStarted', + payload: { entry: trustedApp }, + }); + }, + 'data-test-subj': 'deleteTrustedAppAction', + children: DELETE_TRUSTED_APP_ACTION_LABEL, + }, + ], + }; + } + + return cachedCardProps; + }, [dispatch, getAppUrl, history, listItems, location, policyListById]); + + const handleArtifactCardProps = useCallback( + (trustedApp: TrustedApp) => { + return artifactCardPropsPerItem[trustedApp.id]; + }, + [artifactCardPropsPerItem] + ); + return ( - + items={listItems as TrustedApp[]} onChange={handlePaginationChange} - ItemComponent={TrustedAppCard} - itemComponentProps={(ta) => ({ - trustedApp: ta, - onDelete: handleTrustedAppDelete, - onEdit: handleTrustedAppEdit, - className: 'trusted-app', - })} + ItemComponent={ArtifactEntryCard} + itemComponentProps={handleArtifactCardProps} loading={isLoading} itemId="id" error={error} diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/translations.ts b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/translations.ts index 9e2cad93fc51f..6ffcf5614a697 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/translations.ts +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/translations.ts @@ -7,7 +7,6 @@ import { i18n } from '@kbn/i18n'; import { - TrustedApp, MacosLinuxConditionEntry, WindowsConditionEntry, ConditionEntryField, @@ -61,35 +60,6 @@ export const OPERATOR_TITLES: { [K in OperatorFieldIds]: string } = { }), }; -export const PROPERTY_TITLES: Readonly< - { [K in keyof Omit]: string } -> = { - name: i18n.translate('xpack.securitySolution.trustedapps.trustedapp.name', { - defaultMessage: 'Name', - }), - os: i18n.translate('xpack.securitySolution.trustedapps.trustedapp.os', { - defaultMessage: 'OS', - }), - created_at: i18n.translate('xpack.securitySolution.trustedapps.trustedapp.createdAt', { - defaultMessage: 'Date created', - }), - created_by: i18n.translate('xpack.securitySolution.trustedapps.trustedapp.createdBy', { - defaultMessage: 'Created by', - }), - updated_at: i18n.translate('xpack.securitySolution.trustedapps.trustedapp.updatedAt', { - defaultMessage: 'Date modified', - }), - updated_by: i18n.translate('xpack.securitySolution.trustedapps.trustedapp.updatedBy', { - defaultMessage: 'Modified by', - }), - description: i18n.translate('xpack.securitySolution.trustedapps.trustedapp.description', { - defaultMessage: 'Description', - }), - effectScope: i18n.translate('xpack.securitySolution.trustedapps.trustedapp.effectScope', { - defaultMessage: 'Effect scope', - }), -}; - export const ENTRY_PROPERTY_TITLES: Readonly< { [K in keyof Omit]: string } > = { @@ -104,41 +74,6 @@ export const ENTRY_PROPERTY_TITLES: Readonly< }), }; -export const ACTIONS_COLUMN_TITLE = i18n.translate( - 'xpack.securitySolution.trustedapps.list.columns.actions', - { - defaultMessage: 'Actions', - } -); - -export const LIST_ACTIONS = { - delete: { - name: i18n.translate('xpack.securitySolution.trustedapps.list.actions.delete', { - defaultMessage: 'Remove', - }), - description: i18n.translate( - 'xpack.securitySolution.trustedapps.list.actions.delete.description', - { - defaultMessage: 'Remove this entry', - } - ), - }, -}; - -export const CARD_DELETE_BUTTON_LABEL = i18n.translate( - 'xpack.securitySolution.trustedapps.card.removeButtonLabel', - { - defaultMessage: 'Remove', - } -); - -export const CARD_EDIT_BUTTON_LABEL = i18n.translate( - 'xpack.securitySolution.trustedapps.card.editButtonLabel', - { - defaultMessage: 'Edit', - } -); - export const GRID_VIEW_TOGGLE_LABEL = i18n.translate( 'xpack.securitySolution.trustedapps.view.toggle.grid', { diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.tsx index 3afa2642eba12..9e76cfd001c97 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.tsx @@ -14,6 +14,8 @@ import { EuiButtonEmpty, EuiButtonProps, PropsForButton, + EuiCallOut, + EuiSpacer, EuiModal, EuiModalBody, EuiModalFooter, @@ -22,7 +24,13 @@ import { EuiText, } from '@elastic/eui'; -import { Immutable, TrustedApp } from '../../../../../common/endpoint/types'; +import { + Immutable, + ImmutableObject, + PolicyEffectScope, + GlobalEffectScope, + TrustedApp, +} from '../../../../../common/endpoint/types'; import { AppAction } from '../../../../common/store/actions'; import { useTrustedAppsSelector } from './hooks'; import { @@ -33,19 +41,36 @@ import { const CANCEL_SUBJ = 'trustedAppDeletionCancel'; const CONFIRM_SUBJ = 'trustedAppDeletionConfirm'; +const isTrustedAppByPolicy = ( + trustedApp: ImmutableObject +): trustedApp is ImmutableObject => { + return (trustedApp as ImmutableObject).policies !== undefined; +}; const getTranslations = (entry: Immutable | undefined) => ({ title: ( {entry?.name} }} /> ), - mainMessage: ( + calloutTitle: ( {entry?.name} }} + id="xpack.securitySolution.trustedapps.deletionDialog.calloutTitle" + defaultMessage="Warning" + /> + ), + calloutMessage: ( + ), subMessage: ( @@ -63,7 +88,7 @@ const getTranslations = (entry: Immutable | undefined) => ({ confirmButton: ( ), }); @@ -105,8 +130,11 @@ export const TrustedAppDeletionDialog = memo(() => { + +

    {translations.calloutMessage}

    +
    + -

    {translations.mainMessage}

    {translations.subMessage}

    diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_page.test.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_page.test.tsx index ff7ba8068b4ff..30e170575e2f4 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_page.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_page.test.tsx @@ -183,8 +183,13 @@ describe('When on the Trusted Apps Page', () => { beforeEach(async () => { renderResult = await renderWithListData(); + + await act(async () => { + (await renderResult.findAllByTestId('trustedAppCard-header-actions-button'))[0].click(); + }); + act(() => { - fireEvent.click(renderResult.getByTestId('trustedAppEditButton')); + fireEvent.click(renderResult.getByTestId('editTrustedAppAction')); }); }); diff --git a/x-pack/plugins/security_solution/public/network/components/details/index.tsx b/x-pack/plugins/security_solution/public/network/components/details/index.tsx index 851197a78520b..7658a6a76230c 100644 --- a/x-pack/plugins/security_solution/public/network/components/details/index.tsx +++ b/x-pack/plugins/security_solution/public/network/components/details/index.tsx @@ -43,6 +43,7 @@ export interface IpOverviewProps { flowTarget: FlowTarget; id: string; ip: string; + isDraggable?: boolean; isInDetailsSidePanel: boolean; isLoadingAnomaliesData: boolean; loading: boolean; @@ -57,6 +58,7 @@ export const IpOverview = React.memo( id, ip, data, + isDraggable = false, isInDetailsSidePanel = false, // Rather than duplicate the component, alter the structure based on it's location loading, flowTarget, @@ -76,13 +78,14 @@ export const IpOverview = React.memo( description: locationRenderer( [`${flowTarget}.geo.city_name`, `${flowTarget}.geo.region_name`], data, - contextID + contextID, + isDraggable ), }, { title: i18n.AUTONOMOUS_SYSTEM, description: typeData - ? autonomousSystemRenderer(typeData.autonomousSystem, flowTarget, contextID) + ? autonomousSystemRenderer(typeData.autonomousSystem, flowTarget, contextID, isDraggable) : getEmptyTagValue(), }, ]; @@ -122,13 +125,15 @@ export const IpOverview = React.memo( title: i18n.HOST_ID, description: typeData && data.host - ? hostIdRenderer({ host: data.host, ipFilter: ip, contextID }) + ? hostIdRenderer({ host: data.host, isDraggable, ipFilter: ip, contextID }) : getEmptyTagValue(), }, { title: i18n.HOST_NAME, description: - typeData && data.host ? hostNameRenderer(data.host, ip, contextID) : getEmptyTagValue(), + typeData && data.host + ? hostNameRenderer(data.host, ip, contextID, isDraggable) + : getEmptyTagValue(), }, ], [ 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 ecbb80123e07e..042777491d9c3 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 @@ -14,7 +14,7 @@ import { LayerMappingDetails, } from './types'; import * as i18n from './translations'; -import { SOURCE_TYPES } from '../../../../../maps/common/constants'; +import { SOURCE_TYPES } from '../../../../../maps/common'; const euiVisColorPalette = euiPaletteColorBlind(); // Update field mappings to modify what fields will be returned to map tooltip diff --git a/x-pack/plugins/security_solution/public/network/components/embeddables/map_tool_tip/map_tool_tip.test.tsx b/x-pack/plugins/security_solution/public/network/components/embeddables/map_tool_tip/map_tool_tip.test.tsx index bc869dead4556..7d5e34df8c8fc 100644 --- a/x-pack/plugins/security_solution/public/network/components/embeddables/map_tool_tip/map_tool_tip.test.tsx +++ b/x-pack/plugins/security_solution/public/network/components/embeddables/map_tool_tip/map_tool_tip.test.tsx @@ -9,7 +9,7 @@ import { shallow } from 'enzyme'; import React from 'react'; import '../../../../common/mock/match_media'; import { MapToolTipComponent } from './map_tool_tip'; -import { TooltipFeature } from '../../../../../../maps/common/descriptor_types'; +import { TooltipFeature } from '../../../../../../maps/common'; describe('MapToolTip', () => { test('placeholder component renders correctly against snapshot', () => { diff --git a/x-pack/plugins/security_solution/public/overview/components/host_overview/index.tsx b/x-pack/plugins/security_solution/public/overview/components/host_overview/index.tsx index 75723e0d3af84..e73096aa3babf 100644 --- a/x-pack/plugins/security_solution/public/overview/components/host_overview/index.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/host_overview/index.tsx @@ -42,6 +42,7 @@ interface HostSummaryProps { data: HostItem; docValueFields: DocValueFields[]; id: string; + isDraggable?: boolean; isInDetailsSidePanel: boolean; loading: boolean; isLoadingAnomaliesData: boolean; @@ -60,6 +61,7 @@ export const HostOverview = React.memo( docValueFields, endDate, id, + isDraggable = false, isInDetailsSidePanel = false, // Rather than duplicate the component, alter the structure based on it's location isLoadingAnomaliesData, indexNames, @@ -77,9 +79,10 @@ export const HostOverview = React.memo( rowItems={getOr([], fieldName, fieldData)} attrName={fieldName} idPrefix={contextID ? `host-overview-${contextID}` : 'host-overview'} + isDraggable={isDraggable} /> ), - [contextID] + [contextID, isDraggable] ); const column: DescriptionList[] = useMemo( @@ -88,7 +91,7 @@ export const HostOverview = React.memo( title: i18n.HOST_ID, description: data && data.host - ? hostIdRenderer({ host: data.host, noLink: true }) + ? hostIdRenderer({ host: data.host, isDraggable, noLink: true }) : getEmptyTagValue(), }, { @@ -120,7 +123,7 @@ export const HostOverview = React.memo( ), }, ], - [data, docValueFields, indexNames] + [data, docValueFields, indexNames, isDraggable] ); const firstColumn = useMemo( () => @@ -163,6 +166,7 @@ export const HostOverview = React.memo( rowItems={getOr([], 'host.ip', data)} attrName={'host.ip'} idPrefix={contextID ? `host-overview-${contextID}` : 'host-overview'} + isDraggable={isDraggable} render={(ip) => (ip != null ? : getEmptyTagValue())} /> ), @@ -198,7 +202,7 @@ export const HostOverview = React.memo( }, ], ], - [contextID, data, firstColumn, getDefaultRenderer] + [contextID, data, firstColumn, getDefaultRenderer, isDraggable] ); return ( <> diff --git a/x-pack/plugins/security_solution/public/timelines/components/field_renderers/field_renderers.tsx b/x-pack/plugins/security_solution/public/timelines/components/field_renderers/field_renderers.tsx index d6dee8a8406b9..af5596be0732f 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/field_renderers/field_renderers.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/field_renderers/field_renderers.tsx @@ -42,7 +42,8 @@ export const DEFAULT_MORE_MAX_HEIGHT = '200px'; export const locationRenderer = ( fieldNames: string[], data: NetworkDetailsStrategyResponse['networkDetails'], - contextID?: string + contextID?: string, + isDraggable?: boolean ): React.ReactElement => fieldNames.length > 0 && fieldNames.every((fieldName) => getOr(null, fieldName, data)) ? ( @@ -56,7 +57,7 @@ export const locationRenderer = ( id={`location-renderer-default-draggable-${IpOverviewId}-${ contextID ? `${contextID}-` : '' }${fieldName}`} - isDraggable={false} + isDraggable={isDraggable ?? false} field={fieldName} value={locationValue} /> @@ -76,7 +77,8 @@ export const dateRenderer = (timestamp?: string | null): React.ReactElement => ( export const autonomousSystemRenderer = ( as: AutonomousSystem, flowTarget: FlowTarget, - contextID?: string + contextID?: string, + isDraggable?: boolean ): React.ReactElement => as && as.organization && as.organization.name && as.number ? ( @@ -85,7 +87,7 @@ export const autonomousSystemRenderer = ( id={`autonomous-system-renderer-default-draggable-${IpOverviewId}-${ contextID ? `${contextID}-` : '' }${flowTarget}.as.organization.name`} - isDraggable={false} + isDraggable={isDraggable ?? false} field={`${flowTarget}.as.organization.name`} value={as.organization.name} /> @@ -110,12 +112,14 @@ interface HostIdRendererTypes { contextID?: string; host: HostEcs; ipFilter?: string; + isDraggable?: boolean; noLink?: boolean; } export const hostIdRenderer = ({ contextID, host, + isDraggable = false, ipFilter, noLink, }: HostIdRendererTypes): React.ReactElement => @@ -126,7 +130,7 @@ export const hostIdRenderer = ({ id={`host-id-renderer-default-draggable-${IpOverviewId}-${ contextID ? `${contextID}-` : '' }host-id`} - isDraggable={false} + isDraggable={isDraggable} field="host.id" value={host.id[0]} > @@ -147,7 +151,8 @@ export const hostIdRenderer = ({ export const hostNameRenderer = ( host?: HostEcs, ipFilter?: string, - contextID?: string + contextID?: string, + isDraggable?: boolean ): React.ReactElement => host && host.name && @@ -158,7 +163,7 @@ export const hostNameRenderer = ( id={`host-name-renderer-default-draggable-${IpOverviewId}-${ contextID ? `${contextID}-` : '' }host-name`} - isDraggable={false} + isDraggable={isDraggable ?? false} field={'host.name'} value={host.name[0]} > @@ -180,6 +185,7 @@ interface DefaultFieldRendererProps { rowItems: string[] | null | undefined; attrName: string; idPrefix: string; + isDraggable?: boolean; render?: (item: string) => JSX.Element; displayCount?: number; moreMaxHeight?: string; @@ -191,6 +197,7 @@ export const DefaultFieldRendererComponent: React.FC attrName, displayCount = 1, idPrefix, + isDraggable = false, moreMaxHeight = DEFAULT_MORE_MAX_HEIGHT, render, rowItems, @@ -209,7 +216,7 @@ export const DefaultFieldRendererComponent: React.FC )} {typeof rowItem === 'string' && ( - + {render ? render(rowItem) : rowItem} )} diff --git a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_name.tsx b/x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_name.tsx index 5059c62f61d9d..e833b8411cd9f 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_name.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_name.tsx @@ -6,14 +6,14 @@ */ import { EuiHighlight, EuiText } from '@elastic/eui'; -import React, { useCallback, useState, useMemo, useRef } from 'react'; +import React, { useCallback, useState, useMemo, useRef, useContext } from 'react'; import styled from 'styled-components'; import { OnUpdateColumns } from '../timeline/events'; import { WithHoverActions } from '../../../common/components/with_hover_actions'; -import { useGetTimelineId } from '../../../common/components/drag_and_drop/use_get_timeline_id_from_dom'; import { ColumnHeaderOptions } from '../../../../common'; import { HoverActions } from '../../../common/components/hover_actions'; +import { TimelineContext } from '../../../../../timelines/public'; /** * The name of a (draggable) field @@ -95,8 +95,7 @@ export const FieldName = React.memo<{ }) => { const containerRef = useRef(null); const [showTopN, setShowTopN] = useState(false); - const [goGetTimelineId, setGoGetTimelineId] = useState(false); - const timelineIdFind = useGetTimelineId(containerRef, goGetTimelineId); + const { timelineId: timelineIdFind } = useContext(TimelineContext); const toggleTopN = useCallback(() => { setShowTopN((prevShowTopN) => { @@ -122,7 +121,6 @@ export const FieldName = React.memo<{ ownFocus={hoverActionsOwnFocus} showTopN={showTopN} toggleTopN={toggleTopN} - goGetTimelineId={setGoGetTimelineId} timelineId={timelineIdFind} /> ), diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/side_panel/__snapshots__/index.test.tsx.snap index e3cf7fed14abd..b2a8a439220c0 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/__snapshots__/index.test.tsx.snap @@ -197,6 +197,7 @@ exports[`Details Panel Component DetailsPanel:EventDetails: rendering it should } } handleOnEventClosed={[Function]} + isDraggable={false} isFlyoutView={false} tabType="query" timelineId="test" @@ -435,6 +436,7 @@ exports[`Details Panel Component DetailsPanel:EventDetails: rendering it should } } isAlert={false} + isDraggable={false} loading={true} timelineId="test" timelineTabType="query" @@ -737,6 +739,7 @@ Array [ } } handleOnEventClosed={[Function]} + isDraggable={false} isFlyoutView={true} tabType="query" timelineId="test" @@ -952,6 +955,7 @@ Array [ } } isAlert={false} + isDraggable={false} loading={true} timelineId="test" timelineTabType="flyout" @@ -1229,7 +1233,7 @@ Array [
    - + > + +
    @@ -1596,6 +1775,7 @@ Array [ } } handleOnEventClosed={[Function]} + isDraggable={false} isFlyoutView={true} tabType="query" timelineId="test" @@ -1811,6 +1991,7 @@ Array [ } } isAlert={false} + isDraggable={false} loading={true} timelineId="test" timelineTabType="flyout" @@ -2088,7 +2269,7 @@ Array [
    - + > + +
    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 31cc61d4996a8..b3d7b869c0699 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 @@ -29,6 +29,7 @@ interface Props { detailsData: TimelineEventsDetailsItem[] | null; event: { eventId: string; indexName: string }; isAlert: boolean; + isDraggable?: boolean; loading: boolean; messageHeight?: number; timelineTabType: TimelineTabs | 'flyout'; @@ -80,7 +81,16 @@ export const ExpandableEventTitle = React.memo( ExpandableEventTitle.displayName = 'ExpandableEventTitle'; export const ExpandableEvent = React.memo( - ({ browserFields, event, timelineId, timelineTabType, isAlert, loading, detailsData }) => { + ({ + browserFields, + event, + timelineId, + timelineTabType, + isAlert, + isDraggable, + loading, + detailsData, + }) => { if (!event.eventId) { return {i18n.EVENT_DETAILS_PLACEHOLDER}; } @@ -97,6 +107,7 @@ export const ExpandableEvent = React.memo( data={detailsData ?? []} id={event.eventId!} isAlert={isAlert} + isDraggable={isDraggable} timelineId={timelineId} timelineTabType={timelineTabType} /> 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 0866a927182f5..fee4646e88186 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 @@ -61,6 +61,7 @@ interface EventDetailsPanelProps { refetch?: () => void; }; handleOnEventClosed: () => void; + isDraggable?: boolean; isFlyoutView?: boolean; tabType: TimelineTabs; timelineId: string; @@ -72,6 +73,7 @@ const EventDetailsPanelComponent: React.FC = ({ entityType = 'events', // Default to events so only alerts have to pass entityType in expandedEvent, handleOnEventClosed, + isDraggable, isFlyoutView, tabType, timelineId, @@ -186,6 +188,7 @@ const EventDetailsPanelComponent: React.FC = ({ detailsData={detailsData} event={expandedEvent} isAlert={isAlert} + isDraggable={isDraggable} loading={loading} timelineId={timelineId} timelineTabType="flyout" @@ -217,6 +220,7 @@ const EventDetailsPanelComponent: React.FC = ({ detailsData={detailsData} event={expandedEvent} isAlert={isAlert} + isDraggable={isDraggable} loading={loading} timelineId={timelineId} timelineTabType={tabType} @@ -231,5 +235,6 @@ export const EventDetailsPanel = React.memo( deepEqual(prevProps.browserFields, nextProps.browserFields) && deepEqual(prevProps.docValueFields, nextProps.docValueFields) && deepEqual(prevProps.expandedEvent, nextProps.expandedEvent) && - prevProps.timelineId === nextProps.timelineId + prevProps.timelineId === nextProps.timelineId && + prevProps.isDraggable === nextProps.isDraggable ); diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/host_details/__snapshots__/expandable_host.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/side_panel/host_details/__snapshots__/expandable_host.test.tsx.snap index 2cd3d333798d4..01ef89cd35c9f 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/host_details/__snapshots__/expandable_host.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/host_details/__snapshots__/expandable_host.test.tsx.snap @@ -108,6 +108,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "IShouldBeUsed", ] } + isDraggable={false} isInDetailsSidePanel={true} isLoadingAnomaliesData={false} loading={true} @@ -301,6 +302,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , @@ -310,6 +312,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "MAC addresses", @@ -318,6 +321,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Platform", @@ -339,6 +343,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , @@ -348,6 +353,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "MAC addresses", @@ -356,6 +362,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Platform", @@ -371,6 +378,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , @@ -380,6 +388,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "MAC addresses", @@ -388,6 +397,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Platform", @@ -416,6 +426,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re @@ -447,6 +458,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re @@ -477,6 +489,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re @@ -502,6 +515,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Operating system", @@ -510,6 +524,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Family", @@ -518,6 +533,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Version", @@ -526,6 +542,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Architecture", @@ -547,6 +564,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Operating system", @@ -555,6 +573,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Family", @@ -563,6 +582,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Version", @@ -571,6 +591,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Architecture", @@ -586,6 +607,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Operating system", @@ -594,6 +616,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Family", @@ -602,6 +625,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Version", @@ -610,6 +634,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Architecture", @@ -638,6 +663,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re @@ -668,6 +694,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re @@ -698,6 +725,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re @@ -728,6 +756,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re @@ -753,6 +782,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Cloud provider", @@ -761,6 +791,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Region", @@ -769,6 +800,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Instance ID", @@ -777,6 +809,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Machine type", @@ -798,6 +831,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Cloud provider", @@ -806,6 +840,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Region", @@ -814,6 +849,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Instance ID", @@ -822,6 +858,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Machine type", @@ -837,6 +874,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Cloud provider", @@ -845,6 +883,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Region", @@ -853,6 +892,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Instance ID", @@ -861,6 +901,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re "description": , "title": "Machine type", @@ -889,6 +930,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re @@ -919,6 +961,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re @@ -949,6 +992,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re @@ -979,6 +1023,7 @@ exports[`Expandable Host Component ExpandableHostDetails: rendering it should re diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/host_details/expandable_host.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/host_details/expandable_host.tsx index f18f1eb993ee2..3fe8c2dcc8e08 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/host_details/expandable_host.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/host_details/expandable_host.tsx @@ -54,7 +54,8 @@ export const ExpandableHostDetailsPageLink = ({ hostName }: ExpandableHostProps) export const ExpandableHostDetails = ({ contextID, hostName, -}: ExpandableHostProps & { contextID: string }) => { + isDraggable = false, +}: ExpandableHostProps & { contextID: string; isDraggable?: boolean }) => { const { to, from, isInitializing } = useGlobalTime(); const { docValueFields } = useSourcererScope(); /* @@ -92,6 +93,7 @@ export const ExpandableHostDetails = ({ isInDetailsSidePanel data={hostOverview as HostItem} anomaliesData={anomaliesData} + isDraggable={isDraggable} isLoadingAnomaliesData={isLoadingAnomaliesData} indexNames={allPatterns} loading={loading} diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/host_details/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/host_details/index.tsx index dd1bf3ddb5ffe..0a06810bb1249 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/host_details/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/host_details/index.tsx @@ -61,10 +61,11 @@ interface HostDetailsProps { expandedHost: { hostName: string }; handleOnHostClosed: () => void; isFlyoutView?: boolean; + isDraggable?: boolean; } export const HostDetailsPanel: React.FC = React.memo( - ({ contextID, expandedHost, handleOnHostClosed, isFlyoutView }) => { + ({ contextID, expandedHost, handleOnHostClosed, isDraggable, isFlyoutView }) => { const { hostName } = expandedHost; if (!hostName) { @@ -108,7 +109,11 @@ export const HostDetailsPanel: React.FC = React.memo( - + ); diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/index.test.tsx index 04601fcd50769..511887dc93cdf 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/index.test.tsx @@ -19,13 +19,27 @@ import { } from '../../../common/mock'; import { createStore, State } from '../../../common/store'; import { DetailsPanel } from './index'; -import { TimelineExpandedDetail, TimelineTabs } from '../../../../common/types/timeline'; +import { + TimelineExpandedDetail, + TimelineId, + TimelineTabs, +} from '../../../../common/types/timeline'; import { FlowTarget } from '../../../../common/search_strategy/security_solution/network'; +import { EventDetailsPanel } from './event_details'; jest.mock('../../../common/lib/kibana'); describe('Details Panel Component', () => { - const state: State = { ...mockGlobalState }; + const state: State = { + ...mockGlobalState, + timeline: { + ...mockGlobalState.timeline, + timelineById: { + ...mockGlobalState.timeline.timelineById, + [TimelineId.active]: mockGlobalState.timeline.timelineById.test, + }, + }, + }; const { storage } = createSecuritySolutionStorageMock(); let store = createStore(state, SUB_PLUGINS_REDUCER, kibanaObservable, storage); @@ -67,6 +81,17 @@ describe('Details Panel Component', () => { }, }; + const eventPinnedExpandedDetail: TimelineExpandedDetail = { + [TimelineTabs.pinned]: { + panelView: 'eventDetail', + params: { + eventId: 'my-id', + indexName: 'my-index', + ecsData: mockEcsDataWithAlert, + }, + }, + }; + const mockProps = { browserFields: {}, docValueFields: [], @@ -105,8 +130,10 @@ describe('Details Panel Component', () => { describe('DetailsPanel:EventDetails: rendering', () => { beforeEach(() => { - state.timeline.timelineById.test.expandedDetail = eventExpandedDetail; - store = createStore(state, SUB_PLUGINS_REDUCER, kibanaObservable, storage); + const mockState = { ...state }; + mockState.timeline.timelineById[TimelineId.active].expandedDetail = eventExpandedDetail; + mockState.timeline.timelineById.test.expandedDetail = eventExpandedDetail; + store = createStore(mockState, SUB_PLUGINS_REDUCER, kibanaObservable, storage); }); test('it should render the Details Panel when the panelView is set and the associated params are set', () => { @@ -139,6 +166,60 @@ describe('Details Panel Component', () => { expect(wrapper.find('EventDetails')).toMatchSnapshot(); }); + + test('it should have the attributes isDraggable to be false when timelineId !== "active" and activeTab === "query"', () => { + const wrapper = mount( + + + + ); + expect(wrapper.find(EventDetailsPanel).props().isDraggable).toBeFalsy(); + }); + + test('it should have the attributes isDraggable to be true when timelineId === "active" and activeTab === "query"', () => { + const currentProps = { ...mockProps, timelineId: TimelineId.active }; + const wrapper = mount( + + + + ); + expect(wrapper.find(EventDetailsPanel).props().isDraggable).toBeTruthy(); + }); + }); + + describe('DetailsPanel:EventDetails: rendering in pinned tab', () => { + beforeEach(() => { + const mockState = { ...state }; + mockState.timeline.timelineById[TimelineId.active].activeTab = TimelineTabs.pinned; + mockState.timeline.timelineById[TimelineId.active].expandedDetail = eventPinnedExpandedDetail; + mockState.timeline.timelineById.test.expandedDetail = eventPinnedExpandedDetail; + mockState.timeline.timelineById.test.activeTab = TimelineTabs.pinned; + store = createStore(mockState, SUB_PLUGINS_REDUCER, kibanaObservable, storage); + }); + + test('it should have the attributes isDraggable to be false when timelineId !== "active" and activeTab === "pinned"', () => { + const currentProps = { ...mockProps, tabType: TimelineTabs.pinned }; + const wrapper = mount( + + + + ); + expect(wrapper.find(EventDetailsPanel).props().isDraggable).toBeFalsy(); + }); + + test('it should have the attributes isDraggable to be false when timelineId === "active" and activeTab === "pinned"', () => { + const currentProps = { + ...mockProps, + tabType: TimelineTabs.pinned, + timelineId: TimelineId.active, + }; + const wrapper = mount( + + + + ); + expect(wrapper.find(EventDetailsPanel).props().isDraggable).toBeFalsy(); + }); }); describe('DetailsPanel:HostDetails: rendering', () => { diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/index.tsx index 97d9e4b492d6b..a9b1126edcaeb 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/index.tsx @@ -12,7 +12,7 @@ import { EuiFlyout, EuiFlyoutProps } from '@elastic/eui'; import { timelineActions, timelineSelectors } from '../../store/timeline'; import { timelineDefaults } from '../../store/timeline/defaults'; import { BrowserFields, DocValueFields } from '../../../common/containers/source'; -import { TimelineTabs } from '../../../../common/types/timeline'; +import { TimelineId, TimelineTabs } from '../../../../common/types/timeline'; import { useDeepEqualSelector } from '../../../common/hooks/use_selector'; import { EventDetailsPanel } from './event_details'; import { HostDetailsPanel } from './host_details'; @@ -70,6 +70,7 @@ export const DetailsPanel = React.memo( let visiblePanel = null; // store in variable to make return statement more readable let panelSize: EuiFlyoutProps['size'] = 's'; const contextID = `${timelineId}-${activeTab}`; + const isDraggable = timelineId === TimelineId.active && activeTab === TimelineTabs.query; if (currentTabDetail?.panelView === 'eventDetail' && currentTabDetail?.params?.eventId) { panelSize = 'm'; visiblePanel = ( @@ -79,6 +80,7 @@ export const DetailsPanel = React.memo( entityType={entityType} expandedEvent={currentTabDetail?.params} handleOnEventClosed={closePanel} + isDraggable={isDraggable} isFlyoutView={isFlyoutView} tabType={activeTab} timelineId={timelineId} @@ -92,6 +94,7 @@ export const DetailsPanel = React.memo( contextID={contextID} expandedHost={currentTabDetail?.params} handleOnHostClosed={closePanel} + isDraggable={isDraggable} isFlyoutView={isFlyoutView} /> ); @@ -103,6 +106,7 @@ export const DetailsPanel = React.memo( contextID={contextID} expandedNetwork={currentTabDetail?.params} handleOnNetworkClosed={closePanel} + isDraggable={isDraggable} isFlyoutView={isFlyoutView} /> ); diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/network_details/expandable_network.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/network_details/expandable_network.tsx index e53e835cfd882..184379cd366b1 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/network_details/expandable_network.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/network_details/expandable_network.tsx @@ -66,7 +66,8 @@ export const ExpandableNetworkDetailsPageLink = ({ export const ExpandableNetworkDetails = ({ contextID, expandedNetwork, -}: ExpandableNetworkProps & { contextID: string }) => { + isDraggable, +}: ExpandableNetworkProps & { contextID: string; isDraggable?: boolean }) => { const { ip, flowTarget } = expandedNetwork; const dispatch = useDispatch(); const { to, from, isInitializing } = useGlobalTime(); @@ -132,6 +133,7 @@ export const ExpandableNetworkDetails = ({ loading={loading} isInDetailsSidePanel isLoadingAnomaliesData={isLoadingAnomaliesData} + isDraggable={isDraggable} type={type} flowTarget={flowTarget} startDate={from} diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/network_details/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/network_details/index.tsx index ea857da926f84..b091e499c9269 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/network_details/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/network_details/index.tsx @@ -62,10 +62,17 @@ interface NetworkDetailsProps { expandedNetwork: { ip: string; flowTarget: FlowTarget }; handleOnNetworkClosed: () => void; isFlyoutView?: boolean; + isDraggable?: boolean; } export const NetworkDetailsPanel = React.memo( - ({ contextID, expandedNetwork, handleOnNetworkClosed, isFlyoutView }: NetworkDetailsProps) => { + ({ + contextID, + expandedNetwork, + handleOnNetworkClosed, + isFlyoutView, + isDraggable, + }: NetworkDetailsProps) => { const { ip } = expandedNetwork; return isFlyoutView ? ( @@ -105,7 +112,11 @@ export const NetworkDetailsPanel = React.memo( - + ); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.test.tsx index addb991af58d7..ee8a275279607 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.test.tsx @@ -144,5 +144,22 @@ describe('reasonColumnRenderer', () => { expect(wrapper.queryByTestId('test-row-render')).toBeInTheDocument(); }); + + it('the popover always contains a class that hides it when an overlay (e.g. the inspect modal) is displayed', () => { + const renderedColumn = reasonColumnRenderer.renderColumn({ + ...defaultProps, + ecsData: validEcs, + rowRenderers, + browserFields, + }); + + const wrapper = render({renderedColumn}); + + fireEvent.click(wrapper.getByTestId('reason-cell-button')); + + expect(wrapper.getByRole('dialog')).toHaveClass( + 'euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--noShadow euiPopover__panel euiPopover__panel--right withHoverActions__popover' + ); + }); }); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.tsx index 00f5fd5717aeb..52483b4853cbc 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.tsx @@ -122,6 +122,7 @@ const ReasonCell: React.FC<{ isOpen={isOpen} anchorPosition="rightCenter" closePopover={handleClosePopOver} + panelClassName="withHoverActions__popover" button={button} > diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/sort/__snapshots__/sort_indicator.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/sort/__snapshots__/sort_indicator.test.tsx.snap index 596a05c4c8ab4..8a7b179da059f 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/sort/__snapshots__/sort_indicator.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/sort/__snapshots__/sort_indicator.test.tsx.snap @@ -5,6 +5,7 @@ exports[`SortIndicator rendering renders correctly against snapshot 1`] = ` content="Sorted descending" data-test-subj="sort-indicator-tooltip" delay="regular" + display="inlineBlock" position="top" > = ({ }, [containerElement, onSkipFocusBeforeEventsTable, onSkipFocusAfterEventsTable] ); + const timelineContext = useMemo(() => ({ timelineId }), [timelineId]); return ( - - - {timelineType === TimelineType.template && ( - {i18n.TIMELINE_TEMPLATE} - )} - - + - - - - - - + + {timelineType === TimelineType.template && ( + {i18n.TIMELINE_TEMPLATE} + )} + + + + + + + + + ); }; diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/query_tab_content/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/timelines/components/timeline/query_tab_content/__snapshots__/index.test.tsx.snap index 5f529ba827c45..26b9eb4729999 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/query_tab_content/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/query_tab_content/__snapshots__/index.test.tsx.snap @@ -274,7 +274,7 @@ In other use cases the message field can be used to concatenate different values ] } kqlMode="search" - kqlQueryExpression="" + kqlQueryExpression=" " onEventClosed={[MockFunction]} renderCellValue={[Function]} rowRenderers={ 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 cd9693313b4f9..2fc8c2149c35b 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 @@ -25,6 +25,7 @@ import { useTimelineEventsDetails } from '../../../containers/details/index'; import { useSourcererScope } from '../../../../common/containers/sourcerer'; import { mockSourcererScope } from '../../../../common/containers/sourcerer/mocks'; import { Direction } from '../../../../../common/search_strategy'; +import * as helpers from '../helpers'; jest.mock('../../../containers/index', () => ({ useTimelineEvents: jest.fn(), @@ -116,7 +117,7 @@ describe('Timeline', () => { itemsPerPage: 5, itemsPerPageOptions: [5, 10, 20], kqlMode: 'search' as QueryTabContentComponentProps['kqlMode'], - kqlQueryExpression: '', + kqlQueryExpression: ' ', onEventClosed: jest.fn(), renderCellValue: DefaultCellRenderer, rowRenderers: defaultRowRenderers, @@ -133,6 +134,27 @@ describe('Timeline', () => { }); describe('rendering', () => { + let spyCombineQueries: jest.SpyInstance; + + beforeEach(() => { + spyCombineQueries = jest.spyOn(helpers, 'combineQueries'); + }); + afterEach(() => { + spyCombineQueries.mockClear(); + }); + + test('should trim kqlQueryExpression', () => { + mount( + + + + ); + + expect(spyCombineQueries.mock.calls[0][0].kqlQuery.query).toEqual( + props.kqlQueryExpression.trim() + ); + }); + test('renders correctly against snapshot', () => { const wrapper = shallow( diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/query_tab_content/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/query_tab_content/index.tsx index abbb991c274da..c150f1a44f196 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/query_tab_content/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/query_tab_content/index.tsx @@ -14,7 +14,7 @@ import { EuiBadge, } from '@elastic/eui'; import { isEmpty } from 'lodash/fp'; -import React, { useState, useMemo, useEffect, useCallback } from 'react'; +import React, { useMemo, useEffect, useCallback } from 'react'; import styled from 'styled-components'; import { Dispatch } from 'redux'; import { connect, ConnectedProps, useDispatch } from 'react-redux'; @@ -60,6 +60,7 @@ import { activeTimeline } from '../../../containers/active_timeline_context'; import { DetailsPanel } from '../../side_panel'; import { ExitFullScreen } from '../../../../common/components/exit_full_screen'; import { defaultControlColumn } from '../body/control_columns'; +import { useDeepEqualSelector } from '../../../../common/hooks/use_selector'; const TimelineHeaderContainer = styled.div` margin-top: 6px; @@ -193,12 +194,24 @@ export const QueryTabContentComponent: React.FC = ({ } = useSourcererScope(SourcererScopeName.timeline); const { uiSettings } = useKibana().services; - const [filterManager] = useState(new FilterManager(uiSettings)); + + const getManageTimeline = useMemo(() => timelineSelectors.getManageTimelineById(), []); + const { filterManager: activeFilterManager } = useDeepEqualSelector((state) => + getManageTimeline(state, timelineId ?? '') + ); + + const filterManager = useMemo(() => activeFilterManager ?? new FilterManager(uiSettings), [ + activeFilterManager, + uiSettings, + ]); + const esQueryConfig = useMemo(() => esQuery.getEsQueryConfig(uiSettings), [uiSettings]); const kqlQuery: { query: string; language: KueryFilterQueryKind; - } = useMemo(() => ({ query: kqlQueryExpression, language: 'kuery' }), [kqlQueryExpression]); + } = useMemo(() => ({ query: kqlQueryExpression.trim(), language: 'kuery' }), [ + kqlQueryExpression, + ]); const combinedQueries = combineQueries({ config: esQueryConfig, @@ -256,7 +269,7 @@ export const QueryTabContentComponent: React.FC = ({ id: timelineId, }) ); - }, [filterManager, timelineId, dispatch]); + }, [activeFilterManager, dispatch, filterManager, timelineId, uiSettings]); const [ isQueryLoading, diff --git a/x-pack/plugins/security_solution/public/timelines/store/timeline/helpers.ts b/x-pack/plugins/security_solution/public/timelines/store/timeline/helpers.ts index 7c07410a2789a..6ee844958aeed 100644 --- a/x-pack/plugins/security_solution/public/timelines/store/timeline/helpers.ts +++ b/x-pack/plugins/security_solution/public/timelines/store/timeline/helpers.ts @@ -156,6 +156,7 @@ export const addTimelineToStore = ({ ...timelineById, [id]: { ...timeline, + filterManager: timelineById[id].filterManager, isLoading: timelineById[id].isLoading, initialized: timelineById[id].initialized, dateRange: diff --git a/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.test.ts b/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.test.ts index c0dcba6920b60..eceafb9b56cdd 100644 --- a/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.test.ts +++ b/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.test.ts @@ -52,6 +52,7 @@ import { TimelineModel } from './model'; import { timelineDefaults } from './defaults'; import { TimelineById } from './types'; import { Direction } from '../../../../common/search_strategy'; +import { FilterManager } from '../../../../../../../src/plugins/data/public'; jest.mock('../../../common/components/url_state/normalize_time_range.ts'); jest.mock('../../../common/utils/default_date_settings', () => { @@ -63,6 +64,8 @@ jest.mock('../../../common/utils/default_date_settings', () => { }; }); +const mockFilterManager = {} as FilterManager; + const basicDataProvider: DataProvider = { and: [], id: '123', @@ -97,6 +100,7 @@ const basicTimeline: TimelineModel = { eventIdToNoteIds: {}, excludedRowRendererIds: [], expandedDetail: {}, + filterManager: mockFilterManager, highlightedDropAndProviderId: '', historyIds: [], id: 'foo', @@ -194,6 +198,20 @@ describe('Timeline', () => { }, }); }); + + test('should contain existing filterManager', () => { + const update = addTimelineToStore({ + id: 'foo', + timeline: { + ...basicTimeline, + status: TimelineStatus.immutable, + timelineType: TimelineType.template, + }, + timelineById: timelineByIdMock, + }); + + expect(update.foo.filterManager).toEqual(mockFilterManager); + }); }); describe('#addNewTimeline', () => { diff --git a/x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts b/x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts index bfa3fe88f7ac8..3fb05c8bf1048 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts +++ b/x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts @@ -11,10 +11,14 @@ import { KbnClient } from '@kbn/test'; import bluebird from 'bluebird'; import { basename } from 'path'; import { TRUSTED_APPS_CREATE_API, TRUSTED_APPS_LIST_API } from '../../../common/endpoint/constants'; -import { NewTrustedApp, OperatingSystem, TrustedApp } from '../../../common/endpoint/types'; +import { TrustedApp } from '../../../common/endpoint/types'; +import { TrustedAppGenerator } from '../../../common/endpoint/data_generators/trusted_app_generator'; +import { indexFleetEndpointPolicy } from '../../../common/endpoint/data_loaders/index_fleet_endpoint_policy'; +import { setupFleetForEndpoint } from '../../../common/endpoint/data_loaders/setup_fleet_for_endpoint'; const defaultLogger = new ToolingLog({ level: 'info', writeTo: process.stdout }); const separator = '----------------------------------------'; +const trustedAppGenerator = new TrustedAppGenerator(); export const cli = async () => { const cliDefaults = { @@ -67,106 +71,62 @@ export const run: (options?: RunOptions) => Promise = async ({ }); // touch the Trusted Apps List so it can be created - await kbnClient.request({ - method: 'GET', - path: TRUSTED_APPS_LIST_API, - }); + // and + // setup fleet with endpoint integrations + logger.info('setting up Fleet with endpoint and creating trusted apps list'); + const [installedEndpointPackage] = await Promise.all([ + setupFleetForEndpoint(kbnClient).then((response) => response.endpointPackage), + + kbnClient.request({ + method: 'GET', + path: TRUSTED_APPS_LIST_API, + }), + ]); + + // Setup a list of read endpoint policies and return a method to randomly select one + const randomPolicyId: () => string = await (async () => { + const randomN = (max: number): number => Math.floor(Math.random() * max); + const policyIds: string[] = []; + + for (let i = 0, t = 5; i < t; i++) { + policyIds.push( + ( + await indexFleetEndpointPolicy( + kbnClient, + `Policy for Trusted App assignment ${i + 1}`, + installedEndpointPackage.version + ) + ).integrationPolicies[0].id + ); + } + + return () => policyIds[randomN(policyIds.length)]; + })(); return bluebird.map( Array.from({ length: count }), - () => - kbnClient + async () => { + const body = trustedAppGenerator.generateTrustedAppForCreate(); + + if (body.effectScope.type === 'policy') { + body.effectScope.policies = [randomPolicyId(), randomPolicyId()]; + } + + return kbnClient .request({ method: 'POST', path: TRUSTED_APPS_CREATE_API, - body: generateTrustedAppEntry(), + body, }) .then(({ data }) => { logger.write(data.id); return data; - }), + }); + }, { concurrency: 10 } ); }; -interface GenerateTrustedAppEntryOptions { - os?: OperatingSystem; - name?: string; -} -const generateTrustedAppEntry: (options?: GenerateTrustedAppEntryOptions) => object = ({ - os = randomOperatingSystem(), - name = randomName(), -} = {}): NewTrustedApp => { - const newTrustedApp: NewTrustedApp = { - description: `Generator says we trust ${name}`, - name, - os, - effectScope: { - type: 'global', - }, - entries: [ - { - // @ts-ignore - field: 'process.hash.*', - operator: 'included', - type: 'match', - value: '1234234659af249ddf3e40864e9fb241', - }, - { - // @ts-ignore - field: 'process.executable.caseless', - operator: 'included', - type: 'match', - value: '/one/two/three', - }, - ], - }; - - return newTrustedApp; -}; - -const randomN = (max: number): number => Math.floor(Math.random() * max); - -const randomName = (() => { - const names = [ - 'Symantec Endpoint Security', - 'Bitdefender GravityZone', - 'Malwarebytes', - 'Sophos Intercept X', - 'Webroot Business Endpoint Protection', - 'ESET Endpoint Security', - 'FortiClient', - 'Kaspersky Endpoint Security', - 'Trend Micro Apex One', - 'CylancePROTECT', - 'VIPRE', - 'Norton', - 'McAfee Endpoint Security', - 'AVG AntiVirus', - 'CrowdStrike Falcon', - 'Avast Business Antivirus', - 'Avira Antivirus', - 'Cisco AMP for Endpoints', - 'Eset Endpoint Antivirus', - 'VMware Carbon Black', - 'Palo Alto Networks Traps', - 'Trend Micro', - 'SentinelOne', - 'Panda Security for Desktops', - 'Microsoft Defender ATP', - ]; - const count = names.length; - - return () => names[randomN(count)]; -})(); - -const randomOperatingSystem = (() => { - const osKeys = Object.keys(OperatingSystem) as Array; - const count = osKeys.length; - - return () => OperatingSystem[osKeys[randomN(count)]]; -})(); - const createRunLogger = () => { let groupCount = 1; let itemCount = 0; diff --git a/x-pack/plugins/security_solution/server/config.test.ts b/x-pack/plugins/security_solution/server/config.test.ts new file mode 100644 index 0000000000000..67956acd6656f --- /dev/null +++ b/x-pack/plugins/security_solution/server/config.test.ts @@ -0,0 +1,80 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { configSchema } from './config'; + +describe('config', () => { + describe('alertIgnoreFields', () => { + test('should default to an empty array', () => { + expect(configSchema.validate({}).alertIgnoreFields).toEqual([]); + }); + + test('should accept an array of strings', () => { + expect( + configSchema.validate({ alertIgnoreFields: ['foo.bar', 'mars.bar'] }).alertIgnoreFields + ).toEqual(['foo.bar', 'mars.bar']); + }); + + test('should throw if a non string is being sent in', () => { + expect( + () => + configSchema.validate({ + alertIgnoreFields: 5, + }).alertIgnoreFields + ).toThrow('[alertIgnoreFields]: expected value of type [array] but got [number]'); + }); + + test('should throw if we send in an invalid regular expression as a string', () => { + expect( + () => + configSchema.validate({ + alertIgnoreFields: ['/(/'], + }).alertIgnoreFields + ).toThrow( + '[alertIgnoreFields]: "Invalid regular expression: /(/: Unterminated group" at array position 0' + ); + }); + + test('should throw with two errors if we send two invalid regular expressions', () => { + expect( + () => + configSchema.validate({ + alertIgnoreFields: ['/(/', '/(invalid/'], + }).alertIgnoreFields + ).toThrow( + '[alertIgnoreFields]: "Invalid regular expression: /(/: Unterminated group" at array position 0. "Invalid regular expression: /(invalid/: Unterminated group" at array position 1' + ); + }); + + test('should throw with two errors with a valid string mixed in if we send two invalid regular expressions', () => { + expect( + () => + configSchema.validate({ + alertIgnoreFields: ['/(/', 'valid.string', '/(invalid/'], + }).alertIgnoreFields + ).toThrow( + '[alertIgnoreFields]: "Invalid regular expression: /(/: Unterminated group" at array position 0. "Invalid regular expression: /(invalid/: Unterminated group" at array position 2' + ); + }); + + test('should accept a valid regular expression within the string', () => { + expect( + configSchema.validate({ + alertIgnoreFields: ['/(.*)/'], + }).alertIgnoreFields + ).toEqual(['/(.*)/']); + }); + + test('should accept two valid regular expressions', () => { + expect( + configSchema.validate({ + alertIgnoreFields: ['/(.*)/', '/(.valid*)/'], + }).alertIgnoreFields + ).toEqual(['/(.*)/', '/(.valid*)/']); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/server/config.ts b/x-pack/plugins/security_solution/server/config.ts index a1c6601520a54..0850e43b21eda 100644 --- a/x-pack/plugins/security_solution/server/config.ts +++ b/x-pack/plugins/security_solution/server/config.ts @@ -21,12 +21,61 @@ export const configSchema = schema.object({ maxRuleImportPayloadBytes: schema.number({ defaultValue: 10485760 }), maxTimelineImportExportSize: schema.number({ defaultValue: 10000 }), maxTimelineImportPayloadBytes: schema.number({ defaultValue: 10485760 }), + + /** + * This is used within the merge strategies: + * server/lib/detection_engine/signals/source_fields_merging + * + * For determining which strategy for merging "fields" and "_source" together to get + * runtime fields, constant keywords, etc... + * + * "missingFields" (default) This will only merge fields that are missing from the _source and exist in the fields. + * "noFields" This will turn off all merging of runtime fields, constant keywords from fields. + * "allFields" This will merge and overwrite anything found within "fields" into "_source" before indexing the data. + */ alertMergeStrategy: schema.oneOf( [schema.literal('allFields'), schema.literal('missingFields'), schema.literal('noFields')], { defaultValue: 'missingFields', } ), + + /** + * This is used within the merge strategies: + * server/lib/detection_engine/signals/source_fields_merging + * + * For determining if we need to ignore particular "fields" and not merge them with "_source" such as + * runtime fields, constant keywords, etc... + * + * This feature and functionality is mostly as "safety feature" meaning that we have had bugs in the past + * where something down the stack unexpectedly ends up in the fields API which causes documents to not + * be indexable. Rather than changing alertMergeStrategy to be "noFields", you can use this array to add + * any problematic values. + * + * You can use plain dotted notation strings such as "host.name" or a regular expression such as "/host\..+/" + */ + alertIgnoreFields: schema.arrayOf(schema.string(), { + defaultValue: [], + validate(ignoreFields) { + const errors = ignoreFields.flatMap((ignoreField, index) => { + if (ignoreField.startsWith('/') && ignoreField.endsWith('/')) { + try { + new RegExp(ignoreField.slice(1, -1)); + return []; + } catch (error) { + return [`"${error.message}" at array position ${index}`]; + } + } else { + return []; + } + }); + if (errors.length !== 0) { + return errors.join('. '); + } else { + return undefined; + } + }, + }), [SIGNALS_INDEX_KEY]: schema.string({ defaultValue: DEFAULT_SIGNALS_INDEX }), /** diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/migrate_artifacts_to_fleet.test.ts b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/migrate_artifacts_to_fleet.test.ts index 2071d4b8c27b7..d6599f2686670 100644 --- a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/migrate_artifacts_to_fleet.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/migrate_artifacts_to_fleet.test.ts @@ -15,14 +15,20 @@ import { SavedObjectsFindResponse, SavedObjectsFindResult, } from 'kibana/server'; +import { elasticsearchServiceMock } from 'src/core/server/mocks'; import { migrateArtifactsToFleet } from './migrate_artifacts_to_fleet'; import { createEndpointArtifactClientMock } from '../../services/artifacts/mocks'; -import { getInternalArtifactMock } from '../../schemas/artifacts/saved_objects.mock'; +import { InternalArtifactCompleteSchema } from '../../schemas'; +import { generateArtifactEsGetSingleHitMock } from '../../../../../fleet/server/services/artifacts/mocks'; +import { NewArtifact } from '../../../../../fleet/server/services'; +import { CreateRequest } from '@elastic/elasticsearch/api/types'; describe('When migrating artifacts to fleet', () => { let soClient: jest.Mocked; let logger: jest.Mocked; let artifactClient: ReturnType; + /** An artifact that was created prior to 7.14 */ + let soArtifactEntry: InternalArtifactCompleteSchema; const createSoFindResult = ( soHits: SavedObjectsFindResult[] = [], @@ -41,6 +47,41 @@ describe('When migrating artifacts to fleet', () => { soClient = savedObjectsClientMock.create() as jest.Mocked; logger = loggingSystemMock.create().get() as jest.Mocked; artifactClient = createEndpointArtifactClientMock(); + // pre-v7.14 artifact, which is compressed + soArtifactEntry = { + identifier: 'endpoint-exceptionlist-macos-v1', + compressionAlgorithm: 'zlib', + encryptionAlgorithm: 'none', + decodedSha256: 'd801aa1fb7ddcc330a5e3173372ea6af4a3d08ec58074478e85aa5603e926658', + encodedSha256: 'f8e6afa1d5662f5b37f83337af774b5785b5b7f1daee08b7b00c2d6813874cda', + decodedSize: 14, + encodedSize: 22, + body: 'eJyrVkrNKynKTC1WsoqOrQUAJxkFKQ==', + }; + + // Mock the esClient create response to include the artifact properties that were provide + // to it by fleet artifact client + artifactClient._esClient.create.mockImplementation((props: CreateRequest) => { + return elasticsearchServiceMock.createSuccessTransportRequestPromise({ + ...generateArtifactEsGetSingleHitMock({ + ...((props?.body ?? {}) as NewArtifact), + }), + _index: '.fleet-artifacts-7', + _id: `endpoint:endpoint-exceptionlist-macos-v1-${ + // @ts-ignore + props?.body?.decodedSha256 ?? 'UNKNOWN?' + }`, + _version: 1, + result: 'created', + _shards: { + total: 1, + successful: 1, + failed: 0, + }, + _seq_no: 0, + _primary_term: 1, + }); + }); soClient.find.mockResolvedValue(createSoFindResult([], 0)).mockResolvedValueOnce( createSoFindResult([ @@ -49,7 +90,7 @@ describe('When migrating artifacts to fleet', () => { type: '', id: 'abc123', references: [], - attributes: await getInternalArtifactMock('windows', 'v1'), + attributes: soArtifactEntry, }, ]) ); @@ -70,6 +111,17 @@ describe('When migrating artifacts to fleet', () => { expect(soClient.delete).toHaveBeenCalled(); }); + it('should create artifact in fleet with attributes that match the SO version', async () => { + await migrateArtifactsToFleet(soClient, artifactClient, logger); + + await expect(artifactClient.createArtifact.mock.results[0].value).resolves.toEqual( + expect.objectContaining({ + ...soArtifactEntry, + compressionAlgorithm: 'zlib', + }) + ); + }); + it('should ignore 404 responses for SO delete (multi-node kibana setup)', async () => { const notFoundError: Error & { output?: { statusCode: number } } = new Error('not found'); notFoundError.output = { statusCode: 404 }; diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/migrate_artifacts_to_fleet.ts b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/migrate_artifacts_to_fleet.ts index 4518e23bb7fea..07edfce24affd 100644 --- a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/migrate_artifacts_to_fleet.ts +++ b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/migrate_artifacts_to_fleet.ts @@ -5,9 +5,11 @@ * 2.0. */ +import { inflate as _inflate } from 'zlib'; +import { promisify } from 'util'; import { SavedObjectsClient, Logger } from 'kibana/server'; import { EndpointArtifactClientInterface } from '../../services'; -import { InternalArtifactCompleteSchema } from '../../schemas'; +import { InternalArtifactCompleteSchema, InternalArtifactSchema } from '../../schemas'; import { ArtifactConstants } from './common'; class ArtifactMigrationError extends Error { @@ -16,6 +18,12 @@ class ArtifactMigrationError extends Error { } } +const inflateAsync = promisify(_inflate); + +function isCompressed(artifact: InternalArtifactSchema) { + return artifact.compressionAlgorithm === 'zlib'; +} + /** * With v7.13, artifact storage was moved from a security_solution saved object to a fleet index * in order to support Fleet Server. @@ -57,6 +65,15 @@ export const migrateArtifactsToFleet = async ( } for (const artifact of artifactList) { + if (isCompressed(artifact.attributes)) { + artifact.attributes = { + ...artifact.attributes, + body: (await inflateAsync(Buffer.from(artifact.attributes.body, 'base64'))).toString( + 'base64' + ), + }; + } + // Create new artifact in fleet index await endpointArtifactClient.createArtifact(artifact.attributes); // Delete old artifact from SO and if there are errors here, then ignore 404's diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.test.ts b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.test.ts index b6fd384cdd646..a9e30e64a003b 100644 --- a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.test.ts @@ -16,6 +16,8 @@ import { ManifestManager } from '../../services/artifacts/manifest_manager'; import { buildManifestManagerMock } from '../../services/artifacts/manifest_manager/manifest_manager.mock'; import { InternalArtifactCompleteSchema } from '../../schemas/artifacts'; import { getMockArtifacts } from './mocks'; +import { InvalidInternalManifestError } from '../../services/artifacts/errors'; +import { loggingSystemMock } from '../../../../../../../src/core/server/mocks'; describe('task', () => { const MOCK_TASK_INSTANCE = { @@ -78,8 +80,9 @@ describe('task', () => { }); describe('Artifacts generation flow tests', () => { + let mockContext: ReturnType; + const runTask = async (manifestManager: ManifestManager) => { - const mockContext = createMockEndpointAppContext(); const mockTaskManager = taskManagerMock.createSetup(); const manifestTaskInstance = new ManifestTask({ @@ -112,6 +115,10 @@ describe('task', () => { ARTIFACT_TRUSTED_APPS_MACOS = artifacts[2]; }); + beforeEach(() => { + mockContext = createMockEndpointAppContext(); + }); + test('Should not run the process when no current manifest manager', async () => { const manifestManager = buildManifestManagerMock(); @@ -144,6 +151,25 @@ describe('task', () => { expect(manifestManager.deleteArtifacts).not.toHaveBeenCalled(); }); + test('Should recover if last Computed Manifest threw an InvalidInternalManifestError error', async () => { + const manifestManager = buildManifestManagerMock(); + const logger = loggingSystemMock.createLogger(); + const newManifest = ManifestManager.createDefaultManifest(); + + manifestManager.buildNewManifest = jest.fn().mockRejectedValue(newManifest); + mockContext.logFactory.get = jest.fn().mockReturnValue(logger); + manifestManager.getLastComputedManifest = jest.fn(async () => { + throw new InvalidInternalManifestError( + 'Internal Manifest map SavedObject is missing version' + ); + }); + + await runTask(manifestManager); + + expect(logger.info).toHaveBeenCalledWith('recovering from invalid internal manifest'); + expect(logger.error).toHaveBeenNthCalledWith(1, expect.any(InvalidInternalManifestError)); + }); + test('Should not bump version and commit manifest when no diff in the manifest', async () => { const manifestManager = buildManifestManagerMock(); diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.ts b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.ts index 8588a30aceb89..6a89c50b86973 100644 --- a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.ts +++ b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.ts @@ -14,7 +14,11 @@ import { import { EndpointAppContext } from '../../types'; import { getArtifactId, reportErrors } from './common'; import { InternalArtifactCompleteSchema } from '../../schemas/artifacts'; -import { isEmptyManifestDiff } from './manifest'; +import { isEmptyManifestDiff, Manifest } from './manifest'; +import { InvalidInternalManifestError } from '../../services/artifacts/errors'; +import { ManifestManager } from '../../services'; +import { wrapErrorIfNeeded } from '../../utils'; +import { EndpointError } from '../../errors'; export const ManifestTaskConstants = { TIMEOUT: '1m', @@ -87,7 +91,7 @@ export class ManifestTask { params: { version: ManifestTaskConstants.VERSION }, }); } catch (e) { - this.logger.debug(`Error scheduling task, received ${e.message}`); + this.logger.error(new EndpointError(`Error scheduling task, received ${e.message}`, e)); } }; @@ -112,15 +116,27 @@ export class ManifestTask { const manifestManager = this.endpointAppContext.service.getManifestManager(); if (manifestManager === undefined) { - this.logger.debug('Manifest Manager not available.'); + this.logger.error('Manifest Manager not available.'); return; } try { - // Last manifest we computed, which was saved to ES - const oldManifest = await manifestManager.getLastComputedManifest(); - if (oldManifest == null) { - this.logger.debug('User manifest not available yet.'); + let oldManifest: Manifest | null; + + try { + // Last manifest we computed, which was saved to ES + oldManifest = await manifestManager.getLastComputedManifest(); + } catch (e) { + // Lets recover from a failure in getting the internal manifest map by creating an empty default manifest + if (e instanceof InvalidInternalManifestError) { + this.logger.error(e); + this.logger.info('recovering from invalid internal manifest'); + oldManifest = ManifestManager.createDefaultManifest(); + } + } + + if (oldManifest! == null) { + this.logger.debug('Last computed manifest not available yet'); return; } @@ -159,7 +175,7 @@ export class ManifestTask { reportErrors(this.logger, deleteErrors); } } catch (err) { - this.logger.error(err); + this.logger.error(wrapErrorIfNeeded(err)); } }; } diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/audit_log.test.ts b/x-pack/plugins/security_solution/server/endpoint/routes/actions/audit_log.test.ts index 83f38bc904576..4bd63c83169e5 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/actions/audit_log.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/actions/audit_log.test.ts @@ -48,19 +48,13 @@ describe('Action Log API', () => { }).not.toThrow(); }); - it('should work without query params', () => { + it('should not work when no params while requesting with query params', () => { expect(() => { EndpointActionLogRequestSchema.query.validate({}); - }).not.toThrow(); - }); - - it('should work with query params', () => { - expect(() => { - EndpointActionLogRequestSchema.query.validate({ page: 10, page_size: 100 }); - }).not.toThrow(); + }).toThrow(); }); - it('should work with all query params', () => { + it('should work with all required query params', () => { expect(() => { EndpointActionLogRequestSchema.query.validate({ page: 10, @@ -71,24 +65,24 @@ describe('Action Log API', () => { }).not.toThrow(); }); - it('should work with just startDate', () => { + it('should not work without endDate', () => { expect(() => { EndpointActionLogRequestSchema.query.validate({ page: 1, page_size: 100, start_date: new Date(new Date().setDate(new Date().getDate() - 1)).toISOString(), // yesterday }); - }).not.toThrow(); + }).toThrow(); }); - it('should work with just endDate', () => { + it('should not work without startDate', () => { expect(() => { EndpointActionLogRequestSchema.query.validate({ page: 1, page_size: 100, end_date: new Date().toISOString(), // today }); - }).not.toThrow(); + }).toThrow(); }); it('should not work without allowed page and page_size params', () => { diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.test.ts b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.test.ts index 5b1c0f5c3deb3..156bcd0de2cc9 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.test.ts @@ -337,14 +337,7 @@ describe('handlers', () => { describe('getTrustedAppsSummaryHandler', () => { let getTrustedAppsSummaryHandler: ReturnType; - - beforeEach(() => { - getTrustedAppsSummaryHandler = getTrustedAppsSummaryRouteHandler(appContextMock); - }); - - it('should return ok with list when no errors', async () => { - const mockResponse = httpServerMock.createResponseFactory(); - + const getExceptionsListClientMokcResolvedValue = () => { exceptionsListClient.findExceptionListItem.mockResolvedValue({ data: [ // Linux === 5 @@ -373,6 +366,16 @@ describe('handlers', () => { per_page: 100, total: 23, }); + }; + + beforeEach(() => { + getTrustedAppsSummaryHandler = getTrustedAppsSummaryRouteHandler(appContextMock); + }); + + it('should return ok with list when no errors', async () => { + const mockResponse = httpServerMock.createResponseFactory(); + + getExceptionsListClientMokcResolvedValue(); await getTrustedAppsSummaryHandler( createHandlerContextMock(), @@ -388,6 +391,31 @@ describe('handlers', () => { }); }); + it('should return ok with list when no errors filtering by policyId', async () => { + const mockResponse = httpServerMock.createResponseFactory(); + + const policyId = 'caf1a334-53f3-4be9-814d-a32245f43d34'; + + getExceptionsListClientMokcResolvedValue(); + + await getTrustedAppsSummaryHandler( + createHandlerContextMock(), + httpServerMock.createKibanaRequest({ + query: { + kuery: `exception-list-agnostic.attributes.tags:"policy:${policyId}" OR exception-list-agnostic.attributes.tags:"policy:all"`, + }, + }), + mockResponse + ); + + assertResponse(mockResponse, 'ok', { + linux: 5, + macos: 3, + windows: 15, + total: 23, + }); + }); + it('should return internalError when errors happen', async () => { const mockResponse = httpServerMock.createResponseFactory(); const error = new Error('Something went wrong'); diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.ts b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.ts index 05194dc856d58..13282bfacd5b1 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.ts @@ -17,6 +17,7 @@ import { PostTrustedAppCreateRequest, PutTrustedAppsRequestParams, PutTrustedAppUpdateRequest, + GetTrustedAppsSummaryRequest, } from '../../../../common/endpoint/types'; import { EndpointAppContext } from '../../types'; @@ -216,13 +217,18 @@ export const getTrustedAppsUpdateRouteHandler = ( export const getTrustedAppsSummaryRouteHandler = ( endpointAppContext: EndpointAppContext -): RequestHandler => { +): RequestHandler< + unknown, + GetTrustedAppsSummaryRequest, + unknown, + SecuritySolutionRequestHandlerContext +> => { const logger = endpointAppContext.logFactory.get('trusted_apps'); return async (context, req, res) => { try { return res.ok({ - body: await getTrustedAppsSummary(exceptionListClientFromContext(context)), + body: await getTrustedAppsSummary(exceptionListClientFromContext(context), req.query), }); } catch (error) { return errorHandler(logger, res, error); diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/index.ts b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/index.ts index 4e61f14408f47..1d5df9c6e88b8 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/index.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/index.ts @@ -11,6 +11,7 @@ import { GetTrustedAppsRequestSchema, PostTrustedAppCreateRequestSchema, PutTrustedAppUpdateRequestSchema, + GetTrustedAppsSummaryRequestSchema, } from '../../../../common/endpoint/schema/trusted_apps'; import { TRUSTED_APPS_CREATE_API, @@ -90,7 +91,7 @@ export const registerTrustedAppsRoutes = ( router.get( { path: TRUSTED_APPS_SUMMARY_API, - validate: false, + validate: GetTrustedAppsSummaryRequestSchema, options: { authRequired: true }, }, getTrustedAppsSummaryRouteHandler(endpointAppContext) diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.ts b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.ts index 8558f9a24d213..2c085c14db009 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.ts @@ -12,9 +12,9 @@ import type { EntryMatch, EntryMatchWildcard, EntryNested, + ExceptionListItemSchema, NestedEntriesArray, OsType, - ExceptionListItemSchema, } from '@kbn/securitysolution-io-ts-list-types'; import { ENDPOINT_TRUSTED_APPS_LIST_ID } from '@kbn/securitysolution-list-constants'; @@ -29,9 +29,13 @@ import { NewTrustedApp, OperatingSystem, TrustedApp, - UpdateTrustedApp, TrustedAppEntryTypes, + UpdateTrustedApp, } from '../../../../common/endpoint/types'; +import { + POLICY_REFERENCE_PREFIX, + tagsToEffectScope, +} from '../../../../common/endpoint/service/trusted_apps/mapping'; type ConditionEntriesMap = { [K in ConditionEntryField]?: ConditionEntry }; type Mapping = { [K in T]: U }; @@ -48,7 +52,6 @@ const OPERATING_SYSTEM_TO_OS_TYPE: Mapping = { [OperatingSystem.WINDOWS]: 'windows', }; -const POLICY_REFERENCE_PREFIX = 'policy:'; const OPERATOR_VALUE = 'included'; const filterUndefined = (list: Array): T[] => { @@ -63,21 +66,6 @@ export const createConditionEntry = ( return { field, value, type, operator: OPERATOR_VALUE }; }; -export const tagsToEffectScope = (tags: string[]): EffectScope => { - const policyReferenceTags = tags.filter((tag) => tag.startsWith(POLICY_REFERENCE_PREFIX)); - - if (policyReferenceTags.some((tag) => tag === `${POLICY_REFERENCE_PREFIX}all`)) { - return { - type: 'global', - }; - } else { - return { - type: 'policy', - policies: policyReferenceTags.map((tag) => tag.substr(POLICY_REFERENCE_PREFIX.length)), - }; - } -}; - export const entriesToConditionEntriesMap = (entries: EntriesArray): ConditionEntriesMap => { return entries.reduce((result, entry) => { if (entry.field.startsWith('process.hash') && entry.type === 'match') { diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.test.ts b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.test.ts index ea3354a650521..3323080851801 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.test.ts @@ -274,7 +274,20 @@ describe('service', () => { }); it('should return summary of trusted app items', async () => { - expect(await getTrustedAppsSummary(exceptionsListClient)).toEqual({ + expect(await getTrustedAppsSummary(exceptionsListClient, {})).toEqual({ + linux: 45, + windows: 55, + macos: 30, + total: 130, + }); + }); + + it('should return summary of trusted app items when filtering by policyId', async () => { + expect( + await getTrustedAppsSummary(exceptionsListClient, { + kuery: `exception-list-agnostic.attributes.tags:"policy:caf1a334-53f3-4be9-814d-a32245f43d34" OR exception-list-agnostic.attributes.tags:"policy:all"`, + }) + ).toEqual({ linux: 45, windows: 55, macos: 30, diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.ts b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.ts index cfadaa98ad466..a427f13859f03 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/service.ts @@ -21,6 +21,7 @@ import { PostTrustedAppCreateResponse, PutTrustedAppUpdateRequest, PutTrustedAppUpdateResponse, + GetTrustedAppsSummaryRequest, } from '../../../../common/endpoint/types'; import { @@ -205,11 +206,11 @@ export const updateTrustedApp = async ( }; export const getTrustedAppsSummary = async ( - exceptionsListClient: ExceptionListClient + exceptionsListClient: ExceptionListClient, + { kuery }: GetTrustedAppsSummaryRequest ): Promise => { // Ensure list is created if it does not exist await exceptionsListClient.createTrustedAppsList(); - const summary = { linux: 0, windows: 0, @@ -225,7 +226,7 @@ export const getTrustedAppsSummary = async ( listId: ENDPOINT_TRUSTED_APPS_LIST_ID, page, perPage, - filter: undefined, + filter: kuery, namespaceType: 'agnostic', sortField: undefined, sortOrder: undefined, diff --git a/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.ts b/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.ts index 675ed41e394aa..0bb32cc10e571 100644 --- a/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.ts +++ b/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.ts @@ -73,6 +73,10 @@ export const internalManifestSchema = t.exact( semanticVersion, }) ); + +/** + * The Internal map of all artifacts that the ManifestManager knows about and is managing + */ export type InternalManifestSchema = t.TypeOf; export const internalManifestCreateSchema = t.intersection([ diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions.ts b/x-pack/plugins/security_solution/server/endpoint/services/actions.ts index 80fb1c5d9c7b0..a04a6eea5ab65 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/actions.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/actions.ts @@ -31,8 +31,8 @@ export const getAuditLogResponse = async ({ elasticAgentId: string; page: number; pageSize: number; - startDate?: string; - endDate?: string; + startDate: string; + endDate: string; context: SecuritySolutionRequestHandlerContext; logger: Logger; }): Promise => { @@ -71,8 +71,8 @@ const getActivityLog = async ({ elasticAgentId: string; size: number; from: number; - startDate?: string; - endDate?: string; + startDate: string; + endDate: string; logger: Logger; }) => { const options = { @@ -84,13 +84,10 @@ const getActivityLog = async ({ let actionsResult; let responsesResult; - const dateFilters = []; - if (startDate) { - dateFilters.push({ range: { '@timestamp': { gte: startDate } } }); - } - if (endDate) { - dateFilters.push({ range: { '@timestamp': { lte: endDate } } }); - } + const dateFilters = [ + { range: { '@timestamp': { gte: startDate } } }, + { range: { '@timestamp': { lte: endDate } } }, + ]; try { // fetch actions with matching agent_id diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/errors.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/errors.ts new file mode 100644 index 0000000000000..1810c46ef4313 --- /dev/null +++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EndpointError } from '../../errors'; + +/** + * Indicates that the internal manifest that is managed by ManifestManager is invalid or contains + * invalid data + */ +export class InvalidInternalManifestError extends EndpointError {} diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.test.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.test.ts index e3dc66c20bb67..340137a530e6d 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.test.ts @@ -37,6 +37,8 @@ import { import { ManifestManager } from './manifest_manager'; import { EndpointArtifactClientInterface } from '../artifact_client'; +import { EndpointError } from '../../../errors'; +import { InvalidInternalManifestError } from '../errors'; const getArtifactObject = (artifact: InternalArtifactSchema) => JSON.parse(Buffer.from(artifact.body!, 'base64').toString()); @@ -104,11 +106,13 @@ describe('ManifestManager', () => { const manifestManager = new ManifestManager( buildManifestManagerContextMock({ savedObjectsClient }) ); - const error = { output: { statusCode: 500 } }; + const error = { message: 'bad request', output: { statusCode: 500 } }; savedObjectsClient.get = jest.fn().mockRejectedValue(error); - await expect(manifestManager.getLastComputedManifest()).rejects.toStrictEqual(error); + await expect(manifestManager.getLastComputedManifest()).rejects.toThrow( + new EndpointError('bad request', error) + ); }); test('Throws error when no version on the manifest', async () => { @@ -120,7 +124,7 @@ describe('ManifestManager', () => { savedObjectsClient.get = jest.fn().mockResolvedValue({}); await expect(manifestManager.getLastComputedManifest()).rejects.toStrictEqual( - new Error('No version returned for manifest.') + new InvalidInternalManifestError('Internal Manifest map SavedObject is missing version') ); }); @@ -208,6 +212,59 @@ describe('ManifestManager', () => { new Set([TEST_POLICY_ID_1, TEST_POLICY_ID_2]) ); }); + + test("Retrieve non empty manifest and skips over artifacts that can't be found", async () => { + const savedObjectsClient = savedObjectsClientMock.create(); + const manifestManagerContext = buildManifestManagerContextMock({ savedObjectsClient }); + const manifestManager = new ManifestManager(manifestManagerContext); + + savedObjectsClient.get = jest + .fn() + .mockImplementation(async (objectType: string, id: string) => { + if (objectType === ManifestConstants.SAVED_OBJECT_TYPE) { + return { + attributes: { + created: '20-01-2020 10:00:00.000Z', + schemaVersion: 'v2', + semanticVersion: '1.0.0', + artifacts: [ + { artifactId: ARTIFACT_ID_EXCEPTIONS_MACOS, policyId: undefined }, + { artifactId: ARTIFACT_ID_EXCEPTIONS_WINDOWS, policyId: undefined }, + { artifactId: ARTIFACT_ID_EXCEPTIONS_LINUX, policyId: undefined }, + { artifactId: ARTIFACT_ID_EXCEPTIONS_WINDOWS, policyId: TEST_POLICY_ID_1 }, + { artifactId: ARTIFACT_ID_TRUSTED_APPS_MACOS, policyId: TEST_POLICY_ID_1 }, + { artifactId: ARTIFACT_ID_TRUSTED_APPS_WINDOWS, policyId: TEST_POLICY_ID_1 }, + { artifactId: ARTIFACT_ID_TRUSTED_APPS_WINDOWS, policyId: TEST_POLICY_ID_2 }, + ], + }, + version: '2.0.0', + }; + } else { + return null; + } + }); + + (manifestManagerContext.artifactClient as jest.Mocked).getArtifact.mockImplementation( + async (id) => { + // report the MACOS Exceptions artifact as not found + return id === ARTIFACT_ID_EXCEPTIONS_MACOS ? undefined : ARTIFACTS_BY_ID[id]; + } + ); + + const manifest = await manifestManager.getLastComputedManifest(); + + expect(manifest?.getAllArtifacts()).toStrictEqual(ARTIFACTS.slice(1, 5)); + + expect(manifestManagerContext.logger.error).toHaveBeenCalledWith( + new InvalidInternalManifestError( + `artifact id [${ARTIFACT_ID_EXCEPTIONS_MACOS}] not found!`, + { + entry: ARTIFACTS_BY_ID[ARTIFACT_ID_EXCEPTIONS_MACOS], + action: 'removed from internal ManifestManger tracking map', + } + ) + ); + }); }); describe('buildNewManifest', () => { @@ -565,7 +622,10 @@ describe('ManifestManager', () => { ) ).resolves.toStrictEqual([ error, - new Error(`Incomplete artifact: ${ARTIFACT_ID_TRUSTED_APPS_MACOS}`), + new EndpointError( + `Incomplete artifact: ${ARTIFACT_ID_TRUSTED_APPS_MACOS}`, + ARTIFACTS_BY_ID[ARTIFACT_ID_TRUSTED_APPS_MACOS] + ), ]); expect(artifactClient.createArtifact).toHaveBeenCalledTimes(2); @@ -720,7 +780,7 @@ describe('ManifestManager', () => { ]); await expect(manifestManager.tryDispatch(manifest)).resolves.toStrictEqual([ - new Error(`Package Policy ${TEST_POLICY_ID_1} has no config.`), + new EndpointError(`Package Policy ${TEST_POLICY_ID_1} has no 'inputs[0].config'`), ]); expect(context.packagePolicyService.update).toHaveBeenCalledTimes(0); diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts index f2d1d3660d78e..4c69aa1dd0737 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts @@ -34,6 +34,9 @@ import { import { EndpointArtifactClientInterface } from '../artifact_client'; import { ManifestClient } from '../manifest_client'; import { ExperimentalFeatures } from '../../../../../common/experimental_features'; +import { InvalidInternalManifestError } from '../errors'; +import { wrapErrorIfNeeded } from '../../../utils'; +import { EndpointError } from '../../../errors'; interface ArtifactsBuildResult { defaultArtifacts: InternalArtifactCompleteSchema[]; @@ -282,7 +285,7 @@ export class ManifestManager { newManifest.replaceArtifact(fleetArtifact); } } else { - errors.push(new Error(`Incomplete artifact: ${getArtifactId(artifact)}`)); + errors.push(new EndpointError(`Incomplete artifact: ${getArtifactId(artifact)}`, artifact)); } } return errors; @@ -310,8 +313,8 @@ export class ManifestManager { } /** - * Returns the last computed manifest based on the state of the - * user-artifact-manifest SO. + * Returns the last computed manifest based on the state of the user-artifact-manifest SO. If no + * artifacts have been created yet (ex. no Endpoint policies are in use), then method return `null` * * @returns {Promise} The last computed manifest, or null if does not exist. * @throws Throws/rejects if there is an unexpected error retrieving the manifest. @@ -321,7 +324,10 @@ export class ManifestManager { const manifestSo = await this.getManifestClient().getManifest(); if (manifestSo.version === undefined) { - throw new Error('No version returned for manifest.'); + throw new InvalidInternalManifestError( + 'Internal Manifest map SavedObject is missing version', + manifestSo + ); } const manifest = new Manifest({ @@ -334,16 +340,21 @@ export class ManifestManager { const artifact = await this.artifactClient.getArtifact(entry.artifactId); if (!artifact) { - throw new Error(`artifact id [${entry.artifactId}] not found!`); + this.logger.error( + new InvalidInternalManifestError(`artifact id [${entry.artifactId}] not found!`, { + entry, + action: 'removed from internal ManifestManger tracking map', + }) + ); + } else { + manifest.addEntry(artifact, entry.policyId); } - - manifest.addEntry(artifact, entry.policyId); } return manifest; } catch (error) { if (!error.output || error.output.statusCode !== 404) { - throw error; + throw wrapErrorIfNeeded(error); } return null; } @@ -381,7 +392,10 @@ export class ManifestManager { await iterateArtifactsBuildResult(result, async (artifact, policyId) => { const artifactToAdd = baselineManifest.getArtifact(getArtifactId(artifact)) || artifact; if (!internalArtifactCompleteSchema.is(artifactToAdd)) { - throw new Error(`Incomplete artifact detected: ${getArtifactId(artifactToAdd)}`); + throw new EndpointError( + `Incomplete artifact detected: ${getArtifactId(artifactToAdd)}`, + artifactToAdd + ); } manifest.addEntry(artifactToAdd, policyId); @@ -416,7 +430,12 @@ export class ManifestManager { const serializedManifest = manifest.toPackagePolicyManifest(packagePolicy.id); if (!manifestDispatchSchema.is(serializedManifest)) { - errors.push(new Error(`Invalid manifest for policy ${packagePolicy.id}`)); + errors.push( + new EndpointError( + `Invalid manifest for policy ${packagePolicy.id}`, + serializedManifest + ) + ); } else if (!manifestsEqual(serializedManifest, oldManifest.value)) { newPackagePolicy.inputs[0].config.artifact_manifest = { value: serializedManifest }; @@ -443,7 +462,9 @@ export class ManifestManager { this.logger.debug(`No change in manifest version for package policy: ${id}`); } } else { - errors.push(new Error(`Package Policy ${id} has no config.`)); + errors.push( + new EndpointError(`Package Policy ${id} has no 'inputs[0].config'`, newPackagePolicy) + ); } } ); diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/mocks.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/mocks.ts index 18be9f299c15c..e2a4f9a3f5356 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/mocks.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/mocks.ts @@ -8,7 +8,14 @@ import { SavedObjectsClientContract } from 'src/core/server'; import { savedObjectsClientMock } from 'src/core/server/mocks'; import { ManifestClient } from './manifest_client'; -import { EndpointArtifactClientInterface } from './artifact_client'; +import { EndpointArtifactClient, EndpointArtifactClientInterface } from './artifact_client'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { ElasticsearchClientMock } from '../../../../../../../src/core/server/elasticsearch/client/mocks'; +import { elasticsearchServiceMock } from '../../../../../../../src/core/server/mocks'; +// Because mocks are for testing only, should be ok to import the FleetArtifactsClient directly +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { FleetArtifactsClient } from '../../../../../fleet/server/services'; +import { createArtifactsClientMock } from '../../../../../fleet/server/mocks'; export const getManifestClientMock = ( savedObjectsClient?: SavedObjectsClientContract @@ -19,10 +26,29 @@ export const getManifestClientMock = ( return new ManifestClient(savedObjectsClientMock.create(), 'v1'); }; -export const createEndpointArtifactClientMock = (): jest.Mocked => { +/** + * Returns back a mocked EndpointArtifactClient along with the internal FleetArtifactsClient and the Es Clients that are being used + * @param esClient + */ +export const createEndpointArtifactClientMock = ( + esClient: ElasticsearchClientMock = elasticsearchServiceMock.createScopedClusterClient() + .asInternalUser +): jest.Mocked & { + _esClient: ElasticsearchClientMock; +} => { + const fleetArtifactClientMocked = createArtifactsClientMock(); + const endpointArtifactClientMocked = new EndpointArtifactClient(fleetArtifactClientMocked); + + // Return the interface mocked with jest.fn() that fowards calls to the real instance return { - createArtifact: jest.fn(), - getArtifact: jest.fn(), - deleteArtifact: jest.fn(), + createArtifact: jest.fn(async (...args) => { + const fleetArtifactClient = new FleetArtifactsClient(esClient, 'endpoint'); + const endpointArtifactClient = new EndpointArtifactClient(fleetArtifactClient); + const response = await endpointArtifactClient.createArtifact(...args); + return response; + }), + getArtifact: jest.fn((...args) => endpointArtifactClientMocked.getArtifact(...args)), + deleteArtifact: jest.fn((...args) => endpointArtifactClientMocked.deleteArtifact(...args)), + _esClient: esClient, }; }; diff --git a/x-pack/plugins/security_solution/server/endpoint/utils/wrap_errors.ts b/x-pack/plugins/security_solution/server/endpoint/utils/wrap_errors.ts index 475cd42bc802c..5ff4307574fcd 100644 --- a/x-pack/plugins/security_solution/server/endpoint/utils/wrap_errors.ts +++ b/x-pack/plugins/security_solution/server/endpoint/utils/wrap_errors.ts @@ -11,8 +11,9 @@ import { EndpointError } from '../errors'; * Will wrap the given Error with `EndpointError`, which will help getting a good picture of where in * our code the error originated (better stack trace). */ -export const wrapErrorIfNeeded = (error: Error): EndpointError => - error instanceof EndpointError ? error : new EndpointError(error.message, error); +export const wrapErrorIfNeeded = (error: Error): E => { + return (error instanceof EndpointError ? error : new EndpointError(error.message, error)) as E; +}; /** * used as the callback to `Promise#catch()` to ensure errors diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/schedule_throttle_notification_actions.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/schedule_throttle_notification_actions.test.ts index de62c6b211400..2e5e331b71b00 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/schedule_throttle_notification_actions.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/schedule_throttle_notification_actions.test.ts @@ -53,6 +53,7 @@ describe('schedule_throttle_notification_actions', () => { to: 'now', type: 'query', references: ['http://www.example.com'], + namespace: 'a namespace', note: '# sample markdown', version: 1, exceptionsList: [], diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/index.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/index.ts index a768273c9d147..1ac85f9a27969 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/index.ts @@ -26,6 +26,7 @@ export const createMockConfig = (): ConfigType => ({ endpointResultListDefaultPageSize: 10, packagerTaskInterval: '60s', alertMergeStrategy: 'missingFields', + alertIgnoreFields: [], prebuiltRulesFromFileSystem: true, prebuiltRulesFromSavedObjects: false, }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_responses.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_responses.ts index a7eff049d0d9e..97d976d337564 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_responses.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_responses.ts @@ -39,6 +39,7 @@ import { getQueryRuleParams } from '../../schemas/rule_schemas.mock'; import { getPerformBulkActionSchemaMock } from '../../../../../common/detection_engine/schemas/request/perform_bulk_action_schema.mock'; import { RuleExecutionStatus } from '../../../../../common/detection_engine/schemas/common/schemas'; import { FindBulkExecutionLogResponse } from '../../rule_execution_log/types'; +import { ruleTypeMappings } from '../../signals/utils'; export const typicalSetStatusSignalByIdsPayload = (): SetSignalsStatusSchemaDecoded => ({ signal_ids: ['somefakeid1', 'somefakeid2'], @@ -179,18 +180,18 @@ export const getEmptyFindResult = (): FindHit => ({ data: [], }); -export const getFindResultWithSingleHit = (): FindHit => ({ +export const getFindResultWithSingleHit = (isRuleRegistryEnabled: boolean): FindHit => ({ page: 1, perPage: 1, total: 1, - data: [getAlertMock(getQueryRuleParams())], + data: [getAlertMock(isRuleRegistryEnabled, getQueryRuleParams())], }); -export const nonRuleFindResult = (): FindHit => ({ +export const nonRuleFindResult = (isRuleRegistryEnabled: boolean): FindHit => ({ page: 1, perPage: 1, total: 1, - data: [nonRuleAlert()], + data: [nonRuleAlert(isRuleRegistryEnabled)], }); export const getFindResultWithMultiHits = ({ @@ -348,19 +349,22 @@ export const createActionResult = (): ActionResult => ({ isPreconfigured: false, }); -export const nonRuleAlert = () => ({ +export const nonRuleAlert = (isRuleRegistryEnabled: boolean) => ({ // Defaulting to QueryRuleParams because ts doesn't like empty objects - ...getAlertMock(getQueryRuleParams()), + ...getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()), id: '04128c15-0d1b-4716-a4c5-46997ac7f3bc', name: 'Non-Rule Alert', alertTypeId: 'something', }); -export const getAlertMock = (params: T): Alert => ({ +export const getAlertMock = ( + isRuleRegistryEnabled: boolean, + params: T +): Alert => ({ id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd', name: 'Detect Root/Admin Users', tags: [`${INTERNAL_RULE_ID_KEY}:rule-1`, `${INTERNAL_IMMUTABLE_KEY}:false`], - alertTypeId: 'siem.signals', + alertTypeId: isRuleRegistryEnabled ? ruleTypeMappings[params.type] : 'siem.signals', consumer: 'siem', params, createdAt: new Date('2019-12-13T16:40:33.400Z'), diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/__snapshots__/get_signals_template.test.ts.snap b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/__snapshots__/get_signals_template.test.ts.snap index 3c065ab0ac109..1d4e84ea5dccf 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/__snapshots__/get_signals_template.test.ts.snap +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/__snapshots__/get_signals_template.test.ts.snap @@ -1,5 +1,609 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`get_signals_template backwards compatibility mappings for version 45 should match snapshot 1`] = ` +Object { + "_meta": Object { + "aliases_version": 1, + "version": 45, + }, + "properties": Object { + "kibana.alert.ancestors.depth": Object { + "path": "signal.ancestors.depth", + "type": "alias", + }, + "kibana.alert.ancestors.id": Object { + "path": "signal.ancestors.id", + "type": "alias", + }, + "kibana.alert.ancestors.index": Object { + "path": "signal.ancestors.index", + "type": "alias", + }, + "kibana.alert.ancestors.type": Object { + "path": "signal.ancestors.type", + "type": "alias", + }, + "kibana.alert.depth": Object { + "path": "signal.depth", + "type": "alias", + }, + "kibana.alert.original_event.action": Object { + "path": "signal.original_event.action", + "type": "alias", + }, + "kibana.alert.original_event.category": Object { + "path": "signal.original_event.category", + "type": "alias", + }, + "kibana.alert.original_event.code": Object { + "path": "signal.original_event.code", + "type": "alias", + }, + "kibana.alert.original_event.created": Object { + "path": "signal.original_event.created", + "type": "alias", + }, + "kibana.alert.original_event.dataset": Object { + "path": "signal.original_event.dataset", + "type": "alias", + }, + "kibana.alert.original_event.duration": Object { + "path": "signal.original_event.duration", + "type": "alias", + }, + "kibana.alert.original_event.end": Object { + "path": "signal.original_event.end", + "type": "alias", + }, + "kibana.alert.original_event.hash": Object { + "path": "signal.original_event.hash", + "type": "alias", + }, + "kibana.alert.original_event.id": Object { + "path": "signal.original_event.id", + "type": "alias", + }, + "kibana.alert.original_event.kind": Object { + "path": "signal.original_event.kind", + "type": "alias", + }, + "kibana.alert.original_event.module": Object { + "path": "signal.original_event.module", + "type": "alias", + }, + "kibana.alert.original_event.outcome": Object { + "path": "signal.original_event.outcome", + "type": "alias", + }, + "kibana.alert.original_event.provider": Object { + "path": "signal.original_event.provider", + "type": "alias", + }, + "kibana.alert.original_event.reason": Object { + "path": "signal.original_event.reason", + "type": "alias", + }, + "kibana.alert.original_event.risk_score": Object { + "path": "signal.original_event.risk_score", + "type": "alias", + }, + "kibana.alert.original_event.risk_score_norm": Object { + "path": "signal.original_event.risk_score_norm", + "type": "alias", + }, + "kibana.alert.original_event.sequence": Object { + "path": "signal.original_event.sequence", + "type": "alias", + }, + "kibana.alert.original_event.severity": Object { + "path": "signal.original_event.severity", + "type": "alias", + }, + "kibana.alert.original_event.start": Object { + "path": "signal.original_event.start", + "type": "alias", + }, + "kibana.alert.original_event.timezone": Object { + "path": "signal.original_event.timezone", + "type": "alias", + }, + "kibana.alert.original_event.type": Object { + "path": "signal.original_event.type", + "type": "alias", + }, + "kibana.alert.original_time": Object { + "path": "signal.original_time", + "type": "alias", + }, + "kibana.alert.reason": Object { + "path": "signal.reason", + "type": "alias", + }, + "kibana.alert.risk_score": Object { + "path": "signal.rule.risk_score", + "type": "alias", + }, + "kibana.alert.rule.author": Object { + "path": "signal.rule.author", + "type": "alias", + }, + "kibana.alert.rule.building_block_type": Object { + "path": "signal.rule.building_block_type", + "type": "alias", + }, + "kibana.alert.rule.created_at": Object { + "path": "signal.rule.created_at", + "type": "alias", + }, + "kibana.alert.rule.created_by": Object { + "path": "signal.rule.created_by", + "type": "alias", + }, + "kibana.alert.rule.description": Object { + "path": "signal.rule.description", + "type": "alias", + }, + "kibana.alert.rule.enabled": Object { + "path": "signal.rule.enabled", + "type": "alias", + }, + "kibana.alert.rule.false_positives": Object { + "path": "signal.rule.false_positives", + "type": "alias", + }, + "kibana.alert.rule.from": Object { + "path": "signal.rule.from", + "type": "alias", + }, + "kibana.alert.rule.immutable": Object { + "path": "signal.rule.immutable", + "type": "alias", + }, + "kibana.alert.rule.index": Object { + "path": "signal.rule.index", + "type": "alias", + }, + "kibana.alert.rule.interval": Object { + "path": "signal.rule.interval", + "type": "alias", + }, + "kibana.alert.rule.language": Object { + "path": "signal.rule.language", + "type": "alias", + }, + "kibana.alert.rule.license": Object { + "path": "signal.rule.license", + "type": "alias", + }, + "kibana.alert.rule.max_signals": Object { + "path": "signal.rule.max_signals", + "type": "alias", + }, + "kibana.alert.rule.name": Object { + "path": "signal.rule.name", + "type": "alias", + }, + "kibana.alert.rule.note": Object { + "path": "signal.rule.note", + "type": "alias", + }, + "kibana.alert.rule.query": Object { + "path": "signal.rule.query", + "type": "alias", + }, + "kibana.alert.rule.references": Object { + "path": "signal.rule.references", + "type": "alias", + }, + "kibana.alert.rule.risk_score_mapping.field": Object { + "path": "signal.rule.risk_score_mapping.field", + "type": "alias", + }, + "kibana.alert.rule.risk_score_mapping.operator": Object { + "path": "signal.rule.risk_score_mapping.operator", + "type": "alias", + }, + "kibana.alert.rule.risk_score_mapping.value": Object { + "path": "signal.rule.risk_score_mapping.value", + "type": "alias", + }, + "kibana.alert.rule.rule_id": Object { + "path": "signal.rule.rule_id", + "type": "alias", + }, + "kibana.alert.rule.rule_name_override": Object { + "path": "signal.rule.rule_name_override", + "type": "alias", + }, + "kibana.alert.rule.saved_id": Object { + "path": "signal.rule.saved_id", + "type": "alias", + }, + "kibana.alert.rule.severity_mapping.field": Object { + "path": "signal.rule.severity_mapping.field", + "type": "alias", + }, + "kibana.alert.rule.severity_mapping.operator": Object { + "path": "signal.rule.severity_mapping.operator", + "type": "alias", + }, + "kibana.alert.rule.severity_mapping.severity": Object { + "path": "signal.rule.severity_mapping.severity", + "type": "alias", + }, + "kibana.alert.rule.severity_mapping.value": Object { + "path": "signal.rule.severity_mapping.value", + "type": "alias", + }, + "kibana.alert.rule.tags": Object { + "path": "signal.rule.tags", + "type": "alias", + }, + "kibana.alert.rule.threat.framework": Object { + "path": "signal.rule.threat.framework", + "type": "alias", + }, + "kibana.alert.rule.threat.tactic.id": Object { + "path": "signal.rule.threat.tactic.id", + "type": "alias", + }, + "kibana.alert.rule.threat.tactic.name": Object { + "path": "signal.rule.threat.tactic.name", + "type": "alias", + }, + "kibana.alert.rule.threat.tactic.reference": Object { + "path": "signal.rule.threat.tactic.reference", + "type": "alias", + }, + "kibana.alert.rule.threat.technique.id": Object { + "path": "signal.rule.threat.technique.id", + "type": "alias", + }, + "kibana.alert.rule.threat.technique.name": Object { + "path": "signal.rule.threat.technique.name", + "type": "alias", + }, + "kibana.alert.rule.threat.technique.reference": Object { + "path": "signal.rule.threat.technique.reference", + "type": "alias", + }, + "kibana.alert.rule.threat.technique.subtechnique.id": Object { + "path": "signal.rule.threat.technique.subtechnique.id", + "type": "alias", + }, + "kibana.alert.rule.threat.technique.subtechnique.name": Object { + "path": "signal.rule.threat.technique.subtechnique.name", + "type": "alias", + }, + "kibana.alert.rule.threat.technique.subtechnique.reference": Object { + "path": "signal.rule.threat.technique.subtechnique.reference", + "type": "alias", + }, + "kibana.alert.rule.threat_index": Object { + "path": "signal.rule.threat_index", + "type": "alias", + }, + "kibana.alert.rule.threat_indicator_path": Object { + "path": "signal.rule.threat_indicator_path", + "type": "alias", + }, + "kibana.alert.rule.threat_language": Object { + "path": "signal.rule.threat_language", + "type": "alias", + }, + "kibana.alert.rule.threat_mapping.entries.field": Object { + "path": "signal.rule.threat_mapping.entries.field", + "type": "alias", + }, + "kibana.alert.rule.threat_mapping.entries.type": Object { + "path": "signal.rule.threat_mapping.entries.type", + "type": "alias", + }, + "kibana.alert.rule.threat_mapping.entries.value": Object { + "path": "signal.rule.threat_mapping.entries.value", + "type": "alias", + }, + "kibana.alert.rule.threat_query": Object { + "path": "signal.rule.threat_query", + "type": "alias", + }, + "kibana.alert.rule.threshold.field": Object { + "path": "signal.rule.threshold.field", + "type": "alias", + }, + "kibana.alert.rule.threshold.value": Object { + "path": "signal.rule.threshold.value", + "type": "alias", + }, + "kibana.alert.rule.timeline_id": Object { + "path": "signal.rule.timeline_id", + "type": "alias", + }, + "kibana.alert.rule.timeline_title": Object { + "path": "signal.rule.timeline_title", + "type": "alias", + }, + "kibana.alert.rule.to": Object { + "path": "signal.rule.to", + "type": "alias", + }, + "kibana.alert.rule.type": Object { + "path": "signal.rule.type", + "type": "alias", + }, + "kibana.alert.rule.updated_at": Object { + "path": "signal.rule.updated_at", + "type": "alias", + }, + "kibana.alert.rule.updated_by": Object { + "path": "signal.rule.updated_by", + "type": "alias", + }, + "kibana.alert.rule.uuid": Object { + "path": "signal.rule.id", + "type": "alias", + }, + "kibana.alert.rule.version": Object { + "path": "signal.rule.version", + "type": "alias", + }, + "kibana.alert.severity": Object { + "path": "signal.rule.severity", + "type": "alias", + }, + "kibana.alert.threshold_result.cardinality.field": Object { + "path": "signal.threshold_result.cardinality.field", + "type": "alias", + }, + "kibana.alert.threshold_result.cardinality.value": Object { + "path": "signal.threshold_result.cardinality.value", + "type": "alias", + }, + "kibana.alert.threshold_result.count": Object { + "path": "signal.threshold_result.count", + "type": "alias", + }, + "kibana.alert.threshold_result.from": Object { + "path": "signal.threshold_result.from", + "type": "alias", + }, + "kibana.alert.threshold_result.terms.field": Object { + "path": "signal.threshold_result.terms.field", + "type": "alias", + }, + "kibana.alert.threshold_result.terms.value": Object { + "path": "signal.threshold_result.terms.value", + "type": "alias", + }, + "kibana.alert.workflow_status": Object { + "path": "signal.status", + "type": "alias", + }, + "signal": Object { + "properties": Object { + "_meta": Object { + "properties": Object { + "version": Object { + "type": "long", + }, + }, + "type": "object", + }, + "ancestors": Object { + "properties": Object { + "depth": Object { + "type": "long", + }, + "id": Object { + "type": "keyword", + }, + "index": Object { + "type": "keyword", + }, + "rule": Object { + "type": "keyword", + }, + "type": Object { + "type": "keyword", + }, + }, + }, + "depth": Object { + "type": "integer", + }, + "group": Object { + "properties": Object { + "id": Object { + "type": "keyword", + }, + "index": Object { + "type": "integer", + }, + }, + "type": "object", + }, + "original_event": Object { + "properties": Object { + "reason": Object { + "type": "keyword", + }, + }, + "type": "object", + }, + "reason": Object { + "type": "keyword", + }, + "rule": Object { + "properties": Object { + "author": Object { + "type": "keyword", + }, + "building_block_type": Object { + "type": "keyword", + }, + "license": Object { + "type": "keyword", + }, + "note": Object { + "type": "text", + }, + "risk_score_mapping": Object { + "properties": Object { + "field": Object { + "type": "keyword", + }, + "operator": Object { + "type": "keyword", + }, + "value": Object { + "type": "keyword", + }, + }, + "type": "object", + }, + "rule_name_override": Object { + "type": "keyword", + }, + "severity_mapping": Object { + "properties": Object { + "field": Object { + "type": "keyword", + }, + "operator": Object { + "type": "keyword", + }, + "severity": Object { + "type": "keyword", + }, + "value": Object { + "type": "keyword", + }, + }, + "type": "object", + }, + "threat": Object { + "properties": Object { + "technique": Object { + "properties": Object { + "subtechnique": Object { + "properties": Object { + "id": Object { + "type": "keyword", + }, + "name": Object { + "type": "keyword", + }, + "reference": Object { + "type": "keyword", + }, + }, + "type": "object", + }, + }, + "type": "object", + }, + }, + "type": "object", + }, + "threat_index": Object { + "type": "keyword", + }, + "threat_indicator_path": Object { + "type": "keyword", + }, + "threat_language": Object { + "type": "keyword", + }, + "threat_mapping": Object { + "properties": Object { + "entries": Object { + "properties": Object { + "field": Object { + "type": "keyword", + }, + "type": Object { + "type": "keyword", + }, + "value": Object { + "type": "keyword", + }, + }, + "type": "object", + }, + }, + "type": "object", + }, + "threat_query": Object { + "type": "keyword", + }, + "threshold": Object { + "properties": Object { + "field": Object { + "type": "keyword", + }, + "value": Object { + "type": "float", + }, + }, + "type": "object", + }, + }, + "type": "object", + }, + "threshold_result": Object { + "properties": Object { + "cardinality": Object { + "properties": Object { + "field": Object { + "type": "keyword", + }, + "value": Object { + "type": "long", + }, + }, + }, + "count": Object { + "type": "long", + }, + "from": Object { + "type": "date", + }, + "terms": Object { + "properties": Object { + "field": Object { + "type": "keyword", + }, + "value": Object { + "type": "keyword", + }, + }, + }, + }, + }, + }, + "type": "object", + }, + }, + "runtime": Object { + "host.os.name.caseless": Object { + "script": Object { + "source": "if(doc['host.os.name'].size()!=0) emit(doc['host.os.name'].value.toLowerCase());", + }, + "type": "keyword", + }, + }, +} +`; + +exports[`get_signals_template backwards compatibility mappings for version 57 should match snapshot 1`] = ` +Object { + "_meta": Object { + "aliases_version": 1, + "version": 57, + }, +} +`; + exports[`get_signals_template it should match snapshot 1`] = ` Object { "index_patterns": Array [ @@ -1495,6 +2099,11 @@ Object { }, "name": Object { "fields": Object { + "caseless": Object { + "ignore_above": 1024, + "normalizer": "lowercase", + "type": "keyword", + }, "text": Object { "norms": false, "type": "text", diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/create_index_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/create_index_route.ts index d65a1ad87b41a..61635fdcef9f0 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/create_index_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/create_index_route.ts @@ -23,11 +23,9 @@ import type { import { DETECTION_ENGINE_INDEX_URL } from '../../../../../common/constants'; import { buildSiemResponse } from '../utils'; import { - createSignalsFieldAliases, getSignalsTemplate, SIGNALS_TEMPLATE_VERSION, - SIGNALS_FIELD_ALIASES_VERSION, - ALIAS_VERSION_FIELD, + createBackwardsCompatibilityMapping, } from './get_signals_template'; import { ensureMigrationCleanupPolicy } from '../../migrations/migration_cleanup'; import signalsPolicy from './signals_policy.json'; @@ -35,7 +33,6 @@ import { templateNeedsUpdate } from './check_template_version'; import { getIndexVersion } from './get_index_version'; import { isOutdated } from '../../migrations/helpers'; import { RuleDataPluginService } from '../../../../../../rule_registry/server'; -import signalExtraFields from './signal_extra_fields.json'; import { ConfigType } from '../../../../config'; import { parseExperimentalConfigValue } from '../../../../../common/experimental_features'; @@ -126,7 +123,7 @@ export const createDetectionIndex = async ( } if (indexExists) { - await addFieldAliasesToIndices({ esClient, index, spaceId }); + await addFieldAliasesToIndices({ esClient, index }); // The internal user is used here because Elasticsearch requires the PUT alias requestor to have 'manage' permissions // for BOTH the index AND alias name. However, through 7.14 admins only needed permissions for .siem-signals (the index) // and not .alerts-security.alerts (the alias). From the security solution perspective, all .siem-signals--* @@ -148,33 +145,17 @@ export const createDetectionIndex = async ( const addFieldAliasesToIndices = async ({ esClient, index, - spaceId, }: { esClient: ElasticsearchClient; index: string; - spaceId: string; }) => { const { body: indexMappings } = await esClient.indices.get({ index }); - // Make sure that all signal fields we add aliases for are guaranteed to exist in the mapping for ALL historical - // signals indices (either by adding them to signalExtraFields or ensuring they exist in the original signals - // mapping) or else this call will fail and not update ANY signals indices - const fieldAliases = createSignalsFieldAliases(); for (const [indexName, mapping] of Object.entries(indexMappings)) { const currentVersion: number | undefined = get(mapping.mappings?._meta, 'version'); - const newMapping = { - properties: { - ...signalExtraFields, - ...fieldAliases, - // ...getRbacRequiredFields(spaceId), - }, - _meta: { - version: currentVersion, - [ALIAS_VERSION_FIELD]: SIGNALS_FIELD_ALIASES_VERSION, - }, - }; + const body = createBackwardsCompatibilityMapping(currentVersion ?? 0); await esClient.indices.putMapping({ index: indexName, - body: newMapping, + body, allow_no_indices: true, } as estypes.IndicesPutMappingRequest); } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.test.ts index bb67dd1fca6df..70363cba34fce 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { getSignalsTemplate } from './get_signals_template'; +import { createBackwardsCompatibilityMapping, getSignalsTemplate } from './get_signals_template'; describe('get_signals_template', () => { test('it should set the lifecycle "name" and "rollover_alias" to be the name of the index passed in', () => { @@ -124,4 +124,14 @@ describe('get_signals_template', () => { ); expect(template).toMatchSnapshot(); }); + + test('backwards compatibility mappings for version 45 should match snapshot', () => { + const mapping = createBackwardsCompatibilityMapping(45); + expect(mapping).toMatchSnapshot(); + }); + + test('backwards compatibility mappings for version 57 should match snapshot', () => { + const mapping = createBackwardsCompatibilityMapping(57); + expect(mapping).toMatchSnapshot(); + }); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.ts index 3470f955dbdba..b7a0521e5c3ce 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.ts @@ -11,10 +11,12 @@ import { ALERT_RULE_PRODUCER, ALERT_RULE_TYPE_ID, } from '@kbn/rule-data-utils'; +import { merge } from 'lodash'; import signalsMapping from './signals_mapping.json'; import ecsMapping from './ecs_mapping.json'; import otherMapping from './other_mappings.json'; import aadFieldConversion from './signal_aad_mapping.json'; +import signalExtraFields from './signal_extra_fields.json'; /** @constant @@ -22,7 +24,9 @@ import aadFieldConversion from './signal_aad_mapping.json'; @description This value represents the template version assumed by app code. If this number is greater than the user's signals index version, the detections UI will attempt to update the signals template and roll over to - a new signals index. + a new signals index. + + Since we create a new index for new versions, this version on an existing index should never change. If making mappings changes in a patch release, this number should be incremented by 1. If making mappings changes in a minor release, this number should be @@ -34,12 +38,24 @@ export const SIGNALS_TEMPLATE_VERSION = 57; @constant @type {number} @description This value represents the version of the field aliases that map the new field names - used for alerts-as-data to the old signal.* field names. If any .siem-signals- indices - have an aliases_version less than this value, the detections UI will call create_index_route and - and go through the index update process. Increment this number if making changes to the field - aliases we use to make signals forwards-compatible. + used for alerts-as-data to the old signal.* field names and any other runtime fields that are added + to .siem-signals indices for compatibility reasons (e.g. host.os.name.caseless). + + This version number can change over time on existing indices as we add backwards compatibility fields. + + If any .siem-signals- indices have an aliases_version less than this value, the detections + UI will call create_index_route and and go through the index update process. Increment this number if + making changes to the field aliases we use to make signals forwards-compatible. */ export const SIGNALS_FIELD_ALIASES_VERSION = 1; + +/** + @constant + @type {number} + @description This value represents the minimum required index version (SIGNALS_TEMPLATE_VERSION) for EQL + rules to write signals correctly. If the write index has a `version` less than this value, the EQL rule + will throw an error on execution. +*/ export const MIN_EQL_RULE_INDEX_VERSION = 2; export const ALIAS_VERSION_FIELD = 'aliases_version'; @@ -68,13 +84,12 @@ export const getSignalsTemplate = (index: string, spaceId: string, aadIndexAlias }, mappings: { dynamic: false, - properties: { - ...ecsMapping.mappings.properties, - ...otherMapping.mappings.properties, - ...fieldAliases, - // ...getRbacRequiredFields(spaceId), - signal: signalsMapping.mappings.properties.signal, - }, + properties: merge( + ecsMapping.mappings.properties, + otherMapping.mappings.properties, + fieldAliases, + signalsMapping.mappings.properties + ), _meta: { version: SIGNALS_TEMPLATE_VERSION, [ALIAS_VERSION_FIELD]: SIGNALS_FIELD_ALIASES_VERSION, @@ -97,6 +112,47 @@ export const createSignalsFieldAliases = () => { return fieldAliases; }; +export const backwardsCompatibilityMappings = [ + { + minVersion: 0, + // Version 45 shipped with 7.14 + maxVersion: 45, + mapping: { + runtime: { + 'host.os.name.caseless': { + type: 'keyword', + script: { + source: + "if(doc['host.os.name'].size()!=0) emit(doc['host.os.name'].value.toLowerCase());", + }, + }, + }, + properties: { + // signalExtraFields contains the field mappings that have been added to the signals indices over time. + // We need to include these here because we can't add an alias for a field that isn't in the mapping, + // and we want to apply the aliases to all old signals indices at the same time. + ...signalExtraFields, + ...createSignalsFieldAliases(), + }, + }, + }, +]; + +export const createBackwardsCompatibilityMapping = (version: number) => { + const mappings = backwardsCompatibilityMappings + .filter((mapping) => version <= mapping.maxVersion && version >= mapping.minVersion) + .map((mapping) => mapping.mapping); + + const meta = { + _meta: { + version, + [ALIAS_VERSION_FIELD]: SIGNALS_FIELD_ALIASES_VERSION, + }, + }; + + return merge({}, ...mappings, meta); +}; + export const getRbacRequiredFields = (spaceId: string) => { return { [SPACE_IDS]: { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/other_mappings.json b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/other_mappings.json index b61ad2e43ac03..5ad8f5238a97d 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/other_mappings.json +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/other_mappings.json @@ -98,6 +98,29 @@ } } }, + "host": { + "properties": { + "os": { + "properties": { + "name": { + "fields": { + "text": { + "norms": false, + "type": "text" + }, + "caseless": { + "ignore_above": 1024, + "normalizer": "lowercase", + "type": "keyword" + } + }, + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, "interface": { "properties": { "alias": { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.test.ts index 189173f44a295..866c70626d2bc 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.test.ts @@ -72,12 +72,16 @@ jest.mock('../../../timeline/routes/prepackaged_timelines/install_prepackaged_ti }; }); -describe('add_prepackaged_rules_route', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('add_prepackaged_rules_route - %s', (_, isRuleRegistryEnabled) => { const siemMockClient = siemMock.createClient(); let server: ReturnType; let { clients, context } = requestContextMock.createTools(); let securitySetup: SecurityPluginSetup; let mockExceptionsClient: ExceptionListClient; + const testif = isRuleRegistryEnabled ? test.skip : test; beforeEach(() => { server = serverMock.create(); @@ -91,8 +95,10 @@ describe('add_prepackaged_rules_route', () => { mockExceptionsClient = listMock.getExceptionListClient(); - clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); - clients.rulesClient.update.mockResolvedValue(getAlertMock(getQueryRuleParams())); + clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); + clients.rulesClient.update.mockResolvedValue( + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) + ); (installPrepackagedTimelines as jest.Mock).mockReset(); (installPrepackagedTimelines as jest.Mock).mockResolvedValue({ @@ -106,7 +112,7 @@ describe('add_prepackaged_rules_route', () => { context.core.elasticsearch.client.asCurrentUser.search.mockResolvedValue( elasticsearchClientMock.createSuccessTransportRequestPromise({ _shards: { total: 1 } }) ); - addPrepackedRulesRoute(server.router, createMockConfig(), securitySetup); + addPrepackedRulesRoute(server.router, createMockConfig(), securitySetup, isRuleRegistryEnabled); }); describe('status codes', () => { @@ -129,23 +135,25 @@ describe('add_prepackaged_rules_route', () => { }); }); - test('it returns a 400 if the index does not exist', async () => { + test('it returns a 400 if the index does not exist when rule registry not enabled', async () => { const request = addPrepackagedRulesRequest(); context.core.elasticsearch.client.asCurrentUser.search.mockResolvedValueOnce( elasticsearchClientMock.createSuccessTransportRequestPromise({ _shards: { total: 0 } }) ); const response = await server.inject(request, context); - expect(response.status).toEqual(400); - expect(response.body).toEqual({ - status_code: 400, - message: expect.stringContaining( - 'Pre-packaged rules cannot be installed until the signals index is created' - ), - }); + expect(response.status).toEqual(isRuleRegistryEnabled ? 200 : 400); + if (!isRuleRegistryEnabled) { + expect(response.body).toEqual({ + status_code: 400, + message: expect.stringContaining( + 'Pre-packaged rules cannot be installed until the signals index is created' + ), + }); + } }); - it('returns 404 if siem client is unavailable', async () => { + test('returns 404 if siem client is unavailable', async () => { const { securitySolution, ...contextWithoutSecuritySolution } = context; const response = await server.inject( addPrepackagedRulesRequest(), @@ -185,16 +193,19 @@ describe('add_prepackaged_rules_route', () => { }); }); - test('catches errors if payloads cause errors to be thrown', async () => { - context.core.elasticsearch.client.asCurrentUser.search.mockResolvedValue( - elasticsearchClientMock.createErrorTransportRequestPromise(new Error('Test error')) - ); - const request = addPrepackagedRulesRequest(); - const response = await server.inject(request, context); - - expect(response.status).toEqual(500); - expect(response.body).toEqual({ message: 'Test error', status_code: 500 }); - }); + testif( + 'catches errors if signals index does not exist when rule registry not enabled', + async () => { + context.core.elasticsearch.client.asCurrentUser.search.mockResolvedValue( + elasticsearchClientMock.createErrorTransportRequestPromise(new Error('Test error')) + ); + const request = addPrepackagedRulesRequest(); + const response = await server.inject(request, context); + + expect(response.status).toEqual(500); + expect(response.body).toEqual({ message: 'Test error', status_code: 500 }); + } + ); }); test('should install prepackaged timelines', async () => { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts index 21933b2918722..0048c735b0a7c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts @@ -43,7 +43,8 @@ import { installPrepackagedTimelines } from '../../../timeline/routes/prepackage export const addPrepackedRulesRoute = ( router: SecuritySolutionPluginRouter, config: ConfigType, - security: SetupPlugins['security'] + security: SetupPlugins['security'], + isRuleRegistryEnabled: boolean ) => { router.put( { @@ -79,7 +80,9 @@ export const addPrepackedRulesRoute = ( frameworkRequest, config.maxTimelineImportExportSize, config.prebuiltRulesFromFileSystem, - config.prebuiltRulesFromSavedObjects + config.prebuiltRulesFromSavedObjects, + undefined, + isRuleRegistryEnabled ); return response.ok({ body: validated ?? {} }); } catch (err) { @@ -109,7 +112,8 @@ export const createPrepackagedRules = async ( maxTimelineImportExportSize: ConfigType['maxTimelineImportExportSize'], prebuiltRulesFromFileSystem: ConfigType['prebuiltRulesFromFileSystem'], prebuiltRulesFromSavedObjects: ConfigType['prebuiltRulesFromSavedObjects'], - exceptionsClient?: ExceptionListClient + exceptionsClient?: ExceptionListClient, + isRuleRegistryEnabled?: boolean | undefined ): Promise => { const esClient = context.core.elasticsearch.client; const savedObjectsClient = context.core.savedObjects.client; @@ -131,11 +135,14 @@ export const createPrepackagedRules = async ( prebuiltRulesFromFileSystem, prebuiltRulesFromSavedObjects ); - const prepackagedRules = await getExistingPrepackagedRules({ rulesClient }); + const prepackagedRules = await getExistingPrepackagedRules({ + rulesClient, + isRuleRegistryEnabled: isRuleRegistryEnabled ?? false, + }); const rulesToInstall = getRulesToInstall(latestPrepackagedRules, prepackagedRules); const rulesToUpdate = getRulesToUpdate(latestPrepackagedRules, prepackagedRules); const signalsIndex = siemClient.getSignalsIndex(); - if (rulesToInstall.length !== 0 || rulesToUpdate.length !== 0) { + if (!isRuleRegistryEnabled && (rulesToInstall.length !== 0 || rulesToUpdate.length !== 0)) { const signalsIndexExists = await getIndexExists(esClient.asCurrentUser, signalsIndex); if (!signalsIndexExists) { throw new PrepackagedRulesError( @@ -145,7 +152,14 @@ export const createPrepackagedRules = async ( } } - await Promise.all(installPrepackagedRules(rulesClient, rulesToInstall, signalsIndex)); + await Promise.all( + installPrepackagedRules( + rulesClient, + rulesToInstall, + signalsIndex, + isRuleRegistryEnabled ?? false + ) + ); const timeline = await installPrepackagedTimelines( maxTimelineImportExportSize, frameworkRequest, @@ -160,7 +174,8 @@ export const createPrepackagedRules = async ( context.securitySolution.getSpaceId(), ruleStatusClient, rulesToUpdate, - signalsIndex + signalsIndex, + isRuleRegistryEnabled ?? false ); const prepackagedRulesOutput: PrePackagedRulesAndTimelinesSchema = { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.test.ts index 3de2770972c82..2c8696dbd4554 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.test.ts @@ -24,7 +24,10 @@ import { getQueryRuleParams } from '../../schemas/rule_schemas.mock'; jest.mock('../../../machine_learning/authz', () => mockMlAuthzFactory.create()); -describe('create_rules_bulk', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('create_rules_bulk - %s', (_, isRuleRegistryEnabled) => { let server: ReturnType; let { clients, context } = requestContextMock.createTools(); let ml: ReturnType; @@ -35,12 +38,14 @@ describe('create_rules_bulk', () => { ml = mlServicesMock.createSetupContract(); clients.rulesClient.find.mockResolvedValue(getEmptyFindResult()); // no existing rules - clients.rulesClient.create.mockResolvedValue(getAlertMock(getQueryRuleParams())); // successful creation + clients.rulesClient.create.mockResolvedValue( + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) + ); // successful creation context.core.elasticsearch.client.asCurrentUser.search.mockResolvedValue( elasticsearchClientMock.createSuccessTransportRequestPromise({ _shards: { total: 1 } }) ); - createRulesBulkRoute(server.router, ml); + createRulesBulkRoute(server.router, ml, isRuleRegistryEnabled); }); describe('status codes', () => { @@ -56,7 +61,7 @@ describe('create_rules_bulk', () => { expect(response.body).toEqual({ message: 'Not Found', status_code: 404 }); }); - it('returns 404 if siem client is unavailable', async () => { + test('returns 404 if siem client is unavailable', async () => { const { securitySolution, ...contextWithoutSecuritySolution } = context; // @ts-expect-error const response = await server.inject(getReadBulkRequest(), contextWithoutSecuritySolution); @@ -66,7 +71,7 @@ describe('create_rules_bulk', () => { }); describe('unhappy paths', () => { - it('returns a 403 error object if ML Authz fails', async () => { + test('returns a 403 error object if ML Authz fails', async () => { (buildMlAuthz as jest.Mock).mockReturnValueOnce({ validateRuleType: jest .fn() @@ -86,26 +91,30 @@ describe('create_rules_bulk', () => { ]); }); - it('returns an error object if the index does not exist', async () => { + test('returns an error object if the index does not exist when rule registry not enabled', async () => { context.core.elasticsearch.client.asCurrentUser.search.mockResolvedValueOnce( elasticsearchClientMock.createSuccessTransportRequestPromise({ _shards: { total: 0 } }) ); const response = await server.inject(getReadBulkRequest(), context); expect(response.status).toEqual(200); - expect(response.body).toEqual([ - { - error: { - message: 'To create a rule, the index must exist first. Index undefined does not exist', - status_code: 400, + + if (!isRuleRegistryEnabled) { + expect(response.body).toEqual([ + { + error: { + message: + 'To create a rule, the index must exist first. Index undefined does not exist', + status_code: 400, + }, + rule_id: 'rule-1', }, - rule_id: 'rule-1', - }, - ]); + ]); + } }); test('returns a duplicate error if rule_id already exists', async () => { - clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); + clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); const response = await server.inject(getReadBulkRequest(), context); expect(response.status).toEqual(200); @@ -136,7 +145,7 @@ describe('create_rules_bulk', () => { ]); }); - it('returns an error object if duplicate rule_ids found in request payload', async () => { + test('returns an error object if duplicate rule_ids found in request payload', async () => { const request = requestMock.create({ method: 'post', path: `${DETECTION_ENGINE_RULES_URL}/_bulk_create`, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.ts index 5f44ab0ada92d..31683c289d4b4 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.ts @@ -28,7 +28,8 @@ import { convertCreateAPIToInternalSchema } from '../../schemas/rule_converters' export const createRulesBulkRoute = ( router: SecuritySolutionPluginRouter, - ml: SetupPlugins['ml'] + ml: SetupPlugins['ml'], + isRuleRegistryEnabled: boolean ) => { router.post( { @@ -67,9 +68,10 @@ export const createRulesBulkRoute = ( .map(async (payloadRule) => { if (payloadRule.rule_id != null) { const rule = await readRules({ + id: undefined, + isRuleRegistryEnabled, rulesClient, ruleId: payloadRule.rule_id, - id: undefined, }); if (rule != null) { return createBulkErrorObject({ @@ -79,7 +81,11 @@ export const createRulesBulkRoute = ( }); } } - const internalRule = convertCreateAPIToInternalSchema(payloadRule, siemClient); + const internalRule = convertCreateAPIToInternalSchema( + payloadRule, + siemClient, + isRuleRegistryEnabled + ); try { const validationErrors = createRuleValidateTypeDependents(payloadRule); if (validationErrors.length) { @@ -93,7 +99,7 @@ export const createRulesBulkRoute = ( throwHttpError(await mlAuthz.validateRuleType(internalRule.params.type)); const finalIndex = internalRule.params.outputIndex; const indexExists = await getIndexExists(esClient.asCurrentUser, finalIndex); - if (!indexExists) { + if (!isRuleRegistryEnabled && !indexExists) { return createBulkErrorObject({ ruleId: internalRule.params.ruleId, statusCode: 400, @@ -112,7 +118,10 @@ export const createRulesBulkRoute = ( return transformValidateBulkError(internalRule.params.ruleId, createdRule, undefined); } catch (err) { - return transformBulkError(internalRule.params.ruleId, err); + return transformBulkError( + internalRule.params.ruleId, + err as Error & { statusCode?: number | undefined } + ); } }) ); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_route.test.ts index fc48e34a7ca74..d1be96a44930a 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_route.test.ts @@ -24,7 +24,10 @@ import { elasticsearchClientMock } from 'src/core/server/elasticsearch/client/mo import { getQueryRuleParams } from '../../schemas/rule_schemas.mock'; jest.mock('../../../machine_learning/authz', () => mockMlAuthzFactory.create()); -describe('create_rules', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('create_rules - %s', (_, isRuleRegistryEnabled) => { let server: ReturnType; let { clients, context } = requestContextMock.createTools(); let ml: ReturnType; @@ -35,13 +38,15 @@ describe('create_rules', () => { ml = mlServicesMock.createSetupContract(); clients.rulesClient.find.mockResolvedValue(getEmptyFindResult()); // no current rules - clients.rulesClient.create.mockResolvedValue(getAlertMock(getQueryRuleParams())); // creation succeeds + clients.rulesClient.create.mockResolvedValue( + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) + ); // creation succeeds clients.ruleExecutionLogClient.find.mockResolvedValue(getRuleExecutionStatuses()); // needed to transform: ; context.core.elasticsearch.client.asCurrentUser.search.mockResolvedValue( elasticsearchClientMock.createSuccessTransportRequestPromise({ _shards: { total: 1 } }) ); - createRulesRoute(server.router, ml); + createRulesRoute(server.router, ml, isRuleRegistryEnabled); }); describe('status codes with actionClient and alertClient', () => { @@ -57,7 +62,7 @@ describe('create_rules', () => { expect(response.body).toEqual({ message: 'Not Found', status_code: 404 }); }); - it('returns 404 if siem client is unavailable', async () => { + test('returns 404 if siem client is unavailable', async () => { const { securitySolution, ...contextWithoutSecuritySolution } = context; // @ts-expect-error const response = await server.inject(getCreateRequest(), contextWithoutSecuritySolution); @@ -65,7 +70,7 @@ describe('create_rules', () => { expect(response.body).toEqual({ message: 'Not Found', status_code: 404 }); }); - it('returns 200 if license is not platinum', async () => { + test('returns 200 if license is not platinum', async () => { (context.licensing.license.hasAtLeast as jest.Mock).mockReturnValue(false); const response = await server.inject(getCreateRequest(), context); @@ -74,12 +79,12 @@ describe('create_rules', () => { }); describe('creating an ML Rule', () => { - it('is successful', async () => { + test('is successful', async () => { const response = await server.inject(createMlRuleRequest(), context); expect(response.status).toEqual(200); }); - it('returns a 403 if ML Authz fails', async () => { + test('returns a 403 if ML Authz fails', async () => { (buildMlAuthz as jest.Mock).mockReturnValueOnce({ validateRuleType: jest .fn() @@ -96,21 +101,24 @@ describe('create_rules', () => { }); describe('unhappy paths', () => { - test('it returns a 400 if the index does not exist', async () => { + test('it returns a 400 if the index does not exist when rule registry not enabled', async () => { context.core.elasticsearch.client.asCurrentUser.search.mockResolvedValueOnce( elasticsearchClientMock.createSuccessTransportRequestPromise({ _shards: { total: 0 } }) ); const response = await server.inject(getCreateRequest(), context); - expect(response.status).toEqual(400); - expect(response.body).toEqual({ - message: 'To create a rule, the index must exist first. Index undefined does not exist', - status_code: 400, - }); + expect(response.status).toEqual(isRuleRegistryEnabled ? 200 : 400); + + if (!isRuleRegistryEnabled) { + expect(response.body).toEqual({ + message: 'To create a rule, the index must exist first. Index undefined does not exist', + status_code: 400, + }); + } }); test('returns a duplicate error if rule_id already exists', async () => { - clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); + clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); const response = await server.inject(getCreateRequest(), context); expect(response.status).toEqual(409); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_route.ts index 333fa9c17a75b..9e03e5f8f2143 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_route.ts @@ -6,7 +6,6 @@ */ import { transformError, getIndexExists } from '@kbn/securitysolution-es-utils'; -import { IRuleDataClient } from '../../../../../../rule_registry/server'; import { buildRouteValidation } from '../../../../utils/build_validation/route_validation'; import { DETECTION_ENGINE_RULES_URL, @@ -27,7 +26,7 @@ import { convertCreateAPIToInternalSchema } from '../../schemas/rule_converters' export const createRulesRoute = ( router: SecuritySolutionPluginRouter, ml: SetupPlugins['ml'], - ruleDataClient?: IRuleDataClient | null // TODO: Use this for RAC (otherwise delete it) + isRuleRegistryEnabled: boolean ): void => { router.post( { @@ -57,6 +56,7 @@ export const createRulesRoute = ( if (request.body.rule_id != null) { const rule = await readRules({ + isRuleRegistryEnabled, rulesClient, ruleId: request.body.rule_id, id: undefined, @@ -69,7 +69,11 @@ export const createRulesRoute = ( } } - const internalRule = convertCreateAPIToInternalSchema(request.body, siemClient); + const internalRule = convertCreateAPIToInternalSchema( + request.body, + siemClient, + isRuleRegistryEnabled + ); const mlAuthz = buildMlAuthz({ license: context.licensing.license, @@ -83,7 +87,7 @@ export const createRulesRoute = ( esClient.asCurrentUser, internalRule.params.outputIndex ); - if (!indexExists) { + if (!isRuleRegistryEnabled && !indexExists) { return siemResponse.error({ statusCode: 400, body: `To create a rule, the index must exist first. Index ${internalRule.params.outputIndex} does not exist`, @@ -107,14 +111,18 @@ export const createRulesRoute = ( ruleId: createdRule.id, spaceId: context.securitySolution.getSpaceId(), }); - const [validated, errors] = newTransformValidate(createdRule, ruleStatuses[0]); + const [validated, errors] = newTransformValidate( + createdRule, + ruleStatuses[0], + isRuleRegistryEnabled + ); if (errors != null) { return siemResponse.error({ statusCode: 500, body: errors }); } else { return response.ok({ body: validated ?? {} }); } } catch (err) { - const error = transformError(err); + const error = transformError(err as Error); return siemResponse.error({ body: error.message, statusCode: error.statusCode, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.test.ts index 66feb3cae724f..7db5651de2c34 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.test.ts @@ -18,7 +18,10 @@ import { import { requestContextMock, serverMock, requestMock } from '../__mocks__'; import { deleteRulesBulkRoute } from './delete_rules_bulk_route'; -describe('delete_rules', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('delete_rules - %s', (_, isRuleRegistryEnabled) => { let server: ReturnType; let { clients, context } = requestContextMock.createTools(); @@ -26,11 +29,11 @@ describe('delete_rules', () => { server = serverMock.create(); ({ clients, context } = requestContextMock.createTools()); - clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); // rule exists + clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); // rule exists clients.rulesClient.delete.mockResolvedValue({}); // successful deletion clients.savedObjectsClient.find.mockResolvedValue(getEmptySavedObjectsResponse()); // rule status request - deleteRulesBulkRoute(server.router); + deleteRulesBulkRoute(server.router, isRuleRegistryEnabled); }); describe('status codes with actionClient and alertClient', () => { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.ts index 7a5b7121eb33b..6aecfff1178bc 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.ts @@ -6,6 +6,7 @@ */ import { validate } from '@kbn/securitysolution-io-ts-utils'; + import { queryRuleValidateTypeDependents } from '../../../../../common/detection_engine/schemas/request/query_rules_type_dependents'; import { buildRouteValidation } from '../../../../utils/build_validation/route_validation'; import { @@ -34,7 +35,10 @@ type Handler = RequestHandler< 'delete' | 'post' >; -export const deleteRulesBulkRoute = (router: SecuritySolutionPluginRouter) => { +export const deleteRulesBulkRoute = ( + router: SecuritySolutionPluginRouter, + isRuleRegistryEnabled: boolean +) => { const config: Config = { validate: { body: buildRouteValidation( @@ -71,7 +75,7 @@ export const deleteRulesBulkRoute = (router: SecuritySolutionPluginRouter) => { } try { - const rule = await readRules({ rulesClient, id, ruleId }); + const rule = await readRules({ rulesClient, id, ruleId, isRuleRegistryEnabled }); if (!rule) { return getIdBulkError({ id, ruleId }); } @@ -87,7 +91,12 @@ export const deleteRulesBulkRoute = (router: SecuritySolutionPluginRouter) => { ruleStatuses, id: rule.id, }); - return transformValidateBulkError(idOrRuleIdOrUnknown, rule, ruleStatuses); + return transformValidateBulkError( + idOrRuleIdOrUnknown, + rule, + ruleStatuses, + isRuleRegistryEnabled + ); } catch (err) { return transformBulkError(idOrRuleIdOrUnknown, err); } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/delete_rules_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/delete_rules_route.test.ts index 5102cb32a4572..35b3ef3d9cf85 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/delete_rules_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/delete_rules_route.test.ts @@ -19,7 +19,10 @@ import { requestContextMock, serverMock, requestMock } from '../__mocks__'; import { deleteRulesRoute } from './delete_rules_route'; import { getQueryRuleParams } from '../../schemas/rule_schemas.mock'; -describe('delete_rules', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('delete_rules - %s', (_, isRuleRegistryEnabled) => { let server: ReturnType; let { clients, context } = requestContextMock.createTools(); @@ -27,11 +30,11 @@ describe('delete_rules', () => { server = serverMock.create(); ({ clients, context } = requestContextMock.createTools()); - clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); + clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); clients.savedObjectsClient.find.mockResolvedValue(getEmptySavedObjectsResponse()); clients.ruleExecutionLogClient.find.mockResolvedValue(getRuleExecutionStatuses()); - deleteRulesRoute(server.router); + deleteRulesRoute(server.router, isRuleRegistryEnabled); }); describe('status codes with actionClient and alertClient', () => { @@ -42,7 +45,9 @@ describe('delete_rules', () => { }); test('returns 200 when deleting a single rule with a valid actionClient and alertClient by id', async () => { - clients.rulesClient.get.mockResolvedValue(getAlertMock(getQueryRuleParams())); + clients.rulesClient.get.mockResolvedValue( + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) + ); const response = await server.inject(getDeleteRequestById(), context); expect(response.status).toEqual(200); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/delete_rules_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/delete_rules_route.ts index 499f5c151c66c..77b8dd6fc5b54 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/delete_rules_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/delete_rules_route.ts @@ -6,7 +6,6 @@ */ import { transformError } from '@kbn/securitysolution-es-utils'; -import { IRuleDataClient } from '../../../../../../rule_registry/server'; import { queryRuleValidateTypeDependents } from '../../../../../common/detection_engine/schemas/request/query_rules_type_dependents'; import { queryRulesSchema, @@ -23,7 +22,7 @@ import { readRules } from '../../rules/read_rules'; export const deleteRulesRoute = ( router: SecuritySolutionPluginRouter, - ruleDataClient?: IRuleDataClient | null + isRuleRegistryEnabled: boolean ) => { router.delete( { @@ -54,7 +53,7 @@ export const deleteRulesRoute = ( } const ruleStatusClient = context.securitySolution.getExecutionLogClient(); - const rule = await readRules({ rulesClient, id, ruleId }); + const rule = await readRules({ isRuleRegistryEnabled, rulesClient, id, ruleId }); if (!rule) { const error = getIdError({ id, ruleId }); return siemResponse.error({ @@ -74,7 +73,7 @@ export const deleteRulesRoute = ( ruleStatuses, id: rule.id, }); - const transformed = transform(rule, ruleStatuses[0]); + const transformed = transform(rule, ruleStatuses[0], isRuleRegistryEnabled); if (transformed == null) { return siemResponse.error({ statusCode: 500, body: 'failed to transform alert' }); } else { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/export_rules_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/export_rules_route.ts index 022118859aa0b..e4b99e63cb6c6 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/export_rules_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/export_rules_route.ts @@ -21,7 +21,11 @@ import { getExportByObjectIds } from '../../rules/get_export_by_object_ids'; import { getExportAll } from '../../rules/get_export_all'; import { buildSiemResponse } from '../utils'; -export const exportRulesRoute = (router: SecuritySolutionPluginRouter, config: ConfigType) => { +export const exportRulesRoute = ( + router: SecuritySolutionPluginRouter, + config: ConfigType, + isRuleRegistryEnabled: boolean +) => { router.post( { path: `${DETECTION_ENGINE_RULES_URL}/_export`, @@ -53,7 +57,10 @@ export const exportRulesRoute = (router: SecuritySolutionPluginRouter, config: C body: `Can't export more than ${exportSizeLimit} rules`, }); } else { - const nonPackagedRulesCount = await getNonPackagedRulesCount({ rulesClient }); + const nonPackagedRulesCount = await getNonPackagedRulesCount({ + isRuleRegistryEnabled, + rulesClient, + }); if (nonPackagedRulesCount > exportSizeLimit) { return siemResponse.error({ statusCode: 400, @@ -64,8 +71,8 @@ export const exportRulesRoute = (router: SecuritySolutionPluginRouter, config: C const exported = request.body?.objects != null - ? await getExportByObjectIds(rulesClient, request.body.objects) - : await getExportAll(rulesClient); + ? await getExportByObjectIds(rulesClient, request.body.objects, isRuleRegistryEnabled) + : await getExportAll(rulesClient, isRuleRegistryEnabled); const responseBody = request.query.exclude_export_details ? exported.rulesNdjson diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/find_rules_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/find_rules_route.test.ts index 301cf8518b838..d15d31dcd63e8 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/find_rules_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/find_rules_route.test.ts @@ -17,7 +17,10 @@ import { } from '../__mocks__/request_responses'; import { findRulesRoute } from './find_rules_route'; -describe('find_rules', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('find_rules - %s', (_, isRuleRegistryEnabled) => { let server: ReturnType; let { clients, context } = requestContextMock.createTools(); @@ -25,12 +28,14 @@ describe('find_rules', () => { server = serverMock.create(); ({ clients, context } = requestContextMock.createTools()); - clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); - clients.rulesClient.get.mockResolvedValue(getAlertMock(getQueryRuleParams())); + clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); + clients.rulesClient.get.mockResolvedValue( + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) + ); clients.savedObjectsClient.find.mockResolvedValue(getEmptySavedObjectsResponse()); clients.ruleExecutionLogClient.findBulk.mockResolvedValue(getFindBulkResultStatus()); - findRulesRoute(server.router); + findRulesRoute(server.router, isRuleRegistryEnabled); }); describe('status codes with actionClient and alertClient', () => { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/find_rules_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/find_rules_route.ts index ed39d42c38e4a..26e8d1107237b 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/find_rules_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/find_rules_route.ts @@ -6,7 +6,6 @@ */ import { transformError } from '@kbn/securitysolution-es-utils'; -import { IRuleDataClient } from '../../../../../../rule_registry/server'; import { findRuleValidateTypeDependents } from '../../../../../common/detection_engine/schemas/request/find_rules_type_dependents'; import { findRulesSchema, @@ -21,7 +20,7 @@ import { transformFindAlerts } from './utils'; export const findRulesRoute = ( router: SecuritySolutionPluginRouter, - ruleDataClient?: IRuleDataClient | null + isRuleRegistryEnabled: boolean ) => { router.get( { @@ -52,6 +51,7 @@ export const findRulesRoute = ( const execLogClient = context.securitySolution.getExecutionLogClient(); const rules = await findRules({ + isRuleRegistryEnabled, rulesClient, perPage: query.per_page, page: query.page, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/find_rules_status_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/find_rules_status_route.test.ts index d9b6f4dd0f10c..053e0b7178de5 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/find_rules_status_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/find_rules_status_route.test.ts @@ -17,7 +17,10 @@ import { RuleStatusResponse } from '../../rules/types'; import { AlertExecutionStatusErrorReasons } from '../../../../../../alerting/common'; import { getQueryRuleParams } from '../../schemas/rule_schemas.mock'; -describe('find_statuses', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('find_statuses - %s', (_, isRuleRegistryEnabled) => { let server: ReturnType; let { clients, context } = requestContextMock.createTools(); @@ -25,7 +28,9 @@ describe('find_statuses', () => { server = serverMock.create(); ({ clients, context } = requestContextMock.createTools()); clients.ruleExecutionLogClient.findBulk.mockResolvedValue(getFindBulkResultStatus()); // successful status search - clients.rulesClient.get.mockResolvedValue(getAlertMock(getQueryRuleParams())); + clients.rulesClient.get.mockResolvedValue( + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) + ); findRulesStatusesRoute(server.router); }); @@ -57,7 +62,7 @@ describe('find_statuses', () => { test('returns success if rule status client writes an error status', async () => { // 0. task manager tried to run the rule but couldn't, so the alerting framework // wrote an error to the executionStatus. - const failingExecutionRule = getAlertMock(getQueryRuleParams()); + const failingExecutionRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); failingExecutionRule.executionStatus = { status: 'error', lastExecutionDate: failingExecutionRule.executionStatus.lastExecutionDate, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.test.ts index 61c618dc4d5e6..1b171f693d80b 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.test.ts @@ -51,7 +51,10 @@ jest.mock('../../../timeline/utils/check_timelines_status', () => { }; }); -describe('get_prepackaged_rule_status_route', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('get_prepackaged_rule_status_route - %s', (_, isRuleRegistryEnabled) => { const mockGetCurrentUser = { user: { username: 'mockUser', @@ -63,6 +66,7 @@ describe('get_prepackaged_rule_status_route', () => { let securitySetup: SecurityPluginSetup; beforeEach(() => { + jest.clearAllMocks(); server = serverMock.create(); ({ clients, context } = requestContextMock.createTools()); @@ -75,7 +79,18 @@ describe('get_prepackaged_rule_status_route', () => { clients.rulesClient.find.mockResolvedValue(getEmptyFindResult()); - getPrepackagedRulesStatusRoute(server.router, createMockConfig(), securitySetup); + (checkTimelinesStatus as jest.Mock).mockResolvedValue({ + timelinesToInstall: [], + timelinesToUpdate: [], + prepackagedTimelines: [], + }); + + getPrepackagedRulesStatusRoute( + server.router, + createMockConfig(), + securitySetup, + isRuleRegistryEnabled + ); }); describe('status codes with actionClient and alertClient', () => { @@ -123,7 +138,7 @@ describe('get_prepackaged_rule_status_route', () => { }); test('1 rule installed, 1 custom rules, 0 rules not installed, and 1 rule to not updated', async () => { - clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); + clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); const request = getPrepackagedRulesStatusRequest(); const response = await server.inject(request, context); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.ts index 38c315462bf55..9a06928eee233 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.ts @@ -32,7 +32,8 @@ import { export const getPrepackagedRulesStatusRoute = ( router: SecuritySolutionPluginRouter, config: ConfigType, - security: SetupPlugins['security'] + security: SetupPlugins['security'], + isRuleRegistryEnabled: boolean ) => { router.get( { @@ -59,6 +60,7 @@ export const getPrepackagedRulesStatusRoute = ( config.prebuiltRulesFromSavedObjects ); const customRules = await findRules({ + isRuleRegistryEnabled, rulesClient, perPage: 1, page: 1, @@ -68,7 +70,10 @@ export const getPrepackagedRulesStatusRoute = ( fields: undefined, }); const frameworkRequest = await buildFrameworkRequest(context, security, request); - const prepackagedRules = await getExistingPrepackagedRules({ rulesClient }); + const prepackagedRules = await getExistingPrepackagedRules({ + rulesClient, + isRuleRegistryEnabled, + }); const rulesToInstall = getRulesToInstall(latestPrepackagedRules, prepackagedRules); const rulesToUpdate = getRulesToUpdate(latestPrepackagedRules, prepackagedRules); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts index cd572894f551e..bf29dbe870153 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts @@ -29,7 +29,10 @@ import { getQueryRuleParams } from '../../schemas/rule_schemas.mock'; jest.mock('../../../machine_learning/authz', () => mockMlAuthzFactory.create()); -describe('import_rules_route', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('import_rules_route - %s', (_, isRuleRegistryEnabled) => { let config: ReturnType; let server: ReturnType; let request: ReturnType; @@ -45,11 +48,13 @@ describe('import_rules_route', () => { ml = mlServicesMock.createSetupContract(); clients.rulesClient.find.mockResolvedValue(getEmptyFindResult()); // no extant rules - clients.rulesClient.update.mockResolvedValue(getAlertMock(getQueryRuleParams())); + clients.rulesClient.update.mockResolvedValue( + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) + ); context.core.elasticsearch.client.asCurrentUser.search.mockResolvedValue( elasticsearchClientMock.createSuccessTransportRequestPromise({ _shards: { total: 1 } }) ); - importRulesRoute(server.router, config, ml); + importRulesRoute(server.router, config, ml, isRuleRegistryEnabled); }); describe('status codes', () => { @@ -60,7 +65,7 @@ describe('import_rules_route', () => { }); test('returns 500 if more than 10,000 rules are imported', async () => { - const ruleIds = new Array(10001).fill(undefined).map((_, index) => `rule-${index}`); + const ruleIds = new Array(10001).fill(undefined).map((__, index) => `rule-${index}`); const multiRequest = getImportRulesRequest(buildHapiStream(ruleIdsToNdJsonString(ruleIds))); const response = await server.inject(multiRequest, context); @@ -125,18 +130,20 @@ describe('import_rules_route', () => { transformMock.mockRestore(); }); - test('returns an error if the index does not exist', async () => { + test('returns an error if the index does not exist when rule registry not enabled', async () => { clients.appClient.getSignalsIndex.mockReturnValue('mockSignalsIndex'); context.core.elasticsearch.client.asCurrentUser.search.mockResolvedValueOnce( elasticsearchClientMock.createSuccessTransportRequestPromise({ _shards: { total: 0 } }) ); const response = await server.inject(request, context); - expect(response.status).toEqual(400); - expect(response.body).toEqual({ - message: - 'To create a rule, the index must exist first. Index mockSignalsIndex does not exist', - status_code: 400, - }); + expect(response.status).toEqual(isRuleRegistryEnabled ? 200 : 400); + if (!isRuleRegistryEnabled) { + expect(response.body).toEqual({ + message: + 'To create a rule, the index must exist first. Index mockSignalsIndex does not exist', + status_code: 400, + }); + } }); test('returns an error when cluster throws error', async () => { @@ -166,7 +173,9 @@ describe('import_rules_route', () => { describe('single rule import', () => { test('returns 200 if rule imported successfully', async () => { - clients.rulesClient.create.mockResolvedValue(getAlertMock(getQueryRuleParams())); + clients.rulesClient.create.mockResolvedValue( + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) + ); const response = await server.inject(request, context); expect(response.status).toEqual(200); expect(response.body).toEqual({ @@ -199,7 +208,9 @@ describe('import_rules_route', () => { describe('rule with existing rule_id', () => { test('returns with reported conflict if `overwrite` is set to `false`', async () => { - clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); // extant rule + clients.rulesClient.find.mockResolvedValue( + getFindResultWithSingleHit(isRuleRegistryEnabled) + ); // extant rule const response = await server.inject(request, context); expect(response.status).toEqual(200); @@ -219,7 +230,9 @@ describe('import_rules_route', () => { }); test('returns with NO reported conflict if `overwrite` is set to `true`', async () => { - clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); // extant rule + clients.rulesClient.find.mockResolvedValue( + getFindResultWithSingleHit(isRuleRegistryEnabled) + ); // extant rule const overwriteRequest = getImportRulesRequestOverwriteTrue( buildHapiStream(ruleIdsToNdJsonString(['rule-1'])) ); @@ -251,7 +264,7 @@ describe('import_rules_route', () => { }); test('returns 200 if many rules are imported successfully', async () => { - const ruleIds = new Array(9999).fill(undefined).map((_, index) => `rule-${index}`); + const ruleIds = new Array(9999).fill(undefined).map((__, index) => `rule-${index}`); const multiRequest = getImportRulesRequest(buildHapiStream(ruleIdsToNdJsonString(ruleIds))); const response = await server.inject(multiRequest, context); @@ -339,7 +352,9 @@ describe('import_rules_route', () => { describe('rules with existing rule_id', () => { beforeEach(() => { - clients.rulesClient.find.mockResolvedValueOnce(getFindResultWithSingleHit()); // extant rule + clients.rulesClient.find.mockResolvedValueOnce( + getFindResultWithSingleHit(isRuleRegistryEnabled) + ); // extant rule }); test('returns with reported conflict if `overwrite` is set to `false`', async () => { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.ts index d3193900859fa..8269fe8b36132 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.ts @@ -53,7 +53,8 @@ const CHUNK_PARSED_OBJECT_SIZE = 50; export const importRulesRoute = ( router: SecuritySolutionPluginRouter, config: ConfigType, - ml: SetupPlugins['ml'] + ml: SetupPlugins['ml'], + isRuleRegistryEnabled: boolean ) => { router.post( { @@ -103,7 +104,7 @@ export const importRulesRoute = ( } const signalsIndex = siemClient.getSignalsIndex(); const indexExists = await getIndexExists(esClient.asCurrentUser, signalsIndex); - if (!indexExists) { + if (!isRuleRegistryEnabled && !indexExists) { return siemResponse.error({ statusCode: 400, body: `To create a rule, the index must exist first. Index ${signalsIndex} does not exist`, @@ -205,6 +206,7 @@ export const importRulesRoute = ( const filters: PartialFilter[] | undefined = filtersRest as PartialFilter[]; throwHttpError(await mlAuthz.validateRuleType(type)); const rule = await readRules({ + isRuleRegistryEnabled, rulesClient, ruleId, id: undefined, @@ -212,6 +214,7 @@ export const importRulesRoute = ( if (rule == null) { await createRules({ + isRuleRegistryEnabled, rulesClient, anomalyThreshold, author, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.test.ts index 31f805c563f76..2c3db023dccc4 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.test.ts @@ -22,7 +22,10 @@ import { getQueryRuleParams } from '../../schemas/rule_schemas.mock'; jest.mock('../../../machine_learning/authz', () => mockMlAuthzFactory.create()); -describe('patch_rules_bulk', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('patch_rules_bulk - %s', (_, isRuleRegistryEnabled) => { let server: ReturnType; let { clients, context } = requestContextMock.createTools(); let ml: ReturnType; @@ -32,10 +35,12 @@ describe('patch_rules_bulk', () => { ({ clients, context } = requestContextMock.createTools()); ml = mlServicesMock.createSetupContract(); - clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); // rule exists - clients.rulesClient.update.mockResolvedValue(getAlertMock(getQueryRuleParams())); // update succeeds + clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); // rule exists + clients.rulesClient.update.mockResolvedValue( + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) + ); // update succeeds - patchRulesBulkRoute(server.router, ml); + patchRulesBulkRoute(server.router, ml, isRuleRegistryEnabled); }); describe('status codes with actionClient and alertClient', () => { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.ts index 3aaa82ea56f3f..67d68221d846f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.ts @@ -27,7 +27,8 @@ import { PartialFilter } from '../../types'; export const patchRulesBulkRoute = ( router: SecuritySolutionPluginRouter, - ml: SetupPlugins['ml'] + ml: SetupPlugins['ml'], + isRuleRegistryEnabled: boolean ) => { router.patch( { @@ -121,7 +122,12 @@ export const patchRulesBulkRoute = ( throwHttpError(await mlAuthz.validateRuleType(type)); } - const existingRule = await readRules({ rulesClient, ruleId, id }); + const existingRule = await readRules({ + isRuleRegistryEnabled, + rulesClient, + ruleId, + id, + }); if (existingRule?.params.type) { // reject an unauthorized modification of an ML rule throwHttpError(await mlAuthz.validateRuleType(existingRule?.params.type)); @@ -185,7 +191,7 @@ export const patchRulesBulkRoute = ( ruleId: rule.id, spaceId: context.securitySolution.getSpaceId(), }); - return transformValidateBulkError(rule.id, rule, ruleStatuses); + return transformValidateBulkError(rule.id, rule, ruleStatuses, isRuleRegistryEnabled); } else { return getIdBulkError({ id, ruleId }); } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_route.test.ts index 16d65d6482d21..97773c45ce0d9 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_route.test.ts @@ -25,7 +25,10 @@ import { getQueryRuleParams } from '../../schemas/rule_schemas.mock'; jest.mock('../../../machine_learning/authz', () => mockMlAuthzFactory.create()); -describe('patch_rules', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('patch_rules - %s', (_, isRuleRegistryEnabled) => { let server: ReturnType; let { clients, context } = requestContextMock.createTools(); let ml: ReturnType; @@ -35,14 +38,18 @@ describe('patch_rules', () => { ({ clients, context } = requestContextMock.createTools()); ml = mlServicesMock.createSetupContract(); - clients.rulesClient.get.mockResolvedValue(getAlertMock(getQueryRuleParams())); // existing rule - clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); // existing rule - clients.rulesClient.update.mockResolvedValue(getAlertMock(getQueryRuleParams())); // successful update + clients.rulesClient.get.mockResolvedValue( + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) + ); // existing rule + clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); // existing rule + clients.rulesClient.update.mockResolvedValue( + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) + ); // successful update clients.savedObjectsClient.find.mockResolvedValue(getEmptySavedObjectsResponse()); // successful transform clients.savedObjectsClient.create.mockResolvedValue(getRuleExecutionStatuses()[0]); // successful transform clients.ruleExecutionLogClient.find.mockResolvedValue(getRuleExecutionStatuses()); - patchRulesRoute(server.router, ml); + patchRulesRoute(server.router, ml, isRuleRegistryEnabled); }); describe('status codes with actionClient and alertClient', () => { @@ -69,7 +76,7 @@ describe('patch_rules', () => { }); test('returns error if requesting a non-rule', async () => { - clients.rulesClient.find.mockResolvedValue(nonRuleFindResult()); + clients.rulesClient.find.mockResolvedValue(nonRuleFindResult(isRuleRegistryEnabled)); const response = await server.inject(getPatchRequest(), context); expect(response.status).toEqual(404); expect(response.body).toEqual({ diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_route.ts index b564262b4a5c7..cf140f22289de 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_route.ts @@ -6,7 +6,6 @@ */ import { transformError } from '@kbn/securitysolution-es-utils'; -import { IRuleDataClient } from '../../../../../../rule_registry/server'; import { RuleAlertAction } from '../../../../../common/detection_engine/types'; import { patchRuleValidateTypeDependents } from '../../../../../common/detection_engine/schemas/request/patch_rules_type_dependents'; import { buildRouteValidation } from '../../../../utils/build_validation/route_validation'; @@ -30,7 +29,7 @@ import { PartialFilter } from '../../types'; export const patchRulesRoute = ( router: SecuritySolutionPluginRouter, ml: SetupPlugins['ml'], - ruleDataClient?: IRuleDataClient | null + isRuleRegistryEnabled: boolean ) => { router.patch( { @@ -124,7 +123,12 @@ export const patchRulesRoute = ( throwHttpError(await mlAuthz.validateRuleType(type)); } - const existingRule = await readRules({ rulesClient, ruleId, id }); + const existingRule = await readRules({ + isRuleRegistryEnabled, + rulesClient, + ruleId, + id, + }); if (existingRule?.params.type) { // reject an unauthorized modification of an ML rule throwHttpError(await mlAuthz.validateRuleType(existingRule?.params.type)); @@ -189,7 +193,11 @@ export const patchRulesRoute = ( spaceId: context.securitySolution.getSpaceId(), }); - const [validated, errors] = transformValidate(rule, ruleStatuses[0]); + const [validated, errors] = transformValidate( + rule, + ruleStatuses[0], + isRuleRegistryEnabled + ); if (errors != null) { return siemResponse.error({ statusCode: 500, body: errors }); } else { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/perform_bulk_action_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/perform_bulk_action_route.test.ts index f8b3b834af857..ebc86acc964e6 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/perform_bulk_action_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/perform_bulk_action_route.test.ts @@ -20,7 +20,10 @@ import { getPerformBulkActionSchemaMock } from '../../../../../common/detection_ jest.mock('../../../machine_learning/authz', () => mockMlAuthzFactory.create()); -describe('perform_bulk_action', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('perform_bulk_action - %s', (_, isRuleRegistryEnabled) => { let server: ReturnType; let { clients, context } = requestContextMock.createTools(); let ml: ReturnType; @@ -30,9 +33,9 @@ describe('perform_bulk_action', () => { ({ clients, context } = requestContextMock.createTools()); ml = mlServicesMock.createSetupContract(); - clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); + clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); - performBulkActionRoute(server.router, ml); + performBulkActionRoute(server.router, ml, isRuleRegistryEnabled); }); describe('status codes', () => { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/perform_bulk_action_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/perform_bulk_action_route.ts index 70198d081ebfa..0eba5af4e063a 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/perform_bulk_action_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/perform_bulk_action_route.ts @@ -25,7 +25,8 @@ const BULK_ACTION_RULES_LIMIT = 10000; export const performBulkActionRoute = ( router: SecuritySolutionPluginRouter, - ml: SetupPlugins['ml'] + ml: SetupPlugins['ml'], + isRuleRegistryEnabled: boolean ) => { router.post( { @@ -58,6 +59,7 @@ export const performBulkActionRoute = ( } const rules = await findRules({ + isRuleRegistryEnabled, rulesClient, perPage: BULK_ACTION_RULES_LIMIT, filter: body.query !== '' ? body.query : undefined, @@ -131,7 +133,8 @@ export const performBulkActionRoute = ( case BulkAction.export: const exported = await getExportByObjectIds( rulesClient, - rules.data.map(({ params }) => ({ rule_id: params.ruleId })) + rules.data.map(({ params }) => ({ rule_id: params.ruleId })), + isRuleRegistryEnabled ); const responseBody = `${exported.rulesNdjson}${exported.exportDetails}`; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/read_rules_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/read_rules_route.test.ts index 586ff027425f8..057cbf4c12966 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/read_rules_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/read_rules_route.test.ts @@ -16,7 +16,10 @@ import { } from '../__mocks__/request_responses'; import { requestMock, requestContextMock, serverMock } from '../__mocks__'; -describe('read_signals', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('read_rules - %s', (_, isRuleRegistryEnabled) => { let server: ReturnType; let { clients, context } = requestContextMock.createTools(); @@ -24,11 +27,11 @@ describe('read_signals', () => { server = serverMock.create(); ({ clients, context } = requestContextMock.createTools()); - clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); // rule exists + clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); // rule exists clients.savedObjectsClient.find.mockResolvedValue(getEmptySavedObjectsResponse()); // successful transform clients.ruleExecutionLogClient.find.mockResolvedValue([]); - readRulesRoute(server.router); + readRulesRoute(server.router, isRuleRegistryEnabled); }); describe('status codes with actionClient and alertClient', () => { @@ -45,7 +48,7 @@ describe('read_signals', () => { }); test('returns error if requesting a non-rule', async () => { - clients.rulesClient.find.mockResolvedValue(nonRuleFindResult()); + clients.rulesClient.find.mockResolvedValue(nonRuleFindResult(isRuleRegistryEnabled)); const response = await server.inject(getReadRequest(), context); expect(response.status).toEqual(404); expect(response.body).toEqual({ diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/read_rules_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/read_rules_route.ts index 7aef65e7918b2..5672648190653 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/read_rules_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/read_rules_route.ts @@ -6,7 +6,6 @@ */ import { transformError } from '@kbn/securitysolution-es-utils'; -import { IRuleDataClient } from '../../../../../../rule_registry/server'; import { queryRuleValidateTypeDependents } from '../../../../../common/detection_engine/schemas/request/query_rules_type_dependents'; import { queryRulesSchema, @@ -23,7 +22,7 @@ import { RuleExecutionStatus } from '../../../../../common/detection_engine/sche export const readRulesRoute = ( router: SecuritySolutionPluginRouter, - ruleDataClient?: IRuleDataClient | null + isRuleRegistryEnabled: boolean ) => { router.get( { @@ -55,8 +54,9 @@ export const readRulesRoute = ( const ruleStatusClient = context.securitySolution.getExecutionLogClient(); const rule = await readRules({ - rulesClient, id, + isRuleRegistryEnabled, + rulesClient, ruleId, }); if (rule != null) { @@ -72,7 +72,7 @@ export const readRulesRoute = ( currentStatus.attributes.statusDate = rule.executionStatus.lastExecutionDate.toISOString(); currentStatus.attributes.status = RuleExecutionStatus.failed; } - const transformed = transform(rule, currentStatus); + const transformed = transform(rule, currentStatus, isRuleRegistryEnabled); if (transformed == null) { return siemResponse.error({ statusCode: 500, body: 'Internal error transforming' }); } else { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_bulk_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_bulk_route.test.ts index eeb8b3caf6df5..746a40dfa8dc2 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_bulk_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_bulk_route.test.ts @@ -23,7 +23,10 @@ import { getQueryRuleParams } from '../../schemas/rule_schemas.mock'; jest.mock('../../../machine_learning/authz', () => mockMlAuthzFactory.create()); -describe('update_rules_bulk', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('update_rules_bulk - %s', (_, isRuleRegistryEnabled) => { let server: ReturnType; let { clients, context } = requestContextMock.createTools(); let ml: ReturnType; @@ -33,10 +36,12 @@ describe('update_rules_bulk', () => { ({ clients, context } = requestContextMock.createTools()); ml = mlServicesMock.createSetupContract(); - clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); - clients.rulesClient.update.mockResolvedValue(getAlertMock(getQueryRuleParams())); + clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); + clients.rulesClient.update.mockResolvedValue( + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) + ); - updateRulesBulkRoute(server.router, ml); + updateRulesBulkRoute(server.router, ml, isRuleRegistryEnabled); }); describe('status codes with actionClient and alertClient', () => { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_bulk_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_bulk_route.ts index 389c49d3cff4e..6138690070b62 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_bulk_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_bulk_route.ts @@ -22,7 +22,8 @@ import { updateRules } from '../../rules/update_rules'; export const updateRulesBulkRoute = ( router: SecuritySolutionPluginRouter, - ml: SetupPlugins['ml'] + ml: SetupPlugins['ml'], + isRuleRegistryEnabled: boolean ) => { router.put( { @@ -74,6 +75,7 @@ export const updateRulesBulkRoute = ( ruleStatusClient, defaultOutputIndex: siemClient.getSignalsIndex(), ruleUpdate: payloadRule, + isRuleRegistryEnabled, }); if (rule != null) { const ruleStatuses = await ruleStatusClient.find({ @@ -81,7 +83,7 @@ export const updateRulesBulkRoute = ( ruleId: rule.id, spaceId: context.securitySolution.getSpaceId(), }); - return transformValidateBulkError(rule.id, rule, ruleStatuses); + return transformValidateBulkError(rule.id, rule, ruleStatuses, isRuleRegistryEnabled); } else { return getIdBulkError({ id: payloadRule.id, ruleId: payloadRule.rule_id }); } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_route.test.ts index db0054088137c..5b3e2737418c2 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_route.test.ts @@ -23,7 +23,10 @@ import { getQueryRuleParams } from '../../schemas/rule_schemas.mock'; jest.mock('../../../machine_learning/authz', () => mockMlAuthzFactory.create()); -describe('update_rules', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('update_rules - %s', (_, isRuleRegistryEnabled) => { let server: ReturnType; let { clients, context } = requestContextMock.createTools(); let ml: ReturnType; @@ -33,12 +36,16 @@ describe('update_rules', () => { ({ clients, context } = requestContextMock.createTools()); ml = mlServicesMock.createSetupContract(); - clients.rulesClient.get.mockResolvedValue(getAlertMock(getQueryRuleParams())); // existing rule - clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); // rule exists - clients.rulesClient.update.mockResolvedValue(getAlertMock(getQueryRuleParams())); // successful update + clients.rulesClient.get.mockResolvedValue( + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) + ); // existing rule + clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); // rule exists + clients.rulesClient.update.mockResolvedValue( + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) + ); // successful update clients.ruleExecutionLogClient.find.mockResolvedValue([]); // successful transform: ; - updateRulesRoute(server.router, ml); + updateRulesRoute(server.router, ml, isRuleRegistryEnabled); }); describe('status codes with actionClient and alertClient', () => { @@ -75,7 +82,7 @@ describe('update_rules', () => { }); test('returns error when updating non-rule', async () => { - clients.rulesClient.find.mockResolvedValue(nonRuleFindResult()); + clients.rulesClient.find.mockResolvedValue(nonRuleFindResult(isRuleRegistryEnabled)); const response = await server.inject(getUpdateRequest(), context); expect(response.status).toEqual(404); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_route.ts index ecf61bec2b20a..7cfe83093a549 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/update_rules_route.ts @@ -6,7 +6,6 @@ */ import { transformError } from '@kbn/securitysolution-es-utils'; -import { IRuleDataClient } from '../../../../../../rule_registry/server'; import { updateRulesSchema } from '../../../../../common/detection_engine/schemas/request'; import { updateRuleValidateTypeDependents } from '../../../../../common/detection_engine/schemas/request/update_rules_type_dependents'; import type { SecuritySolutionPluginRouter } from '../../../../types'; @@ -24,7 +23,7 @@ import { buildRouteValidation } from '../../../../utils/build_validation/route_v export const updateRulesRoute = ( router: SecuritySolutionPluginRouter, ml: SetupPlugins['ml'], - ruleDataClient?: IRuleDataClient | null + isRuleRegistryEnabled: boolean ) => { router.put( { @@ -61,11 +60,12 @@ export const updateRulesRoute = ( const ruleStatusClient = context.securitySolution.getExecutionLogClient(); const rule = await updateRules({ - spaceId: context.securitySolution.getSpaceId(), + defaultOutputIndex: siemClient.getSignalsIndex(), + isRuleRegistryEnabled, rulesClient, ruleStatusClient, - defaultOutputIndex: siemClient.getSignalsIndex(), ruleUpdate: request.body, + spaceId: context.securitySolution.getSpaceId(), }); if (rule != null) { @@ -74,7 +74,11 @@ export const updateRulesRoute = ( ruleId: rule.id, spaceId: context.securitySolution.getSpaceId(), }); - const [validated, errors] = transformValidate(rule, ruleStatuses[0]); + const [validated, errors] = transformValidate( + rule, + ruleStatuses[0], + isRuleRegistryEnabled + ); if (errors != null) { return siemResponse.error({ statusCode: 500, body: errors }); } else { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils.test.ts index 0018a37016980..f07a63b690a2d 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils.test.ts @@ -41,16 +41,19 @@ import { type PromiseFromStreams = ImportRulesSchemaDecoded | Error; -describe('utils', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('utils - %s', (_, isRuleRegistryEnabled) => { describe('transformAlertToRule', () => { test('should work with a full data set', () => { - const fullRule = getAlertMock(getQueryRuleParams()); + const fullRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); const rule = transformAlertToRule(fullRule); expect(rule).toEqual(getOutputRuleAlertForRest()); }); test('should omit note if note is undefined', () => { - const fullRule = getAlertMock(getQueryRuleParams()); + const fullRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); fullRule.params.note = undefined; const rule = transformAlertToRule(fullRule); const { note, ...expectedWithoutNote } = getOutputRuleAlertForRest(); @@ -58,7 +61,7 @@ describe('utils', () => { }); test('should return enabled is equal to false', () => { - const fullRule = getAlertMock(getQueryRuleParams()); + const fullRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); fullRule.enabled = false; const ruleWithEnabledFalse = transformAlertToRule(fullRule); const expected = getOutputRuleAlertForRest(); @@ -67,7 +70,7 @@ describe('utils', () => { }); test('should return immutable is equal to false', () => { - const fullRule = getAlertMock(getQueryRuleParams()); + const fullRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); fullRule.params.immutable = false; const ruleWithEnabledFalse = transformAlertToRule(fullRule); const expected = getOutputRuleAlertForRest(); @@ -75,7 +78,7 @@ describe('utils', () => { }); test('should work with tags but filter out any internal tags', () => { - const fullRule = getAlertMock(getQueryRuleParams()); + const fullRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); fullRule.tags = ['tag 1', 'tag 2', `${INTERNAL_IDENTIFIER}_some_other_value`]; const rule = transformAlertToRule(fullRule); const expected = getOutputRuleAlertForRest(); @@ -84,7 +87,7 @@ describe('utils', () => { }); test('transforms ML Rule fields', () => { - const mlRule = getAlertMock(getMlRuleParams()); + const mlRule = getAlertMock(isRuleRegistryEnabled, getMlRuleParams()); mlRule.params.anomalyThreshold = 55; mlRule.params.machineLearningJobId = ['some_job_id']; mlRule.params.type = 'machine_learning'; @@ -100,7 +103,7 @@ describe('utils', () => { }); test('transforms threat_matching fields', () => { - const threatRule = getAlertMock(getThreatRuleParams()); + const threatRule = getAlertMock(isRuleRegistryEnabled, getThreatRuleParams()); const threatFilters: PartialFilter[] = [ { query: { @@ -153,7 +156,7 @@ describe('utils', () => { test('does not leak a lists structure in the transform which would cause validation issues', () => { const result: RuleAlertType & { lists: [] } = { lists: [], - ...getAlertMock(getQueryRuleParams()), + ...getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()), }; const rule = transformAlertToRule(result); expect(rule).toEqual( @@ -168,7 +171,7 @@ describe('utils', () => { test('does not leak an exceptions_list structure in the transform which would cause validation issues', () => { const result: RuleAlertType & { exceptions_list: [] } = { exceptions_list: [], - ...getAlertMock(getQueryRuleParams()), + ...getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()), }; const rule = transformAlertToRule(result); expect(rule).toEqual( @@ -265,7 +268,7 @@ describe('utils', () => { page: 1, perPage: 0, total: 0, - data: [getAlertMock(getQueryRuleParams())], + data: [getAlertMock(isRuleRegistryEnabled, getQueryRuleParams())], }, {} ); @@ -281,14 +284,18 @@ describe('utils', () => { describe('transform', () => { test('outputs 200 if the data is of type siem alert', () => { - const output = transform(getAlertMock(getQueryRuleParams())); + const output = transform( + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()), + undefined, + isRuleRegistryEnabled + ); const expected = getOutputRuleAlertForRest(); expect(output).toEqual(expected); }); test('returns 500 if the data is not of type siem alert', () => { const unsafeCast = ({ data: [{ random: 1 }] } as unknown) as PartialAlert; - const output = transform(unsafeCast); + const output = transform(unsafeCast, undefined, isRuleRegistryEnabled); expect(output).toBeNull(); }); }); @@ -396,24 +403,34 @@ describe('utils', () => { describe('transformOrBulkError', () => { test('outputs 200 if the data is of type siem alert', () => { - const output = transformOrBulkError('rule-1', getAlertMock(getQueryRuleParams()), { - id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd', - actions: [], - ruleThrottle: 'no_actions', - alertThrottle: null, - }); + const output = transformOrBulkError( + 'rule-1', + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()), + { + id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd', + actions: [], + ruleThrottle: 'no_actions', + alertThrottle: null, + }, + isRuleRegistryEnabled + ); const expected = getOutputRuleAlertForRest(); expect(output).toEqual(expected); }); test('returns 500 if the data is not of type siem alert', () => { const unsafeCast = ({ name: 'something else' } as unknown) as PartialAlert; - const output = transformOrBulkError('rule-1', unsafeCast, { - id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd', - actions: [], - ruleThrottle: 'no_actions', - alertThrottle: null, - }); + const output = transformOrBulkError( + 'rule-1', + unsafeCast, + { + id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd', + actions: [], + ruleThrottle: 'no_actions', + alertThrottle: null, + }, + isRuleRegistryEnabled + ); const expected: BulkError = { rule_id: 'rule-1', error: { message: 'Internal error transforming', status_code: 500 }, @@ -428,15 +445,15 @@ describe('utils', () => { }); test('given single alert will return the alert transformed', () => { - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); const transformed = transformAlertsToRules([result1]); const expected = getOutputRuleAlertForRest(); expect(transformed).toEqual([expected]); }); test('given two alerts will return the two alerts transformed', () => { - const result1 = getAlertMock(getQueryRuleParams()); - const result2 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); + const result2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result2.id = 'some other id'; result2.params.ruleId = 'some other id'; @@ -451,11 +468,16 @@ describe('utils', () => { describe('transformOrImportError', () => { test('returns 1 given success if the alert is an alert type and the existing success count is 0', () => { - const output = transformOrImportError('rule-1', getAlertMock(getQueryRuleParams()), { - success: true, - success_count: 0, - errors: [], - }); + const output = transformOrImportError( + 'rule-1', + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()), + { + success: true, + success_count: 0, + errors: [], + }, + isRuleRegistryEnabled + ); const expected: ImportSuccessError = { success: true, errors: [], @@ -465,11 +487,16 @@ describe('utils', () => { }); test('returns 2 given successes if the alert is an alert type and the existing success count is 1', () => { - const output = transformOrImportError('rule-1', getAlertMock(getQueryRuleParams()), { - success: true, - success_count: 1, - errors: [], - }); + const output = transformOrImportError( + 'rule-1', + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()), + { + success: true, + success_count: 1, + errors: [], + }, + isRuleRegistryEnabled + ); const expected: ImportSuccessError = { success: true, errors: [], @@ -480,11 +507,16 @@ describe('utils', () => { test('returns 1 error and success of false if the data is not of type siem alert', () => { const unsafeCast = ({ name: 'something else' } as unknown) as PartialAlert; - const output = transformOrImportError('rule-1', unsafeCast, { - success: true, - success_count: 1, - errors: [], - }); + const output = transformOrImportError( + 'rule-1', + unsafeCast, + { + success: true, + success_count: 1, + errors: [], + }, + isRuleRegistryEnabled + ); const expected: ImportSuccessError = { success: false, errors: [ diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils.ts index 6e1faf819c3d5..4f023156fba06 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/utils.ts @@ -135,9 +135,10 @@ export const transformFindAlerts = ( export const transform = ( alert: PartialAlert, - ruleStatus?: SavedObject + ruleStatus?: SavedObject, + isRuleRegistryEnabled?: boolean ): Partial | null => { - if (isAlertType(alert)) { + if (isAlertType(isRuleRegistryEnabled ?? false, alert)) { return transformAlertToRule( alert, isRuleStatusSavedObjectType(ruleStatus) ? ruleStatus : undefined @@ -150,9 +151,10 @@ export const transform = ( export const transformOrBulkError = ( ruleId: string, alert: PartialAlert, - ruleStatus?: unknown + ruleStatus?: unknown, + isRuleRegistryEnabled?: boolean ): Partial | BulkError => { - if (isAlertType(alert)) { + if (isAlertType(isRuleRegistryEnabled ?? false, alert)) { if (isRuleStatusFindType(ruleStatus) && ruleStatus?.saved_objects.length > 0) { return transformAlertToRule(alert, ruleStatus?.saved_objects[0] ?? ruleStatus); } else { @@ -170,9 +172,10 @@ export const transformOrBulkError = ( export const transformOrImportError = ( ruleId: string, alert: PartialAlert, - existingImportSuccessError: ImportSuccessError + existingImportSuccessError: ImportSuccessError, + isRuleRegistryEnabled: boolean ): ImportSuccessError => { - if (isAlertType(alert)) { + if (isAlertType(isRuleRegistryEnabled, alert)) { return createSuccessObject(existingImportSuccessError); } else { return createImportErrorObject({ diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/validate.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/validate.test.ts index 9cbd4de71613a..a7ba1ac77b7bf 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/validate.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/validate.test.ts @@ -66,20 +66,23 @@ export const ruleOutput = (): RulesSchema => ({ timeline_id: 'some-timeline-id', }); -describe('validate', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('validate - %s', (_, isRuleRegistryEnabled) => { describe('transformValidate', () => { test('it should do a validation correctly of a partial alert', () => { - const ruleAlert = getAlertMock(getQueryRuleParams()); - const [validated, errors] = transformValidate(ruleAlert); + const ruleAlert = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); + const [validated, errors] = transformValidate(ruleAlert, undefined, isRuleRegistryEnabled); expect(validated).toEqual(ruleOutput()); expect(errors).toEqual(null); }); test('it should do an in-validation correctly of a partial alert', () => { - const ruleAlert = getAlertMock(getQueryRuleParams()); + const ruleAlert = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); // @ts-expect-error delete ruleAlert.name; - const [validated, errors] = transformValidate(ruleAlert); + const [validated, errors] = transformValidate(ruleAlert, undefined, isRuleRegistryEnabled); expect(validated).toEqual(null); expect(errors).toEqual('Invalid value "undefined" supplied to "name"'); }); @@ -87,16 +90,26 @@ describe('validate', () => { describe('transformValidateBulkError', () => { test('it should do a validation correctly of a rule id', () => { - const ruleAlert = getAlertMock(getQueryRuleParams()); - const validatedOrError = transformValidateBulkError('rule-1', ruleAlert); + const ruleAlert = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); + const validatedOrError = transformValidateBulkError( + 'rule-1', + ruleAlert, + undefined, + isRuleRegistryEnabled + ); expect(validatedOrError).toEqual(ruleOutput()); }); test('it should do an in-validation correctly of a rule id', () => { - const ruleAlert = getAlertMock(getQueryRuleParams()); + const ruleAlert = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); // @ts-expect-error delete ruleAlert.name; - const validatedOrError = transformValidateBulkError('rule-1', ruleAlert); + const validatedOrError = transformValidateBulkError( + 'rule-1', + ruleAlert, + undefined, + isRuleRegistryEnabled + ); const expected: BulkError = { error: { message: 'Invalid value "undefined" supplied to "name"', @@ -109,8 +122,13 @@ describe('validate', () => { test('it should do a validation correctly of a rule id with ruleStatus passed in', () => { const ruleStatuses = getRuleExecutionStatuses(); - const ruleAlert = getAlertMock(getQueryRuleParams()); - const validatedOrError = transformValidateBulkError('rule-1', ruleAlert, ruleStatuses); + const ruleAlert = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); + const validatedOrError = transformValidateBulkError( + 'rule-1', + ruleAlert, + ruleStatuses, + isRuleRegistryEnabled + ); const expected: RulesSchema = { ...ruleOutput(), status: RuleExecutionStatus.succeeded, @@ -122,10 +140,15 @@ describe('validate', () => { }); test('it should return error object if "alert" is not expected alert type', () => { - const ruleAlert = getAlertMock(getQueryRuleParams()); + const ruleAlert = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); // @ts-expect-error delete ruleAlert.alertTypeId; - const validatedOrError = transformValidateBulkError('rule-1', ruleAlert); + const validatedOrError = transformValidateBulkError( + 'rule-1', + ruleAlert, + undefined, + isRuleRegistryEnabled + ); const expected: BulkError = { error: { message: 'Internal error transforming', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/validate.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/validate.ts index ccb3201848e3c..c1969c5088bc0 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/validate.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/validate.ts @@ -29,9 +29,10 @@ import { RuleParams } from '../../schemas/rule_schemas'; export const transformValidate = ( alert: PartialAlert, - ruleStatus?: SavedObject + ruleStatus?: SavedObject, + isRuleRegistryEnabled?: boolean ): [RulesSchema | null, string | null] => { - const transformed = transform(alert, ruleStatus); + const transformed = transform(alert, ruleStatus, isRuleRegistryEnabled); if (transformed == null) { return [null, 'Internal error transforming']; } else { @@ -41,9 +42,10 @@ export const transformValidate = ( export const newTransformValidate = ( alert: PartialAlert, - ruleStatus?: SavedObject + ruleStatus?: SavedObject, + isRuleRegistryEnabled?: boolean ): [FullResponseSchema | null, string | null] => { - const transformed = transform(alert, ruleStatus); + const transformed = transform(alert, ruleStatus, isRuleRegistryEnabled); if (transformed == null) { return [null, 'Internal error transforming']; } else { @@ -54,9 +56,10 @@ export const newTransformValidate = ( export const transformValidateBulkError = ( ruleId: string, alert: PartialAlert, - ruleStatus?: Array> + ruleStatus?: Array>, + isRuleRegistryEnabled?: boolean ): RulesSchema | BulkError => { - if (isAlertType(alert)) { + if (isAlertType(isRuleRegistryEnabled ?? false, alert)) { if (ruleStatus && ruleStatus?.length > 0 && isRuleStatusSavedObjectType(ruleStatus[0])) { const transformed = transformAlertToRule(alert, ruleStatus[0]); const [validated, errors] = validateNonExact(transformed, rulesSchema); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/tags/read_tags_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/tags/read_tags_route.ts index e22497071b2b7..04464e5d6f5a7 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/tags/read_tags_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/tags/read_tags_route.ts @@ -12,7 +12,10 @@ import { buildSiemResponse } from '../utils'; import { readTags } from '../../tags/read_tags'; -export const readTagsRoute = (router: SecuritySolutionPluginRouter) => { +export const readTagsRoute = ( + router: SecuritySolutionPluginRouter, + isRuleRegistryEnabled: boolean +) => { router.get( { path: DETECTION_ENGINE_TAGS_URL, @@ -31,6 +34,7 @@ export const readTagsRoute = (router: SecuritySolutionPluginRouter) => { try { const tags = await readTags({ + isRuleRegistryEnabled, rulesClient, }); return response.ok({ body: tags }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts index c7e1f9f2e6bd7..23a65b456e6bc 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts @@ -33,7 +33,10 @@ import { RuleExecutionStatus } from '../../../../common/detection_engine/schemas let rulesClient: ReturnType; -describe('utils', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('utils - %s', (_, isRuleRegistryEnabled) => { describe('transformBulkError', () => { test('returns transformed object if it is a boom object', () => { const boom = new Boom.Boom('some boom message', { statusCode: 400 }); @@ -390,12 +393,12 @@ describe('utils', () => { rulesClient = rulesClientMock.create(); }); it('getFailingRules finds no failing rules', async () => { - rulesClient.get.mockResolvedValue(getAlertMock(getQueryRuleParams())); + rulesClient.get.mockResolvedValue(getAlertMock(isRuleRegistryEnabled, getQueryRuleParams())); const res = await getFailingRules(['my-fake-id'], rulesClient); expect(res).toEqual({}); }); it('getFailingRules finds a failing rule', async () => { - const foundRule = getAlertMock(getQueryRuleParams()); + const foundRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); foundRule.executionStatus = { status: 'error', lastExecutionDate: foundRule.executionStatus.lastExecutionDate, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts index 8f078b01daf73..775115ded7c4f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts @@ -328,6 +328,6 @@ export const getFailingRules = async ( if (Boom.isBoom(exc)) { throw exc; } - throw new Error(`Failed to get executionStatus with RulesClient: ${exc.message}`); + throw new Error(`Failed to get executionStatus with RulesClient: ${(exc as Error).message}`); } }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/rule_registry_adapter/rule_registry_log_client/rule_registry_log_client.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/rule_registry_adapter/rule_registry_log_client/rule_registry_log_client.ts index f0da8dad16ab0..a5515f8db8552 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/rule_registry_adapter/rule_registry_log_client/rule_registry_log_client.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/rule_registry_adapter/rule_registry_log_client/rule_registry_log_client.ts @@ -142,76 +142,78 @@ export class RuleRegistryLogClient implements IRuleRegistryLogClient { invariant(result.aggregations, 'Search response should contain aggregations'); return Object.fromEntries( - result.aggregations.rules.buckets.map((bucket) => [ - bucket.key, - bucket.most_recent_logs.hits.hits.map((event) => { - const logEntry = parseRuleExecutionLog(event._source); - invariant( - logEntry[ALERT_RULE_UUID] ?? '', - 'Malformed execution log entry: rule.id field not found' - ); + result.aggregations.rules.buckets.map<[ruleId: string, logs: IRuleStatusSOAttributes[]]>( + (bucket) => [ + bucket.key as string, + bucket.most_recent_logs.hits.hits.map((event) => { + const logEntry = parseRuleExecutionLog(event._source); + invariant( + logEntry[ALERT_RULE_UUID] ?? '', + 'Malformed execution log entry: rule.id field not found' + ); - const lastFailure = bucket.last_failure.event.hits.hits[0] - ? parseRuleExecutionLog(bucket.last_failure.event.hits.hits[0]._source) - : undefined; + const lastFailure = bucket.last_failure.event.hits.hits[0] + ? parseRuleExecutionLog(bucket.last_failure.event.hits.hits[0]._source) + : undefined; - const lastSuccess = bucket.last_success.event.hits.hits[0] - ? parseRuleExecutionLog(bucket.last_success.event.hits.hits[0]._source) - : undefined; + const lastSuccess = bucket.last_success.event.hits.hits[0] + ? parseRuleExecutionLog(bucket.last_success.event.hits.hits[0]._source) + : undefined; - const lookBack = bucket.indexing_lookback.event.hits.hits[0] - ? parseRuleExecutionLog(bucket.indexing_lookback.event.hits.hits[0]._source) - : undefined; + const lookBack = bucket.indexing_lookback.event.hits.hits[0] + ? parseRuleExecutionLog(bucket.indexing_lookback.event.hits.hits[0]._source) + : undefined; - const executionGap = bucket.execution_gap.event.hits.hits[0] - ? parseRuleExecutionLog(bucket.execution_gap.event.hits.hits[0]._source)[ - getMetricField(ExecutionMetric.executionGap) - ] - : undefined; + const executionGap = bucket.execution_gap.event.hits.hits[0] + ? parseRuleExecutionLog(bucket.execution_gap.event.hits.hits[0]._source)[ + getMetricField(ExecutionMetric.executionGap) + ] + : undefined; - const searchDuration = bucket.search_duration_max.event.hits.hits[0] - ? parseRuleExecutionLog(bucket.search_duration_max.event.hits.hits[0]._source)[ - getMetricField(ExecutionMetric.searchDurationMax) - ] - : undefined; + const searchDuration = bucket.search_duration_max.event.hits.hits[0] + ? parseRuleExecutionLog(bucket.search_duration_max.event.hits.hits[0]._source)[ + getMetricField(ExecutionMetric.searchDurationMax) + ] + : undefined; - const indexingDuration = bucket.indexing_duration_max.event.hits.hits[0] - ? parseRuleExecutionLog(bucket.indexing_duration_max.event.hits.hits[0]._source)[ - getMetricField(ExecutionMetric.indexingDurationMax) - ] - : undefined; + const indexingDuration = bucket.indexing_duration_max.event.hits.hits[0] + ? parseRuleExecutionLog(bucket.indexing_duration_max.event.hits.hits[0]._source)[ + getMetricField(ExecutionMetric.indexingDurationMax) + ] + : undefined; - const alertId = logEntry[ALERT_RULE_UUID] ?? ''; - const statusDate = logEntry[TIMESTAMP]; - const lastFailureAt = lastFailure?.[TIMESTAMP]; - const lastFailureMessage = lastFailure?.[MESSAGE]; - const lastSuccessAt = lastSuccess?.[TIMESTAMP]; - const lastSuccessMessage = lastSuccess?.[MESSAGE]; - const status = (logEntry[RULE_STATUS] as RuleExecutionStatus) || null; - const lastLookBackDate = lookBack?.[getMetricField(ExecutionMetric.indexingLookback)]; - const gap = executionGap ? moment.duration(executionGap).humanize() : null; - const bulkCreateTimeDurations = indexingDuration - ? [makeFloatString(indexingDuration)] - : null; - const searchAfterTimeDurations = searchDuration - ? [makeFloatString(searchDuration)] - : null; + const alertId = logEntry[ALERT_RULE_UUID] ?? ''; + const statusDate = logEntry[TIMESTAMP]; + const lastFailureAt = lastFailure?.[TIMESTAMP]; + const lastFailureMessage = lastFailure?.[MESSAGE]; + const lastSuccessAt = lastSuccess?.[TIMESTAMP]; + const lastSuccessMessage = lastSuccess?.[MESSAGE]; + const status = (logEntry[RULE_STATUS] as RuleExecutionStatus) || null; + const lastLookBackDate = lookBack?.[getMetricField(ExecutionMetric.indexingLookback)]; + const gap = executionGap ? moment.duration(executionGap).humanize() : null; + const bulkCreateTimeDurations = indexingDuration + ? [makeFloatString(indexingDuration)] + : null; + const searchAfterTimeDurations = searchDuration + ? [makeFloatString(searchDuration)] + : null; - return { - alertId, - statusDate, - lastFailureAt, - lastFailureMessage, - lastSuccessAt, - lastSuccessMessage, - status, - lastLookBackDate, - gap, - bulkCreateTimeDurations, - searchAfterTimeDurations, - }; - }), - ]) + return { + alertId, + statusDate, + lastFailureAt, + lastFailureMessage, + lastSuccessAt, + lastSuccessMessage, + status, + lastLookBackDate, + gap, + bulkCreateTimeDurations, + searchAfterTimeDurations, + }; + }), + ] + ) ); } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/threshold.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/threshold.ts index 40d2ed37a5576..554672806c12e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/threshold.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/threshold.ts @@ -5,7 +5,35 @@ * 2.0. */ +import { + SPACE_IDS, + ALERT_RULE_CONSUMER, + ALERT_REASON, + ALERT_STATUS, + ALERT_STATUS_ACTIVE, + ALERT_WORKFLOW_STATUS, + ALERT_RULE_NAMESPACE, + ALERT_INSTANCE_ID, + ALERT_UUID, + ALERT_RULE_TYPE_ID, + ALERT_RULE_PRODUCER, + ALERT_RULE_CATEGORY, + ALERT_RULE_UUID, + ALERT_RULE_NAME, +} from '@kbn/rule-data-utils'; +import { TypeOfFieldMap } from '../../../../../../rule_registry/common/field_map'; +import { SERVER_APP_ID } from '../../../../../common/constants'; +import { ANCHOR_DATE } from '../../../../../common/detection_engine/schemas/response/rules_schema.mocks'; +import { getListArrayMock } from '../../../../../common/detection_engine/schemas/types/lists.mock'; import { sampleDocNoSortId } from '../../signals/__mocks__/es_results'; +import { flattenWithPrefix } from '../factories/utils/flatten_with_prefix'; +import { RulesFieldMap } from '../field_maps'; +import { + ALERT_ANCESTORS, + ALERT_ORIGINAL_TIME, + ALERT_ORIGINAL_EVENT, +} from '../field_maps/field_names'; +import { WrappedRACAlert } from '../types'; export const mockThresholdResults = { rawResponse: { @@ -59,3 +87,79 @@ export const mockThresholdResults = { }, }, }; + +export const sampleThresholdAlert: WrappedRACAlert = { + _id: 'b3ad77a4-65bd-4c4e-89cf-13c46f54bc4d', + _index: 'some-index', + _source: { + '@timestamp': '2020-04-20T21:26:30.000Z', + [SPACE_IDS]: ['default'], + [ALERT_INSTANCE_ID]: 'b3ad77a4-65bd-4c4e-89cf-13c46f54bc4d', + [ALERT_UUID]: '310158f7-994d-4a38-8cdc-152139ac4d29', + [ALERT_RULE_CONSUMER]: SERVER_APP_ID, + [ALERT_ANCESTORS]: [ + { + id: 'd5e8eb51-a6a0-456d-8a15-4b79bfec3d71', + type: 'event', + index: 'myFakeSignalIndex', + depth: 0, + }, + ], + [ALERT_ORIGINAL_TIME]: '2020-04-20T21:27:45.000Z', + [ALERT_ORIGINAL_EVENT]: { + action: 'socket_opened', + dataset: 'socket', + kind: 'event', + module: 'system', + }, + [ALERT_REASON]: 'alert reasonable reason', + [ALERT_STATUS]: ALERT_STATUS_ACTIVE, + [ALERT_WORKFLOW_STATUS]: 'open', + 'source.ip': '127.0.0.1', + 'host.name': 'garden-gnomes', + [ALERT_RULE_CATEGORY]: 'security', + [ALERT_RULE_NAME]: 'a threshold rule', + [ALERT_RULE_PRODUCER]: 'siem', + [ALERT_RULE_TYPE_ID]: 'query-rule-id', + [ALERT_RULE_UUID]: '151af49f-2e82-4b6f-831b-7f8cb341a5ff', + ...(flattenWithPrefix(ALERT_RULE_NAMESPACE, { + author: [], + uuid: '7a7065d7-6e8b-4aae-8d20-c93613dec9f9', + created_at: new Date(ANCHOR_DATE).toISOString(), + updated_at: new Date(ANCHOR_DATE).toISOString(), + created_by: 'elastic', + description: 'some description', + enabled: true, + false_positives: ['false positive 1', 'false positive 2'], + from: 'now-6m', + immutable: false, + name: 'Query with a rule id', + query: 'user.name: root or user.name: admin', + references: ['test 1', 'test 2'], + severity: 'high', + severity_mapping: [], + updated_by: 'elastic_kibana', + tags: ['some fake tag 1', 'some fake tag 2'], + to: 'now', + type: 'query', + threat: [], + threshold: { + field: ['source.ip', 'host.name'], + value: 1, + }, + version: 1, + status: 'succeeded', + status_date: '2020-02-22T16:47:50.047Z', + last_success_at: '2020-02-22T16:47:50.047Z', + last_success_message: 'succeeded', + max_signals: 100, + risk_score: 55, + risk_score_mapping: [], + language: 'kuery', + rule_id: 'f88a544c-1d4e-4652-ae2a-c953b38da5d0', + interval: '5m', + exceptions_list: getListArrayMock(), + }) as TypeOfFieldMap), + 'kibana.alert.depth': 1, + }, +}; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_factory.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_factory.ts index 879d776f83df2..2d3a4a5afa5c2 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_factory.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_factory.ts @@ -8,9 +8,12 @@ import { isEmpty } from 'lodash'; import { flow } from 'fp-ts/lib/function'; import { Either, chain, fold, tryCatch } from 'fp-ts/lib/Either'; + +import { TIMESTAMP } from '@kbn/rule-data-utils'; import { parseScheduleDates } from '@kbn/securitysolution-io-ts-utils'; import { ListArray } from '@kbn/securitysolution-io-ts-list-types'; import { toError } from '@kbn/securitysolution-list-api'; + import { createPersistenceRuleTypeFactory } from '../../../../../rule_registry/server'; import { buildRuleMessageFactory } from './factories/build_rule_message_factory'; import { @@ -30,7 +33,7 @@ import { } from '../notifications/schedule_notification_actions'; import { getNotificationResultsLink } from '../notifications/utils'; import { createResultObject } from './utils'; -import { bulkCreateFactory, wrapHitsFactory } from './factories'; +import { bulkCreateFactory, wrapHitsFactory, wrapSequencesFactory } from './factories'; import { RuleExecutionLogClient } from '../rule_execution_log/rule_execution_log_client'; import { RuleExecutionStatus } from '../../../../common/detection_engine/schemas/common/schemas'; import { scheduleThrottledNotificationActions } from '../notifications/schedule_throttle_notification_actions'; @@ -40,6 +43,7 @@ export const createSecurityRuleTypeFactory: CreateSecurityRuleTypeFactory = ({ lists, logger, mergeStrategy, + ignoreFields, ruleDataClient, ruleDataService, }) => (type) => { @@ -107,9 +111,7 @@ export const createSecurityRuleTypeFactory: CreateSecurityRuleTypeFactory = ({ checkPrivilegesFromEsClient(esClient, inputIndices), esClient.fieldCaps({ index: index ?? ['*'], - fields: hasTimestampOverride - ? ['@timestamp', timestampOverride as string] - : ['@timestamp'], + fields: hasTimestampOverride ? [TIMESTAMP, timestampOverride as string] : [TIMESTAMP], include_unmapped: true, }), ]); @@ -208,6 +210,15 @@ export const createSecurityRuleTypeFactory: CreateSecurityRuleTypeFactory = ({ const wrapHits = wrapHitsFactory({ logger, + ignoreFields, + mergeStrategy, + ruleSO, + spaceId, + }); + + const wrapSequences = wrapSequencesFactory({ + logger, + ignoreFields, mergeStrategy, ruleSO, spaceId, @@ -227,6 +238,7 @@ export const createSecurityRuleTypeFactory: CreateSecurityRuleTypeFactory = ({ searchAfterSize, tuple, wrapHits, + wrapSequences, }, }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/create_eql_alert_type.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/create_eql_alert_type.test.ts new file mode 100644 index 0000000000000..868419179c76b --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/create_eql_alert_type.test.ts @@ -0,0 +1,61 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { elasticsearchClientMock } from 'src/core/server/elasticsearch/client/mocks'; + +import { allowedExperimentalValues } from '../../../../../common/experimental_features'; +import { createEqlAlertType } from './create_eql_alert_type'; +import { createRuleTypeMocks } from '../__mocks__/rule_type'; +import { getEqlRuleParams } from '../../schemas/rule_schemas.mock'; + +jest.mock('../../rule_execution_log/rule_execution_log_client'); + +describe('Event correlation alerts', () => { + it('does not send an alert when no events found', async () => { + const params = { + ...getEqlRuleParams(), + query: 'any where false', + }; + const { services, dependencies, executor } = createRuleTypeMocks('eql', params); + const eqlAlertType = createEqlAlertType({ + experimentalFeatures: allowedExperimentalValues, + lists: dependencies.lists, + logger: dependencies.logger, + ignoreFields: [], + mergeStrategy: 'allFields', + ruleDataClient: dependencies.ruleDataClient, + ruleDataService: dependencies.ruleDataService, + version: '1.0.0', + }); + dependencies.alerting.registerType(eqlAlertType); + services.scopedClusterClient.asCurrentUser.search.mockReturnValue( + elasticsearchClientMock.createSuccessTransportRequestPromise({ + hits: { + hits: [], + sequences: [], + events: [], + total: { + relation: 'eq', + value: 0, + }, + }, + took: 0, + timed_out: false, + _shards: { + failed: 0, + skipped: 0, + successful: 1, + total: 1, + }, + }) + ); + + await executor({ params }); + expect(dependencies.ruleDataClient.getWriter).not.toBeCalled(); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/create_eql_alert_type.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/create_eql_alert_type.ts new file mode 100644 index 0000000000000..5893c6fdc86c2 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/create_eql_alert_type.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 { validateNonExact } from '@kbn/securitysolution-io-ts-utils'; +import { PersistenceServices } from '../../../../../../rule_registry/server'; +import { EQL_RULE_TYPE_ID } from '../../../../../common/constants'; +import { eqlRuleParams, EqlRuleParams } from '../../schemas/rule_schemas'; +import { eqlExecutor } from '../../signals/executors/eql'; +import { createSecurityRuleTypeFactory } from '../create_security_rule_type_factory'; +import { CreateRuleOptions } from '../types'; + +export const createEqlAlertType = (createOptions: CreateRuleOptions) => { + const { + experimentalFeatures, + lists, + logger, + ignoreFields, + mergeStrategy, + ruleDataClient, + version, + ruleDataService, + } = createOptions; + const createSecurityRuleType = createSecurityRuleTypeFactory({ + lists, + logger, + ignoreFields, + mergeStrategy, + ruleDataClient, + ruleDataService, + }); + return createSecurityRuleType({ + id: EQL_RULE_TYPE_ID, + name: 'Event Correlation Rule', + validate: { + params: { + validate: (object: unknown) => { + const [validated, errors] = validateNonExact(object, eqlRuleParams); + if (errors != null) { + throw new Error(errors); + } + if (validated == null) { + throw new Error('Validation of rule params failed'); + } + return validated; + }, + }, + }, + actionGroups: [ + { + id: 'default', + name: 'Default', + }, + ], + defaultActionGroupId: 'default', + actionVariables: { + context: [{ name: 'server', description: 'the server' }], + }, + minimumLicenseRequired: 'basic', + isExportable: false, + producer: 'security-solution', + async executor(execOptions) { + const { + runOpts: { + bulkCreate, + exceptionItems, + rule, + searchAfterSize, + tuple, + wrapHits, + wrapSequences, + }, + services, + state, + } = execOptions; + + const result = await eqlExecutor({ + bulkCreate, + exceptionItems, + experimentalFeatures, + logger, + rule, + searchAfterSize, + services, + tuple, + version, + wrapHits, + wrapSequences, + }); + return { ...result, state }; + }, + }); +}; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/bulk_create_factory.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/bulk_create_factory.ts index c600e187bc8f1..cd7a5150ad384 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/bulk_create_factory.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/bulk_create_factory.ts @@ -5,6 +5,8 @@ * 2.0. */ +import { ALERT_INSTANCE_ID } from '@kbn/rule-data-utils'; + import { performance } from 'perf_hooks'; import { countBy, isEmpty } from 'lodash'; @@ -62,11 +64,15 @@ export const bulkCreateFactory = ( ); const createdItems = wrappedDocs - .map((doc, index) => ({ - _id: response.body.items[index].index?._id ?? '', - _index: response.body.items[index].index?._index ?? '', - ...doc._source, - })) + .map((doc, index) => { + const responseIndex = response.body.items[index].index; + return { + _id: responseIndex?._id ?? '', + _index: responseIndex?._index ?? '', + [ALERT_INSTANCE_ID]: responseIndex?._id ?? '', + ...doc._source, + }; + }) .filter((_, index) => response.body.items[index].index?.status === 201); const createdItemsCount = createdItems.length; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/index.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/index.ts index 76263745ba7ae..1c1f6fab6322b 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/index.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/index.ts @@ -8,3 +8,4 @@ export * from './build_rule_message_factory'; export * from './bulk_create_factory'; export * from './wrap_hits_factory'; +export * from './wrap_sequences_factory'; 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 a95da275fc530..453c4d8b785d3 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 @@ -13,6 +13,7 @@ import { ALERT_STATUS_ACTIVE, ALERT_WORKFLOW_STATUS, SPACE_IDS, + TIMESTAMP, } from '@kbn/rule-data-utils'; import { sampleDocNoSortIdWithTimestamp } from '../../../signals/__mocks__/es_results'; @@ -32,13 +33,14 @@ import { import { getListArrayMock } from '../../../../../../common/detection_engine/schemas/types/lists.mock'; import { ALERT_ANCESTORS, + ALERT_DEPTH, ALERT_ORIGINAL_EVENT, ALERT_ORIGINAL_TIME, } from '../../field_maps/field_names'; import { SERVER_APP_ID } from '../../../../../../common/constants'; type SignalDoc = SignalSourceHit & { - _source: Required['_source'] & { '@timestamp': string }; + _source: Required['_source'] & { [TIMESTAMP]: string }; }; const SPACE_ID = 'space'; @@ -57,9 +59,9 @@ describe('buildAlert', () => { ...buildAlert([doc], rule, SPACE_ID, reason), ...additionalAlertFields(doc), }; - const timestamp = alert['@timestamp']; + const timestamp = alert[TIMESTAMP]; const expected = { - '@timestamp': timestamp, + [TIMESTAMP]: timestamp, [SPACE_IDS]: [SPACE_ID], [ALERT_RULE_CONSUMER]: SERVER_APP_ID, [ALERT_ANCESTORS]: [ @@ -76,7 +78,7 @@ describe('buildAlert', () => { [ALERT_WORKFLOW_STATUS]: 'open', ...flattenWithPrefix(ALERT_RULE_NAMESPACE, { author: [], - id: '7a7065d7-6e8b-4aae-8d20-c93613dec9f9', + uuid: '7a7065d7-6e8b-4aae-8d20-c93613dec9f9', created_at: new Date(ANCHOR_DATE).toISOString(), updated_at: new Date(ANCHOR_DATE).toISOString(), created_by: 'elastic', @@ -100,7 +102,6 @@ describe('buildAlert', () => { status_date: '2020-02-22T16:47:50.047Z', last_success_at: '2020-02-22T16:47:50.047Z', last_success_message: 'succeeded', - output_index: '.siem-signals-default', max_signals: 100, risk_score: 55, risk_score_mapping: [], @@ -109,7 +110,7 @@ describe('buildAlert', () => { interval: '5m', exceptions_list: getListArrayMock(), }), - 'kibana.alert.depth': 1, + [ALERT_DEPTH]: 1, }; expect(alert).toEqual(expected); }); @@ -128,9 +129,9 @@ describe('buildAlert', () => { ...buildAlert([doc], rule, SPACE_ID, reason), ...additionalAlertFields(doc), }; - const timestamp = alert['@timestamp']; + const timestamp = alert[TIMESTAMP]; const expected = { - '@timestamp': timestamp, + [TIMESTAMP]: timestamp, [SPACE_IDS]: [SPACE_ID], [ALERT_RULE_CONSUMER]: SERVER_APP_ID, [ALERT_ANCESTORS]: [ @@ -153,7 +154,7 @@ describe('buildAlert', () => { [ALERT_WORKFLOW_STATUS]: 'open', ...flattenWithPrefix(ALERT_RULE_NAMESPACE, { author: [], - id: '7a7065d7-6e8b-4aae-8d20-c93613dec9f9', + uuid: '7a7065d7-6e8b-4aae-8d20-c93613dec9f9', created_at: new Date(ANCHOR_DATE).toISOString(), updated_at: new Date(ANCHOR_DATE).toISOString(), created_by: 'elastic', @@ -177,7 +178,6 @@ describe('buildAlert', () => { status_date: '2020-02-22T16:47:50.047Z', last_success_at: '2020-02-22T16:47:50.047Z', last_success_message: 'succeeded', - output_index: '.siem-signals-default', max_signals: 100, risk_score: 55, risk_score_mapping: [], @@ -186,7 +186,7 @@ describe('buildAlert', () => { interval: '5m', exceptions_list: getListArrayMock(), }), - 'kibana.alert.depth': 1, + [ALERT_DEPTH]: 1, }; expect(alert).toEqual(expected); }); @@ -256,7 +256,7 @@ describe('buildAlert', () => { ...sampleDoc, _source: { ...sampleDoc._source, - '@timestamp': new Date().toISOString(), + [TIMESTAMP]: new Date().toISOString(), }, }; doc._source.event = { @@ -283,7 +283,7 @@ describe('buildAlert', () => { ...sampleDoc, _source: { ...sampleDoc._source, - '@timestamp': new Date().toISOString(), + [TIMESTAMP]: new Date().toISOString(), }, }; doc._source.event = { @@ -340,7 +340,7 @@ describe('buildAlert', () => { ...sampleDoc, _source: { ...sampleDoc._source, - '@timestamp': new Date().toISOString(), + [TIMESTAMP]: new Date().toISOString(), }, }; const output = removeClashes(doc); @@ -353,7 +353,7 @@ describe('buildAlert', () => { ...sampleDoc, _source: { ...sampleDoc._source, - '@timestamp': new Date().toISOString(), + [TIMESTAMP]: new Date().toISOString(), }, }; const output = removeClashes(doc); @@ -370,12 +370,12 @@ describe('buildAlert', () => { }, } as unknown) as SignalDoc; const output = removeClashes(doc); - const timestamp = output._source['@timestamp']; + const timestamp = output._source[TIMESTAMP]; expect(output).toEqual({ ...sampleDoc, _source: { ...sampleDoc._source, - '@timestamp': timestamp, + [TIMESTAMP]: timestamp, }, }); }); @@ -390,12 +390,12 @@ describe('buildAlert', () => { }, } as unknown) as SignalDoc; const output = removeClashes(doc); - const timestamp = output._source['@timestamp']; + const timestamp = output._source[TIMESTAMP]; expect(output).toEqual({ ...sampleDoc, _source: { ...sampleDoc._source, - '@timestamp': timestamp, + [TIMESTAMP]: timestamp, }, }); }); @@ -410,13 +410,13 @@ describe('buildAlert', () => { }, } as unknown) as SignalDoc; const output = removeClashes(doc); - const timestamp = output._source['@timestamp']; + const timestamp = output._source[TIMESTAMP]; const expected = { ...sampleDoc, _source: { ...sampleDoc._source, signal: { rule: { id: '123' } }, - '@timestamp': timestamp, + [TIMESTAMP]: timestamp, }, }; expect(output).toEqual(expected); 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 1377e9ef9207e..d39d6fa2eb805 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 @@ -9,11 +9,16 @@ import { ALERT_REASON, ALERT_RULE_CONSUMER, ALERT_RULE_NAMESPACE, + ALERT_RULE_UUID, ALERT_STATUS, ALERT_STATUS_ACTIVE, ALERT_WORKFLOW_STATUS, SPACE_IDS, + TIMESTAMP, } from '@kbn/rule-data-utils'; + +import { createHash } from 'crypto'; + import { RulesSchema } from '../../../../../../common/detection_engine/schemas/response/rules_schema'; import { isEventTypeSignal } from '../../../signals/build_event_type_signal'; import { Ancestor, BaseSignalHit, SimpleHit } from '../../../signals/types'; @@ -34,6 +39,16 @@ import { } from '../../field_maps/field_names'; import { SERVER_APP_ID } from '../../../../../../common/constants'; +export const generateAlertId = (alert: RACAlert) => { + return createHash('sha256') + .update( + (alert['kibana.alert.ancestors'] as Ancestor[]) + .reduce((acc, ancestor) => acc.concat(ancestor.id, ancestor.index), '') + .concat(alert[ALERT_RULE_UUID] as string) + ) + .digest('hex'); +}; + /** * Takes an event document and extracts the information needed for the corresponding entry in the child * alert's ancestors array. @@ -105,8 +120,11 @@ export const buildAlert = ( [] ); + const { id, output_index: outputIndex, ...mappedRule } = rule; + mappedRule.uuid = id; + return ({ - '@timestamp': new Date().toISOString(), + [TIMESTAMP]: new Date().toISOString(), [ALERT_RULE_CONSUMER]: SERVER_APP_ID, [SPACE_IDS]: spaceId != null ? [spaceId] : [], [ALERT_ANCESTORS]: ancestors, @@ -114,7 +132,7 @@ export const buildAlert = ( [ALERT_WORKFLOW_STATUS]: 'open', [ALERT_DEPTH]: depth, [ALERT_REASON]: reason, - ...flattenWithPrefix(ALERT_RULE_NAMESPACE, rule), + ...flattenWithPrefix(ALERT_RULE_NAMESPACE, mappedRule as RulesSchema), } as unknown) as RACAlert; }; 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 new file mode 100644 index 0000000000000..09367c97e0187 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.test.ts @@ -0,0 +1,153 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { Logger } from 'kibana/server'; + +import { ALERT_RULE_CONSUMER } from '@kbn/rule-data-utils'; + +import { sampleDocNoSortId } from '../../../signals/__mocks__/es_results'; +import { buildAlertGroupFromSequence } from './build_alert_group_from_sequence'; +import { getRulesSchemaMock } from '../../../../../../common/detection_engine/schemas/response/rules_schema.mocks'; +import { + ALERT_ANCESTORS, + ALERT_BUILDING_BLOCK_TYPE, + ALERT_DEPTH, + ALERT_GROUP_ID, +} from '../../field_maps/field_names'; +import { SERVER_APP_ID } from '../../../../../../common/constants'; +import { getQueryRuleParams } from '../../../schemas/rule_schemas.mock'; + +const SPACE_ID = 'space'; + +const loggerMock = ({ + debug: jest.fn(), + info: jest.fn(), + warn: jest.fn(), + error: jest.fn(), +} as unknown) as Logger; + +describe('buildAlert', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + test('it builds an alert composed of a sequence', () => { + expect(true).toEqual(true); + }); + + test('it builds an alert as expected without original_event if event does not exist', () => { + const rule = getRulesSchemaMock(); + const ruleSO = { + attributes: { + actions: [], + createdAt: new Date().toISOString(), + createdBy: 'gandalf', + params: getQueryRuleParams(), + schedule: { interval: '1m' }, + throttle: 'derp', + updatedAt: new Date().toISOString(), + updatedBy: 'galadriel', + ...rule, + }, + id: 'abcd', + references: [], + type: 'rule', + }; + const eqlSequence = { + join_keys: [], + events: [ + sampleDocNoSortId('d5e8eb51-a6a0-456d-8a15-4b79bfec3d71'), + sampleDocNoSortId('619389b2-b077-400e-b40b-abde20d675d3'), + ], + }; + const alertGroup = buildAlertGroupFromSequence( + loggerMock, + eqlSequence, + ruleSO, + 'allFields', + SPACE_ID, + jest.fn() + ); + expect(alertGroup.length).toEqual(3); + expect(alertGroup[0]).toEqual( + expect.objectContaining({ + _source: expect.objectContaining({ + [ALERT_ANCESTORS]: [ + { + depth: 0, + id: 'd5e8eb51-a6a0-456d-8a15-4b79bfec3d71', + index: 'myFakeSignalIndex', + type: 'event', + }, + ], + [ALERT_DEPTH]: 1, + [ALERT_RULE_CONSUMER]: SERVER_APP_ID, + [ALERT_BUILDING_BLOCK_TYPE]: 'default', + }), + }) + ); + expect(alertGroup[1]).toEqual( + expect.objectContaining({ + _source: expect.objectContaining({ + [ALERT_ANCESTORS]: [ + { + depth: 0, + id: '619389b2-b077-400e-b40b-abde20d675d3', + index: 'myFakeSignalIndex', + type: 'event', + }, + ], + [ALERT_DEPTH]: 1, + [ALERT_RULE_CONSUMER]: SERVER_APP_ID, + [ALERT_BUILDING_BLOCK_TYPE]: 'default', + }), + }) + ); + expect(alertGroup[2]).toEqual( + expect.objectContaining({ + _source: expect.objectContaining({ + [ALERT_ANCESTORS]: expect.arrayContaining([ + { + depth: 0, + id: 'd5e8eb51-a6a0-456d-8a15-4b79bfec3d71', + index: 'myFakeSignalIndex', + type: 'event', + }, + { + depth: 0, + id: '619389b2-b077-400e-b40b-abde20d675d3', + index: 'myFakeSignalIndex', + type: 'event', + }, + { + depth: 1, + id: alertGroup[0]._id, + index: '', + rule: 'abcd', + type: 'signal', + }, + { + depth: 1, + id: alertGroup[1]._id, + index: '', + rule: 'abcd', + type: 'signal', + }, + ]), + [ALERT_DEPTH]: 2, + [ALERT_RULE_CONSUMER]: SERVER_APP_ID, + [ALERT_BUILDING_BLOCK_TYPE]: 'default', + }), + }) + ); + + const groupIds = alertGroup.map((alert) => alert._source[ALERT_GROUP_ID]); + for (const groupId of groupIds) { + expect(groupId).toEqual(groupIds[0]); + } + }); +}); 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 new file mode 100644 index 0000000000000..14e0411522a19 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.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 { ALERT_INSTANCE_ID } from '@kbn/rule-data-utils'; + +import { Logger } from 'kibana/server'; + +import { SavedObject } from 'src/core/types'; +import type { ConfigType } from '../../../../../config'; +import { buildRuleWithoutOverrides } from '../../../signals/build_rule'; +import { AlertAttributes, Ancestor, SignalSource } from '../../../signals/types'; +import { RACAlert, WrappedRACAlert } from '../../types'; +import { buildAlert, buildAncestors, generateAlertId } from './build_alert'; +import { buildBulkBody } from './build_bulk_body'; +import { EqlSequence } from '../../../../../../common/detection_engine/types'; +import { generateBuildingBlockIds } from './generate_building_block_ids'; +import { objectArrayIntersection } from '../../../signals/build_bulk_body'; +import { BuildReasonMessage } from '../../../signals/reason_formatters'; +import { + ALERT_BUILDING_BLOCK_TYPE, + ALERT_GROUP_ID, + ALERT_GROUP_INDEX, +} from '../../field_maps/field_names'; + +/** + * Takes N raw documents from ES that form a sequence and builds them into N+1 signals ready to be indexed - + * one signal for each event in the sequence, and a "shell" signal that ties them all together. All N+1 signals + * share the same signal.group.id to make it easy to query them. + * @param sequence The raw ES documents that make up the sequence + * @param ruleSO SavedObject representing the rule that found the sequence + */ +export const buildAlertGroupFromSequence = ( + logger: Logger, + sequence: EqlSequence, + ruleSO: SavedObject, + mergeStrategy: ConfigType['alertMergeStrategy'], + spaceId: string | null | undefined, + buildReasonMessage: BuildReasonMessage +): WrappedRACAlert[] => { + const ancestors: Ancestor[] = sequence.events.flatMap((event) => buildAncestors(event)); + if (ancestors.some((ancestor) => ancestor?.rule === ruleSO.id)) { + return []; + } + + let buildingBlocks: RACAlert[] = []; + try { + buildingBlocks = sequence.events.map((event) => ({ + ...buildBulkBody(spaceId, ruleSO, event, mergeStrategy, [], false, buildReasonMessage), + [ALERT_BUILDING_BLOCK_TYPE]: 'default', + })); + } catch (error) { + logger.error(error); + return []; + } + + const buildingBlockIds = generateBuildingBlockIds(buildingBlocks); + const wrappedBuildingBlocks: WrappedRACAlert[] = buildingBlocks.map((block, i) => ({ + _id: buildingBlockIds[i], + _index: '', + _source: { + ...block, + [ALERT_INSTANCE_ID]: buildingBlockIds[i], + }, + })); + + // Now that we have an array of building blocks for the events in the sequence, + // we can build the signal that links the building blocks together + // and also insert the group id (which is also the "shell" signal _id) in each building block + const doc = buildAlertRoot(wrappedBuildingBlocks, ruleSO, spaceId, buildReasonMessage); + const sequenceAlert = { + _id: generateAlertId(doc), + _index: '', + _source: doc, + }; + + wrappedBuildingBlocks.forEach((block, i) => { + block._source[ALERT_GROUP_ID] = sequenceAlert._source[ALERT_GROUP_ID]; + block._source[ALERT_GROUP_INDEX] = i; + }); + + return [...wrappedBuildingBlocks, sequenceAlert]; +}; + +export const buildAlertRoot = ( + wrappedBuildingBlocks: WrappedRACAlert[], + ruleSO: SavedObject, + spaceId: string | null | undefined, + buildReasonMessage: BuildReasonMessage +): RACAlert => { + const rule = buildRuleWithoutOverrides(ruleSO); + const reason = buildReasonMessage({ rule }); + const doc = buildAlert(wrappedBuildingBlocks, rule, spaceId, reason); + const mergedAlerts = objectArrayIntersection(wrappedBuildingBlocks.map((alert) => alert._source)); + return { + ...mergedAlerts, + event: { + kind: 'signal', + }, + ...doc, + [ALERT_GROUP_ID]: generateAlertId(doc), + }; +}; 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 ae2ebc787451b..56ad78594e9fd 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 @@ -5,13 +5,14 @@ * 2.0. */ +import { TIMESTAMP } from '@kbn/rule-data-utils'; import { SavedObject } from 'src/core/types'; import { BaseHit } from '../../../../../../common/detection_engine/types'; import type { ConfigType } from '../../../../../config'; import { buildRuleWithOverrides, buildRuleWithoutOverrides } from '../../../signals/build_rule'; import { BuildReasonMessage } from '../../../signals/reason_formatters'; import { getMergeStrategy } from '../../../signals/source_fields_merging/strategies'; -import { AlertAttributes, SignalSource, SignalSourceHit } from '../../../signals/types'; +import { AlertAttributes, SignalSource, SignalSourceHit, SimpleHit } from '../../../signals/types'; import { RACAlert } from '../../types'; import { additionalAlertFields, buildAlert } from './build_alert'; import { filterSource } from './filter_source'; @@ -34,12 +35,13 @@ const isSourceDoc = ( export const buildBulkBody = ( spaceId: string | null | undefined, ruleSO: SavedObject, - doc: SignalSourceHit, + doc: SimpleHit, mergeStrategy: ConfigType['alertMergeStrategy'], + ignoreFields: ConfigType['alertIgnoreFields'], applyOverrides: boolean, buildReasonMessage: BuildReasonMessage ): RACAlert => { - const mergedDoc = getMergeStrategy(mergeStrategy)({ doc }); + const mergedDoc = getMergeStrategy(mergeStrategy)({ doc, ignoreFields }); const rule = applyOverrides ? buildRuleWithOverrides(ruleSO, mergedDoc._source ?? {}) : buildRuleWithoutOverrides(ruleSO); @@ -52,7 +54,7 @@ export const buildBulkBody = ( ...filteredSource, ...buildAlert([mergedDoc], rule, spaceId, reason), ...additionalAlertFields(mergedDoc), - '@timestamp': timestamp, + [TIMESTAMP]: timestamp, }; } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/flatten_with_prefix.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/flatten_with_prefix.ts index d472dc5885e57..02f418a151888 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/flatten_with_prefix.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/flatten_with_prefix.ts @@ -5,16 +5,26 @@ * 2.0. */ +import { isPlainObject } from 'lodash'; import { SearchTypes } from '../../../../../../common/detection_engine/types'; export const flattenWithPrefix = ( prefix: string, - obj: Record + maybeObj: unknown ): Record => { - return Object.keys(obj).reduce((acc: Record, key) => { + if (maybeObj != null && isPlainObject(maybeObj)) { + return Object.keys(maybeObj as Record).reduce( + (acc: Record, key) => { + return { + ...acc, + ...flattenWithPrefix(`${prefix}.${key}`, (maybeObj as Record)[key]), + }; + }, + {} + ); + } else { return { - ...acc, - [`${prefix}.${key}`]: obj[key], + [prefix]: maybeObj as SearchTypes, }; - }, {}); + } }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/generate_building_block_ids.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/generate_building_block_ids.ts new file mode 100644 index 0000000000000..84e7f9e3ecef2 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/generate_building_block_ids.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 { ALERT_RULE_UUID } from '@kbn/rule-data-utils'; +import { createHash } from 'crypto'; +import { Ancestor } from '../../../signals/types'; +import { ALERT_ANCESTORS } from '../../field_maps/field_names'; +import { RACAlert } from '../../types'; + +/** + * Generates unique doc ids for each building block signal within a sequence. The id of each building block + * depends on the parents of every building block, so that a signal which appears in multiple different sequences + * (e.g. if multiple rules build sequences that share a common event/signal) will get a unique id per sequence. + * @param buildingBlocks The full list of building blocks in the sequence. + */ +export const generateBuildingBlockIds = (buildingBlocks: RACAlert[]): string[] => { + const baseHashString = buildingBlocks.reduce( + (baseString, block) => + baseString + .concat( + (block[ALERT_ANCESTORS] as Ancestor[]).reduce( + (acc, ancestor) => acc.concat(ancestor.id, ancestor.index), + '' + ) + ) + .concat(block[ALERT_RULE_UUID] as string), + '' + ); + return buildingBlocks.map((block, idx) => + createHash('sha256').update(baseHashString).update(String(idx)).digest('hex') + ); +}; 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 62946c52b7f40..1b169a2996b7e 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 @@ -7,15 +7,15 @@ import { Logger } from 'kibana/server'; -import { SearchAfterAndBulkCreateParams, SignalSourceHit, WrapHits } from '../../signals/types'; -import { buildBulkBody } from './utils/build_bulk_body'; -import { generateId } from '../../signals/utils'; -import { filterDuplicateSignals } from '../../signals/filter_duplicate_signals'; import type { ConfigType } from '../../../../config'; -import { WrappedRACAlert } from '../types'; +import { filterDuplicateSignals } from '../../signals/filter_duplicate_signals'; +import { SearchAfterAndBulkCreateParams, SimpleHit, WrapHits } from '../../signals/types'; +import { generateId } from '../../signals/utils'; +import { buildBulkBody } from './utils/build_bulk_body'; export const wrapHitsFactory = ({ logger, + ignoreFields, mergeStrategy, ruleSO, spaceId, @@ -23,28 +23,30 @@ export const wrapHitsFactory = ({ logger: Logger; ruleSO: SearchAfterAndBulkCreateParams['ruleSO']; mergeStrategy: ConfigType['alertMergeStrategy']; + ignoreFields: ConfigType['alertIgnoreFields']; spaceId: string | null | undefined; }): WrapHits => (events, buildReasonMessage) => { try { - const wrappedDocs: WrappedRACAlert[] = events.flatMap((doc) => [ - { + const wrappedDocs = events.map((event) => { + return { _index: '', _id: generateId( - doc._index, - doc._id, - String(doc._version), + event._index, + event._id, + String(event._version), ruleSO.attributes.params.ruleId ?? '' ), _source: buildBulkBody( spaceId, ruleSO, - doc as SignalSourceHit, + event as SimpleHit, mergeStrategy, + ignoreFields, true, buildReasonMessage ), - }, - ]); + }; + }); return filterDuplicateSignals(ruleSO.id, wrappedDocs, true); } catch (error) { 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 new file mode 100644 index 0000000000000..edfb220d8b6ba --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_sequences_factory.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 { Logger } from 'kibana/server'; + +import { SearchAfterAndBulkCreateParams, WrapSequences } from '../../signals/types'; +import { buildAlertGroupFromSequence } from './utils/build_alert_group_from_sequence'; +import { ConfigType } from '../../../../config'; +import { WrappedRACAlert } from '../types'; + +export const wrapSequencesFactory = ({ + logger, + ruleSO, + ignoreFields, + mergeStrategy, + spaceId, +}: { + logger: Logger; + ruleSO: SearchAfterAndBulkCreateParams['ruleSO']; + ignoreFields: ConfigType['alertIgnoreFields']; + mergeStrategy: ConfigType['alertMergeStrategy']; + spaceId: string | null | undefined; +}): WrapSequences => (sequences, buildReasonMessage) => + sequences.reduce( + (acc: WrappedRACAlert[], sequence) => [ + ...acc, + ...buildAlertGroupFromSequence( + logger, + sequence, + ruleSO, + mergeStrategy, + spaceId, + buildReasonMessage + ), + ], + [] + ); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/field_maps/alerts.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/field_maps/alerts.ts index 1c4b7f03fd73f..f21fc5b6ad393 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/field_maps/alerts.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/field_maps/alerts.ts @@ -43,11 +43,6 @@ export const alertsFieldMap: FieldMap = { array: false, required: true, }, - 'kibana.alert.group': { - type: 'object', - array: false, - required: false, - }, 'kibana.alert.group.id': { type: 'keyword', array: false, @@ -58,11 +53,6 @@ export const alertsFieldMap: FieldMap = { array: false, required: false, }, - 'kibana.alert.original_event': { - type: 'object', - array: false, - required: false, - }, 'kibana.alert.original_event.action': { type: 'keyword', array: false, @@ -198,81 +188,6 @@ export const alertsFieldMap: FieldMap = { array: false, required: false, }, - 'kibana.alert.threat': { - type: 'object', - array: false, - required: false, - }, - 'kibana.alert.threat.framework': { - type: 'keyword', - array: false, - required: true, - }, - 'kibana.alert.threat.tactic': { - type: 'object', - array: false, - required: true, - }, - 'kibana.alert.threat.tactic.id': { - type: 'keyword', - array: false, - required: true, - }, - 'kibana.alert.threat.tactic.name': { - type: 'keyword', - array: false, - required: true, - }, - 'kibana.alert.threat.tactic.reference': { - type: 'keyword', - array: false, - required: true, - }, - 'kibana.alert.threat.technique': { - type: 'object', - array: false, - required: true, - }, - 'kibana.alert.threat.technique.id': { - type: 'keyword', - array: false, - required: true, - }, - 'kibana.alert.threat.technique.name': { - type: 'keyword', - array: false, - required: true, - }, - 'kibana.alert.threat.technique.reference': { - type: 'keyword', - array: false, - required: true, - }, - 'kibana.alert.threat.technique.subtechnique': { - type: 'object', - array: false, - required: true, - }, - 'kibana.alert.threat.technique.subtechnique.id': { - type: 'keyword', - array: false, - required: true, - }, - 'kibana.alert.threat.technique.subtechnique.name': { - type: 'keyword', - array: false, - required: true, - }, - 'kibana.alert.threat.technique.subtechnique.reference': { - type: 'keyword', - array: false, - required: true, - }, - 'kibana.alert.threshold_result': { - type: 'object', - array: false, - required: false, - }, 'kibana.alert.threshold_result.cardinality': { type: 'object', array: false, @@ -300,7 +215,7 @@ export const alertsFieldMap: FieldMap = { }, 'kibana.alert.threshold_result.terms': { type: 'object', - array: false, + array: true, required: false, }, 'kibana.alert.threshold_result.terms.field': { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/field_maps/field_names.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/field_maps/field_names.ts index 41b7e6b02c9c6..68d08e08086a0 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/field_maps/field_names.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/field_maps/field_names.ts @@ -5,9 +5,15 @@ * 2.0. */ -import { ALERT_NAMESPACE } from '@kbn/rule-data-utils'; +import { ALERT_NAMESPACE, ALERT_RULE_NAMESPACE } from '@kbn/rule-data-utils'; -export const ALERT_ANCESTORS = `${ALERT_NAMESPACE}.ancestors`; -export const ALERT_DEPTH = `${ALERT_NAMESPACE}.depth`; -export const ALERT_ORIGINAL_EVENT = `${ALERT_NAMESPACE}.original_event`; -export const ALERT_ORIGINAL_TIME = `${ALERT_NAMESPACE}.original_time`; +export const ALERT_ANCESTORS = `${ALERT_NAMESPACE}.ancestors` as const; +export const ALERT_BUILDING_BLOCK_TYPE = `${ALERT_NAMESPACE}.building_block_type` as const; +export const ALERT_DEPTH = `${ALERT_NAMESPACE}.depth` as const; +export const ALERT_GROUP_ID = `${ALERT_NAMESPACE}.group.id` as const; +export const ALERT_GROUP_INDEX = `${ALERT_NAMESPACE}.group.index` as const; +export const ALERT_ORIGINAL_EVENT = `${ALERT_NAMESPACE}.original_event` as const; +export const ALERT_ORIGINAL_TIME = `${ALERT_NAMESPACE}.original_time` as const; + +const ALERT_RULE_THRESHOLD = `${ALERT_RULE_NAMESPACE}.threshold` as const; +export const ALERT_RULE_THRESHOLD_FIELD = `${ALERT_RULE_THRESHOLD}.field` as const; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/field_maps/rules.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/field_maps/rules.ts index 21405672fdf7f..87b55e092ec5d 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/field_maps/rules.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/field_maps/rules.ts @@ -11,6 +11,11 @@ export const rulesFieldMap = { array: false, required: false, }, + 'kibana.alert.rule.exceptions_list': { + type: 'object', + array: true, + required: false, + }, 'kibana.alert.rule.false_positives': { type: 'keyword', array: true, @@ -46,6 +51,56 @@ export const rulesFieldMap = { array: true, required: true, }, + 'kibana.alert.rule.threat.framework': { + type: 'keyword', + array: false, + required: true, + }, + 'kibana.alert.rule.threat.tactic.id': { + type: 'keyword', + array: false, + required: true, + }, + 'kibana.alert.rule.threat.tactic.name': { + type: 'keyword', + array: false, + required: true, + }, + 'kibana.alert.rule.threat.tactic.reference': { + type: 'keyword', + array: false, + required: true, + }, + 'kibana.alert.rule.threat.technique.id': { + type: 'keyword', + array: false, + required: true, + }, + 'kibana.alert.rule.threat.technique.name': { + type: 'keyword', + array: false, + required: true, + }, + 'kibana.alert.rule.threat.technique.reference': { + type: 'keyword', + array: false, + required: true, + }, + 'kibana.alert.rule.threat.technique.subtechnique.id': { + type: 'keyword', + array: false, + required: true, + }, + 'kibana.alert.rule.threat.technique.subtechnique.name': { + type: 'keyword', + array: false, + required: true, + }, + 'kibana.alert.rule.threat.technique.subtechnique.reference': { + type: 'keyword', + array: false, + required: true, + }, 'kibana.alert.rule.threat_filters': { type: 'keyword', array: true, @@ -91,11 +146,6 @@ export const rulesFieldMap = { array: true, required: false, }, - 'kibana.alert.rule.threshold': { - type: 'object', - array: true, - required: false, - }, 'kibana.alert.rule.threshold.field': { type: 'keyword', array: true, @@ -103,7 +153,7 @@ export const rulesFieldMap = { }, 'kibana.alert.rule.threshold.value': { type: 'float', // TODO: should be 'long' (eventually, after we stabilize) - array: true, + array: false, required: false, }, 'kibana.alert.rule.threshold.cardinality': { @@ -113,12 +163,12 @@ export const rulesFieldMap = { }, 'kibana.alert.rule.threshold.cardinality.field': { type: 'keyword', - array: true, + array: false, required: false, }, 'kibana.alert.rule.threshold.cardinality.value': { type: 'long', - array: true, + array: false, required: false, }, 'kibana.alert.rule.timeline_id': { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/index.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/index.ts index 0fde90c991e40..1787a15588b51 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/index.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/index.ts @@ -5,6 +5,8 @@ * 2.0. */ -export { createQueryAlertType } from './query/create_query_alert_type'; +export { createEqlAlertType } from './eql/create_eql_alert_type'; export { createIndicatorMatchAlertType } from './indicator_match/create_indicator_match_alert_type'; export { createMlAlertType } from './ml/create_ml_alert_type'; +export { createQueryAlertType } from './query/create_query_alert_type'; +export { createThresholdAlertType } from './threshold/create_threshold_alert_type'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/create_indicator_match_alert_type.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/create_indicator_match_alert_type.test.ts index f13a5a5e0e715..fe836c872dcad 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/create_indicator_match_alert_type.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/create_indicator_match_alert_type.test.ts @@ -56,6 +56,7 @@ describe('Indicator Match Alerts', () => { experimentalFeatures: allowedExperimentalValues, lists: dependencies.lists, logger: dependencies.logger, + ignoreFields: [], mergeStrategy: 'allFields', ruleDataClient: dependencies.ruleDataClient, ruleDataService: dependencies.ruleDataService, @@ -97,6 +98,7 @@ describe('Indicator Match Alerts', () => { lists: dependencies.lists, logger: dependencies.logger, mergeStrategy: 'allFields', + ignoreFields: [], ruleDataClient: dependencies.ruleDataClient, ruleDataService: dependencies.ruleDataService, version: '1.0.0', @@ -135,6 +137,7 @@ describe('Indicator Match Alerts', () => { lists: dependencies.lists, logger: dependencies.logger, mergeStrategy: 'allFields', + ignoreFields: [], ruleDataClient: dependencies.ruleDataClient, ruleDataService: dependencies.ruleDataService, version: '1.0.0', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/create_indicator_match_alert_type.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/create_indicator_match_alert_type.ts index 71acc2e1cee85..e2d5da1def707 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/create_indicator_match_alert_type.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/create_indicator_match_alert_type.ts @@ -7,7 +7,7 @@ import { validateNonExact } from '@kbn/securitysolution-io-ts-utils'; import { PersistenceServices } from '../../../../../../rule_registry/server'; -import { INDICATOR_ALERT_TYPE_ID } from '../../../../../common/constants'; +import { INDICATOR_RULE_TYPE_ID } from '../../../../../common/constants'; import { threatRuleParams, ThreatRuleParams } from '../../schemas/rule_schemas'; import { threatMatchExecutor } from '../../signals/executors/threat_match'; import { createSecurityRuleTypeFactory } from '../create_security_rule_type_factory'; @@ -19,6 +19,7 @@ export const createIndicatorMatchAlertType = (createOptions: CreateRuleOptions) lists, logger, mergeStrategy, + ignoreFields, ruleDataClient, version, ruleDataService, @@ -27,11 +28,12 @@ export const createIndicatorMatchAlertType = (createOptions: CreateRuleOptions) lists, logger, mergeStrategy, + ignoreFields, ruleDataClient, ruleDataService, }); return createSecurityRuleType({ - id: INDICATOR_ALERT_TYPE_ID, + id: INDICATOR_RULE_TYPE_ID, name: 'Indicator Match Rule', validate: { params: { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml.ts index 14252bf62ef83..e0ad333b76a24 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml.ts @@ -14,7 +14,7 @@ import { SavedObject } from 'src/core/types'; import { buildEsQuery, IIndexPattern } from '../../../../../../../src/plugins/data/common'; import { createPersistenceRuleTypeFactory } from '../../../../../rule_registry/server'; -import { ML_ALERT_TYPE_ID } from '../../../../common/constants'; +import { ML_RULE_TYPE_ID } from '../../../../common/constants'; import { SecurityRuleRegistry } from '../../../plugin'; const createSecurityMlRuleType = createPersistenceRuleTypeFactory(); @@ -38,7 +38,7 @@ import { MachineLearningRuleAttributes } from '../signals/types'; import { createErrorsFromShard, createSearchAfterReturnType, mergeReturns } from '../signals/utils'; export const mlAlertType = createSecurityMlRuleType({ - id: ML_ALERT_TYPE_ID, + id: ML_RULE_TYPE_ID, name: 'Machine Learning Rule', validate: { params: schema.object({ diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/create_ml_alert_type.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/create_ml_alert_type.test.ts index 40566ffa04e6a..23cd2e94aedf8 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/create_ml_alert_type.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/create_ml_alert_type.test.ts @@ -98,6 +98,7 @@ describe('Machine Learning Alerts', () => { lists: dependencies.lists, logger: dependencies.logger, mergeStrategy: 'allFields', + ignoreFields: [], ml: mlMock, ruleDataClient: dependencies.ruleDataClient, ruleDataService: dependencies.ruleDataService, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/create_ml_alert_type.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/create_ml_alert_type.ts index 1d872df35de3a..7d891d430c63c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/create_ml_alert_type.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/create_ml_alert_type.ts @@ -7,23 +7,32 @@ import { validateNonExact } from '@kbn/securitysolution-io-ts-utils'; import { PersistenceServices } from '../../../../../../rule_registry/server'; -import { ML_ALERT_TYPE_ID } from '../../../../../common/constants'; +import { ML_RULE_TYPE_ID } from '../../../../../common/constants'; import { machineLearningRuleParams, MachineLearningRuleParams } from '../../schemas/rule_schemas'; import { mlExecutor } from '../../signals/executors/ml'; import { createSecurityRuleTypeFactory } from '../create_security_rule_type_factory'; import { CreateRuleOptions } from '../types'; export const createMlAlertType = (createOptions: CreateRuleOptions) => { - const { lists, logger, mergeStrategy, ml, ruleDataClient, ruleDataService } = createOptions; + const { + lists, + logger, + mergeStrategy, + ignoreFields, + ml, + ruleDataClient, + ruleDataService, + } = createOptions; const createSecurityRuleType = createSecurityRuleTypeFactory({ lists, logger, mergeStrategy, + ignoreFields, ruleDataClient, ruleDataService, }); return createSecurityRuleType({ - id: ML_ALERT_TYPE_ID, + id: ML_RULE_TYPE_ID, name: 'Machine Learning Rule', validate: { params: { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.test.ts index 903cf6adadd43..e45d8440386fe 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.test.ts @@ -24,7 +24,7 @@ jest.mock('../utils/get_list_client', () => ({ jest.mock('../../rule_execution_log/rule_execution_log_client'); -describe('Custom query alerts', () => { +describe('Custom Query Alerts', () => { it('does not send an alert when no events found', async () => { const { services, dependencies, executor } = createRuleTypeMocks(); const queryAlertType = createQueryAlertType({ @@ -32,6 +32,7 @@ describe('Custom query alerts', () => { lists: dependencies.lists, logger: dependencies.logger, mergeStrategy: 'allFields', + ignoreFields: [], ruleDataClient: dependencies.ruleDataClient, ruleDataService: dependencies.ruleDataService, version: '1.0.0', @@ -79,6 +80,7 @@ describe('Custom query alerts', () => { lists: dependencies.lists, logger: dependencies.logger, mergeStrategy: 'allFields', + ignoreFields: [], ruleDataClient: dependencies.ruleDataClient, ruleDataService: dependencies.ruleDataService, version: '1.0.0', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.ts index e59037f38ce56..d5af7a4c8b5a4 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.ts @@ -7,7 +7,7 @@ import { validateNonExact } from '@kbn/securitysolution-io-ts-utils'; import { PersistenceServices } from '../../../../../../rule_registry/server'; -import { QUERY_ALERT_TYPE_ID } from '../../../../../common/constants'; +import { QUERY_RULE_TYPE_ID } from '../../../../../common/constants'; import { queryRuleParams, QueryRuleParams } from '../../schemas/rule_schemas'; import { queryExecutor } from '../../signals/executors/query'; import { createSecurityRuleTypeFactory } from '../create_security_rule_type_factory'; @@ -19,6 +19,7 @@ export const createQueryAlertType = (createOptions: CreateRuleOptions) => { lists, logger, mergeStrategy, + ignoreFields, ruleDataClient, version, ruleDataService, @@ -27,11 +28,12 @@ export const createQueryAlertType = (createOptions: CreateRuleOptions) => { lists, logger, mergeStrategy, + ignoreFields, ruleDataClient, ruleDataService, }); return createSecurityRuleType({ - id: QUERY_ALERT_TYPE_ID, + id: QUERY_RULE_TYPE_ID, name: 'Custom Query Rule', validate: { params: { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_eql.sh b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_eql.sh new file mode 100755 index 0000000000000..576e3b7976011 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_eql.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# +# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +# or more contributor license agreements. Licensed under the Elastic License +# 2.0; you may not use this file except in compliance with the Elastic License +# 2.0. +# + +curl -X POST ${KIBANA_URL}${SPACE_URL}/api/alerts/alert \ + -u ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD} \ + -H 'kbn-xsrf: true' \ + -H 'Content-Type: application/json' \ + --verbose \ + -d ' +{ + "params":{ + "author": [], + "description": "Basic event correlation rule", + "exceptionsList": [], + "falsePositives": [], + "from": "now-300s", + "query": "any where true", + "immutable": false, + "index": ["*"], + "language": "eql", + "maxSignals": 10, + "outputIndex": "", + "references": [], + "riskScore": 21, + "riskScoreMapping": [], + "ruleId": "91dec1ba-b779-469c-9667-6b0e865fb86e", + "severity": "low", + "severityMapping": [], + "threat": [], + "to": "now", + "type": "eql", + "version": 1 + }, + "consumer":"alerts", + "alertTypeId":"siem.eqlRule", + "schedule":{ + "interval":"1m" + }, + "actions":[], + "tags":[ + "custom", + "persistence" + ], + "notifyWhen":"onActionGroupChange", + "name":"Basic event correlation rule" +}' + + diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_threshold.sh b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_threshold.sh new file mode 100644 index 0000000000000..47c5cb4eda2e9 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_threshold.sh @@ -0,0 +1,63 @@ +#!/bin/sh +# +# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one +# or more contributor license agreements. Licensed under the Elastic License +# 2.0; you may not use this file except in compliance with the Elastic License +# 2.0. +# + +curl -X POST ${KIBANA_URL}${SPACE_URL}/api/alerts/alert \ + -u ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD} \ + -H 'kbn-xsrf: true' \ + -H 'Content-Type: application/json' \ + --verbose \ + -d ' +{ + "params":{ + "author": [], + "description": "Basic threshold rule", + "exceptionsList": [], + "falsePositives": [], + "from": "now-300s", + "query": "*:*", + "immutable": false, + "index": ["*"], + "language": "kuery", + "maxSignals": 10, + "outputIndex": "", + "references": [], + "riskScore": 21, + "riskScoreMapping": [], + "ruleId": "52dec1ba-b779-469c-9667-6b0e865fb89a", + "severity": "low", + "severityMapping": [], + "threat": [], + "threshold": { + "field": ["source.ip"], + "value": 2, + "cardinality": [ + { + "field": "source.ip", + "value": 1 + } + ] + }, + "to": "now", + "type": "threshold", + "version": 1 + }, + "consumer":"alerts", + "alertTypeId":"siem.thresholdRule", + "schedule":{ + "interval":"1m" + }, + "actions":[], + "tags":[ + "custom", + "persistence" + ], + "notifyWhen":"onActionGroupChange", + "name":"Basic threshold rule" +}' + + diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/create_threshold_alert_type.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/create_threshold_alert_type.test.ts new file mode 100644 index 0000000000000..74435cb300472 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/create_threshold_alert_type.test.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { allowedExperimentalValues } from '../../../../../common/experimental_features'; +import { createThresholdAlertType } from './create_threshold_alert_type'; +import { createRuleTypeMocks } from '../__mocks__/rule_type'; +import { getThresholdRuleParams } from '../../schemas/rule_schemas.mock'; + +jest.mock('../../rule_execution_log/rule_execution_log_client'); + +describe('Threshold Alerts', () => { + it('does not send an alert when no events found', async () => { + const params = getThresholdRuleParams(); + const { dependencies, executor } = createRuleTypeMocks('threshold', params); + const thresholdAlertTpe = createThresholdAlertType({ + experimentalFeatures: allowedExperimentalValues, + lists: dependencies.lists, + logger: dependencies.logger, + mergeStrategy: 'allFields', + ignoreFields: [], + ruleDataClient: dependencies.ruleDataClient, + ruleDataService: dependencies.ruleDataService, + version: '1.0.0', + }); + dependencies.alerting.registerType(thresholdAlertTpe); + + await executor({ params }); + expect(dependencies.ruleDataClient.getWriter).not.toBeCalled(); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/create_threshold_alert_type.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/create_threshold_alert_type.ts new file mode 100644 index 0000000000000..a503cf5aedbea --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/create_threshold_alert_type.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 { validateNonExact } from '@kbn/securitysolution-io-ts-utils'; + +import { PersistenceServices } from '../../../../../../rule_registry/server'; +import { THRESHOLD_RULE_TYPE_ID } from '../../../../../common/constants'; +import { thresholdRuleParams, ThresholdRuleParams } from '../../schemas/rule_schemas'; +import { thresholdExecutor } from '../../signals/executors/threshold'; +import { ThresholdAlertState } from '../../signals/types'; +import { createSecurityRuleTypeFactory } from '../create_security_rule_type_factory'; +import { CreateRuleOptions } from '../types'; + +export const createThresholdAlertType = (createOptions: CreateRuleOptions) => { + const { + experimentalFeatures, + lists, + logger, + mergeStrategy, + ignoreFields, + ruleDataClient, + version, + ruleDataService, + } = createOptions; + const createSecurityRuleType = createSecurityRuleTypeFactory({ + lists, + logger, + mergeStrategy, + ignoreFields, + ruleDataClient, + ruleDataService, + }); + return createSecurityRuleType({ + id: THRESHOLD_RULE_TYPE_ID, + name: 'Threshold Rule', + validate: { + params: { + validate: (object: unknown): ThresholdRuleParams => { + const [validated, errors] = validateNonExact(object, thresholdRuleParams); + if (errors != null) { + throw new Error(errors); + } + if (validated == null) { + throw new Error('Validation of rule params failed'); + } + return validated; + }, + }, + }, + actionGroups: [ + { + id: 'default', + name: 'Default', + }, + ], + defaultActionGroupId: 'default', + actionVariables: { + context: [{ name: 'server', description: 'the server' }], + }, + minimumLicenseRequired: 'basic', + isExportable: false, + producer: 'security-solution', + async executor(execOptions) { + const { + runOpts: { buildRuleMessage, bulkCreate, exceptionItems, rule, tuple, wrapHits }, + services, + startedAt, + state, + } = execOptions; + + // console.log(JSON.stringify(state)); + + const result = await thresholdExecutor({ + buildRuleMessage, + bulkCreate, + exceptionItems, + experimentalFeatures, + logger, + rule, + services, + startedAt, + state, + tuple, + version, + wrapHits, + }); + + return result; + }, + }); +}; 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 f061240c4a6e5..6280a50d4981c 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 @@ -5,10 +5,12 @@ * 2.0. */ +import { Moment } from 'moment'; + import { SearchHit } from '@elastic/elasticsearch/api/types'; import { Logger } from '@kbn/logging'; import { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; -import { Moment } from 'moment'; + import { SavedObject } from '../../../../../../../src/core/server'; import { AlertInstanceContext, @@ -31,7 +33,7 @@ import { SetupPlugins } from '../../../plugin'; import { IRuleDataPluginService } from '../rule_execution_log/types'; import { RuleParams } from '../schemas/rule_schemas'; import { BuildRuleMessage } from '../signals/rule_messages'; -import { AlertAttributes, BulkCreate, WrapHits } from '../signals/types'; +import { AlertAttributes, BulkCreate, WrapHits, WrapSequences } from '../signals/types'; import { AlertsFieldMap, RulesFieldMap } from './field_maps'; import { ExperimentalFeatures } from '../../../../common/experimental_features'; @@ -67,6 +69,7 @@ export interface RunOpts { maxSignals: number; }; wrapHits: WrapHits; + wrapSequences: WrapSequences; } export type SecurityAlertTypeExecutor< @@ -96,6 +99,7 @@ export type CreateSecurityRuleTypeFactory = (options: { lists: SetupPlugins['lists']; logger: Logger; mergeStrategy: ConfigType['alertMergeStrategy']; + ignoreFields: ConfigType['alertIgnoreFields']; ruleDataClient: IRuleDataClient; ruleDataService: IRuleDataPluginService; }) => < @@ -124,6 +128,7 @@ export interface CreateRuleOptions { lists: SetupPlugins['lists']; logger: Logger; mergeStrategy: ConfigType['alertMergeStrategy']; + ignoreFields: ConfigType['alertIgnoreFields']; ml?: SetupPlugins['ml']; ruleDataClient: IRuleDataClient; version: string; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/create_rules.mock.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/create_rules.mock.ts index 34fb7bf5f8291..2c25134cc3760 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/create_rules.mock.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/create_rules.mock.ts @@ -8,7 +8,8 @@ import { CreateRulesOptions } from './types'; import { rulesClientMock } from '../../../../../alerting/server/mocks'; -export const getCreateRulesOptionsMock = (): CreateRulesOptions => ({ +export const getCreateRulesOptionsMock = (isRuleRegistryEnabled: boolean): CreateRulesOptions => ({ + isRuleRegistryEnabled, author: ['Elastic'], buildingBlockType: undefined, rulesClient: rulesClientMock.create(), @@ -61,7 +62,10 @@ export const getCreateRulesOptionsMock = (): CreateRulesOptions => ({ actions: [], }); -export const getCreateMlRulesOptionsMock = (): CreateRulesOptions => ({ +export const getCreateMlRulesOptionsMock = ( + isRuleRegistryEnabled: boolean +): CreateRulesOptions => ({ + isRuleRegistryEnabled, author: ['Elastic'], buildingBlockType: undefined, rulesClient: rulesClientMock.create(), diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/create_rules.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/create_rules.test.ts index 3dd29977a8f2c..0fd708791712a 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/create_rules.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/create_rules.test.ts @@ -8,9 +8,12 @@ import { createRules } from './create_rules'; import { getCreateMlRulesOptionsMock } from './create_rules.mock'; -describe('createRules', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('createRules - %s', (_, isRuleRegistryEnabled) => { it('calls the rulesClient with legacy ML params', async () => { - const ruleOptions = getCreateMlRulesOptionsMock(); + const ruleOptions = getCreateMlRulesOptionsMock(isRuleRegistryEnabled); await createRules(ruleOptions); expect(ruleOptions.rulesClient.create).toHaveBeenCalledWith( expect.objectContaining({ @@ -26,7 +29,7 @@ describe('createRules', () => { it('calls the rulesClient with ML params', async () => { const ruleOptions = { - ...getCreateMlRulesOptionsMock(), + ...getCreateMlRulesOptionsMock(isRuleRegistryEnabled), machineLearningJobId: ['new_job_1', 'new_job_2'], }; await createRules(ruleOptions); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/create_rules.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/create_rules.ts index bc415a0de6961..bed6bf4303897 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/create_rules.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/create_rules.ts @@ -20,6 +20,7 @@ import { CreateRulesOptions } from './types'; import { addTags } from './add_tags'; import { PartialFilter, RuleTypeParams } from '../types'; import { transformToAlertThrottle, transformToNotifyWhen } from './utils'; +import { ruleTypeMappings } from '../signals/utils'; export const createRules = async ({ rulesClient, @@ -68,16 +69,18 @@ export const createRules = async ({ to, type, references, + namespace, note, version, exceptionsList, actions, + isRuleRegistryEnabled, }: CreateRulesOptions): Promise> => { const rule = await rulesClient.create({ data: { name, tags: addTags(tags, ruleId, immutable), - alertTypeId: SIGNALS_ID, + alertTypeId: isRuleRegistryEnabled ? ruleTypeMappings[type] : SIGNALS_ID, consumer: SERVER_APP_ID, params: { anomalyThreshold, @@ -125,6 +128,7 @@ export const createRules = async ({ to, type, references, + namespace, note, version, exceptionsList, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/delete_rules.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/delete_rules.ts index b4b6e3c824205..5003dbf0279e4 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/delete_rules.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/delete_rules.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { asyncForEach } from '@kbn/std'; import { DeleteRuleOptions } from './types'; export const deleteRules = async ({ @@ -14,5 +15,7 @@ export const deleteRules = async ({ id, }: DeleteRuleOptions) => { await rulesClient.delete({ id }); - ruleStatuses.forEach(async (obj) => ruleStatusClient.delete(obj.id)); + await asyncForEach(ruleStatuses, async (obj) => { + await ruleStatusClient.delete(obj.id); + }); }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/duplicate_rule.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/duplicate_rule.test.ts index 92b4dcff61b35..c3f6b0fbead91 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/duplicate_rule.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/duplicate_rule.test.ts @@ -52,6 +52,7 @@ describe('duplicateRule', () => { query: 'process.args : "chmod"', filters: [], buildingBlockType: undefined, + namespace: undefined, note: undefined, timelineId: undefined, timelineTitle: undefined, @@ -99,6 +100,7 @@ describe('duplicateRule', () => { "license": "", "maxSignals": 100, "meta": undefined, + "namespace": undefined, "note": undefined, "outputIndex": ".siem-signals-default", "query": "process.args : \\"chmod\\"", diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/find_rules.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/find_rules.test.ts index 1f91355d7cde2..ebde1d0ad6df8 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/find_rules.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/find_rules.test.ts @@ -6,16 +6,42 @@ */ import { getFilter } from './find_rules'; -import { SIGNALS_ID } from '../../../../common/constants'; +import { + EQL_RULE_TYPE_ID, + INDICATOR_RULE_TYPE_ID, + ML_RULE_TYPE_ID, + QUERY_RULE_TYPE_ID, + THRESHOLD_RULE_TYPE_ID, + SIGNALS_ID, +} from '../../../../common/constants'; + +const allAlertTypeIds = `(alert.attributes.alertTypeId: ${EQL_RULE_TYPE_ID} + OR alert.attributes.alertTypeId: ${ML_RULE_TYPE_ID} + OR alert.attributes.alertTypeId: ${QUERY_RULE_TYPE_ID} + OR alert.attributes.alertTypeId: ${INDICATOR_RULE_TYPE_ID} + OR alert.attributes.alertTypeId: ${THRESHOLD_RULE_TYPE_ID})`.replace(/[\n\r]/g, ''); describe('find_rules', () => { - test('it returns a full filter with an AND if sent down', () => { - expect(getFilter('alert.attributes.enabled: true')).toEqual( - `alert.attributes.alertTypeId: ${SIGNALS_ID} AND alert.attributes.enabled: true` - ); - }); + const fullFilterTestCases: Array<[boolean, string]> = [ + [false, `alert.attributes.alertTypeId: ${SIGNALS_ID} AND alert.attributes.enabled: true`], + [true, `${allAlertTypeIds} AND alert.attributes.enabled: true`], + ]; + const nullFilterTestCases: Array<[boolean, string]> = [ + [false, `alert.attributes.alertTypeId: ${SIGNALS_ID}`], + [true, allAlertTypeIds], + ]; + + test.each(fullFilterTestCases)( + 'it returns a full filter with an AND if sent down [rule registry enabled: %p]', + (isRuleRegistryEnabled, expected) => { + expect(getFilter('alert.attributes.enabled: true', isRuleRegistryEnabled)).toEqual(expected); + } + ); - test('it returns existing filter with no AND when not set', () => { - expect(getFilter(null)).toEqual(`alert.attributes.alertTypeId: ${SIGNALS_ID}`); - }); + test.each(nullFilterTestCases)( + 'it returns existing filter with no AND when not set [rule registry enabled: %p]', + (isRuleRegistryEnabled, expected) => { + expect(getFilter(null, isRuleRegistryEnabled)).toEqual(expected); + } + ); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/find_rules.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/find_rules.ts index e41dac066e18a..a1664f2e5a310 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/find_rules.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/find_rules.ts @@ -8,13 +8,23 @@ import { FindResult } from '../../../../../alerting/server'; import { SIGNALS_ID } from '../../../../common/constants'; import { RuleParams } from '../schemas/rule_schemas'; +import { ruleTypeMappings } from '../signals/utils'; import { FindRuleOptions } from './types'; -export const getFilter = (filter: string | null | undefined) => { +export const getFilter = ( + filter: string | null | undefined, + isRuleRegistryEnabled: boolean = false +) => { + const alertTypeFilter = isRuleRegistryEnabled + ? `(${Object.values(ruleTypeMappings) + .map((type) => (type !== SIGNALS_ID ? `alert.attributes.alertTypeId: ${type}` : undefined)) + .filter((type) => type != null) + .join(' OR ')})` + : `alert.attributes.alertTypeId: ${SIGNALS_ID}`; if (filter == null) { - return `alert.attributes.alertTypeId: ${SIGNALS_ID}`; + return alertTypeFilter; } else { - return `alert.attributes.alertTypeId: ${SIGNALS_ID} AND ${filter}`; + return `${alertTypeFilter} AND ${filter}`; } }; @@ -26,13 +36,14 @@ export const findRules = ({ filter, sortField, sortOrder, + isRuleRegistryEnabled, }: FindRuleOptions): Promise> => { return rulesClient.find({ options: { fields, page, perPage, - filter: getFilter(filter), + filter: getFilter(filter, isRuleRegistryEnabled), sortOrder, sortField, }, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_existing_prepackaged_rules.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_existing_prepackaged_rules.test.ts index 19a6a4e43d877..b478cc2df09a1 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_existing_prepackaged_rules.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_existing_prepackaged_rules.test.ts @@ -20,7 +20,10 @@ import { getNonPackagedRulesCount, } from './get_existing_prepackaged_rules'; -describe('get_existing_prepackaged_rules', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('get_existing_prepackaged_rules - %s', (_, isRuleRegistryEnabled) => { afterEach(() => { jest.resetAllMocks(); }); @@ -28,23 +31,23 @@ describe('get_existing_prepackaged_rules', () => { describe('getExistingPrepackagedRules', () => { test('should return a single item in a single page', async () => { const rulesClient = rulesClientMock.create(); - rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); - const rules = await getExistingPrepackagedRules({ rulesClient }); - expect(rules).toEqual([getAlertMock(getQueryRuleParams())]); + rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); + const rules = await getExistingPrepackagedRules({ isRuleRegistryEnabled, rulesClient }); + expect(rules).toEqual([getAlertMock(isRuleRegistryEnabled, getQueryRuleParams())]); }); test('should return 3 items over 1 page with all on one page', async () => { const rulesClient = rulesClientMock.create(); - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.params.immutable = true; result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; - const result2 = getAlertMock(getQueryRuleParams()); + const result2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result2.params.immutable = true; result2.id = '5baa53f8-96da-44ee-ad58-41bccb7f9f3d'; - const result3 = getAlertMock(getQueryRuleParams()); + const result3 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result3.params.immutable = true; result3.id = 'f3e1bf0b-b95f-43da-b1de-5d2f0af2287a'; @@ -68,7 +71,7 @@ describe('get_existing_prepackaged_rules', () => { }) ); - const rules = await getExistingPrepackagedRules({ rulesClient }); + const rules = await getExistingPrepackagedRules({ isRuleRegistryEnabled, rulesClient }); expect(rules).toEqual([result1, result2, result3]); }); }); @@ -76,18 +79,18 @@ describe('get_existing_prepackaged_rules', () => { describe('getNonPackagedRules', () => { test('should return a single item in a single page', async () => { const rulesClient = rulesClientMock.create(); - rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); - const rules = await getNonPackagedRules({ rulesClient }); - expect(rules).toEqual([getAlertMock(getQueryRuleParams())]); + rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); + const rules = await getNonPackagedRules({ isRuleRegistryEnabled, rulesClient }); + expect(rules).toEqual([getAlertMock(isRuleRegistryEnabled, getQueryRuleParams())]); }); test('should return 2 items over 1 page', async () => { const rulesClient = rulesClientMock.create(); - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; - const result2 = getAlertMock(getQueryRuleParams()); + const result2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result2.id = '5baa53f8-96da-44ee-ad58-41bccb7f9f3d'; // first result mock which is for returning the total @@ -105,20 +108,20 @@ describe('get_existing_prepackaged_rules', () => { getFindResultWithMultiHits({ data: [result1, result2], perPage: 2, page: 1, total: 2 }) ); - const rules = await getNonPackagedRules({ rulesClient }); + const rules = await getNonPackagedRules({ isRuleRegistryEnabled, rulesClient }); expect(rules).toEqual([result1, result2]); }); test('should return 3 items over 1 page with all on one page', async () => { const rulesClient = rulesClientMock.create(); - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; - const result2 = getAlertMock(getQueryRuleParams()); + const result2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result2.id = '5baa53f8-96da-44ee-ad58-41bccb7f9f3d'; - const result3 = getAlertMock(getQueryRuleParams()); + const result3 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result3.id = 'f3e1bf0b-b95f-43da-b1de-5d2f0af2287a'; // first result mock which is for returning the total @@ -141,7 +144,7 @@ describe('get_existing_prepackaged_rules', () => { }) ); - const rules = await getNonPackagedRules({ rulesClient }); + const rules = await getNonPackagedRules({ isRuleRegistryEnabled, rulesClient }); expect(rules).toEqual([result1, result2, result3]); }); }); @@ -149,18 +152,18 @@ describe('get_existing_prepackaged_rules', () => { describe('getRules', () => { test('should return a single item in a single page', async () => { const rulesClient = rulesClientMock.create(); - rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); - const rules = await getRules({ rulesClient, filter: '' }); - expect(rules).toEqual([getAlertMock(getQueryRuleParams())]); + rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); + const rules = await getRules({ isRuleRegistryEnabled, rulesClient, filter: '' }); + expect(rules).toEqual([getAlertMock(isRuleRegistryEnabled, getQueryRuleParams())]); }); test('should return 2 items over two pages, one per page', async () => { const rulesClient = rulesClientMock.create(); - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; - const result2 = getAlertMock(getQueryRuleParams()); + const result2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result2.id = '5baa53f8-96da-44ee-ad58-41bccb7f9f3d'; // first result mock which is for returning the total @@ -178,7 +181,7 @@ describe('get_existing_prepackaged_rules', () => { getFindResultWithMultiHits({ data: [result1, result2], perPage: 2, page: 1, total: 2 }) ); - const rules = await getRules({ rulesClient, filter: '' }); + const rules = await getRules({ isRuleRegistryEnabled, rulesClient, filter: '' }); expect(rules).toEqual([result1, result2]); }); }); @@ -186,8 +189,8 @@ describe('get_existing_prepackaged_rules', () => { describe('getRulesCount', () => { test('it returns a count', async () => { const rulesClient = rulesClientMock.create(); - rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); - const rules = await getRulesCount({ rulesClient, filter: '' }); + rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); + const rules = await getRulesCount({ isRuleRegistryEnabled, rulesClient, filter: '' }); expect(rules).toEqual(1); }); }); @@ -195,8 +198,8 @@ describe('get_existing_prepackaged_rules', () => { describe('getNonPackagedRulesCount', () => { test('it returns a count', async () => { const rulesClient = rulesClientMock.create(); - rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); - const rules = await getNonPackagedRulesCount({ rulesClient }); + rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); + const rules = await getNonPackagedRulesCount({ isRuleRegistryEnabled, rulesClient }); expect(rules).toEqual(1); }); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_existing_prepackaged_rules.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_existing_prepackaged_rules.ts index be8bf1303846d..caa32a809b0a8 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_existing_prepackaged_rules.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_existing_prepackaged_rules.ts @@ -14,21 +14,26 @@ export const FILTER_NON_PREPACKED_RULES = `alert.attributes.tags: "${INTERNAL_IM export const FILTER_PREPACKED_RULES = `alert.attributes.tags: "${INTERNAL_IMMUTABLE_KEY}:true"`; export const getNonPackagedRulesCount = async ({ + isRuleRegistryEnabled, rulesClient, }: { + isRuleRegistryEnabled: boolean; rulesClient: RulesClient; }): Promise => { - return getRulesCount({ rulesClient, filter: FILTER_NON_PREPACKED_RULES }); + return getRulesCount({ isRuleRegistryEnabled, rulesClient, filter: FILTER_NON_PREPACKED_RULES }); }; export const getRulesCount = async ({ rulesClient, filter, + isRuleRegistryEnabled, }: { rulesClient: RulesClient; filter: string; + isRuleRegistryEnabled: boolean; }): Promise => { const firstRule = await findRules({ + isRuleRegistryEnabled, rulesClient, filter, perPage: 1, @@ -43,12 +48,15 @@ export const getRulesCount = async ({ export const getRules = async ({ rulesClient, filter, + isRuleRegistryEnabled, }: { rulesClient: RulesClient; filter: string; -}): Promise => { - const count = await getRulesCount({ rulesClient, filter }); + isRuleRegistryEnabled: boolean; +}) => { + const count = await getRulesCount({ rulesClient, filter, isRuleRegistryEnabled }); const rules = await findRules({ + isRuleRegistryEnabled, rulesClient, filter, perPage: count, @@ -58,7 +66,7 @@ export const getRules = async ({ fields: undefined, }); - if (isAlertTypes(rules.data)) { + if (isAlertTypes(isRuleRegistryEnabled, rules.data)) { return rules.data; } else { // If this was ever true, you have a really messed up system. @@ -69,22 +77,28 @@ export const getRules = async ({ export const getNonPackagedRules = async ({ rulesClient, + isRuleRegistryEnabled, }: { rulesClient: RulesClient; + isRuleRegistryEnabled: boolean; }): Promise => { return getRules({ rulesClient, filter: FILTER_NON_PREPACKED_RULES, + isRuleRegistryEnabled, }); }; export const getExistingPrepackagedRules = async ({ rulesClient, + isRuleRegistryEnabled, }: { rulesClient: RulesClient; + isRuleRegistryEnabled: boolean; }): Promise => { return getRules({ rulesClient, filter: FILTER_PREPACKED_RULES, + isRuleRegistryEnabled, }); }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_all.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_all.test.ts index 2870bee99e51a..3ca5960d7d4e1 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_all.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_all.test.ts @@ -16,11 +16,14 @@ import { getListArrayMock } from '../../../../common/detection_engine/schemas/ty import { getThreatMock } from '../../../../common/detection_engine/schemas/types/threat.mock'; import { getQueryRuleParams } from '../schemas/rule_schemas.mock'; -describe('getExportAll', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('getExportAll - %s', (_, isRuleRegistryEnabled) => { test('it exports everything from the alerts client', async () => { const rulesClient = rulesClientMock.create(); - const result = getFindResultWithSingleHit(); - const alert = getAlertMock(getQueryRuleParams()); + const result = getFindResultWithSingleHit(isRuleRegistryEnabled); + const alert = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); alert.params = { ...alert.params, filters: [{ query: { match_phrase: { 'host.name': 'some-host' } } }], @@ -32,7 +35,7 @@ describe('getExportAll', () => { result.data = [alert]; rulesClient.find.mockResolvedValue(result); - const exports = await getExportAll(rulesClient); + const exports = await getExportAll(rulesClient, isRuleRegistryEnabled); const rulesJson = JSON.parse(exports.rulesNdjson); const detailsJson = JSON.parse(exports.exportDetails); expect(rulesJson).toEqual({ @@ -94,7 +97,7 @@ describe('getExportAll', () => { rulesClient.find.mockResolvedValue(findResult); - const exports = await getExportAll(rulesClient); + const exports = await getExportAll(rulesClient, isRuleRegistryEnabled); expect(exports).toEqual({ rulesNdjson: '', exportDetails: '{"exported_count":0,"missing_rules":[],"missing_rules_count":0}\n', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_all.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_all.ts index 4a79f0089491f..f44471e6e26f9 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_all.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_all.ts @@ -12,12 +12,13 @@ import { transformAlertsToRules } from '../routes/rules/utils'; import { transformDataToNdjson } from '../../../utils/read_stream/create_stream_from_ndjson'; export const getExportAll = async ( - rulesClient: RulesClient + rulesClient: RulesClient, + isRuleRegistryEnabled: boolean ): Promise<{ rulesNdjson: string; exportDetails: string; }> => { - const ruleAlertTypes = await getNonPackagedRules({ rulesClient }); + const ruleAlertTypes = await getNonPackagedRules({ rulesClient, isRuleRegistryEnabled }); const rules = transformAlertsToRules(ruleAlertTypes); // We do not support importing/exporting actions. When we do, delete this line of code const rulesWithoutActions = rules.map((rule) => ({ ...rule, actions: [] })); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_by_object_ids.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_by_object_ids.test.ts index f4325086e4212..740427e44b560 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_by_object_ids.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_by_object_ids.test.ts @@ -16,7 +16,10 @@ import { getListArrayMock } from '../../../../common/detection_engine/schemas/ty import { getThreatMock } from '../../../../common/detection_engine/schemas/types/threat.mock'; import { getQueryRuleParams } from '../schemas/rule_schemas.mock'; -describe('get_export_by_object_ids', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('get_export_by_object_ids - %s', (_, isRuleRegistryEnabled) => { beforeEach(() => { jest.resetAllMocks(); jest.restoreAllMocks(); @@ -25,10 +28,10 @@ describe('get_export_by_object_ids', () => { describe('getExportByObjectIds', () => { test('it exports object ids into an expected string with new line characters', async () => { const rulesClient = rulesClientMock.create(); - rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); + rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); const objects = [{ rule_id: 'rule-1' }]; - const exports = await getExportByObjectIds(rulesClient, objects); + const exports = await getExportByObjectIds(rulesClient, objects, isRuleRegistryEnabled); const exportsObj = { rulesNdjson: JSON.parse(exports.rulesNdjson), exportDetails: JSON.parse(exports.exportDetails), @@ -85,7 +88,7 @@ describe('get_export_by_object_ids', () => { test('it does not export immutable rules', async () => { const rulesClient = rulesClientMock.create(); - const result = getAlertMock(getQueryRuleParams()); + const result = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result.params.immutable = true; const findResult: FindHit = { @@ -95,11 +98,11 @@ describe('get_export_by_object_ids', () => { data: [result], }; - rulesClient.get.mockResolvedValue(getAlertMock(getQueryRuleParams())); + rulesClient.get.mockResolvedValue(getAlertMock(isRuleRegistryEnabled, getQueryRuleParams())); rulesClient.find.mockResolvedValue(findResult); const objects = [{ rule_id: 'rule-1' }]; - const exports = await getExportByObjectIds(rulesClient, objects); + const exports = await getExportByObjectIds(rulesClient, objects, isRuleRegistryEnabled); expect(exports).toEqual({ rulesNdjson: '', exportDetails: @@ -111,10 +114,10 @@ describe('get_export_by_object_ids', () => { describe('getRulesFromObjects', () => { test('it returns transformed rules from objects sent in', async () => { const rulesClient = rulesClientMock.create(); - rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); + rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); const objects = [{ rule_id: 'rule-1' }]; - const exports = await getRulesFromObjects(rulesClient, objects); + const exports = await getRulesFromObjects(rulesClient, objects, isRuleRegistryEnabled); const expected: RulesErrors = { exportedCount: 1, missingRules: [], @@ -175,7 +178,7 @@ describe('get_export_by_object_ids', () => { test('it does not transform the rule if the rule is an immutable rule and designates it as a missing rule', async () => { const rulesClient = rulesClientMock.create(); - const result = getAlertMock(getQueryRuleParams()); + const result = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result.params.immutable = true; const findResult: FindHit = { @@ -189,7 +192,7 @@ describe('get_export_by_object_ids', () => { rulesClient.find.mockResolvedValue(findResult); const objects = [{ rule_id: 'rule-1' }]; - const exports = await getRulesFromObjects(rulesClient, objects); + const exports = await getRulesFromObjects(rulesClient, objects, isRuleRegistryEnabled); const expected: RulesErrors = { exportedCount: 0, missingRules: [{ rule_id: 'rule-1' }], @@ -212,7 +215,7 @@ describe('get_export_by_object_ids', () => { rulesClient.find.mockResolvedValue(findResult); const objects = [{ rule_id: 'rule-1' }]; - const exports = await getRulesFromObjects(rulesClient, objects); + const exports = await getRulesFromObjects(rulesClient, objects, isRuleRegistryEnabled); const expected: RulesErrors = { exportedCount: 0, missingRules: [{ rule_id: 'rule-1' }], diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_by_object_ids.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_by_object_ids.ts index 812310bcb501a..31a7604306de7 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_by_object_ids.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_export_by_object_ids.ts @@ -34,12 +34,13 @@ export interface RulesErrors { export const getExportByObjectIds = async ( rulesClient: RulesClient, - objects: Array<{ rule_id: string }> + objects: Array<{ rule_id: string }>, + isRuleRegistryEnabled: boolean ): Promise<{ rulesNdjson: string; exportDetails: string; }> => { - const rulesAndErrors = await getRulesFromObjects(rulesClient, objects); + const rulesAndErrors = await getRulesFromObjects(rulesClient, objects, isRuleRegistryEnabled); // We do not support importing/exporting actions. When we do, delete this line of code const rulesWithoutActions = rulesAndErrors.rules.map((rule) => ({ ...rule, actions: [] })); const rulesNdjson = transformDataToNdjson(rulesWithoutActions); @@ -49,7 +50,8 @@ export const getExportByObjectIds = async ( export const getRulesFromObjects = async ( rulesClient: RulesClient, - objects: Array<{ rule_id: string }> + objects: Array<{ rule_id: string }>, + isRuleRegistryEnabled: boolean ): Promise => { // If we put more than 1024 ids in one block like "alert.attributes.tags: (id1 OR id2 OR ... OR id1100)" // then the KQL -> ES DSL query generator still puts them all in the same "should" array, but ES defaults @@ -67,6 +69,7 @@ export const getRulesFromObjects = async ( }) .join(' OR '); const rules = await findRules({ + isRuleRegistryEnabled, rulesClient, filter, page: 1, @@ -79,7 +82,7 @@ export const getRulesFromObjects = async ( const matchingRule = rules.data.find((rule) => rule.params.ruleId === ruleId); if ( matchingRule != null && - isAlertType(matchingRule) && + isAlertType(isRuleRegistryEnabled, matchingRule) && matchingRule.params.immutable !== true ) { return { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_rules_to_install.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_rules_to_install.test.ts index 7482097aafd22..4ef84fd1619ea 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_rules_to_install.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_rules_to_install.test.ts @@ -9,57 +9,61 @@ import { getRulesToInstall } from './get_rules_to_install'; import { getAlertMock } from '../routes/__mocks__/request_responses'; import { getAddPrepackagedRulesSchemaDecodedMock } from '../../../../common/detection_engine/schemas/request/add_prepackaged_rules_schema.mock'; import { getQueryRuleParams } from '../schemas/rule_schemas.mock'; +import { AddPrepackagedRulesSchemaDecoded } from '../../../../common/detection_engine/schemas/request'; -describe('get_rules_to_install', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('get_rules_to_install - %s', (_, isRuleRegistryEnabled) => { test('should return empty array if both rule sets are empty', () => { const update = getRulesToInstall([], []); expect(update).toEqual([]); }); test('should return empty array if the two rule ids match', () => { - const ruleFromFileSystem = getAddPrepackagedRulesSchemaDecodedMock(); + const ruleFromFileSystem = getAddPrepackagedRulesSchemaDecodedMock() as AddPrepackagedRulesSchemaDecoded; ruleFromFileSystem.rule_id = 'rule-1'; - const installedRule = getAlertMock(getQueryRuleParams()); + const installedRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule.params.ruleId = 'rule-1'; const update = getRulesToInstall([ruleFromFileSystem], [installedRule]); expect(update).toEqual([]); }); test('should return the rule to install if the id of the two rules do not match', () => { - const ruleFromFileSystem = getAddPrepackagedRulesSchemaDecodedMock(); + const ruleFromFileSystem = getAddPrepackagedRulesSchemaDecodedMock() as AddPrepackagedRulesSchemaDecoded; ruleFromFileSystem.rule_id = 'rule-1'; - const installedRule = getAlertMock(getQueryRuleParams()); + const installedRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule.params.ruleId = 'rule-2'; const update = getRulesToInstall([ruleFromFileSystem], [installedRule]); expect(update).toEqual([ruleFromFileSystem]); }); test('should return two rules to install if both the ids of the two rules do not match', () => { - const ruleFromFileSystem1 = getAddPrepackagedRulesSchemaDecodedMock(); + const ruleFromFileSystem1 = getAddPrepackagedRulesSchemaDecodedMock() as AddPrepackagedRulesSchemaDecoded; ruleFromFileSystem1.rule_id = 'rule-1'; - const ruleFromFileSystem2 = getAddPrepackagedRulesSchemaDecodedMock(); + const ruleFromFileSystem2 = getAddPrepackagedRulesSchemaDecodedMock() as AddPrepackagedRulesSchemaDecoded; ruleFromFileSystem2.rule_id = 'rule-2'; - const installedRule = getAlertMock(getQueryRuleParams()); + const installedRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule.params.ruleId = 'rule-3'; const update = getRulesToInstall([ruleFromFileSystem1, ruleFromFileSystem2], [installedRule]); expect(update).toEqual([ruleFromFileSystem1, ruleFromFileSystem2]); }); test('should return two rules of three to install if both the ids of the two rules do not match but the third does', () => { - const ruleFromFileSystem1 = getAddPrepackagedRulesSchemaDecodedMock(); + const ruleFromFileSystem1 = getAddPrepackagedRulesSchemaDecodedMock() as AddPrepackagedRulesSchemaDecoded; ruleFromFileSystem1.rule_id = 'rule-1'; - const ruleFromFileSystem2 = getAddPrepackagedRulesSchemaDecodedMock(); + const ruleFromFileSystem2 = getAddPrepackagedRulesSchemaDecodedMock() as AddPrepackagedRulesSchemaDecoded; ruleFromFileSystem2.rule_id = 'rule-2'; - const ruleFromFileSystem3 = getAddPrepackagedRulesSchemaDecodedMock(); + const ruleFromFileSystem3 = getAddPrepackagedRulesSchemaDecodedMock() as AddPrepackagedRulesSchemaDecoded; ruleFromFileSystem3.rule_id = 'rule-3'; - const installedRule = getAlertMock(getQueryRuleParams()); + const installedRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule.params.ruleId = 'rule-3'; const update = getRulesToInstall( [ruleFromFileSystem1, ruleFromFileSystem2, ruleFromFileSystem3], diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_rules_to_install.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_rules_to_install.ts index 65f3d4661cc4f..a9e22562606a9 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_rules_to_install.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_rules_to_install.ts @@ -11,7 +11,7 @@ import { RuleAlertType } from './types'; export const getRulesToInstall = ( rulesFromFileSystem: AddPrepackagedRulesSchemaDecoded[], installedRules: RuleAlertType[] -): AddPrepackagedRulesSchemaDecoded[] => { +) => { return rulesFromFileSystem.filter( (rule) => !installedRules.some((installedRule) => installedRule.params.ruleId === rule.rule_id) ); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_rules_to_update.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_rules_to_update.test.ts index 163585e7594ab..dda3bf6efe44c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_rules_to_update.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_rules_to_update.test.ts @@ -10,7 +10,10 @@ import { getAlertMock } from '../routes/__mocks__/request_responses'; import { getAddPrepackagedRulesSchemaDecodedMock } from '../../../../common/detection_engine/schemas/request/add_prepackaged_rules_schema.mock'; import { getQueryRuleParams } from '../schemas/rule_schemas.mock'; -describe('get_rules_to_update', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('get_rules_to_update - %s', (_, isRuleRegistryEnabled) => { describe('get_rules_to_update', () => { test('should return empty array if both rule sets are empty', () => { const update = getRulesToUpdate([], []); @@ -22,7 +25,7 @@ describe('get_rules_to_update', () => { ruleFromFileSystem.rule_id = 'rule-1'; ruleFromFileSystem.version = 2; - const installedRule = getAlertMock(getQueryRuleParams()); + const installedRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule.params.ruleId = 'rule-2'; installedRule.params.version = 1; const update = getRulesToUpdate([ruleFromFileSystem], [installedRule]); @@ -34,7 +37,7 @@ describe('get_rules_to_update', () => { ruleFromFileSystem.rule_id = 'rule-1'; ruleFromFileSystem.version = 1; - const installedRule = getAlertMock(getQueryRuleParams()); + const installedRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule.params.ruleId = 'rule-1'; installedRule.params.version = 2; const update = getRulesToUpdate([ruleFromFileSystem], [installedRule]); @@ -46,7 +49,7 @@ describe('get_rules_to_update', () => { ruleFromFileSystem.rule_id = 'rule-1'; ruleFromFileSystem.version = 1; - const installedRule = getAlertMock(getQueryRuleParams()); + const installedRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule.params.ruleId = 'rule-1'; installedRule.params.version = 1; const update = getRulesToUpdate([ruleFromFileSystem], [installedRule]); @@ -58,7 +61,7 @@ describe('get_rules_to_update', () => { ruleFromFileSystem.rule_id = 'rule-1'; ruleFromFileSystem.version = 2; - const installedRule = getAlertMock(getQueryRuleParams()); + const installedRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule.params.ruleId = 'rule-1'; installedRule.params.version = 1; installedRule.params.exceptionsList = []; @@ -72,12 +75,12 @@ describe('get_rules_to_update', () => { ruleFromFileSystem.rule_id = 'rule-1'; ruleFromFileSystem.version = 2; - const installedRule1 = getAlertMock(getQueryRuleParams()); + const installedRule1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule1.params.ruleId = 'rule-1'; installedRule1.params.version = 1; installedRule1.params.exceptionsList = []; - const installedRule2 = getAlertMock(getQueryRuleParams()); + const installedRule2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule2.params.ruleId = 'rule-2'; installedRule2.params.version = 1; installedRule2.params.exceptionsList = []; @@ -95,12 +98,12 @@ describe('get_rules_to_update', () => { ruleFromFileSystem2.rule_id = 'rule-2'; ruleFromFileSystem2.version = 2; - const installedRule1 = getAlertMock(getQueryRuleParams()); + const installedRule1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule1.params.ruleId = 'rule-1'; installedRule1.params.version = 1; installedRule1.params.exceptionsList = []; - const installedRule2 = getAlertMock(getQueryRuleParams()); + const installedRule2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule2.params.ruleId = 'rule-2'; installedRule2.params.version = 1; installedRule2.params.exceptionsList = []; @@ -125,7 +128,7 @@ describe('get_rules_to_update', () => { ruleFromFileSystem1.rule_id = 'rule-1'; ruleFromFileSystem1.version = 2; - const installedRule1 = getAlertMock(getQueryRuleParams()); + const installedRule1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule1.params.ruleId = 'rule-1'; installedRule1.params.version = 1; installedRule1.params.exceptionsList = []; @@ -147,7 +150,7 @@ describe('get_rules_to_update', () => { ruleFromFileSystem1.rule_id = 'rule-1'; ruleFromFileSystem1.version = 2; - const installedRule1 = getAlertMock(getQueryRuleParams()); + const installedRule1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule1.params.ruleId = 'rule-1'; installedRule1.params.version = 1; installedRule1.params.exceptionsList = [ @@ -179,7 +182,7 @@ describe('get_rules_to_update', () => { ruleFromFileSystem1.rule_id = 'rule-1'; ruleFromFileSystem1.version = 2; - const installedRule1 = getAlertMock(getQueryRuleParams()); + const installedRule1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule1.params.ruleId = 'rule-1'; installedRule1.params.version = 1; installedRule1.params.exceptionsList = [ @@ -201,7 +204,7 @@ describe('get_rules_to_update', () => { ruleFromFileSystem1.rule_id = 'rule-1'; ruleFromFileSystem1.version = 2; - const installedRule1 = getAlertMock(getQueryRuleParams()); + const installedRule1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule1.params.ruleId = 'rule-1'; installedRule1.params.version = 1; installedRule1.params.exceptionsList = [ @@ -228,7 +231,7 @@ describe('get_rules_to_update', () => { ruleFromFileSystem2.rule_id = 'rule-2'; ruleFromFileSystem2.version = 2; - const installedRule1 = getAlertMock(getQueryRuleParams()); + const installedRule1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule1.params.ruleId = 'rule-1'; installedRule1.params.version = 1; installedRule1.params.exceptionsList = [ @@ -239,7 +242,7 @@ describe('get_rules_to_update', () => { type: 'endpoint', }, ]; - const installedRule2 = getAlertMock(getQueryRuleParams()); + const installedRule2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule2.params.ruleId = 'rule-2'; installedRule2.params.version = 1; installedRule2.params.exceptionsList = [ @@ -278,7 +281,7 @@ describe('get_rules_to_update', () => { }, ]; - const installedRule1 = getAlertMock(getQueryRuleParams()); + const installedRule1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule1.params.ruleId = 'rule-1'; installedRule1.params.version = 1; installedRule1.params.exceptionsList = [ @@ -290,7 +293,7 @@ describe('get_rules_to_update', () => { }, ]; - const installedRule2 = getAlertMock(getQueryRuleParams()); + const installedRule2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule2.params.ruleId = 'rule-2'; installedRule2.params.version = 1; installedRule2.params.exceptionsList = [ @@ -320,7 +323,7 @@ describe('get_rules_to_update', () => { ruleFromFileSystem.rule_id = 'rule-1'; ruleFromFileSystem.version = 2; - const installedRule = getAlertMock(getQueryRuleParams()); + const installedRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule.params.ruleId = 'rule-2'; installedRule.params.version = 1; const shouldUpdate = filterInstalledRules(ruleFromFileSystem, [installedRule]); @@ -332,7 +335,7 @@ describe('get_rules_to_update', () => { ruleFromFileSystem.rule_id = 'rule-1'; ruleFromFileSystem.version = 1; - const installedRule = getAlertMock(getQueryRuleParams()); + const installedRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule.params.ruleId = 'rule-1'; installedRule.params.version = 2; const shouldUpdate = filterInstalledRules(ruleFromFileSystem, [installedRule]); @@ -344,7 +347,7 @@ describe('get_rules_to_update', () => { ruleFromFileSystem.rule_id = 'rule-1'; ruleFromFileSystem.version = 1; - const installedRule = getAlertMock(getQueryRuleParams()); + const installedRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule.params.ruleId = 'rule-1'; installedRule.params.version = 1; const shouldUpdate = filterInstalledRules(ruleFromFileSystem, [installedRule]); @@ -356,7 +359,7 @@ describe('get_rules_to_update', () => { ruleFromFileSystem.rule_id = 'rule-1'; ruleFromFileSystem.version = 2; - const installedRule = getAlertMock(getQueryRuleParams()); + const installedRule = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule.params.ruleId = 'rule-1'; installedRule.params.version = 1; installedRule.params.exceptionsList = []; @@ -380,7 +383,7 @@ describe('get_rules_to_update', () => { ruleFromFileSystem1.rule_id = 'rule-1'; ruleFromFileSystem1.version = 2; - const installedRule1 = getAlertMock(getQueryRuleParams()); + const installedRule1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule1.params.ruleId = 'rule-1'; installedRule1.params.version = 1; installedRule1.params.exceptionsList = []; @@ -402,7 +405,7 @@ describe('get_rules_to_update', () => { ruleFromFileSystem1.rule_id = 'rule-1'; ruleFromFileSystem1.version = 2; - const installedRule1 = getAlertMock(getQueryRuleParams()); + const installedRule1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule1.params.ruleId = 'rule-1'; installedRule1.params.version = 1; installedRule1.params.exceptionsList = [ @@ -434,7 +437,7 @@ describe('get_rules_to_update', () => { ruleFromFileSystem1.rule_id = 'rule-1'; ruleFromFileSystem1.version = 2; - const installedRule1 = getAlertMock(getQueryRuleParams()); + const installedRule1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule1.params.ruleId = 'rule-1'; installedRule1.params.version = 1; installedRule1.params.exceptionsList = [ @@ -456,7 +459,7 @@ describe('get_rules_to_update', () => { ruleFromFileSystem1.rule_id = 'rule-1'; ruleFromFileSystem1.version = 2; - const installedRule1 = getAlertMock(getQueryRuleParams()); + const installedRule1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); installedRule1.params.ruleId = 'rule-1'; installedRule1.params.version = 1; installedRule1.params.exceptionsList = [ diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_rules_to_update.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_rules_to_update.ts index 7e098a28552a0..f0017c5e4bdb6 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_rules_to_update.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/get_rules_to_update.ts @@ -18,7 +18,7 @@ import { RuleAlertType } from './types'; export const getRulesToUpdate = ( rulesFromFileSystem: AddPrepackagedRulesSchemaDecoded[], installedRules: RuleAlertType[] -): AddPrepackagedRulesSchemaDecoded[] => { +) => { return rulesFromFileSystem .filter((ruleFromFileSystem) => filterInstalledRules(ruleFromFileSystem, installedRules)) .map((ruleFromFileSystem) => mergeExceptionLists(ruleFromFileSystem, installedRules)); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/install_prepacked_rules.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/install_prepacked_rules.ts index 1681ac7f1659f..3f7191a970020 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/install_prepacked_rules.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/install_prepacked_rules.ts @@ -14,7 +14,8 @@ import { PartialFilter } from '../types'; export const installPrepackagedRules = ( rulesClient: RulesClient, rules: AddPrepackagedRulesSchemaDecoded[], - outputIndex: string + outputIndex: string, + isRuleRegistryEnabled: boolean ): Array>> => rules.reduce>>>((acc, rule) => { const { @@ -60,6 +61,7 @@ export const installPrepackagedRules = ( threshold, timestamp_override: timestampOverride, references, + namespace, note, version, exceptions_list: exceptionsList, @@ -70,6 +72,7 @@ export const installPrepackagedRules = ( return [ ...acc, createRules({ + isRuleRegistryEnabled, rulesClient, anomalyThreshold, author, @@ -116,6 +119,7 @@ export const installPrepackagedRules = ( throttle: null, // At this time there is no pre-packaged actions timestampOverride, references, + namespace, note, version, exceptionsList, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.mock.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.mock.ts index 9ebec947bcc0e..1d09e4ca5c508 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.mock.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.mock.ts @@ -11,7 +11,7 @@ import { getAlertMock } from '../routes/__mocks__/request_responses'; import { getMlRuleParams, getQueryRuleParams } from '../schemas/rule_schemas.mock'; import { ruleExecutionLogClientMock } from '../rule_execution_log/__mocks__/rule_execution_log_client'; -export const getPatchRulesOptionsMock = (): PatchRulesOptions => ({ +export const getPatchRulesOptionsMock = (isRuleRegistryEnabled: boolean): PatchRulesOptions => ({ author: ['Elastic'], buildingBlockType: undefined, rulesClient: rulesClientMock.create(), @@ -61,10 +61,10 @@ export const getPatchRulesOptionsMock = (): PatchRulesOptions => ({ version: 1, exceptionsList: [], actions: [], - rule: getAlertMock(getQueryRuleParams()), + rule: getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()), }); -export const getPatchMlRulesOptionsMock = (): PatchRulesOptions => ({ +export const getPatchMlRulesOptionsMock = (isRuleRegistryEnabled: boolean): PatchRulesOptions => ({ author: ['Elastic'], buildingBlockType: undefined, rulesClient: rulesClientMock.create(), @@ -114,5 +114,5 @@ export const getPatchMlRulesOptionsMock = (): PatchRulesOptions => ({ version: 1, exceptionsList: [], actions: [], - rule: getAlertMock(getMlRuleParams()), + rule: getAlertMock(isRuleRegistryEnabled, getMlRuleParams()), }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.test.ts index dbfc1427abf95..ee39120a8b6d0 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.test.ts @@ -12,15 +12,18 @@ import { RulesClientMock } from '../../../../../alerting/server/rules_client.moc import { getAlertMock } from '../routes/__mocks__/request_responses'; import { getQueryRuleParams } from '../schemas/rule_schemas.mock'; -describe('patchRules', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('patchRules - %s', (_, isRuleRegistryEnabled) => { it('should call rulesClient.disable if the rule was enabled and enabled is false', async () => { - const rulesOptionsMock = getPatchRulesOptionsMock(); + const rulesOptionsMock = getPatchRulesOptionsMock(isRuleRegistryEnabled); const ruleOptions: PatchRulesOptions = { ...rulesOptionsMock, enabled: false, }; ((rulesOptionsMock.rulesClient as unknown) as RulesClientMock).update.mockResolvedValue( - getAlertMock(getQueryRuleParams()) + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) ); await patchRules(ruleOptions); expect(ruleOptions.rulesClient.disable).toHaveBeenCalledWith( @@ -31,7 +34,7 @@ describe('patchRules', () => { }); it('should call rulesClient.enable if the rule was disabled and enabled is true', async () => { - const rulesOptionsMock = getPatchRulesOptionsMock(); + const rulesOptionsMock = getPatchRulesOptionsMock(isRuleRegistryEnabled); const ruleOptions: PatchRulesOptions = { ...rulesOptionsMock, enabled: true, @@ -40,7 +43,7 @@ describe('patchRules', () => { ruleOptions.rule.enabled = false; } ((rulesOptionsMock.rulesClient as unknown) as RulesClientMock).update.mockResolvedValue( - getAlertMock(getQueryRuleParams()) + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) ); await patchRules(ruleOptions); expect(ruleOptions.rulesClient.enable).toHaveBeenCalledWith( @@ -51,7 +54,7 @@ describe('patchRules', () => { }); it('calls the rulesClient with legacy ML params', async () => { - const rulesOptionsMock = getPatchMlRulesOptionsMock(); + const rulesOptionsMock = getPatchMlRulesOptionsMock(isRuleRegistryEnabled); const ruleOptions: PatchRulesOptions = { ...rulesOptionsMock, enabled: true, @@ -60,7 +63,7 @@ describe('patchRules', () => { ruleOptions.rule.enabled = false; } ((rulesOptionsMock.rulesClient as unknown) as RulesClientMock).update.mockResolvedValue( - getAlertMock(getQueryRuleParams()) + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) ); await patchRules(ruleOptions); expect(ruleOptions.rulesClient.update).toHaveBeenCalledWith( @@ -76,7 +79,7 @@ describe('patchRules', () => { }); it('calls the rulesClient with new ML params', async () => { - const rulesOptionsMock = getPatchMlRulesOptionsMock(); + const rulesOptionsMock = getPatchMlRulesOptionsMock(isRuleRegistryEnabled); const ruleOptions: PatchRulesOptions = { ...rulesOptionsMock, machineLearningJobId: ['new_job_1', 'new_job_2'], @@ -86,7 +89,7 @@ describe('patchRules', () => { ruleOptions.rule.enabled = false; } ((rulesOptionsMock.rulesClient as unknown) as RulesClientMock).update.mockResolvedValue( - getAlertMock(getQueryRuleParams()) + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) ); await patchRules(ruleOptions); expect(ruleOptions.rulesClient.update).toHaveBeenCalledWith( @@ -103,7 +106,7 @@ describe('patchRules', () => { describe('regression tests', () => { it("updates the rule's actions if provided", async () => { - const rulesOptionsMock = getPatchRulesOptionsMock(); + const rulesOptionsMock = getPatchRulesOptionsMock(isRuleRegistryEnabled); const ruleOptions: PatchRulesOptions = { ...rulesOptionsMock, actions: [ @@ -118,7 +121,7 @@ describe('patchRules', () => { ], }; ((rulesOptionsMock.rulesClient as unknown) as RulesClientMock).update.mockResolvedValue( - getAlertMock(getQueryRuleParams()) + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) ); await patchRules(ruleOptions); expect(ruleOptions.rulesClient.update).toHaveBeenCalledWith( @@ -140,7 +143,7 @@ describe('patchRules', () => { }); it('does not update actions if none are specified', async () => { - const ruleOptions = getPatchRulesOptionsMock(); + const ruleOptions = getPatchRulesOptionsMock(isRuleRegistryEnabled); delete ruleOptions.actions; if (ruleOptions.rule != null) { ruleOptions.rule.actions = [ @@ -155,7 +158,7 @@ describe('patchRules', () => { ]; } ((ruleOptions.rulesClient as unknown) as RulesClientMock).update.mockResolvedValue( - getAlertMock(getQueryRuleParams()) + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) ); await patchRules(ruleOptions); expect(ruleOptions.rulesClient.update).toHaveBeenCalledWith( diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.ts index bc1faa5dff470..c3b7e7288dc57 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.ts @@ -80,6 +80,7 @@ export const patchRules = async ({ to, type, references, + namespace, note, version, exceptionsList, @@ -131,6 +132,7 @@ export const patchRules = async ({ type, references, version, + namespace, note, exceptionsList, anomalyThreshold, @@ -176,6 +178,7 @@ export const patchRules = async ({ to, type, references, + namespace, note, version: calculatedVersion, exceptionsList, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/defense_evasion_privacy_controls_tcc_database_modification.json b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/defense_evasion_privacy_controls_tcc_database_modification.json index f437b2606c35d..e92620eaca93e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/defense_evasion_privacy_controls_tcc_database_modification.json +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/defense_evasion_privacy_controls_tcc_database_modification.json @@ -14,7 +14,7 @@ "query": "process where event.type in (\"start\", \"process_started\") and process.name : \"sqlite*\" and \n process.args : \"/*/Application Support/com.apple.TCC/TCC.db\"\n", "references": [ "https://applehelpwriter.com/2016/08/29/discovering-how-dropbox-hacks-your-mac/", - "https://github.com/bp88/JSS-Scripts/blob/master/TCC.db Modifier.sh", + "https://github.com/bp88/JSS-Scripts/blob/master/TCC.db%20Modifier.sh", "https://medium.com/@mattshockl/cve-2020-9934-bypassing-the-os-x-transparency-consent-and-control-tcc-framework-for-4e14806f1de8" ], "risk_score": 47, @@ -53,5 +53,5 @@ ], "timestamp_override": "event.ingested", "type": "eql", - "version": 1 + "version": 2 } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security.json b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security.json index 9c59f69b12113..63bf6fea698ae 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security.json +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security.json @@ -20,7 +20,7 @@ "license": "Elastic License v2", "max_signals": 10000, "name": "Endpoint Security", - "query": "event.kind:alert and event.module:(endpoint and not endgame) and not event.code: behavior\n", + "query": "event.kind:alert and event.module:(endpoint and not endgame)\n", "risk_score": 47, "risk_score_mapping": [ { @@ -64,5 +64,5 @@ ], "timestamp_override": "event.ingested", "type": "query", - "version": 4 + "version": 3 } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_behavior_protection.json b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_behavior_protection.json deleted file mode 100644 index f0a523fff96d4..0000000000000 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_behavior_protection.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "author": [ - "Elastic" - ], - "description": "Generates a detection alert each time an Elastic Endpoint Security alert is received for Behavior Protection alerts. Enabling this rule allows you to immediately begin investigating your Endpoint alerts for Behavior Protection.", - "enabled": true, - "exceptions_list": [ - { - "id": "endpoint_list", - "list_id": "endpoint_list", - "namespace_type": "agnostic", - "type": "endpoint" - } - ], - "from": "now-10m", - "index": [ - "logs-endpoint.alerts-*" - ], - "language": "kuery", - "license": "Elastic License v2", - "max_signals": 10000, - "name": "Endpoint Security Behavior Protection", - "query": "event.kind:alert and event.module:(endpoint and not endgame) and event.code: behavior\n", - "risk_score": 47, - "risk_score_mapping": [ - { - "field": "event.risk_score", - "operator": "equals", - "value": "" - } - ], - "rule_id": "d516af98-19f3-45bb-b590-dd623535b746", - "rule_name_override": "rule.name", - "severity": "medium", - "severity_mapping": [ - { - "field": "event.severity", - "operator": "equals", - "severity": "low", - "value": "21" - }, - { - "field": "event.severity", - "operator": "equals", - "severity": "medium", - "value": "47" - }, - { - "field": "event.severity", - "operator": "equals", - "severity": "high", - "value": "73" - }, - { - "field": "event.severity", - "operator": "equals", - "severity": "critical", - "value": "99" - } - ], - "tags": [ - "Elastic", - "Endpoint Security" - ], - "timestamp_override": "event.ingested", - "type": "query", - "version": 1 -} diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/index.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/index.ts index 1aa54dedef5ef..093d5c806c282 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/index.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/index.ts @@ -580,8 +580,7 @@ import rule567 from './defense_evasion_parent_process_pid_spoofing.json'; import rule568 from './defense_evasion_defender_exclusion_via_powershell.json'; import rule569 from './defense_evasion_whitespace_padding_in_command_line.json'; import rule570 from './persistence_webshell_detection.json'; -import rule571 from './elastic_endpoint_security_behavior_protection.json'; -import rule572 from './persistence_via_bits_job_notify_command.json'; +import rule571 from './persistence_via_bits_job_notify_command.json'; export const rawRules = [ rule1, @@ -1155,5 +1154,4 @@ export const rawRules = [ rule569, rule570, rule571, - rule572, ]; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/initial_access_azure_active_directory_high_risk_signin.json b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/initial_access_azure_active_directory_high_risk_signin.json index 008f6ac7b874c..5abbbb1b1c6ed 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/initial_access_azure_active_directory_high_risk_signin.json +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/initial_access_azure_active_directory_high_risk_signin.json @@ -13,7 +13,7 @@ "license": "Elastic License v2", "name": "Azure Active Directory High Risk Sign-in", "note": "## Config\n\nThe Azure Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.", - "query": "event.dataset:azure.signinlogs and\n azure.signinlogs.properties.risk_level_during_signin:high and\n event.outcome:(success or Success)\n", + "query": "event.dataset:azure.signinlogs and\n (azure.signinlogs.properties.risk_level_during_signin:high or azure.signinlogs.properties.risk_level_aggregated:high) and\n event.outcome:(success or Success)\n", "references": [ "https://docs.microsoft.com/en-us/azure/active-directory/conditional-access/howto-conditional-access-policy-risk", "https://docs.microsoft.com/en-us/azure/active-directory/identity-protection/overview-identity-protection", @@ -49,5 +49,5 @@ ], "timestamp_override": "event.ingested", "type": "query", - "version": 2 + "version": 3 } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/ml_linux_anomalous_kernel_module_arguments.json b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/ml_linux_anomalous_kernel_module_arguments.json index 358443e675c6e..c04a68171f6f8 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/ml_linux_anomalous_kernel_module_arguments.json +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/ml_linux_anomalous_kernel_module_arguments.json @@ -12,9 +12,6 @@ "license": "Elastic License v2", "machine_learning_job_id": "linux_rare_kernel_module_arguments", "name": "Anomalous Kernel Module Activity", - "references": [ - "references" - ], "risk_score": 21, "rule_id": "37b0816d-af40-40b4-885f-bb162b3c88a9", "severity": "low", @@ -50,5 +47,5 @@ } ], "type": "machine_learning", - "version": 3 + "version": 4 } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/persistence_docker_shortcuts_plist_modification.json b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/persistence_docker_shortcuts_plist_modification.json index 941fe5cbf5484..e513b5ace737f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/persistence_docker_shortcuts_plist_modification.json +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/persistence_docker_shortcuts_plist_modification.json @@ -13,7 +13,7 @@ "name": "Persistence via Docker Shortcut Modification", "query": "event.category : file and event.action : modification and \n file.path : /Users/*/Library/Preferences/com.apple.dock.plist and \n not process.name : (xpcproxy or cfprefsd or plutil or jamf or PlistBuddy or InstallerRemotePluginService)\n", "references": [ - "https://github.com/specterops/presentations/raw/master/Leo Pitt/Hey_Im_Still_in_Here_Modern_macOS_Persistence_SO-CON2020.pdf" + "https://github.com/specterops/presentations/raw/master/Leo%20Pitt/Hey_Im_Still_in_Here_Modern_macOS_Persistence_SO-CON2020.pdf" ], "risk_score": 47, "rule_id": "c81cefcb-82b9-4408-a533-3c3df549e62d", @@ -44,5 +44,5 @@ ], "timestamp_override": "event.ingested", "type": "query", - "version": 1 + "version": 2 } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/persistence_finder_sync_plugin_pluginkit.json b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/persistence_finder_sync_plugin_pluginkit.json index f2b6364301fe2..cdef729404ceb 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/persistence_finder_sync_plugin_pluginkit.json +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/persistence_finder_sync_plugin_pluginkit.json @@ -16,7 +16,7 @@ "name": "Finder Sync Plugin Registered and Enabled", "query": "sequence by host.id, user.id with maxspan = 5s\n [process where event.type in (\"start\", \"process_started\") and process.name : \"pluginkit\" and process.args : \"-a\"]\n [process where event.type in (\"start\", \"process_started\") and process.name : \"pluginkit\" and\n process.args : \"-e\" and process.args : \"use\" and process.args : \"-i\" and\n not process.args :\n (\n \"com.google.GoogleDrive.FinderSyncAPIExtension\",\n \"com.google.drivefs.findersync\",\n \"com.boxcryptor.osx.Rednif\",\n \"com.adobe.accmac.ACCFinderSync\",\n \"com.microsoft.OneDrive.FinderSync\",\n \"com.insynchq.Insync.Insync-Finder-Integration\",\n \"com.box.desktop.findersyncext\"\n )\n ]\n", "references": [ - "https://github.com/specterops/presentations/raw/master/Leo Pitt/Hey_Im_Still_in_Here_Modern_macOS_Persistence_SO-CON2020.pdf" + "https://github.com/specterops/presentations/raw/master/Leo%20Pitt/Hey_Im_Still_in_Here_Modern_macOS_Persistence_SO-CON2020.pdf" ], "risk_score": 47, "rule_id": "37f638ea-909d-4f94-9248-edd21e4a9906", @@ -46,5 +46,5 @@ } ], "type": "eql", - "version": 1 + "version": 2 } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/privilege_escalation_unusual_parentchild_relationship.json b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/privilege_escalation_unusual_parentchild_relationship.json index 26d62c2da95b0..9cdf474efb450 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/privilege_escalation_unusual_parentchild_relationship.json +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules/privilege_escalation_unusual_parentchild_relationship.json @@ -14,7 +14,7 @@ "name": "Unusual Parent-Child Relationship", "query": "process where event.type in (\"start\", \"process_started\") and\nprocess.parent.name != null and\n (\n /* suspicious parent processes */\n (process.name:\"autochk.exe\" and not process.parent.name:\"smss.exe\") or\n (process.name:(\"fontdrvhost.exe\", \"dwm.exe\") and not process.parent.name:(\"wininit.exe\", \"winlogon.exe\")) or\n (process.name:(\"consent.exe\", \"RuntimeBroker.exe\", \"TiWorker.exe\") and not process.parent.name:\"svchost.exe\") or\n (process.name:\"SearchIndexer.exe\" and not process.parent.name:\"services.exe\") or\n (process.name:\"SearchProtocolHost.exe\" and not process.parent.name:(\"SearchIndexer.exe\", \"dllhost.exe\")) or\n (process.name:\"dllhost.exe\" and not process.parent.name:(\"services.exe\", \"svchost.exe\")) or\n (process.name:\"smss.exe\" and not process.parent.name:(\"System\", \"smss.exe\")) or\n (process.name:\"csrss.exe\" and not process.parent.name:(\"smss.exe\", \"svchost.exe\")) or\n (process.name:\"wininit.exe\" and not process.parent.name:\"smss.exe\") or\n (process.name:\"winlogon.exe\" and not process.parent.name:\"smss.exe\") or\n (process.name:(\"lsass.exe\", \"LsaIso.exe\") and not process.parent.name:\"wininit.exe\") or\n (process.name:\"LogonUI.exe\" and not process.parent.name:(\"wininit.exe\", \"winlogon.exe\")) or\n (process.name:\"services.exe\" and not process.parent.name:\"wininit.exe\") or\n (process.name:\"svchost.exe\" and not process.parent.name:(\"MsMpEng.exe\", \"services.exe\")) or\n (process.name:\"spoolsv.exe\" and not process.parent.name:\"services.exe\") or\n (process.name:\"taskhost.exe\" and not process.parent.name:(\"services.exe\", \"svchost.exe\")) or\n (process.name:\"taskhostw.exe\" and not process.parent.name:(\"services.exe\", \"svchost.exe\")) or\n (process.name:\"userinit.exe\" and not process.parent.name:(\"dwm.exe\", \"winlogon.exe\")) or\n (process.name:(\"wmiprvse.exe\", \"wsmprovhost.exe\", \"winrshost.exe\") and not process.parent.name:\"svchost.exe\") or\n /* suspicious child processes */\n (process.parent.name:(\"SearchProtocolHost.exe\", \"taskhost.exe\", \"csrss.exe\") and not process.name:(\"werfault.exe\", \"wermgr.exe\", \"WerFaultSecure.exe\")) or\n (process.parent.name:\"autochk.exe\" and not process.name:(\"chkdsk.exe\", \"doskey.exe\", \"WerFault.exe\")) or\n (process.parent.name:\"smss.exe\" and not process.name:(\"autochk.exe\", \"smss.exe\", \"csrss.exe\", \"wininit.exe\", \"winlogon.exe\", \"setupcl.exe\", \"WerFault.exe\")) or\n (process.parent.name:\"wermgr.exe\" and not process.name:(\"WerFaultSecure.exe\", \"wermgr.exe\", \"WerFault.exe\")) or\n (process.parent.name:\"conhost.exe\" and not process.name:(\"mscorsvw.exe\", \"wermgr.exe\", \"WerFault.exe\", \"WerFaultSecure.exe\"))\n )\n", "references": [ - "https://github.com/sbousseaden/Slides/blob/master/Hunting MindMaps/PNG/Windows Processes TH.map.png", + "https://github.com/sbousseaden/Slides/blob/master/Hunting MindMaps/PNG/Windows Processes%20TH.map.png", "https://www.andreafortuna.org/2017/06/15/standard-windows-processes-a-brief-reference/" ], "risk_score": 47, @@ -53,5 +53,5 @@ ], "timestamp_override": "event.ingested", "type": "eql", - "version": 8 + "version": 9 } diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/read_rules.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/read_rules.test.ts index 33bc002942497..6f89d725a458e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/read_rules.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/read_rules.test.ts @@ -21,7 +21,10 @@ export class TestError extends Error { public output: { statusCode: number }; } -describe('read_rules', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('read_rules - %s', (_, isRuleRegistryEnabled) => { beforeEach(() => { jest.resetAllMocks(); jest.restoreAllMocks(); @@ -30,23 +33,25 @@ describe('read_rules', () => { describe('readRules', () => { test('should return the output from rulesClient if id is set but ruleId is undefined', async () => { const rulesClient = rulesClientMock.create(); - rulesClient.get.mockResolvedValue(getAlertMock(getQueryRuleParams())); + rulesClient.get.mockResolvedValue(getAlertMock(isRuleRegistryEnabled, getQueryRuleParams())); const rule = await readRules({ + isRuleRegistryEnabled, rulesClient, id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd', ruleId: undefined, }); - expect(rule).toEqual(getAlertMock(getQueryRuleParams())); + expect(rule).toEqual(getAlertMock(isRuleRegistryEnabled, getQueryRuleParams())); }); test('should return null if saved object found by alerts client given id is not alert type', async () => { const rulesClient = rulesClientMock.create(); - const result = getAlertMock(getQueryRuleParams()); + const result = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); // @ts-expect-error delete result.alertTypeId; rulesClient.get.mockResolvedValue(result); const rule = await readRules({ + isRuleRegistryEnabled, rulesClient, id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd', ruleId: undefined, @@ -61,6 +66,7 @@ describe('read_rules', () => { }); const rule = await readRules({ + isRuleRegistryEnabled, rulesClient, id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd', ruleId: undefined, @@ -75,6 +81,7 @@ describe('read_rules', () => { }); try { await readRules({ + isRuleRegistryEnabled, rulesClient, id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd', ruleId: undefined, @@ -86,23 +93,25 @@ describe('read_rules', () => { test('should return the output from rulesClient if id is undefined but ruleId is set', async () => { const rulesClient = rulesClientMock.create(); - rulesClient.get.mockResolvedValue(getAlertMock(getQueryRuleParams())); - rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); + rulesClient.get.mockResolvedValue(getAlertMock(isRuleRegistryEnabled, getQueryRuleParams())); + rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); const rule = await readRules({ + isRuleRegistryEnabled, rulesClient, id: undefined, ruleId: 'rule-1', }); - expect(rule).toEqual(getAlertMock(getQueryRuleParams())); + expect(rule).toEqual(getAlertMock(isRuleRegistryEnabled, getQueryRuleParams())); }); test('should return null if the output from rulesClient with ruleId set is empty', async () => { const rulesClient = rulesClientMock.create(); - rulesClient.get.mockResolvedValue(getAlertMock(getQueryRuleParams())); + rulesClient.get.mockResolvedValue(getAlertMock(isRuleRegistryEnabled, getQueryRuleParams())); rulesClient.find.mockResolvedValue({ data: [], page: 0, perPage: 1, total: 0 }); const rule = await readRules({ + isRuleRegistryEnabled, rulesClient, id: undefined, ruleId: 'rule-1', @@ -112,23 +121,25 @@ describe('read_rules', () => { test('should return the output from rulesClient if id is null but ruleId is set', async () => { const rulesClient = rulesClientMock.create(); - rulesClient.get.mockResolvedValue(getAlertMock(getQueryRuleParams())); - rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); + rulesClient.get.mockResolvedValue(getAlertMock(isRuleRegistryEnabled, getQueryRuleParams())); + rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); const rule = await readRules({ + isRuleRegistryEnabled, rulesClient, id: undefined, ruleId: 'rule-1', }); - expect(rule).toEqual(getAlertMock(getQueryRuleParams())); + expect(rule).toEqual(getAlertMock(isRuleRegistryEnabled, getQueryRuleParams())); }); test('should return null if id and ruleId are undefined', async () => { const rulesClient = rulesClientMock.create(); - rulesClient.get.mockResolvedValue(getAlertMock(getQueryRuleParams())); - rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); + rulesClient.get.mockResolvedValue(getAlertMock(isRuleRegistryEnabled, getQueryRuleParams())); + rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); const rule = await readRules({ + isRuleRegistryEnabled, rulesClient, id: undefined, ruleId: undefined, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/read_rules.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/read_rules.ts index 141977f2474e0..9578e3d4cb6d2 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/read_rules.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/read_rules.ts @@ -20,6 +20,7 @@ import { isAlertType, ReadRuleOptions } from './types'; * a filter query against the tags using `alert.attributes.tags: "__internal:${ruleId}"]` */ export const readRules = async ({ + isRuleRegistryEnabled, rulesClient, id, ruleId, @@ -27,7 +28,7 @@ export const readRules = async ({ if (id != null) { try { const rule = await rulesClient.get({ id }); - if (isAlertType(rule)) { + if (isAlertType(isRuleRegistryEnabled, rule)) { return rule; } else { return null; @@ -42,6 +43,7 @@ export const readRules = async ({ } } else if (ruleId != null) { const ruleFromFind = await findRules({ + isRuleRegistryEnabled, rulesClient, filter: `alert.attributes.tags: "${INTERNAL_RULE_ID_KEY}:${ruleId}"`, page: 1, @@ -50,7 +52,10 @@ export const readRules = async ({ sortField: undefined, sortOrder: undefined, }); - if (ruleFromFind.data.length === 0 || !isAlertType(ruleFromFind.data[0])) { + if ( + ruleFromFind.data.length === 0 || + !isAlertType(isRuleRegistryEnabled, ruleFromFind.data[0]) + ) { return null; } else { return ruleFromFind.data[0]; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/types.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/types.ts index 235217761c8b1..c27caaed5449e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/types.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/types.ts @@ -101,6 +101,7 @@ import { BuildingBlockTypeOrUndefined, RuleNameOverrideOrUndefined, EventCategoryOverrideOrUndefined, + NamespaceOrUndefined, } from '../../../../common/detection_engine/schemas/common/schemas'; import { RulesClient, PartialAlert } from '../../../../../alerting/server'; @@ -109,6 +110,7 @@ import { SIGNALS_ID } from '../../../../common/constants'; import { PartialFilter } from '../types'; import { RuleParams } from '../schemas/rule_schemas'; import { IRuleExecutionLogClient } from '../rule_execution_log/types'; +import { ruleTypeMappings } from '../signals/utils'; export type RuleAlertType = Alert; @@ -192,15 +194,20 @@ export interface Clients { } export const isAlertTypes = ( + isRuleRegistryEnabled: boolean, partialAlert: Array> ): partialAlert is RuleAlertType[] => { - return partialAlert.every((rule) => isAlertType(rule)); + return partialAlert.every((rule) => isAlertType(isRuleRegistryEnabled, rule)); }; export const isAlertType = ( + isRuleRegistryEnabled: boolean, partialAlert: PartialAlert ): partialAlert is RuleAlertType => { - return partialAlert.alertTypeId === SIGNALS_ID; + const ruleTypeValues = (Object.values(ruleTypeMappings) as unknown) as string[]; + return isRuleRegistryEnabled + ? ruleTypeValues.includes(partialAlert.alertTypeId as string) + : partialAlert.alertTypeId === SIGNALS_ID; }; export const isRuleStatusSavedObjectType = ( @@ -266,9 +273,12 @@ export interface CreateRulesOptions { version: Version; exceptionsList: ListArray; actions: RuleAlertAction[]; + isRuleRegistryEnabled: boolean; + namespace?: NamespaceOrUndefined; } export interface UpdateRulesOptions { + isRuleRegistryEnabled: boolean; spaceId: string; ruleStatusClient: IRuleExecutionLogClient; rulesClient: RulesClient; @@ -327,9 +337,11 @@ export interface PatchRulesOptions { exceptionsList: ListArrayOrUndefined; actions: RuleAlertAction[] | undefined; rule: SanitizedAlert | null; + namespace?: NamespaceOrUndefined; } export interface ReadRuleOptions { + isRuleRegistryEnabled: boolean; rulesClient: RulesClient; id: IdOrUndefined; ruleId: RuleIdOrUndefined; @@ -343,6 +355,7 @@ export interface DeleteRuleOptions { } export interface FindRuleOptions { + isRuleRegistryEnabled: boolean; rulesClient: RulesClient; perPage: PerPageOrUndefined; page: PageOrUndefined; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_prepacked_rules.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_prepacked_rules.test.ts index 5cc7f068aa06d..7c9f0c9ec67a3 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_prepacked_rules.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_prepacked_rules.test.ts @@ -13,7 +13,10 @@ import { getAddPrepackagedRulesSchemaDecodedMock } from '../../../../common/dete import { ruleExecutionLogClientMock } from '../rule_execution_log/__mocks__/rule_execution_log_client'; jest.mock('./patch_rules'); -describe('updatePrepackagedRules', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('updatePrepackagedRules - %s', (_, isRuleRegistryEnabled) => { let rulesClient: ReturnType; let ruleStatusClient: ReturnType; @@ -33,14 +36,15 @@ describe('updatePrepackagedRules', () => { ]; const outputIndex = 'outputIndex'; const prepackagedRule = getAddPrepackagedRulesSchemaDecodedMock(); - rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); + rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); await updatePrepackagedRules( rulesClient, 'default', ruleStatusClient, [{ ...prepackagedRule, actions }], - outputIndex + outputIndex, + isRuleRegistryEnabled ); expect(patchRules).toHaveBeenCalledWith( diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_prepacked_rules.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_prepacked_rules.ts index fcfab2fda1a8b..d9c2ecd1b5732 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_prepacked_rules.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_prepacked_rules.ts @@ -54,7 +54,8 @@ export const updatePrepackagedRules = async ( spaceId: string, ruleStatusClient: IRuleExecutionLogClient, rules: AddPrepackagedRulesSchemaDecoded[], - outputIndex: string + outputIndex: string, + isRuleRegistryEnabled: boolean ): Promise => { const ruleChunks = chunk(UPDATE_CHUNK_SIZE, rules); for (const ruleChunk of ruleChunks) { @@ -63,7 +64,8 @@ export const updatePrepackagedRules = async ( spaceId, ruleStatusClient, ruleChunk, - outputIndex + outputIndex, + isRuleRegistryEnabled ); await Promise.all(rulePromises); } @@ -83,7 +85,8 @@ export const createPromises = ( spaceId: string, ruleStatusClient: IRuleExecutionLogClient, rules: AddPrepackagedRulesSchemaDecoded[], - outputIndex: string + outputIndex: string, + isRuleRegistryEnabled: boolean ): Array | null>> => { return rules.map(async (rule) => { const { @@ -133,7 +136,12 @@ export const createPromises = ( exceptions_list: exceptionsList, } = rule; - const existingRule = await readRules({ rulesClient, ruleId, id: undefined }); + const existingRule = await readRules({ + isRuleRegistryEnabled, + rulesClient, + ruleId, + id: undefined, + }); // TODO: Fix these either with an is conversion or by better typing them within io-ts const filters: PartialFilter[] | undefined = filtersObject as PartialFilter[]; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_rules.mock.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_rules.mock.ts index df9431e00a67c..58d6cf1fd5e6b 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_rules.mock.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_rules.mock.ts @@ -11,20 +11,21 @@ import { getUpdateRulesSchemaMock, } from '../../../../common/detection_engine/schemas/request/rule_schemas.mock'; import { ruleExecutionLogClientMock } from '../rule_execution_log/__mocks__/rule_execution_log_client'; -import { UpdateRulesOptions } from './types'; -export const getUpdateRulesOptionsMock = (): UpdateRulesOptions => ({ +export const getUpdateRulesOptionsMock = (isRuleRegistryEnabled: boolean) => ({ spaceId: 'default', rulesClient: rulesClientMock.create(), ruleStatusClient: ruleExecutionLogClientMock.create(), defaultOutputIndex: '.siem-signals-default', ruleUpdate: getUpdateRulesSchemaMock(), + isRuleRegistryEnabled, }); -export const getUpdateMlRulesOptionsMock = (): UpdateRulesOptions => ({ +export const getUpdateMlRulesOptionsMock = (isRuleRegistryEnabled: boolean) => ({ spaceId: 'default', rulesClient: rulesClientMock.create(), ruleStatusClient: ruleExecutionLogClientMock.create(), defaultOutputIndex: '.siem-signals-default', ruleUpdate: getUpdateMachineLearningSchemaMock(), + isRuleRegistryEnabled, }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_rules.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_rules.test.ts index e46b4fad63a92..1ad5cd7ae934c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_rules.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_rules.test.ts @@ -11,15 +11,18 @@ import { getUpdateRulesOptionsMock, getUpdateMlRulesOptionsMock } from './update import { RulesClientMock } from '../../../../../alerting/server/rules_client.mock'; import { getMlRuleParams, getQueryRuleParams } from '../schemas/rule_schemas.mock'; -describe('updateRules', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('updateRules - %s', (_, isRuleRegistryEnabled) => { it('should call rulesClient.disable if the rule was enabled and enabled is false', async () => { - const rulesOptionsMock = getUpdateRulesOptionsMock(); + const rulesOptionsMock = getUpdateRulesOptionsMock(isRuleRegistryEnabled); rulesOptionsMock.ruleUpdate.enabled = false; ((rulesOptionsMock.rulesClient as unknown) as RulesClientMock).get.mockResolvedValue( - getAlertMock(getQueryRuleParams()) + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) ); ((rulesOptionsMock.rulesClient as unknown) as RulesClientMock).update.mockResolvedValue( - getAlertMock(getQueryRuleParams()) + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) ); await updateRules(rulesOptionsMock); @@ -32,15 +35,15 @@ describe('updateRules', () => { }); it('should call rulesClient.enable if the rule was disabled and enabled is true', async () => { - const rulesOptionsMock = getUpdateRulesOptionsMock(); + const rulesOptionsMock = getUpdateRulesOptionsMock(isRuleRegistryEnabled); rulesOptionsMock.ruleUpdate.enabled = true; ((rulesOptionsMock.rulesClient as unknown) as RulesClientMock).get.mockResolvedValue({ - ...getAlertMock(getQueryRuleParams()), + ...getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()), enabled: false, }); ((rulesOptionsMock.rulesClient as unknown) as RulesClientMock).update.mockResolvedValue( - getAlertMock(getQueryRuleParams()) + getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()) ); await updateRules(rulesOptionsMock); @@ -53,15 +56,15 @@ describe('updateRules', () => { }); it('calls the rulesClient with params', async () => { - const rulesOptionsMock = getUpdateMlRulesOptionsMock(); + const rulesOptionsMock = getUpdateMlRulesOptionsMock(isRuleRegistryEnabled); rulesOptionsMock.ruleUpdate.enabled = true; ((rulesOptionsMock.rulesClient as unknown) as RulesClientMock).update.mockResolvedValue( - getAlertMock(getMlRuleParams()) + getAlertMock(isRuleRegistryEnabled, getMlRuleParams()) ); ((rulesOptionsMock.rulesClient as unknown) as RulesClientMock).get.mockResolvedValue( - getAlertMock(getMlRuleParams()) + getAlertMock(isRuleRegistryEnabled, getMlRuleParams()) ); await updateRules(rulesOptionsMock); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_rules.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_rules.ts index a3e0ba31f0c3c..f4060f7f831a9 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_rules.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_rules.ts @@ -14,11 +14,12 @@ import { readRules } from './read_rules'; import { UpdateRulesOptions } from './types'; import { addTags } from './add_tags'; import { typeSpecificSnakeToCamel } from '../schemas/rule_converters'; -import { InternalRuleUpdate, RuleParams } from '../schemas/rule_schemas'; +import { RuleParams } from '../schemas/rule_schemas'; import { enableRule } from './enable_rule'; import { maybeMute, transformToAlertThrottle, transformToNotifyWhen } from './utils'; export const updateRules = async ({ + isRuleRegistryEnabled, spaceId, rulesClient, ruleStatusClient, @@ -26,6 +27,7 @@ export const updateRules = async ({ ruleUpdate, }: UpdateRulesOptions): Promise | null> => { const existingRule = await readRules({ + isRuleRegistryEnabled, rulesClient, ruleId: ruleUpdate.rule_id, id: ruleUpdate.id, @@ -36,7 +38,7 @@ export const updateRules = async ({ const typeSpecificParams = typeSpecificSnakeToCamel(ruleUpdate); const enabled = ruleUpdate.enabled ?? true; - const newInternalRule: InternalRuleUpdate = { + const newInternalRule = { name: ruleUpdate.name, tags: addTags(ruleUpdate.tags ?? [], existingRule.params.ruleId, existingRule.params.immutable), params: { @@ -63,6 +65,7 @@ export const updateRules = async ({ timestampOverride: ruleUpdate.timestamp_override, to: ruleUpdate.to ?? 'now', references: ruleUpdate.references ?? [], + namespace: ruleUpdate.namespace, note: ruleUpdate.note, // Always use the version from the request if specified. If it isn't specified, leave immutable rules alone and // increment the version of mutable rules by 1. diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.test.ts index 602e422772711..95e8552c4b14b 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.test.ts @@ -81,6 +81,7 @@ describe('utils', () => { type: undefined, references: undefined, version: undefined, + namespace: undefined, note: undefined, anomalyThreshold: undefined, machineLearningJobId: undefined, @@ -131,6 +132,7 @@ describe('utils', () => { type: undefined, references: undefined, version: undefined, + namespace: undefined, note: undefined, anomalyThreshold: undefined, machineLearningJobId: undefined, @@ -181,6 +183,7 @@ describe('utils', () => { type: undefined, references: undefined, version: undefined, + namespace: undefined, note: undefined, anomalyThreshold: undefined, machineLearningJobId: undefined, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.ts index d9d5151a64c46..3fdd97b7d933f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.ts @@ -52,6 +52,7 @@ import { RuleNameOverrideOrUndefined, TimestampOverrideOrUndefined, EventCategoryOverrideOrUndefined, + NamespaceOrUndefined, } from '../../../../common/detection_engine/schemas/common/schemas'; import { PartialFilter } from '../types'; import { RuleParams } from '../schemas/rule_schemas'; @@ -118,6 +119,7 @@ export interface UpdateProperties { version: VersionOrUndefined; exceptionsList: ListArrayOrUndefined; anomalyThreshold: AnomalyThresholdOrUndefined; + namespace: NamespaceOrUndefined; } export const calculateVersion = ( diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/schemas/rule_converters.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/schemas/rule_converters.ts index 8a67636c6649d..5214be513a0e6 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/schemas/rule_converters.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/schemas/rule_converters.ts @@ -36,6 +36,7 @@ import { transformToAlertThrottle, transformToNotifyWhen, } from '../rules/utils'; +import { ruleTypeMappings } from '../signals/utils'; // These functions provide conversions from the request API schema to the internal rule schema and from the internal rule schema // to the response API schema. This provides static type-check assurances that the internal schema is in sync with the API schema for @@ -121,14 +122,15 @@ export const typeSpecificSnakeToCamel = (params: CreateTypeSpecific): TypeSpecif export const convertCreateAPIToInternalSchema = ( input: CreateRulesSchema, - siemClient: AppClient + siemClient: AppClient, + isRuleRegistryEnabled: boolean ): InternalRuleCreate => { const typeSpecificParams = typeSpecificSnakeToCamel(input); const newRuleId = input.rule_id ?? uuid.v4(); return { name: input.name, tags: addTags(input.tags ?? [], newRuleId, false), - alertTypeId: SIGNALS_ID, + alertTypeId: isRuleRegistryEnabled ? ruleTypeMappings[input.type] : SIGNALS_ID, consumer: SERVER_APP_ID, params: { author: input.author ?? [], @@ -153,6 +155,7 @@ export const convertCreateAPIToInternalSchema = ( timestampOverride: input.timestamp_override, to: input.to ?? 'now', references: input.references ?? [], + namespace: input.namespace, note: input.note, version: input.version ?? 1, exceptionsList: input.exceptions_list ?? [], @@ -249,6 +252,7 @@ export const commonParamsCamelToSnake = (params: BaseRuleParams) => { risk_score: params.riskScore, severity: params.severity, building_block_type: params.buildingBlockType, + namespace: params.namespace, note: params.note, license: params.license, output_index: params.outputIndex, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/schemas/rule_schemas.mock.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/schemas/rule_schemas.mock.ts index 846a4e26410a3..506f40af2ee79 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/schemas/rule_schemas.mock.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/schemas/rule_schemas.mock.ts @@ -36,6 +36,7 @@ const getBaseRuleParams = (): BaseRuleParams => { riskScoreMapping: [], ruleNameOverride: undefined, maxSignals: 10000, + namespace: undefined, note: '# Investigative notes', timelineId: 'some-timeline-id', timelineTitle: 'some-timeline-title', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/schemas/rule_schemas.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/schemas/rule_schemas.ts index c414ecc8655a3..578d8c4926b69 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/schemas/rule_schemas.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/schemas/rule_schemas.ts @@ -32,6 +32,7 @@ import { buildingBlockTypeOrUndefined, description, enabled, + namespaceOrUndefined, noteOrUndefined, false_positives, rule_id, @@ -62,7 +63,15 @@ import { updated_at, } from '../../../../common/detection_engine/schemas/common/schemas'; -import { SIGNALS_ID, SERVER_APP_ID } from '../../../../common/constants'; +import { + SIGNALS_ID, + SERVER_APP_ID, + INDICATOR_RULE_TYPE_ID, + ML_RULE_TYPE_ID, + QUERY_RULE_TYPE_ID, + EQL_RULE_TYPE_ID, + THRESHOLD_RULE_TYPE_ID, +} from '../../../../common/constants'; const nonEqlLanguages = t.keyof({ kuery: null, lucene: null }); export const baseRuleParams = t.exact( @@ -70,6 +79,7 @@ export const baseRuleParams = t.exact( author, buildingBlockType: buildingBlockTypeOrUndefined, description, + namespace: namespaceOrUndefined, note: noteOrUndefined, falsePositives: false_positives, from, @@ -196,10 +206,20 @@ export const notifyWhen = t.union([ t.null, ]); +export const allRuleTypes = t.union([ + t.literal(SIGNALS_ID), + t.literal(EQL_RULE_TYPE_ID), + t.literal(ML_RULE_TYPE_ID), + t.literal(QUERY_RULE_TYPE_ID), + t.literal(INDICATOR_RULE_TYPE_ID), + t.literal(THRESHOLD_RULE_TYPE_ID), +]); +export type AllRuleTypes = t.TypeOf; + export const internalRuleCreate = t.type({ name, tags, - alertTypeId: t.literal(SIGNALS_ID), + alertTypeId: allRuleTypes, consumer: t.literal(SERVER_APP_ID), schedule: t.type({ interval: t.string, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.test.ts index 206f3ae59d246..5f392bed75f76 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.test.ts @@ -43,6 +43,7 @@ describe('buildBulkBody', () => { ruleSO, doc, 'missingFields', + [], buildReasonMessage ); // Timestamp will potentially always be different so remove it for the test @@ -114,6 +115,7 @@ describe('buildBulkBody', () => { ruleSO, doc, 'missingFields', + [], buildReasonMessage ); // Timestamp will potentially always be different so remove it for the test @@ -199,6 +201,7 @@ describe('buildBulkBody', () => { ruleSO, doc, 'missingFields', + [], buildReasonMessage ); // Timestamp will potentially always be different so remove it for the test @@ -270,6 +273,7 @@ describe('buildBulkBody', () => { ruleSO, doc, 'missingFields', + [], buildReasonMessage ); // Timestamp will potentially always be different so remove it for the test @@ -338,6 +342,7 @@ describe('buildBulkBody', () => { ruleSO, doc, 'missingFields', + [], buildReasonMessage ); // Timestamp will potentially always be different so remove it for the test @@ -405,6 +410,7 @@ describe('buildBulkBody', () => { ruleSO, doc, 'missingFields', + [], buildReasonMessage ); const expected: Omit & { someKey: string } = { @@ -468,6 +474,7 @@ describe('buildBulkBody', () => { ruleSO, doc, 'missingFields', + [], buildReasonMessage ); const expected: Omit & { someKey: string } = { @@ -712,6 +719,7 @@ describe('buildSignalFromEvent', () => { ruleSO, true, 'missingFields', + [], buildReasonMessage ); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.ts index a4e812e8f111a..eb7e8a9fbb6d7 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { TIMESTAMP } from '@kbn/rule-data-utils'; import { SavedObject } from 'src/core/types'; import { getMergeStrategy } from './source_fields_merging/strategies'; import { @@ -37,9 +38,10 @@ export const buildBulkBody = ( ruleSO: SavedObject, doc: SignalSourceHit, mergeStrategy: ConfigType['alertMergeStrategy'], + ignoreFields: ConfigType['alertIgnoreFields'], buildReasonMessage: BuildReasonMessage ): SignalHit => { - const mergedDoc = getMergeStrategy(mergeStrategy)({ doc }); + const mergedDoc = getMergeStrategy(mergeStrategy)({ doc, ignoreFields }); const rule = buildRuleWithOverrides(ruleSO, mergedDoc._source ?? {}); const timestamp = new Date().toISOString(); const reason = buildReasonMessage({ mergedDoc, rule }); @@ -56,7 +58,7 @@ export const buildBulkBody = ( }; const signalHit: SignalHit = { ...filteredSource, - '@timestamp': timestamp, + [TIMESTAMP]: timestamp, event, signal, }; @@ -76,11 +78,19 @@ export const buildSignalGroupFromSequence = ( ruleSO: SavedObject, outputIndex: string, mergeStrategy: ConfigType['alertMergeStrategy'], + ignoreFields: ConfigType['alertIgnoreFields'], buildReasonMessage: BuildReasonMessage ): WrappedSignalHit[] => { const wrappedBuildingBlocks = wrapBuildingBlocks( sequence.events.map((event) => { - const signal = buildSignalFromEvent(event, ruleSO, false, mergeStrategy, buildReasonMessage); + const signal = buildSignalFromEvent( + event, + ruleSO, + false, + mergeStrategy, + ignoreFields, + buildReasonMessage + ); signal.signal.rule.building_block_type = 'default'; return signal; }), @@ -126,7 +136,7 @@ export const buildSignalFromSequence = ( const signal: Signal = buildSignal(events, rule, reason); return { ...mergedEvents, - '@timestamp': timestamp, + [TIMESTAMP]: timestamp, event: { kind: 'signal', }, @@ -146,9 +156,10 @@ export const buildSignalFromEvent = ( ruleSO: SavedObject, applyOverrides: boolean, mergeStrategy: ConfigType['alertMergeStrategy'], + ignoreFields: ConfigType['alertIgnoreFields'], buildReasonMessage: BuildReasonMessage ): SignalHit => { - const mergedEvent = getMergeStrategy(mergeStrategy)({ doc: event }); + const mergedEvent = getMergeStrategy(mergeStrategy)({ doc: event, ignoreFields }); const rule = applyOverrides ? buildRuleWithOverrides(ruleSO, mergedEvent._source ?? {}) : buildRuleWithoutOverrides(ruleSO); @@ -166,7 +177,7 @@ export const buildSignalFromEvent = ( // TODO: better naming for SignalHit - it's really a new signal to be inserted const signalHit: SignalHit = { ...filteredSource, - '@timestamp': timestamp, + [TIMESTAMP]: timestamp, event: eventFields, signal, }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_event_type_signal.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_event_type_signal.test.ts index 0ae81770e83c2..cc3456e7ab968 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_event_type_signal.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_event_type_signal.test.ts @@ -7,7 +7,6 @@ import { sampleDocNoSortId } from './__mocks__/es_results'; import { buildEventTypeSignal, isEventTypeSignal } from './build_event_type_signal'; -import { BaseSignalHit } from './types'; describe('buildEventTypeSignal', () => { beforeEach(() => { @@ -53,7 +52,7 @@ describe('buildEventTypeSignal', () => { }); test('It validates a sample doc with a signal type as "true"', () => { - const doc: BaseSignalHit = ({ + const doc = { ...sampleDocNoSortId(), _source: { ...sampleDocNoSortId()._source, @@ -61,34 +60,34 @@ describe('buildEventTypeSignal', () => { rule: { id: 'id-123' }, }, }, - } as unknown) as BaseSignalHit; + }; expect(isEventTypeSignal(doc)).toEqual(true); }); test('It validates a numeric signal string as "false"', () => { - const doc: BaseSignalHit = ({ + const doc = { ...sampleDocNoSortId(), _source: { ...sampleDocNoSortId()._source, signal: 'something', }, - } as unknown) as BaseSignalHit; + }; expect(isEventTypeSignal(doc)).toEqual(false); }); test('It validates an empty object as "false"', () => { - const doc: BaseSignalHit = ({ + const doc = { ...sampleDocNoSortId(), _source: { ...sampleDocNoSortId()._source, signal: {}, }, - } as unknown) as BaseSignalHit; + }; expect(isEventTypeSignal(doc)).toEqual(false); }); test('It validates an empty rule object as "false"', () => { - const doc: BaseSignalHit = ({ + const doc = { ...sampleDocNoSortId(), _source: { ...sampleDocNoSortId()._source, @@ -96,7 +95,7 @@ describe('buildEventTypeSignal', () => { rule: {}, }, }, - } as unknown) as BaseSignalHit; + }; expect(isEventTypeSignal(doc)).toEqual(false); }); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_event_type_signal.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_event_type_signal.ts index 374788f31a359..d22ca0d1f5090 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_event_type_signal.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_event_type_signal.ts @@ -4,7 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { BaseSignalHit } from './types'; +import { BaseSignalHit, SimpleHit } from './types'; +import { getField } from './utils'; export const buildEventTypeSignal = (doc: BaseSignalHit): object => { if (doc._source?.event != null && doc._source?.event instanceof Object) { @@ -23,6 +24,7 @@ export const buildEventTypeSignal = (doc: BaseSignalHit): object => { * overwritten signal. * @param doc The document which might be a signal or it might be a regular log */ -export const isEventTypeSignal = (doc: BaseSignalHit): boolean => { - return doc._source?.signal?.rule?.id != null && typeof doc._source?.signal?.rule?.id === 'string'; +export const isEventTypeSignal = (doc: SimpleHit): boolean => { + const ruleId = getField(doc, 'signal.rule.id'); + return ruleId != null && typeof ruleId === 'string'; }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_signal.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_signal.ts index 962869cc4d61a..5e26466557217 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_signal.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_signal.ts @@ -9,7 +9,7 @@ import { SearchTypes } from '../../../../common/detection_engine/types'; import { RulesSchema } from '../../../../common/detection_engine/schemas/response/rules_schema'; import { SIGNALS_TEMPLATE_VERSION } from '../routes/index/get_signals_template'; import { isEventTypeSignal } from './build_event_type_signal'; -import { Signal, Ancestor, BaseSignalHit, ThresholdResult } from './types'; +import { Signal, Ancestor, BaseSignalHit, ThresholdResult, SimpleHit } from './types'; import { getValidDateFromDoc } from './utils'; /** @@ -62,7 +62,7 @@ export const buildAncestors = (doc: BaseSignalHit): Ancestor[] => { export const removeClashes = (doc: BaseSignalHit): BaseSignalHit => { // @ts-expect-error @elastic/elasticsearch _source is optional const { signal, ...noSignal } = doc._source; - if (signal == null || isEventTypeSignal(doc)) { + if (signal == null || isEventTypeSignal(doc as SimpleHit)) { return doc; } else { return { @@ -123,6 +123,8 @@ export const additionalSignalFields = (doc: BaseSignalHit) => { original_event: doc._source?.event ?? undefined, threshold_result: thresholdResult, original_signal: - doc._source?.signal != null && !isEventTypeSignal(doc) ? doc._source?.signal : undefined, + doc._source?.signal != null && !isEventTypeSignal(doc as SimpleHit) + ? doc._source?.signal + : undefined, }; }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/eql.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/eql.ts index 9a2805610ca8b..047495031a6df 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/eql.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/eql.ts @@ -75,7 +75,10 @@ export const eqlExecutor = async ({ services.scopedClusterClient.asCurrentUser, ruleParams.outputIndex ); - if (isOutdated({ current: signalIndexVersion, target: MIN_EQL_RULE_INDEX_VERSION })) { + if ( + !experimentalFeatures.ruleRegistryEnabled && + isOutdated({ current: signalIndexVersion, target: MIN_EQL_RULE_INDEX_VERSION }) + ) { throw new Error( `EQL based rules require an update to version ${MIN_EQL_RULE_INDEX_VERSION} of the detection alerts index mapping` ); @@ -95,6 +98,7 @@ export const eqlExecutor = async ({ version, index: ruleParams.index, }); + const request = buildEqlSearchRequest( ruleParams.query, inputIndex, @@ -105,19 +109,23 @@ export const eqlExecutor = async ({ exceptionItems, ruleParams.eventCategoryOverride ); + const eqlSignalSearchStart = performance.now(); logger.debug( `EQL query request path: ${request.path}, method: ${request.method}, body: ${JSON.stringify( request.body )}` ); + // TODO: fix this later const { body: response } = (await services.scopedClusterClient.asCurrentUser.transport.request( request )) as ApiResponse; + const eqlSignalSearchEnd = performance.now(); const eqlSearchDuration = makeFloatString(eqlSignalSearchEnd - eqlSignalSearchStart); result.searchAfterTimes = [eqlSearchDuration]; + let newSignals: SimpleHit[] | undefined; if (response.hits.sequences !== undefined) { newSignals = wrapSequences(response.hits.sequences, buildReasonMessageForEqlAlert); @@ -135,6 +143,7 @@ export const eqlExecutor = async ({ result.createdSignalsCount += insertResult.createdItemsCount; result.createdSignals = insertResult.createdItems; } + result.success = true; return result; }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.test.ts index afcb3707591fc..5766390099e29 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.test.ts @@ -73,6 +73,7 @@ describe('threshold_executor', () => { exceptionItems, experimentalFeatures: allowedExperimentalValues, services: alertServices, + state: { initialized: true, signalHistory: {} }, version, logger, buildRuleMessage, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.ts index ffd90f3b90b91..524bc6a6c524c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/executors/threshold.ts @@ -5,9 +5,12 @@ * 2.0. */ +import { SearchHit } from '@elastic/elasticsearch/api/types'; +import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; + import { Logger } from 'src/core/server'; import { SavedObject } from 'src/core/types'; -import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; + import { AlertInstanceContext, AlertInstanceState, @@ -28,6 +31,7 @@ import { BulkCreate, RuleRangeTuple, SearchAfterAndBulkCreateReturnType, + ThresholdAlertState, WrapHits, } from '../types'; import { @@ -37,6 +41,7 @@ import { } from '../utils'; import { BuildRuleMessage } from '../rule_messages'; import { ExperimentalFeatures } from '../../../../../common/experimental_features'; +import { buildThresholdSignalHistory } from '../threshold/build_signal_history'; export const thresholdExecutor = async ({ rule, @@ -48,6 +53,7 @@ export const thresholdExecutor = async ({ logger, buildRuleMessage, startedAt, + state, bulkCreate, wrapHits, }: { @@ -60,17 +66,48 @@ export const thresholdExecutor = async ({ logger: Logger; buildRuleMessage: BuildRuleMessage; startedAt: Date; + state: ThresholdAlertState; bulkCreate: BulkCreate; wrapHits: WrapHits; -}): Promise => { +}): Promise => { let result = createSearchAfterReturnType(); const ruleParams = rule.attributes.params; + + // Get state or build initial state (on upgrade) + const { signalHistory, searchErrors: previousSearchErrors } = state.initialized + ? { signalHistory: state.signalHistory, searchErrors: [] } + : await getThresholdSignalHistory({ + indexPattern: ['*'], // TODO: get outputIndex? + from: tuple.from.toISOString(), + to: tuple.to.toISOString(), + services, + logger, + ruleId: ruleParams.ruleId, + bucketByFields: ruleParams.threshold.field, + timestampOverride: ruleParams.timestampOverride, + buildRuleMessage, + }); + + if (!state.initialized) { + // Clean up any signal history that has fallen outside the window + const toDelete: string[] = []; + for (const [hash, entry] of Object.entries(signalHistory)) { + if (entry.lastSignalTimestamp < tuple.from.valueOf()) { + toDelete.push(hash); + } + } + for (const hash of toDelete) { + delete signalHistory[hash]; + } + } + if (hasLargeValueItem(exceptionItems)) { result.warningMessages.push( 'Exceptions that use "is in list" or "is not in list" operators are not applied to Threshold rules' ); result.warning = true; } + const inputIndex = await getInputIndex({ experimentalFeatures, services, @@ -78,23 +115,8 @@ export const thresholdExecutor = async ({ index: ruleParams.index, }); - const { - thresholdSignalHistory, - searchErrors: previousSearchErrors, - } = await getThresholdSignalHistory({ - indexPattern: [ruleParams.outputIndex], - from: tuple.from.toISOString(), - to: tuple.to.toISOString(), - services, - logger, - ruleId: ruleParams.ruleId, - bucketByFields: ruleParams.threshold.field, - timestampOverride: ruleParams.timestampOverride, - buildRuleMessage, - }); - const bucketFilters = await getThresholdBucketFilters({ - thresholdSignalHistory, + signalHistory, timestampOverride: ruleParams.timestampOverride, }); @@ -141,7 +163,7 @@ export const thresholdExecutor = async ({ signalsIndex: ruleParams.outputIndex, startedAt, from: tuple.from.toDate(), - thresholdSignalHistory, + signalHistory, bulkCreate, wrapHits, }); @@ -161,5 +183,31 @@ export const thresholdExecutor = async ({ searchAfterTimes: [thresholdSearchDuration], }), ]); - return result; + + const createdAlerts = createdItems.map((alert) => { + const { _id, _index, ...source } = alert as { _id: string; _index: string }; + return { + _id, + _index, + _source: { + ...source, + }, + } as SearchHit; + }); + + const newSignalHistory = buildThresholdSignalHistory({ + alerts: createdAlerts, + }); + + return { + ...result, + state: { + ...state, + initialized: true, + signalHistory: { + ...signalHistory, + ...newSignalHistory, + }, + }, + }; }; 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 8bf0c986b9c25..55a184a1c0bcc 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 @@ -74,6 +74,7 @@ describe('searchAfterAndBulkCreate', () => { ruleSO, signalsIndex: DEFAULT_SIGNALS_INDEX, mergeStrategy: 'missingFields', + ignoreFields: [], }); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.ts index 8037a9a201510..52b0799f5fe33 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/search_after_bulk_create.ts @@ -182,7 +182,7 @@ export const searchAfterAndBulkCreate = async ({ break; } } catch (exc: unknown) { - logger.error(buildRuleMessage(`[-] search_after and bulk threw an error ${exc}`)); + logger.error(buildRuleMessage(`[-] search_after_bulk_create threw an error ${exc}`)); return mergeReturns([ toReturn, createSearchAfterReturnType({ diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.test.ts index 39728235db39c..2696d6981083e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.test.ts @@ -177,7 +177,7 @@ describe('signal_rule_alert_type', () => { alertServices.scopedClusterClient.asCurrentUser.fieldCaps.mockResolvedValue( value as ApiResponse ); - const ruleAlert = getAlertMock(getQueryRuleParams()); + const ruleAlert = getAlertMock(false, getQueryRuleParams()); alertServices.savedObjectsClient.get.mockResolvedValue({ id: 'id', type: 'type', @@ -195,6 +195,7 @@ describe('signal_rule_alert_type', () => { ml: mlMock, lists: listMock.createSetup(), mergeStrategy: 'missingFields', + ignoreFields: [], ruleDataService, }); @@ -244,7 +245,7 @@ describe('signal_rule_alert_type', () => { }, application: {}, }); - const newRuleAlert = getAlertMock(getQueryRuleParams()); + const newRuleAlert = getAlertMock(false, getQueryRuleParams()); newRuleAlert.params.index = ['some*', 'myfa*', 'anotherindex*']; payload = getPayload(newRuleAlert, alertServices) as jest.Mocked; @@ -273,7 +274,7 @@ describe('signal_rule_alert_type', () => { }, application: {}, }); - const newRuleAlert = getAlertMock(getQueryRuleParams()); + const newRuleAlert = getAlertMock(false, getQueryRuleParams()); newRuleAlert.params.index = ['some*', 'myfa*', 'anotherindex*']; payload = getPayload(newRuleAlert, alertServices) as jest.Mocked; @@ -308,7 +309,7 @@ describe('signal_rule_alert_type', () => { }); it('should call scheduleActions if signalsCount was greater than 0 and rule has actions defined', async () => { - const ruleAlert = getAlertMock(getQueryRuleParams()); + const ruleAlert = getAlertMock(false, getQueryRuleParams()); ruleAlert.actions = [ { actionTypeId: '.slack', @@ -332,7 +333,7 @@ describe('signal_rule_alert_type', () => { }); it('should resolve results_link when meta is an empty object to use "/app/security"', async () => { - const ruleAlert = getAlertMock(getQueryRuleParams()); + const ruleAlert = getAlertMock(false, getQueryRuleParams()); ruleAlert.params.meta = {}; ruleAlert.actions = [ { @@ -365,7 +366,7 @@ describe('signal_rule_alert_type', () => { }); it('should resolve results_link when meta is undefined use "/app/security"', async () => { - const ruleAlert = getAlertMock(getQueryRuleParams()); + const ruleAlert = getAlertMock(false, getQueryRuleParams()); delete ruleAlert.params.meta; ruleAlert.actions = [ { @@ -398,7 +399,7 @@ describe('signal_rule_alert_type', () => { }); it('should resolve results_link with a custom link', async () => { - const ruleAlert = getAlertMock(getQueryRuleParams()); + const ruleAlert = getAlertMock(false, getQueryRuleParams()); ruleAlert.params.meta = { kibana_siem_app_url: 'http://localhost' }; ruleAlert.actions = [ { @@ -432,7 +433,7 @@ describe('signal_rule_alert_type', () => { describe('ML rule', () => { it('should not call checkPrivileges if ML rule', async () => { - const ruleAlert = getAlertMock(getMlRuleParams()); + const ruleAlert = getAlertMock(false, getMlRuleParams()); alertServices.savedObjectsClient.get.mockResolvedValue({ id: 'id', type: 'type', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts index 1c4efea0a1d59..9a6c099ed1760 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/signal_rule_alert_type.ts @@ -29,7 +29,7 @@ import { } from '../../../../common/detection_engine/utils'; import { SetupPlugins } from '../../../plugin'; import { getInputIndex } from './get_input_output_index'; -import { AlertAttributes, SignalRuleAlertTypeDefinition } from './types'; +import { AlertAttributes, SignalRuleAlertTypeDefinition, ThresholdAlertState } from './types'; import { getListsClient, getExceptions, @@ -82,6 +82,7 @@ export const signalRulesAlertType = ({ ml, lists, mergeStrategy, + ignoreFields, ruleDataService, }: { logger: Logger; @@ -91,6 +92,7 @@ export const signalRulesAlertType = ({ ml: SetupPlugins['ml']; lists: SetupPlugins['lists'] | undefined; mergeStrategy: ConfigType['alertMergeStrategy']; + ignoreFields: ConfigType['alertIgnoreFields']; ruleDataService: IRuleDataPluginService; }): SignalRuleAlertTypeDefinition => { return { @@ -123,6 +125,7 @@ export const signalRulesAlertType = ({ async executor({ previousStartedAt, startedAt, + state, alertId, services, params, @@ -275,12 +278,14 @@ export const signalRulesAlertType = ({ ruleSO: savedObject, signalsIndex: params.outputIndex, mergeStrategy, + ignoreFields, }); const wrapSequences = wrapSequencesFactory({ ruleSO: savedObject, signalsIndex: params.outputIndex, mergeStrategy, + ignoreFields, }); if (isMlRule(type)) { @@ -312,6 +317,7 @@ export const signalRulesAlertType = ({ logger, buildRuleMessage, startedAt, + state: state as ThresholdAlertState, bulkCreate, wrapHits, }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/single_search_after.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/single_search_after.ts index ff49fb5892f50..7b30f70701e8c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/single_search_after.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/single_search_after.ts @@ -75,9 +75,11 @@ export const singleSearchAfter = async ({ searchAfterQuery as estypes.SearchRequest ); const end = performance.now(); + const searchErrors = createErrorsFromShard({ errors: nextSearchAfterResult._shards.failures ?? [], }); + return { searchResult: nextSearchAfterResult, searchDuration: makeFloatString(end - start), diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_all_fields_with_source.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_all_fields_with_source.test.ts index b900ea268fd6e..6af82d3a71028 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_all_fields_with_source.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_all_fields_with_source.test.ts @@ -44,7 +44,7 @@ describe('merge_all_fields_with_source', () => { test('when source is "undefined", merged doc is "undefined"', () => { const _source: SignalSourceHit['_source'] = {}; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -53,7 +53,7 @@ describe('merge_all_fields_with_source', () => { foo: [], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -62,7 +62,7 @@ describe('merge_all_fields_with_source', () => { foo: 'value', }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -71,7 +71,7 @@ describe('merge_all_fields_with_source', () => { foo: ['value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -80,7 +80,7 @@ describe('merge_all_fields_with_source', () => { foo: ['value_1', 'value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -89,7 +89,7 @@ describe('merge_all_fields_with_source', () => { foo: { bar: 'some value' }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -98,7 +98,7 @@ describe('merge_all_fields_with_source', () => { foo: [{ bar: 'some value' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -107,7 +107,7 @@ describe('merge_all_fields_with_source', () => { foo: [{ bar: 'some value' }, { foo: 'some other value' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -133,7 +133,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -142,7 +142,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': 'value', }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -151,7 +151,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -160,7 +160,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['value_1', 'value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -169,7 +169,7 @@ describe('merge_all_fields_with_source', () => { foo: { bar: 'some value' }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -178,7 +178,7 @@ describe('merge_all_fields_with_source', () => { foo: [{ bar: 'some value' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -187,7 +187,7 @@ describe('merge_all_fields_with_source', () => { foo: [{ bar: 'some value' }, { foo: 'some other value' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -217,7 +217,7 @@ describe('merge_all_fields_with_source', () => { foo: { bar: [] }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -226,7 +226,7 @@ describe('merge_all_fields_with_source', () => { foo: { bar: 'value' }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -235,7 +235,7 @@ describe('merge_all_fields_with_source', () => { foo: { bar: ['value'] }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -244,7 +244,7 @@ describe('merge_all_fields_with_source', () => { foo: { bar: ['value_1', 'value_2'] }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -253,7 +253,7 @@ describe('merge_all_fields_with_source', () => { foo: { bar: { mars: 'some value' } }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -262,7 +262,7 @@ describe('merge_all_fields_with_source', () => { foo: { bar: [{ mars: 'some value' }] }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -271,7 +271,7 @@ describe('merge_all_fields_with_source', () => { foo: { bar: [{ mars: 'some value' }, { mars: 'some other value' }] }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -299,7 +299,7 @@ describe('merge_all_fields_with_source', () => { 'bar.foo': [], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -308,7 +308,7 @@ describe('merge_all_fields_with_source', () => { 'bar.foo': 'value', }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -317,7 +317,7 @@ describe('merge_all_fields_with_source', () => { 'bar.foo': ['value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -326,7 +326,7 @@ describe('merge_all_fields_with_source', () => { 'bar.foo': ['value_1', 'value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -335,7 +335,7 @@ describe('merge_all_fields_with_source', () => { foo: { bar: 'some value' }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -344,7 +344,7 @@ describe('merge_all_fields_with_source', () => { foo: [{ bar: 'some value' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -353,7 +353,7 @@ describe('merge_all_fields_with_source', () => { foo: [{ bar: 'some value' }, { foo: 'some other value' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -376,7 +376,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: 'other_value_1', @@ -389,7 +389,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: ['other_value_1', 'other_value_2'], @@ -402,7 +402,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: { zed: 'other_value_1' } }, }); @@ -413,7 +413,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: [{ zed: 'other_value_1' }, { zed: 'other_value_2' }] }, }); @@ -440,7 +440,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: 'other_value_1', @@ -453,7 +453,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: ['other_value_1', 'other_value_2'] }, }); @@ -464,7 +464,7 @@ describe('merge_all_fields_with_source', () => { foo: [{ bar: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: 'other_value_1', @@ -477,7 +477,7 @@ describe('merge_all_fields_with_source', () => { foo: [{ bar: 'other_value_1' }, { bar: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: [{ bar: 'other_value_1' }, { bar: 'other_value_2' }], }); @@ -503,7 +503,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ 'foo.bar': 'other_value_1', }); @@ -514,7 +514,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); @@ -523,7 +523,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ 'foo.bar': { zed: 'other_value_1' }, }); @@ -534,7 +534,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); }); @@ -560,7 +560,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: ['other_value_1'] }, }); @@ -571,7 +571,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: ['other_value_1', 'other_value_2'] }, }); @@ -582,7 +582,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: [{ zed: 'other_value_1' }] }, }); @@ -593,7 +593,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: [{ zed: 'other_value_1' }, { zed: 'other_value_2' }] }, }); @@ -619,7 +619,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); @@ -628,7 +628,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); @@ -637,7 +637,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); @@ -646,7 +646,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); }); @@ -670,7 +670,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: ['other_value_1'] }, }); @@ -681,7 +681,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: ['other_value_1', 'other_value_2'] }, }); @@ -692,7 +692,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: [{ zed: 'other_value_1' }] }, }); @@ -703,7 +703,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: [{ zed: 'other_value_1' }, { zed: 'other_value_2' }] }, }); @@ -729,7 +729,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); @@ -738,7 +738,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); @@ -747,7 +747,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); @@ -756,7 +756,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); }); @@ -782,7 +782,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: ['other_value_1'], @@ -795,7 +795,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: ['other_value_1', 'other_value_2'], @@ -808,7 +808,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: [{ zed: 'other_value_1' }], @@ -821,7 +821,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], @@ -849,7 +849,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); @@ -858,7 +858,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); @@ -867,7 +867,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); @@ -876,7 +876,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); }); @@ -902,7 +902,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -911,7 +911,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -920,7 +920,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: { zed: 'other_value_1' } }, }); @@ -931,7 +931,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: [{ zed: 'other_value_1' }, { zed: 'other_value_2' }] }, }); @@ -957,7 +957,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -966,7 +966,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -975,7 +975,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ mars: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ 'foo.bar': { mars: 'other_value_1' }, }); @@ -986,7 +986,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ mars: 'other_value_1' }, { mars: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ 'foo.bar': [{ mars: 'other_value_1' }, { mars: 'other_value_2' }], }); @@ -1014,7 +1014,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1023,7 +1023,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1032,7 +1032,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: [{ zed: 'other_value_1' }] }, }); @@ -1043,7 +1043,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: [{ zed: 'other_value_1' }, { zed: 'other_value_2' }] }, }); @@ -1069,7 +1069,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1078,7 +1078,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1087,7 +1087,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: [{ zed: 'other_value_1' }] }, }); @@ -1098,7 +1098,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: [{ zed: 'other_value_1' }, { zed: 'other_value_2' }] }, }); @@ -1124,7 +1124,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1133,7 +1133,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1142,7 +1142,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ mars: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); @@ -1151,7 +1151,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ mars: 'other_value_1' }, { mars: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); }); @@ -1175,7 +1175,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1184,7 +1184,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1193,7 +1193,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ mars: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); @@ -1202,7 +1202,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': [{ mars: 'other_value_1' }, { mars: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(fields); }); }); @@ -1228,7 +1228,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: 'value_1' }, 'foo.bar': 'other_value_1', @@ -1243,7 +1243,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['value_1', 'value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: 'value_1' }, // <--- We have duplicated value_1 twice which is a bug 'foo.bar': ['value_1', 'value_2'], // <-- We have merged the array value because we do not understand if we should or not @@ -1270,7 +1270,7 @@ describe('merge_all_fields_with_source', () => { 'bar.keyword': ['bar_other_value_keyword_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: 'foo_other_value_1', bar: 'bar_other_value_1', @@ -1291,7 +1291,7 @@ describe('merge_all_fields_with_source', () => { 'host.hostname.keyword': ['hostname_other_value_keyword_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ host: { hostname: 'hostname_other_value_1', @@ -1316,7 +1316,7 @@ describe('merge_all_fields_with_source', () => { 'foo.host.hostname.keyword': ['hostname_other_value_keyword_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { host: { @@ -1334,7 +1334,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar': ['other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: 'other_value_1', }); @@ -1354,7 +1354,7 @@ describe('merge_all_fields_with_source', () => { 'host.hostname.keyword': ['hostname_other_value_keyword_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ 'host.name': 'host_name_other_value_1', 'host.hostname': 'hostname_other_value_1', @@ -1373,7 +1373,7 @@ describe('merge_all_fields_with_source', () => { 'foo.host.hostname.keyword': ['hostname_other_value_keyword_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ 'foo.host.name': 'host_name_other_value_1', 'foo.host.hostname': 'hostname_other_value_1', @@ -1388,7 +1388,7 @@ describe('merge_all_fields_with_source', () => { 'foo.bar.zed': ['zed_other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: 'other_value_1', }); @@ -1415,7 +1415,7 @@ describe('merge_all_fields_with_source', () => { 'foo.mars': ['other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1435,7 +1435,7 @@ describe('merge_all_fields_with_source', () => { 'foo.zed.mars': ['other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -1450,7 +1450,7 @@ describe('merge_all_fields_with_source', () => { foo: [{ bar: ['single_value'], zed: ['single_value'] }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: 'single_value', zed: 'single_value' }, }); @@ -1469,10 +1469,132 @@ describe('merge_all_fields_with_source', () => { foo: [{ bar: ['single_value'], zed: ['single_value'] }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeAllFieldsWithSource({ doc })._source; + const merged = mergeAllFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: [{ bar: ['single_value'], zed: ['single_value'] }], }); }); }); + + /** + * Small set of tests to ensure that ignore fields are wired up at the strategy level + */ + describe('ignore fields', () => { + test('Does not merge an ignored field if it does not exist already in the _source', () => { + const _source: SignalSourceHit['_source'] = {}; + const fields: SignalSourceHit['fields'] = { + 'foo.bar': ['other_value_1'], + 'value.should.ignore': ['other_value_2'], // string value should ignore this + '_odd.value': ['other_value_2'], // Regex should ignore this value of: /[_]+/ + }; + const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; + const merged = mergeAllFieldsWithSource({ + doc, + ignoreFields: ['value.should.ignore', '/[_]+/'], + })._source; + expect(merged).toEqual({ + foo: { + bar: 'other_value_1', + }, + }); + }); + + test('Does merge fields when no matching happens', () => { + const _source: SignalSourceHit['_source'] = {}; + const fields: SignalSourceHit['fields'] = { + 'foo.bar': ['other_value_1'], + 'value.should.work': ['other_value_2'], + '_odd.value': ['other_value_2'], + }; + const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; + const merged = mergeAllFieldsWithSource({ + doc, + ignoreFields: ['other.string', '/[z]+/'], // Neither of these two should match anything + })._source; + expect(merged).toEqual({ + foo: { + bar: 'other_value_1', + }, + _odd: { + value: 'other_value_2', + }, + value: { + should: { + work: 'other_value_2', + }, + }, + }); + }); + + test('Does not update an ignored field and keeps the original value if it matches in the ignoreFields', () => { + const _source: SignalSourceHit['_source'] = { + 'value.should.ignore': ['value_1'], + '_odd.value': ['value_2'], + }; + const fields: SignalSourceHit['fields'] = { + 'foo.bar': ['other_value_1'], + 'value.should.ignore': ['other_value_2'], // string value should ignore this + '_odd.value': ['other_value_2'], // Regex should ignore this value of: /[_]+/ + }; + const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; + const merged = mergeAllFieldsWithSource({ + doc, + ignoreFields: ['value.should.ignore', '/[_]+/'], + })._source; + expect(merged).toEqual({ + foo: { + bar: 'other_value_1', + }, + 'value.should.ignore': ['value_1'], + '_odd.value': ['value_2'], + }); + }); + + test('Does not ignore anything when no matching happens and overwrites the expected fields', () => { + const _source: SignalSourceHit['_source'] = { + 'value.should.ignore': ['value_1'], + '_odd.value': ['value_2'], + }; + const fields: SignalSourceHit['fields'] = { + 'foo.bar': ['other_value_1'], + 'value.should.ignore': ['other_value_2'], + '_odd.value': ['other_value_2'], + }; + const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; + const merged = mergeAllFieldsWithSource({ + doc, + ignoreFields: ['nothing.to.match', '/[z]+/'], // these match nothing + })._source; + expect(merged).toEqual({ + foo: { + bar: 'other_value_1', + }, + 'value.should.ignore': ['other_value_2'], + '_odd.value': ['other_value_2'], + }); + }); + }); + + /** + * Test that the EQL bug workaround is wired up. Remove this once the bug is fixed. + */ + describe('Works around EQL bug 77152 (https://github.com/elastic/elasticsearch/issues/77152)', () => { + test('Does not merge field that contains _ignored', () => { + const _source: SignalSourceHit['_source'] = {}; + const fields: SignalSourceHit['fields'] = { + 'foo.bar': ['other_value_1'], + _ignored: ['other_value_1'], + }; + const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; + const merged = mergeAllFieldsWithSource({ + doc, + ignoreFields: [], + })._source; + expect(merged).toEqual({ + foo: { + bar: 'other_value_1', + }, + }); + }); + }); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_all_fields_with_source.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_all_fields_with_source.ts index da2eea9d2c61e..ade83b88d526b 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_all_fields_with_source.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_all_fields_with_source.ts @@ -23,14 +23,16 @@ import { isTypeObject } from '../utils/is_type_object'; * on this function and the general strategies. * * @param doc The document with "_source" and "fields" - * @param throwOnFailSafe Defaults to false, but if set to true it will cause a throw if the fail safe is triggered to indicate we need to add a new explicit test condition + * @param ignoreFields Any fields that we should ignore and never merge from "fields". If the value exists + * within doc._source it will be untouched and used. If the value does not exist within the doc._source, + * it will not be added from fields. * @returns The two merged together in one object where we can */ -export const mergeAllFieldsWithSource: MergeStrategyFunction = ({ doc }) => { +export const mergeAllFieldsWithSource: MergeStrategyFunction = ({ doc, ignoreFields }) => { const source = doc._source ?? {}; const fields = doc.fields ?? {}; const fieldEntries = Object.entries(fields); - const filteredEntries = filterFieldEntries(fieldEntries); + const filteredEntries = filterFieldEntries(fieldEntries, ignoreFields); const transformedSource = filteredEntries.reduce( (merged, [fieldsKey, fieldsValue]: [string, FieldsType]) => { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_missing_fields_with_source.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_missing_fields_with_source.test.ts index 70d1e79580e84..612bff75792da 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_missing_fields_with_source.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_missing_fields_with_source.test.ts @@ -44,7 +44,7 @@ describe('merge_missing_fields_with_source', () => { test('when source is "undefined", merged doc is "undefined"', () => { const _source: SignalSourceHit['_source'] = {}; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -53,7 +53,7 @@ describe('merge_missing_fields_with_source', () => { foo: [], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -62,7 +62,7 @@ describe('merge_missing_fields_with_source', () => { foo: 'value', }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -71,7 +71,7 @@ describe('merge_missing_fields_with_source', () => { foo: ['value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -80,7 +80,7 @@ describe('merge_missing_fields_with_source', () => { foo: ['value_1', 'value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -89,7 +89,7 @@ describe('merge_missing_fields_with_source', () => { foo: { bar: 'some value' }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -98,7 +98,7 @@ describe('merge_missing_fields_with_source', () => { foo: [{ bar: 'some value' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -107,7 +107,7 @@ describe('merge_missing_fields_with_source', () => { foo: [{ bar: 'some value' }, { foo: 'some other value' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -133,7 +133,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -142,7 +142,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': 'value', }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -151,7 +151,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -160,7 +160,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['value_1', 'value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -169,7 +169,7 @@ describe('merge_missing_fields_with_source', () => { foo: { bar: 'some value' }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -178,7 +178,7 @@ describe('merge_missing_fields_with_source', () => { foo: [{ bar: 'some value' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -187,7 +187,7 @@ describe('merge_missing_fields_with_source', () => { foo: [{ bar: 'some value' }, { foo: 'some other value' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -217,7 +217,7 @@ describe('merge_missing_fields_with_source', () => { foo: { bar: [] }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -226,7 +226,7 @@ describe('merge_missing_fields_with_source', () => { foo: { bar: 'value' }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -235,7 +235,7 @@ describe('merge_missing_fields_with_source', () => { foo: { bar: ['value'] }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -244,7 +244,7 @@ describe('merge_missing_fields_with_source', () => { foo: { bar: ['value_1', 'value_2'] }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -253,7 +253,7 @@ describe('merge_missing_fields_with_source', () => { foo: { bar: { mars: 'some value' } }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -262,7 +262,7 @@ describe('merge_missing_fields_with_source', () => { foo: { bar: [{ mars: 'some value' }] }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -271,7 +271,7 @@ describe('merge_missing_fields_with_source', () => { foo: { bar: [{ mars: 'some value' }, { mars: 'some other value' }] }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -299,7 +299,7 @@ describe('merge_missing_fields_with_source', () => { 'bar.foo': [], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -308,7 +308,7 @@ describe('merge_missing_fields_with_source', () => { 'bar.foo': 'value', }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -317,7 +317,7 @@ describe('merge_missing_fields_with_source', () => { 'bar.foo': ['value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -326,7 +326,7 @@ describe('merge_missing_fields_with_source', () => { 'bar.foo': ['value_1', 'value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -335,7 +335,7 @@ describe('merge_missing_fields_with_source', () => { foo: { bar: 'some value' }, }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -344,7 +344,7 @@ describe('merge_missing_fields_with_source', () => { foo: [{ bar: 'some value' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -353,7 +353,7 @@ describe('merge_missing_fields_with_source', () => { foo: [{ bar: 'some value' }, { foo: 'some other value' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -376,7 +376,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: 'other_value_1', @@ -389,7 +389,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: { bar: ['other_value_1', 'other_value_2'], @@ -402,7 +402,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({}); }); @@ -411,7 +411,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({}); }); }); @@ -436,7 +436,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -445,7 +445,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -454,7 +454,7 @@ describe('merge_missing_fields_with_source', () => { foo: [{ bar: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -463,7 +463,7 @@ describe('merge_missing_fields_with_source', () => { foo: [{ bar: 'other_value_1' }, { bar: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -487,7 +487,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -496,7 +496,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -505,7 +505,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -514,7 +514,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -540,7 +540,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -549,7 +549,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -558,7 +558,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -567,7 +567,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -591,7 +591,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -600,7 +600,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -609,7 +609,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -618,7 +618,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -642,7 +642,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -651,7 +651,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -660,7 +660,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -669,7 +669,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -693,7 +693,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -702,7 +702,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -711,7 +711,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -720,7 +720,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -746,7 +746,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -755,7 +755,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -764,7 +764,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -773,7 +773,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -797,7 +797,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -806,7 +806,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -815,7 +815,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -824,7 +824,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -850,7 +850,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -859,7 +859,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -868,7 +868,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -877,7 +877,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -901,7 +901,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -910,7 +910,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -919,7 +919,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ mars: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -928,7 +928,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ mars: 'other_value_1' }, { mars: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -954,7 +954,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -963,7 +963,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -972,7 +972,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -981,7 +981,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -1005,7 +1005,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1014,7 +1014,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1023,7 +1023,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1032,7 +1032,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ zed: 'other_value_1' }, { zed: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -1056,7 +1056,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1065,7 +1065,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1074,7 +1074,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ mars: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1083,7 +1083,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ mars: 'other_value_1' }, { mars: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -1107,7 +1107,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1116,7 +1116,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1', 'other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1125,7 +1125,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ mars: 'other_value_1' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1134,7 +1134,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': [{ mars: 'other_value_1' }, { mars: 'other_value_2' }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -1160,7 +1160,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1172,7 +1172,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['value_1', 'value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -1196,7 +1196,7 @@ describe('merge_missing_fields_with_source', () => { 'bar.keyword': ['bar_other_value_keyword_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1214,7 +1214,7 @@ describe('merge_missing_fields_with_source', () => { 'host.hostname.keyword': ['hostname_other_value_keyword_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1234,7 +1234,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.host.hostname.keyword': ['hostname_other_value_keyword_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1245,7 +1245,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar': ['other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: 'other_value_1', }); @@ -1265,7 +1265,7 @@ describe('merge_missing_fields_with_source', () => { 'host.hostname.keyword': ['hostname_other_value_keyword_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1281,7 +1281,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.host.hostname.keyword': ['hostname_other_value_keyword_1'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1293,7 +1293,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.bar.zed': ['zed_other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({ foo: 'other_value_1', }); @@ -1320,7 +1320,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.mars': ['other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); @@ -1340,7 +1340,7 @@ describe('merge_missing_fields_with_source', () => { 'foo.zed.mars': ['other_value_2'], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); @@ -1355,7 +1355,7 @@ describe('merge_missing_fields_with_source', () => { foo: [{ bar: ['single_value'], zed: ['single_value'] }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual({}); }); @@ -1372,8 +1372,82 @@ describe('merge_missing_fields_with_source', () => { foo: [{ bar: ['single_value'], zed: ['single_value'] }], }; const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; - const merged = mergeMissingFieldsWithSource({ doc })._source; + const merged = mergeMissingFieldsWithSource({ doc, ignoreFields: [] })._source; expect(merged).toEqual(_source); }); }); + + /** + * Small set of tests to ensure that ignore fields are wired up at the strategy level + */ + describe('ignore fields', () => { + test('Does not merge an ignored field if it does not exist already in the _source', () => { + const _source: SignalSourceHit['_source'] = {}; + const fields: SignalSourceHit['fields'] = { + 'foo.bar': ['other_value_1'], + 'value.should.ignore': ['other_value_2'], // string value should ignore this + '_odd.value': ['other_value_2'], // Regex should ignore this value of: /[_]+/ + }; + const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; + const merged = mergeMissingFieldsWithSource({ + doc, + ignoreFields: ['value.should.ignore', '/[_]+/'], + })._source; + expect(merged).toEqual({ + foo: { + bar: 'other_value_1', + }, + }); + }); + + test('Does merge fields when no matching happens', () => { + const _source: SignalSourceHit['_source'] = {}; + const fields: SignalSourceHit['fields'] = { + 'foo.bar': ['other_value_1'], + 'value.should.work': ['other_value_2'], + '_odd.value': ['other_value_2'], + }; + const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; + const merged = mergeMissingFieldsWithSource({ + doc, + ignoreFields: ['other.string', '/[z]+/'], // Neither of these two should match anything + })._source; + expect(merged).toEqual({ + foo: { + bar: 'other_value_1', + }, + _odd: { + value: 'other_value_2', + }, + value: { + should: { + work: 'other_value_2', + }, + }, + }); + }); + }); + + /** + * Test that the EQL bug workaround is wired up. Remove this once the bug is fixed. + */ + describe('Works around EQL bug 77152 (https://github.com/elastic/elasticsearch/issues/77152)', () => { + test('Does not merge field that contains _ignored', () => { + const _source: SignalSourceHit['_source'] = {}; + const fields: SignalSourceHit['fields'] = { + 'foo.bar': ['other_value_1'], + _ignored: ['other_value_1'], + }; + const doc: SignalSourceHit = { ...emptyEsResult(), _source, fields }; + const merged = mergeMissingFieldsWithSource({ + doc, + ignoreFields: [], + })._source; + expect(merged).toEqual({ + foo: { + bar: 'other_value_1', + }, + }); + }); + }); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_missing_fields_with_source.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_missing_fields_with_source.ts index b66c46ccbf0ca..611a3ad879705 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_missing_fields_with_source.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_missing_fields_with_source.ts @@ -19,14 +19,16 @@ import { isNestedObject } from '../utils/is_nested_object'; * Merges only missing sections of "doc._source" with its "doc.fields" on a "best effort" basis. See ../README.md for more information * on this function and the general strategies. * @param doc The document with "_source" and "fields" - * @param throwOnFailSafe Defaults to false, but if set to true it will cause a throw if the fail safe is triggered to indicate we need to add a new explicit test condition + * @param ignoreFields Any fields that we should ignore and never merge from "fields". If the value exists + * within doc._source it will be untouched and used. If the value does not exist within the doc._source, + * it will not be added from fields. * @returns The two merged together in one object where we can */ -export const mergeMissingFieldsWithSource: MergeStrategyFunction = ({ doc }) => { +export const mergeMissingFieldsWithSource: MergeStrategyFunction = ({ doc, ignoreFields }) => { const source = doc._source ?? {}; const fields = doc.fields ?? {}; const fieldEntries = Object.entries(fields); - const filteredEntries = filterFieldEntries(fieldEntries); + const filteredEntries = filterFieldEntries(fieldEntries, ignoreFields); const transformedSource = filteredEntries.reduce( (merged, [fieldsKey, fieldsValue]: [string, FieldsType]) => { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_no_fields.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_no_fields.ts index 6c2daf2526715..5e26b619fbdfa 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_no_fields.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_no_fields.ts @@ -10,6 +10,7 @@ import { MergeStrategyFunction } from '../types'; /** * Does nothing and does not merge source with fields * @param doc The doc to return and do nothing + * @param ignoreFields We do nothing with this value and ignore it if set * @returns The doc as a no operation and do nothing */ -export const mergeNoFields: MergeStrategyFunction = ({ doc }) => doc; +export const mergeNoFields: MergeStrategyFunction = ({ doc, ignoreFields }) => doc; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/types.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/types.ts index 1438d2844949c..0b847064d5d62 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/types.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/types.ts @@ -14,5 +14,13 @@ export type FieldsType = string[] | number[] | boolean[] | object[]; /** * The type of the merge strategy functions which must implement to be part of the strategy group + * @param doc The document to send in to merge + * @param ignoreFields Fields you want to ignore and not merge. */ -export type MergeStrategyFunction = ({ doc }: { doc: SignalSourceHit }) => SignalSourceHit; +export type MergeStrategyFunction = ({ + doc, + ignoreFields, +}: { + doc: SignalSourceHit; + ignoreFields: string[]; +}) => SignalSourceHit; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/filter_field_entries.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/filter_field_entries.test.ts index 9cc2478290885..031a2013b462e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/filter_field_entries.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/filter_field_entries.test.ts @@ -27,7 +27,9 @@ describe('filter_field_entries', () => { test('returns a single valid fieldEntries as expected', () => { const fieldEntries: Array<[string, FieldsType]> = [['foo.bar', dummyValue]]; - expect(filterFieldEntries(fieldEntries)).toEqual(fieldEntries); + expect(filterFieldEntries(fieldEntries, [])).toEqual( + fieldEntries + ); }); test('removes invalid dotted entries', () => { @@ -37,7 +39,7 @@ describe('filter_field_entries', () => { ['..', dummyValue], ['foo..bar', dummyValue], ]; - expect(filterFieldEntries(fieldEntries)).toEqual([ + expect(filterFieldEntries(fieldEntries, [])).toEqual([ ['foo.bar', dummyValue], ]); }); @@ -49,7 +51,7 @@ describe('filter_field_entries', () => { ['bar.keyword', dummyValue], // <-- "bar.keyword" multi-field should be removed ['bar', dummyValue], ]; - expect(filterFieldEntries(fieldEntries)).toEqual([ + expect(filterFieldEntries(fieldEntries, [])).toEqual([ ['foo', dummyValue], ['bar', dummyValue], ]); @@ -62,7 +64,7 @@ describe('filter_field_entries', () => { ['host.hostname', dummyValue], ['host.hostname.keyword', dummyValue], // <-- multi-field should be removed ]; - expect(filterFieldEntries(fieldEntries)).toEqual([ + expect(filterFieldEntries(fieldEntries, [])).toEqual([ ['host.name', dummyValue], ['host.hostname', dummyValue], ]); @@ -75,9 +77,34 @@ describe('filter_field_entries', () => { ['foo.host.hostname', dummyValue], ['foo.host.hostname.keyword', dummyValue], // <-- multi-field should be removed ]; - expect(filterFieldEntries(fieldEntries)).toEqual([ + expect(filterFieldEntries(fieldEntries, [])).toEqual([ ['foo.host.name', dummyValue], ['foo.host.hostname', dummyValue], ]); }); + + test('ignores fields of "_ignore", for eql bug https://github.com/elastic/elasticsearch/issues/77152', () => { + const fieldEntries: Array<[string, FieldsType]> = [ + ['_ignored', dummyValue], + ['foo.host.hostname', dummyValue], + ]; + expect(filterFieldEntries(fieldEntries, [])).toEqual([ + ['foo.host.hostname', dummyValue], + ]); + }); + + test('ignores fields given strings and regular expressions in the ignoreFields list', () => { + const fieldEntries: Array<[string, FieldsType]> = [ + ['host.name', dummyValue], + ['user.name', dummyValue], // <-- string from ignoreFields should ignore this + ['host.hostname', dummyValue], + ['_odd.value', dummyValue], // <-- regular expression from ignoreFields should ignore this + ]; + expect( + filterFieldEntries(fieldEntries, ['user.name', '/[_]+/']) + ).toEqual([ + ['host.name', dummyValue], + ['host.hostname', dummyValue], + ]); + }); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/filter_field_entries.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/filter_field_entries.ts index 221cdabc62847..4ee5fa1db52f5 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/filter_field_entries.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/filter_field_entries.ts @@ -9,6 +9,8 @@ import { isMultiField } from './is_multifield'; import { isInvalidKey } from './is_invalid_key'; import { isTypeObject } from './is_type_object'; import { FieldsType } from '../types'; +import { isIgnored } from './is_ignored'; +import { isEqlBug77152 } from './is_eql_bug_77152'; /** * Filters field entries by removing invalid field entries such as any invalid characters @@ -17,13 +19,18 @@ import { FieldsType } from '../types'; * those and don't try to merge those. * * @param fieldEntries The field entries to filter + * @param ignoreFields Array of fields to ignore. If a value starts and ends with "/", such as: "/[_]+/" then the field will be treated as a regular expression. + * If you have an object structure to ignore such as "{ a: { b: c: {} } } ", then you need to ignore it as the string "a.b.c" * @returns The field entries filtered */ export const filterFieldEntries = ( - fieldEntries: Array<[string, FieldsType]> + fieldEntries: Array<[string, FieldsType]>, + ignoreFields: string[] ): Array<[string, FieldsType]> => { return fieldEntries.filter(([fieldsKey, fieldsValue]: [string, FieldsType]) => { return ( + !isEqlBug77152(fieldsKey) && + !isIgnored(fieldsKey, ignoreFields) && !isInvalidKey(fieldsKey) && !isMultiField(fieldsKey, fieldEntries) && !isTypeObject(fieldsValue) // TODO: Look at not filtering this and instead transform it so it can be inserted correctly in the strategies which does an overwrite of everything from fields diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/index.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/index.ts index baf9efca511e2..87b1097dd9bca 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/index.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/index.ts @@ -7,6 +7,7 @@ export * from './array_in_path_exists'; export * from './filter_field_entries'; export * from './is_array_of_primitives'; +export * from './is_ignored'; export * from './is_invalid_key'; export * from './is_multifield'; export * from './is_nested_object'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/is_eql_bug_77152.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/is_eql_bug_77152.test.ts new file mode 100644 index 0000000000000..47a56e096649b --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/is_eql_bug_77152.test.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 { isEqlBug77152 } from './is_eql_bug_77152'; + +/** + * @deprecated Remove this test once https://github.com/elastic/elasticsearch/issues/77152 is fixed. + */ +describe('is_eql_bug_77152', () => { + beforeAll(() => { + jest.resetAllMocks(); + }); + + afterEach(() => { + jest.resetAllMocks(); + }); + + it('returns true if it encounters the bug which is _ignored is returned in the fields', () => { + expect(isEqlBug77152('_ignored')).toEqual(true); + }); + + it('returns false if it encounters a normal field', () => { + expect(isEqlBug77152('some.field')).toEqual(false); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/is_eql_bug_77152.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/is_eql_bug_77152.ts new file mode 100644 index 0000000000000..e9a642cd5c382 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/is_eql_bug_77152.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. + */ + +/** + * Ignores any field that is "_ignored". Customers are not allowed to have this field and more importantly this shows up as a bug + * from EQL as seen here: https://github.com/elastic/elasticsearch/issues/77152 + * Once this ticket is fixed, please remove this function. + * @param fieldsKey The fields key to match against "_ignored" + * @returns true if it is a "_ignored", otherwise false + * @deprecated Remove this once https://github.com/elastic/elasticsearch/issues/77152 is fixed. + */ +export const isEqlBug77152 = (fieldsKey: string): boolean => { + return fieldsKey === '_ignored'; +}; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/is_ignored.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/is_ignored.test.ts new file mode 100644 index 0000000000000..e4a7093ef127c --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/is_ignored.test.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 { isIgnored } from './is_ignored'; + +describe('is_ignored', () => { + beforeAll(() => { + jest.resetAllMocks(); + }); + + afterEach(() => { + jest.resetAllMocks(); + }); + + describe('string matching', () => { + test('it returns false if given an empty array', () => { + expect(isIgnored('simple.value', [])).toEqual(false); + }); + + test('it returns true if a simple string value matches', () => { + expect(isIgnored('simple.value', ['simple.value'])).toEqual(true); + }); + + test('it returns false if a simple string value does not match', () => { + expect(isIgnored('simple', ['simple.value'])).toEqual(false); + }); + + test('it returns true if a simple string value matches with two strings', () => { + expect(isIgnored('simple.value', ['simple.value', 'simple.second.value'])).toEqual(true); + }); + + test('it returns true if a simple string value matches the second string', () => { + expect(isIgnored('simple.second.value', ['simple.value', 'simple.second.value'])).toEqual( + true + ); + }); + + test('it returns false if a simple string value does not match two strings', () => { + expect(isIgnored('simple', ['simple.value', 'simple.second.value'])).toEqual(false); + }); + + test('it returns true if mixed with a regular expression in the list', () => { + expect(isIgnored('simple', ['simple', '/[_]+/'])).toEqual(true); + }); + }); + + describe('regular expression matching', () => { + test('it returns true if a simple regular expression matches', () => { + expect(isIgnored('_ignored', ['/[_]+/'])).toEqual(true); + }); + + test('it returns false if a simple regular expression does not match', () => { + expect(isIgnored('simple', ['/[_]+/'])).toEqual(false); + }); + + test('it returns true if a simple regular expression matches a longer string', () => { + expect(isIgnored('___ignored', ['/[_]+/'])).toEqual(true); + }); + + test('it returns true if mixed with regular stings', () => { + expect(isIgnored('___ignored', ['simple', '/[_]+/'])).toEqual(true); + }); + + test('it returns true with start anchor', () => { + expect(isIgnored('_ignored', ['simple', '/^[_]+/'])).toEqual(true); + }); + + test('it returns false with start anchor', () => { + expect(isIgnored('simple.something_', ['simple', '/^[_]+/'])).toEqual(false); + }); + + test('it returns true with end anchor', () => { + expect(isIgnored('something_', ['simple', '/[_]+$/'])).toEqual(true); + }); + + test('it returns false with end anchor', () => { + expect(isIgnored('_something', ['simple', '/[_]+$/'])).toEqual(false); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/is_ignored.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/is_ignored.ts new file mode 100644 index 0000000000000..a418ce735626d --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/is_ignored.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. + */ + +/** + * Matches against anything you want to ignore and if it matches that field is ignored. + * @param fieldsKey The fields key to match against + * @param ignoreFields Array of fields to ignore. If a value starts and ends with "/", such as: "/[_]+/" then the field will be treated as a regular expression. + * If you have an object structure to ignore such as "{ a: { b: c: {} } } ", then you need to ignore it as the string "a.b.c" + * @returns true if it is a field to ignore, otherwise false + */ +export const isIgnored = (fieldsKey: string, ignoreFields: string[]): boolean => { + return ignoreFields.some((ignoreField) => { + if (ignoreField.startsWith('/') && ignoreField.endsWith('/')) { + return new RegExp(ignoreField.slice(1, -1)).test(fieldsKey); + } else { + return fieldsKey === ignoreField; + } + }); +}; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/build_signal_history.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/build_signal_history.test.ts new file mode 100644 index 0000000000000..8362942af15b9 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/build_signal_history.test.ts @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ALERT_ORIGINAL_TIME } from '../../rule_types/field_maps/field_names'; +import { sampleThresholdAlert } from '../../rule_types/__mocks__/threshold'; +import { buildThresholdSignalHistory } from './build_signal_history'; + +describe('buildSignalHistory', () => { + it('builds a signal history from an alert', () => { + const signalHistory = buildThresholdSignalHistory({ alerts: [sampleThresholdAlert] }); + expect(signalHistory).toEqual({ + '7a75c5c2db61f57ec166c669cb8244b91f812f0b2f1d4f8afd528d4f8b4e199b': { + lastSignalTimestamp: Date.parse( + sampleThresholdAlert._source[ALERT_ORIGINAL_TIME] as string + ), + terms: [ + { + field: 'host.name', + value: 'garden-gnomes', + }, + { + field: 'source.ip', + value: '127.0.0.1', + }, + ], + }, + }); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/build_signal_history.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/build_signal_history.ts new file mode 100644 index 0000000000000..81b12d2d4f229 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/build_signal_history.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 { SearchHit } from '@elastic/elasticsearch/api/types'; +import { + ALERT_ORIGINAL_TIME, + ALERT_RULE_THRESHOLD_FIELD, +} from '../../rule_types/field_maps/field_names'; + +import { SimpleHit, ThresholdSignalHistory } from '../types'; +import { getThresholdTermsHash, isWrappedRACAlert, isWrappedSignalHit } from '../utils'; + +interface GetThresholdSignalHistoryParams { + alerts: Array>; +} + +const getTerms = (alert: SimpleHit) => { + if (isWrappedRACAlert(alert)) { + return (alert._source[ALERT_RULE_THRESHOLD_FIELD] as string[]).map((field) => ({ + field, + value: alert._source[field] as string, + })); + } else if (isWrappedSignalHit(alert)) { + return alert._source.signal?.threshold_result?.terms ?? []; + } else { + // We shouldn't be here + return []; + } +}; + +const getOriginalTime = (alert: SimpleHit) => { + if (isWrappedRACAlert(alert)) { + const originalTime = alert._source[ALERT_ORIGINAL_TIME]; + return originalTime != null ? new Date(originalTime as string).getTime() : undefined; + } else if (isWrappedSignalHit(alert)) { + const originalTime = alert._source.signal?.original_time; + return originalTime != null ? new Date(originalTime).getTime() : undefined; + } else { + // We shouldn't be here + return undefined; + } +}; + +export const buildThresholdSignalHistory = ({ + alerts, +}: GetThresholdSignalHistoryParams): ThresholdSignalHistory => { + const signalHistory = alerts.reduce((acc, alert) => { + if (!alert._source) { + return acc; + } + + const terms = getTerms(alert as SimpleHit); + const hash = getThresholdTermsHash(terms); + const existing = acc[hash]; + const originalTime = getOriginalTime(alert as SimpleHit); + + if (existing != null) { + if (originalTime && originalTime > existing.lastSignalTimestamp) { + acc[hash].lastSignalTimestamp = originalTime; + } + } else if (originalTime) { + acc[hash] = { + terms, + lastSignalTimestamp: originalTime, + }; + } + return acc; + }, {}); + + return signalHistory; +}; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/bulk_create_threshold_signals.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/bulk_create_threshold_signals.ts index afb0353c4ba03..ce8ee4542d603 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/bulk_create_threshold_signals.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/bulk_create_threshold_signals.ts @@ -46,7 +46,7 @@ interface BulkCreateThresholdSignalsParams { signalsIndex: string; startedAt: Date; from: Date; - thresholdSignalHistory: ThresholdSignalHistory; + signalHistory: ThresholdSignalHistory; bulkCreate: BulkCreate; wrapHits: WrapHits; } @@ -61,7 +61,7 @@ const getTransformedHits = ( ruleId: string, filter: unknown, timestampOverride: TimestampOverrideOrUndefined, - thresholdSignalHistory: ThresholdSignalHistory + signalHistory: ThresholdSignalHistory ) => { const aggParts = threshold.field.length ? results.aggregations && getThresholdAggregationParts(results.aggregations) @@ -148,7 +148,7 @@ const getTransformedHits = ( } const termsHash = getThresholdTermsHash(bucket.terms); - const signalHit = thresholdSignalHistory[termsHash]; + const signalHit = signalHistory[termsHash]; const source = { '@timestamp': timestamp, @@ -202,7 +202,7 @@ export const transformThresholdResultsToEcs = ( threshold: ThresholdNormalized, ruleId: string, timestampOverride: TimestampOverrideOrUndefined, - thresholdSignalHistory: ThresholdSignalHistory + signalHistory: ThresholdSignalHistory ): SignalSearchResponse => { const transformedHits = getTransformedHits( results, @@ -214,7 +214,7 @@ export const transformThresholdResultsToEcs = ( ruleId, filter, timestampOverride, - thresholdSignalHistory + signalHistory ); const thresholdResults = { ...results, @@ -246,7 +246,7 @@ export const bulkCreateThresholdSignals = async ( ruleParams.threshold, ruleParams.ruleId, ruleParams.timestampOverride, - params.thresholdSignalHistory + params.signalHistory ); return params.bulkCreate( diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/find_threshold_signals.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/find_threshold_signals.test.ts index e84b4f31fb15f..41d46925770bd 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/find_threshold_signals.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/find_threshold_signals.test.ts @@ -227,6 +227,7 @@ describe('findThresholdSignals', () => { 'threshold_1:user.name': { terms: { field: 'user.name', + order: { cardinality_count: 'desc' }, min_doc_count: 100, size: 10000, }, @@ -302,6 +303,7 @@ describe('findThresholdSignals', () => { lang: 'painless', }, min_doc_count: 200, + order: { cardinality_count: 'desc' }, }, aggs: { cardinality_count: { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/find_threshold_signals.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/find_threshold_signals.ts index ca7f22e4a7570..740ba281cfcfb 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/find_threshold_signals.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/find_threshold_signals.ts @@ -89,6 +89,13 @@ export const findThresholdSignals = async ({ const thresholdFields = threshold.field; + // order buckets by cardinality (https://github.com/elastic/kibana/issues/95258) + const thresholdFieldCount = thresholdFields.length; + const orderByCardinality = (i: number = 0) => + (thresholdFieldCount === 0 || i === thresholdFieldCount - 1) && threshold.cardinality?.length + ? { order: { cardinality_count: 'desc' } } + : {}; + // Generate a nested terms aggregation for each threshold grouping field provided, appending leaf // aggregations to 1) filter out buckets that don't meet the cardinality threshold, if provided, and // 2) return the latest hit for each bucket so that we can persist the timestamp of the event in the @@ -104,6 +111,7 @@ export const findThresholdSignals = async ({ set(acc, aggPath, { terms: { field, + ...orderByCardinality(i), min_doc_count: threshold.value, // not needed on parent agg, but can help narrow down result set size: 10000, // max 10k buckets }, @@ -121,6 +129,7 @@ export const findThresholdSignals = async ({ source: '""', // Group everything in the same bucket lang: 'painless', }, + ...orderByCardinality(), min_doc_count: threshold.value, }, aggs: leafAggs, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.test.ts index d621868a0956c..e67a6fa3dfa9c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.test.ts @@ -11,7 +11,7 @@ import { getThresholdBucketFilters } from './get_threshold_bucket_filters'; describe('getThresholdBucketFilters', () => { it('should generate filters for threshold signal detection with dupe mitigation', async () => { const result = await getThresholdBucketFilters({ - thresholdSignalHistory: sampleThresholdSignalHistory(), + signalHistory: sampleThresholdSignalHistory(), timestampOverride: undefined, }); expect(result).toEqual([ diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.ts index e6a188a20b5d5..c4569ef9818d9 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_bucket_filters.ts @@ -9,14 +9,18 @@ import { Filter } from 'src/plugins/data/common'; import { ESFilter } from '../../../../../../../../src/core/types/elasticsearch'; import { ThresholdSignalHistory, ThresholdSignalHistoryRecord } from '../types'; +/* + * Returns a filter to exclude events that have already been included in a + * previous threshold signal. Uses the threshold signal history to achieve this. + */ export const getThresholdBucketFilters = async ({ - thresholdSignalHistory, + signalHistory, timestampOverride, }: { - thresholdSignalHistory: ThresholdSignalHistory; + signalHistory: ThresholdSignalHistory; timestampOverride: string | undefined; }): Promise => { - const filters = Object.values(thresholdSignalHistory).reduce( + const filters = Object.values(signalHistory).reduce( (acc: ESFilter[], bucket: ThresholdSignalHistoryRecord): ESFilter[] => { const filter = { bool: { @@ -24,6 +28,7 @@ export const getThresholdBucketFilters = async ({ { range: { [timestampOverride ?? '@timestamp']: { + // Timestamp of last event signaled on for this set of terms. lte: new Date(bucket.lastSignalTimestamp).toISOString(), }, }, @@ -32,6 +37,7 @@ export const getThresholdBucketFilters = async ({ }, } as ESFilter; + // Terms to filter events older than `lastSignalTimestamp`. bucket.terms.forEach((term) => { if (term.field != null) { (filter.bool!.filter as ESFilter[]).push({ diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_signal_history.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_signal_history.ts index b93d8423c0259..276431c3bc929 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_signal_history.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/get_threshold_signal_history.ts @@ -5,7 +5,6 @@ * 2.0. */ -import { RulesSchema } from '../../../../../common/detection_engine/schemas/response/rules_schema'; import { TimestampOverrideOrUndefined } from '../../../../../common/detection_engine/schemas/common/schemas'; import { AlertInstanceContext, @@ -16,7 +15,7 @@ import { Logger } from '../../../../../../../../src/core/server'; import { ThresholdSignalHistory } from '../types'; import { BuildRuleMessage } from '../rule_messages'; import { findPreviousThresholdSignals } from './find_previous_threshold_signals'; -import { getThresholdTermsHash } from '../utils'; +import { buildThresholdSignalHistory } from './build_signal_history'; interface GetThresholdSignalHistoryParams { from: string; @@ -41,7 +40,7 @@ export const getThresholdSignalHistory = async ({ timestampOverride, buildRuleMessage, }: GetThresholdSignalHistoryParams): Promise<{ - thresholdSignalHistory: ThresholdSignalHistory; + signalHistory: ThresholdSignalHistory; searchErrors: string[]; }> => { const { searchResult, searchErrors } = await findPreviousThresholdSignals({ @@ -56,51 +55,10 @@ export const getThresholdSignalHistory = async ({ buildRuleMessage, }); - const thresholdSignalHistory = searchResult.hits.hits.reduce( - (acc, hit) => { - if (!hit._source) { - return acc; - } - - const terms = - hit._source.signal?.threshold_result?.terms != null - ? hit._source.signal.threshold_result.terms - : [ - // Pre-7.12 signals - { - field: - (((hit._source.signal?.rule as RulesSchema).threshold as unknown) as { - field: string; - }).field ?? '', - value: ((hit._source.signal?.threshold_result as unknown) as { value: string }) - .value, - }, - ]; - - const hash = getThresholdTermsHash(terms); - const existing = acc[hash]; - const originalTime = - hit._source.signal?.original_time != null - ? new Date(hit._source.signal?.original_time).getTime() - : undefined; - - if (existing != null) { - if (originalTime && originalTime > existing.lastSignalTimestamp) { - acc[hash].lastSignalTimestamp = originalTime; - } - } else if (originalTime) { - acc[hash] = { - terms, - lastSignalTimestamp: originalTime, - }; - } - return acc; - }, - {} - ); - return { - thresholdSignalHistory, + signalHistory: buildThresholdSignalHistory({ + alerts: searchResult.hits.hits, + }), searchErrors, }; }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts index 3dfe3fb650ecb..fc6b42c38549e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/types.ts @@ -281,7 +281,7 @@ export type SignalsEnrichment = (signals: SignalSearchResponse) => Promise(docs: Array>) => Promise>; -export type SimpleHit = BaseHit<{ '@timestamp': string }>; +export type SimpleHit = BaseHit<{ '@timestamp'?: string }>; export type WrapHits = ( hits: Array>, @@ -362,3 +362,8 @@ export interface ThresholdQueryBucket extends TermAggregationBucket { value_as_string: string; }; } + +export interface ThresholdAlertState extends AlertTypeState { + initialized: boolean; + signalHistory: ThresholdSignalHistory; +} diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts index dc929ed0fdeb1..5993dd626729f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/utils.ts @@ -12,7 +12,7 @@ import uuidv5 from 'uuid/v5'; import dateMath from '@elastic/datemath'; import type { estypes } from '@elastic/elasticsearch'; import { ApiResponse, Context } from '@elastic/elasticsearch/lib/Transport'; -import { ALERT_INSTANCE_ID } from '@kbn/rule-data-utils'; +import { ALERT_INSTANCE_ID, ALERT_RULE_UUID } from '@kbn/rule-data-utils'; import type { ListArray, ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; import { MAX_EXCEPTION_LIST_SIZE } from '@kbn/securitysolution-list-constants'; import { hasLargeValueList } from '@kbn/securitysolution-list-utils'; @@ -62,6 +62,14 @@ import { import { WrappedRACAlert } from '../rule_types/types'; import { SearchTypes } from '../../../../common/detection_engine/types'; import { IRuleExecutionLogClient } from '../rule_execution_log/types'; +import { + EQL_RULE_TYPE_ID, + INDICATOR_RULE_TYPE_ID, + ML_RULE_TYPE_ID, + QUERY_RULE_TYPE_ID, + SIGNALS_ID, + THRESHOLD_RULE_TYPE_ID, +} from '../../../../common/constants'; interface SortExceptionsReturn { exceptionsWithValueLists: ExceptionListItemSchema[]; @@ -394,9 +402,7 @@ export const wrapSignal = (signal: SignalHit, index: string): WrappedSignalHit = return { _id: generateSignalId(signal.signal), _index: index, - _source: { - ...signal, - }, + _source: signal, }; }; @@ -990,12 +996,29 @@ export const isWrappedRACAlert = (event: SimpleHit): event is WrappedRACAlert => return (event as WrappedRACAlert)?._source?.[ALERT_INSTANCE_ID] != null; }; +export const racFieldMappings: Record = { + 'signal.rule.id': ALERT_RULE_UUID, +}; + export const getField = (event: SimpleHit, field: string): T | undefined => { if (isWrappedRACAlert(event)) { - return event._source, field.replace('signal', 'kibana.alert') as T; // TODO: handle special cases + const mappedField = racFieldMappings[field] ?? field.replace('signal', 'kibana.alert'); + return get(event._source, mappedField) as T; } else if (isWrappedSignalHit(event)) { return get(event._source, field) as T; } else if (isWrappedEventHit(event)) { return get(event._source, field) as T; } }; + +/** + * Maps legacy rule types to RAC rule type IDs. + */ +export const ruleTypeMappings = { + eql: EQL_RULE_TYPE_ID, + machine_learning: ML_RULE_TYPE_ID, + query: QUERY_RULE_TYPE_ID, + saved_query: SIGNALS_ID, + threat_match: INDICATOR_RULE_TYPE_ID, + threshold: THRESHOLD_RULE_TYPE_ID, +}; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/wrap_hits_factory.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/wrap_hits_factory.ts index 19bdd58140a33..27220d80ebd6e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/wrap_hits_factory.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/wrap_hits_factory.ts @@ -5,12 +5,7 @@ * 2.0. */ -import { - SearchAfterAndBulkCreateParams, - SignalSourceHit, - WrapHits, - WrappedSignalHit, -} from './types'; +import { SearchAfterAndBulkCreateParams, WrapHits, WrappedSignalHit } from './types'; import { generateId } from './utils'; import { buildBulkBody } from './build_bulk_body'; import { filterDuplicateSignals } from './filter_duplicate_signals'; @@ -20,10 +15,12 @@ export const wrapHitsFactory = ({ ruleSO, signalsIndex, mergeStrategy, + ignoreFields, }: { ruleSO: SearchAfterAndBulkCreateParams['ruleSO']; signalsIndex: string; mergeStrategy: ConfigType['alertMergeStrategy']; + ignoreFields: ConfigType['alertIgnoreFields']; }): WrapHits => (events, buildReasonMessage) => { const wrappedDocs: WrappedSignalHit[] = events.flatMap((doc) => [ { @@ -34,7 +31,7 @@ export const wrapHitsFactory = ({ String(doc._version), ruleSO.attributes.params.ruleId ?? '' ), - _source: buildBulkBody(ruleSO, doc as SignalSourceHit, mergeStrategy, buildReasonMessage), + _source: buildBulkBody(ruleSO, doc, mergeStrategy, ignoreFields, buildReasonMessage), }, ]); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/wrap_sequences_factory.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/wrap_sequences_factory.ts index 0ca4b9688f971..d4a4c55db1d23 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/wrap_sequences_factory.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/wrap_sequences_factory.ts @@ -13,10 +13,12 @@ export const wrapSequencesFactory = ({ ruleSO, signalsIndex, mergeStrategy, + ignoreFields, }: { ruleSO: SearchAfterAndBulkCreateParams['ruleSO']; signalsIndex: string; mergeStrategy: ConfigType['alertMergeStrategy']; + ignoreFields: ConfigType['alertIgnoreFields']; }): WrapSequences => (sequences, buildReasonMessage) => sequences.reduce( (acc: WrappedSignalHit[], sequence) => [ @@ -26,6 +28,7 @@ export const wrapSequencesFactory = ({ ruleSO, signalsIndex, mergeStrategy, + ignoreFields, buildReasonMessage ), ], diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/tags/read_tags.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/tags/read_tags.test.ts index 1b7bf048646ed..505f8958ca44d 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/tags/read_tags.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/tags/read_tags.test.ts @@ -11,19 +11,22 @@ import { INTERNAL_RULE_ID_KEY, INTERNAL_IDENTIFIER } from '../../../../common/co import { readRawTags, readTags, convertTagsToSet, convertToTags, isTags } from './read_tags'; import { getQueryRuleParams } from '../schemas/rule_schemas.mock'; -describe('read_tags', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('read_tags - %s', (_, isRuleRegistryEnabled) => { afterEach(() => { jest.resetAllMocks(); }); describe('readRawTags', () => { test('it should return the intersection of tags to where none are repeating', async () => { - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result1.params.ruleId = 'rule-1'; result1.tags = ['tag 1', 'tag 2', 'tag 3']; - const result2 = getAlertMock(getQueryRuleParams()); + const result2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result2.id = '5baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result2.params.ruleId = 'rule-2'; result2.tags = ['tag 1', 'tag 2', 'tag 3', 'tag 4']; @@ -31,17 +34,17 @@ describe('read_tags', () => { const rulesClient = rulesClientMock.create(); rulesClient.find.mockResolvedValue(getFindResultWithMultiHits({ data: [result1, result2] })); - const tags = await readRawTags({ rulesClient }); + const tags = await readRawTags({ isRuleRegistryEnabled, rulesClient }); expect(tags).toEqual(['tag 1', 'tag 2', 'tag 3', 'tag 4']); }); test('it should return the intersection of tags to where some are repeating values', async () => { - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result1.params.ruleId = 'rule-1'; result1.tags = ['tag 1', 'tag 2', 'tag 2', 'tag 3']; - const result2 = getAlertMock(getQueryRuleParams()); + const result2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result2.id = '5baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result2.params.ruleId = 'rule-2'; result2.tags = ['tag 1', 'tag 2', 'tag 2', 'tag 3', 'tag 4']; @@ -49,17 +52,17 @@ describe('read_tags', () => { const rulesClient = rulesClientMock.create(); rulesClient.find.mockResolvedValue(getFindResultWithMultiHits({ data: [result1, result2] })); - const tags = await readRawTags({ rulesClient }); + const tags = await readRawTags({ isRuleRegistryEnabled, rulesClient }); expect(tags).toEqual(['tag 1', 'tag 2', 'tag 3', 'tag 4']); }); test('it should work with no tags defined between two results', async () => { - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result1.params.ruleId = 'rule-1'; result1.tags = []; - const result2 = getAlertMock(getQueryRuleParams()); + const result2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result2.id = '5baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result2.params.ruleId = 'rule-2'; result2.tags = []; @@ -67,12 +70,12 @@ describe('read_tags', () => { const rulesClient = rulesClientMock.create(); rulesClient.find.mockResolvedValue(getFindResultWithMultiHits({ data: [result1, result2] })); - const tags = await readRawTags({ rulesClient }); + const tags = await readRawTags({ isRuleRegistryEnabled, rulesClient }); expect(tags).toEqual([]); }); test('it should work with a single tag which has repeating values in it', async () => { - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result1.params.ruleId = 'rule-1'; result1.tags = ['tag 1', 'tag 1', 'tag 1', 'tag 2']; @@ -80,12 +83,12 @@ describe('read_tags', () => { const rulesClient = rulesClientMock.create(); rulesClient.find.mockResolvedValue(getFindResultWithMultiHits({ data: [result1] })); - const tags = await readRawTags({ rulesClient }); + const tags = await readRawTags({ isRuleRegistryEnabled, rulesClient }); expect(tags).toEqual(['tag 1', 'tag 2']); }); test('it should work with a single tag which has empty tags', async () => { - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result1.params.ruleId = 'rule-1'; result1.tags = []; @@ -93,19 +96,19 @@ describe('read_tags', () => { const rulesClient = rulesClientMock.create(); rulesClient.find.mockResolvedValue(getFindResultWithMultiHits({ data: [result1] })); - const tags = await readRawTags({ rulesClient }); + const tags = await readRawTags({ isRuleRegistryEnabled, rulesClient }); expect(tags).toEqual([]); }); }); describe('readTags', () => { test('it should return the intersection of tags to where none are repeating', async () => { - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result1.params.ruleId = 'rule-1'; result1.tags = ['tag 1', 'tag 2', 'tag 3']; - const result2 = getAlertMock(getQueryRuleParams()); + const result2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result2.id = '5baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result2.params.ruleId = 'rule-2'; result2.tags = ['tag 1', 'tag 2', 'tag 3', 'tag 4']; @@ -113,17 +116,17 @@ describe('read_tags', () => { const rulesClient = rulesClientMock.create(); rulesClient.find.mockResolvedValue(getFindResultWithMultiHits({ data: [result1, result2] })); - const tags = await readTags({ rulesClient }); + const tags = await readTags({ isRuleRegistryEnabled, rulesClient }); expect(tags).toEqual(['tag 1', 'tag 2', 'tag 3', 'tag 4']); }); test('it should return the intersection of tags to where some are repeating values', async () => { - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result1.params.ruleId = 'rule-1'; result1.tags = ['tag 1', 'tag 2', 'tag 2', 'tag 3']; - const result2 = getAlertMock(getQueryRuleParams()); + const result2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result2.id = '5baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result2.params.ruleId = 'rule-2'; result2.tags = ['tag 1', 'tag 2', 'tag 2', 'tag 3', 'tag 4']; @@ -131,17 +134,17 @@ describe('read_tags', () => { const rulesClient = rulesClientMock.create(); rulesClient.find.mockResolvedValue(getFindResultWithMultiHits({ data: [result1, result2] })); - const tags = await readTags({ rulesClient }); + const tags = await readTags({ isRuleRegistryEnabled, rulesClient }); expect(tags).toEqual(['tag 1', 'tag 2', 'tag 3', 'tag 4']); }); test('it should work with no tags defined between two results', async () => { - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result1.params.ruleId = 'rule-1'; result1.tags = []; - const result2 = getAlertMock(getQueryRuleParams()); + const result2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result2.id = '5baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result2.params.ruleId = 'rule-2'; result2.tags = []; @@ -149,12 +152,12 @@ describe('read_tags', () => { const rulesClient = rulesClientMock.create(); rulesClient.find.mockResolvedValue(getFindResultWithMultiHits({ data: [result1, result2] })); - const tags = await readTags({ rulesClient }); + const tags = await readTags({ isRuleRegistryEnabled, rulesClient }); expect(tags).toEqual([]); }); test('it should work with a single tag which has repeating values in it', async () => { - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result1.params.ruleId = 'rule-1'; result1.tags = ['tag 1', 'tag 1', 'tag 1', 'tag 2']; @@ -162,12 +165,12 @@ describe('read_tags', () => { const rulesClient = rulesClientMock.create(); rulesClient.find.mockResolvedValue(getFindResultWithMultiHits({ data: [result1] })); - const tags = await readTags({ rulesClient }); + const tags = await readTags({ isRuleRegistryEnabled, rulesClient }); expect(tags).toEqual(['tag 1', 'tag 2']); }); test('it should work with a single tag which has empty tags', async () => { - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result1.params.ruleId = 'rule-1'; result1.tags = []; @@ -175,12 +178,12 @@ describe('read_tags', () => { const rulesClient = rulesClientMock.create(); rulesClient.find.mockResolvedValue(getFindResultWithMultiHits({ data: [result1] })); - const tags = await readTags({ rulesClient }); + const tags = await readTags({ isRuleRegistryEnabled, rulesClient }); expect(tags).toEqual([]); }); test('it should filter out any __internal tags for things such as alert_id', async () => { - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result1.params.ruleId = 'rule-1'; result1.tags = [ @@ -192,12 +195,12 @@ describe('read_tags', () => { const rulesClient = rulesClientMock.create(); rulesClient.find.mockResolvedValue(getFindResultWithMultiHits({ data: [result1] })); - const tags = await readTags({ rulesClient }); + const tags = await readTags({ isRuleRegistryEnabled, rulesClient }); expect(tags).toEqual(['tag 1']); }); test('it should filter out any __internal tags with two different results', async () => { - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result1.params.ruleId = 'rule-1'; result1.tags = [ @@ -210,7 +213,7 @@ describe('read_tags', () => { 'tag 5', ]; - const result2 = getAlertMock(getQueryRuleParams()); + const result2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result2.id = '5baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result2.params.ruleId = 'rule-2'; result2.tags = [ @@ -225,19 +228,19 @@ describe('read_tags', () => { const rulesClient = rulesClientMock.create(); rulesClient.find.mockResolvedValue(getFindResultWithMultiHits({ data: [result1] })); - const tags = await readTags({ rulesClient }); + const tags = await readTags({ isRuleRegistryEnabled, rulesClient }); expect(tags).toEqual(['tag 1', 'tag 2', 'tag 3', 'tag 4', 'tag 5']); }); }); describe('convertTagsToSet', () => { test('it should convert the intersection of two tag systems without duplicates', () => { - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result1.params.ruleId = 'rule-1'; result1.tags = ['tag 1', 'tag 2', 'tag 2', 'tag 3']; - const result2 = getAlertMock(getQueryRuleParams()); + const result2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result2.id = '5baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result2.params.ruleId = 'rule-2'; result2.tags = ['tag 1', 'tag 2', 'tag 2', 'tag 3', 'tag 4']; @@ -255,12 +258,12 @@ describe('read_tags', () => { describe('convertToTags', () => { test('it should convert the two tag systems together with duplicates', () => { - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result1.params.ruleId = 'rule-1'; result1.tags = ['tag 1', 'tag 2', 'tag 2', 'tag 3']; - const result2 = getAlertMock(getQueryRuleParams()); + const result2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result2.id = '5baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result2.params.ruleId = 'rule-2'; result2.tags = ['tag 1', 'tag 2', 'tag 2', 'tag 3', 'tag 4']; @@ -281,18 +284,18 @@ describe('read_tags', () => { }); test('it should filter out anything that is not a tag', () => { - const result1 = getAlertMock(getQueryRuleParams()); + const result1 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result1.id = '4baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result1.params.ruleId = 'rule-1'; result1.tags = ['tag 1', 'tag 2', 'tag 2', 'tag 3']; - const result2 = getAlertMock(getQueryRuleParams()); + const result2 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result2.id = '99979e67-19a7-455f-b452-8eded6135716'; result2.params.ruleId = 'rule-2'; // @ts-expect-error delete result2.tags; - const result3 = getAlertMock(getQueryRuleParams()); + const result3 = getAlertMock(isRuleRegistryEnabled, getQueryRuleParams()); result3.id = '5baa53f8-96da-44ee-ad58-41bccb7f9f3d'; result3.params.ruleId = 'rule-2'; result3.tags = ['tag 1', 'tag 2', 'tag 2', 'tag 3', 'tag 4']; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/tags/read_tags.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/tags/read_tags.ts index 2314a8a49f567..183ac6f777963 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/tags/read_tags.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/tags/read_tags.ts @@ -40,22 +40,27 @@ export const convertTagsToSet = (tagObjects: object[]): Set => { // then this should be replaced with a an aggregation call. // Ref: https://www.elastic.co/guide/en/kibana/master/saved-objects-api.html export const readTags = async ({ + isRuleRegistryEnabled, rulesClient, }: { + isRuleRegistryEnabled: boolean; rulesClient: RulesClient; }): Promise => { - const tags = await readRawTags({ rulesClient }); + const tags = await readRawTags({ isRuleRegistryEnabled, rulesClient }); return tags.filter((tag) => !tag.startsWith(INTERNAL_IDENTIFIER)); }; export const readRawTags = async ({ + isRuleRegistryEnabled, rulesClient, }: { + isRuleRegistryEnabled: boolean; rulesClient: RulesClient; perPage?: number; }): Promise => { // Get just one record so we can get the total count const firstTags = await findRules({ + isRuleRegistryEnabled, rulesClient, fields: ['tags'], perPage: 1, @@ -66,6 +71,7 @@ export const readRawTags = async ({ }); // Get all the rules to aggregate over all the tags of the rules const rules = await findRules({ + isRuleRegistryEnabled, rulesClient, fields: ['tags'], perPage: firstTags.total, diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/filters.ts b/x-pack/plugins/security_solution/server/lib/telemetry/filters.ts index 938772ce72367..18c3baccf9aa0 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/filters.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/filters.ts @@ -111,6 +111,8 @@ export const allowlistEventFields: AllowlistFields = { events: allowlistBaseEventFields, // behavioral protection re-nests some field sets under Events.* (>=7.15) Events: allowlistBaseEventFields, + // behavioral protection response data under Response.* (>=7.15) + Responses: true, rule: { id: true, name: true, diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/sender.test.ts b/x-pack/plugins/security_solution/server/lib/telemetry/sender.test.ts index a4f8033f1160d..d04d0ab49afe9 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/sender.test.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/sender.test.ts @@ -80,6 +80,7 @@ describe('TelemetryEventsSender', () => { executable: null, // null fields are never allowlisted working_directory: '/some/usr/dir', }, + Responses: '{ "result": 0 }', // >= 7.15 Target: { process: { name: 'bar.exe', @@ -89,6 +90,9 @@ describe('TelemetryEventsSender', () => { }, }, }, + threat: { + ignored_object: true, // this field is not allowlisted + }, }, ]; @@ -136,6 +140,7 @@ describe('TelemetryEventsSender', () => { name: 'foo.exe', working_directory: '/some/usr/dir', }, + Responses: '{ "result": 0 }', Target: { process: { name: 'bar.exe', diff --git a/x-pack/plugins/security_solution/server/lib/timeline/constants.ts b/x-pack/plugins/security_solution/server/lib/timeline/constants.ts new file mode 100644 index 0000000000000..e38096bc2e82c --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/timeline/constants.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. + */ + +/** + * The reference name for the saved query ID field within the timeline saved object definition + */ +export const SAVED_QUERY_ID_REF_NAME = 'savedQueryId'; + +/** + * This needs to match the type of the saved query saved object. That type is defined here: + * https://github.com/elastic/kibana/blob/master/src/plugins/data/public/query/saved_query/saved_query_service.ts#L54 + */ +export const SAVED_QUERY_TYPE = 'query'; + +/** + * The reference name for the timeline ID field within the notes and pinned events saved object definition + */ +export const TIMELINE_ID_REF_NAME = 'timelineId'; diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/notes/persist_note.ts b/x-pack/plugins/security_solution/server/lib/timeline/routes/notes/persist_note.ts index 32fd87f39620b..ad94f06f2d34f 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/routes/notes/persist_note.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/routes/notes/persist_note.ts @@ -42,18 +42,16 @@ export const persistNoteRoute = ( const frameworkRequest = await buildFrameworkRequest(context, security, request); const { note } = request.body; const noteId = request.body?.noteId ?? null; - const version = request.body?.version ?? null; - const res = await persistNote( - frameworkRequest, + const res = await persistNote({ + request: frameworkRequest, noteId, - version, - { + note: { ...note, timelineId: note.timelineId || null, }, - true - ); + overrideOwner: true, + }); return response.ok({ body: { data: { persistNote: res } }, diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/helpers.test.ts b/x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/helpers.test.ts index f30f80a4cf14c..c384c1df80ad1 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/helpers.test.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/helpers.test.ts @@ -5,8 +5,6 @@ * 2.0. */ -import { join, resolve } from 'path'; - import { createPromiseFromStreams } from '@kbn/utils'; import { SecurityPluginSetup } from '../../../../../../../security/server'; @@ -21,17 +19,20 @@ import { getFindResultWithSingleHit, } from '../../../../detection_engine/routes/__mocks__/request_responses'; -import * as lib from './helpers'; -import { importTimelines } from '../../timelines/import_timelines'; +import * as helpers from './helpers'; +import { importTimelines } from '../../timelines/import_timelines/helpers'; import { buildFrameworkRequest } from '../../../utils/common'; import { ImportTimelineResultSchema } from '../../../../../../common/types/timeline'; -jest.mock('../../timelines/import_timelines'); +jest.mock('../../timelines/import_timelines/helpers'); -describe('installPrepackagedTimelines', () => { +describe.each([ + ['Legacy', false], + ['RAC', true], +])('installPrepackagedTimelines - %s', (_, isRuleRegistryEnabled) => { let securitySetup: SecurityPluginSetup; let frameworkRequest: FrameworkRequest; - const spyInstallPrepackagedTimelines = jest.spyOn(lib, 'installPrepackagedTimelines'); + const spyInstallPrepackagedTimelines = jest.spyOn(helpers, 'installPrepackagedTimelines'); const { clients, context } = requestContextMock.createTools(); const config = createMockConfig(); @@ -46,11 +47,11 @@ describe('installPrepackagedTimelines', () => { authz: {}, } as unknown) as SecurityPluginSetup; - clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit()); + clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); jest.doMock('./helpers', () => { return { - ...lib, + ...helpers, installPrepackagedTimelines: spyInstallPrepackagedTimelines, }; }); @@ -60,7 +61,7 @@ describe('installPrepackagedTimelines', () => { }); afterEach(() => { - spyInstallPrepackagedTimelines.mockClear(); + jest.clearAllMocks(); }); afterAll(() => { @@ -68,10 +69,10 @@ describe('installPrepackagedTimelines', () => { }); test('should call importTimelines', async () => { - await lib.installPrepackagedTimelines( + await helpers.installPrepackagedTimelines( config.maxTimelineImportExportSize, frameworkRequest, - true, + false, mockFilePath, mockFileName ); @@ -80,14 +81,12 @@ describe('installPrepackagedTimelines', () => { }); test('should call importTimelines with Readables', async () => { - const dir = resolve(join(__dirname, mockFilePath)); - const file = mockFileName; - await lib.installPrepackagedTimelines( + await helpers.installPrepackagedTimelines( config.maxTimelineImportExportSize, frameworkRequest, true, - dir, - file + mockFilePath, + mockFileName ); const args = await createPromiseFromStreams([(importTimelines as jest.Mock).mock.calls[0][0]]); const expected = JSON.stringify({ @@ -194,14 +193,12 @@ describe('installPrepackagedTimelines', () => { }); test('should call importTimelines with maxTimelineImportExportSize', async () => { - const dir = resolve(join(__dirname, mockFilePath)); - const file = mockFileName; - await lib.installPrepackagedTimelines( + await helpers.installPrepackagedTimelines( config.maxTimelineImportExportSize, frameworkRequest, true, - dir, - file + mockFilePath, + mockFileName ); expect((importTimelines as jest.Mock).mock.calls[0][1]).toEqual( @@ -210,14 +207,12 @@ describe('installPrepackagedTimelines', () => { }); test('should call importTimelines with frameworkRequest', async () => { - const dir = resolve(join(__dirname, mockFilePath)); - const file = mockFileName; - await lib.installPrepackagedTimelines( + await helpers.installPrepackagedTimelines( config.maxTimelineImportExportSize, frameworkRequest, true, - dir, - file + mockFilePath, + mockFileName ); expect(JSON.stringify((importTimelines as jest.Mock).mock.calls[0][2])).toEqual( @@ -226,21 +221,19 @@ describe('installPrepackagedTimelines', () => { }); test('should call importTimelines with immutable', async () => { - const dir = resolve(join(__dirname, mockFilePath)); - const file = mockFileName; - await lib.installPrepackagedTimelines( + await helpers.installPrepackagedTimelines( config.maxTimelineImportExportSize, frameworkRequest, true, - dir, - file + mockFilePath, + mockFileName ); expect((importTimelines as jest.Mock).mock.calls[0][3]).toEqual(true); }); test('should handle errors from getReadables', async () => { - const result = await lib.installPrepackagedTimelines( + const result = await helpers.installPrepackagedTimelines( config.maxTimelineImportExportSize, frameworkRequest, true, diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/helpers.test.ts b/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/helpers.test.ts index f5e5b7dfb8ae9..c76b0858a6e42 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/helpers.test.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/helpers.test.ts @@ -119,7 +119,7 @@ describe('createTimelines', () => { }); test('persistNotes', () => { - expect((persistNotes as jest.Mock).mock.calls[0][4]).toEqual([ + expect((persistNotes as jest.Mock).mock.calls[0][3]).toEqual([ { created: 1603885051655, createdBy: 'elastic', diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/helpers.ts b/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/helpers.ts index e202230bf5cce..b393c753853f5 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/helpers.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/helpers.ts @@ -54,7 +54,6 @@ export const createTimelines = async ({ isImmutable ); const newTimelineSavedObjectId = responseTimeline.timeline.savedObjectId; - const newTimelineVersion = responseTimeline.timeline.version; let myPromises: unknown[] = []; if (pinnedEventIds != null && !isEmpty(pinnedEventIds)) { @@ -73,7 +72,6 @@ export const createTimelines = async ({ persistNotes( frameworkRequest, timelineSavedObjectId ?? newTimelineSavedObjectId, - newTimelineVersion, existingNoteIds, notes, overrideNotesOwner diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.test.ts b/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.test.ts index 2f51b23d73676..e0962e1fdce27 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.test.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.test.ts @@ -257,25 +257,13 @@ describe('import timelines', () => { test('should provide no noteSavedObjectId when Creating notes for a timeline', async () => { const mockRequest = await getImportTimelinesRequest(); await server.inject(mockRequest, context); - expect(mockPersistNote.mock.calls[0][1]).toBeNull(); - }); - - test('should provide new timeline version when Creating notes for a timeline', async () => { - const mockRequest = await getImportTimelinesRequest(); - await server.inject(mockRequest, context); - expect(mockPersistNote.mock.calls[0][1]).toBeNull(); - }); - - test('should provide note content when Creating notes for a timeline', async () => { - const mockRequest = await getImportTimelinesRequest(); - await server.inject(mockRequest, context); - expect(mockPersistNote.mock.calls[0][2]).toEqual(mockCreatedTimeline.version); + expect(mockPersistNote.mock.calls[0][0].noteId).toBeNull(); }); test('should provide new notes with original author info when Creating notes for a timeline', async () => { const mockRequest = await getImportTimelinesRequest(); await server.inject(mockRequest, context); - expect(mockPersistNote.mock.calls[0][3]).toEqual({ + expect(mockPersistNote.mock.calls[0][0].note).toEqual({ eventId: undefined, note: 'original note', created: '1584830796960', @@ -284,7 +272,7 @@ describe('import timelines', () => { updatedBy: 'original author A', timelineId: mockCreatedTimeline.savedObjectId, }); - expect(mockPersistNote.mock.calls[1][3]).toEqual({ + expect(mockPersistNote.mock.calls[1][0].note).toEqual({ eventId: mockUniqueParsedObjects[0].eventNotes[0].eventId, note: 'original event note', created: '1584830796960', @@ -293,7 +281,7 @@ describe('import timelines', () => { updatedBy: 'original author B', timelineId: mockCreatedTimeline.savedObjectId, }); - expect(mockPersistNote.mock.calls[2][3]).toEqual({ + expect(mockPersistNote.mock.calls[2][0].note).toEqual({ eventId: mockUniqueParsedObjects[0].eventNotes[1].eventId, note: 'event note2', created: '1584830796960', @@ -310,7 +298,7 @@ describe('import timelines', () => { const mockRequest = await getImportTimelinesRequest(); await server.inject(mockRequest, context); - expect(mockPersistNote.mock.calls[0][3]).toEqual({ + expect(mockPersistNote.mock.calls[0][0].note).toEqual({ created: mockUniqueParsedObjects[0].globalNotes[0].created, createdBy: mockUniqueParsedObjects[0].globalNotes[0].createdBy, updated: mockUniqueParsedObjects[0].globalNotes[0].updated, @@ -319,7 +307,7 @@ describe('import timelines', () => { note: mockUniqueParsedObjects[0].globalNotes[0].note, timelineId: mockCreatedTimeline.savedObjectId, }); - expect(mockPersistNote.mock.calls[1][3]).toEqual({ + expect(mockPersistNote.mock.calls[1][0].note).toEqual({ created: mockUniqueParsedObjects[0].eventNotes[0].created, createdBy: mockUniqueParsedObjects[0].eventNotes[0].createdBy, updated: mockUniqueParsedObjects[0].eventNotes[0].updated, @@ -328,7 +316,7 @@ describe('import timelines', () => { note: mockUniqueParsedObjects[0].eventNotes[0].note, timelineId: mockCreatedTimeline.savedObjectId, }); - expect(mockPersistNote.mock.calls[2][3]).toEqual({ + expect(mockPersistNote.mock.calls[2][0].note).toEqual({ created: mockUniqueParsedObjects[0].eventNotes[1].created, createdBy: mockUniqueParsedObjects[0].eventNotes[1].createdBy, updated: mockUniqueParsedObjects[0].eventNotes[1].updated, @@ -640,19 +628,13 @@ describe('import timeline templates', () => { test('should provide no noteSavedObjectId when Creating notes for a timeline', async () => { const mockRequest = await getImportTimelinesRequest(); await server.inject(mockRequest, context); - expect(mockPersistNote.mock.calls[0][1]).toBeNull(); - }); - - test('should provide new timeline version when Creating notes for a timeline', async () => { - const mockRequest = await getImportTimelinesRequest(); - await server.inject(mockRequest, context); - expect(mockPersistNote.mock.calls[0][2]).toEqual(mockCreatedTemplateTimeline.version); + expect(mockPersistNote.mock.calls[0][0].noteId).toBeNull(); }); test('should exclude event notes when creating notes', async () => { const mockRequest = await getImportTimelinesRequest(); await server.inject(mockRequest, context); - expect(mockPersistNote.mock.calls[0][3]).toEqual({ + expect(mockPersistNote.mock.calls[0][0].note).toEqual({ eventId: undefined, note: mockUniqueParsedTemplateTimelineObjects[0].globalNotes[0].note, created: mockUniqueParsedTemplateTimelineObjects[0].globalNotes[0].created, @@ -792,19 +774,13 @@ describe('import timeline templates', () => { test('should provide noteSavedObjectId when Creating notes for a timeline', async () => { const mockRequest = await getImportTimelinesRequest(); await server.inject(mockRequest, context); - expect(mockPersistNote.mock.calls[0][1]).toBeNull(); - }); - - test('should provide new timeline version when Creating notes for a timeline', async () => { - const mockRequest = await getImportTimelinesRequest(); - await server.inject(mockRequest, context); - expect(mockPersistNote.mock.calls[0][2]).toEqual(mockCreatedTemplateTimeline.version); + expect(mockPersistNote.mock.calls[0][0].noteId).toBeNull(); }); test('should exclude event notes when creating notes', async () => { const mockRequest = await getImportTimelinesRequest(); await server.inject(mockRequest, context); - expect(mockPersistNote.mock.calls[0][3]).toEqual({ + expect(mockPersistNote.mock.calls[0][0].note).toEqual({ eventId: undefined, note: mockUniqueParsedTemplateTimelineObjects[0].globalNotes[0].note, created: mockUniqueParsedTemplateTimelineObjects[0].globalNotes[0].created, diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/field_migrator.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/field_migrator.ts new file mode 100644 index 0000000000000..608c104440e78 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/field_migrator.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 { TIMELINE_ID_REF_NAME } from '../../constants'; +import { timelineSavedObjectType } from '../../saved_object_mappings'; +import { FieldMigrator } from '../../utils/migrator'; + +/** + * A migrator to handle moving specific fields that reference the timeline saved object to the references field within a note saved + * object. + */ +export const noteFieldsMigrator = new FieldMigrator([ + { path: 'timelineId', type: timelineSavedObjectType, name: TIMELINE_ID_REF_NAME }, +]); diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/index.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/index.ts index 34914517da683..81941853c57a3 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/index.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/index.ts @@ -28,13 +28,17 @@ export interface Notes { search: string | null, sort: SortNote | null ) => Promise; - persistNote: ( - request: FrameworkRequest, - noteId: string | null, - version: string | null, - note: SavedNote, - overrideOwner: boolean - ) => Promise; + persistNote: ({ + request, + noteId, + note, + overrideOwner, + }: { + request: FrameworkRequest; + noteId: string | null; + note: SavedNote; + overrideOwner: boolean; + }) => Promise; convertSavedObjectToSavedNote: ( savedObject: unknown, timelineVersion?: string | undefined | null diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/persist_notes.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/persist_notes.ts index 58b4e33444d94..612c9083cb343 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/persist_notes.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/persist_notes.ts @@ -13,7 +13,6 @@ import { NoteResult } from '../../../../../common/types/timeline/note'; export const persistNotes = async ( frameworkRequest: FrameworkRequest, timelineSavedObjectId: string, - timelineVersion?: string | null, existingNoteIds?: string[], newNotes?: NoteResult[], overrideOwner: boolean = true @@ -26,13 +25,12 @@ export const persistNotes = async ( timelineSavedObjectId, overrideOwner ); - return persistNote( - frameworkRequest, - overrideOwner ? existingNoteIds?.find((nId) => nId === note.noteId) ?? null : null, - timelineVersion ?? null, - newNote, - overrideOwner - ); + return persistNote({ + request: frameworkRequest, + noteId: overrideOwner ? existingNoteIds?.find((nId) => nId === note.noteId) ?? null : null, + note: newNote, + overrideOwner, + }); }) ?? [] ); }; diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/saved_object.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/saved_object.ts index 91caaa8cc8a8b..29a2aa809b808 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/saved_object.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/saved_object.ts @@ -25,11 +25,13 @@ import { NoteResult, ResponseNotes, ResponseNote, + NoteWithoutExternalRefs, } from '../../../../../common/types/timeline/note'; import { FrameworkRequest } from '../../../framework'; import { noteSavedObjectType } from '../../saved_object_mappings/notes'; -import { convertSavedObjectToSavedTimeline, pickSavedTimeline } from '../timelines'; +import { createTimeline } from '../timelines'; import { timelineSavedObjectType } from '../../saved_object_mappings'; +import { noteFieldsMigrator } from './field_migrator'; export const deleteNote = async (request: FrameworkRequest, noteIds: string[]) => { const savedObjectsClient = request.context.core.savedObjects.client; @@ -42,8 +44,7 @@ export const deleteNote = async (request: FrameworkRequest, noteIds: string[]) = export const deleteNoteByTimelineId = async (request: FrameworkRequest, timelineId: string) => { const options: SavedObjectsFindOptions = { type: noteSavedObjectType, - search: timelineId, - searchFields: ['timelineId'], + hasReference: { type: timelineSavedObjectType, id: timelineId }, }; const notesToBeDeleted = await getAllSavedNote(request, options); const savedObjectsClient = request.context.core.savedObjects.client; @@ -81,8 +82,7 @@ export const getNotesByTimelineId = async ( ): Promise => { const options: SavedObjectsFindOptions = { type: noteSavedObjectType, - search: timelineId, - searchFields: ['timelineId'], + hasReference: { type: timelineSavedObjectType, id: timelineId }, }; const notesByTimelineId = await getAllSavedNote(request, options); return notesByTimelineId.notes; @@ -106,62 +106,29 @@ export const getAllNotes = async ( return getAllSavedNote(request, options); }; -export const persistNote = async ( - request: FrameworkRequest, - noteId: string | null, - version: string | null, - note: SavedNote, - overrideOwner: boolean = true -): Promise => { +export const persistNote = async ({ + request, + noteId, + note, + overrideOwner = true, +}: { + request: FrameworkRequest; + noteId: string | null; + note: SavedNote; + overrideOwner?: boolean; +}): Promise => { try { - const savedObjectsClient = request.context.core.savedObjects.client; - if (noteId == null) { - const timelineVersionSavedObject = - note.timelineId == null - ? await (async () => { - const timelineResult = convertSavedObjectToSavedTimeline( - await savedObjectsClient.create( - timelineSavedObjectType, - pickSavedTimeline(null, {}, request.user) - ) - ); - note.timelineId = timelineResult.savedObjectId; - return timelineResult.version; - })() - : null; - - // Create new note - return { - code: 200, - message: 'success', - note: convertSavedObjectToSavedNote( - await savedObjectsClient.create( - noteSavedObjectType, - overrideOwner ? pickSavedNote(noteId, note, request.user) : note - ), - timelineVersionSavedObject != null ? timelineVersionSavedObject : undefined - ), - }; + return await createNote({ + request, + noteId, + note, + overrideOwner, + }); } // Update existing note - - const existingNote = await getSavedNote(request, noteId); - return { - code: 200, - message: 'success', - note: convertSavedObjectToSavedNote( - await savedObjectsClient.update( - noteSavedObjectType, - noteId, - overrideOwner ? pickSavedNote(noteId, note, request.user) : note, - { - version: existingNote.version || undefined, - } - ) - ), - }; + return await updateNote({ request, noteId, note, overrideOwner }); } catch (err) { if (getOr(null, 'output.statusCode', err) === 403) { const noteToReturn: NoteResult = { @@ -181,22 +148,142 @@ export const persistNote = async ( } }; +const createNote = async ({ + request, + noteId, + note, + overrideOwner = true, +}: { + request: FrameworkRequest; + noteId: string | null; + note: SavedNote; + overrideOwner?: boolean; +}) => { + const savedObjectsClient = request.context.core.savedObjects.client; + const userInfo = request.user; + + const shallowCopyOfNote = { ...note }; + let timelineVersion: string | undefined; + + if (note.timelineId == null) { + const { timeline: timelineResult } = await createTimeline({ + timelineId: null, + timeline: {}, + savedObjectsClient, + userInfo, + }); + + shallowCopyOfNote.timelineId = timelineResult.savedObjectId; + timelineVersion = timelineResult.version; + } + + const noteWithCreator = overrideOwner + ? pickSavedNote(noteId, shallowCopyOfNote, userInfo) + : shallowCopyOfNote; + + const { + transformedFields: migratedAttributes, + references, + } = noteFieldsMigrator.extractFieldsToReferences({ + data: noteWithCreator, + }); + + const createdNote = await savedObjectsClient.create( + noteSavedObjectType, + migratedAttributes, + { + references, + } + ); + + const repopulatedSavedObject = noteFieldsMigrator.populateFieldsFromReferences(createdNote); + + const convertedNote = convertSavedObjectToSavedNote(repopulatedSavedObject, timelineVersion); + + // Create new note + return { + code: 200, + message: 'success', + note: convertedNote, + }; +}; + +const updateNote = async ({ + request, + noteId, + note, + overrideOwner = true, +}: { + request: FrameworkRequest; + noteId: string; + note: SavedNote; + overrideOwner?: boolean; +}) => { + const savedObjectsClient = request.context.core.savedObjects.client; + const userInfo = request.user; + + const existingNote = await savedObjectsClient.get( + noteSavedObjectType, + noteId + ); + + const noteWithCreator = overrideOwner ? pickSavedNote(noteId, note, userInfo) : note; + + const { + transformedFields: migratedPatchAttributes, + references, + } = noteFieldsMigrator.extractFieldsToReferences({ + data: noteWithCreator, + existingReferences: existingNote.references, + }); + + const updatedNote = await savedObjectsClient.update( + noteSavedObjectType, + noteId, + migratedPatchAttributes, + { + version: existingNote.version || undefined, + references, + } + ); + + const populatedNote = noteFieldsMigrator.populateFieldsFromReferencesForPatch({ + dataBeforeRequest: note, + dataReturnedFromRequest: updatedNote, + }); + + const convertedNote = convertSavedObjectToSavedNote(populatedNote); + + return { + code: 200, + message: 'success', + note: convertedNote, + }; +}; + const getSavedNote = async (request: FrameworkRequest, NoteId: string) => { const savedObjectsClient = request.context.core.savedObjects.client; - const savedObject = await savedObjectsClient.get(noteSavedObjectType, NoteId); + const savedObject = await savedObjectsClient.get( + noteSavedObjectType, + NoteId + ); + + const populatedNote = noteFieldsMigrator.populateFieldsFromReferences(savedObject); - return convertSavedObjectToSavedNote(savedObject); + return convertSavedObjectToSavedNote(populatedNote); }; const getAllSavedNote = async (request: FrameworkRequest, options: SavedObjectsFindOptions) => { const savedObjectsClient = request.context.core.savedObjects.client; - const savedObjects = await savedObjectsClient.find(options); + const savedObjects = await savedObjectsClient.find(options); return { totalCount: savedObjects.total, - notes: savedObjects.saved_objects.map((savedObject) => - convertSavedObjectToSavedNote(savedObject) - ), + notes: savedObjects.saved_objects.map((savedObject) => { + const populatedNote = noteFieldsMigrator.populateFieldsFromReferences(savedObject); + + return convertSavedObjectToSavedNote(populatedNote); + }), }; }; @@ -233,11 +320,9 @@ const pickSavedNote = ( if (noteId == null) { savedNote.created = new Date().valueOf(); savedNote.createdBy = userInfo?.username ?? UNAUTHENTICATED_USER; - savedNote.updated = new Date().valueOf(); - savedNote.updatedBy = userInfo?.username ?? UNAUTHENTICATED_USER; - } else if (noteId != null) { - savedNote.updated = new Date().valueOf(); - savedNote.updatedBy = userInfo?.username ?? UNAUTHENTICATED_USER; } + + savedNote.updated = new Date().valueOf(); + savedNote.updatedBy = userInfo?.username ?? UNAUTHENTICATED_USER; return savedNote; }; diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/convert_saved_object_to_savedtimeline.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/convert_saved_object_to_savedtimeline.ts index 27826a92b6d96..b49538a706e39 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/convert_saved_object_to_savedtimeline.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/convert_saved_object_to_savedtimeline.ts @@ -19,7 +19,7 @@ import { } from '../../../../../common/types/timeline'; // TODO: Added to support legacy TimelineType.draft, can be removed in 7.10 -export const TimelineSavedObjectWithDraftRuntimeType = intersection([ +const TimelineSavedObjectWithDraftRuntime = intersection([ type({ id: string, version: string, @@ -53,7 +53,7 @@ const getTimelineTypeAndStatus = ( export const convertSavedObjectToSavedTimeline = (savedObject: unknown): TimelineSavedObject => { const timeline = pipe( - TimelineSavedObjectWithDraftRuntimeType.decode(savedObject), + TimelineSavedObjectWithDraftRuntime.decode(savedObject), map((savedTimeline) => { const attributes = { ...savedTimeline.attributes, diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/field_migrator.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/field_migrator.ts new file mode 100644 index 0000000000000..bb6667f81ed8f --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/field_migrator.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 { SAVED_QUERY_ID_REF_NAME, SAVED_QUERY_TYPE } from '../../constants'; +import { FieldMigrator } from '../../utils/migrator'; + +/** + * A migrator to handle moving specific fields that reference other saved objects to the references field within a saved + * object. + */ +export const timelineFieldsMigrator = new FieldMigrator([ + { path: 'savedQueryId', type: SAVED_QUERY_TYPE, name: SAVED_QUERY_ID_REF_NAME }, +]); diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/index.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/index.ts index 8904a9103bc02..d25d2ece7d246 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/index.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/index.ts @@ -7,7 +7,10 @@ import { getOr } from 'lodash/fp'; -import { SavedObjectsFindOptions } from '../../../../../../../../src/core/server'; +import { + SavedObjectsClientContract, + SavedObjectsFindOptions, +} from '../../../../../../../../src/core/server'; import { UNAUTHENTICATED_USER } from '../../../../../common/constants'; import { NoteSavedObject } from '../../../../../common/types/timeline/note'; import { PinnedEventSavedObject } from '../../../../../common/types/timeline/pinned_event'; @@ -26,6 +29,7 @@ import { TimelineType, TimelineStatus, TimelineResult, + TimelineWithoutExternalRefs, } from '../../../../../common/types/timeline'; import { FrameworkRequest } from '../../../framework'; import * as note from '../notes/saved_object'; @@ -36,6 +40,7 @@ import { timelineSavedObjectType } from '../../saved_object_mappings/'; import { draftTimelineDefaults } from '../../utils/default_timeline'; import { AuthenticatedUser } from '../../../../../../security/server'; import { Maybe } from '../../../../../common/search_strategy'; +import { timelineFieldsMigrator } from './field_migrator'; export { pickSavedTimeline } from './pick_saved_timeline'; export { convertSavedObjectToSavedTimeline } from './convert_saved_object_to_savedtimeline'; @@ -387,34 +392,17 @@ export const persistTimeline = async ( const userInfo = isImmutable ? ({ username: 'Elastic' } as AuthenticatedUser) : request.user; try { if (timelineId == null) { - // Create new timeline - const newTimeline = convertSavedObjectToSavedTimeline( - await savedObjectsClient.create( - timelineSavedObjectType, - pickSavedTimeline(timelineId, timeline, userInfo) - ) - ); - return { - code: 200, - message: 'success', - timeline: newTimeline, - }; + return await createTimeline({ timelineId, timeline, userInfo, savedObjectsClient }); } - // Update Timeline - await savedObjectsClient.update( - timelineSavedObjectType, - timelineId, - pickSavedTimeline(timelineId, timeline, userInfo), - { - version: version || undefined, - } - ); - return { - code: 200, - message: 'success', - timeline: await getSavedTimeline(request, timelineId), - }; + return await updateTimeline({ + request, + timelineId, + timeline, + userInfo, + savedObjectsClient, + version, + }); } catch (err) { if (timelineId != null && savedObjectsClient.errors.isConflictError(err)) { return { @@ -438,6 +426,86 @@ export const persistTimeline = async ( } }; +export const createTimeline = async ({ + timelineId, + timeline, + savedObjectsClient, + userInfo, +}: { + timelineId: string | null; + timeline: SavedTimeline; + savedObjectsClient: SavedObjectsClientContract; + userInfo: AuthenticatedUser | null; +}) => { + const { + transformedFields: migratedAttributes, + references, + } = timelineFieldsMigrator.extractFieldsToReferences({ + data: pickSavedTimeline(timelineId, timeline, userInfo), + }); + + const createdTimeline = await savedObjectsClient.create( + timelineSavedObjectType, + migratedAttributes, + { + references, + } + ); + + const repopulatedSavedObject = timelineFieldsMigrator.populateFieldsFromReferences( + createdTimeline + ); + + // Create new timeline + const newTimeline = convertSavedObjectToSavedTimeline(repopulatedSavedObject); + return { + code: 200, + message: 'success', + timeline: newTimeline, + }; +}; + +const updateTimeline = async ({ + request, + timelineId, + timeline, + savedObjectsClient, + userInfo, + version, +}: { + request: FrameworkRequest; + timelineId: string; + timeline: SavedTimeline; + savedObjectsClient: SavedObjectsClientContract; + userInfo: AuthenticatedUser | null; + version: string | null; +}) => { + const rawTimelineSavedObject = await savedObjectsClient.get( + timelineSavedObjectType, + timelineId + ); + + const { + transformedFields: migratedPatchAttributes, + references, + } = timelineFieldsMigrator.extractFieldsToReferences({ + data: pickSavedTimeline(timelineId, timeline, userInfo), + existingReferences: rawTimelineSavedObject.references, + }); + + // Update Timeline + await savedObjectsClient.update(timelineSavedObjectType, timelineId, migratedPatchAttributes, { + version: version || undefined, + references, + }); + + return { + code: 200, + message: 'success', + timeline: await getSavedTimeline(request, timelineId), + }; +}; + const updatePartialSavedTimeline = async ( request: FrameworkRequest, timelineId: string, @@ -449,18 +517,38 @@ const updatePartialSavedTimeline = async ( timelineId ); - return savedObjectsClient.update( + const { + transformedFields, + references, + } = timelineFieldsMigrator.extractFieldsToReferences({ + data: timeline, + existingReferences: currentSavedTimeline.references, + }); + + const timelineUpdateAttributes = pickSavedTimeline( + null, + { + ...transformedFields, + dateRange: currentSavedTimeline.attributes.dateRange, + }, + request.user + ); + + const updatedTimeline = await savedObjectsClient.update( timelineSavedObjectType, timelineId, - pickSavedTimeline( - null, - { - ...timeline, - dateRange: currentSavedTimeline.attributes.dateRange, - }, - request.user - ) + timelineUpdateAttributes, + { references } ); + + const populatedTimeline = timelineFieldsMigrator.populateFieldsFromReferencesForPatch( + { + dataBeforeRequest: timelineUpdateAttributes, + dataReturnedFromRequest: updatedTimeline, + } + ); + + return populatedTimeline; }; export const resetTimeline = async ( @@ -506,17 +594,21 @@ export const deleteTimeline = async (request: FrameworkRequest, timelineIds: str const getBasicSavedTimeline = async (request: FrameworkRequest, timelineId: string) => { const savedObjectsClient = request.context.core.savedObjects.client; - const savedObject = await savedObjectsClient.get(timelineSavedObjectType, timelineId); + const savedObject = await savedObjectsClient.get( + timelineSavedObjectType, + timelineId + ); + + const populatedTimeline = timelineFieldsMigrator.populateFieldsFromReferences(savedObject); - return convertSavedObjectToSavedTimeline(savedObject); + return convertSavedObjectToSavedTimeline(populatedTimeline); }; const getSavedTimeline = async (request: FrameworkRequest, timelineId: string) => { const userName = request.user?.username ?? UNAUTHENTICATED_USER; - const savedObjectsClient = request.context.core.savedObjects.client; - const savedObject = await savedObjectsClient.get(timelineSavedObjectType, timelineId); - const timelineSaveObject = convertSavedObjectToSavedTimeline(savedObject); + const timelineSaveObject = await getBasicSavedTimeline(request, timelineId); + const timelineWithNotesAndPinnedEvents = await Promise.all([ note.getNotesByTimelineId(request, timelineSaveObject.savedObjectId), pinnedEvent.getAllPinnedEventsByTimelineId(request, timelineSaveObject.savedObjectId), @@ -537,14 +629,18 @@ const getAllSavedTimeline = async (request: FrameworkRequest, options: SavedObje }`; } - const savedObjects = await savedObjectsClient.find(options); + const savedObjects = await savedObjectsClient.find(options); + const timelinesWithNotesAndPinnedEvents = await Promise.all( savedObjects.saved_objects.map(async (savedObject) => { - const timelineSaveObject = convertSavedObjectToSavedTimeline(savedObject); + const migratedSO = timelineFieldsMigrator.populateFieldsFromReferences(savedObject); + + const timelineSaveObject = convertSavedObjectToSavedTimeline(migratedSO); + return Promise.all([ note.getNotesByTimelineId(request, timelineSaveObject.savedObjectId), pinnedEvent.getAllPinnedEventsByTimelineId(request, timelineSaveObject.savedObjectId), - Promise.resolve(timelineSaveObject), + timelineSaveObject, ]); }) ); @@ -606,7 +702,7 @@ export const getSelectedTimelines = async ( } const savedObjects = await Promise.resolve( - savedObjectsClient.bulkGet( + savedObjectsClient.bulkGet( exportedIds?.reduce( (acc, timelineId) => [...acc, { id: timelineId, type: timelineSavedObjectType }], [] as Array<{ id: string; type: string }> @@ -619,12 +715,16 @@ export const getSelectedTimelines = async ( errors: ExportTimelineNotFoundError[]; } = savedObjects.saved_objects.reduce( (acc, savedObject) => { - return savedObject.error == null - ? { - errors: acc.errors, - timelines: [...acc.timelines, convertSavedObjectToSavedTimeline(savedObject)], - } - : { errors: [...acc.errors, savedObject.error], timelines: acc.timelines }; + if (savedObject.error == null) { + const populatedTimeline = timelineFieldsMigrator.populateFieldsFromReferences(savedObject); + + return { + errors: acc.errors, + timelines: [...acc.timelines, convertSavedObjectToSavedTimeline(populatedTimeline)], + }; + } + + return { errors: [...acc.errors, savedObject.error], timelines: acc.timelines }; }, { timelines: [] as TimelineSavedObject[], diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/pick_saved_timeline.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/pick_saved_timeline.ts index 3e00a33966f17..25a4c98f90ee6 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/pick_saved_timeline.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/pick_saved_timeline.ts @@ -8,13 +8,17 @@ import { isEmpty } from 'lodash/fp'; import { AuthenticatedUser } from '../../../../../../security/common/model'; import { UNAUTHENTICATED_USER } from '../../../../../common/constants'; -import { SavedTimeline, TimelineType, TimelineStatus } from '../../../../../common/types/timeline'; +import { + TimelineType, + TimelineStatus, + SavedTimelineWithSavedObjectId, +} from '../../../../../common/types/timeline'; export const pickSavedTimeline = ( timelineId: string | null, - savedTimeline: SavedTimeline & { savedObjectId?: string | null }, + savedTimeline: SavedTimelineWithSavedObjectId, userInfo: AuthenticatedUser | null -): SavedTimeline & { savedObjectId?: string | null } => { +): SavedTimelineWithSavedObjectId => { const dateNow = new Date().valueOf(); if (timelineId == null) { diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/index.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/index.ts new file mode 100644 index 0000000000000..e4c8858321e14 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { timelinesMigrations } from './timelines'; +export { notesMigrations } from './notes'; diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/notes.test.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/notes.test.ts new file mode 100644 index 0000000000000..0aa847cac34cd --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/notes.test.ts @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { TIMELINE_ID_REF_NAME } from '../../constants'; +import { migrateNoteTimelineIdToReferences, TimelineId } from './notes'; + +describe('notes migrations', () => { + describe('7.16.0 timelineId', () => { + it('removes the timelineId from the migrated document', () => { + const migratedDoc = migrateNoteTimelineIdToReferences({ + id: '1', + type: 'awesome', + attributes: { timelineId: '123' }, + }); + + expect(migratedDoc.attributes).toEqual({}); + expect(migratedDoc.references).toEqual([ + // importing the timeline saved object type from the timeline saved object causes a circular import and causes the jest tests to fail + { id: '123', name: TIMELINE_ID_REF_NAME, type: 'siem-ui-timeline' }, + ]); + }); + + it('preserves additional fields when migrating timeline id', () => { + const migratedDoc = migrateNoteTimelineIdToReferences({ + id: '1', + type: 'awesome', + attributes: ({ awesome: 'yes', timelineId: '123' } as unknown) as TimelineId, + }); + + expect(migratedDoc.attributes).toEqual({ awesome: 'yes' }); + expect(migratedDoc.references).toEqual([ + { id: '123', name: TIMELINE_ID_REF_NAME, type: 'siem-ui-timeline' }, + ]); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/notes.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/notes.ts new file mode 100644 index 0000000000000..a8d753e916afb --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/notes.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 { + SavedObjectMigrationMap, + SavedObjectSanitizedDoc, + SavedObjectUnsanitizedDoc, +} from 'kibana/server'; +import { timelineSavedObjectType } from '..'; +import { TIMELINE_ID_REF_NAME } from '../../constants'; +import { createMigratedDoc, createReference } from './utils'; + +export interface TimelineId { + timelineId?: string | null; +} + +export const migrateNoteTimelineIdToReferences = ( + doc: SavedObjectUnsanitizedDoc +): SavedObjectSanitizedDoc => { + const { timelineId, ...restAttributes } = doc.attributes; + + const { references: docReferences = [] } = doc; + const timelineIdReferences = createReference( + timelineId, + TIMELINE_ID_REF_NAME, + timelineSavedObjectType + ); + + return createMigratedDoc({ + doc, + attributes: restAttributes, + docReferences, + migratedReferences: timelineIdReferences, + }); +}; + +export const notesMigrations: SavedObjectMigrationMap = { + '7.16.0': migrateNoteTimelineIdToReferences, +}; diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/timelines.test.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/timelines.test.ts new file mode 100644 index 0000000000000..b74b1b37ad151 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/timelines.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 { SAVED_QUERY_ID_REF_NAME, SAVED_QUERY_TYPE } from '../../constants'; +import { migrateSavedQueryIdToReferences, SavedQueryId } from './timelines'; + +describe('timeline migrations', () => { + describe('7.16.0 savedQueryId', () => { + it('removes the savedQueryId from the migrated document', () => { + const migratedDoc = migrateSavedQueryIdToReferences({ + id: '1', + type: 'awesome', + attributes: { savedQueryId: '123' }, + }); + + expect(migratedDoc.attributes).toEqual({}); + expect(migratedDoc.references).toEqual([ + { id: '123', name: SAVED_QUERY_ID_REF_NAME, type: SAVED_QUERY_TYPE }, + ]); + }); + + it('preserves additional fields when migrating saved query id', () => { + const migratedDoc = migrateSavedQueryIdToReferences({ + id: '1', + type: 'awesome', + attributes: ({ awesome: 'yes', savedQueryId: '123' } as unknown) as SavedQueryId, + }); + + expect(migratedDoc.attributes).toEqual({ awesome: 'yes' }); + expect(migratedDoc.references).toEqual([ + { id: '123', name: SAVED_QUERY_ID_REF_NAME, type: SAVED_QUERY_TYPE }, + ]); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/timelines.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/timelines.ts new file mode 100644 index 0000000000000..45733d7737b62 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/timelines.ts @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + SavedObjectMigrationMap, + SavedObjectSanitizedDoc, + SavedObjectUnsanitizedDoc, +} from 'kibana/server'; +import { SAVED_QUERY_ID_REF_NAME, SAVED_QUERY_TYPE } from '../../constants'; +import { createMigratedDoc, createReference } from './utils'; + +export interface SavedQueryId { + savedQueryId?: string | null; +} + +export const migrateSavedQueryIdToReferences = ( + doc: SavedObjectUnsanitizedDoc +): SavedObjectSanitizedDoc => { + const { savedQueryId, ...restAttributes } = doc.attributes; + + const { references: docReferences = [] } = doc; + const savedQueryIdReferences = createReference( + savedQueryId, + SAVED_QUERY_ID_REF_NAME, + SAVED_QUERY_TYPE + ); + + return createMigratedDoc({ + doc, + attributes: restAttributes, + docReferences, + migratedReferences: savedQueryIdReferences, + }); +}; + +export const timelinesMigrations: SavedObjectMigrationMap = { + '7.16.0': migrateSavedQueryIdToReferences, +}; diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/utils.test.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/utils.test.ts new file mode 100644 index 0000000000000..02e3fca996d5d --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/utils.test.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 { createMigratedDoc, createReference } from './utils'; + +describe('migration utils', () => { + describe('createReference', () => { + it('returns an array with a reference when the id is defined', () => { + expect(createReference('awesome', 'name', 'type')).toEqual([ + { id: 'awesome', name: 'name', type: 'type' }, + ]); + }); + + it('returns an empty array when the id is undefined', () => { + expect(createReference(undefined, 'name', 'type')).toHaveLength(0); + }); + + it('returns an empty array when the id is null', () => { + expect(createReference(null, 'name', 'type')).toHaveLength(0); + }); + }); + + describe('createMigratedDoc', () => { + it('overwrites the attributes of the original doc', () => { + const doc = { + id: '1', + attributes: { + hello: '1', + }, + type: 'yes', + }; + + expect( + createMigratedDoc({ doc, attributes: {}, docReferences: [], migratedReferences: [] }) + ).toEqual({ + id: '1', + attributes: {}, + type: 'yes', + references: [], + }); + }); + + it('combines the references', () => { + const doc = { + id: '1', + attributes: { + hello: '1', + }, + type: 'yes', + }; + + expect( + createMigratedDoc({ + doc, + attributes: {}, + docReferences: [{ id: '1', name: 'name', type: 'type' }], + migratedReferences: [{ id: '5', name: 'name5', type: 'type5' }], + }) + ).toEqual({ + id: '1', + attributes: {}, + type: 'yes', + references: [ + { id: '1', name: 'name', type: 'type' }, + { id: '5', name: 'name5', type: 'type5' }, + ], + }); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/utils.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/utils.ts new file mode 100644 index 0000000000000..ff9b56e6ae2c9 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/utils.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 { + SavedObjectReference, + SavedObjectSanitizedDoc, + SavedObjectUnsanitizedDoc, +} from 'kibana/server'; + +export function createReference( + id: string | null | undefined, + name: string, + type: string +): SavedObjectReference[] { + return id != null ? [{ id, name, type }] : []; +} + +export const createMigratedDoc = ({ + doc, + attributes, + docReferences, + migratedReferences, +}: { + doc: SavedObjectUnsanitizedDoc; + attributes: object; + docReferences: SavedObjectReference[]; + migratedReferences: SavedObjectReference[]; +}): SavedObjectSanitizedDoc => ({ + ...doc, + attributes: { + ...attributes, + }, + references: [...docReferences, ...migratedReferences], +}); diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts index 5815747d3e720..387f78e5059f4 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts @@ -6,14 +6,12 @@ */ import { SavedObjectsType } from '../../../../../../../src/core/server'; +import { notesMigrations } from './migrations'; export const noteSavedObjectType = 'siem-ui-timeline-note'; export const noteSavedObjectMappings: SavedObjectsType['mappings'] = { properties: { - timelineId: { - type: 'keyword', - }, eventId: { type: 'keyword', }, @@ -40,4 +38,5 @@ export const noteType: SavedObjectsType = { hidden: false, namespaceType: 'single', mappings: noteSavedObjectMappings, + migrations: notesMigrations, }; diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts index a2de616e68c79..8300f72a162ed 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts @@ -6,6 +6,7 @@ */ import { SavedObjectsType } from '../../../../../../../src/core/server'; +import { timelinesMigrations } from './migrations'; export const timelineSavedObjectType = 'siem-ui-timeline'; @@ -282,9 +283,6 @@ export const timelineSavedObjectMappings: SavedObjectsType['mappings'] = { }, }, }, - savedQueryId: { - type: 'keyword', - }, sort: { dynamic: false, properties: { @@ -322,4 +320,5 @@ export const timelineType: SavedObjectsType = { hidden: false, namespaceType: 'single', mappings: timelineSavedObjectMappings, + migrations: timelinesMigrations, }; diff --git a/x-pack/plugins/security_solution/server/lib/timeline/utils/migrator.test.ts b/x-pack/plugins/security_solution/server/lib/timeline/utils/migrator.test.ts new file mode 100644 index 0000000000000..58379a2af0b71 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/timeline/utils/migrator.test.ts @@ -0,0 +1,364 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { SavedObject, SavedObjectReference } from 'kibana/server'; +import { FieldMigrator } from './migrator'; + +describe('FieldMigrator', () => { + describe('extractFieldsToReferences', () => { + it('migrates the hello field to references and removes it from the transformed result', () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + const result = migrator.extractFieldsToReferences({ data: { hello: '1', awesome: '2' } }); + + expect(result.transformedFields).toEqual({ + awesome: '2', + }); + + expect(result.references).toEqual([{ id: '1', name: 'name', type: 'type' }]); + }); + + it('ignores a field that does not exist and returns an empty references result', () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + const result = migrator.extractFieldsToReferences({ data: { awesome: '2' } }); + + expect(result.transformedFields).toEqual({ + awesome: '2', + }); + + expect(result.references).toEqual([]); + }); + + it('ignores a field that does not exist and preserves the original references', () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + const result = migrator.extractFieldsToReferences({ + data: { awesome: '2' }, + existingReferences: [{ id: '1', name: 'awesome', type: 'someType' }], + }); + + expect(result.transformedFields).toEqual({ + awesome: '2', + }); + + expect(result.references).toEqual([{ id: '1', name: 'awesome', type: 'someType' }]); + }); + + it('migrates multiple fields', () => { + const migrator = new FieldMigrator([ + { path: 'hello', type: 'type', name: 'name' }, + { path: 'a', type: 'aType', name: 'aName' }, + ]); + + const result = migrator.extractFieldsToReferences({ + data: { hello: '1', awesome: '2', a: 'aId' }, + }); + + expect(result.transformedFields).toEqual({ + awesome: '2', + }); + + expect(result.references).toEqual([ + { id: '1', name: 'name', type: 'type' }, + { id: 'aId', name: 'aName', type: 'aType' }, + ]); + }); + + it('migrates a nested field', () => { + const migrator = new FieldMigrator([{ path: 'a.hello', type: 'type', name: 'name' }]); + + const result = migrator.extractFieldsToReferences({ + data: { + outerHello: '1', + awesome: '2', + a: { hello: '1' }, + }, + }); + + expect(result.transformedFields).toEqual({ + outerHello: '1', + awesome: '2', + a: {}, + }); + + expect(result.references).toEqual([{ id: '1', name: 'name', type: 'type' }]); + }); + + it('removes a field set to undefined and excludes it from the references', () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + const result = migrator.extractFieldsToReferences({ + data: { + awesome: '2', + hello: undefined, + }, + }); + + expect(result.transformedFields).toEqual({ + awesome: '2', + }); + + expect(result.references).toEqual([]); + }); + + it("preserves the reference for a field when it isn't in the object", () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + const result = migrator.extractFieldsToReferences({ + data: { + awesome: '2', + }, + existingReferences: [{ id: '1', name: 'name', type: 'type' }], + }); + + expect(result.transformedFields).toEqual({ + awesome: '2', + }); + + expect(result.references).toEqual([{ id: '1', name: 'name', type: 'type' }]); + }); + + it('removes reference when field is set to null', () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + const result = migrator.extractFieldsToReferences({ + data: { + hello: null, + }, + existingReferences: [{ id: '2', name: 'name', type: 'type' }], + }); + + expect(result.references).toEqual([]); + }); + + it('removes reference when field is set to undefined', () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + const result = migrator.extractFieldsToReferences({ + data: { + hello: undefined, + }, + existingReferences: [{ id: '2', name: 'name', type: 'type' }], + }); + + expect(result.references).toEqual([]); + }); + }); + + describe('populateFieldsFromReferencesForPatch', () => { + it('sets the hello field from references', () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + expect( + migrator.populateFieldsFromReferencesForPatch({ + dataBeforeRequest: { hello: '1' }, + dataReturnedFromRequest: asSavedObject({ + references: [{ id: '1', name: 'name', type: 'type' }], + }), + }) + ).toEqual({ + attributes: { + hello: '1', + }, + references: [{ id: '1', name: 'name', type: 'type' }], + }); + }); + + it('sets the hello field to null when it was null before request', () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + expect( + migrator.populateFieldsFromReferencesForPatch({ + dataReturnedFromRequest: asSavedObject(), + dataBeforeRequest: { hello: null }, + }) + ).toEqual({ + attributes: { + hello: null, + }, + }); + }); + + it('sets the hello field to undefined when it was undefined before request', () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + expect( + migrator.populateFieldsFromReferencesForPatch({ + dataReturnedFromRequest: asSavedObject(), + dataBeforeRequest: { hello: undefined }, + }) + ).toEqual({ attributes: {} }); + }); + + it('sets the hello field to 1 when it exists in references', () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + expect( + migrator.populateFieldsFromReferencesForPatch({ + dataReturnedFromRequest: asSavedObject({ + data: { + awesome: '5', + }, + references: [{ id: '1', name: 'name', type: 'type' }], + }), + dataBeforeRequest: { + awesome: '5', + hello: '1', + }, + }) + ).toEqual({ + attributes: { + awesome: '5', + hello: '1', + }, + references: [{ id: '1', name: 'name', type: 'type' }], + }); + }); + + it('sets the hello field to 1 when it exists in the data before the request but not the references', () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + expect( + migrator.populateFieldsFromReferencesForPatch({ + dataReturnedFromRequest: asSavedObject({ data: { awesome: '5' }, references: [] }), + dataBeforeRequest: { awesome: '5', hello: '1' }, + }) + ).toEqual({ + attributes: { + awesome: '5', + hello: '1', + }, + references: [], + }); + }); + + it('sets the hello field to 1 when it exists in the data before the request and when references is undefined', () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + expect( + migrator.populateFieldsFromReferencesForPatch({ + dataReturnedFromRequest: asSavedObject({ data: { awesome: '5' } }), + dataBeforeRequest: { awesome: '5', hello: '1' }, + }) + ).toEqual({ + attributes: { + awesome: '5', + hello: '1', + }, + }); + }); + + it('does not set hello field when it is not in the data before the request even when it is in the references', () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + expect( + migrator.populateFieldsFromReferencesForPatch({ + dataReturnedFromRequest: asSavedObject({ + data: { awesome: '5' }, + references: [{ id: '1', name: 'name', type: 'type' }], + }), + dataBeforeRequest: { + awesome: '5', + }, + }) + ).toEqual({ + attributes: { + awesome: '5', + }, + references: [{ id: '1', name: 'name', type: 'type' }], + }); + }); + }); + + describe('populateFieldsFromReferences', () => { + it('sets hello to 1 when it is in the references', () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + expect( + migrator.populateFieldsFromReferences( + asSavedObject({ + references: [{ id: '1', name: 'name', type: 'type' }], + }) + ) + ).toEqual({ + attributes: { + hello: '1', + }, + references: [{ id: '1', name: 'name', type: 'type' }], + }); + }); + + it('sets hello to 1 when it is in the references and preserves existing values', () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + expect( + migrator.populateFieldsFromReferences( + asSavedObject({ + data: { bananas: 'awesome' }, + references: [{ id: '1', name: 'name', type: 'type' }], + }) + ) + ).toEqual({ + attributes: { + bananas: 'awesome', + hello: '1', + }, + references: [{ id: '1', name: 'name', type: 'type' }], + }); + }); + + it('sets hello to null when it is not in the references', () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + expect(migrator.populateFieldsFromReferences(asSavedObject())).toEqual({ + attributes: { + hello: null, + }, + }); + }); + + it('sets hello to null when references is undefined', () => { + const migrator = new FieldMigrator([{ path: 'hello', type: 'type', name: 'name' }]); + + expect(migrator.populateFieldsFromReferences(asSavedObject())).toEqual({ + attributes: { + hello: null, + }, + }); + }); + + it('sets hello to null and hi to null when it is not in the references', () => { + const migrator = new FieldMigrator([ + { path: 'hello', type: 'type', name: 'name' }, + { path: 'hi', type: 'hiType', name: 'hiName' }, + ]); + + expect(migrator.populateFieldsFromReferences(asSavedObject())).toEqual({ + attributes: { + hello: null, + hi: null, + }, + }); + }); + }); +}); + +function asSavedObject({ + data, + references, +}: { + data?: object; + references?: SavedObjectReference[]; +} = {}): SavedObject { + return { + attributes: { + ...data, + }, + references, + } as SavedObject; +} diff --git a/x-pack/plugins/security_solution/server/lib/timeline/utils/migrator.ts b/x-pack/plugins/security_solution/server/lib/timeline/utils/migrator.ts new file mode 100644 index 0000000000000..0392a3e5c7e3f --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/timeline/utils/migrator.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 { set } from '@elastic/safer-lodash-set'; +import _ from 'lodash'; +import { SavedObject, SavedObjectReference, SavedObjectsUpdateResponse } from 'kibana/server'; + +interface Field { + path: string; + type: string; + name: string; +} + +/** + * This class handles remove fields from an object and moving them into the saved object reference fields. It also + * handles going the opposite direction to add fields back into an object by setting them to null or if a reference is + * found setting them to the value defined in the reference. + * + * This population of the field is to avoid having to change the UI to look in the references field of saved objects + * to find these values. + */ +export class FieldMigrator { + constructor(private readonly fieldsToMigrate: Field[]) {} + + public extractFieldsToReferences({ + data, + existingReferences = [], + }: { + data: unknown; + existingReferences?: SavedObjectReference[]; + }): { transformedFields: T; references: SavedObjectReference[] } { + const copyOfData = _.cloneDeep(data); + + const references = createReferenceMap(existingReferences); + + for (const field of this.fieldsToMigrate) { + const fieldValue = _.get(copyOfData, field.path); + + // the field is null, or if it is undefined and the path exists (undefined is the default return of _.get which is + // why we need to distinguish if it is a valid path) + if (fieldValue === null || (fieldValue === undefined && _.has(copyOfData, field.path))) { + references.delete(field.name); + } else if (fieldValue !== undefined) { + references.set(field.name, { id: fieldValue, name: field.name, type: field.type }); + } + + // this will do nothing if the field wasn't present + _.unset(copyOfData, field.path); + } + + return { transformedFields: copyOfData as T, references: Array.from(references.values()) }; + } + + public populateFieldsFromReferences(data: SavedObject): object { + const dataToManipulate = _.cloneDeep(data); + + const references = createReferenceMap(data.references); + + for (const field of this.fieldsToMigrate) { + const reference = references.get(field.name); + + if (reference) { + set(dataToManipulate.attributes, field.path, reference.id); + } else { + set(dataToManipulate.attributes, field.path, null); + } + } + + return dataToManipulate; + } + + public populateFieldsFromReferencesForPatch({ + dataBeforeRequest, + dataReturnedFromRequest, + }: { + dataBeforeRequest: object; + dataReturnedFromRequest: SavedObjectsUpdateResponse; + }): object { + const dataToManipulate = _.cloneDeep(dataReturnedFromRequest); + + const references = createReferenceMap(dataReturnedFromRequest.references); + + for (const field of this.fieldsToMigrate) { + const reference = references.get(field.name); + + const fieldValueBeforeRequest = _.get(dataBeforeRequest, field.path); + if (fieldValueBeforeRequest !== undefined) { + if (reference) { + set(dataToManipulate.attributes, field.path, reference.id); + } else { + // set path to fieldValueBeforeRequest + set(dataToManipulate.attributes, field.path, fieldValueBeforeRequest); + } + } + } + + return dataToManipulate; + } +} + +function createReferenceMap( + references: SavedObjectReference[] = [] +): Map { + return new Map(references.map((ref) => [ref.name, ref])); +} diff --git a/x-pack/plugins/security_solution/server/plugin.ts b/x-pack/plugins/security_solution/server/plugin.ts index d657d7e06b1a6..14da8ca650960 100644 --- a/x-pack/plugins/security_solution/server/plugin.ts +++ b/x-pack/plugins/security_solution/server/plugin.ts @@ -48,8 +48,13 @@ import { SpacesPluginSetup as SpacesSetup } from '../../spaces/server'; import { ILicense, LicensingPluginStart } from '../../licensing/server'; import { FleetStartContract } from '../../fleet/server'; import { TaskManagerSetupContract, TaskManagerStartContract } from '../../task_manager/server'; -import { createQueryAlertType } from './lib/detection_engine/rule_types'; -import { createMlAlertType } from './lib/detection_engine/rule_types/ml/create_ml_alert_type'; +import { + createEqlAlertType, + createIndicatorMatchAlertType, + createMlAlertType, + createQueryAlertType, + createThresholdAlertType, +} from './lib/detection_engine/rule_types'; import { initRoutes } from './routes'; import { isAlertExecutor } from './lib/detection_engine/signals/types'; import { signalRulesAlertType } from './lib/detection_engine/signals/signal_rule_alert_type'; @@ -63,10 +68,11 @@ import { SERVER_APP_ID, SIGNALS_ID, NOTIFICATIONS_ID, - QUERY_ALERT_TYPE_ID, + QUERY_RULE_TYPE_ID, DEFAULT_SPACE_ID, - INDICATOR_ALERT_TYPE_ID, - ML_ALERT_TYPE_ID, + INDICATOR_RULE_TYPE_ID, + ML_RULE_TYPE_ID, + EQL_RULE_TYPE_ID, } from '../common/constants'; import { registerEndpointRoutes } from './endpoint/routes/metadata'; import { registerLimitedConcurrencyRoutes } from './endpoint/routes/limited_concurrency'; @@ -96,7 +102,6 @@ import { rulesFieldMap } from './lib/detection_engine/rule_types/field_maps/rule import { RuleExecutionLogClient } from './lib/detection_engine/rule_execution_log/rule_execution_log_client'; import { getKibanaPrivilegesFeaturePrivileges } from './features'; import { EndpointMetadataService } from './endpoint/services/metadata'; -import { createIndicatorMatchAlertType } from './lib/detection_engine/rule_types/indicator_match/create_indicator_match_alert_type'; import { CreateRuleOptions } from './lib/detection_engine/rule_types/types'; import { ctiFieldMap } from './lib/detection_engine/rule_types/field_maps/cti'; @@ -252,15 +257,18 @@ export class Plugin implements IPlugin { // Detection Engine Rule routes that have the REST endpoints of /api/detection_engine/rules // All REST rule creation, deletion, updating, etc...... - createRulesRoute(router, ml, ruleDataClient); - readRulesRoute(router, ruleDataClient); - updateRulesRoute(router, ml, ruleDataClient); - patchRulesRoute(router, ml, ruleDataClient); - deleteRulesRoute(router, ruleDataClient); - findRulesRoute(router, ruleDataClient); - - // TODO: pass ruleDataClient to all relevant routes - - addPrepackedRulesRoute(router, config, security); - getPrepackagedRulesStatusRoute(router, config, security); - createRulesBulkRoute(router, ml); - updateRulesBulkRoute(router, ml); - patchRulesBulkRoute(router, ml); - deleteRulesBulkRoute(router); - performBulkActionRoute(router, ml); + createRulesRoute(router, ml, isRuleRegistryEnabled); + readRulesRoute(router, isRuleRegistryEnabled); + updateRulesRoute(router, ml, isRuleRegistryEnabled); + patchRulesRoute(router, ml, isRuleRegistryEnabled); + deleteRulesRoute(router, isRuleRegistryEnabled); + findRulesRoute(router, isRuleRegistryEnabled); + + // TODO: pass isRuleRegistryEnabled to all relevant routes + + addPrepackedRulesRoute(router, config, security, isRuleRegistryEnabled); + getPrepackagedRulesStatusRoute(router, config, security, isRuleRegistryEnabled); + createRulesBulkRoute(router, ml, isRuleRegistryEnabled); + updateRulesBulkRoute(router, ml, isRuleRegistryEnabled); + patchRulesBulkRoute(router, ml, isRuleRegistryEnabled); + deleteRulesBulkRoute(router, isRuleRegistryEnabled); + performBulkActionRoute(router, ml, isRuleRegistryEnabled); createTimelinesRoute(router, config, security); patchTimelinesRoute(router, config, security); - importRulesRoute(router, config, ml); - exportRulesRoute(router, config); + importRulesRoute(router, config, ml, isRuleRegistryEnabled); + exportRulesRoute(router, config, isRuleRegistryEnabled); importTimelinesRoute(router, config, security); exportTimelinesRoute(router, config, security); @@ -123,7 +123,7 @@ export const initRoutes = ( deleteIndexRoute(router); // Detection Engine tags routes that have the REST endpoints of /api/detection_engine/tags - readTagsRoute(router); + readTagsRoute(router, isRuleRegistryEnabled); // Privileges API to get the generic user privileges readPrivilegesRoute(router, hasEncryptionKey); diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/alerts/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/alerts/index.ts index 2fc2c42be617f..b97b8ed4f6549 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/alerts/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/alerts/index.ts @@ -5,10 +5,11 @@ * 2.0. */ +import { MatrixHistogramTypeToAggName } from '../../../../../../common'; import { buildAlertsHistogramQuery } from './query.alerts_histogram.dsl'; export const alertsMatrixHistogramConfig = { buildDsl: buildAlertsHistogramQuery, - aggName: 'aggregations.alertsGroup.buckets', + aggName: MatrixHistogramTypeToAggName.alerts, parseKey: 'alerts.buckets', }; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/anomalies/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/anomalies/index.ts index 396d1e8bd004b..ec307173ec20c 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/anomalies/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/anomalies/index.ts @@ -5,10 +5,11 @@ * 2.0. */ +import { MatrixHistogramTypeToAggName } from '../../../../../../common'; import { buildAnomaliesHistogramQuery } from './query.anomalies_histogram.dsl'; export const anomaliesMatrixHistogramConfig = { buildDsl: buildAnomaliesHistogramQuery, - aggName: 'aggregations.anomalyActionGroup.buckets', + aggName: MatrixHistogramTypeToAggName.anomalies, parseKey: 'anomalies.buckets', }; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/authentications/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/authentications/index.ts index c147b32be2c00..17f7d78167232 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/authentications/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/authentications/index.ts @@ -5,19 +5,20 @@ * 2.0. */ +import { MatrixHistogramTypeToAggName } from '../../../../../../common'; import { getEntitiesParser } from '../helpers'; import { buildAuthenticationsHistogramQuery } from './query.authentications_histogram.dsl'; import { buildAuthenticationsHistogramQueryEntities } from './query.authentications_histogram_entities.dsl'; export const authenticationsMatrixHistogramConfig = { buildDsl: buildAuthenticationsHistogramQuery, - aggName: 'aggregations.eventActionGroup.buckets', + aggName: MatrixHistogramTypeToAggName.authentications, parseKey: 'events.buckets', }; export const authenticationsMatrixHistogramEntitiesConfig = { buildDsl: buildAuthenticationsHistogramQueryEntities, - aggName: 'aggregations.events.buckets', + aggName: MatrixHistogramTypeToAggName.authenticationsEntities, parseKey: 'events.buckets', parser: getEntitiesParser, }; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/dns/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/dns/index.ts index 26f07d881618a..643b3f657ef0c 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/dns/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/dns/index.ts @@ -7,10 +7,11 @@ import { buildDnsHistogramQuery } from './query.dns_histogram.dsl'; import { getDnsParsedData } from './helpers'; +import { MatrixHistogramTypeToAggName } from '../../../../../../common'; export const dnsMatrixHistogramConfig = { buildDsl: buildDnsHistogramQuery, - aggName: 'aggregations.dns_name_query_count.buckets', + aggName: MatrixHistogramTypeToAggName.dns, parseKey: 'dns_question_name.buckets', parser: getDnsParsedData, }; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/events/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/events/index.ts index 0edfbe7df001b..a280950c37cd6 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/events/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram/events/index.ts @@ -5,10 +5,11 @@ * 2.0. */ +import { MatrixHistogramTypeToAggName } from '../../../../../../common'; import { buildEventsHistogramQuery } from './query.events_histogram.dsl'; export const eventsMatrixHistogramConfig = { buildDsl: buildEventsHistogramQuery, - aggName: 'aggregations.eventActionGroup.buckets', + aggName: MatrixHistogramTypeToAggName.events, parseKey: 'events.buckets', }; diff --git a/x-pack/plugins/snapshot_restore/jest.config.js b/x-pack/plugins/snapshot_restore/jest.config.js index f1c9213047ad5..b7dbd6f6c5786 100644 --- a/x-pack/plugins/snapshot_restore/jest.config.js +++ b/x-pack/plugins/snapshot_restore/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/snapshot_restore'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/snapshot_restore', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/snapshot_restore/{common,public,server}/**/*.{ts,tsx}', + ], }; diff --git a/x-pack/plugins/spaces/jest.config.js b/x-pack/plugins/spaces/jest.config.js index 4629d714d6d69..791f82af86ce0 100644 --- a/x-pack/plugins/spaces/jest.config.js +++ b/x-pack/plugins/spaces/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/spaces'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/spaces', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/spaces/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts b/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts index b5c0972031a8f..06be065c28a71 100644 --- a/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts +++ b/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts @@ -138,7 +138,6 @@ export interface UsageData extends UsageStats { graph?: number; uptime?: number; savedObjectsManagement?: number; - timelion?: number; dev_tools?: number; advancedSettings?: number; infrastructure?: number; @@ -269,12 +268,6 @@ export function getSpacesUsageCollector( description: 'The number of spaces which have this feature disabled.', }, }, - timelion: { - type: 'long', - _meta: { - description: 'The number of spaces which have this feature disabled.', - }, - }, dev_tools: { type: 'long', _meta: { diff --git a/x-pack/plugins/stack_alerts/jest.config.js b/x-pack/plugins/stack_alerts/jest.config.js index 3d03438e02c09..f2f53fd9e0050 100644 --- a/x-pack/plugins/stack_alerts/jest.config.js +++ b/x-pack/plugins/stack_alerts/jest.config.js @@ -9,4 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/stack_alerts'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/stack_alerts', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/plugins/stack_alerts/{common,public,server}/**/*.{ts,tsx}', + ], }; 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/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx index 76f8eaacb8789..e1eb91af5958e 100644 --- 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/alert_types/geo_containment/query_builder/expressions/boundary_index_expression.tsx @@ -16,8 +16,8 @@ import { ES_GEO_SHAPE_TYPES, GeoContainmentAlertParams } from '../../types'; import { GeoIndexPatternSelect } from '../util_components/geo_index_pattern_select'; import { SingleFieldSelect } from '../util_components/single_field_select'; import { ExpressionWithPopover } from '../util_components/expression_with_popover'; -import { IFieldType } from '../../../../../../../../src/plugins/data/common/index_patterns/fields'; -import { IIndexPattern } from '../../../../../../../../src/plugins/data/common/index_patterns'; +import { IFieldType } from '../../../../../../../../src/plugins/data/common'; +import { IIndexPattern } from '../../../../../../../../src/plugins/data/common'; interface Props { alertParams: GeoContainmentAlertParams; 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/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx index a194bd40d9931..333dd69ce50f5 100644 --- 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/alert_types/geo_containment/query_builder/expressions/entity_by_expression.tsx @@ -12,7 +12,7 @@ import _ from 'lodash'; import { IErrorObject } from '../../../../../../triggers_actions_ui/public'; import { SingleFieldSelect } from '../util_components/single_field_select'; import { ExpressionWithPopover } from '../util_components/expression_with_popover'; -import { IFieldType } from '../../../../../../../../src/plugins/data/common/index_patterns/fields'; +import { IFieldType } from '../../../../../../../../src/plugins/data/common'; interface Props { errors: IErrorObject; 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/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx index a3ffe7a3ade0c..e2068ca1b178f 100644 --- 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/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx @@ -20,8 +20,8 @@ import { ES_GEO_FIELD_TYPES } from '../../types'; import { GeoIndexPatternSelect } from '../util_components/geo_index_pattern_select'; import { SingleFieldSelect } from '../util_components/single_field_select'; import { ExpressionWithPopover } from '../util_components/expression_with_popover'; -import { IFieldType } from '../../../../../../../../src/plugins/data/common/index_patterns/fields'; -import { IIndexPattern } from '../../../../../../../../src/plugins/data/common/index_patterns'; +import { IFieldType } from '../../../../../../../../src/plugins/data/common'; +import { IIndexPattern } from '../../../../../../../../src/plugins/data/common'; interface Props { dateField: string; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx b/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx index 25234126689b9..cdc5c12659ce6 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx +++ b/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx @@ -14,7 +14,7 @@ import { GeoContainmentAlertParams } from '../types'; import { EntityIndexExpression } from './expressions/entity_index_expression'; import { EntityByExpression } from './expressions/entity_by_expression'; import { BoundaryIndexExpression } from './expressions/boundary_index_expression'; -import { IIndexPattern } from '../../../../../../../src/plugins/data/common/index_patterns'; +import { IIndexPattern } from '../../../../../../../src/plugins/data/common'; import { esQuery, esKuery, diff --git a/x-pack/plugins/task_manager/README.md b/x-pack/plugins/task_manager/README.md index 400636824a764..350a53c660bc7 100644 --- a/x-pack/plugins/task_manager/README.md +++ b/x-pack/plugins/task_manager/README.md @@ -55,6 +55,7 @@ The task_manager can be configured via `taskManager` config options (e.g. `taskM - `monitored_stats_running_average_window`- Dictates the size of the window used to calculate the running average of various "Hot" stats. Learn More: [./MONITORING](./MONITORING.MD) - `monitored_stats_required_freshness` - Dictates the _required freshness_ of critical "Hot" stats. Learn More: [./MONITORING](./MONITORING.MD) - `monitored_task_execution_thresholds`- Dictates the threshold of failed task executions. Learn More: [./MONITORING](./MONITORING.MD) +- `unsafe.exclude_task_types` - A list of task types to exclude from running. Supports wildcard usage, such as `namespace:*`. This configuration is experimental, unsupported, and can only be used for temporary debugging purposes because it causes Kibana to behave in unexpected ways. ## Task definitions diff --git a/x-pack/plugins/task_manager/jest.config.js b/x-pack/plugins/task_manager/jest.config.js index 49293eb21153a..416709552bd37 100644 --- a/x-pack/plugins/task_manager/jest.config.js +++ b/x-pack/plugins/task_manager/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/task_manager'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/task_manager', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/task_manager/server/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/task_manager/server/config.test.ts b/x-pack/plugins/task_manager/server/config.test.ts index 14d95e3fd2226..e9701fc3e7c05 100644 --- a/x-pack/plugins/task_manager/server/config.test.ts +++ b/x-pack/plugins/task_manager/server/config.test.ts @@ -37,6 +37,9 @@ describe('config validation', () => { }, "poll_interval": 3000, "request_capacity": 1000, + "unsafe": Object { + "exclude_task_types": Array [], + }, "version_conflict_threshold": 80, } `); @@ -93,6 +96,9 @@ describe('config validation', () => { }, "poll_interval": 3000, "request_capacity": 1000, + "unsafe": Object { + "exclude_task_types": Array [], + }, "version_conflict_threshold": 80, } `); @@ -141,6 +147,9 @@ describe('config validation', () => { }, "poll_interval": 3000, "request_capacity": 1000, + "unsafe": Object { + "exclude_task_types": Array [], + }, "version_conflict_threshold": 80, } `); diff --git a/x-pack/plugins/task_manager/server/config.ts b/x-pack/plugins/task_manager/server/config.ts index 9b4f4856bf8a9..286a9feaa1b5e 100644 --- a/x-pack/plugins/task_manager/server/config.ts +++ b/x-pack/plugins/task_manager/server/config.ts @@ -128,6 +128,10 @@ export const configSchema = schema.object( max: DEFAULT_MAX_EPHEMERAL_REQUEST_CAPACITY, }), }), + /* These are not designed to be used by most users. Please use caution when changing these */ + unsafe: schema.object({ + exclude_task_types: schema.arrayOf(schema.string(), { defaultValue: [] }), + }), }, { validate: (config) => { diff --git a/x-pack/plugins/task_manager/server/ephemeral_task_lifecycle.test.ts b/x-pack/plugins/task_manager/server/ephemeral_task_lifecycle.test.ts index 5dbea8e2f4dee..558aa108c2462 100644 --- a/x-pack/plugins/task_manager/server/ephemeral_task_lifecycle.test.ts +++ b/x-pack/plugins/task_manager/server/ephemeral_task_lifecycle.test.ts @@ -68,6 +68,9 @@ describe('EphemeralTaskLifecycle', () => { enabled: true, request_capacity: 10, }, + unsafe: { + exclude_task_types: [], + }, ...config, }, elasticsearchAndSOAvailability$, diff --git a/x-pack/plugins/task_manager/server/integration_tests/managed_configuration.test.ts b/x-pack/plugins/task_manager/server/integration_tests/managed_configuration.test.ts index 496c0138cb1e5..f714fd36c2658 100644 --- a/x-pack/plugins/task_manager/server/integration_tests/managed_configuration.test.ts +++ b/x-pack/plugins/task_manager/server/integration_tests/managed_configuration.test.ts @@ -55,6 +55,9 @@ describe('managed configuration', () => { enabled: true, request_capacity: 10, }, + unsafe: { + exclude_task_types: [], + }, }); logger = context.logger.get('taskManager'); diff --git a/x-pack/plugins/task_manager/server/monitoring/configuration_statistics.test.ts b/x-pack/plugins/task_manager/server/monitoring/configuration_statistics.test.ts index e477edf3b9aed..6e88e9803add2 100644 --- a/x-pack/plugins/task_manager/server/monitoring/configuration_statistics.test.ts +++ b/x-pack/plugins/task_manager/server/monitoring/configuration_statistics.test.ts @@ -39,6 +39,9 @@ describe('Configuration Statistics Aggregator', () => { enabled: true, request_capacity: 10, }, + unsafe: { + exclude_task_types: [], + }, }; const managedConfig = { diff --git a/x-pack/plugins/task_manager/server/monitoring/monitoring_stats_stream.test.ts b/x-pack/plugins/task_manager/server/monitoring/monitoring_stats_stream.test.ts index 50d4b6af9a4cf..ec94d9df1a4dc 100644 --- a/x-pack/plugins/task_manager/server/monitoring/monitoring_stats_stream.test.ts +++ b/x-pack/plugins/task_manager/server/monitoring/monitoring_stats_stream.test.ts @@ -43,6 +43,9 @@ describe('createMonitoringStatsStream', () => { enabled: true, request_capacity: 10, }, + unsafe: { + exclude_task_types: [], + }, }; it('returns the initial config used to configure Task Manager', async () => { diff --git a/x-pack/plugins/task_manager/server/plugin.test.ts b/x-pack/plugins/task_manager/server/plugin.test.ts index dff94259dbe62..c47f006eca415 100644 --- a/x-pack/plugins/task_manager/server/plugin.test.ts +++ b/x-pack/plugins/task_manager/server/plugin.test.ts @@ -42,6 +42,9 @@ describe('TaskManagerPlugin', () => { enabled: false, request_capacity: 10, }, + unsafe: { + exclude_task_types: [], + }, }); pluginInitializerContext.env.instanceUuid = ''; @@ -82,6 +85,9 @@ describe('TaskManagerPlugin', () => { enabled: true, request_capacity: 10, }, + unsafe: { + exclude_task_types: [], + }, }); const taskManagerPlugin = new TaskManagerPlugin(pluginInitializerContext); @@ -122,6 +128,48 @@ describe('TaskManagerPlugin', () => { `"Cannot register task definitions after the task manager has started"` ); }); + + test('it logs a warning when the unsafe `exclude_task_types` config is used', async () => { + const pluginInitializerContext = coreMock.createPluginInitializerContext({ + enabled: true, + max_workers: 10, + index: 'foo', + max_attempts: 9, + poll_interval: 3000, + version_conflict_threshold: 80, + max_poll_inactivity_cycles: 10, + request_capacity: 1000, + monitored_aggregated_stats_refresh_rate: 5000, + monitored_stats_health_verbose_log: { + enabled: false, + warn_delayed_task_start_in_seconds: 60, + }, + monitored_stats_required_freshness: 5000, + monitored_stats_running_average_window: 50, + monitored_task_execution_thresholds: { + default: { + error_threshold: 90, + warn_threshold: 80, + }, + custom: {}, + }, + ephemeral_tasks: { + enabled: false, + request_capacity: 10, + }, + unsafe: { + exclude_task_types: ['*'], + }, + }); + + const logger = pluginInitializerContext.logger.get(); + const taskManagerPlugin = new TaskManagerPlugin(pluginInitializerContext); + taskManagerPlugin.setup(coreMock.createSetup(), { usageCollection: undefined }); + expect((logger.warn as jest.Mock).mock.calls.length).toBe(1); + expect((logger.warn as jest.Mock).mock.calls[0][0]).toBe( + 'Excluding task types from execution: *' + ); + }); }); describe('getElasticsearchAndSOAvailability', () => { diff --git a/x-pack/plugins/task_manager/server/plugin.ts b/x-pack/plugins/task_manager/server/plugin.ts index 35dec38b43df5..f91bb783a5c4c 100644 --- a/x-pack/plugins/task_manager/server/plugin.ts +++ b/x-pack/plugins/task_manager/server/plugin.ts @@ -117,7 +117,14 @@ export class TaskManagerPlugin usageCollection, monitoredHealth$, this.config.ephemeral_tasks.enabled, - this.config.ephemeral_tasks.request_capacity + this.config.ephemeral_tasks.request_capacity, + this.config.unsafe.exclude_task_types + ); + } + + if (this.config.unsafe.exclude_task_types.length) { + this.logger.warn( + `Excluding task types from execution: ${this.config.unsafe.exclude_task_types.join(', ')}` ); } diff --git a/x-pack/plugins/task_manager/server/polling_lifecycle.test.ts b/x-pack/plugins/task_manager/server/polling_lifecycle.test.ts index 42bccbcbaba89..b6a93b14f578b 100644 --- a/x-pack/plugins/task_manager/server/polling_lifecycle.test.ts +++ b/x-pack/plugins/task_manager/server/polling_lifecycle.test.ts @@ -64,6 +64,9 @@ describe('TaskPollingLifecycle', () => { enabled: true, request_capacity: 10, }, + unsafe: { + exclude_task_types: [], + }, }, taskStore: mockTaskStore, logger: taskManagerLogger, diff --git a/x-pack/plugins/task_manager/server/polling_lifecycle.ts b/x-pack/plugins/task_manager/server/polling_lifecycle.ts index 847e1f32e8f2a..26986fc4709f5 100644 --- a/x-pack/plugins/task_manager/server/polling_lifecycle.ts +++ b/x-pack/plugins/task_manager/server/polling_lifecycle.ts @@ -126,6 +126,7 @@ export class TaskPollingLifecycle { this.taskClaiming = new TaskClaiming({ taskStore, maxAttempts: config.max_attempts, + excludedTaskTypes: config.unsafe.exclude_task_types, definitions, logger: this.logger, getCapacity: (taskType?: string) => diff --git a/x-pack/plugins/task_manager/server/queries/task_claiming.test.ts b/x-pack/plugins/task_manager/server/queries/task_claiming.test.ts index ee185ac6ce6bb..1ddafbda71e14 100644 --- a/x-pack/plugins/task_manager/server/queries/task_claiming.test.ts +++ b/x-pack/plugins/task_manager/server/queries/task_claiming.test.ts @@ -102,6 +102,7 @@ describe('TaskClaiming', () => { new TaskClaiming({ logger: taskManagerLogger, definitions, + excludedTaskTypes: [], taskStore: taskStoreMock.create({ taskManagerId: '' }), maxAttempts: 2, getCapacity: () => 10, @@ -119,11 +120,13 @@ describe('TaskClaiming', () => { taskClaimingOpts = {}, hits = [generateFakeTasks(1)], versionConflicts = 2, + excludedTaskTypes = [], }: { storeOpts: Partial; taskClaimingOpts: Partial; hits?: ConcreteTaskInstance[][]; versionConflicts?: number; + excludedTaskTypes?: string[]; }) { const definitions = storeOpts.definitions ?? taskDefinitions; const store = taskStoreMock.create({ taskManagerId: storeOpts.taskManagerId }); @@ -151,6 +154,7 @@ describe('TaskClaiming', () => { logger: taskManagerLogger, definitions, taskStore: store, + excludedTaskTypes, maxAttempts: taskClaimingOpts.maxAttempts ?? 2, getCapacity: taskClaimingOpts.getCapacity ?? (() => 10), ...taskClaimingOpts, @@ -165,17 +169,20 @@ describe('TaskClaiming', () => { claimingOpts, hits = [generateFakeTasks(1)], versionConflicts = 2, + excludedTaskTypes = [], }: { storeOpts: Partial; taskClaimingOpts: Partial; claimingOpts: Omit; hits?: ConcreteTaskInstance[][]; versionConflicts?: number; + excludedTaskTypes?: string[]; }) { const getCapacity = taskClaimingOpts.getCapacity ?? (() => 10); const { taskClaiming, store } = initialiseTestClaiming({ storeOpts, taskClaimingOpts, + excludedTaskTypes, hits, versionConflicts, }); @@ -264,6 +271,11 @@ describe('TaskClaiming', () => { maxAttempts: customMaxAttempts, createTaskRunner: jest.fn(), }, + foobar: { + title: 'foobar', + maxAttempts: customMaxAttempts, + createTaskRunner: jest.fn(), + }, }); const [ @@ -282,6 +294,7 @@ describe('TaskClaiming', () => { claimingOpts: { claimOwnershipUntil: new Date(), }, + excludedTaskTypes: ['foobar'], }); expect(query).toMatchObject({ bool: { @@ -1241,6 +1254,7 @@ if (doc['task.runAt'].size()!=0) { const taskClaiming = new TaskClaiming({ logger: taskManagerLogger, definitions, + excludedTaskTypes: [], taskStore, maxAttempts: 2, getCapacity, diff --git a/x-pack/plugins/task_manager/server/queries/task_claiming.ts b/x-pack/plugins/task_manager/server/queries/task_claiming.ts index 20a0275d8fa07..8380b8fdedb1d 100644 --- a/x-pack/plugins/task_manager/server/queries/task_claiming.ts +++ b/x-pack/plugins/task_manager/server/queries/task_claiming.ts @@ -9,6 +9,7 @@ * This module contains helpers for managing the task manager storage layer. */ import apm from 'elastic-apm-node'; +import minimatch from 'minimatch'; import { Subject, Observable, from, of } from 'rxjs'; import { map, mergeScan } from 'rxjs/operators'; import { difference, partition, groupBy, mapValues, countBy, pick, isPlainObject } from 'lodash'; @@ -57,6 +58,7 @@ export interface TaskClaimingOpts { definitions: TaskTypeDictionary; taskStore: TaskStore; maxAttempts: number; + excludedTaskTypes: string[]; getCapacity: (taskType?: string) => number; } @@ -115,6 +117,7 @@ export class TaskClaiming { private logger: Logger; private readonly taskClaimingBatchesByType: TaskClaimingBatches; private readonly taskMaxAttempts: Record; + private readonly excludedTaskTypes: string[]; /** * Constructs a new TaskStore. @@ -130,6 +133,7 @@ export class TaskClaiming { this.logger = opts.logger; this.taskClaimingBatchesByType = this.partitionIntoClaimingBatches(this.definitions); this.taskMaxAttempts = Object.fromEntries(this.normalizeMaxAttempts(this.definitions)); + this.excludedTaskTypes = opts.excludedTaskTypes; this.events$ = new Subject(); } @@ -354,6 +358,16 @@ export class TaskClaiming { }; }; + private isTaskTypeExcluded(taskType: string) { + for (const excludedType of this.excludedTaskTypes) { + if (minimatch(taskType, excludedType)) { + return true; + } + } + + return false; + } + private async markAvailableTasksAsClaimed({ claimOwnershipUntil, claimTasksById, @@ -362,9 +376,11 @@ export class TaskClaiming { }: OwnershipClaimingOpts): Promise { const { taskTypesToSkip = [], taskTypesToClaim = [] } = groupBy( this.definitions.getAllTypes(), - (type) => (taskTypes.has(type) ? 'taskTypesToClaim' : 'taskTypesToSkip') + (type) => + taskTypes.has(type) && !this.isTaskTypeExcluded(type) + ? 'taskTypesToClaim' + : 'taskTypesToSkip' ); - const queryForScheduledTasks = mustBeAllOf( // Either a task with idle status and runAt <= now or // status running or claiming with a retryAt <= now. @@ -382,6 +398,23 @@ export class TaskClaiming { sort.unshift('_score'); } + const query = matchesClauses( + claimTasksById && claimTasksById.length + ? mustBeAllOf(asPinnedQuery(claimTasksById, queryForScheduledTasks)) + : queryForScheduledTasks, + filterDownBy(InactiveTasks) + ); + const script = updateFieldsAndMarkAsFailed( + { + ownerId: this.taskStore.taskManagerId, + retryAt: claimOwnershipUntil, + }, + claimTasksById || [], + taskTypesToClaim, + taskTypesToSkip, + pick(this.taskMaxAttempts, taskTypesToClaim) + ); + const apmTrans = apm.startTransaction( 'markAvailableTasksAsClaimed', `taskManager markAvailableTasksAsClaimed` @@ -389,22 +422,8 @@ export class TaskClaiming { try { const result = await this.taskStore.updateByQuery( { - query: matchesClauses( - claimTasksById && claimTasksById.length - ? mustBeAllOf(asPinnedQuery(claimTasksById, queryForScheduledTasks)) - : queryForScheduledTasks, - filterDownBy(InactiveTasks) - ), - script: updateFieldsAndMarkAsFailed( - { - ownerId: this.taskStore.taskManagerId, - retryAt: claimOwnershipUntil, - }, - claimTasksById || [], - taskTypesToClaim, - taskTypesToSkip, - pick(this.taskMaxAttempts, taskTypesToClaim) - ), + query, + script, sort, }, { 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 4b993a4e0629d..8e050e31b6cad 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 @@ -17,6 +17,7 @@ import { MonitoredHealth } from '../routes/health'; import { TaskPersistence } from '../task_events'; import { registerTaskManagerUsageCollector } from './task_manager_usage_collector'; import { sleep } from '../test_utils'; +import { TaskManagerUsage } from './types'; describe('registerTaskManagerUsageCollector', () => { let collector: Collector; @@ -31,25 +32,45 @@ describe('registerTaskManagerUsageCollector', () => { return createUsageCollectionSetupMock().makeUsageCollector(config); }); - registerTaskManagerUsageCollector(usageCollectionMock, monitoringStats$, true, 10); + registerTaskManagerUsageCollector(usageCollectionMock, monitoringStats$, true, 10, []); const mockHealth = getMockMonitoredHealth(); monitoringStats$.next(mockHealth); await sleep(1001); expect(usageCollectionMock.makeUsageCollector).toBeCalled(); - const telemetry = await collector.fetch(fetchContext); - expect(telemetry).toMatchObject({ - ephemeral_tasks_enabled: true, - ephemeral_request_capacity: 10, - ephemeral_stats: { - status: mockHealth.stats.ephemeral?.status, - load: mockHealth.stats.ephemeral?.value.load, - executions_per_cycle: mockHealth.stats.ephemeral?.value.executionsPerCycle, - queued_tasks: mockHealth.stats.ephemeral?.value.queuedTasks, - }, + const telemetry: TaskManagerUsage = (await collector.fetch(fetchContext)) as TaskManagerUsage; + expect(telemetry.ephemeral_tasks_enabled).toBe(true); + expect(telemetry.ephemeral_request_capacity).toBe(10); + expect(telemetry.ephemeral_stats).toMatchObject({ + status: mockHealth.stats.ephemeral?.status, + load: mockHealth.stats.ephemeral?.value.load, + executions_per_cycle: mockHealth.stats.ephemeral?.value.executionsPerCycle, + queued_tasks: mockHealth.stats.ephemeral?.value.queuedTasks, }); }); + + it('should report telemetry on the excluded task types', async () => { + const monitoringStats$ = new Subject(); + const usageCollectionMock = createUsageCollectionSetupMock(); + const fetchContext = createCollectorFetchContextWithKibanaMock(); + usageCollectionMock.makeUsageCollector.mockImplementation((config) => { + collector = new Collector(logger, config); + return createUsageCollectionSetupMock().makeUsageCollector(config); + }); + + registerTaskManagerUsageCollector(usageCollectionMock, monitoringStats$, true, 10, [ + 'actions:*', + ]); + + const mockHealth = getMockMonitoredHealth(); + monitoringStats$.next(mockHealth); + await sleep(1001); + + expect(usageCollectionMock.makeUsageCollector).toBeCalled(); + const telemetry: TaskManagerUsage = (await collector.fetch(fetchContext)) as TaskManagerUsage; + expect(telemetry.task_type_exclusion).toEqual(['actions:*']); + }); }); function getMockMonitoredHealth(overrides = {}): MonitoredHealth { 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 3eff2370ec0cb..6e9891ecd6d65 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 @@ -13,7 +13,8 @@ export function createTaskManagerUsageCollector( usageCollection: UsageCollectionSetup, monitoringStats$: Observable, ephemeralTasksEnabled: boolean, - ephemeralRequestCapacity: number + ephemeralRequestCapacity: number, + excludeTaskTypes: string[] ) { let lastMonitoredHealth: MonitoredHealth | null = null; monitoringStats$.subscribe((health) => { @@ -50,6 +51,7 @@ export function createTaskManagerUsageCollector( p99: lastMonitoredHealth?.stats.ephemeral?.value.executionsPerCycle.p99 ?? 0, }, }, + task_type_exclusion: excludeTaskTypes, }; }, schema: { @@ -76,6 +78,7 @@ export function createTaskManagerUsageCollector( p99: { type: 'long' }, }, }, + task_type_exclusion: { type: 'array', items: { type: 'keyword' } }, }, }); } @@ -84,13 +87,15 @@ export function registerTaskManagerUsageCollector( usageCollection: UsageCollectionSetup, monitoringStats$: Observable, ephemeralTasksEnabled: boolean, - ephemeralRequestCapacity: number + ephemeralRequestCapacity: number, + excludeTaskTypes: string[] ) { const collector = createTaskManagerUsageCollector( usageCollection, monitoringStats$, ephemeralTasksEnabled, - ephemeralRequestCapacity + ephemeralRequestCapacity, + excludeTaskTypes ); usageCollection.registerCollector(collector); } diff --git a/x-pack/plugins/task_manager/server/usage/types.ts b/x-pack/plugins/task_manager/server/usage/types.ts index 78e948e21d0aa..0acbfd1d4fab9 100644 --- a/x-pack/plugins/task_manager/server/usage/types.ts +++ b/x-pack/plugins/task_manager/server/usage/types.ts @@ -6,6 +6,7 @@ */ export interface TaskManagerUsage { + task_type_exclusion: string[]; ephemeral_tasks_enabled: boolean; ephemeral_request_capacity: number; ephemeral_stats: { diff --git a/x-pack/plugins/telemetry_collection_xpack/jest.config.js b/x-pack/plugins/telemetry_collection_xpack/jest.config.js index 1f8e83ab2d86e..94f0906c2149e 100644 --- a/x-pack/plugins/telemetry_collection_xpack/jest.config.js +++ b/x-pack/plugins/telemetry_collection_xpack/jest.config.js @@ -9,4 +9,8 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/telemetry_collection_xpack'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/plugins/telemetry_collection_xpack', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/telemetry_collection_xpack/server/**/*.{ts,tsx}'], }; 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 38e74e15f7ae7..0f9bc43cdf37d 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @@ -4050,6 +4050,35 @@ }, "deprecated": { "type": "long" + }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } } } }, @@ -4063,6 +4092,77 @@ }, "deprecated": { "type": "long" + }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "available": { + "type": "boolean" + }, + "total": { + "type": "long" + }, + "deprecated": { + "type": "long" + }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } } } }, @@ -4076,6 +4176,77 @@ }, "deprecated": { "type": "long" + }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } + } + } + }, + "PNGV2": { + "properties": { + "available": { + "type": "boolean" + }, + "total": { + "type": "long" + }, + "deprecated": { + "type": "long" + }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } } } }, @@ -4092,6 +4263,9 @@ }, "app": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4105,6 +4279,51 @@ }, "layout": { "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } + } + } + }, + "printable_pdf_v2": { + "properties": { + "available": { + "type": "boolean" + }, + "total": { + "type": "long" + }, + "deprecated": { + "type": "long" + }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "layout": { + "properties": { + "canvas": { + "type": "long" + }, "print": { "type": "long" }, @@ -4143,6 +4362,9 @@ "properties": { "csv": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4156,6 +4378,341 @@ }, "csv_searchsource": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "PNG": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "PNGV2": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "printable_pdf": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "printable_pdf_v2": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + } + } + }, + "completed_with_warnings": { + "properties": { + "csv": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "PNG": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "PNGV2": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "printable_pdf": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "printable_pdf_v2": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + } + } + }, + "failed": { + "properties": { + "csv": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "PNG": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "PNGV2": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "printable_pdf": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "printable_pdf_v2": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + } + } + }, + "pending": { + "properties": { + "csv": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4167,8 +4724,11 @@ } } }, - "PNG": { + "csv_searchsource": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4180,8 +4740,11 @@ } } }, - "printable_pdf": { + "csv_searchsource_immediate": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4192,13 +4755,12 @@ "type": "long" } } - } - } - }, - "completed_with_warnings": { - "properties": { - "csv": { + }, + "PNG": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4210,8 +4772,11 @@ } } }, - "csv_searchsource": { + "PNGV2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4223,8 +4788,11 @@ } } }, - "PNG": { + "printable_pdf": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4236,8 +4804,11 @@ } } }, - "printable_pdf": { + "printable_pdf_v2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4251,10 +4822,13 @@ } } }, - "failed": { + "processing": { "properties": { "csv": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4268,6 +4842,9 @@ }, "csv_searchsource": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4279,8 +4856,11 @@ } } }, - "PNG": { + "csv_searchsource_immediate": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4292,8 +4872,11 @@ } } }, - "printable_pdf": { + "PNG": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4304,13 +4887,12 @@ "type": "long" } } - } - } - }, - "pending": { - "properties": { - "csv": { + }, + "PNGV2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4322,8 +4904,11 @@ } } }, - "csv_searchsource": { + "printable_pdf": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4335,8 +4920,11 @@ } } }, - "PNG": { + "printable_pdf_v2": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4347,9 +4935,38 @@ "type": "long" } } + } + } + } + } + }, + "available": { + "type": "boolean" + }, + "browser_type": { + "type": "keyword" + }, + "enabled": { + "type": "boolean" + }, + "last7Days": { + "properties": { + "csv": { + "properties": { + "available": { + "type": "boolean" }, - "printable_pdf": { + "total": { + "type": "long" + }, + "deprecated": { + "type": "long" + }, + "app": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4360,13 +4977,38 @@ "type": "long" } } + }, + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } } } }, - "processing": { + "csv_searchsource": { "properties": { - "csv": { + "available": { + "type": "boolean" + }, + "total": { + "type": "long" + }, + "deprecated": { + "type": "long" + }, + "app": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4378,21 +5020,37 @@ } } }, - "csv_searchsource": { + "layout": { "properties": { - "canvas workpad": { + "canvas": { "type": "long" }, - "dashboard": { + "print": { "type": "long" }, - "visualization": { + "preserve_layout": { "type": "long" } } + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "available": { + "type": "boolean" }, - "PNG": { + "total": { + "type": "long" + }, + "deprecated": { + "type": "long" + }, + "app": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4404,35 +5062,22 @@ } } }, - "printable_pdf": { + "layout": { "properties": { - "canvas workpad": { + "canvas": { "type": "long" }, - "dashboard": { + "print": { "type": "long" }, - "visualization": { + "preserve_layout": { "type": "long" } } } } - } - } - }, - "available": { - "type": "boolean" - }, - "browser_type": { - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "last7Days": { - "properties": { - "csv": { + }, + "PNG": { "properties": { "available": { "type": "boolean" @@ -4442,10 +5087,39 @@ }, "deprecated": { "type": "long" + }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } } } }, - "csv_searchsource": { + "PNGV2": { "properties": { "available": { "type": "boolean" @@ -4455,10 +5129,39 @@ }, "deprecated": { "type": "long" + }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } } } }, - "PNG": { + "printable_pdf": { "properties": { "available": { "type": "boolean" @@ -4468,10 +5171,39 @@ }, "deprecated": { "type": "long" + }, + "app": { + "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "layout": { + "properties": { + "canvas": { + "type": "long" + }, + "print": { + "type": "long" + }, + "preserve_layout": { + "type": "long" + } + } } } }, - "printable_pdf": { + "printable_pdf_v2": { "properties": { "available": { "type": "boolean" @@ -4484,6 +5216,9 @@ }, "app": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4497,6 +5232,9 @@ }, "layout": { "properties": { + "canvas": { + "type": "long" + }, "print": { "type": "long" }, @@ -4535,6 +5273,25 @@ "properties": { "csv": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4546,8 +5303,11 @@ } } }, - "csv_searchsource": { + "csv_searchsource_immediate": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4561,6 +5321,25 @@ }, "PNG": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "PNGV2": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4574,6 +5353,25 @@ }, "printable_pdf": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "printable_pdf_v2": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4591,6 +5389,9 @@ "properties": { "csv": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4604,6 +5405,25 @@ }, "csv_searchsource": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4617,6 +5437,25 @@ }, "PNG": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "PNGV2": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4630,6 +5469,25 @@ }, "printable_pdf": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "printable_pdf_v2": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4647,6 +5505,9 @@ "properties": { "csv": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4660,6 +5521,25 @@ }, "csv_searchsource": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4673,6 +5553,25 @@ }, "PNG": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "PNGV2": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4686,6 +5585,25 @@ }, "printable_pdf": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "printable_pdf_v2": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4703,6 +5621,9 @@ "properties": { "csv": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4716,6 +5637,25 @@ }, "csv_searchsource": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4729,6 +5669,25 @@ }, "PNG": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "PNGV2": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4742,6 +5701,25 @@ }, "printable_pdf": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "printable_pdf_v2": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4759,6 +5737,9 @@ "properties": { "csv": { "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4772,6 +5753,25 @@ }, "csv_searchsource": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "csv_searchsource_immediate": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4785,6 +5785,25 @@ }, "PNG": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "PNGV2": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -4798,6 +5817,25 @@ }, "printable_pdf": { "properties": { + "search": { + "type": "long" + }, + "canvas workpad": { + "type": "long" + }, + "dashboard": { + "type": "long" + }, + "visualization": { + "type": "long" + } + } + }, + "printable_pdf_v2": { + "properties": { + "search": { + "type": "long" + }, "canvas workpad": { "type": "long" }, @@ -5617,12 +6655,6 @@ "description": "The number of spaces which have this feature disabled." } }, - "timelion": { - "type": "long", - "_meta": { - "description": "The number of spaces which have this feature disabled." - } - }, "dev_tools": { "type": "long", "_meta": { @@ -5833,6 +6865,12 @@ } } } + }, + "task_type_exclusion": { + "type": "array", + "items": { + "type": "keyword" + } } } }, diff --git a/x-pack/plugins/timelines/jest.config.js b/x-pack/plugins/timelines/jest.config.js index 12bc67dbb2f07..d26134d924e1d 100644 --- a/x-pack/plugins/timelines/jest.config.js +++ b/x-pack/plugins/timelines/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/timelines'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/timelines', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/timelines/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/timelines/public/assets/illustration_product_no_results_magnifying_glass.svg b/x-pack/plugins/timelines/public/assets/illustration_product_no_results_magnifying_glass.svg new file mode 100644 index 0000000000000..b9a0df1630b20 --- /dev/null +++ b/x-pack/plugins/timelines/public/assets/illustration_product_no_results_magnifying_glass.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/x-pack/plugins/timelines/public/components/actions/timeline/cases/create/flyout.tsx b/x-pack/plugins/timelines/public/components/actions/timeline/cases/create/flyout.tsx index 4f189648634d0..727d853990224 100644 --- a/x-pack/plugins/timelines/public/components/actions/timeline/cases/create/flyout.tsx +++ b/x-pack/plugins/timelines/public/components/actions/timeline/cases/create/flyout.tsx @@ -25,7 +25,7 @@ export interface CreateCaseModalProps { const StyledFlyout = styled(EuiFlyout)` ${({ theme }) => ` - z-index: ${theme.eui.euiZModal}; + z-index: ${theme.eui.euiZLevel5}; `} `; @@ -37,10 +37,10 @@ const maskOverlayClassName = 'create-case-flyout-mask-overlay'; * A global style is needed to target a parent element. */ -const GlobalStyle = createGlobalStyle<{ theme: { eui: { euiZModal: number } } }>` +const GlobalStyle = createGlobalStyle<{ theme: { eui: { euiZLevel5: number } } }>` .${maskOverlayClassName} { ${({ theme }) => ` - z-index: ${theme.eui.euiZModal}; + z-index: ${theme.eui.euiZLevel5}; `} } `; diff --git a/x-pack/plugins/timelines/public/components/t_grid/body/column_headers/helpers.test.tsx b/x-pack/plugins/timelines/public/components/t_grid/body/column_headers/helpers.test.tsx index 42057062d8b54..2e684b9eda989 100644 --- a/x-pack/plugins/timelines/public/components/t_grid/body/column_headers/helpers.test.tsx +++ b/x-pack/plugins/timelines/public/components/t_grid/body/column_headers/helpers.test.tsx @@ -98,12 +98,8 @@ describe('helpers', () => { describe('getColumnHeaders', () => { // additional properties used by `EuiDataGrid`: const actions = { - showSortAsc: { - label: 'Sort A-Z', - }, - showSortDesc: { - label: 'Sort Z-A', - }, + showSortAsc: true, + showSortDesc: true, }; const defaultSortDirection = 'desc'; const isSortable = true; diff --git a/x-pack/plugins/timelines/public/components/t_grid/body/column_headers/helpers.tsx b/x-pack/plugins/timelines/public/components/t_grid/body/column_headers/helpers.tsx index cd08e880bcb25..c658000e6d331 100644 --- a/x-pack/plugins/timelines/public/components/t_grid/body/column_headers/helpers.tsx +++ b/x-pack/plugins/timelines/public/components/t_grid/body/column_headers/helpers.tsx @@ -23,11 +23,10 @@ import { MINIMUM_ACTIONS_COLUMN_WIDTH, } from '../constants'; import { allowSorting } from '../helpers'; -import * as i18n from './translations'; const defaultActions: EuiDataGridColumnActions = { - showSortAsc: { label: i18n.SORT_AZ }, - showSortDesc: { label: i18n.SORT_ZA }, + showSortAsc: true, + showSortDesc: true, }; const getAllBrowserFields = (browserFields: BrowserFields): Array> => diff --git a/x-pack/plugins/timelines/public/components/t_grid/body/height_hack.ts b/x-pack/plugins/timelines/public/components/t_grid/body/height_hack.ts index 47cd1ed92d661..5371d7004a864 100644 --- a/x-pack/plugins/timelines/public/components/t_grid/body/height_hack.ts +++ b/x-pack/plugins/timelines/public/components/t_grid/body/height_hack.ts @@ -7,9 +7,6 @@ import { useState, useLayoutEffect } from 'react'; -// That could be different from security and observability. Get it as parameter? -const INITIAL_DATA_GRID_HEIGHT = 967; - // It will recalculate DataGrid height after this time interval. const TIME_INTERVAL = 50; @@ -18,8 +15,17 @@ const TIME_INTERVAL = 50; * 3 (three) is a number, numeral and digit. It is the natural number following 2 and preceding 4, and is the smallest * odd prime number and the only prime preceding a square number. It has religious or cultural significance in many societies. */ + const MAGIC_GAP = 3; +// Hard coded height for every page size +const DATA_GRID_HEIGHT_BY_PAGE_SIZE: { [key: number]: number } = { + 10: 457, + 25: 967, + 50: 1817, + 100: 3517, +}; + /** * HUGE HACK!!! * DataGrtid height isn't properly calculated when the grid has horizontal scroll. @@ -30,13 +36,15 @@ const MAGIC_GAP = 3; * Please delete me and allow DataGrid to calculate its height when the bug is fixed. */ export const useDataGridHeightHack = (pageSize: number, rowCount: number) => { - const [height, setHeight] = useState(INITIAL_DATA_GRID_HEIGHT); + const [height, setHeight] = useState(DATA_GRID_HEIGHT_BY_PAGE_SIZE[pageSize]); useLayoutEffect(() => { setTimeout(() => { const gridVirtualized = document.querySelector('#body-data-grid .euiDataGrid__virtualized'); - if ( + if (rowCount === pageSize) { + setHeight(DATA_GRID_HEIGHT_BY_PAGE_SIZE[pageSize]); + } else if ( gridVirtualized && gridVirtualized.children[0].clientHeight !== gridVirtualized.clientHeight // check if it has vertical scroll ) { diff --git a/x-pack/plugins/timelines/public/components/t_grid/body/sort/__snapshots__/sort_indicator.test.tsx.snap b/x-pack/plugins/timelines/public/components/t_grid/body/sort/__snapshots__/sort_indicator.test.tsx.snap index 596a05c4c8ab4..8a7b179da059f 100644 --- a/x-pack/plugins/timelines/public/components/t_grid/body/sort/__snapshots__/sort_indicator.test.tsx.snap +++ b/x-pack/plugins/timelines/public/components/t_grid/body/sort/__snapshots__/sort_indicator.test.tsx.snap @@ -5,6 +5,7 @@ exports[`SortIndicator rendering renders correctly against snapshot 1`] = ` content="Sorted descending" data-test-subj="sort-indicator-tooltip" delay="regular" + display="inlineBlock" position="top" > = ({ additionalFilters, browserFields, + bulkActions = true, columns, data, dataProviders, @@ -269,6 +270,8 @@ const TGridIntegratedComponent: React.FC = ({ [deletedEventIds.length, totalCount] ); + const hasAlerts = totalCountMinusDeleted > 0; + const nonDeletedEvents = useMemo(() => events.filter((e) => !deletedEventIds.includes(e._id)), [ deletedEventIds, events, @@ -290,6 +293,7 @@ const TGridIntegratedComponent: React.FC = ({ useEffect(() => { setQuery(inspect, loading, refetch); }, [inspect, loading, refetch, setQuery]); + const timelineContext = useMemo(() => ({ timelineId: id }), [id]); return ( @@ -300,88 +304,72 @@ const TGridIntegratedComponent: React.FC = ({ data-test-subj="events-viewer-panel" $isFullScreen={globalFullScreen} > - {isFirstUpdate.current && } + {isFirstUpdate.current && } {graphOverlay} {canQueryTimeline && ( - - - - - - - {!resolverIsShowing(graphEventId) && additionalFilters} - - {tGridEventRenderedViewEnabled && - ['detections-page', 'detections-rules-details-page'].includes(id) && ( - - - - )} - - - {!graphEventId && graphOverlay == null && ( - - - {totalCountMinusDeleted === 0 && loading === false && ( - - - - } - titleSize="s" - body={ -

    - -

    - } - /> + + + + + + + + {!resolverIsShowing(graphEventId) && additionalFilters} + + {tGridEventRenderedViewEnabled && + ['detections-page', 'detections-rules-details-page'].includes(id) && ( + + + )} - {totalCountMinusDeleted > 0 && ( - + + {!graphEventId && graphOverlay == null && ( + <> + {!hasAlerts && !loading && } + {hasAlerts && ( + + + + + )} -
    -
    - )} -
    + + )} + + )}
    diff --git a/x-pack/plugins/timelines/public/components/t_grid/shared/index.tsx b/x-pack/plugins/timelines/public/components/t_grid/shared/index.tsx new file mode 100644 index 0000000000000..f4a9158a3e4e7 --- /dev/null +++ b/x-pack/plugins/timelines/public/components/t_grid/shared/index.tsx @@ -0,0 +1,92 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { createContext } from 'react'; +import { + EuiPanel, + EuiFlexGroup, + EuiFlexItem, + EuiLoadingSpinner, + EuiImage, + EuiText, + EuiTitle, +} from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import type { CoreStart } from '../../../../../../../src/core/public'; + +const heights = { + tall: 490, + short: 250, +}; + +export const TimelineContext = createContext<{ timelineId: string | null }>({ timelineId: null }); + +export const TGridLoading: React.FC<{ height?: keyof typeof heights }> = ({ height = 'tall' }) => { + return ( + + + + + + + + ); +}; + +const panelStyle = { + maxWidth: 500, +}; + +export const TGridEmpty: React.FC<{ height?: keyof typeof heights }> = ({ height = 'tall' }) => { + const { http } = useKibana().services; + + return ( + + + + + + + + +

    + +

    +
    +

    + +

    +
    +
    + + + +
    +
    +
    +
    +
    + ); +}; diff --git a/x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx b/x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx index ee9b7be48df63..18bb56aacab2d 100644 --- a/x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx +++ b/x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx @@ -4,8 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem, EuiLoadingContent } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { EuiFlexItem } from '@elastic/eui'; import { isEmpty } from 'lodash/fp'; import React, { useEffect, useMemo, useState, useRef } from 'react'; import styled from 'styled-components'; @@ -39,10 +38,16 @@ import type { State } from '../../../store/t_grid'; import { useTimelineEvents } from '../../../container'; import { StatefulBody } from '../body'; import { LastUpdatedAt } from '../..'; -import { SELECTOR_TIMELINE_GLOBAL_CONTAINER, UpdatedFlexItem, UpdatedFlexGroup } from '../styles'; +import { + SELECTOR_TIMELINE_GLOBAL_CONTAINER, + UpdatedFlexItem, + UpdatedFlexGroup, + FullWidthFlexGroup, +} from '../styles'; import { InspectButton, InspectButtonContainer } from '../../inspect'; import { useFetchIndex } from '../../../container/source'; import { AddToCaseAction } from '../../actions/timeline/cases/add_to_case_action'; +import { TGridLoading, TGridEmpty, TimelineContext } from '../shared'; export const EVENTS_VIEWER_HEADER_HEIGHT = 90; // px const STANDALONE_ID = 'standalone-t-grid'; @@ -68,12 +73,6 @@ const EventsContainerLoading = styled.div.attrs(({ className = '' }) => ({ flex-direction: column; `; -const FullWidthFlexGroup = styled(EuiFlexGroup)<{ $visible: boolean }>` - overflow: hidden; - margin: 0; - display: ${({ $visible }) => ($visible ? 'flex' : 'none')}; -`; - const ScrollableFlexItem = styled(EuiFlexItem)` overflow: auto; `; @@ -255,6 +254,8 @@ const TGridStandaloneComponent: React.FC = ({ () => (totalCount > 0 ? totalCount - deletedEventIds.length : 0), [deletedEventIds.length, totalCount] ); + const hasAlerts = totalCountMinusDeleted > 0; + const activeCaseFlowId = useSelector((state: State) => tGridSelectors.activeCaseFlowId(state)); const selectedEvent = useMemo(() => { const matchedEvent = events.find((event) => event.ecs._id === activeCaseFlowId); @@ -334,18 +335,19 @@ const TGridStandaloneComponent: React.FC = ({ isFirstUpdate.current = false; } }, [loading]); + const timelineContext = { timelineId: STANDALONE_ID }; return ( - {isFirstUpdate.current && } + {isFirstUpdate.current && } {canQueryTimeline ? ( - <> + - + @@ -354,28 +356,9 @@ const TGridStandaloneComponent: React.FC = ({ - {totalCountMinusDeleted === 0 && loading === false && ( - - - - } - titleSize="s" - body={ -

    - -

    - } - /> - )} - {totalCountMinusDeleted > 0 && ( + {!hasAlerts && !loading && } + + {hasAlerts && ( = ({ )}
    - +
    ) : null}
    diff --git a/x-pack/plugins/timelines/public/components/t_grid/styles.tsx b/x-pack/plugins/timelines/public/components/t_grid/styles.tsx index e15e76c787a3f..28e425f53824b 100644 --- a/x-pack/plugins/timelines/public/components/t_grid/styles.tsx +++ b/x-pack/plugins/timelines/public/components/t_grid/styles.tsx @@ -459,6 +459,13 @@ export const HideShowContainer = styled.div.attrs<{ $isVisible: boolean }>( }) )<{ $isVisible: boolean }>``; +export const FullWidthFlexGroup = styled(EuiFlexGroup)<{ $visible?: boolean }>` + overflow: hidden; + margin: 0; + min-height: 490px; + display: ${({ $visible = true }) => ($visible ? 'flex' : 'none')}; +`; + export const UpdatedFlexGroup = styled(EuiFlexGroup)` position: absolute; z-index: ${({ theme }) => theme.eui.euiZLevel1}; diff --git a/x-pack/plugins/timelines/public/index.ts b/x-pack/plugins/timelines/public/index.ts index 2096415867682..800f1958f9c94 100644 --- a/x-pack/plugins/timelines/public/index.ts +++ b/x-pack/plugins/timelines/public/index.ts @@ -68,3 +68,4 @@ export function plugin(initializerContext: PluginInitializerContext) { } export const StatefulEventContext = createContext(null); +export { TimelineContext } from './components/t_grid/shared'; diff --git a/x-pack/plugins/timelines/public/methods/index.tsx b/x-pack/plugins/timelines/public/methods/index.tsx index 91802c4eb10e1..06bb1ae443216 100644 --- a/x-pack/plugins/timelines/public/methods/index.tsx +++ b/x-pack/plugins/timelines/public/methods/index.tsx @@ -6,7 +6,7 @@ */ import React, { lazy, Suspense } from 'react'; -import { EuiLoadingContent, EuiLoadingSpinner, EuiPanel } from '@elastic/eui'; +import { EuiLoadingSpinner } from '@elastic/eui'; import { I18nProvider } from '@kbn/i18n/react'; import type { Store } from 'redux'; import { Provider } from 'react-redux'; @@ -17,6 +17,7 @@ import type { LastUpdatedAtProps, LoadingPanelProps, FieldBrowserProps } from '. import type { AddToCaseActionProps } from '../components/actions/timeline/cases/add_to_case_action'; import { initialTGridState } from '../store/t_grid/reducer'; import { createStore } from '../store/t_grid'; +import { TGridLoading } from '../components/t_grid/shared'; const initializeStore = ({ store, @@ -51,13 +52,7 @@ export const getTGridLazy = ( ) => { initializeStore({ store, storage, setStore }); return ( - - - - } - > + }> ); diff --git a/x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts b/x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts index 907907e978123..8670b709494f0 100644 --- a/x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts +++ b/x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts @@ -12,9 +12,8 @@ import { IndexPatternsFetcher, ISearchStrategy, SearchStrategyDependencies, + FieldDescriptor, } from '../../../../../../src/plugins/data/server'; -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { FieldDescriptor } from '../../../../../../src/plugins/data/server/index_patterns'; // TODO cleanup path import { diff --git a/x-pack/plugins/timelines/server/search_strategy/index_fields/mock.ts b/x-pack/plugins/timelines/server/search_strategy/index_fields/mock.ts index 76fa1d064b342..f55cd069ecd57 100644 --- a/x-pack/plugins/timelines/server/search_strategy/index_fields/mock.ts +++ b/x-pack/plugins/timelines/server/search_strategy/index_fields/mock.ts @@ -5,8 +5,7 @@ * 2.0. */ -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { FieldDescriptor } from '../../../../../../src/plugins/data/server/index_patterns'; +import { FieldDescriptor } from '../../../../../../src/plugins/data/server'; export const mockAuditbeatIndexField: FieldDescriptor[] = [ { diff --git a/x-pack/plugins/transform/jest.config.js b/x-pack/plugins/transform/jest.config.js index 6b6a57d433392..2732cd66e2c94 100644 --- a/x-pack/plugins/transform/jest.config.js +++ b/x-pack/plugins/transform/jest.config.js @@ -9,4 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', roots: ['/x-pack/plugins/transform'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/transform', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/transform/{common,public,server}/**/*.{ts,tsx}'], }; diff --git a/x-pack/plugins/transform/public/app/common/request.test.ts b/x-pack/plugins/transform/public/app/common/request.test.ts index 6a64c6af6428f..4caeb8789bb53 100644 --- a/x-pack/plugins/transform/public/app/common/request.test.ts +++ b/x-pack/plugins/transform/public/app/common/request.test.ts @@ -29,7 +29,7 @@ import { PivotQuery, } from './request'; import { LatestFunctionConfigUI } from '../../../common/types/transform'; -import { RuntimeField } from '../../../../../../src/plugins/data/common/index_patterns'; +import { RuntimeField } from '../../../../../../src/plugins/data/common'; const simpleQuery: PivotQuery = { query_string: { query: 'airline:AAL' } }; diff --git a/x-pack/plugins/transform/public/app/hooks/use_index_data.test.tsx b/x-pack/plugins/transform/public/app/hooks/use_index_data.test.tsx index 68f6fea3aa943..880ac83fce8b7 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_index_data.test.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_index_data.test.tsx @@ -27,7 +27,7 @@ jest.mock('./use_api'); import { useAppDependencies } from '../__mocks__/app_dependencies'; import { MlSharedContext } from '../__mocks__/shared_context'; -import { RuntimeField } from '../../../../../../src/plugins/data/common/index_patterns'; +import { RuntimeField } from '../../../../../../src/plugins/data/common'; const query: SimpleQuery = { query_string: { diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx index 6bf1abc2cc61f..7ccf986d5d497 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx @@ -50,7 +50,7 @@ import { PutTransformsLatestRequestSchema, PutTransformsPivotRequestSchema, } from '../../../../../../common/api_schemas/transforms'; -import type { RuntimeField } from '../../../../../../../../../src/plugins/data/common/index_patterns'; +import type { RuntimeField } from '../../../../../../../../../src/plugins/data/common'; import { isPopulatedObject } from '../../../../../../common/shared_imports'; import { isLatestTransform } from '../../../../../../common/types/transform'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/common.test.ts b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/common.test.ts index 5891e8b330b94..9b8dcc1a623e3 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/common.test.ts +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/common.test.ts @@ -8,7 +8,7 @@ import { getPivotDropdownOptions } from '../common'; import { IndexPattern } from '../../../../../../../../../../src/plugins/data/public'; import { FilterAggForm } from './filter_agg/components'; -import type { RuntimeField } from '../../../../../../../../../../src/plugins/data/common/index_patterns'; +import type { RuntimeField } from '../../../../../../../../../../src/plugins/data/common'; describe('Transform: Define Pivot Common', () => { test('getPivotDropdownOptions()', () => { diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/action_start/__snapshots__/start_action_name.test.tsx.snap b/x-pack/plugins/transform/public/app/sections/transform_management/components/action_start/__snapshots__/start_action_name.test.tsx.snap index 5a24e30a0657e..20b0691b55bf9 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/action_start/__snapshots__/start_action_name.test.tsx.snap +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/action_start/__snapshots__/start_action_name.test.tsx.snap @@ -4,6 +4,7 @@ exports[`Transform: Transform List Actions Minimal initializatio Start diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/action_stop/__snapshots__/stop_action_name.test.tsx.snap b/x-pack/plugins/transform/public/app/sections/transform_management/components/action_stop/__snapshots__/stop_action_name.test.tsx.snap index e3740ae9a0978..fd97412fa1875 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/action_stop/__snapshots__/stop_action_name.test.tsx.snap +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/action_stop/__snapshots__/stop_action_name.test.tsx.snap @@ -4,6 +4,7 @@ exports[`Transform: Transform List Actions Minimal initialization Stop diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/create_transform_button/__snapshots__/create_transform_button.test.tsx.snap b/x-pack/plugins/transform/public/app/sections/transform_management/components/create_transform_button/__snapshots__/create_transform_button.test.tsx.snap index d85f9379159d0..fc7f3ca713f4a 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/create_transform_button/__snapshots__/create_transform_button.test.tsx.snap +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/create_transform_button/__snapshots__/create_transform_button.test.tsx.snap @@ -4,6 +4,7 @@ exports[`Transform: Transform List Minimal initializat 互換性パレットを使用して、グラフで値を特定の色にマッピング色にマッピングします。", - "charts.advancedSettings.visualization.colorMappingTextDeprecation": "この設定はサポートが終了し、Kibana 8.0 ではサポートされません。", - "charts.advancedSettings.visualization.colorMappingTitle": "カラーマッピング", - "charts.colormaps.bluesText": "青", - "charts.colormaps.greensText": "緑", - "charts.colormaps.greenToRedText": "緑から赤", - "charts.colormaps.greysText": "グレー", - "charts.colormaps.redsText": "赤", - "charts.colormaps.yellowToRedText": "黄色から赤", - "charts.colorPicker.clearColor": "色をリセット", - "charts.colorPicker.setColor.screenReaderDescription": "値 {legendDataLabel} の色を設定", - "charts.countText": "カウント", - "charts.functions.palette.args.colorHelpText": "パレットの色です。{html} カラー名、{hex}、{hsl}、{hsla}、{rgb}、または {rgba} を使用できます。", - "charts.functions.palette.args.gradientHelpText": "サポートされている場合グラデーションパレットを作成しますか?", - "charts.functions.palette.args.reverseHelpText": "パレットを反転させますか?", - "charts.functions.palette.args.stopHelpText": "パレットの色経由点。使用するときには、各色に関連付ける必要があります。", - "charts.functions.paletteHelpText": "カラーパレットを作成します。", - "charts.functions.systemPalette.args.nameHelpText": "パレットリストのパレットの名前", - "charts.functions.systemPaletteHelpText": "動的カラーパレットを作成します。", - "charts.legend.toggleLegendButtonAriaLabel": "凡例を切り替える", - "charts.legend.toggleLegendButtonTitle": "凡例を切り替える", - "charts.palettes.complimentaryLabel": "無料", - "charts.palettes.coolLabel": "Cool", - "charts.palettes.customLabel": "カスタム", - "charts.palettes.defaultPaletteLabel": "デフォルト", - "charts.palettes.grayLabel": "グレー", - "charts.palettes.kibanaPaletteLabel": "互換性", - "charts.palettes.negativeLabel": "負", - "charts.palettes.positiveLabel": "正", - "charts.palettes.statusLabel": "ステータス", - "charts.palettes.temperatureLabel": "温度", - "charts.palettes.warmLabel": "ウォーム", - "charts.partialData.bucketTooltipText": "選択された時間範囲にはこのバケット全体は含まれていません。一部データが含まれている可能性があります。", - "console.autocomplete.addMethodMetaText": "メソド", - "console.consoleDisplayName": "コンソール", - "console.consoleMenu.copyAsCurlFailedMessage": "要求をcURLとしてコピーできませんでした", - "console.consoleMenu.copyAsCurlMessage": "リクエストが URL としてコピーされました", - "console.devToolsDescription": "コンソールでデータを操作するには、cURLをスキップして、JSONインターフェイスを使用します。", - "console.devToolsTitle": "Elasticsearch APIとの連携", - "console.exampleOutputTextarea": "開発ツールコンソールエディターの例", - "console.helpPage.keyboardCommands.autoIndentDescription": "現在のリクエストを自動インデントします", - "console.helpPage.keyboardCommands.closeAutoCompleteMenuDescription": "自動入力メニューを閉じます", - "console.helpPage.keyboardCommands.collapseAllScopesDescription": "現在のスコープを除きすべてのスコープを最小表示します。シフトを追加して拡張します。", - "console.helpPage.keyboardCommands.collapseExpandCurrentScopeDescription": "現在のスコープを最小/拡張表示します。", - "console.helpPage.keyboardCommands.jumpToPreviousNextRequestDescription": "前/次のリクエストの開始または終了に移動します。", - "console.helpPage.keyboardCommands.openAutoCompleteDescription": "自動入力を開きます (未入力時を含む) ", - "console.helpPage.keyboardCommands.openDocumentationDescription": "現在のリクエストのドキュメントを開きます", - "console.helpPage.keyboardCommands.selectCurrentlySelectedInAutoCompleteMenuDescription": "現在の選択項目または自動入力メニューで最も使用されている用語を選択します", - "console.helpPage.keyboardCommands.submitRequestDescription": "リクエストを送信します", - "console.helpPage.keyboardCommands.switchFocusToAutoCompleteMenuDescription": "自動入力メニューに焦点を切り替えます。矢印を使用してさらに用語を選択します", - "console.helpPage.keyboardCommandsTitle": "キーボードコマンド", - "console.helpPage.pageTitle": "ヘルプ", - "console.helpPage.requestFormatDescription": "ホワイトエディターに 1 つ以上のリクエストを入力できます。コンソールはコンパクトなフォーマットのリクエストを理解できます。", - "console.helpPage.requestFormatTitle": "リクエストフォーマット", - "console.historyPage.applyHistoryButtonLabel": "適用", - "console.historyPage.clearHistoryButtonLabel": "クリア", - "console.historyPage.closehistoryButtonLabel": "閉じる", - "console.historyPage.itemOfRequestListAriaLabel": "リクエスト:{historyItem}", - "console.historyPage.noHistoryTextMessage": "履歴がありません", - "console.historyPage.pageTitle": "履歴", - "console.historyPage.requestListAriaLabel": "リクエストの送信履歴", - "console.inputTextarea": "開発ツールコンソール", - "console.loadingError.buttonLabel": "コンソールの再読み込み", - "console.loadingError.message": "最新データを取得するために再読み込みを試してください。", - "console.loadingError.title": "コンソールを読み込めません", - "console.notification.error.couldNotSaveRequestTitle": "リクエストをコンソール履歴に保存できませんでした。", - "console.notification.error.historyQuotaReachedMessage": "リクエスト履歴が満杯です。コンソール履歴を消去して、新しいリクエストを保存します。", - "console.notification.error.noRequestSelectedTitle": "リクエストを選択していません。リクエストの中にカーソルを置いて選択します。", - "console.notification.error.unknownErrorTitle": "不明なリクエストエラー", - "console.outputTextarea": "開発ツールコンソール出力", - "console.pageHeading": "コンソール", - "console.requestInProgressBadgeText": "リクエストが進行中", - "console.requestOptions.autoIndentButtonLabel": "自動インデント", - "console.requestOptions.copyAsUrlButtonLabel": "cURL としてコピー", - "console.requestOptions.openDocumentationButtonLabel": "ドキュメントを開く", - "console.requestOptionsButtonAriaLabel": "リクエストオプション", - "console.requestTimeElapasedBadgeTooltipContent": "経過時間", - "console.sendRequestButtonTooltip": "クリックしてリクエストを送信", - "console.settingsPage.autocompleteLabel": "自動入力", - "console.settingsPage.cancelButtonLabel": "キャンセル", - "console.settingsPage.fieldsLabelText": "フィールド", - "console.settingsPage.fontSizeLabel": "フォントサイズ", - "console.settingsPage.indicesAndAliasesLabelText": "インデックスとエイリアス", - "console.settingsPage.jsonSyntaxLabel": "JSON構文", - "console.settingsPage.pageTitle": "コンソール設定", - "console.settingsPage.pollingLabelText": "自動入力候補を自動的に更新", - "console.settingsPage.refreshButtonLabel": "自動入力候補の更新", - "console.settingsPage.refreshingDataDescription": "コンソールは、Elasticsearchをクエリして自動入力候補を更新します。クラスターが大きい場合や、ネットワークの制限がある場合には、自動更新で問題が発生する可能性があります。", - "console.settingsPage.refreshingDataLabel": "自動入力候補を更新しています", - "console.settingsPage.saveButtonLabel": "保存", - "console.settingsPage.templatesLabelText": "テンプレート", - "console.settingsPage.tripleQuotesMessage": "出力ウィンドウでは三重引用符を使用してください", - "console.settingsPage.wrapLongLinesLabelText": "長い行を改行", - "console.topNav.helpTabDescription": "ヘルプ", - "console.topNav.helpTabLabel": "ヘルプ", - "console.topNav.historyTabDescription": "履歴", - "console.topNav.historyTabLabel": "履歴", - "console.topNav.settingsTabDescription": "設定", - "console.topNav.settingsTabLabel": "設定", - "console.welcomePage.closeButtonLabel": "閉じる", - "console.welcomePage.pageTitle": "コンソールへようこそ", - "console.welcomePage.quickIntroDescription": "コンソール UI は、エディターペイン (左) と応答ペイン (右) の 2 つのペインに分かれています。エディターでリクエストを入力し、Elasticsearch に送信します。結果が右側の応答ペインに表示されます。", - "console.welcomePage.quickIntroTitle": "UI の簡単な説明", - "console.welcomePage.quickTips.cUrlFormatForRequestsDescription": "cURL フォーマットのリクエストを貼り付けると、Console 構文に変換されます。", - "console.welcomePage.quickTips.keyboardShortcutsDescription": "ヘルプボタンでキーボードショートカットが学べます。便利な情報が揃っています!", - "console.welcomePage.quickTips.resizeEditorDescription": "間の区切りをドラッグすることで、エディターとアウトプットペインのサイズを変更できます。", - "console.welcomePage.quickTips.submitRequestDescription": "緑の三角形のボタンをクリックして ES にリクエストを送信します。", - "console.welcomePage.quickTips.useWrenchMenuDescription": "レンチメニューで他の便利な機能が使えます。", - "console.welcomePage.quickTipsTitle": "今のうちにいくつか簡単なコツをお教えします", - "console.welcomePage.supportedRequestFormatDescription": "リクエストの入力中、コンソールが候補を提案するので、Enter/Tabを押して確定できます。これらの候補はリクエストの構造、およびインデックス、タイプに基づくものです。", - "console.welcomePage.supportedRequestFormatTitle": "コンソールは cURL と同様に、コンパクトなフォーマットのリクエストを理解できます。", - "core.application.appContainer.loadingAriaLabel": "アプリケーションを読み込んでいます", - "core.application.appNotFound.pageDescription": "この URL にアプリケーションが見つかりませんでした。前の画面に戻るか、メニューからアプリを選択してみてください。", - "core.application.appNotFound.title": "アプリケーションが見つかりません", - "core.application.appRenderError.defaultTitle": "アプリケーションエラー", - "core.chrome.browserDeprecationLink": "Web サイトのサポートマトリックス", - "core.chrome.browserDeprecationWarning": "このソフトウェアの将来のバージョンでは、Internet Explorerのサポートが削除されます。{link}をご確認ください。", - "core.chrome.legacyBrowserWarning": "ご使用のブラウザが Kibana のセキュリティ要件を満たしていません。", - "core.euiAccordion.isLoading": "読み込み中", - "core.euiBasicTable.selectAllRows": "すべての行を選択", - "core.euiBasicTable.selectThisRow": "この行を選択", - "core.euiBasicTable.tableAutoCaptionWithoutPagination": "この表には{itemCount}行あります。", - "core.euiBasicTable.tableCaptionWithPagination": "{tableCaption}; {page}/{pageCount}ページ。", - "core.euiBasicTable.tablePagination": "前の表のページネーション: {tableCaption}", - "core.euiBasicTable.tableSimpleAutoCaptionWithPagination": "この表には{itemCount}行あります; {page}/{pageCount}ページ。", - "core.euiBottomBar.customScreenReaderAnnouncement": "ドキュメントの最後には、新しいリージョンランドマーク{landmarkHeading}とページレベルのコントロールがあります。", - "core.euiBottomBar.screenReaderAnnouncement": "ドキュメントの最後には、新しいリージョンランドマークとページレベルのコントロールがあります。", - "core.euiBottomBar.screenReaderHeading": "ページレベルのコントロール", - "core.euiBreadcrumbs.collapsedBadge.ariaLabel": "折りたたまれたブレッドクラムを表示", - "core.euiCardSelect.select": "選択してください", - "core.euiCardSelect.selected": "利用不可", - "core.euiCardSelect.unavailable": "選択済み", - "core.euiCodeBlock.copyButton": "コピー", - "core.euiCodeBlock.fullscreenCollapse": "縮小", - "core.euiCodeBlock.fullscreenExpand": "拡張", - "core.euiCodeEditor.startEditing": "編集を開始するにはEnterキーを押してください。", - "core.euiCodeEditor.startInteracting": "コードの操作を開始するには Enter キーを押してください。", - "core.euiCodeEditor.stopEditing": "完了したら Esc キーで編集を終了します。", - "core.euiCodeEditor.stopInteracting": "完了したら Esc キーでコードの操作を終了します。", - "core.euiCollapsedItemActions.allActions": "すべてのアクション", - "core.euiColorPicker.alphaLabel": "アルファチャネル (不透明) 値", - "core.euiColorPicker.closeLabel": "下矢印キーを押すと、色オプションを含むポップオーバーが開きます", - "core.euiColorPicker.colorErrorMessage": "無効な色値", - "core.euiColorPicker.colorLabel": "色値", - "core.euiColorPicker.openLabel": "Escapeキーを押すと、ポップオーバーを閉じます", - "core.euiColorPicker.transparent": "透明", - "core.euiColorStops.screenReaderAnnouncement": "{label}:{readOnly} {disabled}色終了位置ピッカー。各終了には数値と対応するカラー値があります。上下矢印キーを使用して、個別の終了を選択します。Enterキーを押すと、新しい終了を作成します。", - "core.euiColorStopThumb.buttonAriaLabel": "Enterキーを押すと、この点を変更します。Escapeキーを押すと、グループにフォーカスします", - "core.euiColorStopThumb.buttonTitle": "クリックすると編集できます。ドラッグすると再配置できます", - "core.euiColorStopThumb.removeLabel": "この終了を削除", - "core.euiColorStopThumb.screenReaderAnnouncement": "カラー終了編集フォームのポップアップが開きました。Tabを押してフォームコントロールを閲覧するか、Escでこのポップアップを閉じます。", - "core.euiColorStopThumb.stopErrorMessage": "値が範囲外です", - "core.euiColorStopThumb.stopLabel": "点値", - "core.euiColumnActions.moveLeft": "左に移動", - "core.euiColumnActions.moveRight": "右に移動", - "core.euiColumnActions.sort": "{schemaLabel}を並べ替える", - "core.euiColumnSelector.button": "列", - "core.euiColumnSelector.buttonActivePlural": "{numberOfHiddenFields}個の列が非表示です", - "core.euiColumnSelector.buttonActiveSingular": "{numberOfHiddenFields}個の列が非表示です", - "core.euiColumnSelector.hideAll": "すべて非表示", - "core.euiColumnSelector.search": "検索", - "core.euiColumnSelector.searchcolumns": "列を検索", - "core.euiColumnSelector.selectAll": "すべて表示", - "core.euiColumnSorting.button": "フィールドの並べ替え", - "core.euiColumnSorting.clearAll": "並び替えを消去", - "core.euiColumnSorting.emptySorting": "現在並び替えられているフィールドはありません", - "core.euiColumnSorting.pickFields": "並び替え基準でフィールドの選択", - "core.euiColumnSorting.sortFieldAriaLabel": "並べ替え基準:", - "core.euiColumnSortingDraggable.defaultSortAsc": "A-Z", - "core.euiColumnSortingDraggable.defaultSortDesc": "Z-A", - "core.euiComboBoxOptionsList.allOptionsSelected": "利用可能なオプションをすべて選択しました", - "core.euiComboBoxOptionsList.alreadyAdded": "{label} はすでに追加されています", - "core.euiComboBoxOptionsList.createCustomOption": "{searchValue}をカスタムオプションとして追加", - "core.euiComboBoxOptionsList.delimiterMessage": "各項目を{delimiter}で区切って追加", - "core.euiComboBoxOptionsList.loadingOptions": "オプションを読み込み中", - "core.euiComboBoxOptionsList.noAvailableOptions": "利用可能なオプションがありません", - "core.euiComboBoxOptionsList.noMatchingOptions": "{searchValue} はどのオプションにも一致していません", - "core.euiComboBoxPill.removeSelection": "グループの選択項目から {children} を削除してください", - "core.euiCommonlyUsedTimeRanges.legend": "頻繁に使用", - "core.euiDataGrid.ariaLabel": "{label}; {page}/{pageCount}ページ。", - "core.euiDataGrid.ariaLabelledBy": "{page}/{pageCount}ページ。", - "core.euiDataGrid.screenReaderNotice": "セルにはインタラクティブコンテンツが含まれます。", - "core.euiDataGridCellButtons.expandButtonTitle": "クリックするか enter を押すと、セルのコンテンツとインタラクトできます。", - "core.euiDataGridHeaderCell.headerActions": "ヘッダーアクション", - "core.euiDataGridSchema.booleanSortTextAsc": "False-True", - "core.euiDataGridSchema.booleanSortTextDesc": "True-False", - "core.euiDataGridSchema.currencySortTextAsc": "低-高", - "core.euiDataGridSchema.currencySortTextDesc": "高-低", - "core.euiDataGridSchema.dateSortTextAsc": "新-旧", - "core.euiDataGridSchema.dateSortTextDesc": "旧-新", - "core.euiDataGridSchema.jsonSortTextAsc": "小-大", - "core.euiDataGridSchema.jsonSortTextDesc": "大-小", - "core.euiDataGridSchema.numberSortTextAsc": "低-高", - "core.euiDataGridSchema.numberSortTextDesc": "高-低", - "core.euiFieldPassword.maskPassword": "パスワードをマスク", - "core.euiFieldPassword.showPassword": "プレーンテキストとしてパスワードを表示します。注記:パスワードは画面上に見えるように表示されます。", - "core.euiFilePicker.clearSelectedFiles": "選択したファイルを消去", - "core.euiFlyout.closeAriaLabel": "このダイアログを閉じる", - "core.euiForm.addressFormErrors": "ハイライトされたエラーを修正してください。", - "core.euiFormControlLayoutClearButton.label": "インプットを消去", - "core.euiHeaderLinks.appNavigation": "アプリメニュー", - "core.euiHeaderLinks.openNavigationMenu": "メニューを開く", - "core.euiHue.label": "HSV カラーモードの「色相」値を選択", - "core.euiImage.closeImage": "全画面 {alt} 画像を閉じる", - "core.euiImage.openImage": "全画面 {alt} 画像を開く", - "core.euiLink.external.ariaLabel": "外部リンク", - "core.euiLink.newTarget.screenReaderOnlyText": " (新しいタブまたはウィンドウで開く) ", - "core.euiMarkdownEditorFooter.closeButton": "閉じる", - "core.euiMarkdownEditorFooter.descriptionPrefix": "このエディターは使用します", - "core.euiMarkdownEditorFooter.descriptionSuffix": "これらの追加の構文プラグインを利用して、リッチコンテンツをテキストに追加することもできます。", - "core.euiMarkdownEditorFooter.errorsTitle": "エラー", - "core.euiMarkdownEditorFooter.openUploadModal": "ファイルのアップロードモーダルを開く", - "core.euiMarkdownEditorFooter.showMarkdownHelp": "マークダウンヘルプを表示", - "core.euiMarkdownEditorFooter.showSyntaxErrors": "エラーを表示", - "core.euiMarkdownEditorFooter.supportedFileTypes": "サポートされているファイル:{supportedFileTypes}", - "core.euiMarkdownEditorFooter.syntaxTitle": "構文ヘルプ", - "core.euiMarkdownEditorFooter.unsupportedFileType": "ファイルタイプがサポートされていません", - "core.euiMarkdownEditorFooter.uploadingFiles": "クリックすると、ファイルをアップロードします", - "core.euiMarkdownEditorToolbar.editor": "エディター", - "core.euiMarkdownEditorToolbar.previewMarkdown": "プレビュー", - "core.euiModal.closeModal": "このモーダルウィンドウを閉じます", - "core.euiNotificationEventMessages.accordionHideText": "非表示", - "core.euiNotificationEventMeta.contextMenuButton": "{eventName}のメニュー", - "core.euiNotificationEventReadButton.markAsRead": "既読に設定", - "core.euiNotificationEventReadButton.markAsReadAria": "{eventName}を既読に設定", - "core.euiNotificationEventReadButton.markAsUnread": "未読に設定", - "core.euiNotificationEventReadButton.markAsUnreadAria": "{eventName}を未読に設定", - "core.euiPagination.disabledNextPage": "次のページ", - "core.euiPagination.disabledPreviousPage": "前のページ", - "core.euiPagination.firstRangeAriaLabel": "ページ2を{lastPage}にスキップしています", - "core.euiPagination.lastRangeAriaLabel": "ページ{firstPage}を{lastPage}にスキップしています", - "core.euiPagination.nextPage": "次のページ、{page}", - "core.euiPagination.previousPage": "前のページ、{page}", - "core.euiPaginationButton.longPageString": "{page}/{totalPages}ページ", - "core.euiPaginationButton.shortPageString": "{page}ページ", - "core.euiPinnableListGroup.pinExtraActionLabel": "項目をピン留め", - "core.euiPinnableListGroup.pinnedExtraActionLabel": "項目のピン留めを外す", - "core.euiPopover.screenReaderAnnouncement": "これはダイアログです。ダイアログを閉じるには、 escape を押してください。", - "core.euiProgress.valueText": "{value}%", - "core.euiQuickSelect.applyButton": "適用", - "core.euiQuickSelect.fullDescription": "現在 {timeTense} {timeValue} {timeUnit}に設定されています。", - "core.euiQuickSelect.legendText": "時間範囲をすばやく選択", - "core.euiQuickSelect.nextLabel": "次の時間ウィンドウ", - "core.euiQuickSelect.previousLabel": "前の時間ウィンドウ", - "core.euiQuickSelect.quickSelectTitle": "すばやく選択", - "core.euiQuickSelect.tenseLabel": "時間テンス", - "core.euiQuickSelect.unitLabel": "時間単位", - "core.euiQuickSelect.valueLabel": "時間値", - "core.euiRecentlyUsed.legend": "最近使用した日付範囲", - "core.euiRefreshInterval.fullDescription": "現在{optionValue} {optionText}に設定されている間隔を更新します。", - "core.euiRefreshInterval.legend": "以下の感覚ごとに更新", - "core.euiRefreshInterval.start": "開始", - "core.euiRefreshInterval.stop": "停止", - "core.euiRelativeTab.fullDescription": "単位は変更可能です。現在 {unit} に設定されています。", - "core.euiRelativeTab.numberInputError": "0以上でなければなりません", - "core.euiRelativeTab.numberInputLabel": "時間スパンの量", - "core.euiRelativeTab.relativeDate": "{position} 日付", - "core.euiRelativeTab.roundingLabel": "{unit} に四捨五入する", - "core.euiRelativeTab.unitInputLabel": "相対的時間スパン", - "core.euiResizableButton.horizontalResizerAriaLabel": "左右矢印キーを押してパネルサイズを調整します", - "core.euiResizableButton.verticalResizerAriaLabel": "上下矢印キーを押してパネルサイズを調整します", - "core.euiResizablePanel.toggleButtonAriaLabel": "押すと、このパネルを切り替えます", - "core.euiSelectable.loadingOptions": "オプションを読み込み中", - "core.euiSelectable.noAvailableOptions": "利用可能なオプションがありません", - "core.euiSelectable.noMatchingOptions": "{searchValue} はどのオプションにも一致していません", - "core.euiSelectable.placeholderName": "フィルターオプション", - "core.euiSelectableListItem.excludedOption": "除外されたオプション。", - "core.euiSelectableListItem.excludedOptionInstructions": "このオプションの選択を解除するには、Enterを押します", - "core.euiSelectableListItem.includedOption": "追加されたオプション。", - "core.euiSelectableListItem.includedOptionInstructions": "このオプションを除外するには、Enterを押します", - "core.euiSelectableTemplateSitewide.loadingResults": "結果を読み込み中", - "core.euiSelectableTemplateSitewide.noResults": "結果がありません", - "core.euiSelectableTemplateSitewide.onFocusBadgeGoTo": "移動:", - "core.euiSelectableTemplateSitewide.searchPlaceholder": "検索しています...", - "core.euiStat.loadingText": "統計を読み込み中です", - "core.euiStepStrings.complete": "ステップ{number}: {title}は完了しました", - "core.euiStepStrings.disabled": "ステップ{number}: {title}は無効です", - "core.euiStepStrings.errors": "ステップ{number}: {title}にはエラーがあります", - "core.euiStepStrings.incomplete": "ステップ{number}: {title}は完了していません", - "core.euiStepStrings.loading": "ステップ{number}: {title}を読み込んでいます", - "core.euiStepStrings.simpleComplete": "ステップ{number}は完了しました", - "core.euiStepStrings.simpleDisabled": "ステップ{number}は無効です", - "core.euiStepStrings.simpleErrors": "ステップ{number}にはエラーがあります", - "core.euiStepStrings.simpleIncomplete": "ステップ{number}は完了していません", - "core.euiStepStrings.simpleLoading": "ステップ{number}を読み込んでいます", - "core.euiStepStrings.simpleStep": "ステップ{number}", - "core.euiStepStrings.simpleWarning": "ステップ{number}には警告があります", - "core.euiStepStrings.step": "ステップ{number}: {title}", - "core.euiStepStrings.warning": "ステップ{number}: {title}には警告があります", - "core.euiStyleSelector.buttonLegend": "データグリッドの表示密度を選択", - "core.euiStyleSelector.buttonText": "密度", - "core.euiStyleSelector.labelCompact": "コンパクト密度", - "core.euiStyleSelector.labelExpanded": "拡張密度", - "core.euiStyleSelector.labelNormal": "標準密度", - "core.euiSuperDatePicker.showDatesButtonLabel": "日付を表示", - "core.euiSuperSelect.screenReaderAnnouncement": "{optionsCount} 件のアイテムのフォームセレクターを使用しています。1 つのオプションを選択する必要があります。上下の矢印キーで移動するか、Esc キーで閉じます。", - "core.euiSuperSelectControl.selectAnOption": "オプションの選択:{selectedValue} を選択済み", - "core.euiSuperUpdateButton.cannotUpdateTooltip": "アップデートできません", - "core.euiSuperUpdateButton.clickToApplyTooltip": "クリックして適用", - "core.euiSuperUpdateButton.refreshButtonLabel": "更新", - "core.euiSuperUpdateButton.updateButtonLabel": "更新", - "core.euiSuperUpdateButton.updatingButtonLabel": "更新中", - "core.euiTablePagination.rowsPerPage": "ページごとの行数", - "core.euiTablePagination.rowsPerPageOption": "{rowsPerPage} 行", - "core.euiTableSortMobile.sorting": "並べ替え", - "core.euiToast.dismissToast": "トーストを閉じる", - "core.euiToast.newNotification": "新しい通知が表示されます", - "core.euiToast.notification": "通知", - "core.euiTourStepIndicator.ariaLabel": "ステップ{number} {status}", - "core.euiTourStepIndicator.isActive": "アクティブ", - "core.euiTourStepIndicator.isComplete": "完了", - "core.euiTourStepIndicator.isIncomplete": "未完了", - "core.euiTreeView.ariaLabel": "{nodeLabel} {ariaLabel} のチャイルド", - "core.euiTreeView.listNavigationInstructions": "矢印キーを使ってこのリストをすばやくナビゲートすることができます。", - "core.fatalErrors.clearYourSessionButtonLabel": "セッションを消去", - "core.fatalErrors.goBackButtonLabel": "戻る", - "core.fatalErrors.somethingWentWrongTitle": "問題が発生しました", - "core.fatalErrors.tryRefreshingPageDescription": "ページを更新してみてください。うまくいかない場合は、前のページに戻るか、セッションデータを消去してください。", - "core.notifications.errorToast.closeModal": "閉じる", - "core.notifications.globalToast.ariaLabel": "通知メッセージリスト", - "core.notifications.unableUpdateUISettingNotificationMessageTitle": "UI 設定を更新できません", - "core.status.greenTitle": "緑", - "core.status.redTitle": "赤", - "core.status.yellowTitle": "黄", - "core.statusPage.loadStatus.serverIsDownErrorMessage": "サーバーステータスのリクエストに失敗しました。サーバーがダウンしている可能性があります。", - "core.statusPage.loadStatus.serverStatusCodeErrorMessage": "サーバーステータスのリクエストに失敗しました。ステータスコード:{responseStatus}", - "core.statusPage.metricsTiles.columns.heapTotalHeader": "ヒープ合計", - "core.statusPage.metricsTiles.columns.heapUsedHeader": "使用ヒープ", - "core.statusPage.metricsTiles.columns.loadHeader": "読み込み", - "core.statusPage.metricsTiles.columns.requestsPerSecHeader": "1秒あたりのリクエスト", - "core.statusPage.metricsTiles.columns.resTimeAvgHeader": "平均応答時間", - "core.statusPage.metricsTiles.columns.resTimeMaxHeader": "最長応答時間", - "core.statusPage.serverStatus.statusTitle": "Kibanaのステータス:{kibanaStatus}", - "core.statusPage.statusApp.loadingErrorText": "ステータスの読み込み中にエラーが発生しました", - "core.statusPage.statusApp.statusActions.buildText": "{buildNum}を作成", - "core.statusPage.statusApp.statusActions.commitText": "{buildSha}を確定", - "core.statusPage.statusApp.statusTitle": "プラグインステータス", - "core.statusPage.statusTable.columns.idHeader": "ID", - "core.statusPage.statusTable.columns.statusHeader": "ステータス", - "core.toasts.errorToast.seeFullError": "完全なエラーを表示", - "core.ui_settings.params.darkModeText": "Kibana UIのダークモードを有効にします。この設定を適用するにはページの更新が必要です。", - "core.ui_settings.params.darkModeTitle": "ダークモード", - "core.ui_settings.params.dateFormat.dayOfWeekText": "週の初めの曜日を設定します", - "core.ui_settings.params.dateFormat.dayOfWeekTitle": "曜日", - "core.ui_settings.params.dateFormat.optionsLinkText": "フォーマット", - "core.ui_settings.params.dateFormat.scaled.intervalsLinkText": "ISO8601間隔", - "core.ui_settings.params.dateFormat.scaledText": "時間ベースのデータが順番にレンダリングされ、フォーマットされたタイムスタンプが測定値の間隔に適応すべき状況で使用されるフォーマットを定義する値です。キーは{intervalsLink}です。", - "core.ui_settings.params.dateFormat.scaledTitle": "スケーリングされたデータフォーマットです", - "core.ui_settings.params.dateFormat.timezone.invalidValidationMessage": "無効なタイムゾーン:{timezone}", - "core.ui_settings.params.dateFormat.timezoneText": "使用されるタイムゾーンです。{defaultOption}ではご使用のブラウザーにより検知されたタイムゾーンが使用されます。", - "core.ui_settings.params.dateFormat.timezoneTitle": "データフォーマットのタイムゾーン", - "core.ui_settings.params.dateFormatText": "きちんとフォーマットされたデータを表示する際、この{formatLink}を使用します", - "core.ui_settings.params.dateFormatTitle": "データフォーマット", - "core.ui_settings.params.dateNanosFormatText": "Elasticsearchの{dateNanosLink}データタイプに使用されます", - "core.ui_settings.params.dateNanosFormatTitle": "ナノ秒フォーマットでの日付", - "core.ui_settings.params.dateNanosLinkTitle": "date_nanos", - "core.ui_settings.params.dayOfWeekText.invalidValidationMessage": "無効な曜日:{dayOfWeek}", - "core.ui_settings.params.defaultRoute.defaultRouteIsRelativeValidationMessage": "相対URLでなければなりません。", - "core.ui_settings.params.defaultRoute.defaultRouteText": "この設定は、Kibana起動時のデフォルトのルートを設定します。この設定で、Kibana起動時のランディングページを変更できます。ルートは相対URLでなければなりません。", - "core.ui_settings.params.defaultRoute.defaultRouteTitle": "デフォルトのルート", - "core.ui_settings.params.disableAnimationsText": "Kibana UIの不要なアニメーションをオフにします。変更を適用するにはページを更新してください。", - "core.ui_settings.params.disableAnimationsTitle": "アニメーションを無効にする", - "core.ui_settings.params.maxCellHeightText": "表のセルが使用する高さの上限です。この切り捨てを無効にするには0に設定します", - "core.ui_settings.params.maxCellHeightTitle": "表のセルの高さの上限", - "core.ui_settings.params.notifications.banner.markdownLinkText": "マークダウン対応", - "core.ui_settings.params.notifications.bannerLifetimeText": "バナー通知が画面に表示される時間 (ミリ秒単位) です。", - "core.ui_settings.params.notifications.bannerLifetimeTitle": "バナー通知時間", - "core.ui_settings.params.notifications.bannerText": "すべてのユーザーへの一時的な通知を目的としたカスタムバナーです。{markdownLink}", - "core.ui_settings.params.notifications.bannerTitle": "カスタムバナー通知", - "core.ui_settings.params.notifications.errorLifetimeText": "エラー通知が画面に表示される時間 (ミリ秒単位) です。", - "core.ui_settings.params.notifications.errorLifetimeTitle": "エラー通知時間", - "core.ui_settings.params.notifications.infoLifetimeText": "情報通知が画面に表示される時間 (ミリ秒単位) です。", - "core.ui_settings.params.notifications.infoLifetimeTitle": "情報通知時間", - "core.ui_settings.params.notifications.warningLifetimeText": "警告通知が画面に表示される時間 (ミリ秒単位) です。", - "core.ui_settings.params.notifications.warningLifetimeTitle": "警告通知時間", - "core.ui_settings.params.storeUrlText": "URLが長くなりすぎるためブラウザーが対応できない場合があります。セッションストレージにURLの一部を保存することでこの問題に対処できるかどうかをテストしています。結果を教えてください!", - "core.ui_settings.params.storeUrlTitle": "セッションストレージにURLを格納", - "core.ui_settings.params.themeVersionTitle": "テーマバージョン", - "core.ui.chrome.headerGlobalNav.goHomePageIconAriaLabel": "Elastic ホーム", - "core.ui.chrome.headerGlobalNav.helpMenuAskElasticTitle": "Elastic に確認する", - "core.ui.chrome.headerGlobalNav.helpMenuButtonAriaLabel": "ヘルプメニュー", - "core.ui.chrome.headerGlobalNav.helpMenuDocumentation": "ドキュメント", - "core.ui.chrome.headerGlobalNav.helpMenuGiveFeedbackOnApp": "{appName} についてのフィードバックを作成する", - "core.ui.chrome.headerGlobalNav.helpMenuGiveFeedbackTitle": "フィードバックを作成する", - "core.ui.chrome.headerGlobalNav.helpMenuKibanaDocumentationTitle": "Kibanaドキュメント", - "core.ui.chrome.headerGlobalNav.helpMenuOpenGitHubIssueTitle": "GitHubで問題を開く", - "core.ui.chrome.headerGlobalNav.helpMenuTitle": "ヘルプ", - "core.ui.chrome.headerGlobalNav.helpMenuVersion": "v {version}", - "core.ui.chrome.headerGlobalNav.logoAriaLabel": "Elastic ロゴ", - "core.ui.enterpriseSearchNavList.label": "エンタープライズサーチ", - "core.ui.errorUrlOverflow.bigUrlWarningNotificationMessage": "{advancedSettingsLink}で{storeInSessionStorageParam}オプションを有効にするか、オンスクリーンビジュアルを簡素化してください。", - "core.ui.errorUrlOverflow.bigUrlWarningNotificationMessage.advancedSettingsLinkText": "高度な設定", - "core.ui.errorUrlOverflow.bigUrlWarningNotificationTitle": "URLが大きく、Kibanaの動作が停止する可能性があります", - "core.ui.errorUrlOverflow.errorTitle": "このオブジェクトのURLは長すぎます。表示できません", - "core.ui.errorUrlOverflow.optionsToFixError.doNotUseIEText": "最新のブラウザーにアップグレードしてください。他の対応ブラウザーでは、いずれもこの制限がありません。", - "core.ui.errorUrlOverflow.optionsToFixError.enableOptionText": "{kibanaSettingsLink}で{storeInSessionStorageConfig}オプションを有効にしてください。", - "core.ui.errorUrlOverflow.optionsToFixError.enableOptionText.advancedSettingsLinkText": "高度な設定", - "core.ui.errorUrlOverflow.optionsToFixError.removeStuffFromDashboardText": "コンテンツまたはフィルターを削除すると、編集しているオブジェクトがシンプルになります。", - "core.ui.errorUrlOverflow.optionsToFixErrorDescription": "次を試してください。", - "core.ui.kibanaNavList.label": "分析", - "core.ui.legacyBrowserMessage": "この Elastic インストレーションは、現在ご使用のブラウザが満たしていない厳格なセキュリティ要件が有効になっています。", - "core.ui.legacyBrowserTitle": "ブラウザをアップグレードしてください", - "core.ui.loadingIndicatorAriaLabel": "コンテンツを読み込んでいます", - "core.ui.managementNavList.label": "管理", - "core.ui.observabilityNavList.label": "オブザーバビリティ", - "core.ui.overlays.banner.attentionTitle": "注意", - "core.ui.overlays.banner.closeButtonLabel": "閉じる", - "core.ui.primaryNav.pinnedLinksAriaLabel": "ピン留めされたリンク", - "core.ui.primaryNav.screenReaderLabel": "プライマリ", - "core.ui.primaryNav.toggleNavAriaLabel": "プライマリナビゲーションを切り替える", - "core.ui.primaryNavSection.dockAriaLabel": "プライマリナビゲーションリンクを固定する", - "core.ui.primaryNavSection.dockLabel": "ナビゲーションを固定する", - "core.ui.primaryNavSection.screenReaderLabel": "プライマリナビゲーションリンク、{category}", - "core.ui.primaryNavSection.undockAriaLabel": "プライマリナビゲーションリンクの固定を解除する", - "core.ui.primaryNavSection.undockLabel": "ナビゲーションの固定を解除する", - "core.ui.publicBaseUrlWarning.configMissingDescription": "{configKey}が見つかりません。本番環境を実行するときに構成してください。一部の機能が正常に動作しない場合があります。", - "core.ui.publicBaseUrlWarning.configMissingTitle": "構成がありません", - "core.ui.publicBaseUrlWarning.muteWarningButtonLabel": "ミュート警告", - "core.ui.publicBaseUrlWarning.seeDocumentationLinkLabel": "ドキュメントを参照してください。", - "core.ui.recentLinks.linkItem.screenReaderLabel": "{recentlyAccessedItemLinklabel}、タイプ:{pageType}", - "core.ui.recentlyViewed": "最近閲覧", - "core.ui.recentlyViewedAriaLabel": "最近閲覧したリンク", - "core.ui.securityNavList.label": "セキュリティ", - "core.ui.welcomeErrorMessage": "Elasticが正常に読み込まれませんでした。詳細はサーバーアウトプットを確認してください。", - "core.ui.welcomeMessage": "Elastic の読み込み中", - "dashboard.actions.DownloadCreateDrilldownAction.displayName": "CSV をダウンロード", - "dashboard.actions.downloadOptionsUnsavedFilename": "無題", - "dashboard.actions.toggleExpandPanelMenuItem.expandedDisplayName": "最小化", - "dashboard.actions.toggleExpandPanelMenuItem.notExpandedDisplayName": "パネルを最大化", - "dashboard.addPanel.noMatchingObjectsMessage": "一致するオブジェクトが見つかりませんでした。", - "dashboard.addPanel.savedObjectAddedToContainerSuccessMessageTitle": "{savedObjectName} が追加されました", - "dashboard.appLeaveConfirmModal.cancelButtonLabel": "キャンセル", - "dashboard.appLeaveConfirmModal.unsavedChangesSubtitle": "作業を保存せずにダッシュボードから移動しますか?", - "dashboard.appLeaveConfirmModal.unsavedChangesTitle": "保存されていない変更", - "dashboard.badge.readOnly.text": "読み取り専用", - "dashboard.badge.readOnly.tooltip": "ダッシュボードを保存できません", - "dashboard.changeViewModeConfirmModal.cancelButtonLabel": "編集を続行", - "dashboard.changeViewModeConfirmModal.confirmButtonLabel": "変更を破棄", - "dashboard.changeViewModeConfirmModal.description": "表示モードに戻ったときに変更内容を保持または破棄できます。 破棄された変更を回復することはできません。", - "dashboard.changeViewModeConfirmModal.keepUnsavedChangesButtonLabel": "変更を保持", - "dashboard.changeViewModeConfirmModal.leaveEditModeTitle": "保存されていない変更があります", - "dashboard.cloneModal.cloneDashboardTitleAriaLabel": "クローンダッシュボードタイトル", - "dashboard.createConfirmModal.cancelButtonLabel": "キャンセル", - "dashboard.createConfirmModal.confirmButtonLabel": "やり直す", - "dashboard.createConfirmModal.continueButtonLabel": "編集を続行", - "dashboard.createConfirmModal.unsavedChangesSubtitle": "編集を続行するか、空のダッシュボードで始めることができます。", - "dashboard.createConfirmModal.unsavedChangesTitle": "新しいダッシュボードはすでに実行中です", - "dashboard.dashboardAppBreadcrumbsTitle": "ダッシュボード", - "dashboard.dashboardGrid.toast.unableToLoadDashboardDangerMessage": "ダッシュボードが読み込めません。", - "dashboard.dashboardPageTitle": "ダッシュボード", - "dashboard.dashboardWasNotSavedDangerMessage": "ダッシュボード「{dashTitle}」が保存されませんでした。エラー:{errorMessage}", - "dashboard.dashboardWasSavedSuccessMessage": "ダッシュボード「{dashTitle}」が保存されました。", - "dashboard.discardChangesConfirmModal.cancelButtonLabel": "キャンセル", - "dashboard.discardChangesConfirmModal.confirmButtonLabel": "変更を破棄", - "dashboard.discardChangesConfirmModal.discardChangesDescription": "変更を破棄すると、元に戻すことはできません。", - "dashboard.discardChangesConfirmModal.discardChangesTitle": "ダッシュボードへの変更を破棄しますか?", - "dashboard.editorMenu.aggBasedGroupTitle": "アグリゲーションに基づく", - "dashboard.embedUrlParamExtension.filterBar": "フィルターバー", - "dashboard.embedUrlParamExtension.include": "含める", - "dashboard.embedUrlParamExtension.query": "クエリ", - "dashboard.embedUrlParamExtension.timeFilter": "時間フィルター", - "dashboard.embedUrlParamExtension.topMenu": "トップメニュー", - "dashboard.emptyDashboardAdditionalPrivilege": "このダッシュボードを編集するには、追加権限が必要です。", - "dashboard.emptyDashboardTitle": "このダッシュボードは空です。", - "dashboard.emptyWidget.addPanelDescription": "データに関するストーリーを伝えるコンテンツを作成します。", - "dashboard.emptyWidget.addPanelTitle": "最初のビジュアライゼーションを追加", - "dashboard.factory.displayName": "ダッシュボード", - "dashboard.featureCatalogue.dashboardDescription": "ビジュアライゼーションと保存された検索のコレクションの表示と共有を行います。", - "dashboard.featureCatalogue.dashboardSubtitle": "ダッシュボードでデータを分析します。", - "dashboard.featureCatalogue.dashboardTitle": "ダッシュボード", - "dashboard.fillDashboardTitle": "このダッシュボードは空です。コンテンツを追加しましょう!", - "dashboard.helpMenu.appName": "ダッシュボード", - "dashboard.howToStartWorkingOnNewDashboardDescription": "上のメニューバーで[編集]をクリックすると、パネルの追加を開始します。", - "dashboard.howToStartWorkingOnNewDashboardEditLinkAriaLabel": "ダッシュボードを編集", - "dashboard.labs.enableLabsDescription": "このフラグはビューアーで[ラボ]ボタンを使用できるかどうかを決定します。ダッシュボードで実験的機能を有効および無効にするための簡単な方法です。", - "dashboard.labs.enableUI": "ダッシュボードで[ラボ]ボタンを有効にする", - "dashboard.listing.createNewDashboard.combineDataViewFromKibanaAppDescription": "あらゆるKibanaアプリからダッシュボードにデータビューを組み合わせて、すべてを1か所に表示できます。", - "dashboard.listing.createNewDashboard.createButtonLabel": "新規ダッシュボードを作成", - "dashboard.listing.createNewDashboard.newToKibanaDescription": "Kibanaは初心者ですか?{sampleDataInstallLink}してお試しください。", - "dashboard.listing.createNewDashboard.sampleDataInstallLinkText": "サンプルデータをインストール", - "dashboard.listing.createNewDashboard.title": "初めてのダッシュボードを作成してみましょう。", - "dashboard.listing.table.descriptionColumnName": "説明", - "dashboard.listing.table.entityName": "ダッシュボード", - "dashboard.listing.table.entityNamePlural": "ダッシュボード", - "dashboard.listing.table.titleColumnName": "タイトル", - "dashboard.listing.unsaved.discardAria": "{title}への変更を破棄", - "dashboard.listing.unsaved.discardTitle": "変更を破棄", - "dashboard.listing.unsaved.editAria": "{title}の編集を続行", - "dashboard.listing.unsaved.editTitle": "編集を続行", - "dashboard.listing.unsaved.loading": "読み込み中", - "dashboard.listing.unsaved.unsavedChangesTitle": "次の{dash}には保存されていない変更があります。", - "dashboard.migratedChanges": "一部のパネルは正常に最新バージョンに更新されました。", - "dashboard.noMatchRoute.bannerText": "ダッシュボードアプリケーションはこのルート{route}を認識できません。", - "dashboard.noMatchRoute.bannerTitleText": "ページが見つかりません", - "dashboard.panel.AddToLibrary": "ライブラリに保存", - "dashboard.panel.addToLibrary.successMessage": "パネル {panelTitle} は Visualize ライブラリに追加されました", - "dashboard.panel.clonedToast": "クローンパネル", - "dashboard.panel.clonePanel": "パネルのクローン", - "dashboard.panel.copyToDashboard.cancel": "キャンセル", - "dashboard.panel.copyToDashboard.description": "パネルのコピー先を選択します。コピー先のダッシュボードに移動します。", - "dashboard.panel.copyToDashboard.existingDashboardOptionLabel": "既存のダッシュボード", - "dashboard.panel.copyToDashboard.goToDashboard": "コピーしてダッシュボードを開く", - "dashboard.panel.copyToDashboard.newDashboardOptionLabel": "新規ダッシュボード", - "dashboard.panel.copyToDashboard.title": "ダッシュボードにコピー", - "dashboard.panel.invalidData": "URL の無効なデータ", - "dashboard.panel.LibraryNotification": "Visualize ライブラリ通知", - "dashboard.panel.libraryNotification.ariaLabel": "ライブラリ情報を表示し、このパネルのリンクを解除します", - "dashboard.panel.libraryNotification.toolTip": "このパネルを編集すると、他のダッシュボードに影響する場合があります。このパネルのみを変更するには、ライブラリからリンクを解除します。", - "dashboard.panel.removePanel.replacePanel": "パネルの交換", - "dashboard.panel.title.clonedTag": "コピー", - "dashboard.panel.unableToMigratePanelDataForSixOneZeroErrorMessage": "「6.1.0」のダッシュボードの互換性のため、パネルデータを移行できませんでした。パネルには想定された列または行フィールドがありません", - "dashboard.panel.unableToMigratePanelDataForSixThreeZeroErrorMessage": "「6.3.0」のダッシュボードの互換性のため、パネルデータを移行できませんでした。パネルに必要なフィールドがありません:{key}", - "dashboard.panel.unlinkFromLibrary": "ライブラリからのリンクを解除", - "dashboard.panel.unlinkFromLibrary.successMessage": "パネル {panelTitle} は Visualize ライブラリに接続されていません", - "dashboard.panelStorageError.clearError": "保存されていない変更の消去中にエラーが発生しました。{message}", - "dashboard.panelStorageError.getError": "保存されていない変更の取得中にエラーが発生しました。{message}", - "dashboard.panelStorageError.setError": "保存されていない変更の設定中にエラーが発生しました。{message}", - "dashboard.placeholder.factory.displayName": "プレースホルダー", - "dashboard.savedDashboard.newDashboardTitle": "新規ダッシュボード", - "dashboard.solutionToolbar.addPanelButtonLabel": "ビジュアライゼーションを作成", - "dashboard.solutionToolbar.editorMenuButtonLabel": "すべてのタイプ", - "dashboard.strings.dashboardEditTitle": "{title}を編集中", - "dashboard.topNav.cloneModal.cancelButtonLabel": "キャンセル", - "dashboard.topNav.cloneModal.cloneDashboardModalHeaderTitle": "ダッシュボードのクローンを作成", - "dashboard.topNav.cloneModal.confirmButtonLabel": "クローンの確認", - "dashboard.topNav.cloneModal.confirmCloneDescription": "クローンの確認", - "dashboard.topNav.cloneModal.dashboardExistsDescription": "{confirmClone}をクリックして重複タイトルでダッシュボードのクローンを作成します。", - "dashboard.topNav.cloneModal.dashboardExistsTitle": "「{newDashboardName}」というタイトルのダッシュボードがすでに存在します。", - "dashboard.topNav.cloneModal.enterNewNameForDashboardDescription": "ダッシュボードの新しい名前を入力してください。", - "dashboard.topNav.labsButtonAriaLabel": "ラボ", - "dashboard.topNav.labsConfigDescription": "ラボ", - "dashboard.topNav.options.hideAllPanelTitlesSwitchLabel": "パネルタイトルを表示", - "dashboard.topNav.options.syncColorsBetweenPanelsSwitchLabel": "パネル全体でカラーパレットを同期", - "dashboard.topNav.options.useMarginsBetweenPanelsSwitchLabel": "パネルの間に余白を使用", - "dashboard.topNav.saveModal.descriptionFormRowLabel": "説明", - "dashboard.topNav.saveModal.storeTimeWithDashboardFormRowHelpText": "有効化すると、ダッシュボードが読み込まれるごとに現在選択された時刻の時間フィルターが変更されます。", - "dashboard.topNav.saveModal.storeTimeWithDashboardFormRowLabel": "ダッシュボードに時刻を保存", - "dashboard.topNav.showCloneModal.dashboardCopyTitle": "{title}のコピー", - "dashboard.topNave.cancelButtonAriaLabel": "表示モードに切り替える", - "dashboard.topNave.cloneButtonAriaLabel": "クローンを作成", - "dashboard.topNave.cloneConfigDescription": "ダッシュボードのコピーを作成します", - "dashboard.topNave.editButtonAriaLabel": "編集", - "dashboard.topNave.editConfigDescription": "編集モードに切り替えます", - "dashboard.topNave.fullScreenButtonAriaLabel": "全画面", - "dashboard.topNave.fullScreenConfigDescription": "全画面モード", - "dashboard.topNave.optionsButtonAriaLabel": "オプション", - "dashboard.topNave.optionsConfigDescription": "オプション", - "dashboard.topNave.saveAsButtonAriaLabel": "名前を付けて保存", - "dashboard.topNave.saveAsConfigDescription": "新しいダッシュボードとして保存", - "dashboard.topNave.saveButtonAriaLabel": "保存", - "dashboard.topNave.saveConfigDescription": "プロンプトを表示せずにダッシュボードをクイック保存", - "dashboard.topNave.shareButtonAriaLabel": "共有", - "dashboard.topNave.shareConfigDescription": "ダッシュボードを共有します", - "dashboard.topNave.viewConfigDescription": "表示専用モードに切り替え", - "dashboard.unsavedChangesBadge": "保存されていない変更", - "dashboard.urlWasRemovedInSixZeroWarningMessage": "URL「dashboard/create」は6.0で廃止されました。ブックマークを更新してください。", - "data.advancedSettings.autocompleteIgnoreTimerange": "時間範囲を使用", - "data.advancedSettings.autocompleteIgnoreTimerangeText": "このプロパティを無効にすると、現在の時間範囲からではなく、データセットからオートコンプリートの候補を取得します。 {learnMoreLink}", - "data.advancedSettings.courier.customRequestPreference.requestPreferenceLinkText": "リクエスト設定", - "data.advancedSettings.courier.customRequestPreferenceText": "{setRequestReferenceSetting} が {customSettingValue} に設定されている時に使用される {requestPreferenceLink} です。", - "data.advancedSettings.courier.customRequestPreferenceTitle": "カスタムリクエスト設定", - "data.advancedSettings.courier.ignoreFilterText": "この構成は、似ていないインデックスにアクセスするビジュアライゼーションを含むダッシュボードのサポートを強化します。無効にすると、すべてのフィルターがすべてのビジュアライゼーションに適用されます。有効にすると、ビジュアライゼーションのインデックスにフィルター対象のフィールドが含まれていない場合、ビジュアライゼーションの際にフィルターが無視されます。", - "data.advancedSettings.courier.ignoreFilterTitle": "フィルターの無視", - "data.advancedSettings.courier.maxRequestsText": "Kibanaから送信された_msearchリクエストに使用される{maxRequestsLink}設定を管理します。この構成を無効にしてElasticsearchのデフォルトを使用するには、0に設定します。", - "data.advancedSettings.courier.maxRequestsTitle": "最大同時シャードリクエスト", - "data.advancedSettings.courier.requestPreferenceCustom": "カスタム", - "data.advancedSettings.courier.requestPreferenceNone": "なし", - "data.advancedSettings.courier.requestPreferenceSessionId": "セッションID", - "data.advancedSettings.courier.requestPreferenceText": "どのシャードが検索リクエストを扱うかを設定できます。
      \n
    • {sessionId}:同じシャードのすべての検索リクエストを実行するため、オペレーションを制限します。\n これにはリクエスト間でシャードのキャッシュを共有できるというメリットがあります。
    • \n
    • {custom}:独自の設定が可能になります。\n 'courier:customRequestPreference'で設定値をカスタマイズします。
    • \n
    • {none}:設定されていないことを意味します。\n これにより、リクエストが全シャードコピー間に分散されるため、パフォーマンスが改善される可能性があります。\n ただし、シャードによって更新ステータスが異なる場合があるため、結果に矛盾が生じる可能性があります。
    • \n
    ", - "data.advancedSettings.courier.requestPreferenceTitle": "リクエスト設定", - "data.advancedSettings.defaultIndexText": "インデックスが設定されていない時にアクセスするインデックスです", - "data.advancedSettings.defaultIndexTitle": "デフォルトのインデックス", - "data.advancedSettings.docTableHighlightText": "Discover と保存された検索ダッシュボードの結果をハイライトします。ハイライトすることで、大きなドキュメントを扱う際にリクエストが遅くなります。", - "data.advancedSettings.docTableHighlightTitle": "結果をハイライト", - "data.advancedSettings.histogram.barTargetText": "日付ヒストグラムで「自動」間隔を使用する際、この数に近いバケットの作成を試みます", - "data.advancedSettings.histogram.barTargetTitle": "目標バケット数", - "data.advancedSettings.histogram.maxBarsText": "Kibana全体で日付の密度とヒストグラム数を制限し、\n テストクエリを使用するときのパフォーマンスを向上させます。テストクエリのバケットが多すぎる場合は、\n バケットの間隔が増えます。この設定は個別に\n 各ヒストグラムアグリゲーションに適用されます。他の種類のアグリゲーションには適用されません。\n この設定の最大値を求めるには、Elasticsearch「search.max_buckets」\n 値を各ビジュアライゼーションのアグリゲーションの最大数で除算します。", - "data.advancedSettings.histogram.maxBarsTitle": "バケットの最大数", - "data.advancedSettings.historyLimitText": "履歴があるフィールド (例:クエリインプット) に個の数の最近の値が表示されます", - "data.advancedSettings.historyLimitTitle": "履歴制限数", - "data.advancedSettings.metaFieldsText": "_source の外にあり、ドキュメントが表示される時に融合されるフィールドです", - "data.advancedSettings.metaFieldsTitle": "メタフィールド", - "data.advancedSettings.pinFiltersText": "フィルターがデフォルトでグローバル (ピン付けされた状態) になるかの設定です", - "data.advancedSettings.pinFiltersTitle": "フィルターをデフォルトでピン付けする", - "data.advancedSettings.query.allowWildcardsText": "設定すると、クエリ句の頭に*が使えるようになります。現在クエリバーで実験的クエリ機能が有効になっている場合にのみ適用されます。基本的なLuceneクエリでリーディングワイルドカードを無効にするには、{queryStringOptionsPattern}を使用します。", - "data.advancedSettings.query.allowWildcardsTitle": "クエリでリーディングワイルドカードを許可する", - "data.advancedSettings.query.queryStringOptions.optionsLinkText": "オプション", - "data.advancedSettings.query.queryStringOptionsText": "Luceneクエリ文字列パーサーの{optionsLink}。「{queryLanguage}」が{luceneLanguage}に設定されているときにのみ使用されます。", - "data.advancedSettings.query.queryStringOptionsTitle": "クエリ文字列のオプション", - "data.advancedSettings.searchQueryLanguageKql": "KQL", - "data.advancedSettings.searchQueryLanguageLucene": "Lucene", - "data.advancedSettings.searchQueryLanguageText": "クエリ言語はクエリバーで使用されます。KQLはKibana用に特別に開発された新しい言語です。", - "data.advancedSettings.searchQueryLanguageTitle": "クエリ言語", - "data.advancedSettings.searchTimeout": "検索タイムアウト", - "data.advancedSettings.searchTimeoutDesc": "検索セッションの最大タイムアウトを変更するか、0 に設定してタイムアウトを無効にすると、クエリは完了するまで実行されます。", - "data.advancedSettings.sortOptions.optionsLinkText": "オプション", - "data.advancedSettings.sortOptionsText": "Elasticsearch の並べ替えパラメーターの {optionsLink}", - "data.advancedSettings.sortOptionsTitle": "並べ替えオプション", - "data.advancedSettings.suggestFilterValuesText": "フィルターエディターがフィールドの値の候補を表示しないようにするには、このプロパティをfalseにしてください。", - "data.advancedSettings.suggestFilterValuesTitle": "フィルターエディターの候補値", - "data.advancedSettings.timepicker.last15Minutes": "過去15分間", - "data.advancedSettings.timepicker.last1Hour": "過去1時間", - "data.advancedSettings.timepicker.last1Year": "過去1年間", - "data.advancedSettings.timepicker.last24Hours": "過去 24 時間", - "data.advancedSettings.timepicker.last30Days": "過去30日間", - "data.advancedSettings.timepicker.last30Minutes": "過去30分間", - "data.advancedSettings.timepicker.last7Days": "過去7日間", - "data.advancedSettings.timepicker.last90Days": "過去90日間", - "data.advancedSettings.timepicker.quickRanges.acceptedFormatsLinkText": "対応フォーマット", - "data.advancedSettings.timepicker.quickRangesText": "時間フィルターのクイックセクションに表示される範囲のリストです。それぞれのオブジェクトに「開始」、「終了」 ({acceptedFormatsLink}を参照) 、「表示」 (表示するタイトル) が含まれるオブジェクトの配列です。", - "data.advancedSettings.timepicker.quickRangesTitle": "タイムピッカーのクイック範囲", - "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.aggTypes.buckets.ranges.rangesFormatMessage": "{gte} {from} と {lt} {to}", - "data.aggTypes.buckets.ranges.rangesFormatMessageArrowRight": "{from} → {to}", - "data.errors.fetchError": "ネットワークとプロキシ構成を確認してください。問題が解決しない場合は、ネットワーク管理者に問い合わせてください。", - "data.filter.applyFilterActionTitle": "現在のビューにフィルターを適用", - "data.filter.applyFilters.popupHeader": "適用するフィルターの選択", - "data.filter.applyFiltersPopup.cancelButtonLabel": "キャンセル", - "data.filter.applyFiltersPopup.saveButtonLabel": "適用", - "data.filter.filterBar.addFilterButtonLabel": "フィルターを追加します", - "data.filter.filterBar.deleteFilterButtonLabel": "削除", - "data.filter.filterBar.disabledFilterPrefix": "無効", - "data.filter.filterBar.disableFilterButtonLabel": "一時的に無効にする", - "data.filter.filterBar.editFilterButtonLabel": "フィルターを編集", - "data.filter.filterBar.enableFilterButtonLabel": "再度有効にする", - "data.filter.filterBar.excludeFilterButtonLabel": "結果を除外", - "data.filter.filterBar.fieldNotFound": "インデックスパターン {indexPattern} にフィールド {key} がありません", - "data.filter.filterBar.filterItemBadgeAriaLabel": "フィルターアクション", - "data.filter.filterBar.filterItemBadgeIconAriaLabel": "{filter}を削除", - "data.filter.filterBar.includeFilterButtonLabel": "結果を含める", - "data.filter.filterBar.indexPatternSelectPlaceholder": "インデックスパターンの選択", - "data.filter.filterBar.labelErrorInfo": "インデックスパターン{indexPattern}が見つかりません", - "data.filter.filterBar.labelErrorText": "エラー", - "data.filter.filterBar.labelWarningInfo": "フィールド{fieldName}は現在のビューに存在しません", - "data.filter.filterBar.labelWarningText": "警告", - "data.filter.filterBar.moreFilterActionsMessage": "フィルター:{innerText}。他のフィルターアクションを使用するには選択してください。", - "data.filter.filterBar.negatedFilterPrefix": "NOT ", - "data.filter.filterBar.pinFilterButtonLabel": "すべてのアプリにピン付け", - "data.filter.filterBar.pinnedFilterPrefix": "ピン付け済み", - "data.filter.filterBar.unpinFilterButtonLabel": "ピンを外す", - "data.filter.filterEditor.cancelButtonLabel": "キャンセル", - "data.filter.filterEditor.createCustomLabelInputLabel": "カスタムラベル", - "data.filter.filterEditor.createCustomLabelSwitchLabel": "カスタムラベルを作成しますか?", - "data.filter.filterEditor.doesNotExistOperatorOptionLabel": "存在しない", - "data.filter.filterEditor.editFilterPopupTitle": "フィルターを編集", - "data.filter.filterEditor.editFilterValuesButtonLabel": "フィルター値を編集", - "data.filter.filterEditor.editQueryDslButtonLabel": "クエリ DSL として編集", - "data.filter.filterEditor.existsOperatorOptionLabel": "存在する", - "data.filter.filterEditor.falseOptionLabel": "False", - "data.filter.filterEditor.fieldSelectLabel": "フィールド", - "data.filter.filterEditor.fieldSelectPlaceholder": "フィールドを選択", - "data.filter.filterEditor.indexPatternSelectLabel": "インデックスパターン", - "data.filter.filterEditor.isBetweenOperatorOptionLabel": "is between", - "data.filter.filterEditor.isNotBetweenOperatorOptionLabel": "is not between", - "data.filter.filterEditor.isNotOneOfOperatorOptionLabel": "is not one of", - "data.filter.filterEditor.isNotOperatorOptionLabel": "is not", - "data.filter.filterEditor.isOneOfOperatorOptionLabel": "is one of", - "data.filter.filterEditor.isOperatorOptionLabel": "is", - "data.filter.filterEditor.operatorSelectLabel": "演算子", - "data.filter.filterEditor.operatorSelectPlaceholderSelect": "選択してください", - "data.filter.filterEditor.operatorSelectPlaceholderWaiting": "待機中", - "data.filter.filterEditor.queryDslLabel": "Elasticsearch クエリ DSL", - "data.filter.filterEditor.rangeEndInputPlaceholder": "範囲の終了値", - "data.filter.filterEditor.rangeInputLabel": "範囲", - "data.filter.filterEditor.rangeStartInputPlaceholder": "範囲の開始値", - "data.filter.filterEditor.saveButtonLabel": "保存", - "data.filter.filterEditor.trueOptionLabel": "True", - "data.filter.filterEditor.valueInputLabel": "値", - "data.filter.filterEditor.valueInputPlaceholder": "値を入力", - "data.filter.filterEditor.valueSelectPlaceholder": "値を選択", - "data.filter.filterEditor.valuesSelectLabel": "値", - "data.filter.filterEditor.valuesSelectPlaceholder": "値を選択", - "data.filter.options.changeAllFiltersButtonLabel": "すべてのフィルターの変更", - "data.filter.options.deleteAllFiltersButtonLabel": "すべて削除", - "data.filter.options.disableAllFiltersButtonLabel": "すべて無効にする", - "data.filter.options.enableAllFiltersButtonLabel": "すべて有効にする", - "data.filter.options.invertDisabledFiltersButtonLabel": "有効・無効を反転", - "data.filter.options.invertNegatedFiltersButtonLabel": "含める・除外を反転", - "data.filter.options.pinAllFiltersButtonLabel": "すべてピン付け", - "data.filter.options.unpinAllFiltersButtonLabel": "すべてのピンを外す", - "data.filter.searchBar.changeAllFiltersTitle": "すべてのフィルターの変更", - "data.functions.esaggs.help": "AggConfig 集約を実行します", - "data.functions.esaggs.inspector.dataRequest.description": "このリクエストはElasticsearchにクエリし、ビジュアライゼーション用のデータを取得します。", - "data.functions.esaggs.inspector.dataRequest.title": "データ", - "data.functions.indexPatternLoad.help": "インデックスパターンを読み込みます", - "data.functions.indexPatternLoad.id.help": "読み込むインデックスパターンID", - "data.indexPatterns.ensureDefaultIndexPattern.bannerLabel": "Kibanaでデータの可視化と閲覧を行うには、Elasticsearchからデータを取得するためのインデックスパターンの作成が必要です。", - "data.indexPatterns.fetchFieldErrorTitle": "インデックスパターンのフィールド取得中にエラーが発生 {title} (ID:{id}) ", - "data.indexPatterns.indexPatternLoad.error.kibanaRequest": "サーバーでこの検索を実行するには、KibanaRequest が必要です。式実行パラメーターに要求オブジェクトを渡してください。", - "data.indexPatterns.unableWriteLabel": "インデックスパターンを書き込めません。このインデックスパターンへの最新の変更を取得するには、ページを更新してください。", - "data.inspector.table..dataDescriptionTooltip": "ビジュアライゼーションの元のデータを表示", - "data.inspector.table.dataTitle": "データ", - "data.inspector.table.downloadCSVToggleButtonLabel": "CSV をダウンロード", - "data.inspector.table.downloadOptionsUnsavedFilename": "未保存", - "data.inspector.table.filterForValueButtonAriaLabel": "値でフィルター", - "data.inspector.table.filterForValueButtonTooltip": "値でフィルター", - "data.inspector.table.filterOutValueButtonAriaLabel": "値を除外", - "data.inspector.table.filterOutValueButtonTooltip": "値を除外", - "data.inspector.table.formattedCSVButtonLabel": "フォーマット済み CSV", - "data.inspector.table.formattedCSVButtonTooltip": "データを表形式でダウンロード", - "data.inspector.table.noDataAvailableDescription": "エレメントがデータを提供しませんでした。", - "data.inspector.table.noDataAvailableTitle": "利用可能なデータがありません", - "data.inspector.table.rawCSVButtonLabel": "CSV", - "data.inspector.table.rawCSVButtonTooltip": "日付をタイムスタンプとしてなど、提供されたデータをそのままダウンロードします", - "data.inspector.table.tableLabel": "テーブル{index}", - "data.inspector.table.tableSelectorLabel": "選択済み:", - "data.kueryAutocomplete.andOperatorDescription": "{bothArguments} が true であることを条件とする", - "data.kueryAutocomplete.andOperatorDescription.bothArgumentsText": "両方の引数", - "data.kueryAutocomplete.equalOperatorDescription": "一部の値に{equals}", - "data.kueryAutocomplete.equalOperatorDescription.equalsText": "一致する", - "data.kueryAutocomplete.existOperatorDescription": "いずれかの形式中に{exists}", - "data.kueryAutocomplete.existOperatorDescription.existsText": "存在する", - "data.kueryAutocomplete.filterResultsDescription": "{fieldName}を含む結果をフィルタリング", - "data.kueryAutocomplete.greaterThanOperatorDescription": "が一部の値{greaterThan}", - "data.kueryAutocomplete.greaterThanOperatorDescription.greaterThanText": "より大きい", - "data.kueryAutocomplete.greaterThanOrEqualOperatorDescription": "が一部の値{greaterThanOrEqualTo}", - "data.kueryAutocomplete.greaterThanOrEqualOperatorDescription.greaterThanOrEqualToText": "よりも大きいまたは等しい", - "data.kueryAutocomplete.lessThanOperatorDescription": "が一部の値{lessThan}", - "data.kueryAutocomplete.lessThanOperatorDescription.lessThanText": "より小さい", - "data.kueryAutocomplete.lessThanOrEqualOperatorDescription": "が一部の値{lessThanOrEqualTo}", - "data.kueryAutocomplete.lessThanOrEqualOperatorDescription.lessThanOrEqualToText": "より小さいまたは等しい", - "data.kueryAutocomplete.orOperatorDescription": "{oneOrMoreArguments} が true であることを条件とする", - "data.kueryAutocomplete.orOperatorDescription.oneOrMoreArgumentsText": "1つ以上の引数", - "data.noDataPopover.content": "この時間範囲にはデータが含まれていません。表示するフィールドを増やし、グラフを作成するには、時間範囲を広げるか、調整してください。", - "data.noDataPopover.dismissAction": "今後表示しない", - "data.noDataPopover.subtitle": "ヒント", - "data.noDataPopover.title": "空のデータセット", - "data.painlessError.buttonTxt": "スクリプトを編集", - "data.painlessError.painlessScriptedFieldErrorMessage": "インデックスパターン{indexPatternName}でのランタイムフィールドまたはスクリプトフィールドの実行エラー", - "data.parseEsInterval.invalidEsCalendarIntervalErrorMessage": "無効なカレンダー間隔:{interval}、1よりも大きな値が必要です", - "data.parseEsInterval.invalidEsIntervalFormatErrorMessage": "無効な間隔形式:{interval}", - "data.query.queryBar.clearInputLabel": "インプットを消去", - "data.query.queryBar.comboboxAriaLabel": "{pageType} ページの検索とフィルタリング", - "data.query.queryBar.kqlFullLanguageName": "Kibana クエリ言語", - "data.query.queryBar.kqlLanguageName": "KQL", - "data.query.queryBar.KQLNestedQuerySyntaxInfoDocLinkText": "ドキュメント", - "data.query.queryBar.KQLNestedQuerySyntaxInfoOptOutText": "今後表示しない", - "data.query.queryBar.KQLNestedQuerySyntaxInfoText": "ネストされたフィールドをクエリされているようです。ネストされたクエリに対しては、ご希望の結果により異なる方法で KQL 構文を構築することができます。詳細については、{link}をご覧ください。", - "data.query.queryBar.KQLNestedQuerySyntaxInfoTitle": "KQL ネストされたクエリ構文", - "data.query.queryBar.kqlOffLabel": "オフ", - "data.query.queryBar.kqlOnLabel": "オン", - "data.query.queryBar.languageSwitcher.toText": "検索用にKibana Query Languageに切り替える", - "data.query.queryBar.luceneLanguageName": "Lucene", - "data.query.queryBar.searchInputAriaLabel": "{pageType} ページの検索とフィルタリングを行うには入力を開始してください", - "data.query.queryBar.searchInputPlaceholder": "検索", - "data.query.queryBar.syntaxOptionsDescription": "{docsLink} (KQL) は、シンプルなクエリ構文とスクリプトフィールドのサポートを提供します。KQLにはオートコンプリート機能もあります。KQLをオフにする場合は、{nonKqlModeHelpText}", - "data.query.queryBar.syntaxOptionsDescription.nonKqlModeHelpText": "KibanaはLuceneを使用します。", - "data.query.queryBar.syntaxOptionsTitle": "構文オプション", - "data.search.aggs.aggGroups.bucketsText": "バケット", - "data.search.aggs.aggGroups.metricsText": "メトリック", - "data.search.aggs.aggGroups.noneText": "なし", - "data.search.aggs.aggTypesLabel": "{fieldName} の範囲", - "data.search.aggs.buckets.dateHistogram.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.buckets.dateHistogram.dropPartials.help": "このアグリゲーションでdrop_partialsを使用するかどうかを指定します", - "data.search.aggs.buckets.dateHistogram.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.buckets.dateHistogram.extendedBounds.help": "extended_bounds設定を使用すると、強制的にヒストグラムアグリゲーションを実行し、特定の最小値に対してバケットの作成を開始し、最大値までバケットを作成し続けます。 ", - "data.search.aggs.buckets.dateHistogram.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.buckets.dateHistogram.format.help": "このアグリゲーションで使用するフォーマット", - "data.search.aggs.buckets.dateHistogram.id.help": "このアグリゲーションのID", - "data.search.aggs.buckets.dateHistogram.interval.help": "このアグリゲーションで使用する間隔", - "data.search.aggs.buckets.dateHistogram.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.buckets.dateHistogram.minDocCount.help": "このアグリゲーションで使用する最小ドキュメントカウント", - "data.search.aggs.buckets.dateHistogram.scaleMetricValues.help": "このアグリゲーションでscaleMetricValuesを使用するかどうかを指定します", - "data.search.aggs.buckets.dateHistogram.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.buckets.dateHistogram.timeRange.help": "このアグリゲーションで使用する時間範囲", - "data.search.aggs.buckets.dateHistogram.timeZone.help": "このアグリゲーションで使用するタイムゾーン", - "data.search.aggs.buckets.dateHistogram.useNormalizedEsInterval.help": "このアグリゲーションでuseNormalizedEsIntervalを使用するかどうかを指定します", - "data.search.aggs.buckets.dateHistogramLabel": "{intervalDescription} ごとの {fieldName}", - "data.search.aggs.buckets.dateHistogramTitle": "日付ヒストグラム", - "data.search.aggs.buckets.dateRange.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.buckets.dateRange.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.buckets.dateRange.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.buckets.dateRange.id.help": "このアグリゲーションのID", - "data.search.aggs.buckets.dateRange.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.buckets.dateRange.ranges.help": "このアグリゲーションで使用するシリアル化された範囲。", - "data.search.aggs.buckets.dateRange.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.buckets.dateRange.timeZone.help": "このアグリゲーションで使用するタイムゾーン。", - "data.search.aggs.buckets.dateRangeTitle": "日付範囲", - "data.search.aggs.buckets.filter.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.buckets.filter.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.buckets.filter.filter.help": "KQLまたはLuceneクエリに基づいて結果をフィルタリングします。geo_bounding_boxと一緒に使用しないでください", - "data.search.aggs.buckets.filter.geoBoundingBox.help": "バウンディングボックス内の点の位置に基づいて結果をフィルタリングします", - "data.search.aggs.buckets.filter.id.help": "このアグリゲーションのID", - "data.search.aggs.buckets.filter.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.buckets.filter.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.buckets.filters.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.buckets.filters.filters.help": "このアグリゲーションで使用するフィルター", - "data.search.aggs.buckets.filters.id.help": "このアグリゲーションのID", - "data.search.aggs.buckets.filters.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.buckets.filters.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.buckets.filtersTitle": "フィルター", - "data.search.aggs.buckets.filterTitle": "フィルター", - "data.search.aggs.buckets.geoHash.autoPrecision.help": "このアグリゲーションで自動精度を使用するかどうかを指定します", - "data.search.aggs.buckets.geoHash.boundingBox.help": "バウンディングボックス内の点の位置に基づいて結果をフィルタリングします", - "data.search.aggs.buckets.geoHash.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.buckets.geoHash.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.buckets.geoHash.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.buckets.geoHash.id.help": "このアグリゲーションのID", - "data.search.aggs.buckets.geoHash.isFilteredByCollar.help": "カラーでフィルタリングするかどうかを指定します", - "data.search.aggs.buckets.geoHash.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.buckets.geoHash.precision.help": "このアグリゲーションで使用する精度。", - "data.search.aggs.buckets.geoHash.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.buckets.geoHash.useGeocentroid.help": "このアグリゲーションでgeocentroid使用するかどうかを指定します", - "data.search.aggs.buckets.geohashGridTitle": "ジオハッシュ", - "data.search.aggs.buckets.geoTile.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.buckets.geoTile.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.buckets.geoTile.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.buckets.geoTile.id.help": "このアグリゲーションのID", - "data.search.aggs.buckets.geoTile.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.buckets.geoTile.precision.help": "このアグリゲーションで使用する精度。", - "data.search.aggs.buckets.geoTile.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.buckets.geoTile.useGeocentroid.help": "このアグリゲーションでgeocentroid使用するかどうかを指定します", - "data.search.aggs.buckets.geotileGridTitle": "ジオタイル", - "data.search.aggs.buckets.histogram.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.buckets.histogram.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.buckets.histogram.extendedBounds.help": "extended_bounds設定を使用すると、強制的にヒストグラムアグリゲーションを実行し、特定の最小値に対してバケットの作成を開始し、最大値までバケットを作成し続けます。 ", - "data.search.aggs.buckets.histogram.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.buckets.histogram.hasExtendedBounds.help": "このアグリゲーションでhas_extended_boundsを使用するかどうかを指定します", - "data.search.aggs.buckets.histogram.id.help": "このアグリゲーションのID", - "data.search.aggs.buckets.histogram.interval.help": "このアグリゲーションで使用する間隔", - "data.search.aggs.buckets.histogram.intervalBase.help": "このアグリゲーションで使用するIntervalBase", - "data.search.aggs.buckets.histogram.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.buckets.histogram.maxBars.help": "間隔を計算して、この数の棒を取得します", - "data.search.aggs.buckets.histogram.minDocCount.help": "このアグリゲーションでmin_doc_countを使用するかどうかを指定します", - "data.search.aggs.buckets.histogram.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.buckets.histogramTitle": "ヒストグラム", - "data.search.aggs.buckets.intervalOptions.autoDisplayName": "自動", - "data.search.aggs.buckets.intervalOptions.dailyDisplayName": "日", - "data.search.aggs.buckets.intervalOptions.hourlyDisplayName": "時間", - "data.search.aggs.buckets.intervalOptions.millisecondDisplayName": "ミリ秒", - "data.search.aggs.buckets.intervalOptions.minuteDisplayName": "分", - "data.search.aggs.buckets.intervalOptions.monthlyDisplayName": "月", - "data.search.aggs.buckets.intervalOptions.secondDisplayName": "秒", - "data.search.aggs.buckets.intervalOptions.weeklyDisplayName": "週", - "data.search.aggs.buckets.intervalOptions.yearlyDisplayName": "年", - "data.search.aggs.buckets.ipRange.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.buckets.ipRange.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.buckets.ipRange.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.buckets.ipRange.id.help": "このアグリゲーションのID", - "data.search.aggs.buckets.ipRange.ipRangeType.help": "このアグリゲーションで使用するIP範囲タイプ。値mask、fromTOのいずれかを取ります。", - "data.search.aggs.buckets.ipRange.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.buckets.ipRange.ranges.help": "このアグリゲーションで使用するシリアル化された範囲。", - "data.search.aggs.buckets.ipRange.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.buckets.ipRangeLabel": "{fieldName} IP 範囲", - "data.search.aggs.buckets.ipRangeTitle": "IP範囲", - "data.search.aggs.buckets.range.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.buckets.range.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.buckets.range.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.buckets.range.id.help": "このアグリゲーションのID", - "data.search.aggs.buckets.range.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.buckets.range.ranges.help": "このアグリゲーションで使用するシリアル化された範囲。", - "data.search.aggs.buckets.range.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.buckets.rangeTitle": "範囲", - "data.search.aggs.buckets.shardDelay.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.buckets.shardDelay.delay.help": "処理するシャード間の遅延。例:\"5s\"", - "data.search.aggs.buckets.shardDelay.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.buckets.shardDelay.id.help": "このアグリゲーションのID", - "data.search.aggs.buckets.shardDelay.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.buckets.shardDelay.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.buckets.significantTerms.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.buckets.significantTerms.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.buckets.significantTerms.exclude.help": "結果から除外する特定のバケット値", - "data.search.aggs.buckets.significantTerms.excludeLabel": "除外", - "data.search.aggs.buckets.significantTerms.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.buckets.significantTerms.id.help": "このアグリゲーションのID", - "data.search.aggs.buckets.significantTerms.include.help": "結果に含める特定のバケット値", - "data.search.aggs.buckets.significantTerms.includeLabel": "含める", - "data.search.aggs.buckets.significantTerms.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.buckets.significantTerms.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.buckets.significantTerms.size.help": "取得するバケットの最大数", - "data.search.aggs.buckets.significantTermsLabel": "{fieldName} のトップ {size} の珍しいアイテム", - "data.search.aggs.buckets.significantTermsTitle": "重要な用語", - "data.search.aggs.buckets.terms.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.buckets.terms.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.buckets.terms.exclude.help": "結果から除外する特定のバケット値", - "data.search.aggs.buckets.terms.excludeLabel": "除外", - "data.search.aggs.buckets.terms.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.buckets.terms.id.help": "このアグリゲーションのID", - "data.search.aggs.buckets.terms.include.help": "結果に含める特定のバケット値", - "data.search.aggs.buckets.terms.includeLabel": "含める", - "data.search.aggs.buckets.terms.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.buckets.terms.missingBucket.help": "trueに設定すると、見つからないフィールドのすべてのバケットをグループ化します", - "data.search.aggs.buckets.terms.missingBucketLabel": "欠測値", - "data.search.aggs.buckets.terms.missingBucketLabel.help": "ドキュメントのフィールドが見つからないときにグラフで使用される既定のラベル。", - "data.search.aggs.buckets.terms.order.help": "結果を返す順序:昇順または降順", - "data.search.aggs.buckets.terms.orderAgg.help": "結果の並べ替えで使用するアグリゲーション構成", - "data.search.aggs.buckets.terms.orderAscendingTitle": "昇順", - "data.search.aggs.buckets.terms.orderBy.help": "結果を並べ替える基準のフィールド", - "data.search.aggs.buckets.terms.orderDescendingTitle": "降順", - "data.search.aggs.buckets.terms.otherBucket.help": "trueに設定すると、許可されたサイズを超えるすべてのバケットをグループ化します", - "data.search.aggs.buckets.terms.otherBucketDescription": "このリクエストは、データバケットの基準外のドキュメントの数をカウントします。", - "data.search.aggs.buckets.terms.otherBucketLabel": "その他", - "data.search.aggs.buckets.terms.otherBucketLabel.help": "他のバケットのドキュメントのグラフで使用される既定のラベル", - "data.search.aggs.buckets.terms.otherBucketTitle": "他のバケット", - "data.search.aggs.buckets.terms.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.buckets.terms.size.help": "取得するバケットの最大数", - "data.search.aggs.buckets.termsTitle": "用語", - "data.search.aggs.error.aggNotFound": "「{type}」に登録されたアグリゲーションタイプが見つかりません。", - "data.search.aggs.function.buckets.dateHistogram.help": "ヒストグラムアグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.buckets.dateRange.help": "日付範囲アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.buckets.filter.help": "フィルターアグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.buckets.filters.help": "フィルターアグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.buckets.geoHash.help": "ジオハッシュアグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.buckets.geoTile.help": "ジオタイルアグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.buckets.histogram.help": "ヒストグラムアグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.buckets.ipRange.help": "IP範囲アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.buckets.range.help": "範囲アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.buckets.shardDelay.help": "シャード遅延アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.buckets.significantTerms.help": "重要な用語アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.buckets.terms.help": "用語アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.avg.help": "平均値アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.bucket_avg.help": "平均値バケットアグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.bucket_max.help": "最大値バケットアグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.bucket_min.help": "最小値バケットアグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.bucket_sum.help": "合計値バケットアグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.cardinality.help": "カーディナリティアグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.count.help": "カウントアグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.cumulative_sum.help": "合計値バケットアグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.derivative.help": "微分アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.filtered_metric.help": "フィルタリングされたメトリックアグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.geo_bounds.help": "ジオ境界アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.geo_centroid.help": "ジオ中心アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.max.help": "最大値アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.median.help": "中央値アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.min.help": "最小値アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.moving_avg.help": "移動平均値アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.percentile_ranks.help": "パーセンタイル順位アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.percentiles.help": "パーセンタイルアグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.serial_diff.help": "シリアル差異アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.singlePercentile.help": "パーセンタイルアグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.std_deviation.help": "標準偏差アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.sum.help": "合計値アグリゲーションのシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.function.metrics.top_hit.help": "上位一致のシリアル化されたアグリゲーション構成を生成します", - "data.search.aggs.histogram.missingMaxMinValuesWarning": "自動スケールヒストグラムバケットから最高値と最低値を取得できません。これによりビジュアライゼーションのパフォーマンスが低下する可能性があります。", - "data.search.aggs.metrics.averageBucketTitle": "平均バケット", - "data.search.aggs.metrics.averageLabel": "平均 {field}", - "data.search.aggs.metrics.averageTitle": "平均", - "data.search.aggs.metrics.avg.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.avg.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.avg.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.metrics.avg.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.avg.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.avg.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.bucket_avg.customBucket.help": "兄弟パイプラインアグリゲーションを構築するために使用するアグリゲーション構成", - "data.search.aggs.metrics.bucket_avg.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.bucket_avg.customMetric.help": "兄弟パイプラインアグリゲーションを構築するために使用するアグリゲーション構成", - "data.search.aggs.metrics.bucket_avg.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.bucket_avg.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.bucket_avg.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.bucket_avg.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.bucket_max.customBucket.help": "兄弟パイプラインアグリゲーションを構築するために使用するアグリゲーション構成", - "data.search.aggs.metrics.bucket_max.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.bucket_max.customMetric.help": "兄弟パイプラインアグリゲーションを構築するために使用するアグリゲーション構成", - "data.search.aggs.metrics.bucket_max.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.bucket_max.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.bucket_max.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.bucket_max.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.bucket_min.customBucket.help": "兄弟パイプラインアグリゲーションを構築するために使用するアグリゲーション構成", - "data.search.aggs.metrics.bucket_min.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.bucket_min.customMetric.help": "兄弟パイプラインアグリゲーションを構築するために使用するアグリゲーション構成", - "data.search.aggs.metrics.bucket_min.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.bucket_min.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.bucket_min.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.bucket_min.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.bucket_sum.customBucket.help": "兄弟パイプラインアグリゲーションを構築するために使用するアグリゲーション構成", - "data.search.aggs.metrics.bucket_sum.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.bucket_sum.customMetric.help": "兄弟パイプラインアグリゲーションを構築するために使用するアグリゲーション構成", - "data.search.aggs.metrics.bucket_sum.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.bucket_sum.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.bucket_sum.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.bucket_sum.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.cardinality.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.cardinality.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.cardinality.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.metrics.cardinality.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.cardinality.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.cardinality.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.count.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.count.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.count.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.count.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.countLabel": "カウント", - "data.search.aggs.metrics.countTitle": "カウント", - "data.search.aggs.metrics.cumulative_sum.buckets_path.help": "関心があるメトリックへのパス", - "data.search.aggs.metrics.cumulative_sum.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.cumulative_sum.customMetric.help": "親パイプラインアグリゲーションを構築するために使用するアグリゲーション構成", - "data.search.aggs.metrics.cumulative_sum.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.cumulative_sum.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.cumulative_sum.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.cumulative_sum.metricAgg.help": "親パイプラインアグリゲーションを構築するために使用するアグリゲーション構成を検索するためのID", - "data.search.aggs.metrics.cumulative_sum.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.cumulativeSumLabel": "累積和", - "data.search.aggs.metrics.cumulativeSumTitle": "累積和", - "data.search.aggs.metrics.derivative.buckets_path.help": "関心があるメトリックへのパス", - "data.search.aggs.metrics.derivative.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.derivative.customMetric.help": "親パイプラインアグリゲーションを構築するために使用するアグリゲーション構成", - "data.search.aggs.metrics.derivative.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.derivative.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.derivative.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.derivative.metricAgg.help": "親パイプラインアグリゲーションを構築するために使用するアグリゲーション構成を検索するためのID", - "data.search.aggs.metrics.derivative.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.derivativeLabel": "派生", - "data.search.aggs.metrics.derivativeTitle": "派生", - "data.search.aggs.metrics.filtered_metric.customBucket.help": "兄弟パイプラインアグリゲーションを構築するために使用するアグリゲーション構成フィルターアグリゲーションでなければなりません", - "data.search.aggs.metrics.filtered_metric.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.filtered_metric.customMetric.help": "兄弟パイプラインアグリゲーションを構築するために使用するアグリゲーション構成", - "data.search.aggs.metrics.filtered_metric.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.filtered_metric.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.filtered_metric.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.filteredMetricLabel": "フィルタリング済み", - "data.search.aggs.metrics.filteredMetricTitle": "フィルタリングされたメトリック", - "data.search.aggs.metrics.geo_bounds.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.geo_bounds.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.geo_bounds.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.metrics.geo_bounds.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.geo_bounds.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.geo_bounds.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.geo_centroid.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.geo_centroid.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.geo_centroid.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.metrics.geo_centroid.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.geo_centroid.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.geo_centroid.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.geoBoundsLabel": "境界", - "data.search.aggs.metrics.geoBoundsTitle": "境界", - "data.search.aggs.metrics.geoCentroidLabel": "ジオセントロイド", - "data.search.aggs.metrics.geoCentroidTitle": "ジオセントロイド", - "data.search.aggs.metrics.max.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.max.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.max.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.metrics.max.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.max.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.max.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.maxBucketTitle": "最高バケット", - "data.search.aggs.metrics.maxLabel": "最高 {field}", - "data.search.aggs.metrics.maxTitle": "最高", - "data.search.aggs.metrics.median.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.median.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.median.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.metrics.median.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.median.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.median.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.medianLabel": "中央 {field}", - "data.search.aggs.metrics.medianTitle": "中央", - "data.search.aggs.metrics.metricAggregationsSubtypeTitle": "メトリック集約", - "data.search.aggs.metrics.min.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.min.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.min.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.metrics.min.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.min.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.min.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.minBucketTitle": "最低バケット", - "data.search.aggs.metrics.minLabel": "最低 {field}", - "data.search.aggs.metrics.minTitle": "最低", - "data.search.aggs.metrics.moving_avg.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.moving_avg.customMetric.help": "親パイプラインアグリゲーションを構築するために使用するアグリゲーション構成", - "data.search.aggs.metrics.moving_avg.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.moving_avg.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.moving_avg.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.moving_avg.metricAgg.help": "親パイプラインアグリゲーションを構築するために使用するアグリゲーション構成を検索するためのID", - "data.search.aggs.metrics.moving_avg.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.moving_avg.script.help": "親パイプラインアグリゲーションを構築するために使用するアグリゲーション構成を検索するためのID", - "data.search.aggs.metrics.moving_avg.window.help": "ヒストグラム全体でスライドするウィンドウのサイズ。", - "data.search.aggs.metrics.movingAvgLabel": "移動平均", - "data.search.aggs.metrics.movingAvgTitle": "移動平均", - "data.search.aggs.metrics.overallAverageLabel": "全体平均", - "data.search.aggs.metrics.overallMaxLabel": "全体最高", - "data.search.aggs.metrics.overallMinLabel": "全体最低", - "data.search.aggs.metrics.overallSumLabel": "全体合計", - "data.search.aggs.metrics.parentPipelineAggregationsSubtypeTitle": "親パイプライン集約", - "data.search.aggs.metrics.percentile_ranks.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.percentile_ranks.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.percentile_ranks.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.metrics.percentile_ranks.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.percentile_ranks.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.percentile_ranks.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.percentile_ranks.values.help": "パーセンタイル順位の範囲", - "data.search.aggs.metrics.percentileRanks.valuePropsLabel": "「{label}」の {format} のパーセンタイル順位", - "data.search.aggs.metrics.percentileRanksLabel": "{field} のパーセンタイル順位", - "data.search.aggs.metrics.percentileRanksTitle": "パーセンタイル順位", - "data.search.aggs.metrics.percentiles.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.percentiles.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.percentiles.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.metrics.percentiles.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.percentiles.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.percentiles.percents.help": "パーセンタイル順位の範囲", - "data.search.aggs.metrics.percentiles.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.percentiles.valuePropsLabel": "{label} の {percentile} パーセンタイル", - "data.search.aggs.metrics.percentilesLabel": "{field} のパーセンタイル", - "data.search.aggs.metrics.percentilesTitle": "パーセンタイル", - "data.search.aggs.metrics.serial_diff.buckets_path.help": "関心があるメトリックへのパス", - "data.search.aggs.metrics.serial_diff.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.serial_diff.customMetric.help": "親パイプラインアグリゲーションを構築するために使用するアグリゲーション構成", - "data.search.aggs.metrics.serial_diff.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.serial_diff.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.serial_diff.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.serial_diff.metricAgg.help": "親パイプラインアグリゲーションを構築するために使用するアグリゲーション構成を検索するためのID", - "data.search.aggs.metrics.serial_diff.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.serialDiffLabel": "差分の推移", - "data.search.aggs.metrics.serialDiffTitle": "差分の推移", - "data.search.aggs.metrics.siblingPipelineAggregationsSubtypeTitle": "シブリングパイプラインアグリゲーション", - "data.search.aggs.metrics.singlePercentile.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.singlePercentile.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.singlePercentile.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.metrics.singlePercentile.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.singlePercentile.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.singlePercentile.percentile.help": "取得するパーセンタイル", - "data.search.aggs.metrics.singlePercentile.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.singlePercentileLabel": "パーセンタイル{field}", - "data.search.aggs.metrics.singlePercentileTitle": "パーセンタイル", - "data.search.aggs.metrics.standardDeviation.keyDetailsLabel": "{fieldDisplayName} の標準偏差", - "data.search.aggs.metrics.standardDeviation.lowerKeyDetailsTitle": "下の{label}", - "data.search.aggs.metrics.standardDeviation.upperKeyDetailsTitle": "上の{label}", - "data.search.aggs.metrics.standardDeviationLabel": "{field} の標準偏差", - "data.search.aggs.metrics.standardDeviationTitle": "標準偏差", - "data.search.aggs.metrics.std_deviation.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.std_deviation.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.std_deviation.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.metrics.std_deviation.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.std_deviation.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.std_deviation.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.sum.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.sum.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.sum.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.metrics.sum.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.sum.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.sum.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.sumBucketTitle": "合計バケット", - "data.search.aggs.metrics.sumLabel": "{field} の合計", - "data.search.aggs.metrics.sumTitle": "合計", - "data.search.aggs.metrics.timeShift.help": "設定した時間の分だけメトリックの時間範囲をシフトします。例:1時間、7日。[前へ]は日付ヒストグラムまたは時間範囲フィルターから最も近い時間範囲を使用します。", - "data.search.aggs.metrics.top_hit.aggregate.help": "アグリゲーションタイプ", - "data.search.aggs.metrics.top_hit.customLabel.help": "このアグリゲーションのカスタムラベルを表します", - "data.search.aggs.metrics.top_hit.enabled.help": "このアグリゲーションが有効かどうかを指定します", - "data.search.aggs.metrics.top_hit.field.help": "このアグリゲーションで使用するフィールド", - "data.search.aggs.metrics.top_hit.id.help": "このアグリゲーションのID", - "data.search.aggs.metrics.top_hit.json.help": "アグリゲーションがElasticsearchに送信されるときに含める高度なJSON", - "data.search.aggs.metrics.top_hit.schema.help": "このアグリゲーションで使用するスキーマ", - "data.search.aggs.metrics.top_hit.size.help": "取得するバケットの最大数", - "data.search.aggs.metrics.top_hit.sortField.help": "結果を並べ替える基準のフィールド", - "data.search.aggs.metrics.top_hit.sortOrder.help": "結果を返す順序:昇順または降順", - "data.search.aggs.metrics.topHit.ascendingLabel": "昇順", - "data.search.aggs.metrics.topHit.averageLabel": "平均", - "data.search.aggs.metrics.topHit.concatenateLabel": "連結", - "data.search.aggs.metrics.topHit.descendingLabel": "降順", - "data.search.aggs.metrics.topHit.firstPrefixLabel": "最初", - "data.search.aggs.metrics.topHit.lastPrefixLabel": "最後", - "data.search.aggs.metrics.topHit.maxLabel": "最高", - "data.search.aggs.metrics.topHit.minLabel": "最低", - "data.search.aggs.metrics.topHit.sumLabel": "合計", - "data.search.aggs.metrics.topHitTitle": "トップヒット", - "data.search.aggs.metrics.uniqueCountLabel": "{field} のユニークカウント", - "data.search.aggs.metrics.uniqueCountTitle": "ユニークカウント", - "data.search.aggs.otherBucket.labelForMissingValuesLabel": "欠測値のラベル", - "data.search.aggs.otherBucket.labelForOtherBucketLabel": "他のバケットのラベル", - "data.search.aggs.paramTypes.field.invalidSavedFieldParameterErrorMessage": "「{aggType}」アグリゲーションで使用するには、インデックスパターン「{indexPatternTitle}」の保存されたフィールド「{fieldParameter}」が無効です。新しいフィールドを選択してください。", - "data.search.aggs.paramTypes.field.notFoundSavedFieldParameterErrorMessage": "このオブジェクトに関連付けられたフィールド\"{fieldParameter}\"は、インデックスパターンに存在しません。別のフィールドを使用してください。", - "data.search.aggs.paramTypes.field.requiredFieldParameterErrorMessage": "{fieldParameter} は必須パラメーターです", - "data.search.aggs.percentageOfLabel": "{label} の割合", - "data.search.aggs.string.customLabel": "カスタムラベル", - "data.search.dataRequest.title": "データ", - "data.search.es_search.dataRequest.description": "このリクエストはElasticsearchにクエリし、ビジュアライゼーション用のデータを取得します。", - "data.search.es_search.hitsDescription": "クエリにより返されたドキュメントの数です。", - "data.search.es_search.hitsLabel": "ヒット数", - "data.search.es_search.hitsTotalDescription": "クエリに一致するドキュメントの数です。", - "data.search.es_search.hitsTotalLabel": "ヒット数 (合計) ", - "data.search.es_search.indexPatternDescription": "Elasticsearchインデックスに接続したインデックスパターンです。", - "data.search.es_search.indexPatternLabel": "インデックスパターン", - "data.search.es_search.queryTimeDescription": "クエリの処理の所要時間です。リクエストの送信やブラウザーでのパースの時間は含まれません。", - "data.search.es_search.queryTimeLabel": "クエリ時間", - "data.search.es_search.queryTimeValue": "{queryTime}ms", - "data.search.esaggs.error.kibanaRequest": "サーバーでこの検索を実行するには、KibanaRequest が必要です。式実行パラメーターに要求オブジェクトを渡してください。", - "data.search.esdsl.help": "Elasticsearch リクエストを実行", - "data.search.esdsl.index.help": "クエリするElasticsearchインデックス", - "data.search.esdsl.q.help": "クエリDSL", - "data.search.esdsl.size.help": "Elasticsearch 検索 API サイズパラメーター", - "data.search.esErrorTitle": "検索結果を取得できません", - "data.search.functions.esaggs.aggConfigs.help": "agg_type 関数で構成されたアグリゲーションのリスト", - "data.search.functions.esaggs.index.help": "indexPatternLoad で取得されたインデックスパターン", - "data.search.functions.esaggs.metricsAtAllLevels.help": "各バケットレベルでメトリックがある列が含まれるかどうか", - "data.search.functions.esaggs.partialRows.help": "一部のデータのみを含む行を返すかどうか", - "data.search.functions.esaggs.timeFields.help": "クエリに対して解決された時間範囲を取得する時刻フィールドを指定します", - "data.search.functions.existsFilter.field.help": "フィルタリングするフィールドを指定します。「field」関数を使用します。", - "data.search.functions.existsFilter.help": "Kibana existsフィルターを作成", - "data.search.functions.existsFilter.negate.help": "フィルターは否定でなければなりません。", - "data.search.functions.field.help": "Kibanaフィールドを作成します。", - "data.search.functions.field.name.help": "フィールドの名前です", - "data.search.functions.field.script.help": "フィールドがスクリプト化されている場合はフィールドスクリプト。", - "data.search.functions.field.type.help": "フィールド型", - "data.search.functions.kibana_context.filters.help": "Kibana ジェネリックフィルターを指定します", - "data.search.functions.kibana_context.help": "Kibana グローバルコンテキストを更新します", - "data.search.functions.kibana_context.q.help": "自由形式の Kibana テキストクエリを指定します", - "data.search.functions.kibana_context.savedSearchId.help": "クエリとフィルターに使用する保存検索ID を指定します。", - "data.search.functions.kibana_context.timeRange.help": "Kibana 時間範囲フィルターを指定します", - "data.search.functions.kibana.help": "Kibana グローバルコンテキストを取得します", - "data.search.functions.kibanaFilter.disabled.help": "フィルターは無効でなければなりません", - "data.search.functions.kibanaFilter.field.help": "フリーフォームesdslクエリを指定", - "data.search.functions.kibanaFilter.help": "Kibanaフィルターを作成", - "data.search.functions.kibanaFilter.negate.help": "フィルターは否定でなければなりません", - "data.search.functions.kql.help": "Kibana kqlクエリ", - "data.search.functions.kql.q.help": "Kibana KQLフリーフォームテキストクエリを指定", - "data.search.functions.lucene.help": "Kibana Luceneクエリを作成", - "data.search.functions.lucene.q.help": "Kibanaフリーフォームテキストクエリを指定", - "data.search.functions.phraseFilter.field.help": "フィルタリングするフィールドを指定します。「field」関数を使用します。", - "data.search.functions.phraseFilter.help": "Kibanaフレーズまたはフレーズフィルターを作成", - "data.search.functions.phraseFilter.negate.help": "フィルターは否定でなければなりません", - "data.search.functions.phraseFilter.phrase.help": "フレーズを指定", - "data.search.functions.range.gt.help": "より大きい", - "data.search.functions.range.gte.help": "以上", - "data.search.functions.range.help": "Kibana範囲フィルターを作成", - "data.search.functions.range.lt.help": "より小さい", - "data.search.functions.range.lte.help": "以下", - "data.search.functions.rangeFilter.field.help": "フィルタリングするフィールドを指定します。「field」関数を使用します。", - "data.search.functions.rangeFilter.help": "Kibana範囲フィルターを作成", - "data.search.functions.rangeFilter.negate.help": "フィルターは否定でなければなりません", - "data.search.functions.rangeFilter.range.help": "範囲を指定し、「range」関数を使用します。", - "data.search.functions.timerange.from.help": "開始日を指定", - "data.search.functions.timerange.help": "Kibana timerangeを作成", - "data.search.functions.timerange.mode.help": "モードを指定 (絶対または相対) ", - "data.search.functions.timerange.to.help": "終了日を指定", - "data.search.httpErrorTitle": "データを取得できません", - "data.search.searchBar.savedQueryDescriptionLabelText": "説明", - "data.search.searchBar.savedQueryDescriptionText": "再度使用するクエリテキストとフィルターを保存します。", - "data.search.searchBar.savedQueryForm.titleConflictText": "タイトルがすでに保存されているクエリに使用されています", - "data.search.searchBar.savedQueryFormCancelButtonText": "キャンセル", - "data.search.searchBar.savedQueryFormSaveButtonText": "保存", - "data.search.searchBar.savedQueryFormTitle": "クエリを保存", - "data.search.searchBar.savedQueryIncludeFiltersLabelText": "フィルターを含める", - "data.search.searchBar.savedQueryIncludeTimeFilterLabelText": "時間フィルターを含める", - "data.search.searchBar.savedQueryNameHelpText": "名前が必要です。タイトルの始めと終わりにはスペースを使用できません。名前は固有でなければなりません。", - "data.search.searchBar.savedQueryNameLabelText": "名前", - "data.search.searchBar.savedQueryNoSavedQueriesText": "保存されたクエリがありません。", - "data.search.searchBar.savedQueryPopoverButtonText": "保存されたクエリを表示", - "data.search.searchBar.savedQueryPopoverClearButtonAriaLabel": "現在保存されているクエリを消去", - "data.search.searchBar.savedQueryPopoverClearButtonText": "クリア", - "data.search.searchBar.savedQueryPopoverConfirmDeletionCancelButtonText": "キャンセル", - "data.search.searchBar.savedQueryPopoverConfirmDeletionConfirmButtonText": "削除", - "data.search.searchBar.savedQueryPopoverConfirmDeletionTitle": "「{savedQueryName}」を削除しますか?", - "data.search.searchBar.savedQueryPopoverDeleteButtonAriaLabel": "保存されたクエリ {savedQueryName} を削除", - "data.search.searchBar.savedQueryPopoverSaveAsNewButtonAriaLabel": "新規保存クエリを保存", - "data.search.searchBar.savedQueryPopoverSaveAsNewButtonText": "新規保存", - "data.search.searchBar.savedQueryPopoverSaveButtonAriaLabel": "新規保存クエリを保存", - "data.search.searchBar.savedQueryPopoverSaveButtonText": "現在のクエリを保存", - "data.search.searchBar.savedQueryPopoverSaveChangesButtonAriaLabel": "{title} への変更を保存", - "data.search.searchBar.savedQueryPopoverSaveChangesButtonText": "変更を保存", - "data.search.searchBar.savedQueryPopoverSavedQueryListItemButtonAriaLabel": "保存クエリボタン {savedQueryName}", - "data.search.searchBar.savedQueryPopoverSavedQueryListItemDescriptionAriaLabel": "{savedQueryName} の説明", - "data.search.searchBar.savedQueryPopoverSavedQueryListItemSelectedButtonAriaLabel": "選択されたクエリボタン {savedQueryName} を保存しました。変更を破棄するには押してください。", - "data.search.searchBar.savedQueryPopoverTitleText": "保存されたクエリ", - "data.search.searchSource.fetch.requestTimedOutNotificationMessage": "リクエストがタイムアウトしたため、データが不完全な可能性があります", - "data.search.searchSource.fetch.shardsFailedModal.close": "閉じる", - "data.search.searchSource.fetch.shardsFailedModal.copyToClipboard": "応答をクリップボードにコピー", - "data.search.searchSource.fetch.shardsFailedModal.failureHeader": "{failureName}で{failureDetails}", - "data.search.searchSource.fetch.shardsFailedModal.showDetails": "詳細を表示", - "data.search.searchSource.fetch.shardsFailedModal.tabHeaderRequest": "リクエスト", - "data.search.searchSource.fetch.shardsFailedModal.tabHeaderResponse": "応答", - "data.search.searchSource.fetch.shardsFailedModal.tabHeaderShardFailures": "シャードエラー", - "data.search.searchSource.fetch.shardsFailedModal.tableColIndex": "インデックス", - "data.search.searchSource.fetch.shardsFailedModal.tableColNode": "ノード", - "data.search.searchSource.fetch.shardsFailedModal.tableColReason": "理由", - "data.search.searchSource.fetch.shardsFailedModal.tableColShard": "シャード", - "data.search.searchSource.fetch.shardsFailedModal.tableRowCollapse": "{rowDescription}を折りたたむ", - "data.search.searchSource.fetch.shardsFailedModal.tableRowExpand": "{rowDescription}を展開する", - "data.search.searchSource.fetch.shardsFailedNotificationDescription": "表示されているデータは不完全か誤りの可能性があります。", - "data.search.searchSource.fetch.shardsFailedNotificationMessage": "{shardsTotal} 件中 {shardsFailed} 件のシャードでエラーが発生しました", - "data.search.searchSource.hitsDescription": "クエリにより返されたドキュメントの数です。", - "data.search.searchSource.hitsLabel": "ヒット数", - "data.search.searchSource.hitsTotalDescription": "クエリに一致するドキュメントの数です。", - "data.search.searchSource.hitsTotalLabel": "ヒット数 (合計) ", - "data.search.searchSource.indexPatternDescription": "Elasticsearchインデックスに接続したインデックスパターンです。", - "data.search.searchSource.indexPatternIdDescription": "{kibanaIndexPattern} インデックス内の ID です。", - "data.search.searchSource.indexPatternIdLabel": "インデックスパターン ID", - "data.search.searchSource.indexPatternLabel": "インデックスパターン", - "data.search.searchSource.queryTimeDescription": "クエリの処理の所要時間です。リクエストの送信やブラウザーでのパースの時間は含まれません。", - "data.search.searchSource.queryTimeLabel": "クエリ時間", - "data.search.searchSource.queryTimeValue": "{queryTime}ms", - "data.search.searchSource.requestTimeDescription": "ブラウザから Elasticsearch にリクエストが送信され返されるまでの所要時間です。リクエストがキューで待機していた時間は含まれません。", - "data.search.searchSource.requestTimeLabel": "リクエスト時間", - "data.search.searchSource.requestTimeValue": "{requestTime}ms", - "data.search.timeBuckets.infinityLabel": "1年を超える", - "data.search.timeBuckets.monthLabel": "1か月", - "data.search.timeBuckets.yearLabel": "1年", - "data.search.timeoutContactAdmin": "クエリがタイムアウトしました。実行時間を延長するには、システム管理者に問い合わせてください。", - "data.search.timeoutIncreaseSetting": "クエリがタイムアウトしました。検索タイムアウト詳細設定で実行時間を延長します。", - "data.search.timeoutIncreaseSettingActionText": "設定を編集", - "data.search.unableToGetSavedQueryToastTitle": "保存したクエリ {savedQueryId} を読み込めません", - "data.searchSession.warning.readDocs": "続きを読む", - "data.searchSessionIndicator.noCapability": "検索セッションを作成するアクセス権がありません。", - "data.searchSessions.sessionService.sessionEditNameError": "検索セッションの名前を編集できませんでした", - "data.searchSessions.sessionService.sessionObjectFetchError": "検索セッション情報を取得できませんでした", - "data.triggers.applyFilterDescription": "Kibanaフィルターが適用されるとき。単一の値または範囲フィルターにすることができます。", - "data.triggers.applyFilterTitle": "フィルターを適用", - "esQuery.kql.errors.endOfInputText": "インプットの終わり", - "esQuery.kql.errors.fieldNameText": "フィールド名", - "esQuery.kql.errors.literalText": "文字通り", - "esQuery.kql.errors.syntaxError": "{expectedList} を期待しましたが {foundInput} が検出されました。", - "esQuery.kql.errors.valueText": "値", - "esQuery.kql.errors.whitespaceText": "空白類", - "devTools.badge.readOnly.text": "読み取り専用", - "devTools.badge.readOnly.tooltip": "を保存できませんでした", - "devTools.devToolsTitle": "開発ツール", - "devTools.k7BreadcrumbsDevToolsLabel": "開発ツール", - "devTools.pageTitle": "開発ツール", - "discover.advancedSettings.context.defaultSizeText": "コンテキストビューに表示される周りのエントリーの数", - "discover.advancedSettings.context.defaultSizeTitle": "コンテキストサイズ", - "discover.advancedSettings.context.sizeStepText": "コンテキストサイズを増減させる際の最低単位です", - "discover.advancedSettings.context.sizeStepTitle": "コンテキストサイズのステップ", - "discover.advancedSettings.context.tieBreakerFieldsText": "同じタイムスタンプ値のドキュメントを区別するためのコンマ区切りのフィールドのリストです。このリストから、現在のインデックスパターンに含まれ並べ替え可能な初めのフィールドが使用されます。", - "discover.advancedSettings.context.tieBreakerFieldsTitle": "タイブレーカーフィールド", - "discover.advancedSettings.defaultColumnsText": "デフォルトで Discover タブに表示される列です", - "discover.advancedSettings.defaultColumnsTitle": "デフォルトの列", - "discover.advancedSettings.discover.modifyColumnsOnSwitchText": "新しいインデックスパターンで使用できない列を削除します。", - "discover.advancedSettings.discover.modifyColumnsOnSwitchTitle": "インデックスパターンを変更するときに列を修正", - "discover.advancedSettings.discover.multiFieldsLinkText": "マルチフィールド", - "discover.advancedSettings.discover.readFieldsFromSource": "_sourceからフィールドを読み取る", - "discover.advancedSettings.discover.readFieldsFromSourceDescription": "有効にすると、「_source」から直接ドキュメントを読み込みます。これはまもなく廃止される予定です。無効にすると、上位レベルの検索サービスで新しいフィールドAPI経由でフィールドを取得します。", - "discover.advancedSettings.discover.showMultifields": "マルチフィールドを表示", - "discover.advancedSettings.discover.showMultifieldsDescription": "拡張ドキュメントビューに{multiFields}が表示されるかどうかを制御します。ほとんどの場合、マルチフィールドは元のフィールドと同じです。「searchFieldsFromSource」がオフのときにのみこのオプションを使用できます。", - "discover.advancedSettings.docTableHideTimeColumnText": "Discover と、ダッシュボードのすべての保存された検索で、「時刻」列を非表示にします。", - "discover.advancedSettings.docTableHideTimeColumnTitle": "「時刻」列を非表示", - "discover.advancedSettings.docTableVersionDescription": "Discover は、データの並べ替え、列のドラッグアンドドロップ、全画面表示を含む新しいテーブルレイアウトを使用します。このオプションをオンにすると、クラシックテーブルを使用します。オフにすると、新しいテーブルを使用します。", - "discover.advancedSettings.docTableVersionName": "クラシックテーブルを使用", - "discover.advancedSettings.fieldsPopularLimitText": "最も頻繁に使用されるフィールドのトップNを表示します", - "discover.advancedSettings.fieldsPopularLimitTitle": "頻繁に使用されるフィールドの制限", - "discover.advancedSettings.maxDocFieldsDisplayedText": "ドキュメント列でレンダリングされたフィールドの最大数", - "discover.advancedSettings.maxDocFieldsDisplayedTitle": "表示される最大ドキュメントフィールド数", - "discover.advancedSettings.sampleSizeText": "表に表示する行数です", - "discover.advancedSettings.sampleSizeTitle": "行数", - "discover.advancedSettings.searchOnPageLoadText": "Discover の最初の読み込み時に検索を実行するかを制御します。この設定は、保存された検索の読み込み時には影響しません。", - "discover.advancedSettings.searchOnPageLoadTitle": "ページの読み込み時の検索", - "discover.advancedSettings.sortDefaultOrderText": "Discover アプリのインデックスパターンに基づく時刻のデフォルトの並べ替え方向をコントロールします。", - "discover.advancedSettings.sortDefaultOrderTitle": "デフォルトの並べ替え方向", - "discover.advancedSettings.sortOrderAsc": "昇順", - "discover.advancedSettings.sortOrderDesc": "降順", - "discover.backToTopLinkText": "最上部へ戻る。", - "discover.badge.readOnly.text": "読み取り専用", - "discover.badge.readOnly.tooltip": "検索を保存できません", - "discover.bucketIntervalTooltip": "この間隔は選択された時間範囲に表示される{bucketsDescription}が作成されるため、{bucketIntervalDescription}にスケーリングされています。", - "discover.bucketIntervalTooltip.tooLargeBucketsText": "大きすぎるバケット", - "discover.bucketIntervalTooltip.tooManyBucketsText": "バケットが多すぎます", - "discover.clearSelection": "選択した項目をクリア", - "discover.context.breadcrumb": "周りのドキュメント", - "discover.context.contextOfTitle": "#{anchorId}の周りのドキュメント", - "discover.context.failedToLoadAnchorDocumentDescription": "アンカードキュメントの読み込みに失敗しました", - "discover.context.failedToLoadAnchorDocumentErrorDescription": "アンカードキュメントの読み込みに失敗しました。", - "discover.context.invalidTieBreakerFiledSetting": "無効なタイブレーカーフィールド設定", - "discover.context.loadButtonLabel": "読み込み", - "discover.context.loadingDescription": "読み込み中...", - "discover.context.newerDocumentsAriaLabel": "新しいドキュメントの数", - "discover.context.newerDocumentsDescription": "新しいドキュメント", - "discover.context.newerDocumentsWarning": "アンカーよりも新しいドキュメントは{docCount}件しか見つかりませんでした。", - "discover.context.newerDocumentsWarningZero": "アンカーよりも新しいドキュメントは見つかりませんでした。", - "discover.context.olderDocumentsAriaLabel": "古いドキュメントの数", - "discover.context.olderDocumentsDescription": "古いドキュメント", - "discover.context.olderDocumentsWarning": "アンカーよりも古いドキュメントは{docCount}件しか見つかりませんでした。", - "discover.context.olderDocumentsWarningZero": "アンカーよりも古いドキュメントは見つかりませんでした。", - "discover.context.reloadPageDescription.reloadOrVisitTextMessage": "ドキュメントリストを再読み込みするか、ドキュメントリストに戻り、有効なアンカードキュメントを選択してください。", - "discover.context.unableToLoadAnchorDocumentDescription": "アンカードキュメントを読み込めません", - "discover.context.unableToLoadDocumentDescription": "ドキュメントを読み込めません", - "discover.controlColumnHeader": "列の制御", - "discover.copyToClipboardJSON": "ドキュメントをクリップボードにコピー (JSON) ", - "discover.discoverBreadcrumbTitle": "Discover", - "discover.discoverDefaultSearchSessionName": "Discover", - "discover.discoverDescription": "ドキュメントにクエリをかけたりフィルターを適用することで、データをインタラクティブに閲覧できます。", - "discover.discoverSubtitle": "インサイトを検索して見つけます。", - "discover.discoverTitle": "Discover", - "discover.doc.couldNotFindDocumentsDescription": "そのIDに一致するドキュメントがありません。", - "discover.doc.failedToExecuteQueryDescription": "検索の実行に失敗しました", - "discover.doc.failedToLocateDocumentDescription": "ドキュメントが見つかりませんでした", - "discover.doc.failedToLocateIndexPattern": "ID {indexPatternId}に一致するインデックスパターンがありません。", - "discover.doc.loadingDescription": "読み込み中…", - "discover.doc.somethingWentWrongDescription": "{indexName}が見つかりません。", - "discover.doc.somethingWentWrongDescriptionAddon": "インデックスが存在することを確認してください。", - "discover.docTable.limitedSearchResultLabel": "{resultCount}件の結果のみが表示されます。検索結果を絞り込みます。", - "discover.docTable.noResultsTitle": "結果が見つかりませんでした", - "discover.docTable.tableHeader.documentHeader": "ドキュメント", - "discover.docTable.tableHeader.moveColumnLeftButtonAriaLabel": "{columnName}列を左に移動", - "discover.docTable.tableHeader.moveColumnLeftButtonTooltip": "列を左に移動", - "discover.docTable.tableHeader.moveColumnRightButtonAriaLabel": "{columnName}列を右に移動", - "discover.docTable.tableHeader.moveColumnRightButtonTooltip": "列を右に移動", - "discover.docTable.tableHeader.removeColumnButtonAriaLabel": "{columnName}列を削除", - "discover.docTable.tableHeader.removeColumnButtonTooltip": "列の削除", - "discover.docTable.tableHeader.sortByColumnAscendingAriaLabel": "{columnName}を昇順に並べ替える", - "discover.docTable.tableHeader.sortByColumnDescendingAriaLabel": "{columnName}を降順に並べ替える", - "discover.docTable.tableHeader.sortByColumnUnsortedAriaLabel": "{columnName}で並べ替えを止める", - "discover.docTable.tableRow.detailHeading": "拡張ドキュメント", - "discover.docTable.tableRow.filterForValueButtonAriaLabel": "値でフィルター", - "discover.docTable.tableRow.filterForValueButtonTooltip": "値でフィルター", - "discover.docTable.tableRow.filterOutValueButtonAriaLabel": "値を除外", - "discover.docTable.tableRow.filterOutValueButtonTooltip": "値を除外", - "discover.docTable.tableRow.toggleRowDetailsButtonAriaLabel": "行の詳細を切り替える", - "discover.docTable.tableRow.viewSingleDocumentLinkText": "単一のドキュメントを表示", - "discover.docTable.tableRow.viewSurroundingDocumentsLinkText": "周りのドキュメントを表示", - "discover.documentsAriaLabel": "ドキュメント", - "discover.docViews.json.jsonTitle": "JSON", - "discover.docViews.table.filterForFieldPresentButtonAriaLabel": "フィールド表示のフィルター", - "discover.docViews.table.filterForFieldPresentButtonTooltip": "フィールド表示のフィルター", - "discover.docViews.table.filterForValueButtonAriaLabel": "値でフィルター", - "discover.docViews.table.filterForValueButtonTooltip": "値でフィルター", - "discover.docViews.table.filterOutValueButtonAriaLabel": "値を除外", - "discover.docViews.table.filterOutValueButtonTooltip": "値を除外", - "discover.docViews.table.tableTitle": "表", - "discover.docViews.table.toggleColumnInTableButtonAriaLabel": "表の列を切り替える", - "discover.docViews.table.toggleColumnInTableButtonTooltip": "表の列を切り替える", - "discover.docViews.table.toggleFieldDetails": "フィールド詳細を切り替える", - "discover.docViews.table.unableToFilterForPresenceOfMetaFieldsTooltip": "メタフィールドの有無でフィルタリングできません", - "discover.docViews.table.unableToFilterForPresenceOfScriptedFieldsTooltip": "スクリプトフィールドの有無でフィルタリングできません", - "discover.docViews.table.unindexedFieldsCanNotBeSearchedTooltip": "インデックスされていないフィールドは検索できません", - "discover.embeddable.inspectorRequestDataTitle": "データ", - "discover.embeddable.inspectorRequestDescription": "このリクエストはElasticsearchにクエリをかけ、検索データを取得します。", - "discover.embeddable.search.displayName": "検索", - "discover.field.mappingConflict": "このフィールドは、このパターンと一致するインデックス全体に対して複数の型 (文字列、整数など) として定義されています。この競合フィールドを使用することはできますが、Kibana で型を認識する必要がある関数では使用できません。この問題を修正するにはデータのレンダリングが必要です。", - "discover.field.mappingConflict.title": "マッピングの矛盾", - "discover.field.title": "{fieldName} ({fieldDisplayName})", - "discover.fieldChooser.detailViews.emptyStringText": "空の文字列", - "discover.fieldChooser.detailViews.existsInRecordsText": "{value} / {totalValue}件のレコードに存在", - "discover.fieldChooser.detailViews.filterOutValueButtonAriaLabel": "{field}を除外:\"{value}\"", - "discover.fieldChooser.detailViews.filterValueButtonAriaLabel": "{field}を除外:\"{value}\"", - "discover.fieldChooser.detailViews.valueOfRecordsText": "{value} / {totalValue}件のレコード", - "discover.fieldChooser.discoverField.addButtonAriaLabel": "{field}を表に追加", - "discover.fieldChooser.discoverField.addFieldTooltip": "フィールドを列として追加", - "discover.fieldChooser.discoverField.deleteFieldLabel": "インデックスパターンフィールドを削除", - "discover.fieldChooser.discoverField.editFieldLabel": "インデックスパターンフィールドを編集", - "discover.fieldChooser.discoverField.fieldTopValuesLabel": "トップ5の値", - "discover.fieldChooser.discoverField.multiFields": "マルチフィールド", - "discover.fieldChooser.discoverField.removeButtonAriaLabel": "{field}を表から削除", - "discover.fieldChooser.discoverField.removeFieldTooltip": "フィールドを表から削除", - "discover.fieldChooser.fieldCalculator.analysisIsNotAvailableForGeoFieldsErrorMessage": "ジオフィールドは分析できません。", - "discover.fieldChooser.fieldCalculator.analysisIsNotAvailableForObjectFieldsErrorMessage": "オブジェクトフィールドは分析できません。", - "discover.fieldChooser.fieldCalculator.fieldIsNotPresentInDocumentsErrorMessage": "このフィールドはElasticsearchマッピングに表示されますが、ドキュメントテーブルの{hitsLength}件のドキュメントには含まれません。可視化や検索は可能な場合があります。", - "discover.fieldChooser.fieldFilterButtonLabel": "タイプでフィルタリング", - "discover.fieldChooser.fieldsMobileButtonLabel": "フィールド", - "discover.fieldChooser.filter.aggregatableLabel": "集約可能", - "discover.fieldChooser.filter.availableFieldsTitle": "利用可能なフィールド", - "discover.fieldChooser.filter.fieldSelectorLabel": "{id}フィルターオプションの選択", - "discover.fieldChooser.filter.filterByTypeLabel": "タイプでフィルタリング", - "discover.fieldChooser.filter.hideMissingFieldsLabel": "未入力のフィールドを非表示", - "discover.fieldChooser.filter.indexAndFieldsSectionAriaLabel": "インデックスとフィールド", - "discover.fieldChooser.filter.popularTitle": "人気", - "discover.fieldChooser.filter.searchableLabel": "検索可能", - "discover.fieldChooser.filter.selectedFieldsTitle": "スクリプトフィールド", - "discover.fieldChooser.filter.toggleButton.any": "すべて", - "discover.fieldChooser.filter.toggleButton.no": "いいえ", - "discover.fieldChooser.filter.toggleButton.yes": "はい", - "discover.fieldChooser.filter.typeLabel": "型", - "discover.fieldChooser.indexPattern.changeIndexPatternTitle": "インデックスパターンを変更", - "discover.fieldChooser.indexPatterns.actionsPopoverLabel": "インデックスパターン設定", - "discover.fieldChooser.indexPatterns.addFieldButton": "フィールドをインデックスパターンに追加", - "discover.fieldChooser.indexPatterns.manageFieldButton": "インデックスパターンを管理", - "discover.fieldChooser.searchPlaceHolder": "検索フィールド名", - "discover.fieldChooser.toggleFieldFilterButtonHideAriaLabel": "フィールド設定を非表示", - "discover.fieldChooser.toggleFieldFilterButtonShowAriaLabel": "フィールド設定を表示", - "discover.fieldChooser.visualizeButton.label": "可視化", - "discover.fieldList.flyoutBackIcon": "戻る", - "discover.fieldList.flyoutHeading": "フィールドリスト", - "discover.fieldNameIcons.booleanAriaLabel": "ブールフィールド", - "discover.fieldNameIcons.conflictFieldAriaLabel": "矛盾フィールド", - "discover.fieldNameIcons.dateFieldAriaLabel": "日付フィールド", - "discover.fieldNameIcons.geoPointFieldAriaLabel": "地理ポイントフィールド", - "discover.fieldNameIcons.geoShapeFieldAriaLabel": "地理情報シェイプフィールド", - "discover.fieldNameIcons.ipAddressFieldAriaLabel": "IPアドレスフィールド", - "discover.fieldNameIcons.murmur3FieldAriaLabel": "Murmur3フィールド", - "discover.fieldNameIcons.nestedFieldAriaLabel": "入れ子フィールド", - "discover.fieldNameIcons.numberFieldAriaLabel": "数値フィールド", - "discover.fieldNameIcons.sourceFieldAriaLabel": "ソースフィールド", - "discover.fieldNameIcons.stringFieldAriaLabel": "文字列フィールド", - "discover.fieldNameIcons.unknownFieldAriaLabel": "不明なフィールド", - "discover.grid.documentHeader": "ドキュメント", - "discover.grid.filterFor": "フィルター", - "discover.grid.filterForAria": "この{value}でフィルターを適用", - "discover.grid.filterOut": "除外", - "discover.grid.filterOutAria": "この{value}を除外", - "discover.grid.flyout.documentNavigation": "ドキュメントナビゲーション", - "discover.grid.flyout.toastColumnAdded": "列'{columnName}'が追加されました", - "discover.grid.flyout.toastColumnRemoved": "列'{columnName}'が削除されました", - "discover.grid.flyout.toastFilterAdded": "フィルターが追加されました", - "discover.grid.tableRow.detailHeading": "拡張ドキュメント", - "discover.grid.tableRow.viewSingleDocumentLinkTextSimple": "1つのドキュメント", - "discover.grid.tableRow.viewSurroundingDocumentsLinkTextSimple": "周りのドキュメント", - "discover.grid.tableRow.viewText": "表示:", - "discover.grid.viewDoc": "詳細ダイアログを切り替え", - "discover.helpMenu.appName": "Discover", - "discover.hideChart": "グラフを非表示", - "discover.histogramOfFoundDocumentsAriaLabel": "検出されたドキュメントのヒストグラム", - "discover.howToChangeTheTimeTooltip": "時刻を変更するには、グローバル時刻フィルターを使用します。", - "discover.howToSeeOtherMatchingDocumentsDescription": "これらは検索条件に一致した初めの {sampleSize} 件のドキュメントです。他の結果を表示するには検索条件を絞ってください。", - "discover.howToSeeOtherMatchingDocumentsDescriptionGrid": "これらは検索条件に一致した初めの {sampleSize} 件のドキュメントです。他の結果を表示するには検索条件を絞ってください。", - "discover.inspectorRequestDescriptionDocument": "このリクエストはElasticsearchにクエリをかけ、検索データを取得します。", - "discover.json.codeEditorAriaLabel": "Elasticsearch ドキュメントの JSON ビューのみを読み込む", - "discover.json.copyToClipboardLabel": "クリップボードにコピー", - "discover.loadingJSON": "JSONを読み込んでいます", - "discover.loadingResults": "結果を読み込み中", - "discover.localMenu.fallbackReportTitle": "Discover検索[{date}]", - "discover.localMenu.inspectTitle": "検査", - "discover.localMenu.localMenu.newSearchTitle": "新規", - "discover.localMenu.localMenu.optionsTitle": "オプション", - "discover.localMenu.newSearchDescription": "新規検索", - "discover.localMenu.openInspectorForSearchDescription": "検索用にインスペクターを開きます", - "discover.localMenu.openSavedSearchDescription": "保存された検索を開きます", - "discover.localMenu.openTitle": "開く", - "discover.localMenu.optionsDescription": "オプション", - "discover.localMenu.saveSaveSearchDescription": "ビジュアライゼーションとダッシュボードで使用できるように Discover の検索を保存します", - "discover.localMenu.saveSearchDescription": "検索を保存します", - "discover.localMenu.saveTitle": "保存", - "discover.localMenu.shareSearchDescription": "検索を共有します", - "discover.localMenu.shareTitle": "共有", - "discover.noResults.expandYourTimeRangeTitle": "時間範囲を拡大", - "discover.noResults.queryMayNotMatchTitle": "1つ以上の表示されているインデックスに日付フィールドが含まれています。クエリが現在の時間範囲のデータと一致しないか、現在選択された時間範囲にデータがまったく存在しない可能性があります。データが存在する時間範囲に変えることができます。", - "discover.noResults.searchExamples.noResultsBecauseOfError": "検索結果の取得中にエラーが発生しました", - "discover.noResults.searchExamples.noResultsMatchSearchCriteriaTitle": "検索条件と一致する結果がありません。", - "discover.noResultsFound": "結果が見つかりませんでした", - "discover.notifications.invalidTimeRangeText": "指定された時間範囲が無効です。 (開始:'{from}'、終了:'{to}') ", - "discover.notifications.invalidTimeRangeTitle": "無効な時間範囲", - "discover.notifications.notSavedSearchTitle": "検索「{savedSearchTitle}」は保存されませんでした。", - "discover.notifications.savedSearchTitle": "検索「{savedSearchTitle}」が保存されました。", - "discover.openOptionsPopover.dataGridText": "新しいテーブル", - "discover.openOptionsPopover.goToAdvancedSettings": "使ってみる", - "discover.openOptionsPopover.gotToAllSettings": "すべてのDiscoverオプション", - "discover.openOptionsPopover.legacyTableText": "クラシックテーブル", - "discover.reloadSavedSearchButton": "検索をリセット", - "discover.removeColumnLabel": "列を削除", - "discover.rootBreadcrumb": "Discover", - "discover.savedSearch.savedObjectName": "保存検索", - "discover.searchGenerationWithDescription": "検索{searchTitle}で生成されたテーブル", - "discover.searchGenerationWithDescriptionGrid": "検索{searchTitle}で生成されたテーブル ({searchDescription}) ", - "discover.searchingTitle": "検索中", - "discover.selectColumnHeader": "列を選択", - "discover.selectedDocumentsNumber": "{nr}個のドキュメントが選択されました", - "discover.showAllDocuments": "すべてのドキュメントを表示", - "discover.showChart": "グラフを表示", - "discover.showErrorMessageAgain": "エラーメッセージを表示", - "discover.showingDefaultIndexPatternWarningDescription": "デフォルトのインデックスパターン「{loadedIndexPatternTitle}」 ({loadedIndexPatternId}) を表示中", - "discover.showingSavedIndexPatternWarningDescription": "保存されたインデックスパターン「{ownIndexPatternTitle}」 ({ownIndexPatternId}) を表示中", - "discover.showSelectedDocumentsOnly": "選択したドキュメントのみを表示", - "discover.skipToBottomButtonLabel": "テーブルの最後に移動", - "discover.sourceViewer.errorMessage": "現在データを取得できませんでした。タブを更新して、再試行してください。", - "discover.sourceViewer.errorMessageTitle": "エラーが発生しました", - "discover.sourceViewer.refresh": "更新", - "discover.timechartHeader.timeIntervalSelect.ariaLabel": "時間間隔", - "discover.timechartHeader.timeIntervalSelect.per": "ごと", - "discover.timeLabel": "時間", - "discover.toggleSidebarAriaLabel": "サイドバーを切り替える", - "discover.topNav.openOptionsPopover.description": "お知らせDiscoverでは、データの並べ替え、列のドラッグアンドドロップ、ドキュメントの比較を行う方法が改善されました。詳細設定で[クラシックテーブルを使用]を切り替えて、開始します。", - "discover.topNav.openSearchPanel.manageSearchesButtonLabel": "検索の管理", - "discover.topNav.openSearchPanel.noSearchesFoundDescription": "一致する検索が見つかりませんでした。", - "discover.topNav.openSearchPanel.openSearchTitle": "検索を開く", - "discover.topNav.optionsPopover.currentViewMode": "{viewModeLabel}: {currentViewMode}", - "discover.topNav.optionsPopover.currentViewModeLabel": "現在のビューモード", - "discover.uninitializedRefreshButtonText": "データを更新", - "discover.uninitializedText": "クエリを作成、フィルターを追加、または[更新]をクリックして、現在のクエリの結果を取得します。", - "discover.uninitializedTitle": "検索開始", - "discover.valueIsNotConfiguredIndexPatternIDWarningTitle": "{stateVal}は設定されたインデックスパターンIDではありません", - "embeddableApi.addPanel.createNewDefaultOption": "新規作成", - "embeddableApi.addPanel.displayName": "パネルの追加", - "embeddableApi.addPanel.noMatchingObjectsMessage": "一致するオブジェクトが見つかりませんでした。", - "embeddableApi.addPanel.savedObjectAddedToContainerSuccessMessageTitle": "{savedObjectName} が追加されました", - "embeddableApi.addPanel.Title": "ライブラリから追加", - "embeddableApi.attributeService.saveToLibraryError": "保存中にエラーが発生しました。エラー:{errorMessage}", - "embeddableApi.contextMenuTrigger.description": "パネルの右上のコンテキストメニューをクリックします。", - "embeddableApi.contextMenuTrigger.title": "コンテキストメニュー", - "embeddableApi.customizePanel.action.displayName": "パネルタイトルを編集", - "embeddableApi.customizePanel.modal.cancel": "キャンセル", - "embeddableApi.customizePanel.modal.optionsMenuForm.panelTitleFormRowLabel": "パネルタイトル", - "embeddableApi.customizePanel.modal.optionsMenuForm.panelTitleInputAriaLabel": "パネルのカスタムタイトルを入力してください", - "embeddableApi.customizePanel.modal.optionsMenuForm.resetCustomDashboardButtonLabel": "リセット", - "embeddableApi.customizePanel.modal.saveButtonTitle": "保存", - "embeddableApi.customizePanel.modal.showTitle": "パネルタイトルを表示", - "embeddableApi.customizeTitle.optionsMenuForm.panelTitleFormRowLabel": "パネルタイトル", - "embeddableApi.customizeTitle.optionsMenuForm.panelTitleInputAriaLabel": "このインプットへの変更は直ちに適用されます。Enter を押して閉じます。", - "embeddableApi.customizeTitle.optionsMenuForm.resetCustomDashboardButtonLabel": "タイトルをリセット", - "embeddableApi.errors.embeddableFactoryNotFound": "{type} を読み込めません。Elasticsearch と Kibana のデフォルトのディストリビューションを適切なライセンスでアップグレードしてください。", - "embeddableApi.errors.paneldoesNotExist": "パネルが見つかりません", - "embeddableApi.helloworld.displayName": "こんにちは", - "embeddableApi.panel.dashboardPanelAriaLabel": "ダッシュボードパネル", - "embeddableApi.panel.editPanel.displayName": "{value} を編集", - "embeddableApi.panel.editTitleAriaLabel": "クリックしてタイトルを編集:{title}", - "embeddableApi.panel.enhancedDashboardPanelAriaLabel": "ダッシュボードパネル:{title}", - "embeddableApi.panel.inspectPanel.displayName": "検査", - "embeddableApi.panel.inspectPanel.untitledEmbeddableFilename": "無題", - "embeddableApi.panel.labelAborted": "中断しました", - "embeddableApi.panel.labelError": "エラー", - "embeddableApi.panel.optionsMenu.panelOptionsButtonAriaLabel": "パネルオプション", - "embeddableApi.panel.optionsMenu.panelOptionsButtonEnhancedAriaLabel": "{title} のパネルオプション", - "embeddableApi.panel.placeholderTitle": "[タイトルなし]", - "embeddableApi.panel.removePanel.displayName": "ダッシュボードから削除", - "embeddableApi.panelBadgeTrigger.description": "パネルに埋め込み可能なファイルが読み込まれるときに、アクションがタイトルバーに表示されます。", - "embeddableApi.panelBadgeTrigger.title": "パネルバッジ", - "embeddableApi.panelNotificationTrigger.description": "パネルの右上にアクションが表示されます。", - "embeddableApi.panelNotificationTrigger.title": "パネル通知", - "embeddableApi.samples.contactCard.displayName": "連絡先カード", - "embeddableApi.samples.filterableContainer.displayName": "フィルター可能なダッシュボード", - "embeddableApi.samples.filterableEmbeddable.displayName": "フィルター可能", - "embeddableApi.selectRangeTrigger.description": "ビジュアライゼーションでの値の範囲", - "embeddableApi.selectRangeTrigger.title": "範囲選択", - "embeddableApi.valueClickTrigger.description": "ビジュアライゼーションでデータポイントをクリック", - "embeddableApi.valueClickTrigger.title": "シングルクリック", - "esUi.cronEditor.cronDaily.fieldHour.textAtLabel": "に", - "esUi.cronEditor.cronDaily.fieldTimeLabel": "時間", - "esUi.cronEditor.cronDaily.hourSelectLabel": "時間", - "esUi.cronEditor.cronDaily.minuteSelectLabel": "分", - "esUi.cronEditor.cronHourly.fieldMinute.textAtLabel": "に", - "esUi.cronEditor.cronHourly.fieldTimeLabel": "分", - "esUi.cronEditor.cronMonthly.fieldDateLabel": "日付", - "esUi.cronEditor.cronMonthly.fieldHour.textAtLabel": "に", - "esUi.cronEditor.cronMonthly.fieldTimeLabel": "時間", - "esUi.cronEditor.cronMonthly.hourSelectLabel": "時間", - "esUi.cronEditor.cronMonthly.minuteSelectLabel": "分", - "esUi.cronEditor.cronMonthly.textOnTheLabel": "に", - "esUi.cronEditor.cronWeekly.fieldDateLabel": "日", - "esUi.cronEditor.cronWeekly.fieldHour.textAtLabel": "に", - "esUi.cronEditor.cronWeekly.fieldTimeLabel": "時間", - "esUi.cronEditor.cronWeekly.hourSelectLabel": "時間", - "esUi.cronEditor.cronWeekly.minuteSelectLabel": "分", - "esUi.cronEditor.cronWeekly.textOnLabel": "オン", - "esUi.cronEditor.cronYearly.fieldDate.textOnTheLabel": "に", - "esUi.cronEditor.cronYearly.fieldDateLabel": "日付", - "esUi.cronEditor.cronYearly.fieldHour.textAtLabel": "に", - "esUi.cronEditor.cronYearly.fieldMonth.textInLabel": "入", - "esUi.cronEditor.cronYearly.fieldMonthLabel": "月", - "esUi.cronEditor.cronYearly.fieldTimeLabel": "時間", - "esUi.cronEditor.cronYearly.hourSelectLabel": "時間", - "esUi.cronEditor.cronYearly.minuteSelectLabel": "分", - "esUi.cronEditor.day.friday": "金曜日", - "esUi.cronEditor.day.monday": "月曜日", - "esUi.cronEditor.day.saturday": "土曜日", - "esUi.cronEditor.day.sunday": "日曜日", - "esUi.cronEditor.day.thursday": "木曜日", - "esUi.cronEditor.day.tuesday": "火曜日", - "esUi.cronEditor.day.wednesday": "水曜日", - "esUi.cronEditor.fieldFrequencyLabel": "頻度", - "esUi.cronEditor.month.april": "4 月", - "esUi.cronEditor.month.august": "8 月", - "esUi.cronEditor.month.december": "12 月", - "esUi.cronEditor.month.february": "2 月", - "esUi.cronEditor.month.january": "1 月", - "esUi.cronEditor.month.july": "7 月", - "esUi.cronEditor.month.june": "6 月", - "esUi.cronEditor.month.march": "3 月", - "esUi.cronEditor.month.may": "5月", - "esUi.cronEditor.month.november": "11 月", - "esUi.cronEditor.month.october": "10 月", - "esUi.cronEditor.month.september": "9 月", - "esUi.cronEditor.textEveryLabel": "毎", - "esUi.forms.comboBoxField.placeHolderText": "入力してエンターキーを押してください", - "esUi.forms.fieldValidation.indexNameSpacesError": "インデックス名にはスペースを使用できません。", - "esUi.forms.fieldValidation.indexNameStartsWithDotError": "インデックス名の始めにピリオド (.) は使用できません。", - "esUi.forms.fieldValidation.indexPatternSpacesError": "インデックスパターンにはスペースを使用できません。", - "esUi.formWizard.backButtonLabel": "戻る", - "esUi.formWizard.nextButtonLabel": "次へ", - "esUi.formWizard.saveButtonLabel": "保存", - "esUi.formWizard.savingButtonLabel": "保存中...", - "esUi.validation.string.invalidJSONError": "無効なJSON", - "expressions.defaultErrorRenderer.errorTitle": "ビジュアライゼーションエラー", - "expressions.execution.functionDisabled": "関数 {fnName} が無効です。", - "expressions.execution.functionNotFound": "関数 {fnName} が見つかりませんでした。", - "expressions.functions.cumulativeSum.args.byHelpText": "累積和計算を分割する列", - "expressions.functions.cumulativeSum.args.inputColumnIdHelpText": "累積和を計算する列", - "expressions.functions.cumulativeSum.args.outputColumnIdHelpText": "結果の累積和を格納する列", - "expressions.functions.cumulativeSum.args.outputColumnNameHelpText": "結果の累積和を格納する列の名前", - "expressions.functions.cumulativeSum.help": "データテーブルの列の累積和を計算します", - "expressions.functions.derivative.args.byHelpText": "微分係数計算を分割する列", - "expressions.functions.derivative.args.inputColumnIdHelpText": "微分係数を計算する列", - "expressions.functions.derivative.args.outputColumnIdHelpText": "結果の微分係数を格納する列", - "expressions.functions.derivative.args.outputColumnNameHelpText": "結果の微分係数を格納する列の名前", - "expressions.functions.derivative.help": "データテーブルの列の微分係数を計算します", - "expressions.functions.font.args.alignHelpText": "水平テキスト配置", - "expressions.functions.font.args.colorHelpText": "文字の色です。", - "expressions.functions.font.args.familyHelpText": "利用可能な{css}ウェブフォント文字列です", - "expressions.functions.font.args.italicHelpText": "テキストを斜体にしますか?", - "expressions.functions.font.args.lHeightHelpText": "ピクセル単位の行の高さです。", - "expressions.functions.font.args.sizeHelpText": "ピクセル単位のフォントサイズです。", - "expressions.functions.font.args.underlineHelpText": "テキストに下線を引きますか?", - "expressions.functions.font.args.weightHelpText": "フォントの重量です。たとえば、{list}、または {end}です。", - "expressions.functions.font.invalidFontWeightErrorMessage": "無効なフォント太さ:'{weight}'", - "expressions.functions.font.invalidTextAlignmentErrorMessage": "無効なテキストアラインメント:'{align}'", - "expressions.functions.fontHelpText": "フォントスタイルを作成します。", - "expressions.functions.mapColumn.args.copyMetaFromHelpText": "設定されている場合、指定した列IDのメタオブジェクトが指定したターゲット列にコピーされます。列が存在しない場合は失敗し、エラーは表示されません。", - "expressions.functions.mapColumn.args.expressionHelpText": "すべての行で実行される式。単一行の{DATATABLE}と一緒に指定され、セル値を返します。", - "expressions.functions.mapColumn.args.idHelpText": "結果列の任意のID。IDが指定されていないときには、指定された名前引数で既存の列からルックアップされます。この名前の列が存在しない場合、この名前と同じIDの新しい列がテーブルに追加されます。", - "expressions.functions.mapColumn.args.nameHelpText": "結果の列の名前です。名前は一意である必要はありません。", - "expressions.functions.mapColumnHelpText": "他の列の結果として計算された列を追加します。引数が指定された場合のみ変更が加えられます。{alterColumnFn}と{staticColumnFn}もご参照ください。", - "expressions.functions.math.args.expressionHelpText": "評価された {TINYMATH} 表現です。{TINYMATH_URL} をご覧ください。", - "expressions.functions.math.args.onErrorHelpText": "{TINYMATH}評価が失敗するか、NaNが返される場合、戻り値はonErrorで指定されます。「'throw'」の場合、例外が発生し、式の実行が終了します (デフォルト) 。", - "expressions.functions.math.emptyDatatableErrorMessage": "空のデータベース", - "expressions.functions.math.emptyExpressionErrorMessage": "空の表現", - "expressions.functions.math.executionFailedErrorMessage": "数式の実行に失敗しました。列名を確認してください", - "expressions.functions.math.tooManyResultsErrorMessage": "式は 1 つの数字を返す必要があります。表現を {mean} または {sum} で囲んでみてください", - "expressions.functions.mathColumn.args.copyMetaFromHelpText": "設定されている場合、指定した列IDのメタオブジェクトが指定したターゲット列にコピーされます。列が存在しない場合は失敗し、エラーは表示されません。", - "expressions.functions.mathColumn.args.idHelpText": "結果の列のIDです。一意でなければなりません。", - "expressions.functions.mathColumn.args.nameHelpText": "結果の列の名前です。名前は一意である必要はありません。", - "expressions.functions.mathColumn.arrayValueError": "{name}で配列値に対する演算を実行できません", - "expressions.functions.mathColumn.uniqueIdError": "IDは一意でなければなりません", - "expressions.functions.mathColumnHelpText": "他の列の結果として計算された列を追加します。引数が指定された場合のみ変更が加えられます。{alterColumnFn}と{staticColumnFn}もご参照ください。", - "expressions.functions.mathHelpText": "{TYPE_NUMBER}または{DATATABLE}を{CONTEXT}として使用して、{TINYMATH}数式を解釈します。{DATATABLE}列は列名で表示されます。{CONTEXT}が数字の場合は、{value}と表示されます。", - "expressions.functions.movingAverage.args.byHelpText": "移動平均計算を分割する列", - "expressions.functions.movingAverage.args.inputColumnIdHelpText": "移動平均を計算する列", - "expressions.functions.movingAverage.args.outputColumnIdHelpText": "結果の移動平均を格納する列", - "expressions.functions.movingAverage.args.outputColumnNameHelpText": "結果の移動平均を格納する列の名前", - "expressions.functions.movingAverage.args.windowHelpText": "ヒストグラム全体でスライドするウィンドウのサイズ。", - "expressions.functions.movingAverage.help": "データテーブルの列の移動平均を計算します", - "expressions.functions.overallMetric.args.byHelpText": "全体の計算を分割する列", - "expressions.functions.overallMetric.args.inputColumnIdHelpText": "全体のメトリックを計算する列", - "expressions.functions.overallMetric.args.outputColumnIdHelpText": "結果の全体のメトリックを格納する列", - "expressions.functions.overallMetric.args.outputColumnNameHelpText": "結果の全体のメトリックを格納する列の名前", - "expressions.functions.overallMetric.help": "データテーブルの列の合計値、最小値、最大値、」または平均を計算します", - "expressions.functions.overallMetric.metricHelpText": "計算するメトリック", - "expressions.functions.seriesCalculations.columnConflictMessage": "指定した outputColumnId {columnId} はすでに存在します。別の列 ID を選択してください。", - "expressions.functions.theme.args.defaultHelpText": "テーマ情報がない場合のデフォルト値。", - "expressions.functions.theme.args.variableHelpText": "読み取るテーマ変数名。", - "expressions.functions.themeHelpText": "テーマ設定を読み取ります。", - "expressions.functions.uiSetting.args.default": "パラメーターが設定されていない場合のデフォルト値。", - "expressions.functions.uiSetting.args.parameter": "パラメーター名。", - "expressions.functions.uiSetting.error.kibanaRequest": "サーバーでUI設定を取得するには、KibanaRequest が必要です。式実行パラメーターに要求オブジェクトを渡してください。", - "expressions.functions.uiSetting.error.parameter": "無効なパラメーター\"{parameter}\"です。", - "expressions.functions.uiSetting.help": "UI設定パラメーター値を返します。", - "expressions.functions.var.help": "Kibanaグローバルコンテキストを更新します。", - "expressions.functions.var.name.help": "変数の名前を指定します。", - "expressions.functions.varset.help": "Kibanaグローバルコンテキストを更新します。", - "expressions.functions.varset.name.help": "変数の名前を指定します。", - "expressions.functions.varset.val.help": "変数の値を指定します。指定しないと、入力コンテキストが使用されます。", - "expressions.types.number.fromStringConversionErrorMessage": "\"{string}\" 文字列を数字に変換できません", - "fieldFormats.advancedSettings.format.bytesFormat.numeralFormatLinkText": "数字フォーマット", - "fieldFormats.advancedSettings.format.bytesFormatText": "「バイト」フォーマットのデフォルト{numeralFormatLink}です", - "fieldFormats.advancedSettings.format.bytesFormatTitle": "バイトフォーマット", - "fieldFormats.advancedSettings.format.currencyFormat.numeralFormatLinkText": "数字フォーマット", - "fieldFormats.advancedSettings.format.currencyFormatText": "「通貨」フォーマットのデフォルト{numeralFormatLink}です", - "fieldFormats.advancedSettings.format.currencyFormatTitle": "通貨フォーマット", - "fieldFormats.advancedSettings.format.defaultTypeMapText": "各フィールドタイプにデフォルトで使用するフォーマット名のマップです。フィールドタイプが特に指定されていない場合は {defaultFormat} が使用されます", - "fieldFormats.advancedSettings.format.defaultTypeMapTitle": "フィールドタイプフォーマット名", - "fieldFormats.advancedSettings.format.formattingLocale.numeralLanguageLinkText": "数字言語", - "fieldFormats.advancedSettings.format.formattingLocaleText": "{numeralLanguageLink} ロケール", - "fieldFormats.advancedSettings.format.formattingLocaleTitle": "フォーマットロケール", - "fieldFormats.advancedSettings.format.numberFormat.numeralFormatLinkText": "数字フォーマット", - "fieldFormats.advancedSettings.format.numberFormatText": "「数字」フォーマットのデフォルト{numeralFormatLink}です", - "fieldFormats.advancedSettings.format.numberFormatTitle": "数字フォーマット", - "fieldFormats.advancedSettings.format.percentFormat.numeralFormatLinkText": "数字フォーマット", - "fieldFormats.advancedSettings.format.percentFormatText": "「パーセント」フォーマットのデフォルト{numeralFormatLink}です", - "fieldFormats.advancedSettings.format.percentFormatTitle": "パーセントフォーマット", - "fieldFormats.advancedSettings.shortenFieldsText": "長いフィールドを短くします。例:foo.bar.bazの代わりにf.b.bazと表示", - "fieldFormats.advancedSettings.shortenFieldsTitle": "フィールドの短縮", - "fieldFormats.boolean.title": "ブール", - "fieldFormats.bytes.title": "バイト", - "fieldFormats.color.title": "色", - "fieldFormats.date_nanos.title": "日付ナノ", - "fieldFormats.date.title": "日付", - "fieldFormats.duration.inputFormats.days": "日", - "fieldFormats.duration.inputFormats.hours": "時間", - "fieldFormats.duration.inputFormats.microseconds": "マイクロ秒", - "fieldFormats.duration.inputFormats.milliseconds": "ミリ秒", - "fieldFormats.duration.inputFormats.minutes": "分", - "fieldFormats.duration.inputFormats.months": "か月", - "fieldFormats.duration.inputFormats.nanoseconds": "ナノ秒", - "fieldFormats.duration.inputFormats.picoseconds": "ピコ秒", - "fieldFormats.duration.inputFormats.seconds": "秒", - "fieldFormats.duration.inputFormats.weeks": "週間", - "fieldFormats.duration.inputFormats.years": "年", - "fieldFormats.duration.negativeLabel": "マイナス", - "fieldFormats.duration.outputFormats.asDays": "日", - "fieldFormats.duration.outputFormats.asDays.short": "d", - "fieldFormats.duration.outputFormats.asHours": "時間", - "fieldFormats.duration.outputFormats.asHours.short": "h", - "fieldFormats.duration.outputFormats.asMilliseconds": "ミリ秒", - "fieldFormats.duration.outputFormats.asMilliseconds.short": "ms", - "fieldFormats.duration.outputFormats.asMinutes": "分", - "fieldFormats.duration.outputFormats.asMinutes.short": "分", - "fieldFormats.duration.outputFormats.asMonths": "か月", - "fieldFormats.duration.outputFormats.asMonths.short": "mon", - "fieldFormats.duration.outputFormats.asSeconds": "秒", - "fieldFormats.duration.outputFormats.asSeconds.short": "s", - "fieldFormats.duration.outputFormats.asWeeks": "週間", - "fieldFormats.duration.outputFormats.asWeeks.short": "w", - "fieldFormats.duration.outputFormats.asYears": "年", - "fieldFormats.duration.outputFormats.asYears.short": "y", - "fieldFormats.duration.outputFormats.humanize.approximate": "人間が読み取り可能 (近似値) ", - "fieldFormats.duration.outputFormats.humanize.precise": "人間が読み取り可能 (正確な値) ", - "fieldFormats.duration.title": "期間", - "fieldFormats.histogram.title": "ヒストグラム", - "fieldFormats.ip.title": "IP アドレス", - "fieldFormats.number.title": "数字", - "fieldFormats.percent.title": "割合 (%) ", - "fieldFormats.relative_date.title": "相対日付", - "fieldFormats.static_lookup.title": "静的ルックアップ", - "fieldFormats.string.emptyLabel": " (空) ", - "fieldFormats.string.title": "文字列", - "fieldFormats.string.transformOptions.base64": "Base64 デコード", - "fieldFormats.string.transformOptions.lower": "小文字", - "fieldFormats.string.transformOptions.none": "- なし -", - "fieldFormats.string.transformOptions.short": "短い点線", - "fieldFormats.string.transformOptions.title": "タイトルケース", - "fieldFormats.string.transformOptions.upper": "大文字", - "fieldFormats.string.transformOptions.url": "URL パラメーターデコード", - "fieldFormats.truncated_string.title": "切り詰めた文字列", - "fieldFormats.url.title": "Url", - "fieldFormats.url.types.audio": "音声", - "fieldFormats.url.types.img": "画像", - "fieldFormats.url.types.link": "リンク", - "flot.pie.unableToDrawLabelsInsideCanvasErrorMessage": "キャンバス内のラベルではパイを作成できません", - "flot.time.aprLabel": "4 月", - "flot.time.augLabel": "8 月", - "flot.time.decLabel": "12 月", - "flot.time.febLabel": "2 月", - "flot.time.friLabel": "金", - "flot.time.janLabel": "1月", - "flot.time.julLabel": "7月", - "flot.time.junLabel": "6 月", - "flot.time.marLabel": "3 月", - "flot.time.mayLabel": "5月", - "flot.time.monLabel": "月", - "flot.time.novLabel": "11月", - "flot.time.octLabel": "10 月", - "flot.time.satLabel": "土", - "flot.time.sepLabel": "9月", - "flot.time.sunLabel": "日", - "flot.time.thuLabel": "木", - "flot.time.tueLabel": "火", - "flot.time.wedLabel": "水", - "home.addData.sampleDataButtonLabel": "サンプルデータを試す", - "home.addData.sectionTitle": "データを取り込む", - "home.breadcrumbs.addDataTitle": "データの追加", - "home.breadcrumbs.homeTitle": "ホーム", - "home.dataManagementDisableCollection": " 収集を停止するには、", - "home.dataManagementDisableCollectionLink": "ここで使用状況データを無効にします。", - "home.dataManagementDisclaimerPrivacy": "使用状況データがどのように製品とサービスの管理と改善につながるのかに関する詳細については ", - "home.dataManagementDisclaimerPrivacyLink": "プライバシーポリシーをご覧ください。", - "home.dataManagementEnableCollection": " 収集を開始するには、", - "home.dataManagementEnableCollectionLink": "ここで使用状況データを有効にします。", - "home.exploreButtonLabel": "独りで閲覧", - "home.exploreYourDataDescription": "すべてのステップを終えたら、データ閲覧準備の完了です。", - "home.header.title": "ホーム", - "home.letsStartDescription": "任意のソースからクラスターにデータを追加して、リアルタイムでデータを分析して可視化します。当社のソリューションを使用すれば、どこからでも検索を追加し、エコシステムを監視して、セキュリティの脅威から保護することができます。", - "home.letsStartTitle": "データを追加して開始する", - "home.loadTutorials.requestFailedErrorMessage": "リクエスト失敗、ステータスコード:{status}", - "home.loadTutorials.unableToLoadErrorMessage": "チュートリアルが読み込めません。", - "home.manageData.sectionTitle": "データを管理", - "home.pageTitle": "ホーム", - "home.recentlyAccessed.recentlyViewedTitle": "最近閲覧", - "home.sampleData.ecommerceSpec.ordersTitle": "[e コマース] 注文", - "home.sampleData.ecommerceSpec.promotionTrackingTitle": "[e コマース] プロモーショントラッキング", - "home.sampleData.ecommerceSpec.revenueDashboardDescription": "サンプルの e コマースの注文と収益を分析します", - "home.sampleData.ecommerceSpec.revenueDashboardTitle": "[e コマース] 収益ダッシュボード", - "home.sampleData.ecommerceSpec.soldProductsPerDayTitle": "[e コマース] 1 日の販売製品", - "home.sampleData.ecommerceSpecDescription": "e コマースの注文をトラッキングするサンプルデータ、ビジュアライゼーション、ダッシュボードです。", - "home.sampleData.ecommerceSpecTitle": "サンプル e コマース注文", - "home.sampleData.flightsSpec.airportConnectionsTitle": "[フライト] 空港乗り継ぎ (空港にカーソルを合わせてください) ", - "home.sampleData.flightsSpec.delayBucketsTitle": "[フライト] 遅延バケット", - "home.sampleData.flightsSpec.delaysAndCancellationsTitle": "[フライト] 遅延・欠航", - "home.sampleData.flightsSpec.departuresCountMapTitle": "[フライト] 出発カウントマップ", - "home.sampleData.flightsSpec.destinationWeatherTitle": "[フライト] 目的地の天候", - "home.sampleData.flightsSpec.flightLogTitle": "[フライト] 飛行記録", - "home.sampleData.flightsSpec.globalFlightDashboardDescription": "ES-Air、Logstash Airways、Kibana Airlines、JetBeats のサンプル飛行データを分析します", - "home.sampleData.flightsSpec.globalFlightDashboardTitle": "[フライト] グローバルフライトダッシュボード", - "home.sampleData.flightsSpecDescription": "飛行ルートを監視するサンプルデータ、ビジュアライゼーション、ダッシュボードです。", - "home.sampleData.flightsSpecTitle": "サンプル飛行データ", - "home.sampleData.logsSpec.goalsTitle": "[ログ] 目標", - "home.sampleData.logsSpec.hostVisitsBytesTableTitle": "[ログ] ホスト、訪問数、バイト表", - "home.sampleData.logsSpec.responseCodesOverTimeTitle": "[ログ] 一定期間の応答コードと注釈", - "home.sampleData.logsSpec.sourceAndDestinationSankeyChartTitle": "[ログ] ソースと行先のサンキーダイアグラム", - "home.sampleData.logsSpec.visitorsMapTitle": "[ログ] ビジターマップ", - "home.sampleData.logsSpec.webTrafficDescription": "Elastic Web サイトのサンプル Webトラフィックログデータを分析します", - "home.sampleData.logsSpec.webTrafficTitle": "[ログ] Web トラフィック", - "home.sampleData.logsSpecDescription": "Web ログを監視するサンプルデータ、ビジュアライゼーション、ダッシュボードです。", - "home.sampleData.logsSpecTitle": "サンプル Web ログ", - "home.sampleDataSet.installedLabel": "{name} がインストールされました", - "home.sampleDataSet.unableToInstallErrorMessage": "サンプルデータセット「{name}」をインストールできません", - "home.sampleDataSet.unableToLoadListErrorMessage": "サンプルデータセットのリストを読み込めません", - "home.sampleDataSet.unableToUninstallErrorMessage": "サンプルデータセット「{name}」をアンインストールできません", - "home.sampleDataSet.uninstalledLabel": "{name} がアンインストールされました", - "home.sampleDataSetCard.addButtonAriaLabel": "{datasetName} を追加", - "home.sampleDataSetCard.addButtonLabel": "データの追加", - "home.sampleDataSetCard.addingButtonAriaLabel": "{datasetName} を追加中", - "home.sampleDataSetCard.addingButtonLabel": "追加中", - "home.sampleDataSetCard.dashboardLinkLabel": "ダッシュボード", - "home.sampleDataSetCard.default.addButtonAriaLabel": "{datasetName} を追加", - "home.sampleDataSetCard.default.addButtonLabel": "データの追加", - "home.sampleDataSetCard.default.unableToVerifyErrorMessage": "データセットステータスを確認できません、エラー:{statusMsg}", - "home.sampleDataSetCard.removeButtonAriaLabel": "{datasetName} を削除", - "home.sampleDataSetCard.removeButtonLabel": "削除", - "home.sampleDataSetCard.removingButtonAriaLabel": "{datasetName} を削除中", - "home.sampleDataSetCard.removingButtonLabel": "削除中", - "home.sampleDataSetCard.viewDataButtonAriaLabel": "{datasetName} を表示", - "home.sampleDataSetCard.viewDataButtonLabel": "データを表示", - "home.solutionsSection.sectionTitle": "ソリューションを選択", - "home.tryButtonLabel": "データの追加", - "home.tutorial.addDataToKibanaTitle": "データの追加", - "home.tutorial.card.sampleDataDescription": "これらの「ワンクリック」データセットで Kibana の探索を始めましょう。", - "home.tutorial.card.sampleDataTitle": "サンプルデータ", - "home.tutorial.elasticCloudButtonLabel": "Elastic Cloud", - "home.tutorial.instruction_variant.fleet": "FleetのElastic APM (ベータ版) ", - "home.tutorial.instruction.copyButtonLabel": "スニペットをコピー", - "home.tutorial.instructionSet.checkStatusButtonLabel": "ステータスを確認", - "home.tutorial.instructionSet.customizeLabel": "コードスニペットのカスタマイズ", - "home.tutorial.instructionSet.noDataLabel": "データが見つかりません", - "home.tutorial.instructionSet.statusCheckTitle": "ステータス確認", - "home.tutorial.instructionSet.successLabel": "成功", - "home.tutorial.instructionSet.toggleAriaLabel": "コマンドパラメーターの可視性を調整します", - "home.tutorial.introduction.betaLabel": "ベータ", - "home.tutorial.introduction.imageAltDescription": "プライマリダッシュボードのスクリーンショット。", - "home.tutorial.introduction.viewButtonLabel": "エクスポートされたフィールドを表示", - "home.tutorial.noTutorialLabel": "チュートリアル {tutorialId} が見つかりません", - "home.tutorial.savedObject.addedLabel": "{savedObjectsLength} 件の保存されたオブジェクトが追加されました", - "home.tutorial.savedObject.confirmButtonLabel": "上書きを確定", - "home.tutorial.savedObject.defaultButtonLabel": "Kibana オブジェクトを読み込む", - "home.tutorial.savedObject.installLabel": "インデックスパターン、ビジュアライゼーション、事前定義済みのダッシュボードをインポートします。", - "home.tutorial.savedObject.installStatusLabel": "{savedObjectsLength} オブジェクトの {overwriteErrorsLength} がすでに存在します。インポートして既存のオブジェクトを上書きするには、「上書きを確定」をクリックしてください。オブジェクトへの変更はすべて失われます。", - "home.tutorial.savedObject.loadTitle": "Kibana オブジェクトを読み込む", - "home.tutorial.savedObject.requestFailedErrorMessage": "リクエスト失敗、エラー:{message}", - "home.tutorial.savedObject.unableToAddErrorMessage": "{savedObjectsLength} 件中 {errorsLength} 件の kibana オブジェクトが追加できません。エラー:{errorMessage}", - "home.tutorial.selectionLegend": "デプロイタイプ", - "home.tutorial.selfManagedButtonLabel": "自己管理", - "home.tutorial.tabs.allTitle": "すべて", - "home.tutorial.tabs.loggingTitle": "ログ", - "home.tutorial.tabs.metricsTitle": "メトリック", - "home.tutorial.tabs.sampleDataTitle": "サンプルデータ", - "home.tutorial.tabs.securitySolutionTitle": "セキュリティ", - "home.tutorial.unexpectedStatusCheckStateErrorDescription": "予期せぬステータス確認ステータス {statusCheckState}", - "home.tutorial.unhandledInstructionTypeErrorDescription": "予期せぬ指示タイプ {visibleInstructions}", - "home.tutorialDirectory.featureCatalogueDescription": "一般的なアプリやサービスからデータを取り込みます。", - "home.tutorialDirectory.featureCatalogueTitle": "データの追加", - "home.tutorials.activemqLogs.artifacts.dashboards.linkLabel": "ActiveMQ 監査イベント", - "home.tutorials.activemqLogs.longDescription": "Filebeat で ActiveMQ ログを収集します。[詳細] ({learnMoreLink}) ", - "home.tutorials.activemqLogs.nameTitle": "ActiveMQ ログ", - "home.tutorials.activemqLogs.shortDescription": "Filebeat で ActiveMQ ログを収集します。", - "home.tutorials.activemqMetrics.artifacts.application.label": "Discover", - "home.tutorials.activemqMetrics.longDescription": "Metricbeat モジュール「activemq」は、ActiveMQ インスタンスから監視メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.activemqMetrics.nameTitle": "ActiveMQ メトリック", - "home.tutorials.activemqMetrics.shortDescription": "ActiveMQ インスタンスから監視メトリックを取得します。", - "home.tutorials.aerospikeMetrics.artifacts.application.label": "Discover", - "home.tutorials.aerospikeMetrics.longDescription": "Metricbeat モジュール「aerospike」は、Aerospike から内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.aerospikeMetrics.nameTitle": "Aerospike メトリック", - "home.tutorials.aerospikeMetrics.shortDescription": "Aerospike サーバーから内部メトリックを取得します。", - "home.tutorials.apacheLogs.artifacts.dashboards.linkLabel": "Apache ログダッシュボード", - "home.tutorials.apacheLogs.longDescription": "apache Filebeat モジュールが、Apache 2 HTTP サーバーにより作成されたアクセスとエラーのログをパースします。[詳細] ({learnMoreLink}) 。", - "home.tutorials.apacheLogs.nameTitle": "Apache ログ", - "home.tutorials.apacheLogs.shortDescription": "Apache HTTP サーバーが作成したアクセスとエラーのログを収集しパースします。", - "home.tutorials.apacheMetrics.artifacts.dashboards.linkLabel": "Apache メトリックダッシュボード", - "home.tutorials.apacheMetrics.longDescription": "Metricbeat モジュール「apache」は、Apache 2 HTTP サーバーから内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.apacheMetrics.nameTitle": "Apache メトリック", - "home.tutorials.apacheMetrics.shortDescription": "Apache 2 HTTP サーバーから内部メトリックを取得します。", - "home.tutorials.auditbeat.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.auditbeat.longDescription": "Auditbeat を使用してホストから監査データを収集します。これらにはプロセス、ユーザー、ログイン、ソケット情報、ファイルアクセス、その他が含まれます。[詳細] ({learnMoreLink}) 。", - "home.tutorials.auditbeat.nameTitle": "Auditbeat", - "home.tutorials.auditbeat.shortDescription": "ホストから監査データを収集します。", - "home.tutorials.auditdLogs.artifacts.dashboards.linkLabel": "監査イベント", - "home.tutorials.auditdLogs.longDescription": "モジュールは監査デーモン (「auditd」) からログを収集して解析します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.auditdLogs.nameTitle": "Auditd ログ", - "home.tutorials.auditdLogs.shortDescription": "Linux auditd デーモンからログを収集します。", - "home.tutorials.awsLogs.artifacts.dashboards.linkLabel": "AWS S3 サーバーアクセスログダッシュボード", - "home.tutorials.awsLogs.longDescription": "SQS 通知設定されている S3 バケットに AWS ログをエクスポートすることで、AWS ログを収集します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.awsLogs.nameTitle": "AWS S3 ベースのログ", - "home.tutorials.awsLogs.shortDescription": "Filebeat で S3 バケットから AWS ログを収集します。", - "home.tutorials.awsMetrics.artifacts.dashboards.linkLabel": "AWS メトリックダッシュボード", - "home.tutorials.awsMetrics.longDescription": "Metricbeat モジュール「aws」は、AWS API と Cloudwatch から監視メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.awsMetrics.nameTitle": "AWS メトリック", - "home.tutorials.awsMetrics.shortDescription": "AWS API と Cloudwatch からの EC2 インスタンスの監視メトリックです。", - "home.tutorials.azureLogs.artifacts.dashboards.linkLabel": "Apacheログダッシュボード", - "home.tutorials.azureLogs.longDescription": "「azure」Filebeatモジュールは、Azureアクティビティと監査関連ログを収集します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.azureLogs.nameTitle": "Azureログ", - "home.tutorials.azureLogs.shortDescription": "Azureアクティビティと監査関連ログを収集します。", - "home.tutorials.azureMetrics.artifacts.dashboards.linkLabel": "Apacheメトリックダッシュボード", - "home.tutorials.azureMetrics.longDescription": "Metricbeat モジュール「azure」は、Azure から監視メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.azureMetrics.nameTitle": "Azure メトリック", - "home.tutorials.azureMetrics.shortDescription": "Azure 監視メトリックをフェッチします。", - "home.tutorials.barracudaLogs.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.barracudaLogs.longDescription": "これは、Syslog またはファイルで Barracuda Web Application Firewall ログを受信するためのモジュールです。[詳細] ({learnMoreLink}) 。", - "home.tutorials.barracudaLogs.nameTitle": "Barracuda ログ", - "home.tutorials.barracudaLogs.shortDescription": "Barracuda Web Application Firewall ログを syslog またはファイルから収集します。", - "home.tutorials.bluecoatLogs.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.bluecoatLogs.longDescription": "これは、Syslog またはファイルで Blue Coat Director ログを受信するためのモジュールです。[詳細] ({learnMoreLink}) 。", - "home.tutorials.bluecoatLogs.nameTitle": "Blue Coat ログ", - "home.tutorials.bluecoatLogs.shortDescription": "Blue Coat Director ログを syslog またはファイルから収集します。", - "home.tutorials.cefLogs.artifacts.dashboards.linkLabel": "CEF ネットワーク概要ダッシュボード", - "home.tutorials.cefLogs.longDescription": "これは Syslog で Common Event Format (CEF) データを受信するためのモジュールです。Syslog プロトコルでメッセージが受信されると、Syslog 入力がヘッダーを解析し、タイムスタンプ値を設定します。次に、プロセッサーが適用され、CEF エンコードデータを解析します。デコードされたデータは「cef」オブジェクトフィールドに書き込まれます。CEF データを入力できるすべての Elastic Common Schema (ECS) フィールドが入力されます。[詳細] ({learnMoreLink}) 。", - "home.tutorials.cefLogs.nameTitle": "CEF ログ", - "home.tutorials.cefLogs.shortDescription": "Syslog で Common Event Format (CEF) ログデータを収集します。", - "home.tutorials.cephMetrics.artifacts.application.label": "Discover", - "home.tutorials.cephMetrics.longDescription": "Metricbeat モジュール「ceph」は、Ceph から内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.cephMetrics.nameTitle": "Ceph メトリック", - "home.tutorials.cephMetrics.shortDescription": "Ceph サーバーから内部メトリックを取得します。", - "home.tutorials.checkpointLogs.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.checkpointLogs.longDescription": "これは Check Point ファイアウォールログ用のモジュールです。Syslog 形式の Log Exporter からのログをサポートします。[詳細] ({learnMoreLink}) 。", - "home.tutorials.checkpointLogs.nameTitle": "Check Point ログ", - "home.tutorials.checkpointLogs.shortDescription": "Check Point ファイアウォールログを収集します。", - "home.tutorials.ciscoLogs.artifacts.dashboards.linkLabel": "ASA ファイアウォールダッシュボード", - "home.tutorials.ciscoLogs.longDescription": "これは Cisco ネットワークデバイスのログ用のモジュールです (ASA、FTD、IOS、Nexus) 。Syslog のログまたはファイルから読み取られたログを受信するための次のファイルセットが含まれます。[詳細] ({learnMoreLink}) 。", - "home.tutorials.ciscoLogs.nameTitle": "Cisco ログ", - "home.tutorials.ciscoLogs.shortDescription": "Syslog またはファイルから Cisco ネットワークデバイスログを収集します。", - "home.tutorials.cloudwatchLogs.longDescription": "Functionbeat を AWS Lambda 関数として実行するようデプロイし、Cloudwatch ログを収集します。[詳細 ({learnMoreLink}) 。", - "home.tutorials.cloudwatchLogs.nameTitle": "AWS Cloudwatch ログ", - "home.tutorials.cloudwatchLogs.shortDescription": "Functionbeat で Cloudwatch ログを収集します。", - "home.tutorials.cockroachdbMetrics.artifacts.dashboards.linkLabel": "CockroachDB メトリックダッシュボード", - "home.tutorials.cockroachdbMetrics.longDescription": "Metricbeat モジュール「cockroachdb」は、CockroachDB から監視メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.cockroachdbMetrics.nameTitle": "CockroachDB メトリック", - "home.tutorials.cockroachdbMetrics.shortDescription": "CockroachDB サーバーから監視メトリックを取得します。", - "home.tutorials.common.auditbeat.cloudInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.auditbeat.premCloudInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.auditbeat.premInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.auditbeatCloudInstructions.config.debTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.auditbeatCloudInstructions.config.debTitle": "構成を編集する", - "home.tutorials.common.auditbeatCloudInstructions.config.osxTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.auditbeatCloudInstructions.config.osxTitle": "構成を編集する", - "home.tutorials.common.auditbeatCloudInstructions.config.rpmTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.auditbeatCloudInstructions.config.rpmTitle": "構成を編集する", - "home.tutorials.common.auditbeatCloudInstructions.config.windowsTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.auditbeatCloudInstructions.config.windowsTitle": "構成を編集する", - "home.tutorials.common.auditbeatInstructions.config.debTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.auditbeatInstructions.config.debTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.auditbeatInstructions.config.debTitle": "構成を編集する", - "home.tutorials.common.auditbeatInstructions.config.osxTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.auditbeatInstructions.config.osxTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.auditbeatInstructions.config.osxTitle": "構成を編集する", - "home.tutorials.common.auditbeatInstructions.config.rpmTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.auditbeatInstructions.config.rpmTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.auditbeatInstructions.config.rpmTitle": "構成を編集する", - "home.tutorials.common.auditbeatInstructions.config.windowsTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.auditbeatInstructions.config.windowsTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.auditbeatInstructions.config.windowsTitle": "構成を編集する", - "home.tutorials.common.auditbeatInstructions.install.debTextPost": "32 ビットパッケージをお探しですか?[ダウンロードページ] ({linkUrl}) をご覧ください。", - "home.tutorials.common.auditbeatInstructions.install.debTextPre": "Auditbeatは初めてですか?[クイックスタート] ({linkUrl}) を参照してください。", - "home.tutorials.common.auditbeatInstructions.install.debTitle": "Auditbeat のダウンロードとインストール", - "home.tutorials.common.auditbeatInstructions.install.osxTextPre": "Auditbeatは初めてですか?[クイックスタート] ({linkUrl}) を参照してください。", - "home.tutorials.common.auditbeatInstructions.install.osxTitle": "Auditbeat のダウンロードとインストール", - "home.tutorials.common.auditbeatInstructions.install.rpmTextPost": "32 ビットパッケージをお探しですか?[ダウンロードページ] ({linkUrl}) をご覧ください。", - "home.tutorials.common.auditbeatInstructions.install.rpmTextPre": "Auditbeatは初めてですか?[クイックスタート] ({linkUrl}) を参照してください。", - "home.tutorials.common.auditbeatInstructions.install.rpmTitle": "Auditbeat のダウンロードとインストール", - "home.tutorials.common.auditbeatInstructions.install.windowsTextPost": "{auditbeatPath} ファイルの {propertyName} を Elasticsearch のインストールに設定します。", - "home.tutorials.common.auditbeatInstructions.install.windowsTextPre": "Auditbeatは初めてですか?[クイックスタート] ({guideLinkUrl}) を参照してください。\n 1.[ダウンロード] ({auditbeatLinkUrl}) ページからAuditbeat Windows zipファイルをダウンロードします。\n 2.zipファイルのコンテンツを{folderPath}に解凍します。\n 3.「{directoryName}」ディレクトリの名前を「Auditbeat」に変更します。\n 4.管理者としてPowerShellプロンプトを開きます (PowerShellアイコンを右クリックして「管理者として実行」を選択します) 。Windows XPをご使用の場合、PowerShellのダウンロードとインストールが必要な場合があります。\n 5.PowerShell プロンプトで次のコマンドを実行し、Auditbeat を Windows サービスとしてインストールします。", - "home.tutorials.common.auditbeatInstructions.install.windowsTitle": "Auditbeat のダウンロードとインストール", - "home.tutorials.common.auditbeatInstructions.start.debTextPre": "「setup」コマンドで Kibana のダッシュボードを読み込みます。ダッシュボードがすでにセットアップされている場合、このコマンドは省略します。", - "home.tutorials.common.auditbeatInstructions.start.debTitle": "Auditbeat を起動", - "home.tutorials.common.auditbeatInstructions.start.osxTextPre": "「setup」コマンドで Kibana のダッシュボードを読み込みます。ダッシュボードがすでにセットアップされている場合、このコマンドは省略します。", - "home.tutorials.common.auditbeatInstructions.start.osxTitle": "Auditbeat を起動", - "home.tutorials.common.auditbeatInstructions.start.rpmTextPre": "「setup」コマンドで Kibana のダッシュボードを読み込みます。ダッシュボードがすでにセットアップされている場合、このコマンドは省略します。", - "home.tutorials.common.auditbeatInstructions.start.rpmTitle": "Auditbeat を起動", - "home.tutorials.common.auditbeatInstructions.start.windowsTextPre": "「setup」コマンドで Kibana のダッシュボードを読み込みます。ダッシュボードがすでにセットアップされている場合、このコマンドは省略します。", - "home.tutorials.common.auditbeatInstructions.start.windowsTitle": "Auditbeat を起動", - "home.tutorials.common.auditbeatStatusCheck.buttonLabel": "データを確認してください", - "home.tutorials.common.auditbeatStatusCheck.errorText": "まだデータを受信していません", - "home.tutorials.common.auditbeatStatusCheck.successText": "データを受信しました", - "home.tutorials.common.auditbeatStatusCheck.text": "Auditbeat からデータを受け取ったことを確認してください。", - "home.tutorials.common.auditbeatStatusCheck.title": "ステータス", - "home.tutorials.common.cloudInstructions.passwordAndResetLink": "{passwordTemplate}が「Elastic」ユーザーのパスワードです。\\{#config.cloud.profileUrl\\}\n パスワードを忘れた場合[Elastic Cloudでリセット] (\\{config.cloud.baseUrl\\}\\{config.cloud.profileUrl\\}) 。\n \\{/config.cloud.profileUrl\\}", - "home.tutorials.common.filebeat.cloudInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.filebeat.premCloudInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.filebeat.premInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.filebeatCloudInstructions.config.debTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.filebeatCloudInstructions.config.debTitle": "構成を編集する", - "home.tutorials.common.filebeatCloudInstructions.config.osxTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.filebeatCloudInstructions.config.osxTitle": "構成を編集する", - "home.tutorials.common.filebeatCloudInstructions.config.rpmTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.filebeatCloudInstructions.config.rpmTitle": "構成を編集する", - "home.tutorials.common.filebeatCloudInstructions.config.windowsTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.filebeatCloudInstructions.config.windowsTitle": "構成を編集する", - "home.tutorials.common.filebeatEnableInstructions.debTextPost": "「/etc/filebeat/modules.d/{moduleName}.yml」ファイルで設定を変更します。", - "home.tutorials.common.filebeatEnableInstructions.debTitle": "{moduleName} モジュールを有効にし構成します", - "home.tutorials.common.filebeatEnableInstructions.osxTextPost": "「modules.d/{moduleName}.yml」」ファイルで設定を変更します。", - "home.tutorials.common.filebeatEnableInstructions.osxTextPre": "インストールディレクトリから次のファイルを実行します:", - "home.tutorials.common.filebeatEnableInstructions.osxTitle": "{moduleName} モジュールを有効にし構成します", - "home.tutorials.common.filebeatEnableInstructions.rpmTextPost": "「/etc/filebeat/modules.d/{moduleName}.yml」ファイルで設定を変更します。", - "home.tutorials.common.filebeatEnableInstructions.rpmTitle": "{moduleName} モジュールを有効にし構成します", - "home.tutorials.common.filebeatEnableInstructions.windowsTextPost": "「modules.d/{moduleName}.yml」」ファイルで設定を変更します。", - "home.tutorials.common.filebeatEnableInstructions.windowsTextPre": "「{path}」フォルダから次のファイルを実行します:", - "home.tutorials.common.filebeatEnableInstructions.windowsTitle": "{moduleName} モジュールを有効にし構成します", - "home.tutorials.common.filebeatInstructions.config.debTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.filebeatInstructions.config.debTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.filebeatInstructions.config.debTitle": "構成を編集する", - "home.tutorials.common.filebeatInstructions.config.osxTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.filebeatInstructions.config.osxTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.filebeatInstructions.config.osxTitle": "構成を編集する", - "home.tutorials.common.filebeatInstructions.config.rpmTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.filebeatInstructions.config.rpmTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.filebeatInstructions.config.rpmTitle": "構成を編集する", - "home.tutorials.common.filebeatInstructions.config.windowsTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.filebeatInstructions.config.windowsTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.filebeatInstructions.config.windowsTitle": "構成を編集する", - "home.tutorials.common.filebeatInstructions.install.debTextPost": "32 ビットパッケージをお探しですか?[ダウンロードページ] ({linkUrl}) をご覧ください。", - "home.tutorials.common.filebeatInstructions.install.debTextPre": "Filebeatは初めてですか?[クイックスタート] ({linkUrl}) を参照してください。", - "home.tutorials.common.filebeatInstructions.install.debTitle": "Filebeat のダウンロードとインストール", - "home.tutorials.common.filebeatInstructions.install.osxTextPre": "Filebeatは初めてですか?[クイックスタート] ({linkUrl}) を参照してください。", - "home.tutorials.common.filebeatInstructions.install.osxTitle": "Filebeat のダウンロードとインストール", - "home.tutorials.common.filebeatInstructions.install.rpmTextPost": "32 ビットパッケージをお探しですか?[ダウンロードページ] ({linkUrl}) をご覧ください。", - "home.tutorials.common.filebeatInstructions.install.rpmTextPre": "Filebeatは初めてですか?[クイックスタート] ({linkUrl}) を参照してください。", - "home.tutorials.common.filebeatInstructions.install.rpmTitle": "Filebeat のダウンロードとインストール", - "home.tutorials.common.filebeatInstructions.install.windowsTextPost": "{filebeatPath} ファイルの {propertyName} を Elasticsearch のインストールに設定します。", - "home.tutorials.common.filebeatInstructions.install.windowsTextPre": "Filebeatは初めてですか?[クイックスタート] ({guideLinkUrl}) を参照してください。\n 1.[ダウンロード] ({filebeatLinkUrl}) ページからAuditbeat Windows zipファイルをダウンロードします。\n 2.zipファイルのコンテンツを{folderPath}に解凍します。\n 3.「{directoryName}」ディレクトリの名前を「Filebeat」に変更します。\n 4.管理者としてPowerShellプロンプトを開きます (PowerShellアイコンを右クリックして「管理者として実行」を選択します) 。Windows XPをご使用の場合、PowerShellのダウンロードとインストールが必要な場合があります。\n 5.PowerShell プロンプトで次のコマンドを実行し、Filebeat を Windows サービスとしてインストールします。", - "home.tutorials.common.filebeatInstructions.install.windowsTitle": "Filebeat のダウンロードとインストール", - "home.tutorials.common.filebeatInstructions.start.debTextPre": "「setup」コマンドで Kibana のダッシュボードを読み込みます。ダッシュボードがすでにセットアップされている場合、このコマンドは省略します。", - "home.tutorials.common.filebeatInstructions.start.debTitle": "Filebeat を起動します", - "home.tutorials.common.filebeatInstructions.start.osxTextPre": "「setup」コマンドで Kibana のダッシュボードを読み込みます。ダッシュボードがすでにセットアップされている場合、このコマンドは省略します。", - "home.tutorials.common.filebeatInstructions.start.osxTitle": "Filebeat を起動します", - "home.tutorials.common.filebeatInstructions.start.rpmTextPre": "「setup」コマンドで Kibana のダッシュボードを読み込みます。ダッシュボードがすでにセットアップされている場合、このコマンドは省略します。", - "home.tutorials.common.filebeatInstructions.start.rpmTitle": "Filebeat を起動します", - "home.tutorials.common.filebeatInstructions.start.windowsTextPre": "「setup」コマンドで Kibana のダッシュボードを読み込みます。ダッシュボードがすでにセットアップされている場合、このコマンドは省略します。", - "home.tutorials.common.filebeatInstructions.start.windowsTitle": "Filebeat を起動", - "home.tutorials.common.filebeatStatusCheck.buttonLabel": "データを確認してください", - "home.tutorials.common.filebeatStatusCheck.errorText": "モジュールからまだデータを受け取っていません", - "home.tutorials.common.filebeatStatusCheck.successText": "このモジュールからデータを受け取りました", - "home.tutorials.common.filebeatStatusCheck.text": "Filebeat の「{moduleName}」モジュールからデータを受け取ったことを確認してください。", - "home.tutorials.common.filebeatStatusCheck.title": "モジュールステータス", - "home.tutorials.common.functionbeat.cloudInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.functionbeat.premCloudInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.functionbeat.premInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.functionbeatAWSInstructions.textPost": "「」と「」がアカウント資格情報、「us-east-1」がご希望の地域です。", - "home.tutorials.common.functionbeatAWSInstructions.textPre": "環境で AWS アカウント認証情報を設定します。", - "home.tutorials.common.functionbeatAWSInstructions.title": "AWS 認証情報の設定", - "home.tutorials.common.functionbeatCloudInstructions.config.osxTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.functionbeatCloudInstructions.config.osxTitle": "構成を編集する", - "home.tutorials.common.functionbeatCloudInstructions.config.windowsTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.functionbeatCloudInstructions.config.windowsTitle": "構成を編集する", - "home.tutorials.common.functionbeatEnableOnPremInstructions.defaultTextPost": "「」が投入するロググループの名前で、「」が Functionbeat デプロイのステージングに使用されるが有効な S3 バケット名です。", - "home.tutorials.common.functionbeatEnableOnPremInstructions.defaultTitle": "Cloudwatch ロググループの構成", - "home.tutorials.common.functionbeatEnableOnPremInstructionsOSXLinux.textPre": "「functionbeat.yml」ファイルで設定を変更します。", - "home.tutorials.common.functionbeatEnableOnPremInstructionsWindows.textPre": "{path} ファイルで設定を変更します。", - "home.tutorials.common.functionbeatInstructions.config.osxTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.functionbeatInstructions.config.osxTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.functionbeatInstructions.config.osxTitle": "Elastic クラスターの構成", - "home.tutorials.common.functionbeatInstructions.config.windowsTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.functionbeatInstructions.config.windowsTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.functionbeatInstructions.config.windowsTitle": "構成を編集する", - "home.tutorials.common.functionbeatInstructions.deploy.osxTextPre": "これにより Functionbeat が Lambda 関数としてインストールされます「setup」コマンドで Elasticsearch の構成を確認し、Kibana インデックスパターンを読み込みます。通常このコマンドを省いても大丈夫です。", - "home.tutorials.common.functionbeatInstructions.deploy.osxTitle": "Functionbeat を AWS Lambda にデプロイ", - "home.tutorials.common.functionbeatInstructions.deploy.windowsTextPre": "これにより Functionbeat が Lambda 関数としてインストールされます「setup」コマンドで Elasticsearch の構成を確認し、Kibana インデックスパターンを読み込みます。通常このコマンドを省いても大丈夫です。", - "home.tutorials.common.functionbeatInstructions.deploy.windowsTitle": "Functionbeat を AWS Lambda にデプロイ", - "home.tutorials.common.functionbeatInstructions.install.linuxTextPre": "Functionbeatは初めてですか?[クイックスタート] ({link}) を参照してください。", - "home.tutorials.common.functionbeatInstructions.install.linuxTitle": "Functionbeat のダウンロードとインストール", - "home.tutorials.common.functionbeatInstructions.install.osxTextPre": "Functionbeatは初めてですか?[クイックスタート] ({link}) を参照してください。", - "home.tutorials.common.functionbeatInstructions.install.osxTitle": "Functionbeat のダウンロードとインストール", - "home.tutorials.common.functionbeatInstructions.install.windowsTextPre": "Functionbeatは初めてですか?[クイックスタート] ({functionbeatLink}) を参照してください。\n 1.[ダウンロード] ({elasticLink}) ページからFunctionbeat Windows zipファイルをダウンロードします。\n 2.zipファイルのコンテンツを{folderPath}に解凍します。\n 3.「{directoryName} ディレクトリの名前を「Functionbeat」に変更します。\n 4.管理者としてPowerShellプロンプトを開きます (PowerShellアイコンを右クリックして「管理者として実行」を選択します) 。Windows XPをご使用の場合、PowerShellのダウンロードとインストールが必要な場合があります。\n 5.PowerShell プロンプトから、Functionbeat ディレクトリに移動します:", - "home.tutorials.common.functionbeatInstructions.install.windowsTitle": "Functionbeat のダウンロードとインストール", - "home.tutorials.common.functionbeatStatusCheck.buttonLabel": "データを確認してください", - "home.tutorials.common.functionbeatStatusCheck.errorText": "Functionbeat からまだデータを受け取っていません", - "home.tutorials.common.functionbeatStatusCheck.successText": "Functionbeat からデータを受け取りました", - "home.tutorials.common.functionbeatStatusCheck.text": "Functionbeat からデータを受け取ったことを確認してください。", - "home.tutorials.common.functionbeatStatusCheck.title": "Functionbeat ステータス", - "home.tutorials.common.heartbeat.cloudInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.heartbeat.premCloudInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.heartbeat.premInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.heartbeatCloudInstructions.config.debTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.heartbeatCloudInstructions.config.debTitle": "構成を編集する", - "home.tutorials.common.heartbeatCloudInstructions.config.osxTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.heartbeatCloudInstructions.config.osxTitle": "構成を編集する", - "home.tutorials.common.heartbeatCloudInstructions.config.rpmTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.heartbeatCloudInstructions.config.rpmTitle": "構成を編集する", - "home.tutorials.common.heartbeatCloudInstructions.config.windowsTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.heartbeatCloudInstructions.config.windowsTitle": "構成を編集する", - "home.tutorials.common.heartbeatEnableCloudInstructions.debTextPre": "「heartbeat.yml」ファイルの「heartbeat.monitors」設定を変更します。", - "home.tutorials.common.heartbeatEnableCloudInstructions.defaultTextPost": "Heartbeat の監視を構成する手順の詳細は、[Heartbeat 構成ドキュメント] ({configureLink}) をご覧ください。", - "home.tutorials.common.heartbeatEnableCloudInstructions.defaultTitle": "構成を変更 - 監視を追加", - "home.tutorials.common.heartbeatEnableCloudInstructions.osxTextPre": "「heartbeat.yml」ファイルの「heartbeat.monitors」設定を変更します。", - "home.tutorials.common.heartbeatEnableCloudInstructions.rpmTextPre": "「heartbeat.yml」ファイルの「heartbeat.monitors」設定を変更します。", - "home.tutorials.common.heartbeatEnableCloudInstructions.windowsTextPre": "「heartbeat.yml」ファイルの「heartbeat.monitors」設定を変更します。", - "home.tutorials.common.heartbeatEnableOnPremInstructions.debTextPre": "「heartbeat.yml」ファイルの「heartbeat.monitors」設定を変更します。", - "home.tutorials.common.heartbeatEnableOnPremInstructions.defaultTextPost": "{hostTemplate} は監視対象の URL です。Heartbeat の監視を構成する手順の詳細は、[Heartbeat 構成ドキュメント] ({configureLink}) をご覧ください。", - "home.tutorials.common.heartbeatEnableOnPremInstructions.defaultTitle": "構成を変更 - 監視を追加", - "home.tutorials.common.heartbeatEnableOnPremInstructions.osxTextPre": "「heartbeat.yml」ファイルの「heartbeat.monitors」設定を変更します。", - "home.tutorials.common.heartbeatEnableOnPremInstructions.rpmTextPre": "「heartbeat.yml」ファイルの「heartbeat.monitors」設定を変更します。", - "home.tutorials.common.heartbeatEnableOnPremInstructions.windowsTextPre": "「heartbeat.yml」ファイルの「heartbeat.monitors」設定を変更します。", - "home.tutorials.common.heartbeatInstructions.config.debTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.heartbeatInstructions.config.debTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.heartbeatInstructions.config.debTitle": "構成を編集する", - "home.tutorials.common.heartbeatInstructions.config.osxTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.heartbeatInstructions.config.osxTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.heartbeatInstructions.config.osxTitle": "構成を編集する", - "home.tutorials.common.heartbeatInstructions.config.rpmTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.heartbeatInstructions.config.rpmTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.heartbeatInstructions.config.rpmTitle": "構成を編集する", - "home.tutorials.common.heartbeatInstructions.config.windowsTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.heartbeatInstructions.config.windowsTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.heartbeatInstructions.config.windowsTitle": "構成を編集する", - "home.tutorials.common.heartbeatInstructions.install.debTextPost": "32 ビットパッケージをお探しですか?[ダウンロードページ] ({link}) をご覧ください。", - "home.tutorials.common.heartbeatInstructions.install.debTextPre": "Heartbeatは初めてですか?[クイックスタート] ({link}) を参照してください。", - "home.tutorials.common.heartbeatInstructions.install.debTitle": "Heartbeat のダウンロードとインストール", - "home.tutorials.common.heartbeatInstructions.install.osxTextPre": "Heartbeatは初めてですか?[クイックスタート] ({link}) を参照してください。", - "home.tutorials.common.heartbeatInstructions.install.osxTitle": "Heartbeat のダウンロードとインストール", - "home.tutorials.common.heartbeatInstructions.install.rpmTextPre": "Heartbeatは初めてですか?[クイックスタート] ({link}) を参照してください。", - "home.tutorials.common.heartbeatInstructions.install.rpmTitle": "Heartbeat のダウンロードとインストール", - "home.tutorials.common.heartbeatInstructions.install.windowsTextPre": "Heartbeatは初めてですか?[クイックスタート] ({heartbeatLink}) を参照してください。\n 1.[ダウンロード] ({elasticLink}) ページからHeartbeat Windows zipファイルをダウンロードします。\n 2.zipファイルのコンテンツを{folderPath}に解凍します。\n 3.「{directoryName} ディレクトリの名前を「Heartbeat」に変更します。\n 4.管理者としてPowerShellプロンプトを開きます (PowerShellアイコンを右クリックして「管理者として実行」を選択します) 。Windows XPをご使用の場合、PowerShellのダウンロードとインストールが必要な場合があります。\n 5.PowerShell プロンプトで次のコマンドを実行し、Heartbeat を Windows サービスとしてインストールします。", - "home.tutorials.common.heartbeatInstructions.install.windowsTitle": "Heartbeat のダウンロードとインストール", - "home.tutorials.common.heartbeatInstructions.start.debTextPre": "「setup」コマンドで Kibana のインデックスパターンを読み込みます。", - "home.tutorials.common.heartbeatInstructions.start.debTitle": "Heartbeat を起動します", - "home.tutorials.common.heartbeatInstructions.start.osxTextPre": "「setup」コマンドで Kibana のインデックスパターンを読み込みます。", - "home.tutorials.common.heartbeatInstructions.start.osxTitle": "Heartbeat を起動します", - "home.tutorials.common.heartbeatInstructions.start.rpmTextPre": "「setup」コマンドで Kibana のインデックスパターンを読み込みます。", - "home.tutorials.common.heartbeatInstructions.start.rpmTitle": "Heartbeat を起動します", - "home.tutorials.common.heartbeatInstructions.start.windowsTextPre": "「setup」コマンドで Kibana のインデックスパターンを読み込みます。", - "home.tutorials.common.heartbeatInstructions.start.windowsTitle": "Heartbeat を起動します", - "home.tutorials.common.heartbeatStatusCheck.buttonLabel": "データを確認してください", - "home.tutorials.common.heartbeatStatusCheck.errorText": "Heartbeat からまだデータを受け取っていません", - "home.tutorials.common.heartbeatStatusCheck.successText": "Heartbeat からデータを受け取りました", - "home.tutorials.common.heartbeatStatusCheck.text": "Heartbeat からデータを受け取ったことを確認してください。", - "home.tutorials.common.heartbeatStatusCheck.title": "Heartbeat のステータス", - "home.tutorials.common.logstashInstructions.install.java.osxTextPre": "[こちら] ({link}) のインストール手順に従ってください。", - "home.tutorials.common.logstashInstructions.install.java.osxTitle": "Java Runtime Environment のダウンロードとインストール", - "home.tutorials.common.logstashInstructions.install.java.windowsTextPre": "[こちら] ({link}) のインストール手順に従ってください。", - "home.tutorials.common.logstashInstructions.install.java.windowsTitle": "Java Runtime Environment のダウンロードとインストール", - "home.tutorials.common.logstashInstructions.install.logstash.osxTextPre": "Logstash は初めてですか? [入門ガイド] ({link}) をご覧ください。", - "home.tutorials.common.logstashInstructions.install.logstash.osxTitle": "Logstash のダウンロードとインストール", - "home.tutorials.common.logstashInstructions.install.logstash.windowsTextPre": "Logstash は初めてですか? [入門ガイド] ({logstashLink}) をご覧ください。\n 1. Logstash Windows zip ファイルを [ダウンロード] ({elasticLink}) します。\n 2.zip ファイルのコンテンツを展開します。", - "home.tutorials.common.logstashInstructions.install.logstash.windowsTitle": "Logstash のダウンロードとインストール", - "home.tutorials.common.metricbeat.cloudInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.metricbeat.premCloudInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.metricbeat.premInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.metricbeatCloudInstructions.config.debTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.metricbeatCloudInstructions.config.debTitle": "構成を編集する", - "home.tutorials.common.metricbeatCloudInstructions.config.osxTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.metricbeatCloudInstructions.config.osxTitle": "構成を編集する", - "home.tutorials.common.metricbeatCloudInstructions.config.rpmTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.metricbeatCloudInstructions.config.rpmTitle": "構成を編集する", - "home.tutorials.common.metricbeatCloudInstructions.config.windowsTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.metricbeatCloudInstructions.config.windowsTitle": "構成を編集する", - "home.tutorials.common.metricbeatEnableInstructions.debTextPost": "「/etc/metricbeat/modules.d/{moduleName}.yml」ファイルで設定を変更します。", - "home.tutorials.common.metricbeatEnableInstructions.debTitle": "{moduleName} モジュールを有効にし構成します", - "home.tutorials.common.metricbeatEnableInstructions.osxTextPost": "「modules.d/{moduleName}.yml」」ファイルで設定を変更します。", - "home.tutorials.common.metricbeatEnableInstructions.osxTextPre": "インストールディレクトリから次のファイルを実行します:", - "home.tutorials.common.metricbeatEnableInstructions.osxTitle": "{moduleName} モジュールを有効にし構成します", - "home.tutorials.common.metricbeatEnableInstructions.rpmTextPost": "「/etc/metricbeat/modules.d/{moduleName}.yml」ファイルで設定を変更します。", - "home.tutorials.common.metricbeatEnableInstructions.rpmTitle": "{moduleName} モジュールを有効にし構成します", - "home.tutorials.common.metricbeatEnableInstructions.windowsTextPost": "「modules.d/{moduleName}.yml」」ファイルで設定を変更します。", - "home.tutorials.common.metricbeatEnableInstructions.windowsTextPre": "「{path}」フォルダから次のファイルを実行します:", - "home.tutorials.common.metricbeatEnableInstructions.windowsTitle": "{moduleName} モジュールを有効にし構成します", - "home.tutorials.common.metricbeatInstructions.config.debTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.metricbeatInstructions.config.debTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.metricbeatInstructions.config.debTitle": "構成を編集する", - "home.tutorials.common.metricbeatInstructions.config.osxTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.metricbeatInstructions.config.osxTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.metricbeatInstructions.config.osxTitle": "構成を編集する", - "home.tutorials.common.metricbeatInstructions.config.rpmTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.metricbeatInstructions.config.rpmTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.metricbeatInstructions.config.rpmTitle": "構成を編集する", - "home.tutorials.common.metricbeatInstructions.config.windowsTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.metricbeatInstructions.config.windowsTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.metricbeatInstructions.config.windowsTitle": "構成を編集する", - "home.tutorials.common.metricbeatInstructions.install.debTextPost": "32 ビットパッケージをお探しですか?[ダウンロードページ] ({link}) をご覧ください。", - "home.tutorials.common.metricbeatInstructions.install.debTextPre": "Metricbeatは初めてですか?[クイックスタート] ({link}) を参照してください。", - "home.tutorials.common.metricbeatInstructions.install.debTitle": "Metricbeat のダウンロードとインストール", - "home.tutorials.common.metricbeatInstructions.install.osxTextPre": "Metricbeatは初めてですか?[クイックスタート] ({link}) を参照してください。", - "home.tutorials.common.metricbeatInstructions.install.osxTitle": "Metricbeat のダウンロードとインストール", - "home.tutorials.common.metricbeatInstructions.install.rpmTextPre": "Metricbeatは初めてですか?[クイックスタート] ({link}) を参照してください。", - "home.tutorials.common.metricbeatInstructions.install.rpmTitle": "Metricbeat のダウンロードとインストール", - "home.tutorials.common.metricbeatInstructions.install.windowsTextPost": "{path} ファイルの「output.elasticsearch」を Elasticsearch のインストールに設定します。", - "home.tutorials.common.metricbeatInstructions.install.windowsTextPre": "Metricbeatは初めてですか?[クイックスタート] ({metricbeatLink}) を参照してください。\n 1.[ダウンロード] ({elasticLink}) ページからMetricbeat Windows zipファイルをダウンロードします。\n 2.zipファイルのコンテンツを{folderPath}に解凍します。\n 3.{directoryName}ディレクトリの名前を「Metricbeat」に変更します。\n 4.管理者としてPowerShellプロンプトを開きます (PowerShellアイコンを右クリックして「管理者として実行」を選択します) 。Windows XPをご使用の場合、PowerShellのダウンロードとインストールが必要な場合があります。\n 5.PowerShell プロンプトで次のコマンドを実行し、Metricbeat を Windows サービスとしてインストールします。", - "home.tutorials.common.metricbeatInstructions.install.windowsTitle": "Metricbeat のダウンロードとインストール", - "home.tutorials.common.metricbeatInstructions.start.debTextPre": "「setup」コマンドで Kibana のダッシュボードを読み込みます。ダッシュボードがすでにセットアップされている場合、このコマンドは省略します。", - "home.tutorials.common.metricbeatInstructions.start.debTitle": "Metricbeat を起動します", - "home.tutorials.common.metricbeatInstructions.start.osxTextPre": "「setup」コマンドで Kibana のダッシュボードを読み込みます。ダッシュボードがすでにセットアップされている場合、このコマンドは省略します。", - "home.tutorials.common.metricbeatInstructions.start.osxTitle": "Metricbeat を起動します", - "home.tutorials.common.metricbeatInstructions.start.rpmTextPre": "「setup」コマンドで Kibana のダッシュボードを読み込みます。ダッシュボードがすでにセットアップされている場合、このコマンドは省略します。", - "home.tutorials.common.metricbeatInstructions.start.rpmTitle": "Metricbeat を起動します", - "home.tutorials.common.metricbeatInstructions.start.windowsTextPre": "「setup」コマンドで Kibana のダッシュボードを読み込みます。ダッシュボードがすでにセットアップされている場合、このコマンドは省略します。", - "home.tutorials.common.metricbeatInstructions.start.windowsTitle": "Metricbeat を起動します", - "home.tutorials.common.metricbeatStatusCheck.buttonLabel": "データを確認してください", - "home.tutorials.common.metricbeatStatusCheck.errorText": "モジュールからまだデータを受け取っていません", - "home.tutorials.common.metricbeatStatusCheck.successText": "このモジュールからデータを受け取りました", - "home.tutorials.common.metricbeatStatusCheck.text": "Metricbeat の「{moduleName}」モジュールからデータを受け取ったことを確認してください", - "home.tutorials.common.metricbeatStatusCheck.title": "モジュールステータス", - "home.tutorials.common.premCloudInstructions.option1.textPre": "[Elastic Cloud] ({link}) にアクセスします。アカウントをお持ちでない場合は新規登録してください。14 日間の無料トライアルがご利用いただけます。\n\nElastic Cloud コンソールにログインします\n\nElastic Cloud コンソールで次の手順に従ってクラスターを作成します。\n 1.[デプロイを作成]を選択して[デプロイ名]を指定します\n 2.必要に応じて他のデプロイオプションを変更します (デフォルトも使い始めるのに有効です) \n 3.「デプロイを作成」をクリックします\n 4.デプロイの作成が完了するまで待ちます\n 5.新規クラウド Kibana インスタンスにアクセスし、Kibana ホームの手順に従います。", - "home.tutorials.common.premCloudInstructions.option1.title": "オプション 1:Elastic Cloud でお試しください", - "home.tutorials.common.premCloudInstructions.option2.textPre": "この Kibana インスタンスをマネージド Elasticsearch インスタンスに対して実行している場合は、手動セットアップを行います。\n\n「Elasticsearch」エンドポイントを {urlTemplate} として保存し、クラスターの「パスワード」を {passwordTemplate} として保存します。", - "home.tutorials.common.premCloudInstructions.option2.title": "オプション 2:Kibana を Cloud インスタンスに接続", - "home.tutorials.common.winlogbeat.cloudInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.winlogbeat.premCloudInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.winlogbeat.premInstructions.gettingStarted.title": "はじめに", - "home.tutorials.common.winlogbeatCloudInstructions.config.windowsTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.winlogbeatCloudInstructions.config.windowsTitle": "構成を編集する", - "home.tutorials.common.winlogbeatInstructions.config.windowsTextPost": "{passwordTemplate} が「Elastic」ユーザーのパスワード、{esUrlTemplate} が Elasticsearch の URL、{kibanaUrlTemplate} が Kibana の URL です。", - "home.tutorials.common.winlogbeatInstructions.config.windowsTextPre": "{path} を変更して Elastic Cloud への接続情報を設定します:", - "home.tutorials.common.winlogbeatInstructions.config.windowsTitle": "構成を編集する", - "home.tutorials.common.winlogbeatInstructions.install.windowsTextPost": "{path} ファイルの「output.elasticsearch」を Elasticsearch のインストールに設定します。", - "home.tutorials.common.winlogbeatInstructions.install.windowsTextPre": "Winlogbeatは初めてですか?[クイックスタート] ({winlogbeatLink}) を参照してください。\n 1.[ダウンロード] ({elasticLink}) ページからWinlogbeat Windows zipファイルをダウンロードします。\n 2.zipファイルのコンテンツを{folderPath}に解凍します。\n 3.{directoryName}ディレクトリの名前を「Winlogbeat」に変更します。\n 4.管理者としてPowerShellプロンプトを開きます (PowerShellアイコンを右クリックして「管理者として実行」を選択します) 。Windows XPをご使用の場合、PowerShellのダウンロードとインストールが必要な場合があります。\n 5.PowerShell プロンプトで次のコマンドを実行し、Winlogbeat を Windows サービスとしてインストールします。", - "home.tutorials.common.winlogbeatInstructions.install.windowsTitle": "Winlogbeat のダウンロードとインストール", - "home.tutorials.common.winlogbeatInstructions.start.windowsTextPre": "「setup」コマンドで Kibana のダッシュボードを読み込みます。ダッシュボードがすでにセットアップされている場合、このコマンドは省略します。", - "home.tutorials.common.winlogbeatInstructions.start.windowsTitle": "Winlogbeat を起動", - "home.tutorials.common.winlogbeatStatusCheck.buttonLabel": "データを確認してください", - "home.tutorials.common.winlogbeatStatusCheck.errorText": "まだデータを受信していません", - "home.tutorials.common.winlogbeatStatusCheck.successText": "データを受信しました", - "home.tutorials.common.winlogbeatStatusCheck.text": "Winlogbeat からデータを受け取ったことを確認してください。", - "home.tutorials.common.winlogbeatStatusCheck.title": "モジュールステータス", - "home.tutorials.consulMetrics.artifacts.dashboards.linkLabel": "Consul メトリックダッシュボード", - "home.tutorials.consulMetrics.longDescription": "Metricbeat モジュール「consul」は、Consul から監視メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.consulMetrics.nameTitle": "Consul メトリック", - "home.tutorials.consulMetrics.shortDescription": "CouchdB サーバーから監視メトリックを取得します。", - "home.tutorials.corednsLogs.artifacts.dashboards.linkLabel": "[Filebeat CoreDNS] 概要", - "home.tutorials.corednsLogs.longDescription": "これは CoreDNS の Filebeatモジュールです。スタンドアロンの CoreDNS デプロイメントと Kubernetes での CoreDNS デプロイメントの両方をサポートします。[詳細] ({learnMoreLink}) 。", - "home.tutorials.corednsLogs.nameTitle": "CoreDNS ログ", - "home.tutorials.corednsLogs.shortDescription": "CoreDNS ログを収集します。", - "home.tutorials.corednsMetrics.artifacts.application.label": "Discover", - "home.tutorials.corednsMetrics.longDescription": "Metricbeat モジュール「coredns」は、CoreDNS から監視メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.corednsMetrics.nameTitle": "CoreDNS メトリック", - "home.tutorials.corednsMetrics.shortDescription": "CoreDNS サーバーから監視メトリックを取得します。", - "home.tutorials.couchbaseMetrics.artifacts.application.label": "Discover", - "home.tutorials.couchbaseMetrics.longDescription": "Metricbeat モジュール「couchbase」は、Couchbase から内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.couchbaseMetrics.nameTitle": "Couchbase メトリック", - "home.tutorials.couchbaseMetrics.shortDescription": "Couchbase から内部メトリックを取得します。", - "home.tutorials.couchdbMetrics.artifacts.dashboards.linkLabel": "CouchDB メトリックダッシュボード", - "home.tutorials.couchdbMetrics.longDescription": "Metricbeat モジュール「couchdb」は、CouchDB から監視メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.couchdbMetrics.nameTitle": "CouchDB メトリック", - "home.tutorials.couchdbMetrics.shortDescription": "CouchdB サーバーから監視メトリックを取得します。", - "home.tutorials.crowdstrikeLogs.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.crowdstrikeLogs.longDescription": "これは Falcon [SIEM コネクター] (https://www.crowdstrike.com/blog/tech-center/integrate-with-your-siem) を使用したCrowdStrike Falcon のための Filebeatモジュールです。 このモジュールはこのデータを収集し、ECS に変換して、取り込み、SIEM に表示します。 デフォルトでは、Falcon SIEM コネクターは JSON 形式の Falcon Streaming API イベントデータを出力します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.crowdstrikeLogs.nameTitle": "CrowdStrike ログ", - "home.tutorials.crowdstrikeLogs.shortDescription": "Falcon SIEM コネクターを使用して CrowdStrike Falcon ログを収集します。", - "home.tutorials.cylanceLogs.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.cylanceLogs.longDescription": "これは、Syslog またはファイルで CylancePROTECT ログを受信するためのモジュールです。[詳細] ({learnMoreLink}) 。", - "home.tutorials.cylanceLogs.nameTitle": "CylancePROTECT ログ", - "home.tutorials.dockerMetrics.artifacts.dashboards.linkLabel": "Docker メトリックダッシュボード", - "home.tutorials.dockerMetrics.longDescription": "Metricbeat モジュール「docker」 は、Docker サーバーからメトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.dockerMetrics.nameTitle": "Docker メトリック", - "home.tutorials.dockerMetrics.shortDescription": "Docker コンテナーに関するメトリックを取得します。", - "home.tutorials.dropwizardMetrics.artifacts.application.label": "Discover", - "home.tutorials.dropwizardMetrics.longDescription": "Metricbeat モジュール「dropwizard」は、Dropwizard Java アプリケーション から内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.dropwizardMetrics.nameTitle": "Dropwizard メトリック", - "home.tutorials.dropwizardMetrics.shortDescription": "Dropwizard Java アプリケーションから内部メトリックを取得します。", - "home.tutorials.elasticsearchLogs.artifacts.application.label": "Discover", - "home.tutorials.elasticsearchLogs.longDescription": "「elasticsearch」Filebeat モジュールが、Elasticsearch により作成されたログをパースします。[詳細 ({learnMoreLink}) 。", - "home.tutorials.elasticsearchLogs.nameTitle": "Elasticsearch ログ", - "home.tutorials.elasticsearchLogs.shortDescription": "Elasticsearch により作成されたログを収集しパースします。", - "home.tutorials.elasticsearchMetrics.artifacts.application.label": "Discover", - "home.tutorials.elasticsearchMetrics.longDescription": "Metricbeat モジュール「elasticsearch」は、Elasticsearch から内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.elasticsearchMetrics.nameTitle": "Elasticsearch メトリック", - "home.tutorials.elasticsearchMetrics.shortDescription": "Elasticsearch から内部メトリックを取得します。", - "home.tutorials.envoyproxyLogs.artifacts.dashboards.linkLabel": "Envoy Proxy 概要", - "home.tutorials.envoyproxyLogs.longDescription": "これは Envoy Proxy アクセスログ (https://www.envoyproxy.io/docs/envoy/v1.10.0/configuration/access_log) 用の Filebeat モジュールです。Kubernetes でのスタンドアロンのデプロイメントと Envoy プロキシデプロイメントの両方をサポートします。[詳細] ({learnMoreLink}) 。", - "home.tutorials.envoyproxyLogs.nameTitle": "Envoy Proxy ログ", - "home.tutorials.envoyproxyLogs.shortDescription": "Envoy Proxy ログを収集します。", - "home.tutorials.envoyproxyMetrics.longDescription": "Metricbeat モジュール「envoyproxy」は、Envoy Proxy から監視メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.envoyproxyMetrics.nameTitle": "Envoy Proxy メトリック", - "home.tutorials.envoyproxyMetrics.shortDescription": "Envoy Proxy サーバーから監視メトリックを取得します。", - "home.tutorials.etcdMetrics.artifacts.application.label": "Discover", - "home.tutorials.etcdMetrics.longDescription": "Metricbeat モジュール「etcd」は、Etcd から内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.etcdMetrics.nameTitle": "Etcd メトリック", - "home.tutorials.etcdMetrics.shortDescription": "Etcd サーバーから内部メトリックを取得します。", - "home.tutorials.f5Logs.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.f5Logs.longDescription": "これは、Syslog またはファイルで Big-IP Access Policy Manager ログを受信するためのモジュールです。[詳細] ({learnMoreLink}) 。", - "home.tutorials.f5Logs.nameTitle": "F5 ログ", - "home.tutorials.f5Logs.shortDescription": "Syslog またはファイルで F5 Big-IP Access Policy Manager ログを収集します。", - "home.tutorials.fortinetLogs.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.fortinetLogs.longDescription": "これは Syslog 形式で送信された Fortinet FortiOS ログのためのモジュールです。[詳細] ({learnMoreLink}) 。", - "home.tutorials.fortinetLogs.nameTitle": "Fortinet ログ", - "home.tutorials.fortinetLogs.shortDescription": "Syslog で Fortinet FortiOS ログを収集します。", - "home.tutorials.gcpLogs.artifacts.dashboards.linkLabel": "監査ログダッシュボード", - "home.tutorials.gcpLogs.longDescription": "これは Google Cloud ログのモジュールです。Stackdriver から Google Pub/Sub トピックシンクにエクスポートされた監査、VPC フロー、ファイアウォールログの読み取りをサポートします。[詳細] ({learnMoreLink}) 。", - "home.tutorials.gcpLogs.nameTitle": "Google Cloud ログ", - "home.tutorials.gcpLogs.shortDescription": "Google Cloud 監査、ファイアウォール、VPC フローログを収集します。", - "home.tutorials.gcpMetrics.artifacts.dashboards.linkLabel": "Google Cloudメトリックダッシュボード", - "home.tutorials.gcpMetrics.longDescription": "「gcp」Metricbeatモジュールは、Stackdriver Monitoring APIを使用して、Google Cloud Platformから監視メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.gcpMetrics.nameTitle": "Google Cloudメトリック", - "home.tutorials.gcpMetrics.shortDescription": "Stackdriver Monitoring API を使用して、Google Cloud Platform から監視メトリックを取得します。", - "home.tutorials.golangMetrics.artifacts.dashboards.linkLabel": "Golang メトリックダッシュボード", - "home.tutorials.golangMetrics.longDescription": "Metricbeat モジュール「{moduleName}」は、Golang アプリから内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.golangMetrics.nameTitle": "Golang メトリック", - "home.tutorials.golangMetrics.shortDescription": "Golang アプリから内部メトリックを取得します。", - "home.tutorials.gsuiteLogs.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.gsuiteLogs.longDescription": "これは異なる GSuite 監査レポート API からデータを取り込むためのモジュールです。[詳細] ({learnMoreLink}) 。", - "home.tutorials.gsuiteLogs.nameTitle": "GSuite ログ", - "home.tutorials.gsuiteLogs.shortDescription": "GSuite アクティビティレポートを収集します。", - "home.tutorials.haproxyLogs.artifacts.dashboards.linkLabel": "HAProxy 概要", - "home.tutorials.haproxyLogs.longDescription": "このモジュールは、 (「haproxy」) プロセスからログを収集して解析します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.haproxyLogs.nameTitle": "HAProxy ログ", - "home.tutorials.haproxyLogs.shortDescription": "HAProxy ログを収集します。", - "home.tutorials.haproxyMetrics.artifacts.application.label": "Discover", - "home.tutorials.haproxyMetrics.longDescription": "Metricbeat モジュール「haproxy」は、HAProxy アプリから内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.haproxyMetrics.nameTitle": "HAProxy メトリック", - "home.tutorials.haproxyMetrics.shortDescription": "HAProxy サーバーから内部メトリックを取得します。", - "home.tutorials.ibmmqLogs.artifacts.dashboards.linkLabel": "IBM MQ イベント", - "home.tutorials.ibmmqLogs.longDescription": "Filebeat で IBM MQ ログを収集します。[詳細] ({learnMoreLink}) ", - "home.tutorials.ibmmqLogs.nameTitle": "IBM MQ ログ", - "home.tutorials.ibmmqLogs.shortDescription": "Filebeat で IBM MQ ログを収集します。", - "home.tutorials.ibmmqMetrics.artifacts.application.label": "Discover", - "home.tutorials.ibmmqMetrics.longDescription": "Metricbeat モジュール「ibmmq」は、IBM MQ インスタンスから監視メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.ibmmqMetrics.nameTitle": "IBM MQ メトリック", - "home.tutorials.ibmmqMetrics.shortDescription": "IBM MQ インスタンスから監視メトリックを取得します。", - "home.tutorials.icingaLogs.artifacts.dashboards.linkLabel": "Icinga Main ログ", - "home.tutorials.icingaLogs.longDescription": "このモジュールは [Icinga] (https://www.icinga.com/products/icinga-2/) のメイン、デバッグ、スタータップログを解析します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.icingaLogs.nameTitle": "Icinga ログ", - "home.tutorials.icingaLogs.shortDescription": "Icinga メイン、デバッグ、スタートアップログを収集します。", - "home.tutorials.iisLogs.artifacts.dashboards.linkLabel": "IIS ログダッシュボード", - "home.tutorials.iisLogs.longDescription": "「iis」Filebeat モジュールが、Nginx HTTP サーバーにより作成されたアクセスとエラーのログをパースします。[詳細] ({learnMoreLink}) 。", - "home.tutorials.iisLogs.nameTitle": "IIS ログ", - "home.tutorials.iisLogs.shortDescription": "IIS HTTP サーバーにより作成されたアクセスとエラーのログを収集しパースします。", - "home.tutorials.iisMetrics.artifacts.dashboards.linkLabel": "IISメトリックダッシュボード", - "home.tutorials.iisMetrics.longDescription": "「iis」Metricbeatモジュールは、IISサーバーおよび実行中のアプリケーションプールとWebサイトからメトリックを収集します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.iisMetrics.nameTitle": "IISメトリック", - "home.tutorials.iisMetrics.shortDescription": "IISサーバー関連メトリックを収集します。", - "home.tutorials.impervaLogs.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.impervaLogs.longDescription": "これは、Syslog またはファイルで SecureSphere ログを受信するためのモジュールです。[詳細] ({learnMoreLink}) 。", - "home.tutorials.impervaLogs.nameTitle": "Imperva ログ", - "home.tutorials.impervaLogs.shortDescription": "Syslog またはファイルから Imperva SecureSphere ログを収集します。", - "home.tutorials.infobloxLogs.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.infobloxLogs.longDescription": "これは、Syslog またはファイルで Infoblox NIOS ログを受信するためのモジュールです。[詳細] ({learnMoreLink}) 。", - "home.tutorials.infobloxLogs.nameTitle": "Infoblox ログ", - "home.tutorials.infobloxLogs.shortDescription": "Syslog またはファイルから Infoblox NIOS ログを収集します。", - "home.tutorials.iptablesLogs.artifacts.dashboards.linkLabel": "Iptables 概要", - "home.tutorials.iptablesLogs.longDescription": "これは iptables と ip6tables ログ用のモジュールです。ネットワーク上で受信した syslog ログ経由や、ファイルからのログをパースします。また、ルールセット名、ルール番号、トラフィックに実行されたアクション (許可/拒否) を含む、Ubiquiti ファイアウォールにより追加された接頭辞も認識できます。[詳細] ({learnMoreLink}) 。", - "home.tutorials.iptablesLogs.nameTitle": "Iptables ログ", - "home.tutorials.iptablesLogs.shortDescription": "iptables および ip6tables ログを収集します。", - "home.tutorials.juniperLogs.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.juniperLogs.longDescription": "これは、Syslog またはファイルで Juniper JUNOS ログを受信するためのモジュールです。[詳細] ({learnMoreLink}) 。", - "home.tutorials.juniperLogs.nameTitle": "Juniper ログ", - "home.tutorials.juniperLogs.shortDescription": "Syslog またはファイルから Juniper JUNOS ログを収集します。", - "home.tutorials.kafkaLogs.artifacts.dashboards.linkLabel": "Kafka ログダッシュボード", - "home.tutorials.kafkaLogs.longDescription": "「kafka」Filebeat モジュールは、Kafka が作成したログをパースします。[詳細] ({learnMoreLink}) 。", - "home.tutorials.kafkaLogs.nameTitle": "Kafka ログ", - "home.tutorials.kafkaLogs.shortDescription": "Kafka が作成したログを収集しパースします。", - "home.tutorials.kafkaMetrics.artifacts.application.label": "Discover", - "home.tutorials.kafkaMetrics.longDescription": "Metricbeat モジュール「kafka」は、Kafka から内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.kafkaMetrics.nameTitle": "Kafka メトリック", - "home.tutorials.kafkaMetrics.shortDescription": "Kafka サーバーから内部メトリックを取得します。", - "home.tutorials.kibanaLogs.artifacts.application.label": "Discover", - "home.tutorials.kibanaLogs.longDescription": "これは Kibana モジュールです。[詳細] ({learnMoreLink}) 。", - "home.tutorials.kibanaLogs.nameTitle": "Kibana ログ", - "home.tutorials.kibanaLogs.shortDescription": "Kibana ログを収集します。", - "home.tutorials.kibanaMetrics.artifacts.application.label": "Discover", - "home.tutorials.kibanaMetrics.longDescription": "Metricbeat モジュール「kibana」は、Kibana から内部メトリックを取得します。 [詳細] ({learnMoreLink}) 。", - "home.tutorials.kibanaMetrics.nameTitle": "Kibana メトリック", - "home.tutorials.kibanaMetrics.shortDescription": "Kibana から内部メトリックを取得します。", - "home.tutorials.kubernetesMetrics.artifacts.dashboards.linkLabel": "Kubernetes メトリックダッシュボード", - "home.tutorials.kubernetesMetrics.longDescription": "Metricbeat モジュール「kubernetes」は、Kubernetes API からメトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.kubernetesMetrics.nameTitle": "Kubernetes メトリック", - "home.tutorials.kubernetesMetrics.shortDescription": "Kubernetes からメトリックを取得します。", - "home.tutorials.logstashLogs.artifacts.dashboards.linkLabel": "Logstash ログ", - "home.tutorials.logstashLogs.longDescription": "このモジュールは Logstash 標準ログと低速ログを解析します。プレーンテキスト形式と JSON 形式がサポートされます。[詳細] ({learnMoreLink}) 。", - "home.tutorials.logstashLogs.nameTitle": "Logstash ログ", - "home.tutorials.logstashLogs.shortDescription": "Logstash メインおよび低速ログを収集します。", - "home.tutorials.logstashMetrics.artifacts.application.label": "Discover", - "home.tutorials.logstashMetrics.longDescription": "Metricbeat モジュール「{moduleName}」は、Logstash サーバーから内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.logstashMetrics.nameTitle": "Logstash メトリック", - "home.tutorials.logstashMetrics.shortDescription": "Logstash サーバーから内部メトリックを取得します。", - "home.tutorials.memcachedMetrics.artifacts.application.label": "Discover", - "home.tutorials.memcachedMetrics.longDescription": "Metricbeat モジュール「memcached」は、Memcached から内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.memcachedMetrics.nameTitle": "Memcached メトリック", - "home.tutorials.memcachedMetrics.shortDescription": "Memcached サーバーから内部メトリックを取得します。", - "home.tutorials.microsoftLogs.artifacts.dashboards.linkLabel": "Microsoft ATP 概要", - "home.tutorials.microsoftLogs.longDescription": "Elastic Security で使用する Microsoft Defender ATP アラートを収集します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.microsoftLogs.nameTitle": "Microsoft Defender ATP ログ", - "home.tutorials.microsoftLogs.shortDescription": "Microsoft Defender ATP アラートを収集します。", - "home.tutorials.mispLogs.artifacts.dashboards.linkLabel": "MISP 概要", - "home.tutorials.mispLogs.longDescription": "これは MISP プラットフォーム (https://www.circl.lu/doc/misp/) から脅威インテリジェンス情報を読み取るための Filebeatモジュールです。MISP REST API インターフェイスにアクセスするために httpjson 入力を使用します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.mispLogs.nameTitle": "MISP 脅威インテリジェンスログ", - "home.tutorials.mispLogs.shortDescription": "Filebeat を使用して MISP 脅威インテリジェンスデータを収集します。", - "home.tutorials.mongodbLogs.artifacts.dashboards.linkLabel": "MongoDB 概要", - "home.tutorials.mongodbLogs.longDescription": "このモジュールは、[MongoDB] (https://www.mongodb.com/) で作成されたログを収集し、解析します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.mongodbLogs.nameTitle": "MongoDB ログ", - "home.tutorials.mongodbLogs.shortDescription": "MongoDB ログを収集します。", - "home.tutorials.mongodbMetrics.artifacts.dashboards.linkLabel": "MongoDB メトリックダッシュボード", - "home.tutorials.mongodbMetrics.longDescription": "Metricbeat モジュール「mongodb」は、MongoDB サーバーから内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.mongodbMetrics.nameTitle": "MongoDB メトリック", - "home.tutorials.mongodbMetrics.shortDescription": "MongoDB から内部メトリックを取得します。", - "home.tutorials.mssqlLogs.artifacts.application.label": "Discover", - "home.tutorials.mssqlLogs.longDescription": "このモジュールは MSSQL により作成されたエラーログを解析します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.mssqlLogs.nameTitle": "MSSQL ログ", - "home.tutorials.mssqlLogs.shortDescription": "MSSQL ログを収集します。", - "home.tutorials.mssqlMetrics.artifacts.dashboards.linkLabel": "Microsoft SQL Server メトリックダッシュボード", - "home.tutorials.mssqlMetrics.longDescription": "Metricbeat モジュール「mssql」は、Microsoft SQL Server インスタンスからの監視、ログ、パフォーマンスメトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.mssqlMetrics.nameTitle": "Microsoft SQL Server Metrics", - "home.tutorials.mssqlMetrics.shortDescription": "Microsoft SQL Server インスタンスから監視メトリックを取得します。", - "home.tutorials.muninMetrics.artifacts.application.label": "Discover", - "home.tutorials.muninMetrics.longDescription": "Metricbeat モジュール「munin」は、Munin から内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.muninMetrics.nameTitle": "Munin メトリック", - "home.tutorials.muninMetrics.shortDescription": "Munin サーバーから内部メトリックを取得します。", - "home.tutorials.mysqlLogs.artifacts.dashboards.linkLabel": "MySQL ログダッシュボード", - "home.tutorials.mysqlLogs.longDescription": "「mysql」Filebeat モジュールは、MySQL が作成したエラーとスローログをパースします。[詳細] ({learnMoreLink}) 。", - "home.tutorials.mysqlLogs.nameTitle": "MySQL ログ", - "home.tutorials.mysqlLogs.shortDescription": "MySQL が作成したエラーとスローログを収集しパースします。", - "home.tutorials.mysqlMetrics.artifacts.dashboards.linkLabel": "MySQL メトリックダッシュボード", - "home.tutorials.mysqlMetrics.longDescription": "Metricbeat モジュール「mysql」は、MySQL サーバーから内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.mysqlMetrics.nameTitle": "MySQL メトリック", - "home.tutorials.mysqlMetrics.shortDescription": "MySQL から内部メトリックを取得します。", - "home.tutorials.natsLogs.artifacts.dashboards.linkLabel": "NATSログダッシュボード", - "home.tutorials.natsLogs.longDescription": "「nats」Filebeat モジュールが、Nats により作成されたログをパースします。[詳細] ({learnMoreLink}) 。", - "home.tutorials.natsLogs.nameTitle": "NATSログ", - "home.tutorials.natsLogs.shortDescription": "Nats により作成されたログを収集しパースします。", - "home.tutorials.natsMetrics.artifacts.dashboards.linkLabel": "NATSメトリックダッシュボード", - "home.tutorials.natsMetrics.longDescription": "Metricbeat モジュール「nats」は、Nats から監視メトリックを取得します。[詳細] {learnMoreLink}) 。", - "home.tutorials.natsMetrics.nameTitle": "NATSメトリック", - "home.tutorials.natsMetrics.shortDescription": "Nats サーバーから監視メトリックを取得します。", - "home.tutorials.netflowLogs.artifacts.dashboards.linkLabel": "Netflow 概要", - "home.tutorials.netflowLogs.longDescription": "これは UDP で NetFlow および IPFIX フローレコードを受信するモジュールです。この入力は、NetFlow バージョン 1、5、6、7、8、9、IPFIX をサポートします。NetFlow バージョン 9 以外では、フィールドが自動的に NetFlow v9 にマッピングされます。[詳細] ({learnMoreLink}) 。", - "home.tutorials.netflowLogs.nameTitle": "NetFlow / IPFIX Collector", - "home.tutorials.netflowLogs.shortDescription": "NetFlow および IPFIX フローレコードを収集します。", - "home.tutorials.netscoutLogs.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.netscoutLogs.nameTitle": "Arbor Peakflow ログ", - "home.tutorials.netscoutLogs.shortDescription": "Syslog またはファイルから Netscout Arbor Peakflow SP ログを収集します。", - "home.tutorials.nginxLogs.artifacts.dashboards.linkLabel": "Nginx ログダッシュボード", - "home.tutorials.nginxLogs.longDescription": "「nginx」Filebeat モジュールは、Nginx HTTP サーバーが作成したアクセスとエラーのログをパースします。[詳細] ({learnMoreLink}) 。", - "home.tutorials.nginxLogs.nameTitle": "Nginx ログ", - "home.tutorials.nginxLogs.shortDescription": "Nginx HTTP サーバーが作成したアクセスとエラーのログを収集しパースします。", - "home.tutorials.nginxMetrics.artifacts.dashboards.linkLabel": "Nginx メトリックダッシュボード", - "home.tutorials.nginxMetrics.longDescription": "Metricbeat モジュール「nginx」は、Nginx サーバーから内部メトリックを取得します。このモジュールは {statusModuleLink} で生成したウェブページからサーバーステータスデータを収集しますが、これは Nginx で有効にする必要があります。[詳細] ({learnMoreLink}) 。", - "home.tutorials.nginxMetrics.nameTitle": "Nginx メトリック", - "home.tutorials.nginxMetrics.shortDescription": "Nginx HTTP サーバーから内部メトリックを取得します。", - "home.tutorials.o365Logs.artifacts.dashboards.linkLabel": "O365 監査ダッシュボード", - "home.tutorials.o365Logs.longDescription": "これは Office 365 API エンドポイントのいずれか経由で受信された Office 365 ログのモジュールです。現在、ユーザー、管理者、システム、ポリシーアクションのほか、Office 365 Management Activity API によって公開された Office 365 および Azure AD アクティビティログからのイベントがサポートされています。[詳細] ({learnMoreLink}) 。", - "home.tutorials.o365Logs.nameTitle": "Office 365 ログ", - "home.tutorials.o365Logs.shortDescription": "Office 365 API 経由で Office 365 アクティビティログを収集します。", - "home.tutorials.oktaLogs.artifacts.dashboards.linkLabel": "Okta 概要", - "home.tutorials.oktaLogs.longDescription": "Okta モジュールは[Okta API] (https://developer.okta.com/docs/reference/) からイベントを収集します。 特に、これは[Okta システムログ API] (https://developer.okta.com/docs/reference/api/system-log/) からの読み取りをサポートします。 [詳細] ({learnMoreLink}) 。", - "home.tutorials.oktaLogs.nameTitle": "Okta ログ", - "home.tutorials.oktaLogs.shortDescription": "Okta API 経由で Okta システムログを収集します。", - "home.tutorials.openmetricsMetrics.longDescription": "Metricbeat モジュール「openmetrics」は、OpenMetrics の形式でメトリックを提供するエンドポイントからメトリックをフェッチします。[詳細] ({learnMoreLink}) 。", - "home.tutorials.openmetricsMetrics.nameTitle": "OpenMetrics メトリック", - "home.tutorials.openmetricsMetrics.shortDescription": "OpenMetrics 形式でメトリックを提供するエンドポイントからメトリックを取得します。", - "home.tutorials.oracleMetrics.artifacts.application.label": "Discover", - "home.tutorials.oracleMetrics.longDescription": "「{moduleName}」Metricbeatモジュールは、Oracleサーバーから内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.oracleMetrics.nameTitle": "Oracleメトリック", - "home.tutorials.oracleMetrics.shortDescription": "Oracleサーバーから内部メトリックを取得します。", - "home.tutorials.osqueryLogs.artifacts.dashboards.linkLabel": "Osquery コンプライアンスパック", - "home.tutorials.osqueryLogs.longDescription": "このモジュールは JSON 形式で [osqueryd] (https://osquery.readthedocs.io/en/latest/introduction/using-osqueryd/) によって作成された結果ログを収集およびデコードします。osqueryd を設定するには、ご使用のオペレーティングシステムの osquery インストール手順に従い、「filesystem」ロギングドラバー (デフォルト) を構成します。 UTC タイムスタンプが有効であることを確認します。 [詳細] ({learnMoreLink}) 。", - "home.tutorials.osqueryLogs.nameTitle": "Osquery ログ", - "home.tutorials.osqueryLogs.shortDescription": "JSON 形式で osquery を収集します。", - "home.tutorials.panwLogs.artifacts.dashboards.linkLabel": "PANW ネットワークフロー", - "home.tutorials.panwLogs.longDescription": "このモジュールは、Syslog から受信したログまたはファイルから読み取られたログを監視する Palo Alto Networks PAN-OS ファイアウォール監視ログのモジュールです。現在、トラフィックおよび脅威タイプのメッセージがサポートされます。 [詳細] ({learnMoreLink}) 。", - "home.tutorials.panwLogs.nameTitle": "Palo Alto Networks PAN-OS ログ", - "home.tutorials.panwLogs.shortDescription": "Syslog またはログファイルから Palo Alto Networks PAN-OS 脅威およびトラフィックログを収集します。", - "home.tutorials.phpFpmMetrics.longDescription": "Metricbeat モジュール「php_fpm」は、PHP-FPM サーバーから内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.phpFpmMetrics.nameTitle": "PHP-FPM メトリック", - "home.tutorials.phpFpmMetrics.shortDescription": "PHP-FPM から内部メトリックを取得します。", - "home.tutorials.postgresqlLogs.artifacts.dashboards.linkLabel": "PostgreSQL ログダッシュボード", - "home.tutorials.postgresqlLogs.longDescription": "「postgresql」Filebeat モジュールが、PostgreSQL により作成されたエラーとスローログをパースします。[詳細] ({learnMoreLink}) 。", - "home.tutorials.postgresqlLogs.nameTitle": "PostgreSQL ログ", - "home.tutorials.postgresqlLogs.shortDescription": "PostgreSQL により作成されたエラーとスローログを収集しパースします。", - "home.tutorials.postgresqlMetrics.longDescription": "Metricbeat モジュール「postgresql」は、PostgreSQL サーバーから内部メトリックを取得します。 [詳細] ({learnMoreLink}) 。", - "home.tutorials.postgresqlMetrics.nameTitle": "PostgreSQL メトリック", - "home.tutorials.postgresqlMetrics.shortDescription": "PostgreSQL から内部メトリックを取得します。", - "home.tutorials.prometheusMetrics.artifacts.application.label": "Discover", - "home.tutorials.prometheusMetrics.longDescription": "Metricbeat モジュール「{moduleName}」は、Prometheus エンドポイントからメトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.prometheusMetrics.nameTitle": "Prometheus メトリック", - "home.tutorials.prometheusMetrics.shortDescription": "Prometheus エクスポーターからメトリックを取得します。", - "home.tutorials.rabbitmqLogs.artifacts.application.label": "Discover", - "home.tutorials.rabbitmqLogs.longDescription": "これは[RabbitMQ ログファイル] (https://www.rabbitmq.com/logging.html) を解析するモジュールです。 [詳細] ({learnMoreLink}) 。", - "home.tutorials.rabbitmqLogs.nameTitle": "RabbitMQ ログ", - "home.tutorials.rabbitmqLogs.shortDescription": "RabbitMQ ログを収集します。", - "home.tutorials.rabbitmqMetrics.artifacts.dashboards.linkLabel": "RabbitMQ メトリックダッシュボード", - "home.tutorials.rabbitmqMetrics.longDescription": "Metricbeat モジュール「rabbitmq」は、RabbitMQ サーバーから内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.rabbitmqMetrics.nameTitle": "RabbitMQ メトリック", - "home.tutorials.rabbitmqMetrics.shortDescription": "RabbitMQ サーバーから内部メトリックを取得します。", - "home.tutorials.radwareLogs.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.radwareLogs.longDescription": "これは、Syslog またはファイルで Radware DefensePro ログを受信するためのモジュールです。[詳細] ({learnMoreLink}) 。", - "home.tutorials.radwareLogs.nameTitle": "Radware DefensePro ログ", - "home.tutorials.radwareLogs.shortDescription": "Syslog またはファイルから Radware DefensePro ログを収集します。", - "home.tutorials.redisenterpriseMetrics.artifacts.application.label": "Discover", - "home.tutorials.redisenterpriseMetrics.longDescription": "Metricbeat モジュール「redisenterprise」は Redis Enterprise Server 監視メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.redisenterpriseMetrics.nameTitle": "Redis Enterprise メトリック", - "home.tutorials.redisenterpriseMetrics.shortDescription": "Redis Enterprise Server から監視メトリックを取得します。", - "home.tutorials.redisLogs.artifacts.dashboards.linkLabel": "Redis ログダッシュボード", - "home.tutorials.redisLogs.longDescription": "「redis」Filebeat モジュールは、Redis が作成したエラーとスローログをパースします。Redis がエラーログを作成するには、Redis 構成ファイルの「logfile」オプションが「redis-server.log」に設定されていることを確認してください。スローログは「SLOWLOG」コマンドで Redis から直接的に読み込まれます。Redis でスローログを記録するには、「slowlog-log-slower-than」オプションが設定されていることを確認してください。「slowlog」ファイルセットは実験的なものであることに注意してください。[詳細] ({learnMoreLink}) 。", - "home.tutorials.redisLogs.nameTitle": "Redis ログ", - "home.tutorials.redisLogs.shortDescription": "Redis が作成したエラーとスローログを収集しパースします。", - "home.tutorials.redisMetrics.artifacts.dashboards.linkLabel": "Redis メトリックダッシュボード", - "home.tutorials.redisMetrics.longDescription": "Metricbeat モジュール「redis」は、Redis サーバーから内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.redisMetrics.nameTitle": "Redis メトリック", - "home.tutorials.redisMetrics.shortDescription": "Redis から内部メトリックを取得します。", - "home.tutorials.santaLogs.artifacts.dashboards.linkLabel": "Santa 概要", - "home.tutorials.santaLogs.longDescription": "このモジュールは、プロセス実行を監視し、バイナリをブラックリスト/ホワイトリストに登録できる macOS 向けのセキュリティツールである [Google Santa] (https://github.com/google/santa) からログを収集して解析します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.santaLogs.nameTitle": "Google Santa ログ", - "home.tutorials.santaLogs.shortDescription": "MacOS でのプロセス実行に関する Google Santa ログを収集します。", - "home.tutorials.sonicwallLogs.longDescription": "これは、Syslog またはファイルで Sonicwall-FW ログを受信するためのモジュールです。[詳細] ({learnMoreLink}) 。", - "home.tutorials.sonicwallLogs.nameTitle": "Sonicwall FW ログ", - "home.tutorials.sonicwallLogs.shortDescription": "Syslog またはファイルから Sonicwall-FW ログを収集します。", - "home.tutorials.sophosLogs.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.sophosLogs.longDescription": "これは Sophos 製品用モジュールであり、Syslog 形式で送信された XG SFOS ログが現在サポートされています。[詳細] ({learnMoreLink}) 。", - "home.tutorials.sophosLogs.nameTitle": "Sophos ログ", - "home.tutorials.sophosLogs.shortDescription": "Syslog で Sophos XG SFOS ログを収集します。", - "home.tutorials.squidLogs.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.squidLogs.longDescription": "これは、Syslog またはファイルで Squid ログを受信するためのモジュールです。[詳細] ({learnMoreLink}) 。", - "home.tutorials.squidLogs.nameTitle": "Squid ログ", - "home.tutorials.squidLogs.shortDescription": "Syslog またはファイルから Squid ログを収集します。", - "home.tutorials.stanMetrics.artifacts.dashboards.linkLabel": "Stan メトリックダッシュボード", - "home.tutorials.stanMetrics.longDescription": "Metricbeat モジュール「stan」は、STAN から監視メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.stanMetrics.nameTitle": "STAN メトリック", - "home.tutorials.stanMetrics.shortDescription": "STAN サーバーから監視メトリックを取得します。", - "home.tutorials.statsdMetrics.longDescription": "Metricbeat モジュール「statsd」は、statsd から監視メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.statsdMetrics.nameTitle": "statsd メトリック", - "home.tutorials.statsdMetrics.shortDescription": "statsd から監視メトリックを取得します。", - "home.tutorials.suricataLogs.artifacts.dashboards.linkLabel": "Suricata イベント概要", - "home.tutorials.suricataLogs.longDescription": "このモジュールは Suricata IDS/IPS/NSM ログ用です。[Suricata Eve JSON 形式] (https://suricata.readthedocs.io/en/latest/output/eve/eve-json-format.html) のログを解析します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.suricataLogs.nameTitle": "Suricata ログ", - "home.tutorials.suricataLogs.shortDescription": "Suricata IDS/IPS/NSM ログを収集します。", - "home.tutorials.systemLogs.artifacts.dashboards.linkLabel": "システム Syslog ダッシュボード", - "home.tutorials.systemLogs.longDescription": "このモジュールは、一般的な Unix/Linux ベースのディストリビューションのシステムログサービスが作成したログを収集し解析します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.systemLogs.nameTitle": "システムログ", - "home.tutorials.systemLogs.shortDescription": "一般的な Unix/Linux ベースのディストリビューションのシステムログを収集します。", - "home.tutorials.systemMetrics.artifacts.dashboards.linkLabel": "システムメトリックダッシュボード", - "home.tutorials.systemMetrics.longDescription": "Metricbeat モジュール「system」は、ホストから CPU、メモリー、ネットワーク、ディスクの統計を収集します。システム全体の統計とプロセスやファイルシステムごとの統計を収集します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.systemMetrics.nameTitle": "システムメトリック", - "home.tutorials.systemMetrics.shortDescription": "ホストから CPU、メモリー、ネットワーク、ディスクの統計を収集します。", - "home.tutorials.tomcatLogs.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.tomcatLogs.longDescription": "これは、Syslog またはファイルで Apache Tomcat ログを受信するためのモジュールです。[詳細] ({learnMoreLink}) 。", - "home.tutorials.tomcatLogs.nameTitle": "Tomcat ログ", - "home.tutorials.tomcatLogs.shortDescription": "Syslog またはファイルから Apache Tomcat ログを収集します。", - "home.tutorials.traefikLogs.artifacts.dashboards.linkLabel": "Traefik アクセスログ", - "home.tutorials.traefikLogs.longDescription": "このモジュールは[Træfik] (https://traefik.io/) により作成されたアクセスログを解析します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.traefikLogs.nameTitle": "Traefik ログ", - "home.tutorials.traefikLogs.shortDescription": "Traefik アクセスログを収集します。", - "home.tutorials.traefikMetrics.longDescription": "Metricbeat モジュール「traefik」は、Traefik から監視メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.traefikMetrics.nameTitle": "Traefik メトリック", - "home.tutorials.traefikMetrics.shortDescription": "Traefik から監視メトリックを取得します。", - "home.tutorials.uptimeMonitors.artifacts.dashboards.linkLabel": "Uptime アプリ", - "home.tutorials.uptimeMonitors.longDescription": "アクティブなプロービングでサービスの稼働状況を監視します。 Heartbeat は URL のリストに基づいて質問します。稼働していますか? [詳細] ({learnMoreLink}) 。", - "home.tutorials.uptimeMonitors.nameTitle": "稼働状況監視", - "home.tutorials.uptimeMonitors.shortDescription": "サービスの稼働状況を監視します。", - "home.tutorials.uwsgiMetrics.artifacts.dashboards.linkLabel": "uWSGI メトリックダッシュボード", - "home.tutorials.uwsgiMetrics.longDescription": "Metricbeat モジュール「uwsgi」は、uWSGI サーバーから内部メトリックを取得します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.uwsgiMetrics.nameTitle": "uWSGI メトリック", - "home.tutorials.uwsgiMetrics.shortDescription": "uWSGI サーバーから内部メトリックを取得します。", - "home.tutorials.vsphereMetrics.artifacts.application.label": "Discover", - "home.tutorials.vsphereMetrics.longDescription": "「vsphere」Metricbeat モジュールは、vSphere クラスターから内部メトリックを取得します。 [詳細] ({learnMoreLink}) 。", - "home.tutorials.vsphereMetrics.nameTitle": "vSphere メトリック", - "home.tutorials.vsphereMetrics.shortDescription": "vSphere から内部メトリックを取得します。", - "home.tutorials.windowsEventLogs.artifacts.application.label": "SIEM アプリ", - "home.tutorials.windowsEventLogs.longDescription": "Winlogbeat を使用して Windows イベントログからログを収集します。[詳細] ({learnMoreLink}) 。", - "home.tutorials.windowsEventLogs.nameTitle": "Windows イベントログ", - "home.tutorials.windowsEventLogs.shortDescription": "Windows イベントログからイベントを取得します。", - "home.tutorials.windowsMetrics.artifacts.application.label": "Discover", - "home.tutorials.windowsMetrics.longDescription": "「windows」Metricbeat モジュールは、Windows から内部メトリックを取得します。 [詳細] ({learnMoreLink}) 。", - "home.tutorials.windowsMetrics.nameTitle": "Windows メトリック", - "home.tutorials.windowsMetrics.shortDescription": "Windows から内部メトリックを取得します。", - "home.tutorials.zeekLogs.artifacts.dashboards.linkLabel": "Zeek 概要", - "home.tutorials.zeekLogs.longDescription": "これは Zeek (旧称 Bro) のモジュールです。[Zeek JSON 形式] (https://www.zeek.org/manual/release/logs/index.html) のログを解析します。 [詳細] ({learnMoreLink}) 。", - "home.tutorials.zeekLogs.nameTitle": "Zeek ログ", - "home.tutorials.zeekLogs.shortDescription": "Zeek ネットワークセキュリティ監視ログを収集します。", - "home.tutorials.zookeeperMetrics.artifacts.application.label": "Discover", - "home.tutorials.zookeeperMetrics.longDescription": "「{moduleName}」Metricbeat モジュールは、Zookeeper サーバーから内部メトリックを取得します。 [詳細] ({learnMoreLink}) 。", - "home.tutorials.zookeeperMetrics.nameTitle": "Zookeeper メトリック", - "home.tutorials.zookeeperMetrics.shortDescription": "Zookeeper サーバーから内部メトリックを取得します。", - "home.tutorials.zscalerLogs.artifacts.dashboards.linkLabel": "セキュリティアプリ", - "home.tutorials.zscalerLogs.longDescription": "これは、Syslog またはファイルで Zscaler NSS ログを受信するためのモジュールです。[詳細] ({learnMoreLink}) 。", - "home.tutorials.zscalerLogs.nameTitle": "Zscaler ログ", - "home.tutorials.zscalerLogs.shortDescription": "これは、Syslog またはファイルで Zscaler NSS ログを受信するためのモジュールです。", - "home.welcomeTitle": "Elasticへようこそ", - "indexPatternFieldEditor.color.actions": "アクション", - "indexPatternFieldEditor.color.addColorButton": "色を追加", - "indexPatternFieldEditor.color.backgroundLabel": "背景色", - "indexPatternFieldEditor.color.deleteAria": "削除", - "indexPatternFieldEditor.color.deleteTitle": "色のフォーマットを削除", - "indexPatternFieldEditor.color.exampleLabel": "例", - "indexPatternFieldEditor.color.patternLabel": "パターン (正規表現) ", - "indexPatternFieldEditor.color.rangeLabel": "範囲 (min:max) ", - "indexPatternFieldEditor.color.textColorLabel": "文字の色", - "indexPatternFieldEditor.date.documentationLabel": "ドキュメント", - "indexPatternFieldEditor.date.momentLabel": "Moment.jsのフォーマットパターン (デフォルト:{defaultPattern}) ", - "indexPatternFieldEditor.defaultErrorMessage": "このフォーマット構成の使用を試みた際にエラーが発生しました:{message}", - "indexPatternFieldEditor.defaultFormatDropDown": "- デフォルト -", - "indexPatternFieldEditor.defaultFormatHeader": "フォーマット (デフォルト:{defaultFormat}) ", - "indexPatternFieldEditor.deleteField.savedHeader": "「{fieldName}」が保存されました", - "indexPatternFieldEditor.deleteRuntimeField.confirmationModal.cancelButtonLabel": "キャンセル", - "indexPatternFieldEditor.deleteRuntimeField.confirmationModal.removeButtonLabel": "フィールドの削除", - "indexPatternFieldEditor.deleteRuntimeField.confirmationModal.removeMultipleButtonLabel": "フィールドの削除", - "indexPatternFieldEditor.deleteRuntimeField.confirmationModal.saveButtonLabel": "変更を保存", - "indexPatternFieldEditor.deleteRuntimeField.confirmModal.deleteMultipleTitle": "{count}個のフィールドを削除", - "indexPatternFieldEditor.deleteRuntimeField.confirmModal.deleteSingleTitle": "フィールド'{name}'を削除", - "indexPatternFieldEditor.deleteRuntimeField.confirmModal.multipleDeletionDescription": "これらのランタイムフィールドを削除しようとしています。", - "indexPatternFieldEditor.deleteRuntimeField.confirmModal.typeConfirm": "REMOVEと入力すると確認します", - "indexPatternFieldEditor.deleteRuntimeField.confirmModal.warningChangingFields": "名前または型を変更すると、このフィールドに依存する検索およびビジュアライゼーションが破損する可能性があります。", - "indexPatternFieldEditor.deleteRuntimeField.confirmModal.warningRemovingFields": "フィールドを削除すると、このフィールドに依存する検索およびビジュアライゼーションが破損する可能性があります。", - "indexPatternFieldEditor.duration.decimalPlacesLabel": "小数部分の桁数", - "indexPatternFieldEditor.duration.includeSpace": "サフィックスと値の間にスペースを入れる", - "indexPatternFieldEditor.duration.inputFormatLabel": "インプット形式", - "indexPatternFieldEditor.duration.outputFormatLabel": "アウトプット形式", - "indexPatternFieldEditor.duration.showSuffixLabel": "接尾辞を表示", - "indexPatternFieldEditor.duration.showSuffixLabel.short": "短縮サフィックスを使用", - "indexPatternFieldEditor.durationErrorMessage": "小数部分の桁数は0から20までの間で指定する必要があります", - "indexPatternFieldEditor.editor.flyoutDefaultTitle": "フィールドを作成", - "indexPatternFieldEditor.editor.flyoutEditFieldSubtitle": "インデックスパターン:{patternName}", - "indexPatternFieldEditor.editor.flyoutEditFieldTitle": "「{fieldName}」フィールドの編集", - "indexPatternFieldEditor.editor.flyoutSaveButtonLabel": "保存", - "indexPatternFieldEditor.editor.form.advancedSettings.hideButtonLabel": "高度な SIEM 設定の非表示化", - "indexPatternFieldEditor.editor.form.advancedSettings.showButtonLabel": "高度なSIEM設定の表示", - "indexPatternFieldEditor.editor.form.changeWarning": "名前または型を変更すると、このフィールドに依存する検索およびビジュアライゼーションが破損する可能性があります。", - "indexPatternFieldEditor.editor.form.customLabelDescription": "Discover、Maps、Visualizeでフィールド名の代わりに表示するラベルを作成します。長いフィールド名を短くする際に役立ちます。 クエリとフィルターは元のフィールド名を使用します。", - "indexPatternFieldEditor.editor.form.customLabelLabel": "カスタムラベル", - "indexPatternFieldEditor.editor.form.customLabelTitle": "カスタムラベルを設定", - "indexPatternFieldEditor.editor.form.defineFieldLabel": "スクリプトを定義", - "indexPatternFieldEditor.editor.form.fieldShadowingCalloutDescription": "このフィールドはマッピングされたフィールドの名前を共有します。このフィールドの値は検索結果に返されます。", - "indexPatternFieldEditor.editor.form.fieldShadowingCalloutTitle": "フィールドシャドーイング", - "indexPatternFieldEditor.editor.form.formatDescription": "値を表示する任意の形式を設定します。形式を変更すると値に影響し、Discoverでのハイライトができない可能性があります。", - "indexPatternFieldEditor.editor.form.formatTitle": "フォーマットの設定", - "indexPatternFieldEditor.editor.form.nameAriaLabel": "名前フィールド", - "indexPatternFieldEditor.editor.form.nameLabel": "名前", - "indexPatternFieldEditor.editor.form.popularityDescription": "ポピュラリティを調整し、フィールドリストでフィールドを上下に表示させます。 デフォルトでは、Discoverは選択の多いものから選択の少ないものの順に表示します。", - "indexPatternFieldEditor.editor.form.popularityLabel": "利用頻度", - "indexPatternFieldEditor.editor.form.popularityTitle": "ポピュラリティ", - "indexPatternFieldEditor.editor.form.runtimeType.placeholderLabel": "タイプを選択", - "indexPatternFieldEditor.editor.form.runtimeTypeLabel": "型", - "indexPatternFieldEditor.editor.form.script.learnMoreLinkText": "スクリプト構文の詳細を参照してください。", - "indexPatternFieldEditor.editor.form.scriptEditor.compileErrorMessage": "Painlessスクリプトのコンパイルエラー", - "indexPatternFieldEditor.editor.form.scriptEditor.debugErrorMessage": "構文エラー詳細", - "indexPatternFieldEditor.editor.form.scriptEditorAriaLabel": "スクリプトエディター", - "indexPatternFieldEditor.editor.form.scriptEditorValidationMessage": "無効なPainless構文です。", - "indexPatternFieldEditor.editor.form.source.scriptFieldHelpText": "スクリプトがないランタイムフィールドは、{source}から値を取得します。フィールドが_sourceに存在しない場合は、検索リクエストは値を返しません。{learnMoreLink}", - "indexPatternFieldEditor.editor.form.typeSelectAriaLabel": "タイプ選択", - "indexPatternFieldEditor.editor.form.validations.customLabelIsRequiredErrorMessage": "フィールドにラベルを付けます。", - "indexPatternFieldEditor.editor.form.validations.nameIsRequiredErrorMessage": "名前が必要です。", - "indexPatternFieldEditor.editor.form.validations.popularityGreaterThan0ErrorMessage": "ポピュラリティはゼロ以上でなければなりません。", - "indexPatternFieldEditor.editor.form.validations.popularityIsRequiredErrorMessage": "フィールドにポピュラリティを割り当てます。", - "indexPatternFieldEditor.editor.form.validations.scriptIsRequiredErrorMessage": "フィールド値を設定するには、スクリプトが必要です。", - "indexPatternFieldEditor.editor.form.valueDescription": "{source}の同じ名前のフィールドから取得するのではなく、フィールドの値を設定します。", - "indexPatternFieldEditor.editor.form.valueTitle": "値を設定", - "indexPatternFieldEditor.editor.runtimeFieldsEditor.existRuntimeFieldNamesValidationErrorMessage": "この名前のフィールドはすでに存在します。", - "indexPatternFieldEditor.editor.validationErrorTitle": "続行する前にフォームのエラーを修正してください。", - "indexPatternFieldEditor.formatHeader": "フォーマット", - "indexPatternFieldEditor.histogram.histogramAsNumberLabel": "アグリゲーションされた数値形式", - "indexPatternFieldEditor.histogram.numeralLabel": "数値形式パターン (任意) ", - "indexPatternFieldEditor.histogram.subFormat.bytes": "バイト", - "indexPatternFieldEditor.histogram.subFormat.number": "数字", - "indexPatternFieldEditor.histogram.subFormat.percent": "割合 (%) ", - "indexPatternFieldEditor.noSuchFieldName": "フィールド名'{fieldName}'はインデックスパターンで見つかりません", - "indexPatternFieldEditor.number.documentationLabel": "ドキュメント", - "indexPatternFieldEditor.number.numeralLabel": "Numeral.js のフォーマットパターン (デフォルト: {defaultPattern})", - "indexPatternFieldEditor.samples.inputHeader": "インプット", - "indexPatternFieldEditor.samples.outputHeader": "アウトプット", - "indexPatternFieldEditor.samplesHeader": "サンプル", - "indexPatternFieldEditor.save.deleteErrorTitle": "フィールド削除を保存できませんでした", - "indexPatternFieldEditor.save.errorTitle": "フィールド変更を保存できませんでした", - "indexPatternFieldEditor.saveRuntimeField.confirmationModal.cancelButtonLabel": "キャンセル", - "indexPatternFieldEditor.saveRuntimeField.confirmModal.title": "変更を'{name}'に保存", - "indexPatternFieldEditor.saveRuntimeField.confirmModal.typeConfirm": "続行するにはCHANGEと入力します", - "indexPatternFieldEditor.staticLookup.actions": "アクション", - "indexPatternFieldEditor.staticLookup.addEntryButton": "エントリーを追加", - "indexPatternFieldEditor.staticLookup.deleteAria": "削除", - "indexPatternFieldEditor.staticLookup.deleteTitle": "エントリーの削除", - "indexPatternFieldEditor.staticLookup.keyLabel": "キー", - "indexPatternFieldEditor.staticLookup.leaveBlankPlaceholder": "値をそのままにするには空欄にします", - "indexPatternFieldEditor.staticLookup.unknownKeyLabel": "不明なキーの値", - "indexPatternFieldEditor.staticLookup.valueLabel": "値", - "indexPatternFieldEditor.string.transformLabel": "変換", - "indexPatternFieldEditor.truncate.lengthLabel": "フィールドの長さ", - "indexPatternFieldEditor.url.heightLabel": "高さ", - "indexPatternFieldEditor.url.labelTemplateHelpText": "ラベルテンプレートのヘルプ", - "indexPatternFieldEditor.url.labelTemplateLabel": "ラベルテンプレート", - "indexPatternFieldEditor.url.offLabel": "オフ", - "indexPatternFieldEditor.url.onLabel": "オン", - "indexPatternFieldEditor.url.openTabLabel": "新規タブで開く", - "indexPatternFieldEditor.url.template.helpLinkText": "URLテンプレートのヘルプ", - "indexPatternFieldEditor.url.typeLabel": "型", - "indexPatternFieldEditor.url.urlTemplateLabel": "URLテンプレート", - "indexPatternFieldEditor.url.widthLabel": "幅", - "indexPatternManagement.actions.cancelButton": "キャンセル", - "indexPatternManagement.actions.createButton": "フィールドを作成", - "indexPatternManagement.actions.deleteButton": "削除", - "indexPatternManagement.actions.saveButton": "フィールドを保存", - "indexPatternManagement.createHeader": "スクリプトフィールドを作成", - "indexPatternManagement.customLabel": "カスタムラベル", - "indexPatternManagement.defaultFormatDropDown": "- デフォルト -", - "indexPatternManagement.defaultFormatHeader": "フォーマット (デフォルト:{defaultFormat}) ", - "indexPatternManagement.deleteField.cancelButton": "キャンセル", - "indexPatternManagement.deleteField.deleteButton": "削除", - "indexPatternManagement.deleteField.deletedHeader": "「{fieldName}」が削除されました", - "indexPatternManagement.deleteField.savedHeader": "「{fieldName}」が保存されました", - "indexPatternManagement.deleteFieldHeader": "フィールド「{fieldName}」を削除", - "indexPatternManagement.deleteFieldLabel": "削除されたフィールドは復元できません。{separator}続行してよろしいですか?", - "indexPatternManagement.disabledCallOutHeader": "スクリプティングが無効です", - "indexPatternManagement.disabledCallOutLabel": "Elasticsearchでのすべてのインラインスクリプティングが無効になっています。Kibanaでスクリプトフィールドを使用するには、インラインスクリプティングを有効にする必要があります。", - "indexPatternManagement.editHeader": "{fieldName}を編集", - "indexPatternManagement.editIndexPattern.deleteButton": "削除", - "indexPatternManagement.editIndexPattern.deleteHeader": "インデックスパターンを削除しますか?", - "indexPatternManagement.editIndexPattern.deprecation": "スクリプトフィールドは廃止予定です。代わりに{runtimeDocs}を使用してください。", - "indexPatternManagement.editIndexPattern.detailsAria": "インデックスパターンの詳細", - "indexPatternManagement.editIndexPattern.fields.addFieldButtonLabel": "フィールドの追加", - "indexPatternManagement.editIndexPattern.fields.allLangsDropDown": "すべての言語", - "indexPatternManagement.editIndexPattern.fields.allTypesDropDown": "すべてのフィールドタイプ", - "indexPatternManagement.editIndexPattern.fields.filterAria": "フィールドタイプをフィルター", - "indexPatternManagement.editIndexPattern.fields.filterPlaceholder": "検索", - "indexPatternManagement.editIndexPattern.fields.searchAria": "検索フィールド", - "indexPatternManagement.editIndexPattern.fields.table.additionalInfoAriaLabel": "追加フィールド情報", - "indexPatternManagement.editIndexPattern.fields.table.aggregatableDescription": "これらのフィールドはビジュアライゼーションの集約に使用できます", - "indexPatternManagement.editIndexPattern.fields.table.aggregatableLabel": "集約可能", - "indexPatternManagement.editIndexPattern.fields.table.customLabelTooltip": "フィールドのカスタムラベル。", - "indexPatternManagement.editIndexPattern.fields.table.deleteDescription": "削除", - "indexPatternManagement.editIndexPattern.fields.table.deleteLabel": "削除", - "indexPatternManagement.editIndexPattern.fields.table.editDescription": "編集", - "indexPatternManagement.editIndexPattern.fields.table.editLabel": "編集", - "indexPatternManagement.editIndexPattern.fields.table.excludedDescription": "取得の際に_sourceから除外されるフィールドです", - "indexPatternManagement.editIndexPattern.fields.table.excludedLabel": "除外", - "indexPatternManagement.editIndexPattern.fields.table.formatHeader": "フォーマット", - "indexPatternManagement.editIndexPattern.fields.table.isAggregatableAria": "は集約可能です", - "indexPatternManagement.editIndexPattern.fields.table.isExcludedAria": "は除外されています", - "indexPatternManagement.editIndexPattern.fields.table.isSearchableAria": "は検索可能です", - "indexPatternManagement.editIndexPattern.fields.table.multiTypeAria": "複数タイプのフィールド", - "indexPatternManagement.editIndexPattern.fields.table.multiTypeTooltip": "このフィールドのタイプはインデックスごとに変わります。多くの分析機能には使用できません。", - "indexPatternManagement.editIndexPattern.fields.table.nameHeader": "名前", - "indexPatternManagement.editIndexPattern.fields.table.primaryTimeAriaLabel": "プライマリ時間フィールド", - "indexPatternManagement.editIndexPattern.fields.table.primaryTimeTooltip": "このフィールドはイベントの発生時刻を表します。", - "indexPatternManagement.editIndexPattern.fields.table.runtimeIconTipText": "このフィールドはインデックスパターンにのみ存在します。", - "indexPatternManagement.editIndexPattern.fields.table.runtimeIconTipTitle": "ランタイムフィールド", - "indexPatternManagement.editIndexPattern.fields.table.searchableDescription": "これらのフィールドはフィルターバーで使用できます", - "indexPatternManagement.editIndexPattern.fields.table.searchableHeader": "検索可能", - "indexPatternManagement.editIndexPattern.fields.table.typeHeader": "型", - "indexPatternManagement.editIndexPattern.list.defaultIndexPatternListName": "デフォルト", - "indexPatternManagement.editIndexPattern.mappingConflictHeader": "マッピングの矛盾", - "indexPatternManagement.editIndexPattern.removeAria": "インデックスパターンを削除します。", - "indexPatternManagement.editIndexPattern.removeTooltip": "インデックスパターンを削除します。", - "indexPatternManagement.editIndexPattern.scripted.addFieldButton": "スクリプトフィールドを追加", - "indexPatternManagement.editIndexPattern.scripted.deleteField.cancelButton": "キャンセル", - "indexPatternManagement.editIndexPattern.scripted.deleteField.deleteButton": "削除", - "indexPatternManagement.editIndexPattern.scripted.deleteFieldLabel": "スクリプトフィールド「{fieldName}」を削除しますか?", - "indexPatternManagement.editIndexPattern.scripted.deprecationLangHeader": "廃止された言語が使用されています", - "indexPatternManagement.editIndexPattern.scripted.deprecationLangLabel.deprecationLangDetail": "次の廃止された言語が使用されています。{deprecatedLangsInUse}これらの言語は、KibanaとElasticsearchの次のメジャーバージョンでサポートされなくなります。問題を避けるため、スクリプトフィールドを{link}に変換してください。", - "indexPatternManagement.editIndexPattern.scripted.deprecationLangLabel.painlessDescription": "Painless", - "indexPatternManagement.editIndexPattern.scripted.newFieldPlaceholder": "新規スクリプトフィールド", - "indexPatternManagement.editIndexPattern.scripted.noFieldLabel": "「{indexPatternTitle}」インデックスパターンには「{fieldName}」というスクリプトフィールドがありません", - "indexPatternManagement.editIndexPattern.scripted.table.deleteDescription": "このフィールドを削除します", - "indexPatternManagement.editIndexPattern.scripted.table.deleteHeader": "削除", - "indexPatternManagement.editIndexPattern.scripted.table.editDescription": "このフィールドを編集します", - "indexPatternManagement.editIndexPattern.scripted.table.editHeader": "編集", - "indexPatternManagement.editIndexPattern.scripted.table.formatDescription": "フィールドに使用されているフォーマットです", - "indexPatternManagement.editIndexPattern.scripted.table.formatHeader": "フォーマット", - "indexPatternManagement.editIndexPattern.scripted.table.langDescription": "フィールドに使用されている言語です", - "indexPatternManagement.editIndexPattern.scripted.table.langHeader": "言語", - "indexPatternManagement.editIndexPattern.scripted.table.nameDescription": "フィールドの名前です", - "indexPatternManagement.editIndexPattern.scripted.table.nameHeader": "名前", - "indexPatternManagement.editIndexPattern.scripted.table.scriptDescription": "フィールドのスクリプトです", - "indexPatternManagement.editIndexPattern.scripted.table.scriptHeader": "スクリプト", - "indexPatternManagement.editIndexPattern.scriptedLabel": "スクリプトフィールドはビジュアライゼーションで使用され、ドキュメントに表示できます。ただし、検索することはできません。", - "indexPatternManagement.editIndexPattern.setDefaultAria": "デフォルトのインデックスに設定します。", - "indexPatternManagement.editIndexPattern.setDefaultTooltip": "デフォルトのインデックスに設定します。", - "indexPatternManagement.editIndexPattern.source.addButtonLabel": "追加", - "indexPatternManagement.editIndexPattern.source.deleteFilter.cancelButtonLabel": "キャンセル", - "indexPatternManagement.editIndexPattern.source.deleteFilter.deleteButtonLabel": "削除", - "indexPatternManagement.editIndexPattern.source.deleteSourceFilterLabel": "フィールドフィルター「{value}」を削除しますか?", - "indexPatternManagement.editIndexPattern.source.noteLabel": "下の表で、マルチフィールドが一致として誤って表示されます。これらのフィルターは、オリジナルのソースドキュメントのフィールドのみに適用されるため、一致するマルチフィールドはフィルタリングされません。", - "indexPatternManagement.editIndexPattern.source.table.cancelAria": "キャンセル", - "indexPatternManagement.editIndexPattern.source.table.deleteAria": "削除", - "indexPatternManagement.editIndexPattern.source.table.editAria": "編集", - "indexPatternManagement.editIndexPattern.source.table.filterDescription": "フィルター名", - "indexPatternManagement.editIndexPattern.source.table.filterHeader": "フィルター", - "indexPatternManagement.editIndexPattern.source.table.matchesDescription": "フィールドに使用されている言語です", - "indexPatternManagement.editIndexPattern.source.table.matchesHeader": "一致", - "indexPatternManagement.editIndexPattern.source.table.notMatchedLabel": "ソースフィルターが既知のフィールドと一致しません。", - "indexPatternManagement.editIndexPattern.source.table.saveAria": "保存", - "indexPatternManagement.editIndexPattern.sourceLabel": "フィールドフィルターは、ドキュメントの取得時に 1 つまたは複数のフィールドを除外するのに使用される場合もあります。これは Discover アプリでのドキュメントの表示中、またはダッシュボードアプリの保存された検索の結果を表示する表で起こります。ドキュメントに大きなフィールドや重要ではないフィールドが含まれている場合、この程度の低いレベルでフィルターにより除外すると良いかもしれません。", - "indexPatternManagement.editIndexPattern.sourcePlaceholder": "フィールドフィルター、ワイルドカード使用可 (例:「user*」と入力して「user」で始まるフィールドをフィルタリング) ", - "indexPatternManagement.editIndexPattern.tabs.fieldsHeader": "フィールド", - "indexPatternManagement.editIndexPattern.tabs.scriptedHeader": "スクリプトフィールド", - "indexPatternManagement.editIndexPattern.tabs.sourceHeader": "フィールドフィルター", - "indexPatternManagement.editIndexPattern.timeFilterHeader": "時刻フィールド:「{timeFieldName}」", - "indexPatternManagement.editIndexPattern.timeFilterLabel.mappingAPILink": "フィールドマッピング", - "indexPatternManagement.editIndexPattern.timeFilterLabel.timeFilterDetail": "{indexPatternTitle}でフィールドを表示して編集します。型や検索可否などのフィールド属性はElasticsearchで{mappingAPILink}に基づきます。", - "indexPatternManagement.fieldTypeConflict": "フィールドタイプの矛盾", - "indexPatternManagement.formatHeader": "フォーマット", - "indexPatternManagement.formatLabel": "フォーマットは、特定の値の表示形式を管理できます。また、値を完全に変更したり、Discover でのハイライト機能を無効にしたりすることも可能です。", - "indexPatternManagement.header.runtimeLink": "ランタイムフィールド", - "indexPatternManagement.indexNameLabel": "インデックス名", - "indexPatternManagement.indexPattern.sectionsHeader": "インデックスパターン", - "indexPatternManagement.indexPatterns.badge.readOnly.text": "読み取り専用", - "indexPatternManagement.indexPatterns.badge.readOnly.tooltip": "インデックスパターンを保存できません", - "indexPatternManagement.indexPatterns.createBreadcrumb": "インデックスパターンを作成", - "indexPatternManagement.indexPatterns.createFieldBreadcrumb": "フィールドを作成", - "indexPatternManagement.indexPatterns.listBreadcrumb": "インデックスパターン", - "indexPatternManagement.indexPatternTable.createBtn": "インデックスパターンを作成", - "indexPatternManagement.indexPatternTable.indexPatternExplanation": "Elasticsearchからのデータの取得に役立つインデックスパターンを作成して管理します。", - "indexPatternManagement.indexPatternTable.title": "インデックスパターン", - "indexPatternManagement.labelHelpText": "このフィールドが Discover、Maps、Visualize に表示されるときに使用するカスタムラベルを設定します。現在、クエリとフィルターはカスタムラベルをサポートせず、元のフィールド名が使用されます。", - "indexPatternManagement.languageLabel": "言語", - "indexPatternManagement.mappingConflictLabel.mappingConflictDetail": "{mappingConflict} {fieldName}というフィールドはすでに存在します。スクリプトフィールドに同じ名前を付けると、同時に両方のフィールドにクエリが実行できなくなります。", - "indexPatternManagement.mappingConflictLabel.mappingConflictLabel": "マッピングの矛盾:", - "indexPatternManagement.multiTypeLabelDesc": "このフィールドのタイプはインデックスごとに変わります。多くの分析機能には使用できません。タイプごとのインデックスは次のとおりです。", - "indexPatternManagement.nameErrorMessage": "名前が必要です", - "indexPatternManagement.nameLabel": "名前", - "indexPatternManagement.namePlaceholder": "新規スクリプトフィールド", - "indexPatternManagement.popularityLabel": "利用頻度", - "indexPatternManagement.script.accessWithLabel": "{code} でフィールドにアクセスします。", - "indexPatternManagement.script.getHelpLabel": "構文のヒントを得たり、スクリプトの結果をプレビューしたりできます。", - "indexPatternManagement.scriptedFieldsDeprecatedBody": "柔軟性とPainlessスクリプトサポートを強化するには、{runtimeDocs}を使用してください。", - "indexPatternManagement.scriptedFieldsDeprecatedTitle": "スクリプトフィールドは廃止予定です。", - "indexPatternManagement.scriptingLanguages.errorFetchingToastDescription": "Elasticsearchから利用可能なスクリプト言語の取得中にエラーが発生しました", - "indexPatternManagement.scriptInvalidErrorMessage": "スクリプトが無効です。詳細については、スクリプトプレビューを表示してください", - "indexPatternManagement.scriptLabel": "スクリプト", - "indexPatternManagement.scriptRequiredErrorMessage": "スクリプトが必要です", - "indexPatternManagement.syntax.default.formatLabel": "doc['some_field'].value", - "indexPatternManagement.syntax.defaultLabel.defaultDetail": "デフォルトで、KibanaのスクリプトフィールドはElasticsearchでの使用を目的に特別に開発されたシンプルでセキュアなスクリプト言語の{painless}を使用します。ドキュメントの値にアクセスするには次のフォーマットを使用します。", - "indexPatternManagement.syntax.defaultLabel.painlessLink": "Painless", - "indexPatternManagement.syntax.kibanaLabel": "現在、Kibanaでは、作成するPainlessスクリプトに特別な制限が1つ設定されています。Named関数を含めることができません。", - "indexPatternManagement.syntax.lucene.commonLabel.commonDetail": "Kibanaの旧バージョンからのアップグレードですか?おなじみの{lucene}は引き続きご利用いただけます。Lucene式はJavaScriptと非常に似ていますが、基本的な計算、ビット処理、比較オペレーション用に開発されたものです。", - "indexPatternManagement.syntax.lucene.commonLabel.luceneLink": "Lucene表現", - "indexPatternManagement.syntax.lucene.limits.fieldsLabel": "格納されたフィールドは利用できません", - "indexPatternManagement.syntax.lucene.limits.sparseLabel": "フィールドがまばらな (ドキュメントの一部にしか値がない) 場合、値がないドキュメントには 0 の値が入力されます", - "indexPatternManagement.syntax.lucene.limits.typesLabel": "数字、ブール、日付、geo_pointフィールドのみアクセスできます", - "indexPatternManagement.syntax.lucene.limitsLabel": "Lucene表現には次のいくつかの制限があります。", - "indexPatternManagement.syntax.lucene.operations.arithmeticLabel": "算術演算子:{operators}", - "indexPatternManagement.syntax.lucene.operations.bitwiseLabel": "ビット処理演算子:{operators}", - "indexPatternManagement.syntax.lucene.operations.booleanLabel": "ブール演算子 (三項演算子を含む) :{operators}", - "indexPatternManagement.syntax.lucene.operations.comparisonLabel": "比較演算子:{operators}", - "indexPatternManagement.syntax.lucene.operations.distanceLabel": "距離関数:{operators}", - "indexPatternManagement.syntax.lucene.operations.mathLabel": "一般的な関数:{operators}", - "indexPatternManagement.syntax.lucene.operations.miscellaneousLabel": "その他関数:{operators}", - "indexPatternManagement.syntax.lucene.operations.trigLabel": "三角ライブラリ関数:{operators}", - "indexPatternManagement.syntax.lucene.operationsLabel": "Lucene表現で利用可能なオペレーションは次のとおりです。", - "indexPatternManagement.syntax.painlessLabel.javaAPIsLink": "ネイティブJava API", - "indexPatternManagement.syntax.painlessLabel.painlessDetail": "Painlessは非常に強力かつ使いやすい言語です。多くの{javaAPIs}にアクセスすることができます。{syntax}について読めば、すぐに習得することができます!", - "indexPatternManagement.syntax.painlessLabel.syntaxLink": "構文", - "indexPatternManagement.syntaxHeader": "構文", - "indexPatternManagement.testScript.errorMessage": "スクリプト内にエラーがあります", - "indexPatternManagement.testScript.fieldsLabel": "追加フィールド", - "indexPatternManagement.testScript.fieldsPlaceholder": "選択してください...", - "indexPatternManagement.testScript.instructions": "スクリプトを実行すると、最初の検索結果10件をプレビューできます。追加フィールドを選択して結果に含み、コンテキストをさらに加えたり、特定の文書上でフィルターにクエリを追加したりすることもできます。", - "indexPatternManagement.testScript.resultsLabel": "最初の10件", - "indexPatternManagement.testScript.resultsTitle": "結果を表示", - "indexPatternManagement.testScript.submitButtonLabel": "スクリプトを実行", - "indexPatternManagement.typeLabel": "型", - "indexPatternManagement.warningCallOutLabel.callOutDetail": "この機能を使う前に、{scripFields}と{scriptsInAggregation}についてよく理解するようにしてください。計算値の表示と集約にスクリプトフィールドが使用できます。そのため非常に遅い場合があり、適切に行わないとKibanaが使用できなくなる可能性もあります。", - "indexPatternManagement.warningCallOutLabel.runtimeLink": "ランタイムフィールド", - "indexPatternManagement.warningCallOutLabel.scripFieldsLink": "スクリプトフィールド", - "indexPatternManagement.warningCallOutLabel.scriptsInAggregationLink": "集約におけるスクリプト", - "indexPatternManagement.warningHeader": "廃止警告:", - "indexPatternManagement.warningLabel.painlessLinkLabel": "Painless", - "indexPatternManagement.warningLabel.warningDetail": "{language}は廃止され、KibanaとElasticsearchの次のメジャーバージョンではサポートされなくなります。新規スクリプトフィールドには{painlessLink}を使うことをお勧めします。", - "inputControl.control.noIndexPatternTooltip": "index-pattern id が見つかりませんでした:{indexPatternId}.", - "inputControl.control.notInitializedTooltip": "コントロールが初期化されていません", - "inputControl.control.noValuesDisableTooltip": "「{indexPatternName}」インデックスパターンでいずれのドキュメントにも存在しない「{fieldName}」フィールドがフィルターの対象になっています。異なるフィールドを選択するか、このフィールドに値が入力されているドキュメントをインデックスしてください。", - "inputControl.editor.controlEditor.controlLabel": "コントロールラベル", - "inputControl.editor.controlEditor.moveControlDownAriaLabel": "コントロールを下に移動", - "inputControl.editor.controlEditor.moveControlUpAriaLabel": "コントロールを上に移動", - "inputControl.editor.controlEditor.removeControlAriaLabel": "コントロールを削除", - "inputControl.editor.controlsTab.addButtonLabel": "追加", - "inputControl.editor.controlsTab.select.addControlAriaLabel": "コントロールを追加", - "inputControl.editor.controlsTab.select.controlTypeAriaLabel": "コントロールタイプを選択してください", - "inputControl.editor.controlsTab.select.listDropDownOptionLabel": "オプションリスト", - "inputControl.editor.controlsTab.select.rangeDropDownOptionLabel": "範囲スライダー", - "inputControl.editor.fieldSelect.fieldLabel": "フィールド", - "inputControl.editor.fieldSelect.selectFieldPlaceholder": "フィールドを選択してください...", - "inputControl.editor.indexPatternSelect.patternLabel": "インデックスパターン", - "inputControl.editor.indexPatternSelect.patternPlaceholder": "インデックスパターンを選択してください...", - "inputControl.editor.listControl.dynamicOptions.stringFieldDescription": "「文字列」フィールドでのみ利用可能", - "inputControl.editor.listControl.dynamicOptions.updateDescription": "ユーザーインプットに対する更新オプション", - "inputControl.editor.listControl.dynamicOptionsLabel": "ダイナミックオプション", - "inputControl.editor.listControl.multiselectDescription": "複数選択を許可", - "inputControl.editor.listControl.multiselectLabel": "複数選択", - "inputControl.editor.listControl.parentDescription": "オプションは親コントロールの値がベースになっています。親が設定されていない場合は無効です。", - "inputControl.editor.listControl.parentLabel": "親コントロール", - "inputControl.editor.listControl.sizeDescription": "オプション数", - "inputControl.editor.listControl.sizeLabel": "サイズ", - "inputControl.editor.optionsTab.pinFiltersLabel": "すべてのアプリケーションのフィルターをピン付け", - "inputControl.editor.optionsTab.updateFilterLabel": "変更するごとに Kibana フィルターを更新", - "inputControl.editor.optionsTab.useTimeFilterLabel": "時間フィルターを使用", - "inputControl.editor.rangeControl.decimalPlacesLabel": "小数部分の桁数", - "inputControl.editor.rangeControl.stepSizeLabel": "ステップサイズ", - "inputControl.function.help": "インプットコントロールビジュアライゼーション", - "inputControl.listControl.disableTooltip": "「{label}」が設定されるまで無効です。", - "inputControl.listControl.unableToFetchTooltip": "用語を取得できません、エラー:{errorMessage}", - "inputControl.rangeControl.unableToFetchTooltip": "範囲 (最低値と最高値) を取得できません、エラー: {errorMessage}", - "inputControl.register.controlsDescription": "ドロップダウンメニューと範囲スライダーをダッシュボードに追加します。", - "inputControl.register.controlsTitle": "コントロール", - "inputControl.register.tabs.controlsTitle": "コントロール", - "inputControl.register.tabs.optionsTitle": "オプション", - "inputControl.vis.inputControlVis.applyChangesButtonLabel": "変更を適用", - "inputControl.vis.inputControlVis.cancelChangesButtonLabel": "変更をキャンセル", - "inputControl.vis.inputControlVis.clearFormButtonLabel": "用語を消去", - "inputControl.vis.listControl.partialResultsWarningMessage": "リクエストに長くかかり過ぎているため、用語リストが不完全な可能性があります。完全な結果を得るには、kibana.yml の自動完了設定を調整してください。", - "inputControl.vis.listControl.selectPlaceholder": "選択してください...", - "inputControl.vis.listControl.selectTextPlaceholder": "選択してください...", - "inspector.closeButton": "インスペクターを閉じる", - "inspector.reqTimestampDescription": "リクエストの開始が記録された時刻です", - "inspector.reqTimestampKey": "リクエストのタイムスタンプ", - "inspector.requests.copyToClipboardLabel": "クリップボードにコピー", - "inspector.requests.descriptionRowIconAriaLabel": "説明", - "inspector.requests.failedLabel": " (失敗) ", - "inspector.requests.noRequestsLoggedDescription.elementHasNotLoggedAnyRequestsText": "エレメントが (まだ) リクエストを記録していません。", - "inspector.requests.noRequestsLoggedDescription.whatDoesItUsuallyMeanText": "これは通常、データを取得する必要がないか、エレメントがまだデータの取得を開始していないことを意味します。", - "inspector.requests.noRequestsLoggedTitle": "リクエストが記録されていません", - "inspector.requests.requestFailedTooltipTitle": "リクエストに失敗しました", - "inspector.requests.requestInProgressAriaLabel": "リクエストが進行中", - "inspector.requests.requestLabel": "リクエスト:", - "inspector.requests.requestsDescriptionTooltip": "データを収集したリクエストを表示します", - "inspector.requests.requestsTitle": "リクエスト", - "inspector.requests.requestSucceededTooltipTitle": "リクエスト成功", - "inspector.requests.requestTabLabel": "リクエスト", - "inspector.requests.requestTimeLabel": "{requestTime}ms", - "inspector.requests.requestTooltipDescription": "リクエストの合計所要時間です。", - "inspector.requests.requestWasMadeDescription.requestHadFailureText": "、{failedCount} 件に失敗がありました", - "inspector.requests.responseTabLabel": "応答", - "inspector.requests.searchSessionId": "セッション ID を検索:{searchSessionId}", - "inspector.requests.statisticsTabLabel": "統計", - "inspector.title": "インスペクター", - "inspector.view": "{viewName} を表示", - "kibana_legacy.notify.fatalError.errorStatusMessage": "エラー {errStatus} {errStatusText}: {errMessage}", - "kibana_legacy.notify.fatalError.unavailableServerErrorMessage": "HTTP リクエストで接続に失敗しました。Kibana サーバーが実行されていて、ご使用のブラウザの接続が正常に動作していることを確認するか、システム管理者にお問い合わせください。", - "kibana_legacy.notify.toaster.errorMessage": "エラー:{errorMessage}\n {errorStack}", - "kibana_legacy.notify.toaster.errorStatusMessage": "エラー {errStatus} {errStatusText}: {errMessage}", - "kibana_legacy.notify.toaster.unavailableServerErrorMessage": "HTTP リクエストで接続に失敗しました。Kibana サーバーが実行されていて、ご使用のブラウザの接続が正常に動作していることを確認するか、システム管理者にお問い合わせください。", - "kibana_legacy.paginate.controls.pageSizeLabel": "ページサイズ", - "kibana_legacy.paginate.controls.scrollTopButtonLabel": "最上部に移動", - "kibana_legacy.paginate.size.allDropDownOptionLabel": "すべて", - "kibana_utils.history.savedObjectIsMissingNotificationMessage": "保存されたオブジェクトがありません", - "kibana_utils.stateManagement.stateHash.unableToRestoreUrlErrorMessage": "URL を完全に復元できません。共有機能を使用していることを確認してください。", - "kibana_utils.stateManagement.stateHash.unableToStoreHistoryInSessionErrorMessage": "セッションがいっぱいで安全に削除できるアイテムが見つからないため、Kibana は履歴アイテムを保存できません。\n\nこれは大抵新規タブに移動することで解決されますが、より大きな問題が原因である可能性もあります。このメッセージが定期的に表示される場合は、{gitHubIssuesUrl} で問題を報告してください。", - "kibana_utils.stateManagement.url.restoreUrlErrorTitle": "URLからの状態の復元エラー", - "kibana_utils.stateManagement.url.saveStateInUrlErrorTitle": "URLでの状態の保存エラー", - "kibana-react.dualRangeControl.maxInputAriaLabel": "範囲最大", - "kibana-react.dualRangeControl.minInputAriaLabel": "範囲最小", - "kibana-react.dualRangeControl.mustSetBothErrorMessage": "下と上の値の両方を設定する必要があります", - "kibana-react.dualRangeControl.outsideOfRangeErrorMessage": "値は {min} と {max} の間でなければなりません", - "kibana-react.dualRangeControl.upperValidErrorMessage": "上の値は下の値以上でなければなりません", - "kibana-react.exitFullScreenButton.exitFullScreenModeButtonAriaLabel": "全画面モードを終了", - "kibana-react.exitFullScreenButton.exitFullScreenModeButtonText": "全画面を終了", - "kibana-react.exitFullScreenButton.fullScreenModeDescription": "ESC キーで全画面モードを終了します。", - "kibana-react.kbnOverviewPageHeader.addDataButtonLabel": "データの追加", - "kibana-react.kbnOverviewPageHeader.devToolsButtonLabel": "開発ツール", - "kibana-react.kbnOverviewPageHeader.stackManagementButtonLabel": "管理", - "kibana-react.mountPointPortal.errorMessage": "ポータルコンテンツのレンダリングエラー", - "kibana-react.pageFooter.changeDefaultRouteSuccessToast": "ランディングページが更新されました", - "kibana-react.pageFooter.changeHomeRouteLink": "ログイン時に別のページを表示", - "kibana-react.pageFooter.makeDefaultRouteLink": "これをランディングページにする", - "kibana-react.splitPanel.adjustPanelSizeAriaLabel": "左右のキーを押してパネルサイズを調整します", - "kibana-react.tableListView.listing.createNewItemButtonLabel": "Create {entityName}", - "kibana-react.tableListView.listing.deleteButtonMessage": "{itemCount} 件の {entityName} を削除", - "kibana-react.tableListView.listing.deleteConfirmModalDescription": "削除された {entityNamePlural} は復元できません。", - "kibana-react.tableListView.listing.deleteSelectedConfirmModal.title": "{itemCount} 件の {entityName} を削除", - "kibana-react.tableListView.listing.deleteSelectedItemsConfirmModal.cancelButtonLabel": "キャンセル", - "kibana-react.tableListView.listing.deleteSelectedItemsConfirmModal.confirmButtonLabel": "削除", - "kibana-react.tableListView.listing.deleteSelectedItemsConfirmModal.confirmButtonLabelDeleting": "削除中", - "kibana-react.tableListView.listing.fetchErrorDescription": "{entityName}リストを取得できませんでした。{message}", - "kibana-react.tableListView.listing.fetchErrorTitle": "リストを取得できませんでした", - "kibana-react.tableListView.listing.listingLimitExceeded.advancedSettingsLinkText": "高度な設定", - "kibana-react.tableListView.listing.listingLimitExceededDescription": "{totalItems} 件の {entityNamePlural} がありますが、{listingLimitText} の設定により {listingLimitValue} 件までしか下の表に表示できません。{advancedSettingsLink} の下でこの設定を変更できます。", - "kibana-react.tableListView.listing.listingLimitExceededTitle": "リスティング制限超過", - "kibana-react.tableListView.listing.noAvailableItemsMessage": "利用可能な {entityNamePlural} がありません。", - "kibana-react.tableListView.listing.noMatchedItemsMessage": "検索条件に一致する {entityNamePlural} がありません。", - "kibana-react.tableListView.listing.table.actionTitle": "アクション", - "kibana-react.tableListView.listing.table.editActionDescription": "編集", - "kibana-react.tableListView.listing.table.editActionName": "編集", - "kibana-react.tableListView.listing.unableToDeleteDangerMessage": "{entityName} を削除できません", - "kibanaOverview.addData.sampleDataButtonLabel": "サンプルデータを試す", - "kibanaOverview.addData.sectionTitle": "データを取り込む", - "kibanaOverview.apps.title": "これらのアプリを検索", - "kibanaOverview.header.title": "Kibana", - "kibanaOverview.kibana.solution.title": "Kibana", - "kibanaOverview.manageData.sectionTitle": "データを管理", - "kibanaOverview.more.title": "Elasticではさまざまなことが可能です", - "kibanaOverview.news.title": "新機能", - "lists.exceptions.doesNotExistOperatorLabel": "存在しない", - "lists.exceptions.existsOperatorLabel": "存在する", - "lists.exceptions.isInListOperatorLabel": "リストにある", - "lists.exceptions.isNotInListOperatorLabel": "リストにない", - "lists.exceptions.isNotOneOfOperatorLabel": "is not one of", - "lists.exceptions.isNotOperatorLabel": "is not", - "lists.exceptions.isOneOfOperatorLabel": "is one of", - "lists.exceptions.isOperatorLabel": "is", - "management.breadcrumb": "スタック管理", - "management.landing.header": "Stack Management {version}へようこそ", - "management.landing.subhead": "インデックス、インデックスパターン、保存されたオブジェクト、Kibanaの設定、その他を管理します。", - "management.landing.text": "アプリの一覧は左側のメニューにあります。", - "management.nav.label": "管理", - "management.sections.dataTip": "クラスターデータとバックアップを管理します", - "management.sections.dataTitle": "データ", - "management.sections.ingestTip": "データを変換し、クラスターに読み込む方法を管理します", - "management.sections.ingestTitle": "投入", - "management.sections.insightsAndAlertingTip": "データの変化を検出する方法を管理します", - "management.sections.insightsAndAlertingTitle": "アラートとインサイト", - "management.sections.kibanaTip": "Kibanaをカスタマイズし、保存されたオブジェクトを管理します", - "management.sections.kibanaTitle": "Kibana", - "management.sections.section.tip": "機能とデータへのアクセスを制御します", - "management.sections.section.title": "セキュリティ", - "management.sections.stackTip": "ライセンスを管理し、スタックをアップグレードします", - "management.sections.stackTitle": "スタック", - "management.stackManagement.managementDescription": "Elastic Stack の管理を行うセンターコンソールです。", - "management.stackManagement.managementLabel": "スタック管理", - "management.stackManagement.title": "スタック管理", - "monaco.painlessLanguage.autocomplete.docKeywordDescription": "doc['field_name'] 構文を使用して、スクリプトからフィールド値にアクセスします", - "monaco.painlessLanguage.autocomplete.emitKeywordDescription": "戻らずに値を発行します。", - "monaco.painlessLanguage.autocomplete.fieldValueDescription": "フィールド「{fieldName}」の値を取得します", - "monaco.painlessLanguage.autocomplete.paramsKeywordDescription": "スクリプトに渡された変数にアクセスします。", - "newsfeed.emptyPrompt.noNewsText": "Kibana インスタンスがインターネットにアクセスできない場合、管理者にこの機能を無効にするように依頼してください。そうでない場合は、ニュースを取り込み続けます。", - "newsfeed.emptyPrompt.noNewsTitle": "ニュースがない場合", - "newsfeed.flyoutList.closeButtonLabel": "閉じる", - "newsfeed.flyoutList.versionTextLabel": "{version}", - "newsfeed.flyoutList.whatsNewTitle": "Elastic の新機能", - "newsfeed.headerButton.readAriaLabel": "ニュースフィードメニュー - すべての項目が既読です", - "newsfeed.headerButton.unreadAriaLabel": "ニュースフィードメニュー - 未読の項目があります", - "newsfeed.loadingPrompt.gettingNewsText": "最新ニュースを取得しています...", - "presentationUtil.dashboardPicker.searchDashboardPlaceholder": "ダッシュボードを検索...", - "presentationUtil.labs.components.browserSwitchHelp": "このブラウザーでラボを有効にします。ブラウザーを閉じた後も永続します。", - "presentationUtil.labs.components.browserSwitchName": "ブラウザー", - "presentationUtil.labs.components.calloutHelp": "変更を適用するには更新します", - "presentationUtil.labs.components.closeButtonLabel": "閉じる", - "presentationUtil.labs.components.descriptionMessage": "開発中の機能や実験的な機能を試します。", - "presentationUtil.labs.components.disabledStatusMessage": "デフォルト: {status}", - "presentationUtil.labs.components.enabledStatusMessage": "デフォルト: {status}", - "presentationUtil.labs.components.kibanaSwitchHelp": "すべてのKibanaユーザーでこのラボを有効にします。", - "presentationUtil.labs.components.kibanaSwitchName": "Kibana", - "presentationUtil.labs.components.labFlagsLabel": "ラボフラグ", - "presentationUtil.labs.components.noProjectsinSolutionMessage": "現在{solutionName}にはラボがありません。", - "presentationUtil.labs.components.noProjectsMessage": "現在ラボはありません。", - "presentationUtil.labs.components.overrideFlagsLabel": "上書き", - "presentationUtil.labs.components.overridenIconTipLabel": "デフォルトの上書き", - "presentationUtil.labs.components.resetToDefaultLabel": "デフォルトにリセット", - "presentationUtil.labs.components.sessionSwitchHelp": "このブラウザーセッションのラボを有効にします。ブラウザーを閉じるとリセットされます。", - "presentationUtil.labs.components.sessionSwitchName": "セッション", - "presentationUtil.labs.components.titleLabel": "ラボ", - "presentationUtil.labs.enableDeferBelowFoldProjectDescription": "「区切り」の下のすべてのパネル (ウィンドウ下部の下にある非表示の領域) はすぐに読み込まれません。ビューポートを入力するときにのみ読み込まれます", - "presentationUtil.labs.enableDeferBelowFoldProjectName": "「区切り」の下のパネルの読み込みを延期", - "presentationUtil.saveModalDashboard.addToDashboardLabel": "ダッシュボードに追加", - "presentationUtil.saveModalDashboard.dashboardInfoTooltip": "Visualizeライブラリに追加された項目はすべてのダッシュボードで使用できます。ライブラリ項目の編集は、使用されるすべての場所に表示されます。", - "presentationUtil.saveModalDashboard.existingDashboardOptionLabel": "既存", - "presentationUtil.saveModalDashboard.libraryOptionLabel": "ライブラリに追加", - "presentationUtil.saveModalDashboard.newDashboardOptionLabel": "新規", - "presentationUtil.saveModalDashboard.noDashboardOptionLabel": "なし", - "presentationUtil.saveModalDashboard.saveAndGoToDashboardLabel": "保存してダッシュボードを開く", - "presentationUtil.saveModalDashboard.saveLabel": "保存", - "presentationUtil.saveModalDashboard.saveToLibraryLabel": "保存してライブラリに追加", - "presentationUtil.solutionToolbar.editorMenuButtonLabel": "すべてのエディター", - "presentationUtil.solutionToolbar.libraryButtonLabel": "ライブラリから追加", - "presentationUtil.solutionToolbar.quickButton.ariaButtonLabel": "新しい{createType}を作成", - "presentationUtil.solutionToolbar.quickButton.legendLabel": "クイック作成", - "savedObjects.advancedSettings.listingLimitText": "一覧ページ用に取得するオブジェクトの数です", - "savedObjects.advancedSettings.listingLimitTitle": "オブジェクト取得制限", - "savedObjects.advancedSettings.perPageText": "読み込みダイアログで表示されるページごとのオブジェクトの数です", - "savedObjects.advancedSettings.perPageTitle": "ページごとのオブジェクト数", - "savedObjects.confirmModal.cancelButtonLabel": "キャンセル", - "savedObjects.confirmModal.overwriteButtonLabel": "上書き", - "savedObjects.confirmModal.overwriteConfirmationMessage": "{title} を上書きしてよろしいですか?", - "savedObjects.confirmModal.overwriteTitle": "{name} を上書きしますか?", - "savedObjects.confirmModal.saveDuplicateButtonLabel": "{name} を保存", - "savedObjects.confirmModal.saveDuplicateConfirmationMessage": "「{title}」というタイトルの {name} がすでに存在します。保存しますか?", - "savedObjects.finder.filterButtonLabel": "タイプ", - "savedObjects.finder.searchPlaceholder": "検索…", - "savedObjects.finder.sortAsc": "昇順", - "savedObjects.finder.sortAuto": "ベストマッチ", - "savedObjects.finder.sortButtonLabel": "並べ替え", - "savedObjects.finder.sortDesc": "降順", - "savedObjects.overwriteRejectedDescription": "上書き確認が拒否されました", - "savedObjects.saveDuplicateRejectedDescription": "重複ファイルの保存確認が拒否されました", - "savedObjects.saveModal.cancelButtonLabel": "キャンセル", - "savedObjects.saveModal.descriptionLabel": "説明", - "savedObjects.saveModal.duplicateTitleDescription": "「{title}」を保存すると、タイトルが重複します。", - "savedObjects.saveModal.duplicateTitleLabel": "この{objectType}はすでに存在します", - "savedObjects.saveModal.saveAsNewLabel": "新しい {objectType} として保存", - "savedObjects.saveModal.saveButtonLabel": "保存", - "savedObjects.saveModal.saveTitle": "{objectType} を保存", - "savedObjects.saveModal.titleLabel": "タイトル", - "savedObjects.saveModalOrigin.addToOriginLabel": "追加", - "savedObjects.saveModalOrigin.originAfterSavingSwitchLabel": "保存後に{originVerb}から{origin}", - "savedObjects.saveModalOrigin.returnToOriginLabel": "戻る", - "savedObjects.saveModalOrigin.saveAndReturnLabel": "保存して戻る", - "savedObjectsManagement.breadcrumb.edit": "{savedObjectType}を編集", - "savedObjectsManagement.breadcrumb.index": "保存されたオブジェクト", - "savedObjectsManagement.deleteConfirm.modalDeleteButtonLabel": "削除", - "savedObjectsManagement.deleteConfirm.modalDescription": "このアクションはオブジェクトをKibanaから永久に削除します。", - "savedObjectsManagement.deleteConfirm.modalTitle": "「{title}」を削除しますか?", - "savedObjectsManagement.deleteSavedObjectsConfirmModalDescription": "この操作は次の保存されたオブジェクトを削除します:", - "savedObjectsManagement.field.offLabel": "オフ", - "savedObjectsManagement.field.onLabel": "オン", - "savedObjectsManagement.importSummary.createdCountHeader": "{createdCount}件の新規項目", - "savedObjectsManagement.importSummary.createdOutcomeLabel": "作成済み", - "savedObjectsManagement.importSummary.errorCountHeader": "{errorCount}件のエラー", - "savedObjectsManagement.importSummary.errorOutcomeLabel": "{errorMessage}", - "savedObjectsManagement.importSummary.overwrittenCountHeader": "{overwrittenCount}件上書きされました", - "savedObjectsManagement.importSummary.overwrittenOutcomeLabel": "上書き", - "savedObjectsManagement.importSummary.warnings.defaultButtonLabel": "Go", - "savedObjectsManagement.indexPattern.confirmOverwriteButton": "上書き", - "savedObjectsManagement.indexPattern.confirmOverwriteLabel": "「{title}」に上書きしてよろしいですか?", - "savedObjectsManagement.indexPattern.confirmOverwriteTitle": "{type}を上書きしますか?", - "savedObjectsManagement.managementSectionLabel": "保存されたオブジェクト", - "savedObjectsManagement.objects.savedObjectsDescription": "保存された検索、ビジュアライゼーション、ダッシュボードのインポート、エクスポート、管理を行います。", - "savedObjectsManagement.objects.savedObjectsTitle": "保存されたオブジェクト", - "savedObjectsManagement.objectsTable.deleteConfirmModal.cannotDeleteCallout.content": "一部の選択したオブジェクトは削除できません。テーブル概要の一覧には表示されません", - "savedObjectsManagement.objectsTable.deleteConfirmModal.cannotDeleteCallout.title": "一部のオブジェクトを削除できません", - "savedObjectsManagement.objectsTable.deleteConfirmModal.sharedObjectsCallout.content": "共有オブジェクトは属しているすべてのスペースから削除されます。", - "savedObjectsManagement.objectsTable.deleteSavedObjectsConfirmModal.cancelButtonLabel": "キャンセル", - "savedObjectsManagement.objectsTable.deleteSavedObjectsConfirmModal.idColumnName": "Id", - "savedObjectsManagement.objectsTable.deleteSavedObjectsConfirmModal.titleColumnName": "タイトル", - "savedObjectsManagement.objectsTable.deleteSavedObjectsConfirmModal.typeColumnName": "型", - "savedObjectsManagement.objectsTable.deleteSavedObjectsConfirmModalTitle": "保存されたオブジェクトの削除", - "savedObjectsManagement.objectsTable.export.dangerNotification": "エクスポートを生成できません", - "savedObjectsManagement.objectsTable.export.successNotification": "ファイルはバックグラウンドでダウンロード中です", - "savedObjectsManagement.objectsTable.export.successWithExcludedObjectsNotification": "ファイルはバックグラウンドでダウンロード中です。一部のオブジェクトはエクスポートから除外されました。除外されたオブジェクトの一覧は、エクスポートされたファイルの最後の行をご覧ください。", - "savedObjectsManagement.objectsTable.export.successWithMissingRefsNotification": "ファイルはバックグラウンドでダウンロード中です。一部の関連オブジェクトが見つかりませんでした。足りないオブジェクトの一覧は、エクスポートされたファイルの最後の行をご覧ください。", - "savedObjectsManagement.objectsTable.exportObjectsConfirmModal.cancelButtonLabel": "キャンセル", - "savedObjectsManagement.objectsTable.exportObjectsConfirmModal.exportAllButtonLabel": "すべてエクスポート", - "savedObjectsManagement.objectsTable.exportObjectsConfirmModal.exportOptionsLabel": "オプション", - "savedObjectsManagement.objectsTable.exportObjectsConfirmModal.includeReferencesDeepLabel": "関連オブジェクトを含める", - "savedObjectsManagement.objectsTable.exportObjectsConfirmModalDescription": "エクスポートするタイプを選択してください", - "savedObjectsManagement.objectsTable.flyout.confirmLegacyImport.resolvingConflictsLoadingMessage": "矛盾を解決中…", - "savedObjectsManagement.objectsTable.flyout.confirmLegacyImport.retryingFailedObjectsLoadingMessage": "失敗したオブジェクトを再試行中…", - "savedObjectsManagement.objectsTable.flyout.confirmLegacyImport.savedSearchAreLinkedProperlyLoadingMessage": "保存された検索が正しくリンクされていることを確認してください…", - "savedObjectsManagement.objectsTable.flyout.confirmLegacyImport.savingConflictsLoadingMessage": "矛盾を保存中…", - "savedObjectsManagement.objectsTable.flyout.errorCalloutTitle": "申し訳ございません、エラーが発生しました", - "savedObjectsManagement.objectsTable.flyout.import.cancelButtonLabel": "キャンセル", - "savedObjectsManagement.objectsTable.flyout.import.confirmButtonLabel": "インポート", - "savedObjectsManagement.objectsTable.flyout.importFailedDescription": "{totalImportCount}個中{failedImportCount}個のオブジェクトのインポートに失敗しました。インポート失敗", - "savedObjectsManagement.objectsTable.flyout.importFailedMissingReference": "{type} [id={id}]は{refType} [id={refId}]を見つけられませんでした", - "savedObjectsManagement.objectsTable.flyout.importFailedTitle": "インポート失敗", - "savedObjectsManagement.objectsTable.flyout.importFailedUnsupportedType": "{type} [id={id}]サポートされていないタイプ", - "savedObjectsManagement.objectsTable.flyout.importFileErrorMessage": "エラーのためファイルを処理できませんでした:「{error}」", - "savedObjectsManagement.objectsTable.flyout.importLegacyFileErrorMessage": "ファイルを処理できませんでした。", - "savedObjectsManagement.objectsTable.flyout.importPromptText": "インポート", - "savedObjectsManagement.objectsTable.flyout.importSavedObjectTitle": "保存されたオブジェクトのインポート", - "savedObjectsManagement.objectsTable.flyout.importSuccessful.confirmAllChangesButtonLabel": "すべての変更を確定", - "savedObjectsManagement.objectsTable.flyout.importSuccessful.confirmButtonLabel": "完了", - "savedObjectsManagement.objectsTable.flyout.importSuccessfulCallout.noObjectsImportedTitle": "オブジェクトがインポートされませんでした", - "savedObjectsManagement.objectsTable.flyout.importSuccessfulDescription": "{importCount}個のオブジェクトがインポートされました。", - "savedObjectsManagement.objectsTable.flyout.importSuccessfulTitle": "インポート成功", - "savedObjectsManagement.objectsTable.flyout.indexPatternConflictsCalloutLinkText": "新規インデックスパターンを作成", - "savedObjectsManagement.objectsTable.flyout.indexPatternConflictsDescription": "次の保存されたオブジェクトは、存在しないインデックスパターンを使用しています。関連付け直す別のインデックスパターンを選択してください。必要に応じて、{indexPatternLink}できます。", - "savedObjectsManagement.objectsTable.flyout.indexPatternConflictsTitle": "インデックスパターンの矛盾", - "savedObjectsManagement.objectsTable.flyout.invalidFormatOfImportedFileErrorMessage": "保存されたオブジェクトのファイル形式が無効なため、インポートできません。", - "savedObjectsManagement.objectsTable.flyout.legacyFileUsedBody": "最新のレポートでNDJSONファイルを作成すれば完了です。", - "savedObjectsManagement.objectsTable.flyout.legacyFileUsedTitle": "JSONファイルのサポートが終了します", - "savedObjectsManagement.objectsTable.flyout.renderConflicts.columnCountDescription": "影響されるオブジェクトの数です", - "savedObjectsManagement.objectsTable.flyout.renderConflicts.columnCountName": "カウント", - "savedObjectsManagement.objectsTable.flyout.renderConflicts.columnIdDescription": "インデックスパターンのIDです", - "savedObjectsManagement.objectsTable.flyout.renderConflicts.columnIdName": "ID", - "savedObjectsManagement.objectsTable.flyout.renderConflicts.columnNewIndexPatternName": "新規インデックスパターン", - "savedObjectsManagement.objectsTable.flyout.renderConflicts.columnSampleOfAffectedObjectsDescription": "影響されるオブジェクトのサンプル", - "savedObjectsManagement.objectsTable.flyout.renderConflicts.columnSampleOfAffectedObjectsName": "影響されるオブジェクトのサンプル", - "savedObjectsManagement.objectsTable.flyout.selectFileToImportFormRowLabel": "インポートするファイルを選択してください", - "savedObjectsManagement.objectsTable.header.importButtonLabel": "インポート", - "savedObjectsManagement.objectsTable.header.refreshButtonLabel": "更新", - "savedObjectsManagement.objectsTable.header.savedObjectsTitle": "保存されたオブジェクト", - "savedObjectsManagement.objectsTable.howToDeleteSavedObjectsDescription": "保存されたオブジェクトを管理して共有します。オブジェクトの基本データを編集するには、関連付けられたアプリケーションに移動します。", - "savedObjectsManagement.objectsTable.importModeControl.createNewCopies.disabledText": "オブジェクトが以前にコピーまたはインポートされたかどうかを確認します。", - "savedObjectsManagement.objectsTable.importModeControl.createNewCopies.disabledTitle": "既存のオブジェクトを確認", - "savedObjectsManagement.objectsTable.importModeControl.createNewCopies.enabledText": "このオプションを使用すると、オブジェクトの1つ以上のコピーを作成します。", - "savedObjectsManagement.objectsTable.importModeControl.createNewCopies.enabledTitle": "ランダムIDで新しいオブジェクトを作成", - "savedObjectsManagement.objectsTable.importModeControl.importOptionsTitle": "インポートオプション", - "savedObjectsManagement.objectsTable.importModeControl.overwrite.disabledLabel": "競合時にアクションを要求", - "savedObjectsManagement.objectsTable.importModeControl.overwrite.enabledLabel": "自動的に競合を上書き", - "savedObjectsManagement.objectsTable.importSummary.unsupportedTypeError": "サポートされていないオブジェクトタイプ", - "savedObjectsManagement.objectsTable.overwriteModal.body.ambiguousConflict": "「{title}」は複数の既存のオブジェクトと競合します。上書きしますか?", - "savedObjectsManagement.objectsTable.overwriteModal.body.conflict": "「{title}」は既存のオブジェクトと競合します。上書きしますか?", - "savedObjectsManagement.objectsTable.overwriteModal.cancelButtonText": "スキップ", - "savedObjectsManagement.objectsTable.overwriteModal.overwriteButtonText": "上書き", - "savedObjectsManagement.objectsTable.overwriteModal.selectControlLabel": "オブジェクトID", - "savedObjectsManagement.objectsTable.overwriteModal.title": "{type}を上書きしますか?", - "savedObjectsManagement.objectsTable.relationships.columnActions.inspectActionDescription": "この保存されたオブジェクトを確認してください", - "savedObjectsManagement.objectsTable.relationships.columnActions.inspectActionName": "検査", - "savedObjectsManagement.objectsTable.relationships.columnActionsName": "アクション", - "savedObjectsManagement.objectsTable.relationships.columnErrorDescription": "関係でエラーが発生しました", - "savedObjectsManagement.objectsTable.relationships.columnErrorName": "エラー", - "savedObjectsManagement.objectsTable.relationships.columnIdDescription": "保存されたオブジェクトのID", - "savedObjectsManagement.objectsTable.relationships.columnIdName": "Id", - "savedObjectsManagement.objectsTable.relationships.columnRelationship.childAsValue": "子", - "savedObjectsManagement.objectsTable.relationships.columnRelationship.parentAsValue": "親", - "savedObjectsManagement.objectsTable.relationships.columnRelationshipName": "直接関係", - "savedObjectsManagement.objectsTable.relationships.columnTitleDescription": "保存されたオブジェクトのタイトルです", - "savedObjectsManagement.objectsTable.relationships.columnTitleName": "タイトル", - "savedObjectsManagement.objectsTable.relationships.columnTypeDescription": "保存されたオブジェクトのタイプです", - "savedObjectsManagement.objectsTable.relationships.columnTypeName": "型", - "savedObjectsManagement.objectsTable.relationships.invalidRelationShip": "この保存されたオブジェクトには無効な関係がいくつかあります。", - "savedObjectsManagement.objectsTable.relationships.relationshipsTitle": "{title}に関連する保存済みオブジェクトはこちらです。この{type}を削除すると、親オブジェクトに影響しますが、子オブジェクトには影響しません。", - "savedObjectsManagement.objectsTable.relationships.renderErrorMessage": "エラー", - "savedObjectsManagement.objectsTable.relationships.search.filters.relationship.childAsValue.view": "子", - "savedObjectsManagement.objectsTable.relationships.search.filters.relationship.name": "直接関係", - "savedObjectsManagement.objectsTable.relationships.search.filters.relationship.parentAsValue.view": "親", - "savedObjectsManagement.objectsTable.relationships.search.filters.type.name": "型", - "savedObjectsManagement.objectsTable.searchBar.unableToParseQueryErrorMessage": "クエリをパースできません", - "savedObjectsManagement.objectsTable.table.columnActions.inspectActionDescription": "この保存されたオブジェクトを確認してください", - "savedObjectsManagement.objectsTable.table.columnActions.inspectActionName": "検査", - "savedObjectsManagement.objectsTable.table.columnActions.viewRelationshipsActionDescription": "この保存されたオブジェクトと他の保存されたオブジェクトとの関係性を表示します", - "savedObjectsManagement.objectsTable.table.columnActions.viewRelationshipsActionName": "関係", - "savedObjectsManagement.objectsTable.table.columnActionsName": "アクション", - "savedObjectsManagement.objectsTable.table.columnTitleDescription": "保存されたオブジェクトのタイトルです", - "savedObjectsManagement.objectsTable.table.columnTitleName": "タイトル", - "savedObjectsManagement.objectsTable.table.columnTypeDescription": "保存されたオブジェクトのタイプです", - "savedObjectsManagement.objectsTable.table.columnTypeName": "型", - "savedObjectsManagement.objectsTable.table.deleteButtonLabel": "削除", - "savedObjectsManagement.objectsTable.table.deleteButtonTitle": "保存されたオブジェクトを削除できません", - "savedObjectsManagement.objectsTable.table.exportButtonLabel": "エクスポート", - "savedObjectsManagement.objectsTable.table.exportPopoverButtonLabel": "エクスポート", - "savedObjectsManagement.objectsTable.table.typeFilterName": "型", - "savedObjectsManagement.objectsTable.unableFindSavedObjectNotificationMessage": "保存されたオブジェクトが見つかりません", - "savedObjectsManagement.objectsTable.unableFindSavedObjectsNotificationMessage": "保存されたオブジェクトが見つかりません", - "savedObjectsManagement.objectView.unableFindSavedObjectNotificationMessage": "保存されたオブジェクトが見つかりません", - "savedObjectsManagement.parsingFieldErrorMessage": "{fieldName}をインデックスパターン{indexName}用にパース中にエラーが発生しました:{errorMessage}", - "savedObjectsManagement.view.cancelButtonAriaLabel": "キャンセル", - "savedObjectsManagement.view.cancelButtonLabel": "キャンセル", - "savedObjectsManagement.view.deleteItemButtonLabel": "{title}を削除", - "savedObjectsManagement.view.editItemTitle": "{title}の編集", - "savedObjectsManagement.view.fieldDoesNotExistErrorMessage": "このオブジェクトに関連付けられたフィールドは、現在このインデックスパターンに存在しません。", - "savedObjectsManagement.view.howToFixErrorDescription": "このエラーの原因がわかる場合は修正してください。わからない場合は上の削除ボタンをクリックしてください。", - "savedObjectsManagement.view.howToModifyObjectDescription": "オブジェクトの編集は上級ユーザー向けです。オブジェクトのプロパティが検証されておらず、無効なオブジェクトはエラー、データ損失、またはそれ以上の問題の原因となります。コードを熟知した人に指示されていない限り、この設定は変更しない方が無難です。", - "savedObjectsManagement.view.howToModifyObjectTitle": "十分ご注意ください!", - "savedObjectsManagement.view.indexPatternDoesNotExistErrorMessage": "このオブジェクトに関連付けられたインデックスパターンは現在存在しません。", - "savedObjectsManagement.view.saveButtonAriaLabel": "{ title }オブジェクトを保存", - "savedObjectsManagement.view.saveButtonLabel": "{ title }オブジェクトを保存", - "savedObjectsManagement.view.savedObjectProblemErrorMessage": "この保存されたオブジェクトに問題があります", - "savedObjectsManagement.view.savedSearchDoesNotExistErrorMessage": "このオブジェクトに関連付けられた保存された検索は現在存在しません。", - "savedObjectsManagement.view.viewItemButtonLabel": "{title}を表示", - "savedObjectsManagement.view.viewItemTitle": "{title}を表示", - "security.checkup.dismissButtonText": "閉じる", - "security.checkup.dontShowAgain": "今後表示しない", - "security.checkup.insecureClusterMessage": "1 ビットを失わないでください。Elastic では無料でデータを保護できます。", - "security.checkup.insecureClusterTitle": "データが保護されていません", - "security.checkup.learnMoreButtonText": "詳細", - "share.advancedSettings.csv.quoteValuesText": "csvエクスポートに値を引用するかどうかです", - "share.advancedSettings.csv.quoteValuesTitle": "CSVの値を引用", - "share.advancedSettings.csv.separatorText": "エクスポートされた値をこの文字列で区切ります", - "share.advancedSettings.csv.separatorTitle": "CSVセパレーター", - "share.contextMenu.embedCodeLabel": "埋め込みコード", - "share.contextMenu.embedCodePanelTitle": "埋め込みコード", - "share.contextMenu.permalinkPanelTitle": "パーマリンク", - "share.contextMenu.permalinksLabel": "パーマリンク", - "share.contextMenuTitle": "この {objectType} を共有", - "share.urlGenerators.error.createUrlFnProvided": "このジェネレーターは非推奨とマークされています。createUrl fn を付けないでください。", - "share.urlGenerators.error.migrateCalledNotDeprecated": "非推奨以外のジェネレーターで migrate を呼び出すことはできません。", - "share.urlGenerators.error.migrationFnGivenNotDeprecated": "移行機能を提供する場合、このジェネレーターに非推奨マークを付ける必要があります", - "share.urlGenerators.error.noCreateUrlFnProvided": "このジェネレーターには非推奨のマークがありません。createUrl fn を付けてください。", - "share.urlGenerators.error.noMigrationFnProvided": "アクセスリンクジェネレーターに非推奨マークが付いている場合、移行機能を提供する必要があります。", - "share.urlGenerators.errors.noGeneratorWithId": "{id} という ID のジェネレーターはありません", - "share.urlPanel.canNotShareAsSavedObjectHelpText": "{objectType} が保存されるまで保存されたオブジェクトを共有することはできません。", - "share.urlPanel.copyIframeCodeButtonLabel": "iFrame コードをコピー", - "share.urlPanel.copyLinkButtonLabel": "リンクをコピー", - "share.urlPanel.generateLinkAsLabel": "名前を付けてリンクを生成", - "share.urlPanel.publicUrlHelpText": "公開URLを使用して、他のユーザーと共有します。ログインプロンプトをなくして、ワンステップの匿名アクセスを可能にします。", - "share.urlPanel.publicUrlLabel": "公開URL", - "share.urlPanel.savedObjectDescription": "この URL を共有することで、他のユーザーがこの {objectType} の最も最近保存されたバージョンを読み込めるようになります。", - "share.urlPanel.savedObjectLabel": "保存されたオブジェクト", - "share.urlPanel.shortUrlHelpText": "互換性が最も高くなるよう、短いスナップショット URL を共有することをお勧めします。Internet Explorer は URL の長さに制限があり、一部の wiki やマークアップパーサーは長い完全なスナップショット URL に対応していませんが、短い URL は正常に動作するはずです。", - "share.urlPanel.shortUrlLabel": "短い URL", - "share.urlPanel.snapshotDescription": "スナップショット URL には、{objectType} の現在の状態がエンコードされています。保存された {objectType} への編集内容はこの URL には反映されません。", - "share.urlPanel.snapshotLabel": "スナップショット", - "share.urlPanel.unableCreateShortUrlErrorMessage": "短い URL を作成できません。エラー:{errorMessage}", - "share.urlPanel.urlGroupTitle": "URL", - "telemetry.callout.appliesSettingTitle": "この設定に加えた変更は {allOfKibanaText} に適用され、自動的に保存されます。", - "telemetry.callout.appliesSettingTitle.allOfKibanaText": "Kibana のすべて", - "telemetry.callout.clusterStatisticsDescription": "これは収集される基本的なクラスター統計の例です。インデックス、シャード、ノードの数が含まれます。監視がオンになっているかどうかなどのハイレベルの使用統計も含まれます。", - "telemetry.callout.clusterStatisticsTitle": "クラスター統計", - "telemetry.callout.errorLoadingClusterStatisticsDescription": "クラスター統計の取得中に予期せぬエラーが発生しました。Elasticsearch、Kibana、またはネットワークのエラーが原因の可能性があります。Kibana を確認し、ページを再読み込みして再試行してください。", - "telemetry.callout.errorLoadingClusterStatisticsTitle": "クラスター統計の読み込みエラー", - "telemetry.callout.errorUnprivilegedUserDescription": "暗号化されていないクラスター統計を表示するアクセス権がありません。", - "telemetry.callout.errorUnprivilegedUserTitle": "クラスター統計の表示エラー", - "telemetry.clusterData": "クラスターデータ", - "telemetry.optInErrorToastText": "使用状況統計設定の設定中にエラーが発生しました。", - "telemetry.optInErrorToastTitle": "エラー", - "telemetry.optInNoticeSeenErrorTitle": "エラー", - "telemetry.optInNoticeSeenErrorToastText": "通知の消去中にエラーが発生しました", - "telemetry.optInSuccessOff": "使用状況データ収集がオフです。", - "telemetry.optInSuccessOn": "使用状況データ収集がオンです。", - "telemetry.provideUsageStatisticsAriaName": "使用統計を提供", - "telemetry.provideUsageStatisticsTitle": "使用統計を提供", - "telemetry.readOurUsageDataPrivacyStatementLinkText": "プライバシーポリシー", - "telemetry.securityData": "Endpoint Security データ", - "telemetry.seeExampleOfClusterData": "収集する {clusterData} の例をご覧ください。", - "telemetry.seeExampleOfClusterDataAndEndpointSecuity": "当社が収集する{clusterData}および{endpointSecurityData}の例をご覧ください。", - "telemetry.telemetryBannerDescription": "Elastic Stackの改善にご協力ください使用状況データの収集は現在無効です。使用状況データの収集を有効にすると、製品とサービスを管理して改善することができます。詳細については、{privacyStatementLink}をご覧ください。", - "telemetry.telemetryConfigAndLinkDescription": "使用状況データの収集を有効にすると、製品とサービスを管理して改善することができます。詳細については、{privacyStatementLink}をご覧ください。", - "telemetry.telemetryConfigDescription": "基本的な機能の利用状況に関する統計情報を提供して、Elastic Stack の改善にご協力ください。このデータは Elastic 社外と共有されません。", - "telemetry.telemetryOptedInDisableUsage": "ここで使用状況データを無効にする", - "telemetry.telemetryOptedInDismissMessage": "閉じる", - "telemetry.telemetryOptedInNoticeDescription": "使用状況データがどのように製品とサービスの管理と改善につながるのかに関する詳細については、{privacyStatementLink}をご覧ください。収集を停止するには、{disableLink}。", - "telemetry.telemetryOptedInNoticeTitle": "Elastic Stack の改善にご協力ください", - "telemetry.telemetryOptedInPrivacyStatement": "プライバシーポリシー", - "telemetry.usageDataTitle": "使用データ", - "telemetry.welcomeBanner.disableButtonLabel": "無効にする", - "telemetry.welcomeBanner.enableButtonLabel": "有効にする", - "telemetry.welcomeBanner.telemetryConfigDetailsDescription.telemetryPrivacyStatementLinkText": "プライバシーポリシー", - "telemetry.welcomeBanner.title": "Elastic Stack の改善にご協力ください", - "timelion.badge.readOnly.text": "読み取り専用", - "timelion.badge.readOnly.tooltip": "Timelion シートを保存できません", - "timelion.breadcrumbs.create": "作成", - "timelion.breadcrumbs.root": "Timelion", - "timelion.cells.actions.fullscreenAriaLabel": "全画面チャート", - "timelion.cells.actions.fullscreenTooltip": "全画面", - "timelion.cells.actions.removeAriaLabel": "リモートスタート", - "timelion.cells.actions.removeTooltip": "削除", - "timelion.cells.actions.reorderAriaLabel": "ドラッグして並べ替え", - "timelion.cells.actions.reorderTooltip": "ドラッグして並べ替え", - "timelion.chart.seriesList.noSchemaWarning": "次のパネルタイプは存在しません:{renderType}", - "timelion.deprecation.here": "ダッシュボードに移行します。", - "timelion.deprecation.message": "Timelionアプリは7.0以降で非推奨となっています。7.16では削除される予定です。Timelionワークシートを引き続き使用するには、{timeLionDeprecationLink}。", - "timelion.emptyExpressionErrorMessage": "Timelion エラー:式が入力されていません", - "timelion.expressionInputAriaLabel": "Timelion 式", - "timelion.expressionInputPlaceholder": "{esQuery} でのクエリを試してみてください。", - "timelion.expressionSuggestions.arg.infoTitle": "情報", - "timelion.expressionSuggestions.arg.listTitle": "引数:", - "timelion.expressionSuggestions.arg.nameTitle": "引数名", - "timelion.expressionSuggestions.arg.typesTitle": "対応タイプ", - "timelion.expressionSuggestions.argument.description.acceptsText": "受け入れ", - "timelion.expressionSuggestions.func.description.chainableHelpText": "連鎖可能", - "timelion.expressionSuggestions.func.description.chainableText": "{help} (連鎖可能) ", - "timelion.expressionSuggestions.func.description.dataSourceHelpText": "データソース", - "timelion.expressionSuggestions.func.description.dataSourceText": "{help} (データソース) ", - "timelion.fitFunctions.carry.downSampleErrorMessage": "ダウンサンプルには「carry」フィットメソドを使用せず、「scale」または「average」を使用してください", - "timelion.fullscreen.exitAriaLabel": "全画面を終了", - "timelion.fullscreen.exitTooltip": "全画面を終了", - "timelion.function.help": "Timelion のビジュアライゼーションです。", - "timelion.help.configuration.firstTimeConfigurationLinkText": "初回構成", - "timelion.help.configuration.notValid.advancedSettingsPathText": "管理 / Kibana / 高度な設定", - "timelion.help.configuration.notValid.notValidSettingsErrorMessage": "Elasticsearch の設定を確認できませんでした:{reason}。高度な設定を確認して再試行してください。 ({count}) ", - "timelion.help.configuration.notValid.paragraph1": "Logstash を使用している場合、Timelion でのログデータの探索開始に何も構成する必要はありません。他のインデックスを検索するには、{advancedSettingsPath} に移動し、{esDefaultIndex} および {esTimefield} 設定を構成し、インデックスと一致させます。", - "timelion.help.configuration.notValid.paragraph2": "他の Timelion 設定もあります。今のところ他の設定は気にしなくて大丈夫です。後程、必要に応じていつでも設定できることがわかります。", - "timelion.help.configuration.notValid.validateButtonLabel": "構成を検証", - "timelion.help.configuration.notValidTitle": "初回構成", - "timelion.help.configuration.valid.advancedSettingsPathText": "管理/Kibana/高度な設定", - "timelion.help.configuration.valid.intervalIsAutoText": "準備完了です!", - "timelion.help.configuration.valid.intervals.content.intervalIsNotAutoText": "Timelion が適切な間隔を選択できるよう、{auto} に設定します。", - "timelion.help.configuration.valid.intervalsTextPart1": "インプットバーの右にある間隔設定は、サンプリングの頻度をコントロールできます。現在 {interval} に設定されています。", - "timelion.help.configuration.valid.intervalsTextPart2": "Timelion が選択された時間範囲と間隔の組み合わせによりデータポイントが多くなりすぎると判断した場合、エラーが発生します。制限を調整するには、{advancedSettingsPath} で {maxBuckets} を構成します。", - "timelion.help.configuration.valid.intervalsTitle": "間隔", - "timelion.help.configuration.valid.paragraph1Part1": "デフォルトのインデックスと時間フィールドを検証し、すべて問題なさそうです。{statsMin} から {statsMax} へのデータが見つかりました。おそらく準備完了です。何か問題がある場合は、", - "timelion.help.configuration.valid.paragraph1Part2": "で Elasticsearch データソースの構成に関する詳細をご覧ください。", - "timelion.help.configuration.valid.paragraph2": "すでにチャートが 1 つ表示されていますが、興味深いデータを得るにはいくつか調整が必要な可能性があります。", - "timelion.help.configuration.valid.paragraph3": "これで、一定期間のデータポイントの数を示す折れ線グラフが表示されるはずです。", - "timelion.help.configuration.valid.timeRangeText": "時間フィルターを使用して、可視化するデータを含む期間を選択します。上記のすべてまたは一部の時間範囲を含む時間範囲を選択するようにしてください。", - "timelion.help.configuration.valid.timeRangeTitle": "時間範囲", - "timelion.help.configuration.validTitle": "良いお知らせです。Elasticsearch が正しく構成されました!", - "timelion.help.dataTransforming.functionReferenceLinkText": "機能リファレンス", - "timelion.help.dataTransforming.paragraph1": "基本を覚えたところで、Timelion の実力を発揮させましょう。データのサブセットが、一定期間における全体の何パーセントを表しているか見てみましょう。たとえば、Web トラフィックの何パーセントが米国からのものでしょう?", - "timelion.help.dataTransforming.paragraph2": "まず初めに、米国を含むすべてのイベントを見つけます:{esUsQuery}。", - "timelion.help.dataTransforming.paragraph3": "次に、全体に対する米国のイベントの比率を割り出します。{us} をすべてで割るために、{divide} 関数 {divideDataQuery} を使用できます。", - "timelion.help.dataTransforming.paragraph4": "まぁまぁですが、これでは 0 から 1 までの値になってしまいます。パーセンテージに変換するには、100 を掛けます:{multiplyDataQuery}。", - "timelion.help.dataTransforming.paragraph5": "これでトラフィックの何パーセントが米国からのものなのか分かり、一定期間内にどのように変化したのか見ることができます!Timelion には、{sum}、{subtract}、{multiply}、{divide} などのいくつもの演算機能が搭載されています。これらの多くが数列や数字を扱えます。また、{movingaverage}、{abs}、{derivative} といった他の便利な変換機能もあります。", - "timelion.help.dataTransforming.paragraph6Part1": "構文を学んだところで、", - "timelion.help.dataTransforming.paragraph6Part2": "Timelion で利用できるすべての機能の使い方をご覧ください。ツールバーの\\{Docs\\}をクリックしていつでもリファレンスを表示できます。このチュートリアルに戻るには、リファレンスの上にある \\{Tutorial\\} リンクをクリックします。", - "timelion.help.dataTransformingTitle": "データの変換:お楽しみの始まりです!", - "timelion.help.dontShowHelpButtonLabel": "今後表示しない", - "timelion.help.expressions.examples.customStylingDescription": "{descriptionTitle}初めの数列を赤くし、2 つ目の数列に 1 ピクセル幅のバーを使用します。", - "timelion.help.expressions.examples.customStylingDescriptionTitle": "カスタムスタイリング。", - "timelion.help.expressions.examples.groupedExpressionsDescription": "{descriptionTitle} 式のグループを関数に連結させることもできます。ここでは両方の数列が線ではなく点で表示されています。", - "timelion.help.expressions.examples.groupedExpressionsDescriptionTitle": "式のグループ化。", - "timelion.help.expressions.examples.namedArgumentsDescription": "{descriptionTitle}引数の指定順序を覚える必要はありません。名前付き引数を使えば、式の読み書きが楽になります。", - "timelion.help.expressions.examples.namedArgumentsDescriptionTitle": "名前付き引数。", - "timelion.help.expressions.examples.twoExpressionsDescription": "{descriptionTitle}同じチャートに 2 つの式が使えます。", - "timelion.help.expressions.examples.twoExpressionsDescriptionTitle": "2 倍の楽しみ。", - "timelion.help.expressions.functionReferenceLinkText": "機能リファレンス", - "timelion.help.expressions.paragraph1": "それぞれの式はデータソース関数で始まります。ここから、新しい関数をデータソースに追加して変換や強化ができます。", - "timelion.help.expressions.paragraph2": "ところで、ここから先はデータの持ち主が一番よくご存知なのではないでしょうか。サンプルクエリをより有意義なものと自由に置き換えてみてください。", - "timelion.help.expressions.paragraph3": "実験をします。ツールバーの{strongAdd}をクリックして、他のチャートをいくつか追加してみましょう。そして、チャートを選択して次の式の内の 1 つをコピーし、インプットバーに貼り付けて、Enter を押します。リセットして繰り返し、他の式を試してみましょう。", - "timelion.help.expressions.paragraph4": "Timelion は、チャートの見た目をカスタマイズするための他のビュー変換機能も搭載しています。完全なリストは次のリソースをご覧ください", - "timelion.help.expressions.strongAddText": "追加", - "timelion.help.expressionsTitle": "式を使って式を定義", - "timelion.help.functions.absHelpText": "数列リストの各値の絶対値を返します", - "timelion.help.functions.aggregate.args.functionHelpText": "{functions} の 1 つ", - "timelion.help.functions.aggregateHelpText": "数列のすべての点の処理結果に基づく線を作成します。利用可能な関数:{functions}", - "timelion.help.functions.bars.args.stackHelpText": "バーがスタックした場合はデフォルトで true にする", - "timelion.help.functions.bars.args.widthHelpText": "バーの幅 (ピクセル) ", - "timelion.help.functions.barsHelpText": "seriesList をバーとして表示", - "timelion.help.functions.color.args.colorHelpText": "16 進数としての数列の色です。例:#c6c6c6 はかわいいライトグレーを示します。複数の色を指定し、複数数列がある場合、グラデーションになります。例:「#00B1CC:#00FF94:#FF3A39:#CC1A6F」", - "timelion.help.functions.colorHelpText": "数列の色を変更します", - "timelion.help.functions.common.args.fitHelpText": "ターゲットの期間と間隔に数列を合わせるためのアルゴリズムです。使用可能:{fitFunctions}", - "timelion.help.functions.common.args.offsetHelpText": "日付表現による数列の取得をオフセットします。例:1 か月前からイベントを作成する -1M は現在のように表示されます。「timerange」によって、チャートの全体的な時間範囲に関連した数列をオフセットします。例:「timerange:-2」は過去に対する全体的なチャート時間範囲の 2 倍をオフセットします。", - "timelion.help.functions.condition.args.elseHelpText": "比較が false の場合に点が設定される値です。ここで seriesList を引き渡した場合、初めの数列が使用されます。", - "timelion.help.functions.condition.args.ifHelpText": "点が比較される値です。ここで seriesList を引き渡した場合、初めの数列が使用されます。", - "timelion.help.functions.condition.args.operator.suggestions.eqHelpText": "equal", - "timelion.help.functions.condition.args.operator.suggestions.gteHelpText": "超過", - "timelion.help.functions.condition.args.operator.suggestions.gtHelpText": "より大きい", - "timelion.help.functions.condition.args.operator.suggestions.lteHelpText": "未満", - "timelion.help.functions.condition.args.operator.suggestions.ltHelpText": "より小さい", - "timelion.help.functions.condition.args.operator.suggestions.neHelpText": "not equal", - "timelion.help.functions.condition.args.operatorHelpText": "比較に使用する比較演算子、有効な演算子は eq (=) 、ne (≠) , lt (&lt;) , lte (≦) , gt (>) , gte (≧) ", - "timelion.help.functions.condition.args.thenHelpText": "比較が true の場合に点が設定される値です。ここで seriesList を引き渡した場合、初めの数列が使用されます。", - "timelion.help.functions.conditionHelpText": "演算子を使って各点を数字、または別の数列の同じ点と比較し、true の場合値を結果の値に設定し、オプションとして else が使用されます。", - "timelion.help.functions.cusum.args.baseHelpText": "開始の数字です。基本的に、数列の初めにこの数字が追加されます", - "timelion.help.functions.cusumHelpText": "ベースから始め、数列の累積和を返します。", - "timelion.help.functions.derivativeHelpText": "一定期間の値の変化をプロットします。", - "timelion.help.functions.divide.args.divisorHelpText": "割る数字または数列です。複数数列を含む seriesList はラベルに適用されます。", - "timelion.help.functions.divideHelpText": "seriesList の 1 つまたは複数の数列の値をインプット seriesList の各数列のそれぞれの配置に割けます。", - "timelion.help.functions.es.args.indexHelpText": "クエリを実行するインデックスで、ワイルドカードが使えます。「metrics」、「split」、「timefield」引数のスクリプトフィールドのフィールド名のインデックスパターン名とフィールド名の入力候補を提供します。", - "timelion.help.functions.es.args.intervalHelpText": "**これは使用しないでください**。fit 関数のデバッグは楽しいですが、間隔ピッカーを使用すべきです。", - "timelion.help.functions.es.args.kibanaHelpText": "Kibana ダッシュボードでフィルターを適用します。Kibana ダッシュボードの使用時にのみ適用されます。", - "timelion.help.functions.es.args.metricHelpText": "Elasticsearch メトリック集約:avg、sum、min、max、percentiles、または基数、後ろにフィールドを付けます。例:「sum:bytes」、「percentiles:bytes:95,99,99.9」、「count」", - "timelion.help.functions.es.args.qHelpText": "Lucene クエリ文字列の構文のクエリ", - "timelion.help.functions.es.args.splitHelpText": "分割する Elasticsearch フィールドと制限です。例:「{hostnameSplitArg}」は上位 10 のホスト名を取得します", - "timelion.help.functions.es.args.timefieldHelpText": "X 軸にフィールドタイプ「date」を使用", - "timelion.help.functions.esHelpText": "Elasticsearch インスタンスからデータを取得します", - "timelion.help.functions.firstHelpText": "これは単純に input seriesList を返す内部機能です。この機能は使わないでください", - "timelion.help.functions.fit.args.modeHelpText": "数列をターゲットに合わせるためのアルゴリズムです。次のいずれかです。{fitFunctions}", - "timelion.help.functions.fitHelpText": "定義された fit 関数を使用して空値を入力します", - "timelion.help.functions.graphite.args.metricHelpText": "取得する Graphite メトリック、例:{metricExample}", - "timelion.help.functions.graphiteHelpText": "[実験的] Graphite からデータを取得します。Kibana の高度な設定で Graphite サーバーを構成します", - "timelion.help.functions.hide.args.hideHelpText": "数列の表示と非表示を切り替えます", - "timelion.help.functions.hideHelpText": "デフォルトで数列を非表示にします", - "timelion.help.functions.holt.args.alphaHelpText": "\n 0 から 1 の平滑化加重です。\n アルファを上げると新しい数列がオリジナルにさらに近くなります。\n 下げると数列がスムーズになります", - "timelion.help.functions.holt.args.betaHelpText": "\n 0 から 1 の傾向加重です。\n ベータを上げると線の上下の動きが長くなります。\n 下げると新しい傾向をより早く反映するようになります", - "timelion.help.functions.holt.args.gammaHelpText": "0 から 1 のシーズン加重です。データが波のようになっていますか?\n この数字を上げると、最近のシーズンの重要性が高まり、波形の動きを速くします。\n 下げると新しいシーズンの重要性が下がり、過去がより重要視されます。", - "timelion.help.functions.holt.args.sampleHelpText": "\n シーズン数列の「予測」を開始する前にサンプリングするシーズンの数です。\n (gamma でのみ有効、デフォルト:all) ", - "timelion.help.functions.holt.args.seasonHelpText": "シーズンの長さです、例:パターンが毎週繰り返される場合は 1w。 (gamma でのみ有効) ", - "timelion.help.functions.holtHelpText": "\n 数列の始めをサンプリングし、\n いくつかのオプションパラメーターを使用して何が起こるか予測します。基本的に、この機能は未来を予測するのではなく、\n 過去のデータに基づき現在何が起きているべきかを予測します。\n この情報は異常検知に役立ちます。null には予測値が入力されます。", - "timelion.help.functions.label.args.labelHelpText": "数列の凡例値です。文字列で $1、$2 などを使用して、正規表現の捕捉グループに合わせることができます。", - "timelion.help.functions.label.args.regexHelpText": "捕捉グループをサポートする正規表現です", - "timelion.help.functions.labelHelpText": "数列のラベルを変更します。%s で既存のラベルを参照します", - "timelion.help.functions.legend.args.columnsHelpText": "凡例を分ける列の数です", - "timelion.help.functions.legend.args.position.suggestions.falseHelpText": "凡例を無効にします", - "timelion.help.functions.legend.args.position.suggestions.neHelpText": "北東の角に凡例を配置します", - "timelion.help.functions.legend.args.position.suggestions.nwHelpText": "北西の角に凡例を配置します", - "timelion.help.functions.legend.args.position.suggestions.seHelpText": "南東の角に凡例を配置します", - "timelion.help.functions.legend.args.position.suggestions.swHelpText": "南西の角に凡例を配置します", - "timelion.help.functions.legend.args.positionHelpText": "凡例を配置する角:nw、ne、se、または sw。false で凡例を無効にすることもできます", - "timelion.help.functions.legend.args.showTimeHelpText": "グラフにカーソルを合わせた時、凡例の時間値を表示します。デフォルト:true", - "timelion.help.functions.legend.args.timeFormatHelpText": "moment.js フォーマットパターンです。デフォルト:{defaultTimeFormat}", - "timelion.help.functions.legendHelpText": "プロットの凡例の位置とスタイルを設定します", - "timelion.help.functions.lines.args.fillHelpText": "0 と 10 の間の数字です。エリアチャートの作成に使用します。", - "timelion.help.functions.lines.args.showHelpText": "線の表示と非表示を切り替えます", - "timelion.help.functions.lines.args.stackHelpText": "線をスタックします。よく誤解を招きます。この機能を使用する際は塗りつぶしを使うようにしましょう。", - "timelion.help.functions.lines.args.stepsHelpText": "線をステップとして表示します。つまり、点の間に中間値を挿入しません。", - "timelion.help.functions.lines.args.widthHelpText": "線の太さです", - "timelion.help.functions.linesHelpText": "seriesList を線として表示します", - "timelion.help.functions.log.args.baseHelpText": "対数のベースを設定します、デフォルトは 10 です", - "timelion.help.functions.logHelpText": "数列リストの各値の対数値を返します (デフォルトのベース:10) ", - "timelion.help.functions.max.args.valueHelpText": "点を既存の値と引き渡された値のどちらか高い方に設定します。seriesList を引き渡す場合、数列がちょうど 1 つでなければなりません。", - "timelion.help.functions.maxHelpText": "インプット seriesList の各数列のそれぞれの配置の seriesList の 1 つまたは複数の数列の最高値です", - "timelion.help.functions.min.args.valueHelpText": "点を既存の値と引き渡された値のどちらか低い方に設定します。seriesList を引き渡す場合、数列がちょうど 1 つでなければなりません。", - "timelion.help.functions.minHelpText": "インプット seriesList の各数列のそれぞれの配置の seriesList の 1 つまたは複数の数列の最低値です", - "timelion.help.functions.movingaverage.args.positionHelpText": "結果時間に相対的な平均点の位置です。次のいずれかです。{validPositions}", - "timelion.help.functions.movingaverage.args.windowHelpText": "平均を出す点の数、または日付計算式 (例:1d、1M) です。日付計算式が指定された場合、この機能は現在選択された間隔でできるだけ近づけます。日付計算式が間隔で均等に分けられない場合、結果に異常が出る場合があります。", - "timelion.help.functions.movingaverageHelpText": "特定期間の移動平均を計算します。ばらばらの数列を滑らかにするのに有効です。", - "timelion.help.functions.movingstd.args.positionHelpText": "結果時間に相対的な期間スライスの配置です。オプションは {positions} です。デフォルト:{defaultPosition}", - "timelion.help.functions.movingstd.args.windowHelpText": "標準偏差を計算する点の数です。", - "timelion.help.functions.movingstdHelpText": "特定期間の移動標準偏差を計算します。ネイティブ two-pass アルゴリズムを使用します。非常に長い数列や、非常に大きな数字を含む数列では、四捨五入による誤差がより明らかになる可能性があります。", - "timelion.help.functions.multiply.args.multiplierHelpText": "掛ける数字または数列です。複数数列を含む seriesList はラベルに適用されます。", - "timelion.help.functions.multiplyHelpText": "seriesList の 1 つまたは複数の数列の値をインプット seriesList の各数列のそれぞれの配置に掛けます。", - "timelion.help.functions.notAllowedGraphiteUrl": "この Graphite URL は kibana.yml ファイルで構成されていません。\n 「timelion.graphiteUrls」で kibana.yml ファイルの Graphite サーバーリストを構成し、\n Kibana の高度な設定でいずれかを選択してください", - "timelion.help.functions.points.args.fillColorHelpText": "点を塗りつぶす色です。", - "timelion.help.functions.points.args.fillHelpText": "塗りつぶしの透明度を表す 0 から 10 までの数字です", - "timelion.help.functions.points.args.radiusHelpText": "点のサイズです", - "timelion.help.functions.points.args.showHelpText": "点の表示・非表示です", - "timelion.help.functions.points.args.symbolHelpText": "点のシンボルです。次のいずれかです。{validSymbols}", - "timelion.help.functions.points.args.weightHelpText": "点の周りの太さです", - "timelion.help.functions.pointsHelpText": "数列を点として表示します", - "timelion.help.functions.precision.args.precisionHelpText": "各値を切り捨てる桁数です", - "timelion.help.functions.precisionHelpText": "値の小数点以下を切り捨てる桁数です", - "timelion.help.functions.props.args.globalHelpText": "各数列に対し、seriesList にプロップを設定します", - "timelion.help.functions.propsHelpText": "数列に任意のプロパティを設定するため、自己責任で行ってください。例:{example}。", - "timelion.help.functions.quandl.args.codeHelpText": "プロットする Quandl コードです。これらは quandl.com に掲載されています。", - "timelion.help.functions.quandl.args.positionHelpText": "Quandl ソースによっては、複数数列を返すものがあります。どれを使用しますか?1 ベースインデックス", - "timelion.help.functions.quandlHelpText": "\n [実験的]\n Quandl コードで quandl.com からデータを取得します。Kibana で {quandlKeyField} を空き API キーに設定\n 高度な設定API は、キーなしでは非常に低いレート制限があります。", - "timelion.help.functions.range.args.maxHelpText": "新しい最高値です", - "timelion.help.functions.range.args.minHelpText": "新しい最低値です", - "timelion.help.functions.rangeHelpText": "同じシェイプを維持しつつ数列の最高値と最低値を変更します", - "timelion.help.functions.scaleInterval.args.intervalHelpText": "新しい間隔の日付計算表記です。例:1 秒 = 1s。1m、5m、1M、1w、1y など。", - "timelion.help.functions.scaleIntervalHelpText": "変更すると、値 (通常合計またはカウント) が新しい間隔にスケーリングされます。例:毎秒のレート", - "timelion.help.functions.static.args.labelHelpText": "数列のラベルを簡単に設定する方法です。.label () 関数を使用することもできます。", - "timelion.help.functions.static.args.valueHelpText": "表示する単一の値です。複数の値が渡された場合、指定された時間範囲に均等に挿入されます。", - "timelion.help.functions.staticHelpText": "チャートに 1 つの値を挿入します", - "timelion.help.functions.subtract.args.termHelpText": "インプットから引く数字または数列です。複数数列を含む seriesList はラベルに適用されます。", - "timelion.help.functions.subtractHelpText": "seriesList の 1 つまたは複数の数列の値をインプット seriesList の各数列のそれぞれの配置から引きます。", - "timelion.help.functions.sum.args.termHelpText": "インプット数列に足す数字または数列です。複数数列を含む seriesList はラベルに適用されます。", - "timelion.help.functions.sumHelpText": "seriesList の 1 つまたは複数の数列の値をインプット seriesList の各数列のそれぞれの配置に足します。", - "timelion.help.functions.title.args.titleHelpText": "プロットのタイトルです。", - "timelion.help.functions.titleHelpText": "プロットの上部にタイトルを追加します。複数の seriesList がコールされた場合、最後のコールが使用されます。", - "timelion.help.functions.trend.args.endHelpText": "始めまたは終わりからの計算を修了する場所です。たとえば、-10 の場合終わりから 10 点目で計算が終了し、+15 の場合始めから 15 点目で終了します。デフォルト:0", - "timelion.help.functions.trend.args.modeHelpText": "傾向線の生成に使用するアルゴリズムです。次のいずれかです。{validRegressions}", - "timelion.help.functions.trend.args.startHelpText": "始めまたは終わりからの計算を開始する場所です。たとえば、-10 の場合終わりから 10 点目から計算を開始し、+15 の場合始めから 15 点目から開始します。デフォルト:0", - "timelion.help.functions.trendHelpText": "指定された回帰アルゴリズムで傾向線を描きます", - "timelion.help.functions.trim.args.endHelpText": "数列の終わりから切り取るバケットです。デフォルト:1", - "timelion.help.functions.trim.args.startHelpText": "数列の始めから切り取るバケットです。デフォルト:1", - "timelion.help.functions.trimHelpText": "「部分的バケットの問題」に合わせて、数列の始めか終わりの N 個のバケットを無効化するように設定します。", - "timelion.help.functions.worldbank.args.codeHelpText": "Worldbank API パスです。これは通常ドメインの後ろからクエリ文字列までのすべてです。例:{apiPathExample}。", - "timelion.help.functions.worldbankHelpText": "\n [実験的]\n 数列へのパスを使用して {worldbankUrl} からデータを取得します。\n Worldbank は主に年間データを提供し、現在の年のデータがないことがよくあります。\n 最近の期間範囲のデータが取得できない場合は、{offsetQuery} をお試しください。", - "timelion.help.functions.worldbankIndicators.args.countryHelpText": "Worldbank の国 ID です。通常は国の 2 文字のコートです", - "timelion.help.functions.worldbankIndicators.args.indicatorHelpText": "使用するインジケーターコードです。{worldbankUrl} で調べる必要があります。多くが分かりづらいものです。例:{indicatorExample} は人口です", - "timelion.help.functions.worldbankIndicatorsHelpText": "\n [実験的]\n 国名とインジケーターを使って {worldbankUrl} からデータを取得します。Worldbank は\n 主に年間データを提供し、現在の年のデータがないことがよくあります。最近の期間範囲のデータが取得できない場合は、{offsetQuery} をお試しください。\n 時間範囲", - "timelion.help.functions.yaxis.args.colorHelpText": "軸ラベルの色です", - "timelion.help.functions.yaxis.args.labelHelpText": "軸のラベルです", - "timelion.help.functions.yaxis.args.maxHelpText": "最高値", - "timelion.help.functions.yaxis.args.minHelpText": "最低値", - "timelion.help.functions.yaxis.args.positionHelpText": "左から右", - "timelion.help.functions.yaxis.args.tickDecimalsHelpText": "y 軸とティックラベルの小数点以下の桁数です。", - "timelion.help.functions.yaxis.args.unitsHelpText": "Y 軸のラベルのフォーマットに使用する機能です。次のいずれかです。{formatters}", - "timelion.help.functions.yaxis.args.yaxisHelpText": "この数列をプロットする数字の Y 軸です。例:2 本目の Y 軸は .yaxis (2) になります。", - "timelion.help.functions.yaxisHelpText": "さまざまな Y 軸のオプションを構成します。おそらく最も重要なのは、N 本目 (例:2 本目) の Y 軸を追加する機能です。", - "timelion.help.mainPage.functionReference.detailsTable.acceptedTypesColumnLabel": "対応タイプ", - "timelion.help.mainPage.functionReference.detailsTable.argumentNameColumnLabel": "引数名", - "timelion.help.mainPage.functionReference.detailsTable.informationColumnLabel": "情報", - "timelion.help.mainPage.functionReference.gettingStartedText": "関数をクリックすると詳細が表示されます。初心者の方ですか?", - "timelion.help.mainPage.functionReference.noArgumentsFunctionErrorMessage": "この関数には引数を使用できません。簡単でしょう?", - "timelion.help.mainPage.functionReference.welcomePageLinkText": "チュートリアルをご覧ください", - "timelion.help.mainPage.functionReferenceTitle": "機能リファレンス", - "timelion.help.mainPage.keyboardTips.autoComplete.downArrowDescription": "自動入力メニューに焦点を切り替えます。矢印を使用してさらに用語を選択します", - "timelion.help.mainPage.keyboardTips.autoComplete.downArrowLabel": "下矢印", - "timelion.help.mainPage.keyboardTips.autoComplete.enterTabDescription": "現在の選択項目または自動入力メニューで最も使用されている用語を選択します", - "timelion.help.mainPage.keyboardTips.autoComplete.escDescription": "自動入力メニューを閉じます", - "timelion.help.mainPage.keyboardTips.autoCompleteTitle": "自動入力が有効な場合", - "timelion.help.mainPage.keyboardTips.generalEditing.submitRequestText": "リクエストを送信します", - "timelion.help.mainPage.keyboardTips.generalEditingTitle": "一般編集", - "timelion.help.mainPage.keyboardTipsTitle": "キーボードのヒント", - "timelion.help.mainPageTitle": "ヘルプ", - "timelion.help.nextPageButtonLabel": "次へ", - "timelion.help.previousPageButtonLabel": "前へ", - "timelion.help.querying.countMetricAggregationLinkText": "Elasticsearch メトリック集約", - "timelion.help.querying.countTextPart1": "イベントをカウントするのも良いですが、Elasticsearch のデータソースは単独の値を返す", - "timelion.help.querying.countTextPart2": "もサポートしています。最も便利なものには、{min}、{max}、{avg}、{sum}、{cardinality} があります。{srcIp} フィールドのユニークカウントを求めたいとしましょう。{cardinality} メトリック {esCardinalityQuery} を使用します。{bytes} フィールドの平均を取得するには、{avg} metric:メトリック {esAvgQuery} を使用できます。", - "timelion.help.querying.countTitle": "カウントを超えて", - "timelion.help.querying.esAsteriskQueryDescriptionText": "Elasticsearch、デフォルトインデックスのすべてを計算", - "timelion.help.querying.esIndexQueryDescriptionText": "* を logstash-* インデックスの q (クエリ) として使用します", - "timelion.help.querying.luceneQueryLinkText": "Lucene クエリ文字列", - "timelion.help.querying.paragraph1": "Elasticsearch データソースが利用可能であることを確認済みなので、クエリの送信ができます。手始めに、インプットバーに {esPattern} と入力し Enter を押してみましょう。", - "timelion.help.querying.paragraph2Part1": "これは{esAsteriskQueryDescription}となります。サブセットを把握したい場合は、{htmlQuery} で {html} に一致するイベントをカウントしたり、{bobQuery} で {user} フィールドに {bob} を含み、{bytes} フィールドが 100 より大きな値のイベントを検索したりできます。このクエリはシングルクォートで囲まれています。スペースを含むためです。いずれかの", - "timelion.help.querying.paragraph2Part2": "を {esQuery} 関数の初めの引数として入力することができます。", - "timelion.help.querying.passingArgumentsText": "Timelion には一般的な操作を簡単に行えるよう、いくつものショートカットがあります。スペースや特殊文字を含まないシンプルな引数用のものがその一つで、クォートを使う必要はありません。また、多くの関数にデフォルトがあります。たとえば、{esEmptyQuery} と {esStarQuery} で実行される処理は同じです。引数には名前も付いているため、特定の順序で指定する必要はありません。たとえば、{esLogstashQuery} を入力して、Elasticsearch データソース {esIndexQueryDescription} に命令することができます。", - "timelion.help.querying.passingArgumentsTitle": "引数の受け渡し", - "timelion.help.queryingTitle": "Elasticsearch データソースにクエリを実行中", - "timelion.help.unknownErrorMessage": "不明なエラー", - "timelion.help.welcome.content.emphasizedEverythingText": "すべて", - "timelion.help.welcome.content.functionReferenceLinkText": "関数リファレンスに移動", - "timelion.help.welcome.content.paragraph1": "Timelion は時系列に関する {emphasizedEverything} を司る、全知全能のツールです。データストアから提供された時系列データは、Timelion にお任せください。Timelion は複数データソースのデータセットを、覚えやすい式構文で比較、結合、整理できます。このチュートリアルは Elasticsearch が中心となりますが、ここで学んだことは Timelion がサポートするすべてのデータソースに適用できます。", - "timelion.help.welcome.content.paragraph2": "はじめてみる{strongNext} をクリックします。チュートリアルをスキップしてドキュメントを表示しますか?", - "timelion.help.welcome.content.strongNextText": "次へ", - "timelion.help.welcomeTitle": "{strongTimelionLabel} へようこそ!", - "timelion.intervals.customIntervalAriaLabel": "カスタム間隔", - "timelion.intervals.selectIntervalAriaLabel": "間隔を選択", - "timelion.noFunctionErrorMessage": "そのような関数はありません:{name}", - "timelion.panels.noRenderFunctionErrorMessage": "パネルにはレンダリング関数が必要です", - "timelion.panels.timechart.unknownIntervalErrorMessage": "不明な間隔", - "timelion.requestHandlerErrorTitle": "Timelion リクエストエラー", - "timelion.savedObjectFinder.addNewItemButtonLabel": "新規{item}を追加", - "timelion.savedObjectFinder.manageItemsButtonLabel": "{items}の管理", - "timelion.savedObjectFinder.noMatchesFoundDescription": "一致する{items}が見つかりません。", - "timelion.savedObjectFinder.pageItemsFromHitCountDescription": "{hitCount} 件中 {pageFirstItem}-{pageLastItem} 件目", - "timelion.savedObjectFinder.sortByButtonLabeAscendingScreenReaderOnly": "昇順", - "timelion.savedObjectFinder.sortByButtonLabeDescendingScreenReaderOnly": "降順", - "timelion.savedObjectFinder.sortByButtonLabel": "名前", - "timelion.savedObjectFinder.sortByButtonLabelScreenReaderOnly": "並べ替え基準", - "timelion.savedObjects.howToSaveAsNewDescription": "以前のバージョンの Kibana では、{savedObjectName} の名前を変更すると新しい名前でコピーが作成されました。現在のバージョンで同じように保存するには、[新規 {savedObjectName} として保存]チェックボックスを使用します。", - "timelion.savedObjects.saveAsNewLabel": "新規 {savedObjectName} として保存", - "timelion.saveExpression.successNotificationText": "保存された式「{title}」", - "timelion.saveSheet.successNotificationText": "保存されたシート「{title}」", - "timelion.search.submitAriaLabel": "検索", - "timelion.searchErrorTitle": "Timelion リクエストエラー", - "timelion.serverSideErrors.argumentsOverflowErrorMessage": "{functionName} に引き渡された引数が多すぎます", - "timelion.serverSideErrors.bucketsOverflowErrorMessage": "最大バケットを超えました:{bucketCount}/{maxBuckets} が許可されています。より広い間隔または短い期間を選択してください", - "timelion.serverSideErrors.colorFunction.colorNotProvidedErrorMessage": "色が指定されていません", - "timelion.serverSideErrors.conditionFunction.unknownOperatorErrorMessage": "不明な演算子", - "timelion.serverSideErrors.conditionFunction.wrongArgTypeErrorMessage": "数字または seriesList でなければなりません", - "timelion.serverSideErrors.esFunction.indexNotFoundErrorMessage": "Elasticsearch インデックス {index} が見つかりません", - "timelion.serverSideErrors.holtFunction.missingParamsErrorMessage": "シーズンの長さとサンプルサイズ >= 2 を指定する必要があります", - "timelion.serverSideErrors.holtFunction.notEnoughPointsErrorMessage": "二重指数平滑化を使用するには最低 2 つの点が必要です", - "timelion.serverSideErrors.movingaverageFunction.notValidPositionErrorMessage": "有効な配置:{validPositions}", - "timelion.serverSideErrors.movingstdFunction.notValidPositionErrorMessage": "有効な配置:{validPositions}", - "timelion.serverSideErrors.pointsFunction.notValidSymbolErrorMessage": "有効なシンボル:{validSymbols}", - "timelion.serverSideErrors.quandlFunction.unsupportedIntervalErrorMessage": "quandl () でサポートされていない間隔:{interval}. quandl () でサポートされている間隔:{intervals}", - "timelion.serverSideErrors.sheetParseErrorMessage": "予想:文字 {column} で {expectedDescription}", - "timelion.serverSideErrors.unknownArgumentErrorMessage": "{functionName} への不明な引数:{argumentName}", - "timelion.serverSideErrors.unknownArgumentTypeErrorMessage": "引数タイプがサポートされていません:{argument}", - "timelion.serverSideErrors.worldbankFunction.noDataErrorMessage": "Worldbank へのリクエストは成功しましたが、{code} のデータがありませんでした", - "timelion.serverSideErrors.wrongFunctionArgumentTypeErrorMessage": "{functionName} ({argumentName}) は {requiredTypes} の内の 1 つでなければなりません。{actualType} を入手", - "timelion.serverSideErrors.yaxisFunction.notSupportedUnitTypeErrorMessage": "{units} はサポートされているユニットタイプではありません。", - "timelion.serverSideErrors.yaxisFunction.notValidCurrencyFormatErrorMessage": "通貨は 3 文字のコードでなければなりません", - "timelion.timelionDescription": "グラフに時系列データを表示します。", - "timelion.topNavMenu.addChartButtonAriaLabel": "チャートを追加", - "timelion.topNavMenu.addChartButtonLabel": "追加", - "timelion.topNavMenu.delete.modal.confirmButtonLabel": "削除", - "timelion.topNavMenu.delete.modal.successNotificationText": "「{title}」が削除されました", - "timelion.topNavMenu.delete.modal.warningText": "削除されたシートは復元できません。", - "timelion.topNavMenu.delete.modalTitle": "Timelion シート「{title}」を削除しますか?", - "timelion.topNavMenu.deleteSheetButtonAriaLabel": "現在のシートを削除", - "timelion.topNavMenu.deleteSheetButtonLabel": "削除", - "timelion.topNavMenu.helpButtonAriaLabel": "ヘルプ", - "timelion.topNavMenu.helpButtonLabel": "ヘルプ", - "timelion.topNavMenu.newSheetButtonAriaLabel": "新規シート", - "timelion.topNavMenu.newSheetButtonLabel": "新規", - "timelion.topNavMenu.openSheetButtonAriaLabel": "シートを開く", - "timelion.topNavMenu.openSheetButtonLabel": "開く", - "timelion.topNavMenu.openSheetTitle": "シートを開く", - "timelion.topNavMenu.options.columnsCountLabel": "列 (列カウントは 12 できっかりと割れる必要があります) ", - "timelion.topNavMenu.options.rowsCountLabel": "行 (これは現在のウィンドウの縦の長さに基づく目標値です) 。", - "timelion.topNavMenu.optionsButtonAriaLabel": "オプション", - "timelion.topNavMenu.optionsButtonLabel": "オプション", - "timelion.topNavMenu.save.saveAsDashboardPanel.inputPlaceholder": "このパネルに名前を付ける", - "timelion.topNavMenu.save.saveAsDashboardPanel.selectedExpressionLabel": "現在選択されている式", - "timelion.topNavMenu.save.saveAsDashboardPanel.submitButtonLabel": "保存", - "timelion.topNavMenu.save.saveAsDashboardPanelDescription": "Kibana ダッシュボードにチャートの追加が必要ですか?できます!このオプションは、現在選択されている式を、他のオブジェクトの追加と同じように Kibana ダッシュボードに追加可能なパネルとして保存します。他のパネルへのリファレンスが使用されている場合、リファレンスの表現を直接保存する表現にコピーして、リファレンスを削除する必要があります。他の表現式を保存するよう選択するには、チャートをクリックします。", - "timelion.topNavMenu.save.saveAsDashboardPanelLabel": "式に名前を付けて保存", - "timelion.topNavMenu.save.saveAsDashboardPanelTitle": "現在の式を Kibana ダッシュボードのパネルとして保存", - "timelion.topNavMenu.save.saveEntireSheet.inputAriaLabel": "名前", - "timelion.topNavMenu.save.saveEntireSheet.inputPlaceholder": "このシートに名前を付ける...", - "timelion.topNavMenu.save.saveEntireSheet.submitButtonLabel": "保存", - "timelion.topNavMenu.save.saveEntireSheetDescription": "Timelion 式を主に Timelion アプリで使用し、Kibana のダッシュボードに Timelion のチャートを追加する必要がない場合は、このオプションを使用します。他のパネルへのリファレンスを使用する場合もこのオプションを使用します。", - "timelion.topNavMenu.save.saveEntireSheetLabel": "シートに名前を付けて保存", - "timelion.topNavMenu.save.saveEntireSheetTitle": "Timelion シート全体の保存", - "timelion.topNavMenu.saveSheetButtonAriaLabel": "シートを保存", - "timelion.topNavMenu.saveSheetButtonLabel": "保存", - "timelion.topNavMenu.sheetOptionsTitle": "シートオプション", - "timelion.topNavMenu.statsDescription": "クエリ時間 {queryTime}ms / 処理時間 {processingTime}ms", - "timelion.uiSettings.defaultColumnsDescription": "デフォルトの Timelion シートの列数です", - "timelion.uiSettings.defaultColumnsLabel": "デフォルトの列", - "timelion.uiSettings.defaultIndexDescription": "{esParam} で検索するデフォルトの Elasticsearch インデックスです", - "timelion.uiSettings.defaultIndexLabel": "デフォルトのインデックス", - "timelion.uiSettings.defaultRowsDescription": "デフォルトの Timelion シートの行数です", - "timelion.uiSettings.defaultRowsLabel": "デフォルトの行", - "timelion.uiSettings.experimentalLabel": "実験的", - "timelion.uiSettings.graphiteURLDescription": "{experimentalLabel} Graphite ホストの URL", - "timelion.uiSettings.graphiteURLLabel": "Graphite URL", - "timelion.uiSettings.maximumBucketsDescription": "1つのデータソースが返せるバケットの最大数です", - "timelion.uiSettings.maximumBucketsLabel": "バケットの最大数", - "timelion.uiSettings.minimumIntervalDescription": "「auto」を使用時に計算される最小の間隔です", - "timelion.uiSettings.minimumIntervalLabel": "最低間隔", - "timelion.uiSettings.quandlKeyDescription": "{experimentalLabel} www.quandl.com からの API キーです", - "timelion.uiSettings.quandlKeyLabel": "Quandl キー", - "timelion.uiSettings.showTutorialDescription": "Timelion アプリの起動時にデフォルトでチュートリアルを表示しますか?", - "timelion.uiSettings.showTutorialLabel": "チュートリアルを表示", - "timelion.uiSettings.targetBucketsDescription": "自動間隔の使用時に目標となるバケット数です。", - "timelion.uiSettings.targetBucketsLabel": "目標バケット数", - "timelion.uiSettings.timeFieldDescription": "{esParam} の使用時にタイムスタンプを含むデフォルトのフィールドです", - "timelion.uiSettings.timeFieldLabel": "時間フィールド", - "timelion.vis.expressionLabel": "Timelion 式", - "timelion.vis.interval.auto": "自動", - "timelion.vis.interval.day": "1日", - "timelion.vis.interval.hour": "1時間", - "timelion.vis.interval.minute": "1分", - "timelion.vis.interval.month": "1か月", - "timelion.vis.interval.second": "1秒", - "timelion.vis.interval.week": "1週間", - "timelion.vis.interval.year": "1年", - "timelion.vis.intervalLabel": "間隔", - "timelion.vis.invalidIntervalErrorMessage": "無効な間隔フォーマット。", - "timelion.vis.selectIntervalHelpText": "オプションを選択するかカスタム値を作成します。例:30s、20m、24h、2d、1w、1M", - "timelion.vis.selectIntervalPlaceholder": "間隔を選択", - "uiActions.actionPanel.more": "詳細", - "uiActions.actionPanel.title": "オプション", - "uiActions.errors.incompatibleAction": "操作に互換性がありません", - "uiActions.triggers.rowClickkDescription": "テーブル行をクリック", - "uiActions.triggers.rowClickTitle": "テーブル行クリック", - "usageCollection.stats.notReadyMessage": "まだ統計が準備できていません。しばらくたってから再試行してください。", - "visDefaultEditor.advancedToggle.advancedLinkLabel": "高度な設定", - "visDefaultEditor.agg.disableAggButtonTooltip": "{schemaTitle} {aggTitle} アグリゲーションを無効にする", - "visDefaultEditor.agg.enableAggButtonTooltip": "{schemaTitle} {aggTitle} アグリゲーションを有効にする", - "visDefaultEditor.agg.errorsAriaLabel": "{schemaTitle} {aggTitle} アグリゲーションにエラーがあります", - "visDefaultEditor.agg.modifyPriorityButtonTooltip": "ドラッグして {schemaTitle} {aggTitle} の優先度を変更する", - "visDefaultEditor.agg.removeDimensionButtonTooltip": "{schemaTitle} {aggTitle} アグリゲーションを削除する", - "visDefaultEditor.agg.toggleEditorButtonAriaLabel": "{schema} エディターを切り替える", - "visDefaultEditor.aggAdd.addButtonLabel": "追加", - "visDefaultEditor.aggAdd.addGroupButtonLabel": "{groupNameLabel} を追加", - "visDefaultEditor.aggAdd.addSubGroupButtonLabel": "サブ {groupNameLabel} を追加", - "visDefaultEditor.aggAdd.bucketLabel": "バケット", - "visDefaultEditor.aggAdd.maxBuckets": "最大{groupNameLabel}数に達しました", - "visDefaultEditor.aggAdd.metricLabel": "メトリック", - "visDefaultEditor.aggParams.errors.aggWrongRunOrderErrorMessage": "「{schema}」集約は他のバケットの前に実行する必要があります!", - "visDefaultEditor.aggSelect.aggregationLabel": "集約", - "visDefaultEditor.aggSelect.helpLinkLabel": "{aggTitle}のヘルプ", - "visDefaultEditor.aggSelect.noCompatibleAggsDescription": "インデックスパターン{indexPatternTitle}には集約可能なフィールドが含まれていません。", - "visDefaultEditor.aggSelect.selectAggPlaceholder": "集約を選択してください", - "visDefaultEditor.aggSelect.subAggregationLabel": "サブ集約", - "visDefaultEditor.buckets.mustHaveBucketErrorMessage": "「日付ヒストグラム」または「ヒストグラム」集約のバケットを追加します。", - "visDefaultEditor.controls.aggNotValidLabel": "- 無効な集約 -", - "visDefaultEditor.controls.aggregateWith.noAggsErrorTooltip": "選択されたフィールドには互換性のある集約がありません。", - "visDefaultEditor.controls.aggregateWithLabel": "集約:", - "visDefaultEditor.controls.aggregateWithTooltip": "複数ヒットまたは複数値のフィールドを 1 つのメトリックにまとめる方法を選択します。", - "visDefaultEditor.controls.changePrecisionLabel": "マップズームの精度を変更", - "visDefaultEditor.controls.columnsLabel": "列", - "visDefaultEditor.controls.customMetricLabel": "カスタムメトリック", - "visDefaultEditor.controls.dateRanges.acceptedDateFormatsLinkText": "許容可能な日付形式", - "visDefaultEditor.controls.dateRanges.addRangeButtonLabel": "範囲を追加", - "visDefaultEditor.controls.dateRanges.errorMessage": "各範囲は1つ以上の有効な日付にしてください。", - "visDefaultEditor.controls.dateRanges.fromColumnLabel": "開始:", - "visDefaultEditor.controls.dateRanges.removeRangeButtonAriaLabel": "{from}から{to}の範囲を削除", - "visDefaultEditor.controls.dateRanges.toColumnLabel": "終了:", - "visDefaultEditor.controls.definiteMetricLabel": "メトリック:{metric}", - "visDefaultEditor.controls.dotSizeRatioHelpText": "最小の点から最大の点までの半径の比率を変更します。", - "visDefaultEditor.controls.dotSizeRatioLabel": "点サイズ率", - "visDefaultEditor.controls.dropPartialBucketsLabel": "不完全なバケットをドロップ", - "visDefaultEditor.controls.dropPartialBucketsTooltip": "時間範囲外にわたるバケットを削除してヒストグラムが不完全なバケットで開始・終了しないようにします。", - "visDefaultEditor.controls.extendedBounds.errorMessage": "最低値は最大値以下でなければなりません。", - "visDefaultEditor.controls.extendedBounds.maxLabel": "最高", - "visDefaultEditor.controls.extendedBounds.minLabel": "最低", - "visDefaultEditor.controls.extendedBoundsLabel": "拡張された境界", - "visDefaultEditor.controls.extendedBoundsTooltip": "最低値と最高値は結果を絞るのではなく、結果セットのバウンドを拡張します。", - "visDefaultEditor.controls.field.fieldIsNotExists": "このオブジェクトに関連付けられたフィールド\"{fieldParameter}\"は、インデックスパターンに存在しません。別のフィールドを使用してください。", - "visDefaultEditor.controls.field.fieldLabel": "フィールド", - "visDefaultEditor.controls.field.invalidFieldForAggregation": "このアグリゲーションで使用するには、インデックスパターン\"{indexPatternTitle}\"の保存されたフィールド\"{fieldParameter}\"が無効です。新しいフィールドを選択してください。", - "visDefaultEditor.controls.field.noCompatibleFieldsDescription": "インデックスパターン` {indexPatternTitle} に次の互換性のあるフィールドタイプが 1 つも含まれていません:{fieldTypes}", - "visDefaultEditor.controls.field.selectFieldPlaceholder": "フィールドの選択", - "visDefaultEditor.controls.filters.addFilterButtonLabel": "フィルターを追加します", - "visDefaultEditor.controls.filters.definiteFilterLabel": "{index} ラベルでフィルタリング", - "visDefaultEditor.controls.filters.filterLabel": "{index} でフィルタリング", - "visDefaultEditor.controls.filters.labelPlaceholder": "ラベル", - "visDefaultEditor.controls.filters.removeFilterButtonAriaLabel": "このフィルターを削除", - "visDefaultEditor.controls.filters.toggleFilterButtonAriaLabel": "フィルターラベルを切り替える", - "visDefaultEditor.controls.includeExclude.addUnitButtonLabel": "値を追加", - "visDefaultEditor.controls.ipRanges.addRangeButtonLabel": "範囲を追加", - "visDefaultEditor.controls.ipRanges.cidrMaskAriaLabel": "CIDR マスク:{mask}", - "visDefaultEditor.controls.ipRanges.cidrMasksButtonLabel": "CIDR マスク", - "visDefaultEditor.controls.ipRanges.fromToButtonLabel": "開始/終了", - "visDefaultEditor.controls.ipRanges.ipRangeFromAriaLabel": "IP 範囲の開始値:{value}", - "visDefaultEditor.controls.ipRanges.ipRangeToAriaLabel": "IP 範囲の終了値:{value}", - "visDefaultEditor.controls.ipRanges.removeCidrMaskButtonAriaLabel": "{mask} の CIDR マスクの値を削除", - "visDefaultEditor.controls.ipRanges.removeEmptyCidrMaskButtonAriaLabel": "CIDR マスクのデフォルトの値を削除", - "visDefaultEditor.controls.ipRanges.removeRangeAriaLabel": "{from}から{to}の範囲を削除", - "visDefaultEditor.controls.ipRangesAriaLabel": "IP 範囲", - "visDefaultEditor.controls.jsonInputLabel": "JSON インプット", - "visDefaultEditor.controls.jsonInputTooltip": "ここに追加された JSON 形式のプロパティは、すべてこのセクションの Elasticsearch 集約定義に融合されます。用語集約における「shard_size」がその例です。", - "visDefaultEditor.controls.maxBars.autoPlaceholder": "自動", - "visDefaultEditor.controls.maxBars.maxBarsHelpText": "間隔は、使用可能なデータに基づいて、自動的に選択されます。棒の最大数は、詳細設定の{histogramMaxBars}以下でなければなりません。", - "visDefaultEditor.controls.maxBars.maxBarsLabel": "棒の最大数", - "visDefaultEditor.controls.metricLabel": "メトリック", - "visDefaultEditor.controls.metrics.bucketTitle": "バケット", - "visDefaultEditor.controls.metrics.metricTitle": "メトリック", - "visDefaultEditor.controls.numberInterval.autoInteralIsUsed": "自動間隔が使用されます", - "visDefaultEditor.controls.numberInterval.minimumIntervalLabel": "最低間隔", - "visDefaultEditor.controls.numberInterval.minimumIntervalTooltip": "入力された値により高度な設定の {histogramMaxBars} で指定されたよりも多くのバケットが作成される場合、間隔は自動的にスケーリングされます。", - "visDefaultEditor.controls.numberInterval.selectIntervalPlaceholder": "間隔を入力", - "visDefaultEditor.controls.numberList.addUnitButtonLabel": "{unitName} を追加", - "visDefaultEditor.controls.numberList.duplicateValueErrorMessage": "重複値。", - "visDefaultEditor.controls.numberList.enterValuePlaceholder": "値を入力", - "visDefaultEditor.controls.numberList.invalidAscOrderErrorMessage": "値は昇順になっていません。", - "visDefaultEditor.controls.numberList.invalidRangeErrorMessage": "値は {min} から {max} の範囲でなければなりません。", - "visDefaultEditor.controls.numberList.removeUnitButtonAriaLabel": "{value} のランク値を削除", - "visDefaultEditor.controls.onlyRequestDataAroundMapExtentLabel": "マップ範囲のデータのみリクエストしてください", - "visDefaultEditor.controls.onlyRequestDataAroundMapExtentTooltip": "geo_bounding_box フィルター集約を適用して、襟付きのマップビューボックスにサブジェクトエリアを絞ります", - "visDefaultEditor.controls.orderAgg.alphabeticalLabel": "アルファベット順", - "visDefaultEditor.controls.orderAgg.orderByLabel": "並び順", - "visDefaultEditor.controls.orderLabel": "順序", - "visDefaultEditor.controls.otherBucket.groupValuesLabel": "他の値を別のバケットにまとめる", - "visDefaultEditor.controls.otherBucket.groupValuesTooltip": "トップ N 以外の値はこのバケットにまとめられます。欠測値があるドキュメントを含めるには、「欠測値を表示」を有効にしてください。", - "visDefaultEditor.controls.otherBucket.showMissingValuesLabel": "欠測値を表示", - "visDefaultEditor.controls.otherBucket.showMissingValuesTooltip": "「文字列」タイプのフィールドにのみ使用できます。有効にすると、欠測値があるドキュメントが検索に含まれます。バケットがトップ N の場合、チャートに表示されます。トップ N ではなく、「他の値を別のバケットにまとえる」が有効な場合、Elasticsearch は欠測値を「他」のバケットに追加します。", - "visDefaultEditor.controls.percentileRanks.percentUnitNameText": "パーセント", - "visDefaultEditor.controls.percentileRanks.valuesLabel": "値", - "visDefaultEditor.controls.percentileRanks.valueUnitNameText": "値", - "visDefaultEditor.controls.percentiles.percentsLabel": "パーセント", - "visDefaultEditor.controls.placeMarkersOffGridLabel": "グリッド外にマーカーを配置 (ジオセントロイドを使用) ", - "visDefaultEditor.controls.precisionLabel": "精度", - "visDefaultEditor.controls.ranges.addRangeButtonLabel": "範囲を追加", - "visDefaultEditor.controls.ranges.fromLabel": "開始:", - "visDefaultEditor.controls.ranges.greaterThanOrEqualPrepend": "≧", - "visDefaultEditor.controls.ranges.greaterThanOrEqualTooltip": "よりも大きいまたは等しい", - "visDefaultEditor.controls.ranges.lessThanPrepend": "<", - "visDefaultEditor.controls.ranges.lessThanTooltip": "より小さい", - "visDefaultEditor.controls.ranges.removeRangeButtonAriaLabel": "{from}から{to}の範囲を削除", - "visDefaultEditor.controls.ranges.toLabel": "終了:", - "visDefaultEditor.controls.rowsLabel": "行", - "visDefaultEditor.controls.scaleMetricsLabel": "メトリック値のスケーリング (非推奨) ", - "visDefaultEditor.controls.scaleMetricsTooltip": "これを有効にすると、手動最低間隔を選択し、広い間隔が使用された場合、カウントと合計メトリックが手動で選択された間隔にスケーリングされます。", - "visDefaultEditor.controls.showEmptyBucketsLabel": "空のバケットを表示", - "visDefaultEditor.controls.showEmptyBucketsTooltip": "結果のあるバケットだけでなくすべてのバケットを表示します", - "visDefaultEditor.controls.sizeLabel": "サイズ", - "visDefaultEditor.controls.sizeTooltip": "トップ K のヒットをリクエスト。複数ヒットは「集約基準」でまとめられます。", - "visDefaultEditor.controls.sortOnLabel": "並べ替えオン", - "visDefaultEditor.controls.splitByLegend": "行または列でチャートを分割します。", - "visDefaultEditor.controls.timeInterval.createsTooLargeBucketsTooltip": "この間隔は、選択された時間範囲に表示するには大きすぎるバケットが作成されるため、にスケーリングされています。", - "visDefaultEditor.controls.timeInterval.createsTooManyBucketsTooltip": "この間隔は選択された時間範囲に表示しきれない数のバケットが作成されるため、にスケーリングされています。", - "visDefaultEditor.controls.timeInterval.invalidFormatErrorMessage": "無効な間隔フォーマット。", - "visDefaultEditor.controls.timeInterval.minimumIntervalLabel": "最低間隔", - "visDefaultEditor.controls.timeInterval.scaledHelpText": "現在 {bucketDescription} にスケーリングされています", - "visDefaultEditor.controls.timeInterval.selectIntervalPlaceholder": "間隔を選択", - "visDefaultEditor.controls.timeInterval.selectOptionHelpText": "オプションを選択するかカスタム値を作成します。例:30s、20m、24h、2d、1w、1M", - "visDefaultEditor.controls.useAutoInterval": "自動間隔を使用", - "visDefaultEditor.editorConfig.dateHistogram.customInterval.helpText": "構成間隔の倍数でなければなりません:{interval}", - "visDefaultEditor.editorConfig.histogram.interval.helpText": "構成間隔の倍数でなければなりません:{interval}", - "visDefaultEditor.metrics.wrongLastBucketTypeErrorMessage": "「{type}」メトリック集約を使用する場合、最後のバケット集約は「Date Histogram」または「Histogram」でなければなりません。", - "visDefaultEditor.options.colorRanges.errorText": "各範囲は前の範囲よりも大きくなければなりません。", - "visDefaultEditor.options.colorSchema.colorSchemaLabel": "配色", - "visDefaultEditor.options.colorSchema.howToChangeColorsDescription": "それぞれの色は凡例で変更できます。", - "visDefaultEditor.options.colorSchema.resetColorsButtonLabel": "色をリセット", - "visDefaultEditor.options.colorSchema.reverseColorSchemaLabel": "図表を反転", - "visDefaultEditor.options.percentageMode.documentationLabel": "Numeral.jsドキュメント", - "visDefaultEditor.options.percentageMode.numeralLabel": "形式パターン", - "visDefaultEditor.options.percentageMode.percentageModeLabel": "百分率モード", - "visDefaultEditor.options.rangeErrorMessage": "値は{min}と{max}の間でなければなりません", - "visDefaultEditor.options.vislibBasicOptions.legendPositionLabel": "凡例位置", - "visDefaultEditor.options.vislibBasicOptions.showTooltipLabel": "ツールヒントを表示", - "visDefaultEditor.palettePicker.label": "カラーパレット", - "visDefaultEditor.sidebar.autoApplyChangesLabelOff": "自動適用がオフです", - "visDefaultEditor.sidebar.autoApplyChangesLabelOn": "自動適用がオンです", - "visDefaultEditor.sidebar.autoApplyChangesOff": "オフ", - "visDefaultEditor.sidebar.autoApplyChangesOffLabel": "自動適用がオフです", - "visDefaultEditor.sidebar.autoApplyChangesOn": "オン", - "visDefaultEditor.sidebar.autoApplyChangesOnLabel": "自動適用がオンです", - "visDefaultEditor.sidebar.autoApplyChangesTooltip": "変更されるごとにビジュアライゼーションを自動的に更新します。", - "visDefaultEditor.sidebar.collapseButtonAriaLabel": "サイドバーを切り替える", - "visDefaultEditor.sidebar.discardChangesButtonLabel": "破棄", - "visDefaultEditor.sidebar.errorButtonTooltip": "ハイライトされたフィールドのエラーを解決する必要があります。", - "visDefaultEditor.sidebar.indexPatternAriaLabel": "インデックスパターン:{title}", - "visDefaultEditor.sidebar.savedSearch.goToDiscoverButtonText": "Discover にこの検索を表示", - "visDefaultEditor.sidebar.savedSearch.linkButtonAriaLabel": "保存された検索へのリンク。クリックして詳細を確認するかリンクを解除します。", - "visDefaultEditor.sidebar.savedSearch.popoverHelpText": "保存したこの検索に今後加える修正は、ビジュアライゼーションに反映されます。自動更新を無効にするには、リンクを削除します。", - "visDefaultEditor.sidebar.savedSearch.popoverTitle": "保存された検索にリンクされています", - "visDefaultEditor.sidebar.savedSearch.titleAriaLabel": "保存された検索:{title}", - "visDefaultEditor.sidebar.savedSearch.unlinkSavedSearchButtonText": "保存された検索へのリンクを削除", - "visDefaultEditor.sidebar.tabs.dataLabel": "データ", - "visDefaultEditor.sidebar.tabs.optionsLabel": "オプション", - "visDefaultEditor.sidebar.updateChartButtonLabel": "更新", - "visDefaultEditor.sidebar.updateInfoTooltip": "CTRL + Enterは更新のショートカットです。", - "visTypeMarkdown.function.font.help": "フォント設定です。", - "visTypeMarkdown.function.help": "マークダウンビジュアライゼーション", - "visTypeMarkdown.function.markdown.help": "レンダリングするマークダウン", - "visTypeMarkdown.function.openLinksInNewTab.help": "新規タブでリンクを開きます", - "visTypeMarkdown.markdownDescription": "テキストと画像をダッシュボードに追加します。", - "visTypeMarkdown.markdownTitleInWizard": "テキスト", - "visTypeMarkdown.params.fontSizeLabel": "ポイント単位のベースフォントサイズです。", - "visTypeMarkdown.params.helpLinkLabel": "ヘルプ", - "visTypeMarkdown.params.openLinksLabel": "新規タブでリンクを開く", - "visTypeMarkdown.tabs.dataText": "データ", - "visTypeMarkdown.tabs.optionsText": "オプション", - "visTypeMetric.colorModes.backgroundOptionLabel": "背景", - "visTypeMetric.colorModes.labelsOptionLabel": "ラベル", - "visTypeMetric.colorModes.noneOptionLabel": "なし", - "visTypeMetric.function.bgFill.help": "html 16 進数コード (#123456) 、html 色 (red、blue) 、または rgba 値 (rgba (255,255,255,1) ) 。", - "visTypeMetric.function.bucket.help": "バケットディメンションの構成です。", - "visTypeMetric.function.colorMode.help": "色を変更するメトリックの部分", - "visTypeMetric.function.colorRange.help": "別の色が適用される値のグループを指定する範囲オブジェクト。", - "visTypeMetric.function.colorSchema.help": "使用する配色", - "visTypeMetric.function.font.help": "フォント設定です。", - "visTypeMetric.function.help": "メトリックビジュアライゼーション", - "visTypeMetric.function.invertColors.help": "色範囲を反転します", - "visTypeMetric.function.metric.help": "メトリックディメンションの構成です。", - "visTypeMetric.function.percentageMode.help": "百分率モードでメトリックを表示します。colorRange を設定する必要があります。", - "visTypeMetric.function.showLabels.help": "メトリック値の下にラベルを表示します。", - "visTypeMetric.function.subText.help": "メトリックの下に表示するカスタムテキスト", - "visTypeMetric.function.useRanges.help": "有効な色範囲です。", - "visTypeMetric.metricDescription": "計算結果を単独の数字として表示します。", - "visTypeMetric.metricTitle": "メトリック", - "visTypeMetric.params.color.useForLabel": "使用する色", - "visTypeMetric.params.rangesTitle": "範囲", - "visTypeMetric.params.settingsTitle": "設定", - "visTypeMetric.params.showTitleLabel": "タイトルを表示", - "visTypeMetric.params.style.fontSizeLabel": "ポイント単位のメトリックフォントサイズ", - "visTypeMetric.params.style.styleTitle": "スタイル", - "visTypeMetric.schemas.metricTitle": "メトリック", - "visTypeMetric.schemas.splitGroupTitle": "グループを分割", - "visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.deprecation": "Visualizeの円グラフのレガシーグラフライブラリは廃止予定であり、8.0以降ではサポートされません。", - "visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.description": "Visualizeで円グラフのレガシーグラフライブラリを有効にします。", - "visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.name": "円グラフのレガシーグラフライブラリ", - "visTypePie.controls.truncateLabel": "切り捨て", - "visTypePie.editors.pie.addLegendLabel": "凡例を表示", - "visTypePie.editors.pie.decimalSliderLabel": "割合の最大小数点桁数", - "visTypePie.editors.pie.distinctColorsLabel": "スライスごとに異なる色を使用", - "visTypePie.editors.pie.donutLabel": "ドーナッツ", - "visTypePie.editors.pie.labelPositionLabel": "ラベル位置", - "visTypePie.editors.pie.labelsSettingsTitle": "ラベル設定", - "visTypePie.editors.pie.nestedLegendLabel": "ネスト凡例", - "visTypePie.editors.pie.pieSettingsTitle": "パイ設定", - "visTypePie.editors.pie.showLabelsLabel": "ラベルを表示", - "visTypePie.editors.pie.showTopLevelOnlyLabel": "トップレベルのみ表示", - "visTypePie.editors.pie.showValuesLabel": "値を表示", - "visTypePie.editors.pie.valueFormatsLabel": "値", - "visTypePie.function.args.addLegendHelpText": "グラフ凡例を表示", - "visTypePie.function.args.addTooltipHelpText": "スライスにカーソルを置いたときにツールチップを表示", - "visTypePie.function.args.bucketsHelpText": "バケットディメンション構成", - "visTypePie.function.args.distinctColorsHelpText": "スライスごとに異なる色をマッピングします。同じ値のスライスは同じ色になります", - "visTypePie.function.args.isDonutHelpText": "円グラフをドーナツグラフとして表示します", - "visTypePie.function.args.labelsHelpText": "円グラフラベル構成", - "visTypePie.function.args.legendPositionHelpText": "グラフの上、下、左、右に凡例を配置", - "visTypePie.function.args.metricHelpText": "メトリックディメンション構成", - "visTypePie.function.args.nestedLegendHelpText": "詳細凡例を表示", - "visTypePie.function.args.paletteHelpText": "グラフパレット名を定義します", - "visTypePie.function.args.splitColumnHelpText": "列ディメンション構成で分割", - "visTypePie.function.args.splitRowHelpText": "行ディメンション構成で分割", - "visTypePie.function.pieLabels.help": "円グラフラベルオブジェクトを生成します", - "visTypePie.function.pieLabels.lastLevel.help": "最上位のラベルのみを表示", - "visTypePie.function.pieLabels.percentDecimals.help": "割合として値に表示される10進数を定義します", - "visTypePie.function.pieLabels.position.help": "ラベル位置を定義します", - "visTypePie.function.pieLabels.show.help": "円グラフのラベルを表示します", - "visTypePie.function.pieLabels.truncate.help": "スライス値が表示される文字数を定義します", - "visTypePie.function.pieLabels.values.help": "スライス内の値を定義します", - "visTypePie.function.pieLabels.valuesFormat.help": "値の形式を定義します", - "visTypePie.functions.help": "パイビジュアライゼーション", - "visTypePie.labelPositions.insideOrOutsideText": "内部または外部", - "visTypePie.labelPositions.insideText": "内部", - "visTypePie.legend.filterForValueButtonAriaLabel": "値でフィルター", - "visTypePie.legend.filterOptionsLegend": "{legendDataLabel}、フィルターオプション", - "visTypePie.legend.filterOutValueButtonAriaLabel": "値を除外", - "visTypePie.legendPositions.bottomText": "一番下", - "visTypePie.legendPositions.leftText": "左", - "visTypePie.legendPositions.rightText": "右", - "visTypePie.legendPositions.topText": "トップ", - "visTypePie.pie.metricTitle": "スライスサイズ", - "visTypePie.pie.pieDescription": "全体に対する比率でデータを比較します。", - "visTypePie.pie.pieTitle": "円", - "visTypePie.pie.segmentTitle": "スライスの分割", - "visTypePie.pie.splitTitle": "チャートを分割", - "visTypePie.valuesFormats.percent": "割合を表示", - "visTypePie.valuesFormats.value": "値を表示", - "visTypeTable.aggTable.exportLabel": "エクスポート:", - "visTypeTable.aggTable.formattedLabel": "フォーマット済み", - "visTypeTable.aggTable.rawLabel": "未加工", - "visTypeTable.defaultAriaLabel": "データ表ビジュアライゼーション", - "visTypeTable.directives.tableCellFilter.filterForValueTooltip": "値でフィルター", - "visTypeTable.directives.tableCellFilter.filterOutValueTooltip": "値を除外", - "visTypeTable.function.args.bucketsHelpText": "バケットディメンション構成", - "visTypeTable.function.args.metricsHelpText": "メトリックディメンション構成", - "visTypeTable.function.args.percentageColHelpText": "割合を表示する列の名前", - "visTypeTable.function.args.perPageHelpText": "表ページの行数はページネーションで使用されます", - "visTypeTable.function.args.rowHelpText": "行値は分割表モードで使用されます。「true」に設定すると、行で分割します", - "visTypeTable.function.args.showToolbarHelpText": "「true」に設定すると、グリッドツールバーと[エクスポート]ボタンを表示します", - "visTypeTable.function.args.showTotalHelpText": "「true」に設定すると、合計行を表示します", - "visTypeTable.function.args.splitColumnHelpText": "列ディメンション構成で分割", - "visTypeTable.function.args.splitRowHelpText": "行ディメンション構成で分割", - "visTypeTable.function.args.titleHelpText": "ビジュアライゼーションタイトル。タイトルはデフォルトファイル名としてCSVエクスポートで使用されます", - "visTypeTable.function.args.totalFuncHelpText": "合計行の集計関数を指定します。使用可能なオプション:", - "visTypeTable.function.help": "表ビジュアライゼーション", - "visTypeTable.params.defaultPercentageCol": "非表示", - "visTypeTable.params.PercentageColLabel": "パーセンテージ列", - "visTypeTable.params.percentageTableColumnName": "{title} パーセント", - "visTypeTable.params.perPageLabel": "ページごとの最大行数", - "visTypeTable.params.showMetricsLabel": "すべてのバケット/レベルのメトリックを表示", - "visTypeTable.params.showPartialRowsLabel": "部分的な行を表示", - "visTypeTable.params.showPartialRowsTip": "部分データのある行を表示。表示されていなくてもすべてのバケット/レベルのメトリックが計算されます。", - "visTypeTable.params.showToolbarLabel": "ツールバーを表示", - "visTypeTable.params.showTotalLabel": "合計を表示", - "visTypeTable.params.totalFunctionLabel": "合計機能", - "visTypeTable.sort.ascLabel": "昇順で並べ替え", - "visTypeTable.sort.descLabel": "降順で並べ替え", - "visTypeTable.tableCellFilter.filterForValueAriaLabel": "値のフィルター:{cellContent}", - "visTypeTable.tableCellFilter.filterForValueText": "値でフィルター", - "visTypeTable.tableCellFilter.filterOutValueAriaLabel": "値の除外:{cellContent}", - "visTypeTable.tableCellFilter.filterOutValueText": "値を除外", - "visTypeTable.tableVisDescription": "行と列にデータを表示します。", - "visTypeTable.tableVisEditorConfig.schemas.bucketTitle": "行を分割", - "visTypeTable.tableVisEditorConfig.schemas.metricTitle": "メトリック", - "visTypeTable.tableVisEditorConfig.schemas.splitTitle": "テーブルを分割", - "visTypeTable.tableVisTitle": "データテーブル", - "visTypeTable.totalAggregations.averageText": "平均", - "visTypeTable.totalAggregations.countText": "カウント", - "visTypeTable.totalAggregations.maxText": "最高", - "visTypeTable.totalAggregations.minText": "最低", - "visTypeTable.totalAggregations.sumText": "合計", - "visTypeTable.vis.controls.exportButtonAriaLabel": "{dataGridAriaLabel} を CSV としてエクスポート", - "visTypeTable.vis.controls.exportButtonLabel": "エクスポート", - "visTypeTable.vis.controls.formattedCSVButtonLabel": "フォーマット済み", - "visTypeTable.vis.controls.rawCSVButtonLabel": "未加工", - "visTypeTable.vis.noResultsFoundTitle": "結果が見つかりませんでした", - "expressionTagcloud.feedbackMessage.tooSmallContainerDescription": "コンテナーが小さすぎてクラウド全体を表示できません。タグが切り取られたか省略されている可能性があります。", - "expressionTagcloud.feedbackMessage.truncatedTagsDescription": "描写時間が長くなるのを防ぐため、タグの数が切り捨てられています。", - "expressionTagcloud.functions.tagcloud.args.bucketHelpText": "バケットディメンションの構成です。", - "expressionTagcloud.functions.tagcloudHelpText": "タグクラウドのビジュアライゼーションです。", - "expressionTagcloud.functions.tagcloud.args.metricHelpText": "メトリックディメンションの構成です。", - "expressionTagcloud.functions.tagcloud.args.orientationHelpText": "タグクラウド内の単語の方向です。", - "expressionTagcloud.functions.tagcloud.args.paletteHelpText": "グラフパレット名を定義します", - "expressionTagcloud.functions.tagcloud.args.scaleHelpText": "単語のフォントサイズを決定するスケールです", - "visTypeTagCloud.orientations.multipleText": "複数", - "visTypeTagCloud.orientations.rightAngledText": "直角", - "visTypeTagCloud.orientations.singleText": "単一", - "visTypeTagCloud.scales.linearText": "線形", - "visTypeTagCloud.scales.logText": "ログ", - "visTypeTagCloud.scales.squareRootText": "平方根", - "visTypeTagCloud.vis.schemas.metricTitle": "タグサイズ", - "visTypeTagCloud.vis.schemas.segmentTitle": "タグ", - "visTypeTagCloud.vis.tagCloudDescription": "単語の頻度とフォントサイズを表示します。", - "visTypeTagCloud.vis.tagCloudTitle": "タグクラウド", - "visTypeTagCloud.visParams.fontSizeLabel": "フォントサイズ範囲 (ピクセル) ", - "visTypeTagCloud.visParams.orientationsLabel": "方向", - "visTypeTagCloud.visParams.showLabelToggleLabel": "ラベルを表示", - "visTypeTagCloud.visParams.textScaleLabel": "テキストスケール", - "visTypeTimeseries.addDeleteButtons.addButtonDefaultTooltip": "追加", - "visTypeTimeseries.addDeleteButtons.cloneButtonDefaultTooltip": "クローンを作成", - "visTypeTimeseries.addDeleteButtons.deleteButtonDefaultTooltip": "削除", - "visTypeTimeseries.addDeleteButtons.reEnableTooltip": "再度有効にする", - "visTypeTimeseries.addDeleteButtons.temporarilyDisableTooltip": "一時的に無効にする", - "visTypeTimeseries.advancedSettings.maxBucketsText": "TSVBヒストグラム密度に影響します。「histogram:maxBars」よりも大きく設定する必要があります。", - "visTypeTimeseries.advancedSettings.maxBucketsTitle": "TSVBバケット制限", - "visTypeTimeseries.aggUtils.averageLabel": "平均", - "visTypeTimeseries.aggUtils.bucketScriptLabel": "バケットスクリプト", - "visTypeTimeseries.aggUtils.cardinalityLabel": "基数", - "visTypeTimeseries.aggUtils.countLabel": "カウント", - "visTypeTimeseries.aggUtils.cumulativeSumLabel": "累積和", - "visTypeTimeseries.aggUtils.derivativeLabel": "派生", - "visTypeTimeseries.aggUtils.deviationLabel": "標準偏差", - "visTypeTimeseries.aggUtils.filterRatioLabel": "フィルターレート", - "visTypeTimeseries.aggUtils.mathLabel": "数学処理", - "visTypeTimeseries.aggUtils.maxLabel": "最高", - "visTypeTimeseries.aggUtils.minLabel": "最低", - "visTypeTimeseries.aggUtils.movingAverageLabel": "移動平均", - "visTypeTimeseries.aggUtils.overallAverageLabel": "全体平均", - "visTypeTimeseries.aggUtils.overallMaxLabel": "全体最高", - "visTypeTimeseries.aggUtils.overallMinLabel": "全体最低", - "visTypeTimeseries.aggUtils.overallStdDeviationLabel": "全体標準偏差", - "visTypeTimeseries.aggUtils.overallSumLabel": "全体合計", - "visTypeTimeseries.aggUtils.overallSumOfSquaresLabel": "全体平方和", - "visTypeTimeseries.aggUtils.overallVarianceLabel": "全体の相異", - "visTypeTimeseries.aggUtils.percentileLabel": "パーセンタイル", - "visTypeTimeseries.aggUtils.percentileRankLabel": "パーセンタイルランク", - "visTypeTimeseries.aggUtils.positiveOnlyLabel": "プラスのみ", - "visTypeTimeseries.aggUtils.positiveRateLabel": "カウンターレート", - "visTypeTimeseries.aggUtils.serialDifferenceLabel": "連続差", - "visTypeTimeseries.aggUtils.seriesAggLabel": "数列集約", - "visTypeTimeseries.aggUtils.staticValueLabel": "不動値", - "visTypeTimeseries.aggUtils.sumLabel": "合計", - "visTypeTimeseries.aggUtils.sumOfSquaresLabel": "平方和", - "visTypeTimeseries.aggUtils.topHitLabel": "トップヒット", - "visTypeTimeseries.aggUtils.valueCountLabel": "値カウント", - "visTypeTimeseries.aggUtils.varianceLabel": "相異", - "visTypeTimeseries.aggRow.addMetricButtonTooltip": "メトリックを追加", - "visTypeTimeseries.aggRow.deleteMetricButtonTooltip": "メトリックを削除", - "visTypeTimeseries.aggSelect.aggGroups.metricAggLabel": "メトリック集約", - "visTypeTimeseries.aggSelect.aggGroups.parentPipelineAggLabel": "親パイプライン集約", - "visTypeTimeseries.aggSelect.aggGroups.siblingPipelineAggLabel": "シブリングパイプライン集約", - "visTypeTimeseries.aggSelect.aggGroups.specialAggLabel": "特殊集約", - "visTypeTimeseries.aggSelect.selectAggPlaceholder": "集約を選択", - "visTypeTimeseries.annotationsEditor.addDataSourceButtonLabel": "データソースを追加", - "visTypeTimeseries.annotationsEditor.dataSourcesLabel": "データソース", - "visTypeTimeseries.annotationsEditor.fieldsLabel": "フィールド (必須 - コンマ区切りのパス) ", - "visTypeTimeseries.annotationsEditor.howToCreateAnnotationDataSourceDescription": "下のボタンをクリックして注釈データソースを作成します。", - "visTypeTimeseries.annotationsEditor.iconLabel": "アイコン (必須) ", - "visTypeTimeseries.annotationsEditor.ignoreGlobalFiltersLabel": "グローバルフィルターを無視しますか?", - "visTypeTimeseries.annotationsEditor.ignorePanelFiltersLabel": "パネルフィルターを無視しますか?", - "visTypeTimeseries.annotationsEditor.queryStringLabel": "クエリ文字列", - "visTypeTimeseries.annotationsEditor.rowTemplateHelpText": "eg.{rowTemplateExample}", - "visTypeTimeseries.annotationsEditor.rowTemplateLabel": "行テンプレート (必須)", - "visTypeTimeseries.annotationsEditor.timeFieldLabel": "時間フィールド (必須)", - "visTypeTimeseries.axisLabelOptions.axisLabel": "per {unitValue} {unitString}", - "visTypeTimeseries.calculateLabel.bucketScriptsLabel": "バケットスクリプト", - "visTypeTimeseries.calculateLabel.countLabel": "カウント", - "visTypeTimeseries.calculateLabel.filterRatioLabel": "フィルターレート", - "visTypeTimeseries.calculateLabel.mathLabel": "数学処理", - "visTypeTimeseries.calculateLabel.metricTypeOfMetricFieldRankLabel": "{metricTypeLabel} of {metricField}", - "visTypeTimeseries.calculateLabel.metricTypeOfTargetLabel": "{metricTypeLabel} of {targetLabel}", - "visTypeTimeseries.calculateLabel.metricTypeOfTargetWithAdditionalLabel": "{metricTypeLabel} of {targetLabel} ({additionalLabel}) ", - "visTypeTimeseries.calculateLabel.positiveRateLabel": "{field} のカウンターレート", - "visTypeTimeseries.calculateLabel.seriesAggLabel": "数列アグリゲーション ({metricFunction}) ", - "visTypeTimeseries.calculateLabel.staticValueLabel": "{metricValue} の静的値", - "visTypeTimeseries.calculateLabel.unknownLabel": "不明", - "visTypeTimeseries.calculation.aggregationLabel": "アグリゲーション", - "visTypeTimeseries.calculation.painlessScriptDescription": "変数は {params}オブジェクトのキーです (例:{paramsName}) 。バケット間隔 (ミリ秒単位) にアクセスするには {paramsInterval} を使用します。", - "visTypeTimeseries.calculation.painlessScriptLabel": "Painless スクリプト", - "visTypeTimeseries.calculation.variablesLabel": "変数", - "visTypeTimeseries.colorPicker.clearIconLabel": "クリア", - "visTypeTimeseries.colorPicker.notAccessibleAriaLabel": "カラーピッカー、アクセス不可", - "visTypeTimeseries.colorPicker.notAccessibleWithValueAriaLabel": "カラーピッカー ({value}) 、アクセス不可", - "visTypeTimeseries.colorRules.adjustChartSizeAriaLabel": "上下の矢印を押してチャートサイズを調整します", - "visTypeTimeseries.colorRules.defaultPrimaryNameLabel": "背景", - "visTypeTimeseries.colorRules.defaultSecondaryNameLabel": "テキスト", - "visTypeTimeseries.colorRules.emptyLabel": "空", - "visTypeTimeseries.colorRules.greaterThanLabel": "> greater than", - "visTypeTimeseries.colorRules.greaterThanOrEqualLabel": ">= greater than or equal", - "visTypeTimeseries.colorRules.ifMetricIsLabel": "メトリックが", - "visTypeTimeseries.colorRules.lessThanLabel": "< less than", - "visTypeTimeseries.colorRules.lessThanOrEqualLabel": "<= less than or equal", - "visTypeTimeseries.colorRules.setPrimaryColorLabel": "{primaryName} を設定", - "visTypeTimeseries.colorRules.setSecondaryColorLabel": "{secondaryName} を設定", - "visTypeTimeseries.colorRules.valueAriaLabel": "値", - "visTypeTimeseries.cumulativeSum.aggregationLabel": "アグリゲーション", - "visTypeTimeseries.cumulativeSum.metricLabel": "メトリック", - "visTypeTimeseries.dataFormatPicker.bytesLabel": "バイト", - "visTypeTimeseries.dataFormatPicker.customLabel": "カスタム", - "visTypeTimeseries.dataFormatPicker.decimalPlacesLabel": "小数部分の桁数", - "visTypeTimeseries.dataFormatPicker.durationLabel": "期間", - "visTypeTimeseries.dataFormatPicker.formatStringHelpText": "{numeralJsLink}を参照", - "visTypeTimeseries.dataFormatPicker.formatStringLabel": "フォーマット文字列", - "visTypeTimeseries.dataFormatPicker.fromLabel": "開始:", - "visTypeTimeseries.dataFormatPicker.numberLabel": "数字", - "visTypeTimeseries.dataFormatPicker.percentLabel": "パーセント", - "visTypeTimeseries.dataFormatPicker.toLabel": "終了:", - "visTypeTimeseries.defaultDataFormatterLabel": "データフォーマッター", - "visTypeTimeseries.derivative.aggregationLabel": "アグリゲーション", - "visTypeTimeseries.derivative.metricLabel": "メトリック", - "visTypeTimeseries.derivative.unitsLabel": "単位 (1s、1m など) ", - "visTypeTimeseries.durationOptions.daysLabel": "日", - "visTypeTimeseries.durationOptions.hoursLabel": "時間", - "visTypeTimeseries.durationOptions.humanize": "人間に読解可能", - "visTypeTimeseries.durationOptions.microsecondsLabel": "マイクロ秒", - "visTypeTimeseries.durationOptions.millisecondsLabel": "ミリ秒", - "visTypeTimeseries.durationOptions.minutesLabel": "分", - "visTypeTimeseries.durationOptions.monthsLabel": "か月", - "visTypeTimeseries.durationOptions.nanosecondsLabel": "ナノ秒", - "visTypeTimeseries.durationOptions.picosecondsLabel": "ピコ秒", - "visTypeTimeseries.durationOptions.secondsLabel": "秒", - "visTypeTimeseries.durationOptions.weeksLabel": "週間", - "visTypeTimeseries.durationOptions.yearsLabel": "年", - "visTypeTimeseries.emptyTextValue": " (空) ", - "visTypeTimeseries.error.requestForPanelFailedErrorMessage": "このパネルのリクエストに失敗しました", - "visTypeTimeseries.fetchFields.loadIndexPatternFieldsErrorMessage": "index_pattern フィールドを読み込めません", - "visTypeTimeseries.fields.fieldNotFound": "フィールド\"{field}\"が見つかりません", - "visTypeTimeseries.fieldSelect.fieldIsNotValid": "\"{fieldParameter}\"フィールドは無効であり、現在のインデックスで使用できません。新しいフィールドを選択してください。", - "visTypeTimeseries.fieldSelect.selectFieldPlaceholder": "フィールドを選択してください...", - "visTypeTimeseries.filterRatio.aggregationLabel": "アグリゲーション", - "visTypeTimeseries.filterRatio.denominatorLabel": "分母", - "visTypeTimeseries.filterRatio.fieldLabel": "フィールド", - "visTypeTimeseries.filterRatio.metricAggregationLabel": "メトリック集約", - "visTypeTimeseries.filterRatio.numeratorLabel": "分子", - "visTypeTimeseries.function.help": "TSVB ビジュアライゼーション", - "visTypeTimeseries.gauge.dataTab.dataButtonLabel": "データ", - "visTypeTimeseries.gauge.dataTab.metricsButtonLabel": "メトリック", - "visTypeTimeseries.gauge.editor.addSeriesTooltip": "数列を追加", - "visTypeTimeseries.gauge.editor.cloneSeriesTooltip": "数列のクローンを作成", - "visTypeTimeseries.gauge.editor.deleteSeriesTooltip": "数列を削除", - "visTypeTimeseries.gauge.editor.labelPlaceholder": "ラベル", - "visTypeTimeseries.gauge.editor.toggleEditorAriaLabel": "数列エディターを切り替える", - "visTypeTimeseries.gauge.optionsTab.backgroundColorLabel": "背景色:", - "visTypeTimeseries.gauge.optionsTab.colorRulesLabel": "カラールール", - "visTypeTimeseries.gauge.optionsTab.dataLabel": "データ", - "visTypeTimeseries.gauge.optionsTab.gaugeLineWidthLabel": "ゲージ線の幅", - "visTypeTimeseries.gauge.optionsTab.gaugeMaxLabel": "ゲージ最大値 (自動は未入力) ", - "visTypeTimeseries.gauge.optionsTab.gaugeStyleLabel": "ゲージスタイル", - "visTypeTimeseries.gauge.optionsTab.ignoreGlobalFilterLabel": "グローバルフィルターを無視しますか?", - "visTypeTimeseries.gauge.optionsTab.innerColorLabel": "内側の色:", - "visTypeTimeseries.gauge.optionsTab.innerLineWidthLabel": "内側の線の幅", - "visTypeTimeseries.gauge.optionsTab.optionsButtonLabel": "オプション", - "visTypeTimeseries.gauge.optionsTab.panelFilterLabel": "パネルフィルター", - "visTypeTimeseries.gauge.optionsTab.panelOptionsButtonLabel": "パネルオプション", - "visTypeTimeseries.gauge.optionsTab.styleLabel": "スタイル", - "visTypeTimeseries.gauge.styleOptions.circleLabel": "円", - "visTypeTimeseries.gauge.styleOptions.halfCircleLabel": "半円", - "visTypeTimeseries.getInterval.daysLabel": "日", - "visTypeTimeseries.getInterval.hoursLabel": "時間", - "visTypeTimeseries.getInterval.minutesLabel": "分", - "visTypeTimeseries.getInterval.monthsLabel": "か月", - "visTypeTimeseries.getInterval.secondsLabel": "秒", - "visTypeTimeseries.getInterval.weeksLabel": "週間", - "visTypeTimeseries.getInterval.yearsLabel": "年", - "visTypeTimeseries.handleErrorResponse.unexpectedError": "予期しないエラー", - "visTypeTimeseries.iconSelect.asteriskLabel": "アスタリスク", - "visTypeTimeseries.iconSelect.bellLabel": "ベル", - "visTypeTimeseries.iconSelect.boltLabel": "ボルト", - "visTypeTimeseries.iconSelect.bombLabel": "ボム", - "visTypeTimeseries.iconSelect.bugLabel": "バグ", - "visTypeTimeseries.iconSelect.commentLabel": "コメント", - "visTypeTimeseries.iconSelect.exclamationCircleLabel": "マル感嘆符", - "visTypeTimeseries.iconSelect.exclamationTriangleLabel": "注意三角マーク", - "visTypeTimeseries.iconSelect.fireLabel": "炎", - "visTypeTimeseries.iconSelect.flagLabel": "旗", - "visTypeTimeseries.iconSelect.heartLabel": "ハート", - "visTypeTimeseries.iconSelect.mapMarkerLabel": "マップマーカー", - "visTypeTimeseries.iconSelect.mapPinLabel": "マップピン", - "visTypeTimeseries.iconSelect.starLabel": "星", - "visTypeTimeseries.iconSelect.tagLabel": "タグ", - "visTypeTimeseries.indexPattern.detailLevel": "詳細レベル", - "visTypeTimeseries.indexPattern.detailLevelAriaLabel": "詳細レベル", - "visTypeTimeseries.indexPattern.detailLevelHelpText": "時間範囲に基づき自動間隔を制御します。デフォルトの間隔は詳細設定の{histogramTargetBars}と{histogramMaxBars}の影響を受けます。", - "visTypeTimeseries.indexPattern.dropLastBucketLabel": "最後のバケットをドロップしますか?", - "visTypeTimeseries.indexPattern.finest": "最も細かい", - "visTypeTimeseries.indexPattern.intervalHelpText": "例:auto、1m、1d、7d、1y、>=1m", - "visTypeTimeseries.indexPattern.intervalLabel": "間隔", - "visTypeTimeseries.indexPattern.timeFieldLabel": "時間フィールド", - "visTypeTimeseries.indexPattern.timeRange.entireTimeRange": "時間範囲全体", - "visTypeTimeseries.indexPattern.timeRange.error": "現在のインデックスタイプでは\"{mode}\"を使用できません。", - "visTypeTimeseries.indexPattern.timeRange.hint": "この設定は、一致するドキュメントに使用される期間をコントロールします。「時間範囲全体」は、タイムピッカーで選択されたすべてのドキュメントと照会します。「最終値」は、期間の終了時から指定期間のドキュメントのみと照会します。", - "visTypeTimeseries.indexPattern.timeRange.label": "データ期間モード", - "visTypeTimeseries.indexPattern.timeRange.lastValue": "最終値", - "visTypeTimeseries.indexPattern.timeRange.selectTimeRange": "選択してください", - "visTypeTimeseries.indexPattern.сoarse": "粗い", - "visTypeTimeseries.indexPatternSelect.createIndexPatternText": "インデックスパターンを作成", - "visTypeTimeseries.indexPatternSelect.defaultIndexPatternText": "デフォルトのインデックスパターンが使用されています。", - "visTypeTimeseries.indexPatternSelect.label": "インデックスパターン", - "visTypeTimeseries.indexPatternSelect.queryAllIndexesText": "すべてのインデックスにクエリを実行するには * を使用します", - "visTypeTimeseries.indexPatternSelect.switchModePopover.areaLabel": "インデックスパターン選択モードを構成", - "visTypeTimeseries.indexPatternSelect.switchModePopover.text": "インデックスパターンは、データ探索で対象とする1つ以上のElasticsearchインデックスを定義します。ElasticsearchインデックスまたはKibanaインデックスパターン (推奨) を使用できます。", - "visTypeTimeseries.indexPatternSelect.switchModePopover.title": "インデックスパターン選択モード", - "visTypeTimeseries.indexPatternSelect.switchModePopover.useKibanaIndices": "Kibanaインデックスパターンのみを使用", - "visTypeTimeseries.kbnVisTypes.metricsDescription": "時系列データの高度な分析を実行します。", - "visTypeTimeseries.kbnVisTypes.metricsTitle": "TSVB", - "visTypeTimeseries.lastValueModeIndicator.lastBucketDate": "バケット:{lastBucketDate}", - "visTypeTimeseries.lastValueModeIndicator.lastValue": "最終値", - "visTypeTimeseries.lastValueModeIndicator.lastValueModeBadgeAriaLabel": "最後の値の詳細を表示", - "visTypeTimeseries.lastValueModeIndicator.panelInterval": "間隔:{formattedPanelInterval}", - "visTypeTimeseries.lastValueModePopover.gearButton": "最終値のインジケーター表示オプションを変更", - "visTypeTimeseries.lastValueModePopover.switch": "最終値モードを使用するときにラベルを表示", - "visTypeTimeseries.lastValueModePopover.title": "最終値オプション", - "visTypeTimeseries.markdown.alignOptions.bottomLabel": "一番下", - "visTypeTimeseries.markdown.alignOptions.middleLabel": "真ん中", - "visTypeTimeseries.markdown.alignOptions.topLabel": "一番上", - "visTypeTimeseries.markdown.dataTab.dataButtonLabel": "データ", - "visTypeTimeseries.markdown.dataTab.metricsButtonLabel": "メトリック", - "visTypeTimeseries.markdown.editor.addSeriesTooltip": "数列を追加", - "visTypeTimeseries.markdown.editor.cloneSeriesTooltip": "数列のクローンを作成", - "visTypeTimeseries.markdown.editor.deleteSeriesTooltip": "数列を削除", - "visTypeTimeseries.markdown.editor.labelPlaceholder": "ラベル", - "visTypeTimeseries.markdown.editor.toggleEditorAriaLabel": "数列エディターを切り替える", - "visTypeTimeseries.markdown.editor.variableNamePlaceholder": "変数名", - "visTypeTimeseries.markdown.optionsTab.backgroundColorLabel": "背景色:", - "visTypeTimeseries.markdown.optionsTab.customCSSLabel": "カスタム CSS (Less をサポート) ", - "visTypeTimeseries.markdown.optionsTab.dataLabel": "データ", - "visTypeTimeseries.markdown.optionsTab.ignoreGlobalFilterLabel": "グローバルフィルターを無視しますか?", - "visTypeTimeseries.markdown.optionsTab.openLinksInNewTab": "新規タブでリンクを開きますか?", - "visTypeTimeseries.markdown.optionsTab.optionsButtonLabel": "オプション", - "visTypeTimeseries.markdown.optionsTab.panelFilterLabel": "パネルフィルター", - "visTypeTimeseries.markdown.optionsTab.panelOptionsButtonLabel": "パネルオプション", - "visTypeTimeseries.markdown.optionsTab.showScrollbarsLabel": "スクロールバーを表示しますか?", - "visTypeTimeseries.markdown.optionsTab.styleLabel": "スタイル", - "visTypeTimeseries.markdown.optionsTab.verticalAlignmentLabel": "縦の配列:", - "visTypeTimeseries.markdownEditor.howToAccessEntireTreeDescription": "{all} という特殊な変数もあり、ツリー全体へのアクセスに使用できます。これは group by からデータのリストを作成する際に便利です:", - "visTypeTimeseries.markdownEditor.howToUseVariablesInMarkdownDescription": "次の変数は Markdown で Handlebar (mustache) 構文を使用して使用できます。利用可能な表現は {handlebarLink} をご覧ください。", - "visTypeTimeseries.markdownEditor.howUseVariablesInMarkdownDescription.documentationLinkText": "ドキュメンテーションはここをクリックしてください", - "visTypeTimeseries.markdownEditor.nameLabel": "名前", - "visTypeTimeseries.markdownEditor.noVariablesAvailableDescription": "選択されたデータメトリックに利用可能な変数はありません。", - "visTypeTimeseries.markdownEditor.valueLabel": "値", - "visTypeTimeseries.math.aggregationLabel": "アグリゲーション", - "visTypeTimeseries.math.expressionDescription.tinyMathLinkText": "TinyMath", - "visTypeTimeseries.math.expressionLabel": "表現", - "visTypeTimeseries.math.variablesLabel": "変数", - "visTypeTimeseries.metric.dataTab.dataButtonLabel": "データ", - "visTypeTimeseries.metric.dataTab.metricsButtonLabel": "メトリック", - "visTypeTimeseries.metric.editor.addSeriesTooltip": "数列を追加", - "visTypeTimeseries.metric.editor.cloneSeriesTooltip": "数列のクローンを作成", - "visTypeTimeseries.metric.editor.deleteSeriesTooltip": "数列を削除", - "visTypeTimeseries.metric.editor.labelPlaceholder": "ラベル", - "visTypeTimeseries.metric.editor.toggleEditorAriaLabel": "数列エディターを切り替える", - "visTypeTimeseries.metric.optionsTab.colorRulesLabel": "カラールール", - "visTypeTimeseries.metric.optionsTab.dataLabel": "データ", - "visTypeTimeseries.metric.optionsTab.ignoreGlobalFilterLabel": "グローバルフィルターを無視しますか?", - "visTypeTimeseries.metric.optionsTab.optionsButtonLabel": "オプション", - "visTypeTimeseries.metric.optionsTab.panelFilterLabel": "パネルフィルター", - "visTypeTimeseries.metric.optionsTab.panelOptionsButtonLabel": "パネルオプション", - "visTypeTimeseries.metricMissingErrorMessage": "メトリックに {field} がありません", - "visTypeTimeseries.metricSelect.selectMetricPlaceholder": "メトリックを選択してください…", - "visTypeTimeseries.missingPanelConfigDescription": "「{modelType}」にパネル構成が欠けています", - "visTypeTimeseries.movingAverage.aggregationLabel": "アグリゲーション", - "visTypeTimeseries.movingAverage.alpha": "アルファ", - "visTypeTimeseries.movingAverage.beta": "ベータ", - "visTypeTimeseries.movingAverage.gamma": "ガンマ", - "visTypeTimeseries.movingAverage.metricLabel": "メトリック", - "visTypeTimeseries.movingAverage.model.selectPlaceholder": "選択してください", - "visTypeTimeseries.movingAverage.modelLabel": "モデル", - "visTypeTimeseries.movingAverage.modelOptions.exponentiallyWeightedLabel": "指数加重", - "visTypeTimeseries.movingAverage.modelOptions.holtLinearLabel": "Holt-Linear", - "visTypeTimeseries.movingAverage.modelOptions.holtWintersLabel": "Holt-Winters", - "visTypeTimeseries.movingAverage.modelOptions.linearLabel": "線形", - "visTypeTimeseries.movingAverage.modelOptions.simpleLabel": "シンプル", - "visTypeTimeseries.movingAverage.multiplicative": "マルチキャプティブ", - "visTypeTimeseries.movingAverage.multiplicative.selectPlaceholder": "選択してください", - "visTypeTimeseries.movingAverage.multiplicativeOptions.false": "False", - "visTypeTimeseries.movingAverage.multiplicativeOptions.true": "True", - "visTypeTimeseries.movingAverage.period": "期間", - "visTypeTimeseries.movingAverage.windowSizeHint": "ウィンドウは、必ず、期間のサイズの 2 倍以上でなければなりません", - "visTypeTimeseries.movingAverage.windowSizeLabel": "ウィンドウサイズ", - "visTypeTimeseries.noButtonLabel": "いいえ", - "visTypeTimeseries.percentile.aggregationLabel": "アグリゲーション", - "visTypeTimeseries.percentile.fieldLabel": "フィールド", - "visTypeTimeseries.percentile.fillToLabel": "次の基準に合わせる:", - "visTypeTimeseries.percentile.modeLabel": "モード:", - "visTypeTimeseries.percentile.modeOptions.bandLabel": "帯", - "visTypeTimeseries.percentile.modeOptions.lineLabel": "折れ線", - "visTypeTimeseries.percentile.percentile": "パーセンタイル", - "visTypeTimeseries.percentile.percentileAriaLabel": "パーセンタイル", - "visTypeTimeseries.percentile.percents": "パーセント", - "visTypeTimeseries.percentile.shadeLabel": "シェイド (0 から 1) :", - "visTypeTimeseries.percentileHdr.numberOfSignificantValueDigits": "大きい値の桁数 (HDR ヒストグラム) ", - "visTypeTimeseries.percentileHdr.numberOfSignificantValueDigits.hint": "HDR ヒストグラム (ハイダイナミックレンジヒストグラム) は、レイテンシ測定のパーセンタイルランクを計算するときに役立つ別の実装方法です。メモリ消費量が多いというトレードオフがある t-digest 実装よりも高速になります。大きい値の桁数パラメーターは、大きい桁数のヒストグラムで値の解像度を指定します。", - "visTypeTimeseries.percentileRank.aggregationLabel": "アグリゲーション", - "visTypeTimeseries.percentileRank.fieldLabel": "フィールド", - "visTypeTimeseries.percentileRank.values": "値", - "visTypeTimeseries.positiveOnly.aggregationLabel": "アグリゲーション", - "visTypeTimeseries.positiveOnly.metricLabel": "メトリック", - "visTypeTimeseries.positiveRate.aggregationLabel": "アグリゲーション", - "visTypeTimeseries.positiveRate.helpText": "このアグリゲーションは、{link}にのみ適用してください。これは、最大値、微分、正の値のみを適用するショートカットです。", - "visTypeTimeseries.positiveRate.helpTextLink": "単調に数値を増加しています", - "visTypeTimeseries.positiveRate.unitSelectPlaceholder": "スケールを選択...", - "visTypeTimeseries.positiveRate.unitsLabel": "スケール", - "visTypeTimeseries.postiveRate.fieldLabel": "フィールド", - "visTypeTimeseries.replaceVars.errors.markdownErrorDescription": "Markdown、既知の変数、ビルトイン Handlebars 表現のみが使用されていることを確認してください。", - "visTypeTimeseries.replaceVars.errors.markdownErrorTitle": "Markdown の処理中にエラーが発生", - "visTypeTimeseries.replaceVars.errors.unknownVarDescription": "{badVar} は不明な変数です", - "visTypeTimeseries.replaceVars.errors.unknownVarTitle": "Markdown の処理中にエラーが発生", - "visTypeTimeseries.searchStrategyUndefinedErrorMessage": "検索ストラテジが定義されていませんでした", - "visTypeTimeseries.serialDiff.aggregationLabel": "アグリゲーション", - "visTypeTimeseries.serialDiff.lagLabel": "ラグ", - "visTypeTimeseries.serialDiff.metricLabel": "メトリック", - "visTypeTimeseries.series.missingAggregationKeyErrorMessage": "返答から集約キーが欠けています。このリクエストのパーミッションを確認してください。", - "visTypeTimeseries.series.shouldOneSeriesPerRequestErrorMessage": "1 つのリクエストに複数の数列を含めることはできません。", - "visTypeTimeseries.seriesAgg.aggregationLabel": "アグリゲーション", - "visTypeTimeseries.seriesAgg.functionLabel": "関数", - "visTypeTimeseries.seriesAgg.functionOptions.avgLabel": "平均", - "visTypeTimeseries.seriesAgg.functionOptions.countLabel": "系列数", - "visTypeTimeseries.seriesAgg.functionOptions.cumulativeSumLabel": "累積和", - "visTypeTimeseries.seriesAgg.functionOptions.maxLabel": "最高", - "visTypeTimeseries.seriesAgg.functionOptions.minLabel": "最低", - "visTypeTimeseries.seriesAgg.functionOptions.overallAvgLabel": "全体平均", - "visTypeTimeseries.seriesAgg.functionOptions.overallMaxLabel": "全体最高", - "visTypeTimeseries.seriesAgg.functionOptions.overallMinLabel": "全体最低", - "visTypeTimeseries.seriesAgg.functionOptions.overallSumLabel": "全体合計", - "visTypeTimeseries.seriesAgg.functionOptions.sumLabel": "合計", - "visTypeTimeseries.seriesAgg.seriesAggIsNotCompatibleLabel": "数列集約は表の可視化に対応していません。", - "visTypeTimeseries.seriesConfig.filterLabel": "フィルター", - "visTypeTimeseries.seriesConfig.ignoreGlobalFilterDisabledTooltip": "グローバルフィルターはパネルオプションで無視されるため、これは無効です。", - "visTypeTimeseries.seriesConfig.ignoreGlobalFilterLabel": "グローバルフィルターを無視しますか?", - "visTypeTimeseries.seriesConfig.missingSeriesComponentDescription": "パネルタイプ {panelType} の数列コンポーネントが欠けています", - "visTypeTimeseries.seriesConfig.offsetSeriesTimeLabel": "数列の時間を (1m, 1h, 1w, 1d) でオフセット", - "visTypeTimeseries.seriesConfig.overrideIndexPatternLabel": "インデックスパターンを上書きしますか?", - "visTypeTimeseries.seriesConfig.templateHelpText": "例:{templateExample}", - "visTypeTimeseries.seriesConfig.templateLabel": "テンプレート", - "visTypeTimeseries.sort.dragToSortAriaLabel": "ドラッグして並べ替えます", - "visTypeTimeseries.sort.dragToSortTooltip": "ドラッグして並べ替えます", - "visTypeTimeseries.splits.everything.groupByLabel": "グループ分けの条件", - "visTypeTimeseries.splits.filter.groupByLabel": "グループ分けの条件", - "visTypeTimeseries.splits.filter.queryStringLabel": "クエリ文字列", - "visTypeTimeseries.splits.filterItems.labelAriaLabel": "ラベル", - "visTypeTimeseries.splits.filterItems.labelPlaceholder": "ラベル", - "visTypeTimeseries.splits.filters.groupByLabel": "グループ分けの条件", - "visTypeTimeseries.splits.groupBySelect.modeOptions.everythingLabel": "すべて", - "visTypeTimeseries.splits.groupBySelect.modeOptions.filterLabel": "フィルター", - "visTypeTimeseries.splits.groupBySelect.modeOptions.filtersLabel": "フィルター", - "visTypeTimeseries.splits.groupBySelect.modeOptions.termsLabel": "用語", - "visTypeTimeseries.splits.terms.byLabel": "グループ基準", - "visTypeTimeseries.splits.terms.defaultCountLabel": "ドキュメントカウント (デフォルト) ", - "visTypeTimeseries.splits.terms.directionLabel": "方向", - "visTypeTimeseries.splits.terms.dirOptions.ascendingLabel": "昇順", - "visTypeTimeseries.splits.terms.dirOptions.descendingLabel": "降順", - "visTypeTimeseries.splits.terms.excludeLabel": "除外", - "visTypeTimeseries.splits.terms.groupByLabel": "グループ分けの条件", - "visTypeTimeseries.splits.terms.includeLabel": "含める", - "visTypeTimeseries.splits.terms.orderByLabel": "並び順", - "visTypeTimeseries.splits.terms.sizePlaceholder": "サイズ", - "visTypeTimeseries.splits.terms.termsLabel": "用語", - "visTypeTimeseries.splits.terms.topLabel": "一番上", - "visTypeTimeseries.static.aggregationLabel": "アグリゲーション", - "visTypeTimeseries.static.staticValuesLabel": "固定値", - "visTypeTimeseries.stdAgg.aggregationLabel": "アグリゲーション", - "visTypeTimeseries.stdAgg.fieldLabel": "フィールド", - "visTypeTimeseries.stdDeviation.aggregationLabel": "アグリゲーション", - "visTypeTimeseries.stdDeviation.fieldLabel": "フィールド", - "visTypeTimeseries.stdDeviation.modeLabel": "モード", - "visTypeTimeseries.stdDeviation.modeOptions.boundsBandLabel": "境界バンド", - "visTypeTimeseries.stdDeviation.modeOptions.lowerBoundLabel": "下の境界", - "visTypeTimeseries.stdDeviation.modeOptions.rawLabel": "未加工", - "visTypeTimeseries.stdDeviation.modeOptions.upperBoundLabel": "上の境界", - "visTypeTimeseries.stdDeviation.sigmaLabel": "シグマ", - "visTypeTimeseries.stdSibling.aggregationLabel": "アグリゲーション", - "visTypeTimeseries.stdSibling.metricLabel": "メトリック", - "visTypeTimeseries.stdSibling.modeLabel": "モード", - "visTypeTimeseries.stdSibling.modeOptions.boundsBandLabel": "境界バンド", - "visTypeTimeseries.stdSibling.modeOptions.lowerBoundLabel": "下の境界", - "visTypeTimeseries.stdSibling.modeOptions.rawLabel": "未加工", - "visTypeTimeseries.stdSibling.modeOptions.upperBoundLabel": "上の境界", - "visTypeTimeseries.stdSibling.sigmaLabel": "シグマ", - "visTypeTimeseries.table.addSeriesTooltip": "数列を追加", - "visTypeTimeseries.table.aggregateFunctionLabel": "集約関数", - "visTypeTimeseries.table.avgLabel": "平均", - "visTypeTimeseries.table.cloneSeriesTooltip": "数列のクローンを作成", - "visTypeTimeseries.table.colorRulesLabel": "カラールール", - "visTypeTimeseries.table.columnNotSortableTooltip": "この列は並べ替えできません", - "visTypeTimeseries.table.cumulativeSumLabel": "累積和", - "visTypeTimeseries.table.dataTab.columnLabel": "列ラベル", - "visTypeTimeseries.table.dataTab.columnsButtonLabel": "列", - "visTypeTimeseries.table.dataTab.defineFieldDescription": "表の可視化は、用語集約でグループ分けの基準となるフィールドを定義する必要があります。", - "visTypeTimeseries.table.dataTab.groupByFieldLabel": "フィールドでグループ分け", - "visTypeTimeseries.table.dataTab.rowsLabel": "行", - "visTypeTimeseries.table.deleteSeriesTooltip": "数列を削除", - "visTypeTimeseries.table.fieldLabel": "フィールド", - "visTypeTimeseries.table.filterLabel": "フィルター", - "visTypeTimeseries.table.labelAriaLabel": "ラベル", - "visTypeTimeseries.table.labelPlaceholder": "ラベル", - "visTypeTimeseries.table.maxLabel": "最高", - "visTypeTimeseries.table.minLabel": "最低", - "visTypeTimeseries.table.noResultsAvailableMessage": "結果がありません。", - "visTypeTimeseries.table.noResultsAvailableWithDescriptionMessage": "結果がありません。このビジュアライゼーションは、フィールドでグループを選択する必要があります。", - "visTypeTimeseries.table.optionsTab.dataLabel": "データ", - "visTypeTimeseries.table.optionsTab.ignoreGlobalFilterLabel": "グローバルフィルターを無視しますか?", - "visTypeTimeseries.table.optionsTab.itemUrlHelpText": "これは mustache テンプレートをサポートしています。{key} が用語に設定されています。", - "visTypeTimeseries.table.optionsTab.itemUrlLabel": "アイテム URL", - "visTypeTimeseries.table.optionsTab.panelFilterLabel": "パネルフィルター", - "visTypeTimeseries.table.optionsTab.panelOptionsButtonLabel": "パネルオプション", - "visTypeTimeseries.table.overallAvgLabel": "全体平均", - "visTypeTimeseries.table.overallMaxLabel": "全体最高", - "visTypeTimeseries.table.overallMinLabel": "全体最低", - "visTypeTimeseries.table.overallSumLabel": "全体合計", - "visTypeTimeseries.table.showTrendArrowsLabel": "傾向矢印を表示しますか?", - "visTypeTimeseries.table.sumLabel": "合計", - "visTypeTimeseries.table.tab.metricsLabel": "メトリック", - "visTypeTimeseries.table.tab.optionsLabel": "オプション", - "visTypeTimeseries.table.templateHelpText": "eg.{templateExample}", - "visTypeTimeseries.table.templateLabel": "テンプレート", - "visTypeTimeseries.table.toggleSeriesEditorAriaLabel": "数列エディターを切り替える", - "visTypeTimeseries.timeSeries.addSeriesTooltip": "数列を追加", - "visTypeTimeseries.timeseries.annotationsTab.annotationsButtonLabel": "注釈", - "visTypeTimeseries.timeSeries.axisMaxLabel": "軸最大値", - "visTypeTimeseries.timeSeries.axisMinLabel": "軸最小値", - "visTypeTimeseries.timeSeries.axisPositionLabel": "軸の配置", - "visTypeTimeseries.timeSeries.barLabel": "バー", - "visTypeTimeseries.timeSeries.chartBar.chartTypeLabel": "チャートタイプ", - "visTypeTimeseries.timeSeries.chartBar.fillLabel": "塗りつぶし (0 から 1) ", - "visTypeTimeseries.timeSeries.chartBar.lineWidthLabel": "線の幅", - "visTypeTimeseries.timeSeries.chartBar.stackedLabel": "スタック", - "visTypeTimeseries.timeSeries.chartLine.chartTypeLabel": "チャートタイプ", - "visTypeTimeseries.timeSeries.chartLine.fillLabel": "塗りつぶし (0 から 1) ", - "visTypeTimeseries.timeSeries.chartLine.lineWidthLabel": "線の幅", - "visTypeTimeseries.timeSeries.chartLine.pointSizeLabel": "点のサイズ", - "visTypeTimeseries.timeSeries.chartLine.stackedLabel": "スタック", - "visTypeTimeseries.timeSeries.chartLine.stepsLabel": "ステップ", - "visTypeTimeseries.timeSeries.cloneSeriesTooltip": "数列のクローンを作成", - "visTypeTimeseries.timeseries.dataTab.dataButtonLabel": "データ", - "visTypeTimeseries.timeSeries.deleteSeriesTooltip": "数列を削除", - "visTypeTimeseries.timeSeries.gradientLabel": "グラデーション", - "visTypeTimeseries.timeSeries.hideInLegendLabel": "凡例で非表示", - "visTypeTimeseries.timeSeries.labelPlaceholder": "ラベル", - "visTypeTimeseries.timeSeries.leftLabel": "左", - "visTypeTimeseries.timeseries.legendPositionOptions.bottomLabel": "一番下", - "visTypeTimeseries.timeseries.legendPositionOptions.leftLabel": "左", - "visTypeTimeseries.timeseries.legendPositionOptions.rightLabel": "右", - "visTypeTimeseries.timeSeries.lineLabel": "折れ線", - "visTypeTimeseries.timeSeries.noneLabel": "なし", - "visTypeTimeseries.timeSeries.offsetSeriesTimeLabel": "数列の時間を (1m, 1h, 1w, 1d) でオフセット", - "visTypeTimeseries.timeseries.optionsTab.axisMaxLabel": "軸最大値", - "visTypeTimeseries.timeseries.optionsTab.axisMinLabel": "軸最小値", - "visTypeTimeseries.timeseries.optionsTab.axisPositionLabel": "軸の配置", - "visTypeTimeseries.timeseries.optionsTab.axisScaleLabel": "軸のスケール", - "visTypeTimeseries.timeseries.optionsTab.backgroundColorLabel": "背景色:", - "visTypeTimeseries.timeseries.optionsTab.dataLabel": "データ", - "visTypeTimeseries.timeseries.optionsTab.displayGridLabel": "グリッドを表示", - "visTypeTimeseries.timeseries.optionsTab.ignoreDaylightTimeLabel": "夏時間を無視しますか?", - "visTypeTimeseries.timeseries.optionsTab.ignoreGlobalFilterLabel": "グローバルフィルターを無視しますか?", - "visTypeTimeseries.timeseries.optionsTab.legendPositionLabel": "凡例の配置", - "visTypeTimeseries.timeseries.optionsTab.panelFilterLabel": "パネルフィルター", - "visTypeTimeseries.timeseries.optionsTab.panelOptionsButtonLabel": "パネルオプション", - "visTypeTimeseries.timeseries.optionsTab.showLegendLabel": "凡例を表示しますか?", - "visTypeTimeseries.timeseries.optionsTab.styleLabel": "スタイル", - "visTypeTimeseries.timeseries.optionsTab.tooltipMode": "ツールチップ", - "visTypeTimeseries.timeSeries.overrideIndexPatternLabel": "インデックスパターンを上書きしますか?", - "visTypeTimeseries.timeSeries.percentLabel": "パーセント", - "visTypeTimeseries.timeseries.positionOptions.leftLabel": "左", - "visTypeTimeseries.timeseries.positionOptions.rightLabel": "右", - "visTypeTimeseries.timeSeries.rainbowLabel": "虹", - "visTypeTimeseries.timeSeries.rightLabel": "右", - "visTypeTimeseries.timeseries.scaleOptions.logLabel": "ログ", - "visTypeTimeseries.timeseries.scaleOptions.normalLabel": "標準", - "visTypeTimeseries.timeSeries.separateAxisLabel": "軸を分けますか?", - "visTypeTimeseries.timeSeries.splitColorThemeLabel": "カラーテーマを分割", - "visTypeTimeseries.timeSeries.stackedLabel": "スタック", - "visTypeTimeseries.timeSeries.stackedWithinSeriesLabel": "数列内でスタック", - "visTypeTimeseries.timeSeries.tab.metricsLabel": "メトリック", - "visTypeTimeseries.timeSeries.tab.optionsLabel": "オプション", - "visTypeTimeseries.timeSeries.templateHelpText": "eg.{templateExample}", - "visTypeTimeseries.timeSeries.templateLabel": "テンプレート", - "visTypeTimeseries.timeSeries.toggleSeriesEditorAriaLabel": "数列エディターを切り替える", - "visTypeTimeseries.timeseries.tooltipOptions.showAll": "すべての値を表示", - "visTypeTimeseries.timeseries.tooltipOptions.showFocused": "フォーカスされた値を表示", - "visTypeTimeseries.topHit.aggregateWith.selectPlaceholder": "選択してください...", - "visTypeTimeseries.topHit.aggregateWithLabel": "集約:", - "visTypeTimeseries.topHit.aggregationLabel": "アグリゲーション", - "visTypeTimeseries.topHit.aggWithOptions.averageLabel": "平均", - "visTypeTimeseries.topHit.aggWithOptions.concatenate": "連結", - "visTypeTimeseries.topHit.aggWithOptions.maxLabel": "最高", - "visTypeTimeseries.topHit.aggWithOptions.minLabel": "最低", - "visTypeTimeseries.topHit.aggWithOptions.sumLabel": "合計", - "visTypeTimeseries.topHit.fieldLabel": "フィールド", - "visTypeTimeseries.topHit.order.selectPlaceholder": "選択してください...", - "visTypeTimeseries.topHit.orderByLabel": "並び順", - "visTypeTimeseries.topHit.orderLabel": "順序", - "visTypeTimeseries.topHit.orderOptions.ascLabel": "昇順", - "visTypeTimeseries.topHit.orderOptions.descLabel": "降順", - "visTypeTimeseries.topHit.sizeLabel": "サイズ", - "visTypeTimeseries.topN.addSeriesTooltip": "数列を追加", - "visTypeTimeseries.topN.cloneSeriesTooltip": "数列のクローンを作成", - "visTypeTimeseries.topN.dataTab.dataButtonLabel": "データ", - "visTypeTimeseries.topN.deleteSeriesTooltip": "数列を削除", - "visTypeTimeseries.topN.labelPlaceholder": "ラベル", - "visTypeTimeseries.topN.optionsTab.backgroundColorLabel": "背景色:", - "visTypeTimeseries.topN.optionsTab.colorRulesLabel": "カラールール", - "visTypeTimeseries.topN.optionsTab.dataLabel": "データ", - "visTypeTimeseries.topN.optionsTab.ignoreGlobalFilterLabel": "グローバルフィルターを無視しますか?", - "visTypeTimeseries.topN.optionsTab.itemUrlDescription": "これは mustache テンプレートをサポートしています。{key} が用語に設定されています。", - "visTypeTimeseries.topN.optionsTab.itemUrlLabel": "アイテム URL", - "visTypeTimeseries.topN.optionsTab.panelFilterLabel": "パネルフィルター", - "visTypeTimeseries.topN.optionsTab.panelOptionsButtonLabel": "パネルオプション", - "visTypeTimeseries.topN.optionsTab.styleLabel": "スタイル", - "visTypeTimeseries.topN.tab.metricsLabel": "メトリック", - "visTypeTimeseries.topN.tab.optionsLabel": "オプション", - "visTypeTimeseries.topN.toggleSeriesEditorAriaLabel": "数列エディターを切り替える", - "visTypeTimeseries.units.auto": "自動", - "visTypeTimeseries.units.perDay": "日単位", - "visTypeTimeseries.units.perHour": "時間単位", - "visTypeTimeseries.units.perMillisecond": "ミリ秒単位", - "visTypeTimeseries.units.perMinute": "分単位", - "visTypeTimeseries.units.perSecond": "秒単位", - "visTypeTimeseries.unsupportedAgg.aggIsNotSupportedDescription": "{modelType} 集約はサポートされなくなりました。", - "visTypeTimeseries.unsupportedAgg.aggIsTemporaryUnsupportedDescription": "{modelType} 集約は現在サポートされていません。", - "visTypeTimeseries.unsupportedSplit.splitIsUnsupportedDescription": "{modelType} での分割はサポートされていません。", - "visTypeTimeseries.validateInterval.notifier.maxBucketsExceededErrorMessage": "クエリが取得を試みたデータが多すぎます。通常、時間範囲を狭くするか、使用される間隔を変更すると、問題が解決します。", - "visTypeTimeseries.vars.variableNameAriaLabel": "変数名", - "visTypeTimeseries.vars.variableNamePlaceholder": "変数名", - "visTypeTimeseries.visEditorVisualization.applyChangesLabel": "変更を適用", - "visTypeTimeseries.visEditorVisualization.autoApplyLabel": "自動適用", - "visTypeTimeseries.visEditorVisualization.changesHaveNotBeenAppliedMessage": "ビジュアライゼーションへの変更が適用されました。", - "visTypeTimeseries.visEditorVisualization.changesSuccessfullyAppliedMessage": "最新の変更が適用されました。", - "visTypeTimeseries.visEditorVisualization.changesWillBeAutomaticallyAppliedMessage": "変更が自動的に適用されます。", - "visTypeTimeseries.visEditorVisualization.indexPatternMode.dismissNoticeButtonText": "閉じる", - "visTypeTimeseries.visEditorVisualization.indexPatternMode.link": "確認してください。", - "visTypeTimeseries.visEditorVisualization.indexPatternMode.notificationMessage": "お知らせElasticsearchインデックスまたはKibanaインデックスパターンからデータを可視化できるようになりました。{indexPatternModeLink}。", - "visTypeTimeseries.visEditorVisualization.indexPatternMode.notificationTitle": "TSVBはインデックスパターンをサポートします", - "visTypeTimeseries.visPicker.gaugeLabel": "ゲージ", - "visTypeTimeseries.visPicker.metricLabel": "メトリック", - "visTypeTimeseries.visPicker.tableLabel": "表", - "visTypeTimeseries.visPicker.timeSeriesLabel": "時系列", - "visTypeTimeseries.visPicker.topNLabel": "トップ N", - "visTypeTimeseries.yesButtonLabel": "はい", - "visTypeVega.editor.formatError": "仕様のフォーマット中にエラーが発生", - "visTypeVega.editor.reformatAsHJSONButtonLabel": "HJSON に変換", - "visTypeVega.editor.reformatAsJSONButtonLabel": "JSON に変換しコメントを削除", - "visTypeVega.editor.vegaDocumentationLinkText": "Vega ドキュメント", - "visTypeVega.editor.vegaEditorOptionsButtonAriaLabel": "Vega エディターオプション", - "visTypeVega.editor.vegaHelpButtonAriaLabel": "Vega ヘルプ", - "visTypeVega.editor.vegaHelpLinkText": "Kibana Vega ヘルプ", - "visTypeVega.editor.vegaLiteDocumentationLinkText": "Vega-Lite ドキュメンテーション", - "visTypeVega.emsFileParser.emsFileNameDoesNotExistErrorMessage": "{emsfile} {emsfileName} が存在しません", - "visTypeVega.emsFileParser.missingNameOfFileErrorMessage": "{dataUrlParamValue} の {dataUrlParam} には {nameParam} パラメーター (ファイル名) が必要です", - "visTypeVega.esQueryParser.autointervalValueTypeErrorMessage": "{autointerval} は文字 {trueValue} または数字である必要があります", - "visTypeVega.esQueryParser.dataUrlMustNotHaveLegacyAndBodyQueryValuesAtTheSameTimeErrorMessage": "{dataUrlParam} はレガシー {legacyContext} と {bodyQueryConfigName} の値を同時に含めることができません。", - "visTypeVega.esQueryParser.dataUrlMustNotHaveLegacyContextTogetherWithContextOrTimefieldErrorMessage": "{dataUrlParam} は {legacyContext} と同時に {context} または {timefield} を含めることができません", - "visTypeVega.esQueryParser.legacyContextCanBeTrueErrorMessage": "レガシー {legacyContext} は {trueValue} (時間範囲ピッカーを無視) 、または時間フィールドの名前のどちらかです。例:{timestampParam}", - "visTypeVega.esQueryParser.legacyUrlShouldChangeToWarningMessage": "レガシー {urlParam}: {legacyUrl} を {result} に変更する必要があります", - "visTypeVega.esQueryParser.shiftMustValueTypeErrorMessage": "{shiftParam} は数値でなければなりません", - "visTypeVega.esQueryParser.timefilterValueErrorMessage": "{timefilter} のプロパティは {trueValue}、{minValue}、または {maxValue} に設定する必要があります", - "visTypeVega.esQueryParser.unknownUnitValueErrorMessage": "不明な {unitParamName} 値。次のいずれかでなければなりません。[{unitParamValues}]", - "visTypeVega.esQueryParser.unnamedRequest": "無題のリクエスト#{index}", - "visTypeVega.esQueryParser.urlBodyValueTypeErrorMessage": "{configName} はオブジェクトでなければなりません", - "visTypeVega.esQueryParser.urlContextAndUrlTimefieldMustNotBeUsedErrorMessage": "{urlContext} と {timefield} は {queryParam} が設定されている場合使用できません", - "visTypeVega.function.help": "Vega ビジュアライゼーション", - "visTypeVega.inspector.dataSetsLabel": "データセット", - "visTypeVega.inspector.dataViewer.dataSetAriaLabel": "データセット", - "visTypeVega.inspector.dataViewer.gridAriaLabel": "{name}データグリッド", - "visTypeVega.inspector.signalValuesLabel": "単一の値", - "visTypeVega.inspector.signalViewer.gridAriaLabel": "単一の値のデータグリッド", - "visTypeVega.inspector.specLabel": "仕様", - "visTypeVega.inspector.specViewer.copyToClipboardLabel": "クリップボードにコピー", - "visTypeVega.inspector.vegaAdapter.signal": "信号", - "visTypeVega.inspector.vegaAdapter.value": "値", - "visTypeVega.inspector.vegaDebugLabel": "Vegaデバッグ", - "visTypeVega.mapView.experimentalMapLayerInfo": "マップレイヤーはまだ実験段階であり、オフィシャルGA機能のサポートSLAが適用されません。フィードバックがある場合は、{githubLink}で問題を報告してください。", - "visTypeVega.mapView.mapStyleNotFoundWarningMessage": "{mapStyleParam} が見つかりませんでした", - "visTypeVega.mapView.minZoomAndMaxZoomHaveBeenSwappedWarningMessage": "{minZoomPropertyName} と {maxZoomPropertyName} が交換されました", - "visTypeVega.mapView.resettingPropertyToMaxValueWarningMessage": "{name} を {max} にリセットしています", - "visTypeVega.mapView.resettingPropertyToMinValueWarningMessage": "{name} を {min} にリセットしています", - "visTypeVega.type.vegaDescription": "Vega を使用して、新しいタイプのビジュアライゼーションを作成します。", - "visTypeVega.type.vegaNote": "Vega 構文の知識が必要です。", - "visTypeVega.type.vegaTitleInWizard": "カスタムビジュアライゼーション", - "visTypeVega.urlParser.dataUrlRequiresUrlParameterInFormErrorMessage": "{dataUrlParam} には「{formLink}」の形で {urlParam} パラメーターが必要です", - "visTypeVega.urlParser.urlShouldHaveQuerySubObjectWarningMessage": "{urlObject} を使用するには {subObjectName} サブオブジェクトが必要です", - "visTypeVega.vegaParser.autoSizeDoesNotAllowFalse": "{autoSizeParam}が有効です。無効にするには、{autoSizeParam}を{noneParam}に設定してください", - "visTypeVega.vegaParser.baseView.externalUrlsAreNotEnabledErrorMessage": "外部 URL が無効です。{enableExternalUrls} を {kibanaConfigFileName} に追加", - "visTypeVega.vegaParser.baseView.functionIsNotDefinedForGraphErrorMessage": "このグラフには {funcName} が定義されていません", - "visTypeVega.vegaParser.baseView.indexNotFoundErrorMessage": "インデックス {index} が見つかりません", - "visTypeVega.vegaParser.baseView.timeValuesTypeErrorMessage": "時間フィルターの設定エラー:両方の時間の値は相対的または絶対的な日付である必要があります。 {start}、{end}", - "visTypeVega.vegaParser.baseView.unableToFindDefaultIndexErrorMessage": "デフォルトのインデックスが見つかりません", - "visTypeVega.vegaParser.centerOnMarkConfigValueTypeErrorMessage": "{configName} は {trueValue}、{falseValue}、または数字でなければなりません", - "visTypeVega.vegaParser.dataExceedsSomeParamsUseTimesLimitErrorMessage": "データには {urlParam}、{valuesParam}、 {sourceParam} の内複数を含めることができません", - "visTypeVega.vegaParser.hostConfigIsDeprecatedWarningMessage": "{deprecatedConfigName} は廃止されました。代わりに {newConfigName} を使用します。", - "visTypeVega.vegaParser.hostConfigValueTypeErrorMessage": "{configName} が含まれている場合、オブジェクトでなければなりません", - "visTypeVega.vegaParser.inputSpecDoesNotSpecifySchemaErrorMessage": "仕様に基づき、{schemaParam}フィールドには、\nVega ({vegaSchemaUrl}を参照) または\nVega-Lite ({vegaLiteSchemaUrl}を参照) の有効なURLを入力する必要があります。\nURLは識別子にすぎません。Kibanaやご使用のブラウザーがこのURLにアクセスすることはありません。", - "visTypeVega.vegaParser.invalidVegaSpecErrorMessage": "無効な Vega 仕様", - "visTypeVega.vegaParser.kibanaConfigValueTypeErrorMessage": "{configName} が含まれている場合、オブジェクトでなければなりません", - "visTypeVega.vegaParser.maxBoundsValueTypeWarningMessage": "{maxBoundsConfigName} は 4 つの数字の配列でなければなりません", - "visTypeVega.vegaParser.notSupportedUrlTypeErrorMessage": "{urlObject} はサポートされていません", - "visTypeVega.vegaParser.notValidLibraryVersionForInputSpecWarningMessage": "インプット仕様に {schemaLibrary} {schemaVersion} が使用されていますが、現在のバージョンの {schemaLibrary} は {libraryVersion} です。", - "visTypeVega.vegaParser.paddingConfigValueTypeErrorMessage": "{configName} は数字でなければなりません", - "visTypeVega.vegaParser.someKibanaConfigurationIsNoValidWarningMessage": "{configName} は有効ではありません", - "visTypeVega.vegaParser.someKibanaParamValueTypeWarningMessage": "{configName} はブール値でなければなりません", - "visTypeVega.vegaParser.textTruncateConfigValueTypeErrorMessage": "{configName} はブール値でなければなりません", - "visTypeVega.vegaParser.unexpectedValueForPositionConfigurationErrorMessage": "{configurationName} 構成に予期せぬ値が使用されています", - "visTypeVega.vegaParser.unrecognizedControlsLocationValueErrorMessage": "認識されていない {controlsLocationParam} 値。[{locToDirMap}] のいずれかが想定されます。", - "visTypeVega.vegaParser.unrecognizedDirValueErrorMessage": "認識されていない {dirParam} 値。[{expectedValues}] のいずれかが想定されます。", - "visTypeVega.vegaParser.VLCompilerShouldHaveGeneratedSingleProtectionObjectErrorMessage": "内部エラー:Vega-Lite コンパイラーがシングルプロジェクションオブジェクトを生成したはずです", - "visTypeVega.vegaParser.widthAndHeightParamsAreIgnored": "{autoSizeParam}が有効であるため、{widthParam}および{heightParam}パラメーターは無視されます。無効にする{autoSizeParam}: {noneParam}を設定", - "visTypeVega.vegaParser.widthAndHeightParamsAreRequired": "{autoSizeParam}が{noneParam}に設定されているときには、カットまたは繰り返された{vegaLiteParam}仕様を使用している間に何も表示されません。修正するには、{autoSizeParam}を削除するか、{vegaParam}を使用してください。", - "visTypeVega.visualization.renderErrorTitle": "Vega エラー", - "visTypeVega.visualization.unableToRenderWithoutDataWarningMessage": "データなしにはレンダリングできません", - "visTypeVislib.advancedSettings.visualization.dimmingOpacityText": "チャートの別のエレメントが選択された時に暗くなるチャート項目の透明度です。この数字が小さければ小さいほど、ハイライトされたエレメントが目立ちます。0と1の間の数字で設定します。", - "visTypeVislib.advancedSettings.visualization.dimmingOpacityTitle": "減光透明度", - "visTypeVislib.advancedSettings.visualization.heatmap.maxBucketsText": "1つのデータソースが返せるバケットの最大数です。値が大きいとブラウザのレンダリング速度が下がる可能性があります。", - "visTypeVislib.advancedSettings.visualization.heatmap.maxBucketsTitle": "ヒートマップの最大バケット数", - "visTypeVislib.aggResponse.allDocsTitle": "すべてのドキュメント", - "visTypeVislib.controls.gaugeOptions.alignmentLabel": "アラインメント", - "visTypeVislib.controls.gaugeOptions.autoExtendRangeLabel": "範囲を自動拡張", - "visTypeVislib.controls.gaugeOptions.displayWarningsLabel": "警告を表示", - "visTypeVislib.controls.gaugeOptions.extendRangeTooltip": "範囲をデータの最高値に広げます。", - "visTypeVislib.controls.gaugeOptions.gaugeTypeLabel": "ゲージタイプ", - "visTypeVislib.controls.gaugeOptions.labelsTitle": "ラベル", - "visTypeVislib.controls.gaugeOptions.rangesTitle": "範囲", - "visTypeVislib.controls.gaugeOptions.showLabelsLabel": "ラベルを表示", - "visTypeVislib.controls.gaugeOptions.showLegendLabel": "凡例を表示", - "visTypeVislib.controls.gaugeOptions.showOutline": "アウトラインを表示", - "visTypeVislib.controls.gaugeOptions.showScaleLabel": "縮尺を表示", - "visTypeVislib.controls.gaugeOptions.styleTitle": "スタイル", - "visTypeVislib.controls.gaugeOptions.subTextLabel": "サブラベル", - "visTypeVislib.controls.gaugeOptions.switchWarningsTooltip": "警告のオン/オフを切り替えます。オンにすると、すべてのラベルを表示できない際に警告が表示されます。", - "visTypeVislib.controls.heatmapOptions.colorLabel": "色", - "visTypeVislib.controls.heatmapOptions.colorScaleLabel": "カラースケール", - "visTypeVislib.controls.heatmapOptions.colorsNumberLabel": "色の数", - "visTypeVislib.controls.heatmapOptions.labelsTitle": "ラベル", - "visTypeVislib.controls.heatmapOptions.overwriteAutomaticColorLabel": "自動カラーを上書きする", - "visTypeVislib.controls.heatmapOptions.rotateLabel": "回転", - "visTypeVislib.controls.heatmapOptions.scaleToDataBoundsLabel": "データバウンドに合わせる", - "visTypeVislib.controls.heatmapOptions.showLabelsTitle": "ラベルを表示", - "visTypeVislib.controls.heatmapOptions.useCustomRangesLabel": "カスタム範囲を使用", - "visTypeVislib.editors.heatmap.basicSettingsTitle": "基本設定", - "visTypeVislib.editors.heatmap.heatmapSettingsTitle": "ヒートマップ設定", - "visTypeVislib.editors.heatmap.highlightLabel": "ハイライト範囲", - "visTypeVislib.editors.heatmap.highlightLabelTooltip": "チャートのカーソルを当てた部分と凡例の対応するラベルをハイライトします。", - "visTypeVislib.functions.pie.help": "パイビジュアライゼーション", - "visTypeVislib.functions.vislib.help": "Vislib ビジュアライゼーション", - "visTypeVislib.gauge.alignmentAutomaticTitle": "自動", - "visTypeVislib.gauge.alignmentHorizontalTitle": "横", - "visTypeVislib.gauge.alignmentVerticalTitle": "縦", - "visTypeVislib.gauge.gaugeDescription": "メトリックのステータスを示します。", - "visTypeVislib.gauge.gaugeTitle": "ゲージ", - "visTypeVislib.gauge.gaugeTypes.arcText": "弧形", - "visTypeVislib.gauge.gaugeTypes.circleText": "円", - "visTypeVislib.gauge.groupTitle": "グループを分割", - "visTypeVislib.gauge.metricTitle": "メトリック", - "visTypeVislib.goal.goalDescription": "メトリックがどのように目標まで進むのかを追跡します。", - "visTypeVislib.goal.goalTitle": "ゴール", - "visTypeVislib.goal.groupTitle": "グループを分割", - "visTypeVislib.goal.metricTitle": "メトリック", - "visTypeVislib.heatmap.groupTitle": "Y 軸", - "visTypeVislib.heatmap.heatmapDescription": "マトリックスのセルのデータを網掛けにします。", - "visTypeVislib.heatmap.heatmapTitle": "ヒートマップ", - "visTypeVislib.heatmap.metricTitle": "値", - "visTypeVislib.heatmap.segmentTitle": "X 軸", - "visTypeVislib.heatmap.splitTitle": "チャートを分割", - "visTypeVislib.vislib.errors.noResultsFoundTitle": "結果が見つかりませんでした", - "visTypeVislib.vislib.heatmap.maxBucketsText": "定義された数列が多すぎます ({nr}) 。構成されている最大値は {max} です。", - "visTypeVislib.vislib.legend.filterForValueButtonAriaLabel": "値 {legendDataLabel} でフィルタリング", - "visTypeVislib.vislib.legend.filterOptionsLegend": "{legendDataLabel}、フィルターオプション", - "visTypeVislib.vislib.legend.filterOutValueButtonAriaLabel": "値 {legendDataLabel} を除外", - "visTypeVislib.vislib.legend.loadingLabel": "読み込み中…", - "visTypeVislib.vislib.legend.toggleLegendButtonAriaLabel": "凡例を切り替える", - "visTypeVislib.vislib.legend.toggleLegendButtonTitle": "凡例を切り替える", - "visTypeVislib.vislib.legend.toggleOptionsButtonAriaLabel": "{legendDataLabel}、トグルオプション", - "visTypeVislib.vislib.tooltip.fieldLabel": "フィールド", - "visTypeVislib.vislib.tooltip.valueLabel": "値", - "visTypeXy.advancedSettings.visualization.legacyChartsLibrary.deprecation": "Visualizeのエリアグラフ、折れ線グラフ、棒グラフのレガシーグラフライブラリは廃止予定であり、8.0以降ではサポートされません。", - "visTypeXy.advancedSettings.visualization.legacyChartsLibrary.description": "Visualizeでエリア、折れ線、棒グラフのレガシーグラフライブラリを有効にします。", - "visTypeXy.advancedSettings.visualization.legacyChartsLibrary.name": "XY軸レガシーグラフライブラリ", - "visTypeXy.aggResponse.allDocsTitle": "すべてのドキュメント", - "visTypeXy.area.areaDescription": "軸と線の間のデータを強調します。", - "visTypeXy.area.areaTitle": "エリア", - "visTypeXy.area.groupTitle": "系列を分割", - "visTypeXy.area.metricsTitle": "Y 軸", - "visTypeXy.area.radiusTitle": "点のサイズ", - "visTypeXy.area.segmentTitle": "X 軸", - "visTypeXy.area.splitTitle": "チャートを分割", - "visTypeXy.area.tabs.metricsAxesTitle": "メトリックと軸", - "visTypeXy.area.tabs.panelSettingsTitle": "パネル設定", - "visTypeXy.axisModes.normalText": "標準", - "visTypeXy.axisModes.percentageText": "割合 (%) ", - "visTypeXy.axisModes.silhouetteText": "シルエット", - "visTypeXy.axisModes.wiggleText": "振動", - "visTypeXy.categoryAxis.rotate.angledText": "傾斜", - "visTypeXy.categoryAxis.rotate.horizontalText": "横", - "visTypeXy.categoryAxis.rotate.verticalText": "縦", - "visTypeXy.chartModes.normalText": "標準", - "visTypeXy.chartModes.stackedText": "スタック", - "visTypeXy.chartTypes.areaText": "エリア", - "visTypeXy.chartTypes.barText": "バー", - "visTypeXy.chartTypes.lineText": "折れ線", - "visTypeXy.controls.pointSeries.categoryAxis.alignLabel": "配置", - "visTypeXy.controls.pointSeries.categoryAxis.filterLabelsLabel": "フィルターラベル", - "visTypeXy.controls.pointSeries.categoryAxis.labelsTitle": "ラベル", - "visTypeXy.controls.pointSeries.categoryAxis.positionLabel": "位置", - "visTypeXy.controls.pointSeries.categoryAxis.showLabel": "軸線とラベルを表示", - "visTypeXy.controls.pointSeries.categoryAxis.showLabelsLabel": "ラベルを表示", - "visTypeXy.controls.pointSeries.categoryAxis.xAxisTitle": "X 軸", - "visTypeXy.controls.pointSeries.gridAxis.dontShowLabel": "非表示", - "visTypeXy.controls.pointSeries.gridAxis.gridText": "グリッド", - "visTypeXy.controls.pointSeries.gridAxis.xAxisLinesLabel": "X 軸線を表示", - "visTypeXy.controls.pointSeries.gridAxis.yAxisLinesDisabledTooltip": "ヒストグラムに X 軸線は表示できません。", - "visTypeXy.controls.pointSeries.gridAxis.yAxisLinesLabel": "Y 軸線を表示", - "visTypeXy.controls.pointSeries.series.chartTypeLabel": "チャートタイプ", - "visTypeXy.controls.pointSeries.series.circlesRadius": "点のサイズ", - "visTypeXy.controls.pointSeries.series.lineModeLabel": "線のモード", - "visTypeXy.controls.pointSeries.series.lineWidthLabel": "線の幅", - "visTypeXy.controls.pointSeries.series.metricsTitle": "メトリック", - "visTypeXy.controls.pointSeries.series.modeLabel": "モード", - "visTypeXy.controls.pointSeries.series.newAxisLabel": "新規軸…", - "visTypeXy.controls.pointSeries.series.showDotsLabel": "点を表示", - "visTypeXy.controls.pointSeries.series.showLineLabel": "線を表示", - "visTypeXy.controls.pointSeries.series.valueAxisLabel": "値軸", - "visTypeXy.controls.pointSeries.seriesAccordionAriaLabel": "{agg} オプションを切り替える", - "visTypeXy.controls.pointSeries.valueAxes.addButtonTooltip": "Y 軸を追加します", - "visTypeXy.controls.pointSeries.valueAxes.customExtentsLabel": "カスタム範囲", - "visTypeXy.controls.pointSeries.valueAxes.maxLabel": "最高", - "visTypeXy.controls.pointSeries.valueAxes.minErrorMessage": "最低値は最高値よりも低く設定する必要があります。", - "visTypeXy.controls.pointSeries.valueAxes.minLabel": "最低", - "visTypeXy.controls.pointSeries.valueAxes.minNeededScaleText": "ログスケールが選択されている場合、最低値は 0 よりも大きいものである必要があります。", - "visTypeXy.controls.pointSeries.valueAxes.modeLabel": "モード", - "visTypeXy.controls.pointSeries.valueAxes.positionLabel": "位置", - "visTypeXy.controls.pointSeries.valueAxes.removeButtonTooltip": "Y 軸を削除します", - "visTypeXy.controls.pointSeries.valueAxes.scaleToDataBounds.boundsMargin": "境界マージン", - "visTypeXy.controls.pointSeries.valueAxes.scaleToDataBounds.minNeededBoundsMargin": "境界マージンは 0 以上でなければなりません。", - "visTypeXy.controls.pointSeries.valueAxes.scaleToDataBoundsLabel": "データバウンドに合わせる", - "visTypeXy.controls.pointSeries.valueAxes.scaleTypeLabel": "スケールタイプ", - "visTypeXy.controls.pointSeries.valueAxes.setAxisExtentsLabel": "軸範囲を設定", - "visTypeXy.controls.pointSeries.valueAxes.showLabel": "軸線とラベルを表示", - "visTypeXy.controls.pointSeries.valueAxes.titleLabel": "タイトル", - "visTypeXy.controls.pointSeries.valueAxes.toggleCustomExtendsAriaLabel": "カスタム範囲を切り替える", - "visTypeXy.controls.pointSeries.valueAxes.toggleOptionsAriaLabel": "{axisName} オプションを切り替える", - "visTypeXy.controls.pointSeries.valueAxes.yAxisTitle": "Y 軸", - "visTypeXy.controls.truncateLabel": "切り捨て", - "visTypeXy.editors.elasticChartsOptions.detailedTooltip.label": "詳細ツールチップを表示", - "visTypeXy.editors.elasticChartsOptions.detailedTooltip.tooltip": "単一の値を表示するためのレガシー詳細ツールチップを有効にします。無効にすると、新しい概要のツールチップに複数の値が表示されます。", - "visTypeXy.editors.elasticChartsOptions.fillOpacity": "塗りつぶしの透明度", - "visTypeXy.editors.elasticChartsOptions.missingValuesLabel": "欠測値を埋める", - "visTypeXy.editors.pointSeries.currentTimeMarkerLabel": "現在時刻マーカー", - "visTypeXy.editors.pointSeries.orderBucketsBySumLabel": "バケットを合計で並べ替え", - "visTypeXy.editors.pointSeries.settingsTitle": "設定", - "visTypeXy.editors.pointSeries.showLabels": "チャートに値を表示", - "visTypeXy.editors.pointSeries.thresholdLine.colorLabel": "線の色", - "visTypeXy.editors.pointSeries.thresholdLine.showLabel": "しきい線を表示", - "visTypeXy.editors.pointSeries.thresholdLine.styleLabel": "ラインスタイル", - "visTypeXy.editors.pointSeries.thresholdLine.valueLabel": "しきい値", - "visTypeXy.editors.pointSeries.thresholdLine.widthLabel": "線の幅", - "visTypeXy.editors.pointSeries.thresholdLineSettingsTitle": "しきい線", - "visTypeXy.fittingFunctionsTitle.carry": "最後 (ギャップを最後の値で埋める) ", - "visTypeXy.fittingFunctionsTitle.linear": "線形 (ギャップを線で埋める) ", - "visTypeXy.fittingFunctionsTitle.lookahead": "次 (ギャップを次の値で埋める) ", - "visTypeXy.fittingFunctionsTitle.none": "非表示 (ギャップを埋めない) ", - "visTypeXy.fittingFunctionsTitle.zero": "ゼロ (ギャップをゼロで埋める) ", - "visTypeXy.function.args.addLegend.help": "グラフ凡例を表示", - "visTypeXy.function.args.addTimeMarker.help": "時刻マーカーを表示", - "visTypeXy.function.args.addTooltip.help": "カーソルを置いたときにツールチップを表示", - "visTypeXy.function.args.args.chartType.help": "グラフの種類。折れ線、エリア、ヒストグラムを選択できます", - "visTypeXy.function.args.categoryAxes.help": "カテゴリ軸構成", - "visTypeXy.function.args.detailedTooltip.help": "詳細ツールチップを表示", - "visTypeXy.function.args.fillOpacity.help": "エリアグラフの塗りつぶしの透明度を定義します", - "visTypeXy.function.args.fittingFunction.help": "適合関数の名前", - "visTypeXy.function.args.gridCategoryLines.help": "グラフにグリッドカテゴリ線を表示", - "visTypeXy.function.args.gridValueAxis.help": "グリッドを表示する値軸の名前", - "visTypeXy.function.args.isVislibVis.help": "古いvislib可視化を示すフラグ。色を含む後方互換性のために使用されます", - "visTypeXy.function.args.labels.help": "グラフラベル構成", - "visTypeXy.function.args.legendPosition.help": "グラフの上、下、左、右に凡例を配置", - "visTypeXy.function.args.orderBucketsBySum.help": "バケットを合計で並べ替え", - "visTypeXy.function.args.palette.help": "グラフパレット名を定義します", - "visTypeXy.function.args.radiusRatio.help": "点サイズ率", - "visTypeXy.function.args.seriesDimension.help": "系列ディメンション構成", - "visTypeXy.function.args.seriesParams.help": "系列パラメーター構成", - "visTypeXy.function.args.splitColumnDimension.help": "列ディメンション構成で分割", - "visTypeXy.function.args.splitRowDimension.help": "行ディメンション構成で分割", - "visTypeXy.function.args.thresholdLine.help": "しきい値線構成", - "visTypeXy.function.args.times.help": "時刻マーカー構成", - "visTypeXy.function.args.valueAxes.help": "値軸構成", - "visTypeXy.function.args.widthDimension.help": "幅ディメンション構成", - "visTypeXy.function.args.xDimension.help": "X軸ディメンション構成", - "visTypeXy.function.args.yDimension.help": "Y軸ディメンション構成", - "visTypeXy.function.args.zDimension.help": "Z軸ディメンション構成", - "visTypeXy.function.categoryAxis.help": "カテゴリ軸オブジェクトを生成します", - "visTypeXy.function.categoryAxis.id.help": "カテゴリ軸のID", - "visTypeXy.function.categoryAxis.labels.help": "軸ラベル構成", - "visTypeXy.function.categoryAxis.position.help": "カテゴリ軸の位置", - "visTypeXy.function.categoryAxis.scale.help": "スケール構成", - "visTypeXy.function.categoryAxis.show.help": "カテゴリ軸を表示", - "visTypeXy.function.categoryAxis.title.help": "カテゴリ軸のタイトル", - "visTypeXy.function.categoryAxis.type.help": "カテゴリ軸の種類。カテゴリまたは値を選択できます", - "visTypeXy.function.label.color.help": "ラベルの色", - "visTypeXy.function.label.filter.help": "軸の重なるラベルと重複を非表示にします", - "visTypeXy.function.label.help": "ラベルオブジェクトを生成します", - "visTypeXy.function.label.overwriteColor.help": "色を上書き", - "visTypeXy.function.label.rotate.help": "角度を回転", - "visTypeXy.function.label.show.help": "ラベルを表示", - "visTypeXy.function.label.truncate.help": "切り捨てる前の記号の数", - "visTypeXy.function.scale.boundsMargin.help": "境界のマージン", - "visTypeXy.function.scale.defaultYExtents.help": "データ境界にスケールできるフラグ", - "visTypeXy.function.scale.help": "スケールオブジェクトを生成します", - "visTypeXy.function.scale.max.help": "最高値", - "visTypeXy.function.scale.min.help": "最低値", - "visTypeXy.function.scale.mode.help": "スケールモード。標準、割合、小刻み、シルエットを選択できます", - "visTypeXy.function.scale.setYExtents.help": "独自の範囲を設定できるフラグ", - "visTypeXy.function.scale.type.help": "スケールタイプ。線形、対数、平方根を選択できます", - "visTypeXy.function.seriesParam.circlesRadius.help": "円のサイズ (半径) を定義します", - "visTypeXy.function.seriesParam.drawLinesBetweenPoints.help": "点の間に線を描画", - "visTypeXy.function.seriesparam.help": "系列パラメーターオブジェクトを生成します", - "visTypeXy.function.seriesParam.id.help": "系列パラメーターのID", - "visTypeXy.function.seriesParam.interpolate.help": "補間モード。線形、カーディナル、階段状を選択できます", - "visTypeXy.function.seriesParam.label.help": "系列パラメーターの名前", - "visTypeXy.function.seriesParam.lineWidth.help": "線の幅", - "visTypeXy.function.seriesParam.mode.help": "グラフモード。積み上げまたは割合を選択できます", - "visTypeXy.function.seriesParam.show.help": "パラメーターを表示", - "visTypeXy.function.seriesParam.showCircles.help": "円を表示", - "visTypeXy.function.seriesParam.type.help": "グラフの種類。折れ線、エリア、ヒストグラムを選択できます", - "visTypeXy.function.seriesParam.valueAxis.help": "値軸の名前", - "visTypeXy.function.thresholdLine.color.help": "しきい線の色", - "visTypeXy.function.thresholdLine.help": "しきい値線オブジェクトを生成します", - "visTypeXy.function.thresholdLine.show.help": "しきい線を表示", - "visTypeXy.function.thresholdLine.style.help": "しきい線のスタイル。実線、点線、一点鎖線を選択できます", - "visTypeXy.function.thresholdLine.value.help": "しきい値", - "visTypeXy.function.thresholdLine.width.help": "しきい値線の幅", - "visTypeXy.function.timeMarker.class.help": "CSSクラス名", - "visTypeXy.function.timeMarker.color.help": "時刻マーカーの色", - "visTypeXy.function.timemarker.help": "時刻マーカーオブジェクトを生成します", - "visTypeXy.function.timeMarker.opacity.help": "時刻マーカーの透明度", - "visTypeXy.function.timeMarker.time.help": "正確な時刻", - "visTypeXy.function.timeMarker.width.help": "時刻マーカーの幅", - "visTypeXy.function.valueAxis.axisParams.help": "値軸パラメーター", - "visTypeXy.function.valueaxis.help": "値軸オブジェクトを生成します", - "visTypeXy.function.valueAxis.name.help": "値軸の名前", - "visTypeXy.functions.help": "XYビジュアライゼーション", - "visTypeXy.histogram.groupTitle": "系列を分割", - "visTypeXy.histogram.histogramDescription": "軸の縦棒にデータを表示します。", - "visTypeXy.histogram.histogramTitle": "縦棒", - "visTypeXy.histogram.metricTitle": "Y 軸", - "visTypeXy.histogram.radiusTitle": "点のサイズ", - "visTypeXy.histogram.segmentTitle": "X 軸", - "visTypeXy.histogram.splitTitle": "チャートを分割", - "visTypeXy.horizontalBar.groupTitle": "系列を分割", - "visTypeXy.horizontalBar.horizontalBarDescription": "軸の横棒にデータを表示します。", - "visTypeXy.horizontalBar.horizontalBarTitle": "横棒", - "visTypeXy.horizontalBar.metricTitle": "Y 軸", - "visTypeXy.horizontalBar.radiusTitle": "点のサイズ", - "visTypeXy.horizontalBar.segmentTitle": "X 軸", - "visTypeXy.horizontalBar.splitTitle": "チャートを分割", - "visTypeXy.interpolationModes.smoothedText": "スムーズ", - "visTypeXy.interpolationModes.steppedText": "ステップ", - "visTypeXy.interpolationModes.straightText": "直線", - "visTypeXy.legend.filterForValueButtonAriaLabel": "値でフィルター", - "visTypeXy.legend.filterOptionsLegend": "{legendDataLabel}、フィルターオプション", - "visTypeXy.legend.filterOutValueButtonAriaLabel": "値を除外", - "visTypeXy.legendPositions.bottomText": "一番下", - "visTypeXy.legendPositions.leftText": "左", - "visTypeXy.legendPositions.rightText": "右", - "visTypeXy.legendPositions.topText": "トップ", - "visTypeXy.line.groupTitle": "系列を分割", - "visTypeXy.line.lineDescription": "データを系列点として表示します。", - "visTypeXy.line.lineTitle": "折れ線", - "visTypeXy.line.metricTitle": "Y 軸", - "visTypeXy.line.radiusTitle": "点のサイズ", - "visTypeXy.line.segmentTitle": "X 軸", - "visTypeXy.line.splitTitle": "チャートを分割", - "visTypeXy.scaleTypes.linearText": "線形", - "visTypeXy.scaleTypes.logText": "ログ", - "visTypeXy.scaleTypes.squareRootText": "平方根", - "visTypeXy.thresholdLine.style.dashedText": "鎖線", - "visTypeXy.thresholdLine.style.dotdashedText": "点線", - "visTypeXy.thresholdLine.style.fullText": "完全", - "visualizations.function.xyDimension.aggType.help": "集約タイプ", - "visualizations.function.xydimension.help": "XYディメンションオブジェクトを生成します", - "visualizations.function.xyDimension.label.help": "ラベル", - "visualizations.function.xyDimension.params.help": "パラメーター", - "visualizations.function.xyDimension.visDimension.help": "ディメンションオブジェクト構成", - "visualizations.advancedSettings.visualizeEnableLabsText": "ユーザーが実験的なビジュアライゼーションを作成、表示、編集できるようになります。無効の場合、\n ユーザーは本番準備が整ったビジュアライゼーションのみを利用できます。", - "visualizations.advancedSettings.visualizeEnableLabsTitle": "実験的なビジュアライゼーションを有効にする", - "visualizations.disabledLabVisualizationLink": "ドキュメンテーションを表示", - "visualizations.disabledLabVisualizationMessage": "ラボビジュアライゼーションを表示するには、高度な設定でラボモードをオンにしてください。", - "visualizations.disabledLabVisualizationTitle": "{title} はラボビジュアライゼーションです。", - "visualizations.displayName": "ビジュアライゼーション", - "visualizations.embeddable.placeholderTitle": "プレースホルダータイトル", - "visualizations.function.range.from.help": "範囲の開始", - "visualizations.function.range.help": "範囲オブジェクトを生成します", - "visualizations.function.range.to.help": "範囲の終了", - "visualizations.function.visDimension.accessor.help": "使用するデータセット内の列 (列インデックスまたは列名) ", - "visualizations.function.visDimension.error.accessor": "入力された列名は無効です。", - "visualizations.function.visDimension.format.help": "フォーマット", - "visualizations.function.visDimension.formatParams.help": "フォーマットパラメーター", - "visualizations.function.visDimension.help": "visConfig ディメンションオブジェクトを生成します", - "visualizations.initializeWithoutIndexPatternErrorMessage": "インデックスパターンなしで集約を初期化しようとしています", - "visualizations.newVisWizard.aggBasedGroupDescription": "クラシック Visualize ライブラリを使用して、アグリゲーションに基づいてグラフを作成します。", - "visualizations.newVisWizard.aggBasedGroupTitle": "アグリゲーションに基づく", - "visualizations.newVisWizard.chooseSourceTitle": "ソースの選択", - "visualizations.newVisWizard.experimentalTitle": "実験的", - "visualizations.newVisWizard.experimentalTooltip": "このビジュアライゼーションは今後のリリースで変更または削除される可能性があり、SLA のサポート対象になりません。", - "visualizations.newVisWizard.exploreOptionLinkText": "探索オプション", - "visualizations.newVisWizard.filterVisTypeAriaLabel": "ビジュアライゼーションのタイプでフィルタリング", - "visualizations.newVisWizard.goBackLink": "別のビジュアライゼーションを選択", - "visualizations.newVisWizard.helpTextAriaLabel": "タイプを選択してビジュアライゼーションの作成を始めましょう。ESC を押してこのモーダルを閉じます。Tab キーを押して次に進みます。", - "visualizations.newVisWizard.learnMoreText": "詳細について", - "visualizations.newVisWizard.newVisTypeTitle": "新規 {visTypeName}", - "visualizations.newVisWizard.readDocumentationLink": "ドキュメンテーションを表示", - "visualizations.newVisWizard.searchSelection.notFoundLabel": "一致インデックスまたは保存した検索が見つかりません。", - "visualizations.newVisWizard.searchSelection.savedObjectType.indexPattern": "インデックスパターン", - "visualizations.newVisWizard.searchSelection.savedObjectType.search": "保存検索", - "visualizations.newVisWizard.title": "新規ビジュアライゼーション", - "visualizations.newVisWizard.toolsGroupTitle": "ツール", - "visualizations.noResultsFoundTitle": "結果が見つかりませんでした", - "visualizations.savedObjectName": "ビジュアライゼーション", - "visualizations.savingVisualizationFailed.errorMsg": "ビジュアライゼーションの保存が失敗しました", - "visualizations.visualizationTypeInvalidMessage": "無効なビジュアライゼーションタイプ \"{visType}\"", - "visualize.badge.readOnly.text": "読み取り専用", - "visualize.badge.readOnly.tooltip": "ビジュアライゼーションをライブラリに保存できません", - "visualize.byValue_pageHeading": "{originatingApp}アプリに埋め込まれた{chartType}タイプのビジュアライゼーション", - "visualize.confirmModal.confirmTextDescription": "変更を保存せずにVisualizeエディターから移動しますか?", - "visualize.confirmModal.title": "保存されていない変更", - "visualize.createVisualization.failedToLoadErrorMessage": "ビジュアライゼーションを読み込めませんでした", - "visualize.createVisualization.noIndexPatternOrSavedSearchIdErrorMessage": "indexPatternまたはsavedSearchIdが必要です", - "visualize.createVisualization.noVisTypeErrorMessage": "有効なビジュアライゼーションタイプを指定してください", - "visualize.editor.createBreadcrumb": "作成", - "visualize.editor.defaultEditBreadcrumbText": "ビジュアライゼーションを編集", - "visualize.experimentalVisInfoText": "このビジュアライゼーションはまだ実験段階であり、オフィシャルGA機能のサポートSLAが適用されません。フィードバックがある場合は、{githubLink}で問題を報告してください。", - "visualize.helpMenu.appName": "Visualizeライブラリ", - "visualize.linkedToSearch.unlinkSuccessNotificationText": "保存された検索「{searchTitle}」からリンクが解除されました", - "visualize.listing.betaTitle": "ベータ", - "visualize.listing.betaTooltip": "このビジュアライゼーションはベータ段階で、変更される可能性があります。デザインとコードはオフィシャルGA機能よりも完成度が低く、現状のまま保証なしで提供されています。ベータ機能にはオフィシャルGA機能のSLAが適用されません", - "visualize.listing.breadcrumb": "Visualizeライブラリ", - "visualize.listing.createNew.createButtonLabel": "新規ビジュアライゼーションを追加", - "visualize.listing.createNew.description": "データに基づき異なるビジュアライゼーションを作成できます。", - "visualize.listing.createNew.title": "最初のビジュアライゼーションの作成", - "visualize.listing.experimentalTitle": "実験的", - "visualize.listing.experimentalTooltip": "このビジュアライゼーションは今後のリリースで変更または削除される可能性があり、SLA のサポート対象になりません。", - "visualize.listing.table.descriptionColumnName": "説明", - "visualize.listing.table.entityName": "ビジュアライゼーション", - "visualize.listing.table.entityNamePlural": "ビジュアライゼーション", - "visualize.listing.table.listTitle": "Visualizeライブラリ", - "visualize.listing.table.titleColumnName": "タイトル", - "visualize.listing.table.typeColumnName": "型", - "visualize.listingPageTitle": "Visualizeライブラリ", - "visualize.noMatchRoute.bannerText": "Visualizeアプリケーションはこのルートを認識できません。{route}", - "visualize.noMatchRoute.bannerTitleText": "ページが見つかりません", - "visualize.pageHeading": "{chartName} {chartType}可視化", - "visualize.topNavMenu.cancelAndReturnButtonTooltip": "完了する前に変更を破棄", - "visualize.topNavMenu.cancelButtonAriaLabel": "変更を保存せずに最後に使用していたアプリに戻る", - "visualize.topNavMenu.cancelButtonLabel": "キャンセル", - "visualize.topNavMenu.openInspectorButtonAriaLabel": "ビジュアライゼーションのインスペクターを開く", - "visualize.topNavMenu.openInspectorButtonLabel": "検査", - "visualize.topNavMenu.openInspectorDisabledButtonTooltip": "このビジュアライゼーションはインスペクターをサポートしていません。", - "visualize.topNavMenu.saveAndReturnVisualizationButtonAriaLabel": "可視化の編集が完了し、前回使用していたアプリに戻ります", - "visualize.topNavMenu.saveAndReturnVisualizationButtonLabel": "保存して戻る", - "visualize.topNavMenu.saveAndReturnVisualizationDisabledButtonTooltip": "完了する前に変更を適用または破棄", - "visualize.topNavMenu.saveVisualization.failureNotificationText": "「{visTitle}」の保存中にエラーが発生しました", - "visualize.topNavMenu.saveVisualization.successNotificationText": "「{visTitle}」が保存されました", - "visualize.topNavMenu.saveVisualizationAsButtonLabel": "名前を付けて保存", - "visualize.topNavMenu.saveVisualizationButtonAriaLabel": "ビジュアライゼーションを保存", - "visualize.topNavMenu.saveVisualizationButtonLabel": "保存", - "visualize.topNavMenu.saveVisualizationDisabledButtonTooltip": "保存する前に変更を適用または破棄", - "visualize.topNavMenu.saveVisualizationToLibraryButtonLabel": "ライブラリに保存", - "visualize.topNavMenu.shareVisualizationButtonAriaLabel": "ビジュアライゼーションを共有", - "visualize.topNavMenu.shareVisualizationButtonLabel": "共有", - "visualize.topNavMenu.updatePanel": "{originatingAppName}でパネルを更新", - "visualize.visualizationLoadingFailedErrorMessage": "ビジュアライゼーションを読み込めませんでした", - "visualize.visualizeDescription": "ビジュアライゼーションを作成してElasticsearchインデックスに保存されたデータをアグリゲーションします。", - "visualize.visualizeListingBreadcrumbsTitle": "Visualizeライブラリ", - "visualize.visualizeListingDashboardAppName": "ダッシュボードアプリケーション", - "visualize.visualizeListingDashboardFlowDescription": "ダッシュボードを作成しますか?新しい統合ワークフローを使用して、{dashboardApp} から直接コンテンツを作成します。", - "visualize.visualizeListingDeleteErrorTitle": "ビジュアライゼーションの削除中にエラーが発生", - "xpack.actions.actionTypeRegistry.get.missingActionTypeErrorMessage": "アクションタイプ「{id}」は登録されていません。", - "xpack.actions.actionTypeRegistry.register.duplicateActionTypeErrorMessage": "アクションタイプ「{id}」はすでに登録されています。", - "xpack.actions.alertHistoryEsIndexConnector.name": "アラート履歴Elasticsearchインデックス", - "xpack.actions.appName": "アクション", - "xpack.actions.builtin.case.swimlaneTitle": "スイムレーン", - "xpack.actions.builtin.cases.jiraTitle": "Jira", - "xpack.actions.builtin.cases.resilientTitle": "IBM Resilient", - "xpack.actions.builtin.configuration.apiAllowedHostsError": "コネクターアクションの構成エラー:{message}", - "xpack.actions.builtin.email.customViewInKibanaMessage": "このメッセージは Kibana によって送信されました。[{kibanaFooterLinkText}] ({link}) 。", - "xpack.actions.builtin.email.errorSendingErrorMessage": "エラー送信メールアドレス", - "xpack.actions.builtin.email.kibanaFooterLinkText": "Kibana を開く", - "xpack.actions.builtin.email.sentByKibanaMessage": "このメッセージは Kibana によって送信されました。", - "xpack.actions.builtin.emailTitle": "メール", - "xpack.actions.builtin.esIndex.errorIndexingErrorMessage": "エラーインデックス作成ドキュメント", - "xpack.actions.builtin.esIndexTitle": "インデックス", - "xpack.actions.builtin.jira.configuration.apiAllowedHostsError": "コネクターアクションの構成エラー:{message}", - "xpack.actions.builtin.pagerduty.invalidTimestampErrorMessage": "タイムスタンプ\"{timestamp}\"の解析エラー", - "xpack.actions.builtin.pagerduty.missingDedupkeyErrorMessage": "eventActionが「{eventAction}」のときにはDedupKeyが必要です", - "xpack.actions.builtin.pagerduty.pagerdutyConfigurationError": "pagerduty アクションの設定エラー:{message}", - "xpack.actions.builtin.pagerduty.postingErrorMessage": "pagerduty イベントの投稿エラー", - "xpack.actions.builtin.pagerduty.postingRetryErrorMessage": "pagerduty イベントの投稿エラー:http status {status}、後ほど再試行", - "xpack.actions.builtin.pagerduty.postingUnexpectedErrorMessage": "pagerduty イベントの投稿エラー:予期せぬステータス {status}", - "xpack.actions.builtin.pagerduty.timestampParsingFailedErrorMessage": "タイムスタンプの解析エラー \"{timestamp}\":{message}", - "xpack.actions.builtin.pagerdutyTitle": "PagerDuty", - "xpack.actions.builtin.serverLog.errorLoggingErrorMessage": "メッセージのロギングエラー", - "xpack.actions.builtin.serverLogTitle": "サーバーログ", - "xpack.actions.builtin.serviceNowITSMTitle": "ServiceNow ITSM", - "xpack.actions.builtin.serviceNowSIRTitle": "ServiceNow SecOps", - "xpack.actions.builtin.serviceNowTitle": "ServiceNow", - "xpack.actions.builtin.slack.errorPostingErrorMessage": "slack メッセージの投稿エラー", - "xpack.actions.builtin.slack.errorPostingRetryDateErrorMessage": "slack メッセージの投稿エラー、 {retryString} で再試行", - "xpack.actions.builtin.slack.errorPostingRetryLaterErrorMessage": "slack メッセージの投稿エラー、後ほど再試行", - "xpack.actions.builtin.slack.slackConfigurationError": "slack アクションの設定エラー:{message}", - "xpack.actions.builtin.slack.slackConfigurationErrorNoHostname": "slack アクションの構成エラー:Web フック URL からホスト名をパースできません", - "xpack.actions.builtin.slack.unexpectedHttpResponseErrorMessage": "slack からの予期せぬ http 応答:{httpStatus} {httpStatusText}", - "xpack.actions.builtin.slack.unexpectedNullResponseErrorMessage": "Slack から予期せぬ null 応答", - "xpack.actions.builtin.slackTitle": "Slack", - "xpack.actions.builtin.swimlane.configuration.apiAllowedHostsError": "コネクターアクションの構成エラー:{message}", - "xpack.actions.builtin.swimlaneTitle": "スイムレーン", - "xpack.actions.builtin.teams.errorPostingRetryDateErrorMessage": "Microsoft Teams メッセージの投稿エラーです。{retryString} に再試行します", - "xpack.actions.builtin.teams.errorPostingRetryLaterErrorMessage": "Microsoft Teams メッセージの投稿エラーです。しばらくたってから再試行します", - "xpack.actions.builtin.teams.invalidResponseErrorMessage": "Microsoft Teams への投稿エラーです。無効な応答です", - "xpack.actions.builtin.teams.teamsConfigurationError": "Teams アクションの設定エラー:{message}", - "xpack.actions.builtin.teams.teamsConfigurationErrorNoHostname": "Teams アクションの構成エラー:Web フック URL からホスト名をパースできません", - "xpack.actions.builtin.teams.unreachableErrorMessage": "Microsoft Teams への投稿エラーです。予期しないエラーです", - "xpack.actions.builtin.teamsTitle": "Microsoft Teams", - "xpack.actions.builtin.webhook.invalidResponseErrorMessage": "Webフックの呼び出しエラー、無効な応答", - "xpack.actions.builtin.webhook.invalidResponseRetryDateErrorMessage": "Webフックの呼び出しエラー、{retryString} に再試行", - "xpack.actions.builtin.webhook.invalidResponseRetryLaterErrorMessage": "Webフックの呼び出しエラー、後ほど再試行", - "xpack.actions.builtin.webhook.invalidUsernamePassword": "ユーザーとパスワードの両方を指定する必要があります", - "xpack.actions.builtin.webhook.requestFailedErrorMessage": "Webフックの呼び出しエラー。要求が失敗しました", - "xpack.actions.builtin.webhook.unreachableErrorMessage": "webhookの呼び出しエラー、予期せぬエラー", - "xpack.actions.builtin.webhook.webhookConfigurationError": "Web フックアクションの構成中にエラーが発生:{message}", - "xpack.actions.builtin.webhook.webhookConfigurationErrorNoHostname": "Webフックアクションの構成エラーです。URLを解析できません。{err}", - "xpack.actions.builtin.webhookTitle": "Web フック", - "xpack.actions.disabledActionTypeError": "アクションタイプ \"{actionType}\" は、Kibana 構成 xpack.actions.enabledActionTypes では有効化されません", - "xpack.actions.featureRegistry.actionsFeatureName": "アクションとコネクター", - "xpack.actions.savedObjects.goToConnectorsButtonText": "コネクターに移動", - "xpack.actions.serverSideErrors.expirerdLicenseErrorMessage": "{licenseType} ライセンスの期限が切れたのでアクションタイプ {actionTypeId} は無効です。", - "xpack.actions.serverSideErrors.invalidLicenseErrorMessage": "{licenseType} ライセンスでサポートされないのでアクションタイプ {actionTypeId} は無効です。ライセンスをアップグレードしてください。", - "xpack.actions.serverSideErrors.predefinedActionDeleteDisabled": "あらかじめ構成されたアクション{id}は削除できません。", - "xpack.actions.serverSideErrors.predefinedActionUpdateDisabled": "あらかじめ構成されたアクション{id}は更新できません。", - "xpack.actions.serverSideErrors.unavailableLicenseErrorMessage": "現時点でライセンス情報を入手できないため、アクションタイプ {actionTypeId} は無効です。", - "xpack.actions.serverSideErrors.unavailableLicenseInformationErrorMessage": "グラフを利用できません。現在ライセンス情報が利用できません。", - "xpack.actions.urlAllowedHostsConfigurationError": "ターゲット{field}「{value}」はKibana構成xpack.actions.allowedHostsに追加されていません", - "xpack.alerting.alertNavigationRegistry.get.missingNavigationError": "「{consumer}」内のアラートタイプ「{alertType}」のナビゲーションは登録されていません。", - "xpack.alerting.alertNavigationRegistry.register.duplicateDefaultError": "「{consumer}」内のデフォルトナビゲーションはすでに登録されています。", - "xpack.alerting.alertNavigationRegistry.register.duplicateNavigationError": "「{consumer}」内のアラートタイプ「{alertType}」のナビゲーションはすでに登録されています。", - "xpack.alerting.rulesClient.invalidDate": "パラメーター{field}の無効な日付:「{dateValue}」", - "xpack.alerting.rulesClient.validateActions.invalidGroups": "無効なアクショングループ:{groups}", - "xpack.alerting.ruleTypeRegistry.get.missingAlertTypeError": "アラートタイプ「{id}」は登録されていません。", - "xpack.alerting.ruleTypeRegistry.register.customRecoveryActionGroupUsageError": "アラートタイプ [id=\"{id}\"] を登録できません。アクショングループ [{actionGroup}] は、復元とアクティブなアクショングループの両方として使用できません。", - "xpack.alerting.ruleTypeRegistry.register.duplicateAlertTypeError": "アラートタイプ\"{id}\"はすでに登録されています。", - "xpack.alerting.api.error.disabledApiKeys": "アラートは API キーに依存しますがキーが無効になっているようです", - "xpack.alerting.appName": "アラート", - "xpack.alerting.builtinActionGroups.recovered": "回復済み", - "xpack.alerting.injectActionParams.email.kibanaFooterLinkText": "Kibanaでルールを表示", - "xpack.alerting.savedObjects.goToRulesButtonText": "ルールに移動", - "xpack.alerting.server.healthStatus.available": "アラートフレームワークを使用できます", - "xpack.alerting.server.healthStatus.degraded": "アラートフレームワークは劣化しました", - "xpack.alerting.server.healthStatus.unavailable": "アラートフレームワークを使用できません", - "xpack.alerting.serverSideErrors.expirerdLicenseErrorMessage": "{licenseType} ライセンスの期限が切れたのでアラートタイプ {alertTypeId} は無効です。", - "xpack.alerting.serverSideErrors.invalidLicenseErrorMessage": "アラート{alertTypeId}は無効です。{licenseType}ライセンスが必要です。アップグレードオプションを表示するには、[ライセンス管理]に移動してください。", - "xpack.alerting.serverSideErrors.unavailableLicenseErrorMessage": "現時点でライセンス情報を入手できないため、アラートタイプ {alertTypeId} は無効です。", - "xpack.alerting.serverSideErrors.unavailableLicenseInformationErrorMessage": "アラートを利用できません。現在ライセンス情報が利用できません。", - "xpack.apm.a.thresholdMet": "しきい値一致", - "xpack.apm.addDataButtonLabel": "データの追加", - "xpack.apm.agentConfig.allOptionLabel": "すべて", - "xpack.apm.agentConfig.apiRequestSize.description": "チャンクエンコーディング (HTTPストリーミング) を経由してAPM ServerインテークAPIに送信されるリクエスト本文の最大合計圧縮サイズ。\nわずかなオーバーシュートの可能性があることに注意してください。\n\n使用できるバイト単位は、「b」、「kb」、「mb」です。「1kb」は「1024b」と等価です。", - "xpack.apm.agentConfig.apiRequestSize.label": "API リクエストサイズ", - "xpack.apm.agentConfig.apiRequestTime.description": "APM Server への HTTP リクエストを開いておく最大時間。\n\n注:この値は、APM Server の「read_timeout」設定よりも低くする必要があります。", - "xpack.apm.agentConfig.apiRequestTime.label": "API リクエスト時間", - "xpack.apm.agentConfig.captureBody.description": "HTTPリクエストのトランザクションの場合、エージェントはオプションとしてリクエスト本文 (POST変数など) をキャプチャすることができます。\nメッセージブローカーからメッセージを受信すると開始するトランザクションでは、エージェントがテキストメッセージの本文を取り込むことができます。", - "xpack.apm.agentConfig.captureBody.label": "本文をキャプチャ", - "xpack.apm.agentConfig.captureHeaders.description": "「true」に設定すると、メッセージングフレームワーク (Kafkaなど) を使用するときに、エージェントはHTTP要求と応答ヘッダー (Cookieを含む) 、およびメッセージヘッダー/プロパティを取り込みます。\n\n注:これを「false」に設定すると、ネットワーク帯域幅、ディスク容量、およびオブジェクト割り当てが減少します。", - "xpack.apm.agentConfig.captureHeaders.label": "ヘッダーのキャプチャ", - "xpack.apm.agentConfig.chooseService.editButton": "編集", - "xpack.apm.agentConfig.chooseService.service.environment.label": "環境", - "xpack.apm.agentConfig.chooseService.service.name.label": "サービス名", - "xpack.apm.agentConfig.circuitBreakerEnabled.description": "Circuit Breakerを有効にすべきかどうかを指定するブール値。 有効にすると、エージェントは定期的にストレス監視をポーリングして、システム/プロセス/JVMのストレス状態を検出します。監視のいずれかがストレスの兆候を検出した場合、`recording`構成オプションの設定が「false」であるかのようにエージェントは一時停止し、リソース消費を最小限に抑えられます。一時停止した場合、エージェントはストレス状態が緩和されたかどうかを検出するために同じ監視のポーリングを継続します。すべての監視でシステム/プロセス/JVMにストレスがないことが認められると、エージェントは再開して完全に機能します。", - "xpack.apm.agentConfig.circuitBreakerEnabled.label": "Cirtcuit Breaker が有効", - "xpack.apm.agentConfig.configTable.appliedTooltipMessage": "1 つ以上のエージェントにより適用されました", - "xpack.apm.agentConfig.configTable.configTable.failurePromptText": "エージェントの構成一覧を取得できませんでした。ユーザーに十分なパーミッションがない可能性があります。", - "xpack.apm.agentConfig.configTable.createConfigButtonLabel": "構成の作成", - "xpack.apm.agentConfig.configTable.emptyPromptTitle": "構成が見つかりません。", - "xpack.apm.agentConfig.configTable.environmentColumnLabel": "サービス環境", - "xpack.apm.agentConfig.configTable.lastUpdatedColumnLabel": "最終更新", - "xpack.apm.agentConfig.configTable.notAppliedTooltipMessage": "まだエージェントにより適用されていません", - "xpack.apm.agentConfig.configTable.serviceNameColumnLabel": "サービス名", - "xpack.apm.agentConfig.configurationsPanelTitle": "構成", - "xpack.apm.agentConfig.configurationsPanelTitle.noPermissionTooltipLabel": "ユーザーロールには、エージェント構成を作成する権限がありません", - "xpack.apm.agentConfig.createConfigButtonLabel": "構成の作成", - "xpack.apm.agentConfig.createConfigTitle": "構成の作成", - "xpack.apm.agentConfig.deleteModal.cancel": "キャンセル", - "xpack.apm.agentConfig.deleteModal.confirm": "削除", - "xpack.apm.agentConfig.deleteModal.text": "サービス「{serviceName}」と環境「{environment}」の構成を削除しようとしています。", - "xpack.apm.agentConfig.deleteModal.title": "構成を削除", - "xpack.apm.agentConfig.deleteSection.deleteConfigFailedText": "「{serviceName}」の構成を削除中に問題が発生しました。エラー:「{errorMessage}」", - "xpack.apm.agentConfig.deleteSection.deleteConfigFailedTitle": "構成を削除できませんでした", - "xpack.apm.agentConfig.deleteSection.deleteConfigSucceededText": "「{serviceName}」の構成が正常に削除されました。エージェントに反映されるまでに少し時間がかかります。", - "xpack.apm.agentConfig.deleteSection.deleteConfigSucceededTitle": "構成が削除されました", - "xpack.apm.agentConfig.editConfigTitle": "構成の編集", - "xpack.apm.agentConfig.enableLogCorrelation.description": "エージェントがSLF4JのMDCと融合してトレースログ相関を有効にすべきかどうかを指定するブール値。「true」に設定した場合、エージェントは現在アクティブなスパンとトランザクションの「trace.id」と「transaction.id」をMDCに設定します。Javaエージェントバージョン1.16.0以降では、エージェントは、エラーメッセージが記録される前に、取り込まれたエラーの「error.id」もMDCに追加します。注:実行時にこの設定を有効にできますが、再起動しないと無効にはできません。", - "xpack.apm.agentConfig.enableLogCorrelation.label": "ログ相関を有効にする", - "xpack.apm.agentConfig.logLevel.description": "エージェントのログ記録レベルを設定します", - "xpack.apm.agentConfig.logLevel.label": "ログレベル", - "xpack.apm.agentConfig.newConfig.description": "APMアプリ内からエージェント構成を微調整してください。変更はAPMエージェントに自動的に伝達されるので、再デプロイする必要はありません。", - "xpack.apm.agentConfig.profilingInferredSpansEnabled.description": "「true」に設定すると、エージェントは、別名統計プロファイラーと呼ばれるサンプリングプロファイラーであるasync-profilerに基づいてメソッド実行用のスパンを作成します。サンプリングプロファイラーのしくみの性質上、推定スパンの期間は厳密ではなく見込みのみです。「profiling_inferred_spans_sampling_interval」では、正確度とオーバーヘッドの間のトレードオフを微調整できます。推定スパンは、プロファイルセッションの終了後に作成されます。つまり、通常のスパンと推定スパンの間にはUIに表示されるタイミングに遅延があります。注:この機能はWindowsで使用できません。", - "xpack.apm.agentConfig.profilingInferredSpansEnabled.label": "プロファイル推定スパンが有効です", - "xpack.apm.agentConfig.profilingInferredSpansExcludedClasses.description": "プロファイラー推定スパンを作成する必要がないクラスを除外します。このオプションは、0文字以上に一致するワイルドカード「*」をサポートします。デフォルトでは、照合時に大文字と小文字の区別はありません。要素の前に「 (?-i) 」を付けると、照合時に大文字と小文字が区別されます。", - "xpack.apm.agentConfig.profilingInferredSpansExcludedClasses.label": "プロファイル推定スパンでクラスを除外しました", - "xpack.apm.agentConfig.profilingInferredSpansIncludedClasses.description": "設定した場合、エージェントは、このリストに一致するメソッドの推定スパンのみを作成します。値を設定すると、わずかに負荷が低減することがあり、対象となるクラスのスパンのみを作成することによって煩雑になるのを防止できます。このオプションは、0文字以上に一致するワイルドカード「*」をサポートします。例:「org.example.myapp.*」デフォルトでは、照合時に大文字と小文字の区別はありません。要素の前に「 (?-i) 」を付けると、照合時に大文字と小文字が区別されます。", - "xpack.apm.agentConfig.profilingInferredSpansIncludedClasses.label": "プロファイル推定スパンでクラスを包含しました", - "xpack.apm.agentConfig.profilingInferredSpansMinDuration.description": "推定スパンの最小期間。最小期間もサンプリング間隔によって暗黙的に設定されることに注意してください。ただし、サンプリング間隔を大きくすると、推定スパンの期間の精度も低下します。", - "xpack.apm.agentConfig.profilingInferredSpansMinDuration.label": "プロファイル推定スパン最小期間", - "xpack.apm.agentConfig.profilingInferredSpansSamplingInterval.description": "プロファイルセッション内でスタックトレースを収集する頻度。低い値に設定するほど継続時間の精度が上がります。その代わり、オーバーヘッドが増し、潜在的に無関係なオペレーションのスパンが増えるという犠牲が伴います。プロファイル推定スパンの最小期間は、この設定値と同じです。", - "xpack.apm.agentConfig.profilingInferredSpansSamplingInterval.label": "プロファイル推定サンプリング間隔", - "xpack.apm.agentConfig.range.errorText": "{rangeType, select,\n between {{min}と{max}の間でなければなりません}\n gt {値は{min}よりも大きい値でなければなりません}\n lt {{max}よりも低く設定する必要があります}\n other {整数でなければなりません}\n }", - "xpack.apm.agentConfig.recording.description": "記録中の場合、エージェントは着信HTTPリクエストを計測し、エラーを追跡し、メトリックを収集して送信します。記録なしに設定すると、エージェントはnoopとして動作し、更新された更新のポーリングを除き、データの収集や APM Server との通信を行いません。これは可逆スイッチなので、記録なしに設定されていてもエージェントスレッドは強制終了されませんが、この状態ではほとんどアイドル状態なのでオーバーヘッドは無視できます。この設定を使用すると、Elastic APMが有効か無効かを動的に制御できます。", - "xpack.apm.agentConfig.recording.label": "記録中", - "xpack.apm.agentConfig.sanitizeFiledNames.description": "場合によっては、サニタイズが必要です。つまり、Elastic APM に送信される機密データを削除する必要があります。この構成では、サニタイズされるフィールド名のワイルドカードパターンのリストを使用できます。これらは HTTP ヘッダー (Cookie を含む) と「application/x-www-form-urlencoded」データ (POST フォームフィールド) に適用されます。クエリ文字列と取り込まれた要求本文 (「application/json」データなど) はサニタイズされません。", - "xpack.apm.agentConfig.sanitizeFiledNames.label": "フィールド名のサニタイズ", - "xpack.apm.agentConfig.saveConfig.failed.text": "「{serviceName}」の構成の保存中に問題が発生しました。エラー:「{errorMessage}」", - "xpack.apm.agentConfig.saveConfig.failed.title": "構成を保存できませんでした", - "xpack.apm.agentConfig.saveConfig.succeeded.text": "「{serviceName}」の構成を保存しました。エージェントに反映されるまでに少し時間がかかります。", - "xpack.apm.agentConfig.saveConfig.succeeded.title": "構成が保存されました", - "xpack.apm.agentConfig.saveConfigurationButtonLabel": "次のステップ", - "xpack.apm.agentConfig.serverTimeout.description": "APM Server への要求で構成されたタイムアウトより時間がかかる場合、\n要求がキャンセルされ、イベント (例外またはトランザクション) が破棄されます。\n0に設定するとタイムアウトが無効になります。\n\n警告:タイムアウトが無効か高い値に設定されている場合、APM Serverがタイムアウトになると、アプリでメモリの問題が発生する可能性があります。", - "xpack.apm.agentConfig.serverTimeout.label": "サーバータイムアウト", - "xpack.apm.agentConfig.servicePage.alreadyConfiguredOption": "すでに構成済み", - "xpack.apm.agentConfig.servicePage.cancelButton": "キャンセル", - "xpack.apm.agentConfig.servicePage.environment.description": "構成ごとに 1 つの環境のみがサポートされます。", - "xpack.apm.agentConfig.servicePage.environment.fieldLabel": "サービス環境", - "xpack.apm.agentConfig.servicePage.environment.title": "環境", - "xpack.apm.agentConfig.servicePage.service.description": "構成するサービスを選択してください。", - "xpack.apm.agentConfig.servicePage.service.fieldLabel": "サービス名", - "xpack.apm.agentConfig.servicePage.service.title": "サービス", - "xpack.apm.agentConfig.settingsPage.discardChangesButton": "変更を破棄", - "xpack.apm.agentConfig.settingsPage.notFound.message": "リクエストされた構成が存在しません", - "xpack.apm.agentConfig.settingsPage.notFound.title": "申し訳ございません、エラーが発生しました", - "xpack.apm.agentConfig.settingsPage.saveButton": "構成を保存", - "xpack.apm.agentConfig.spanFramesMinDuration.description": "デフォルト設定では、APM エージェントは記録されたすべてのスパンでスタックトレースを収集します。\nこれはコード内でスパンの原因になる厳密な場所を見つけるうえで非常に役立ちますが、このスタックトレースを収集するとオーバーヘッドが生じます。\nこのオプションを負の値 (「-1ms」など) に設定すると、すべてのスパンのスタックトレースが収集されます。正の値 (たとえば、「5 ms」) に設定すると、スタックトレース収集を、指定値 (たとえば、5ミリ秒) 以上の期間にわたるスパンに制限されます。\n\nスパンのスタックトレース収集を完全に無効にするには、値を「0ms」に設定します。", - "xpack.apm.agentConfig.spanFramesMinDuration.label": "スパンフレーム最小期間", - "xpack.apm.agentConfig.stackTraceLimit.description": "0 に設定するとスタックトレース収集が無効になります。収集するフレームの最大数として正の整数値が使用されます。-1 に設定すると、すべてのフレームが収集されます。", - "xpack.apm.agentConfig.stackTraceLimit.label": "スタックトレース制限", - "xpack.apm.agentConfig.stressMonitorCpuDurationThreshold.description": "システムに現在ストレスがかかっているか、それとも以前に検出したストレスが緩和されたかを判断するために必要な最小時間。この時期のすべての測定は、関連しきい値と比較してストレス状態の変化を検出できるように一貫性が必要です。「1m」以上にする必要があります。", - "xpack.apm.agentConfig.stressMonitorCpuDurationThreshold.label": "ストレス監視 CPU 期間しきい値", - "xpack.apm.agentConfig.stressMonitorGcReliefThreshold.description": "ヒープにストレスがかからない時期を特定するためにGC監視で使用するしきい値。「stress_monitor_gc_stress_threshold」を超えた場合、エージェントはそれをヒープストレス状態と見なします。ストレス状態が収まったことを確認するには、すべてのヒーププールで占有メモリの割合がこのしきい値よりも低いことを確認します。GC監視は、直近のGCの後で測定したメモリ消費のみに依存します。", - "xpack.apm.agentConfig.stressMonitorGcReliefThreshold.label": "ストレス監視システム GC 緩和しきい値", - "xpack.apm.agentConfig.stressMonitorGcStressThreshold.description": "ヒープストレスを特定するためにGC監視で使用するしきい値。すべてのヒーププールに同じしきい値が使用され、いずれかの使用率がその値を超える場合、エージェントはそれをヒープストレスと見なします。GC監視は、直近のGCの後で測定したメモリ消費のみに依存します。", - "xpack.apm.agentConfig.stressMonitorGcStressThreshold.label": "ストレス監視システム GC ストレスしきい値", - "xpack.apm.agentConfig.stressMonitorSystemCpuReliefThreshold.description": "システムにCPUストレスがかかっていないことを判断するためにシステムCPU監視で使用するしきい値。監視機能でCPUストレスを検出した場合にCPUストレスが緩和されたと判断するには、測定されたシステムCPUが「stress_monitor_cpu_duration_threshold」と同じ長さ以上の期間にわたってこのしきい値を下回る必要があります。", - "xpack.apm.agentConfig.stressMonitorSystemCpuReliefThreshold.label": "ストレス監視システム CPU 緩和しきい値", - "xpack.apm.agentConfig.stressMonitorSystemCpuStressThreshold.description": "システムCPU監視でシステムCPUストレスの検出に使用するしきい値。システムCPUが少なくとも「stress_monitor_cpu_duration_threshold」と同じ長さ以上の期間にわたってこのしきい値を超えると、監視機能はこれをストレス状態と見なします。", - "xpack.apm.agentConfig.stressMonitorSystemCpuStressThreshold.label": "ストレス監視システム CPU ストレスしきい値", - "xpack.apm.agentConfig.transactionIgnoreUrl.description": "特定の URL への要求が命令されないように制限するために使用します。この構成では、無視される URL パスのワイルドカードパターンのカンマ区切りのリストを使用できます。受信 HTTP 要求が検出されると、要求パスが、リストの各要素に対してテストされます。たとえば、このリストに「/home/index」を追加すると、一致して、「http://localhost/home/index」と「http://whatever.com/home/index?value1=123」から命令が削除されます。", - "xpack.apm.agentConfig.transactionIgnoreUrl.label": "URL に基づくトランザクションを無視", - "xpack.apm.agentConfig.transactionMaxSpans.description": "トランザクションごとに記録される範囲を制限します。", - "xpack.apm.agentConfig.transactionMaxSpans.label": "トランザクションの最大範囲", - "xpack.apm.agentConfig.transactionSampleRate.description": "デフォルトでは、エージェントはすべてのトランザクション (たとえば、サービスへのリクエストなど) をサンプリングします。オーバーヘッドやストレージ要件を減らすには、サンプルレートの値を0.0〜1.0に設定します。全体的な時間とサンプリングされないトランザクションの結果は記録されますが、コンテキスト情報、ラベル、スパンは記録されません。", - "xpack.apm.agentConfig.transactionSampleRate.label": "トランザクションのサンプルレート", - "xpack.apm.agentConfig.unsavedSetting.tooltip": "未保存", - "xpack.apm.agentMetrics.java.gcRate": "GC レート", - "xpack.apm.agentMetrics.java.gcRateChartTitle": "1 分ごとのガベージコレクション", - "xpack.apm.agentMetrics.java.gcTime": "GC 時間", - "xpack.apm.agentMetrics.java.gcTimeChartTitle": "1 分ごとのごみ収集の時間", - "xpack.apm.agentMetrics.java.heapMemoryChartTitle": "ヒープ領域", - "xpack.apm.agentMetrics.java.heapMemorySeriesCommitted": "平均実行割当", - "xpack.apm.agentMetrics.java.heapMemorySeriesMax": "平均制限", - "xpack.apm.agentMetrics.java.heapMemorySeriesUsed": "平均使用", - "xpack.apm.agentMetrics.java.nonHeapMemoryChartTitle": "ヒープ領域以外", - "xpack.apm.agentMetrics.java.nonHeapMemorySeriesCommitted": "平均実行割当", - "xpack.apm.agentMetrics.java.nonHeapMemorySeriesUsed": "平均使用", - "xpack.apm.agentMetrics.java.threadCount": "平均カウント", - "xpack.apm.agentMetrics.java.threadCountChartTitle": "スレッド数", - "xpack.apm.agentMetrics.java.threadCountMax": "最高カウント", - "xpack.apm.alertAnnotationButtonAriaLabel": "アラート詳細を表示", - "xpack.apm.alertAnnotationCriticalTitle": "重大アラート", - "xpack.apm.alertAnnotationNoSeverityTitle": "アラート", - "xpack.apm.alertAnnotationWarningTitle": "警告アラート", - "xpack.apm.alerting.fields.all_option": "すべて", - "xpack.apm.alerting.fields.environment": "環境", - "xpack.apm.alerting.fields.service": "サービス", - "xpack.apm.alerting.fields.type": "型", - "xpack.apm.alerts.action_variables.environment": "アラートが作成されるトランザクションタイプ", - "xpack.apm.alerts.action_variables.intervalSize": "アラート条件が満たされた期間の長さと単位", - "xpack.apm.alerts.action_variables.serviceName": "アラートが作成されるサービス", - "xpack.apm.alerts.action_variables.threshold": "この値を超えるすべてのトリガーによりアラートが実行されます", - "xpack.apm.alerts.action_variables.transactionType": "アラートが作成されるトランザクションタイプ", - "xpack.apm.alerts.action_variables.triggerValue": "しきい値に達し、アラートをトリガーした値", - "xpack.apm.alerts.anomalySeverity.criticalLabel": "致命的", - "xpack.apm.alerts.anomalySeverity.majorLabel": "メジャー", - "xpack.apm.alerts.anomalySeverity.minor": "マイナー", - "xpack.apm.alerts.anomalySeverity.scoreDetailsDescription": "スコア {value} {value, select, critical {} other {以上}}", - "xpack.apm.alerts.anomalySeverity.warningLabel": "警告", - "xpack.apm.alertTypes.errorCount.defaultActionMessage": "次の条件のため、\\{\\{alertName\\}\\}アラートが実行されています。\n\n- サービス名:\\{\\{context.serviceName\\}\\}\n- 環境:\\{\\{context.environment\\}\\}\n- しきい値\\{\\{context.threshold\\}\\}エラー\n- トリガーされた値:過去\\{\\{context.interval\\}\\}に\\{\\{context.triggerValue\\}\\}件のエラー", - "xpack.apm.alertTypes.errorCount.description": "サービスのエラー数が定義されたしきい値を超過したときにアラートを発行します。", - "xpack.apm.alertTypes.errorCount.reason": "エラー数が{serviceName}の{threshold}を超えています (現在の値は{measured}) ", - "xpack.apm.alertTypes.transactionDuration.defaultActionMessage": "次の条件のため、\\{\\{alertName\\}\\}アラートが実行されています。\n\n- サービス名:\\{\\{context.serviceName\\}\\}\n- タイプ:\\{\\{context.transactionType\\}\\}\n- 環境:\\{\\{context.environment\\}\\}\n- レイテンシしきい値:\\{\\{context.threshold\\}\\}ミリ秒\n- 観察されたレイテンシ:直前の\\{\\{context.interval\\}\\}に\\{\\{context.triggerValue\\}\\}", - "xpack.apm.alertTypes.transactionDuration.description": "サービスの特定のトランザクションタイプのレイテンシが定義されたしきい値を超えたときにアラートを発行します。", - "xpack.apm.alertTypes.transactionDuration.reason": "レイテンシが{serviceName}の{threshold}を超えています (現在の値は{measured}) ", - "xpack.apm.alertTypes.transactionDurationAnomaly.defaultActionMessage": "次の条件のため、\\{\\{alertName\\}\\}アラートが実行されています。\n\n- サービス名:\\{\\{context.serviceName\\}\\}\n- タイプ:\\{\\{context.transactionType\\}\\}\n- 環境:\\{\\{context.environment\\}\\}\n- 重要度しきい値:\\{\\{context.threshold\\}\\}%\n- 重要度値:\\{\\{context.triggerValue\\}\\}\n", - "xpack.apm.alertTypes.transactionDurationAnomaly.description": "サービスのレイテンシが異常であるときにアラートを表示します。", - "xpack.apm.alertTypes.transactionDurationAnomaly.reason": "{serviceName}の{severityLevel}異常が検知されました (スコアは{measured}) ", - "xpack.apm.alertTypes.transactionErrorRate.defaultActionMessage": "次の条件のため、\\{\\{alertName\\}\\}アラートが実行されています。\n\n- サービス名:\\{\\{context.serviceName\\}\\}\n- タイプ:\\{\\{context.transactionType\\}\\}\n- 環境:\\{\\{context.environment\\}\\}\n- しきい値:\\{\\{context.threshold\\}\\}%\n- トリガーされた値:過去\\{\\{context.interval\\}\\}にエラーの\\{\\{context.triggerValue\\}\\}%", - "xpack.apm.alertTypes.transactionErrorRate.description": "サービスのトランザクションエラー率が定義されたしきい値を超過したときにアラートを発行します。", - "xpack.apm.alertTypes.transactionErrorRate.reason": "トランザクションエラー率が{serviceName}の{threshold}を超えています (現在の値は{measured}) ", - "xpack.apm.analyzeDataButton.label": "データを分析", - "xpack.apm.analyzeDataButton.tooltip": "実験 - データの分析では、任意のディメンションの結果データを選択してフィルタリングし、パフォーマンスの問題の原因または影響を調査することができます", - "xpack.apm.analyzeDataButtonLabel": "データを分析", - "xpack.apm.analyzeDataButtonLabel.message": "実験 - データの分析では、任意のディメンションの結果データを選択してフィルタリングし、パフォーマンスの問題の原因または影響を調査することができます。", - "xpack.apm.anomaly_detection.error.invalid_license": "異常検知を使用するには、Elastic Platinumライセンスのサブスクリプションが必要です。このライセンスがあれば、機械学習を活用して、サービスを監視できます。", - "xpack.apm.anomaly_detection.error.missing_read_privileges": "異常検知ジョブを表示するには、機械学習およびAPMの「読み取り」権限が必要です", - "xpack.apm.anomaly_detection.error.missing_write_privileges": "異常検知ジョブを作成するには、機械学習およびAPMの「書き込み」権限が必要です", - "xpack.apm.anomaly_detection.error.not_available": "機械学習を利用できません", - "xpack.apm.anomaly_detection.error.not_available_in_space": "選択したスペースでは、機械学習を利用できません", - "xpack.apm.anomalyDetection.createJobs.failed.text": "APMサービス環境用に[{environments}]1つ以上の異常検知ジョブを作成しているときに問題が発生しました。エラー:「{errorMessage}」", - "xpack.apm.anomalyDetection.createJobs.failed.title": "異常検知ジョブを作成できませんでした", - "xpack.apm.anomalyDetection.createJobs.succeeded.text": "APMサービス環境[{environments}]の異常検知ジョブが正常に作成されました。機械学習がトラフィック異常値の分析を開始するには、少し時間がかかります。", - "xpack.apm.anomalyDetection.createJobs.succeeded.title": "異常検知ジョブが作成されました", - "xpack.apm.anomalyDetectionSetup.linkLabel": "異常検知", - "xpack.apm.anomalyDetectionSetup.notEnabledForEnvironmentText": "「{currentEnvironment}」環境では、まだ異常検知が有効ではありません。クリックすると、セットアップを続行します。", - "xpack.apm.anomalyDetectionSetup.notEnabledText": "異常検知はまだ有効ではありません。クリックすると、セットアップを続行します。", - "xpack.apm.api.fleet.cloud_apm_package_policy.requiredRoleOnCloud": "スーパーユーザーロールが付与されたElastic Cloudユーザーのみが操作できます。", - "xpack.apm.api.fleet.fleetSecurityRequired": "FleetおよびSecurityプラグインが必要です", - "xpack.apm.apmDescription": "アプリケーション内から自動的に詳細なパフォーマンスメトリックやエラーを集めます。", - "xpack.apm.apmSchema.index": "APMサーバースキーマ - インデックス", - "xpack.apm.apmSettings.index": "APM 設定 - インデックス", - "xpack.apm.apply.label": "適用", - "xpack.apm.chart.annotation.version": "バージョン", - "xpack.apm.chart.cpuSeries.processAverageLabel": "プロセス平均", - "xpack.apm.chart.cpuSeries.processMaxLabel": "プロセス最大", - "xpack.apm.chart.cpuSeries.systemAverageLabel": "システム平均", - "xpack.apm.chart.cpuSeries.systemMaxLabel": "システム最大", - "xpack.apm.chart.error": "データの取得時にエラーが発生しました。再試行してください", - "xpack.apm.chart.memorySeries.systemAverageLabel": "平均", - "xpack.apm.chart.memorySeries.systemMaxLabel": "最高", - "xpack.apm.clearFilters": "フィルターを消去", - "xpack.apm.correlations.correlationsTable.actionsLabel": "フィルター", - "xpack.apm.correlations.correlationsTable.excludeDescription": "値を除外", - "xpack.apm.correlations.correlationsTable.excludeLabel": "除外", - "xpack.apm.correlations.correlationsTable.filterDescription": "値でフィルタリング", - "xpack.apm.correlations.correlationsTable.filterLabel": "フィルター", - "xpack.apm.correlations.correlationsTable.loadingText": "読み込み中", - "xpack.apm.correlations.correlationsTable.noDataText": "データなし", - "xpack.apm.correlations.customize.buttonLabel": "フィールドのカスタマイズ", - "xpack.apm.correlations.customize.fieldHelpText": "相関関係を分析するフィールドをカスタマイズまたは{reset}します。{docsLink}", - "xpack.apm.correlations.customize.fieldHelpTextDocsLink": "デフォルトフィールドの詳細。", - "xpack.apm.correlations.customize.fieldHelpTextReset": "リセット", - "xpack.apm.correlations.customize.fieldLabel": "フィールド", - "xpack.apm.correlations.customize.fieldPlaceholder": "オプションを選択または作成", - "xpack.apm.correlations.customize.thresholdLabel": "しきい値", - "xpack.apm.correlations.customize.thresholdPercentile": "{percentile}パーセンタイル", - "xpack.apm.correlations.latencyCorrelations.correlationsTable.actionsLabel": "フィルター", - "xpack.apm.correlations.latencyCorrelations.correlationsTable.correlationColumnDescription": "サービスの遅延に対するフィールドの影響。0~1の範囲。", - "xpack.apm.correlations.latencyCorrelations.correlationsTable.correlationLabel": "相関関係", - "xpack.apm.correlations.latencyCorrelations.correlationsTable.excludeDescription": "値を除外", - "xpack.apm.correlations.latencyCorrelations.correlationsTable.excludeLabel": "除外", - "xpack.apm.correlations.latencyCorrelations.correlationsTable.fieldNameLabel": "フィールド名", - "xpack.apm.correlations.latencyCorrelations.correlationsTable.fieldValueLabel": "フィールド値", - "xpack.apm.correlations.latencyCorrelations.correlationsTable.filterDescription": "値でフィルタリング", - "xpack.apm.correlations.latencyCorrelations.correlationsTable.filterLabel": "フィルター", - "xpack.apm.correlations.latencyCorrelations.errorTitle": "相関関係の取得中にエラーが発生しました", - "xpack.apm.csm.breakdownFilter.browser": "ブラウザー", - "xpack.apm.csm.breakdownFilter.device": "デバイス", - "xpack.apm.csm.breakdownFilter.location": "場所", - "xpack.apm.csm.breakDownFilter.noBreakdown": "内訳なし", - "xpack.apm.csm.breakdownFilter.os": "OS", - "xpack.apm.csm.pageViews.analyze": "分析", - "xpack.apm.csm.search.url.close": "閉じる", - "xpack.apm.customLink.buttom.create": "カスタムリンクを作成", - "xpack.apm.customLink.buttom.create.title": "作成", - "xpack.apm.customLink.buttom.manage": "カスタムリンクを管理", - "xpack.apm.customLink.empty": "カスタムリンクが見つかりません。独自のカスタムリンク、たとえば特定のダッシュボードまたは外部リンクへのリンクをセットアップします。", - "xpack.apm.emptyMessage.noDataFoundDescription": "別の時間範囲を試すか検索フィルターをリセットしてください。", - "xpack.apm.emptyMessage.noDataFoundLabel": "データが見つかりません。", - "xpack.apm.error.prompt.body": "詳細はブラウザの開発者コンソールをご確認ください。", - "xpack.apm.error.prompt.title": "申し訳ございませんが、エラーが発生しました : (", - "xpack.apm.errorCountAlert.name": "エラー数しきい値", - "xpack.apm.errorCountAlertTrigger.errors": " エラー", - "xpack.apm.errorGroupDetails.culpritLabel": "原因", - "xpack.apm.errorGroupDetails.errorGroupTitle": "エラーグループ {errorGroupId}", - "xpack.apm.errorGroupDetails.errorOccurrenceTitle": "エラーのオカレンス", - "xpack.apm.errorGroupDetails.exceptionMessageLabel": "例外メッセージ", - "xpack.apm.errorGroupDetails.logMessageLabel": "ログメッセージ", - "xpack.apm.errorGroupDetails.occurrencesChartLabel": "オカレンス", - "xpack.apm.errorGroupDetails.relatedTransactionSample": "関連トランザクションサンプル", - "xpack.apm.errorGroupDetails.unhandledLabel": "未対応", - "xpack.apm.errorRate": "エラー率", - "xpack.apm.errorRate.chart.errorRate": "エラー率 (平均) ", - "xpack.apm.errorRate.chart.errorRate.previousPeriodLabel": "前の期間", - "xpack.apm.errorsTable.errorMessageAndCulpritColumnLabel": "エラーメッセージと原因", - "xpack.apm.errorsTable.groupIdColumnDescription": "スタックトレースのハッシュ。動的パラメータのため、エラーメッセージが異なる場合でも、類似したエラーをグループ化します。", - "xpack.apm.errorsTable.groupIdColumnLabel": "グループ ID", - "xpack.apm.errorsTable.latestOccurrenceColumnLabel": "最近のオカレンス", - "xpack.apm.errorsTable.noErrorsLabel": "エラーが見つかりませんでした", - "xpack.apm.errorsTable.occurrencesColumnLabel": "オカレンス", - "xpack.apm.errorsTable.typeColumnLabel": "型", - "xpack.apm.errorsTable.unhandledLabel": "未対応", - "xpack.apm.featureRegistry.apmFeatureName": "APMおよびユーザーエクスペリエンス", - "xpack.apm.feedbackMenu.appName": "APM", - "xpack.apm.fetcher.error.status": "エラー", - "xpack.apm.fetcher.error.title": "リソースの取得中にエラーが発生しました", - "xpack.apm.fetcher.error.url": "URL", - "xpack.apm.filter.environment.allLabel": "すべて", - "xpack.apm.filter.environment.label": "環境", - "xpack.apm.filter.environment.notDefinedLabel": "未定義", - "xpack.apm.filter.environment.selectEnvironmentLabel": "環境を選択", - "xpack.apm.formatters.hoursTimeUnitLabel": "h", - "xpack.apm.formatters.microsTimeUnitLabel": "マイクロ秒", - "xpack.apm.formatters.millisTimeUnitLabel": "ms", - "xpack.apm.formatters.minutesTimeUnitLabel": "分", - "xpack.apm.formatters.secondsTimeUnitLabel": "s", - "xpack.apm.header.badge.readOnly.text": "読み取り専用", - "xpack.apm.header.badge.readOnly.tooltip": "を保存できませんでした", - "xpack.apm.helpMenu.upgradeAssistantLink": "アップグレードアシスタント", - "xpack.apm.home.alertsMenu.alerts": "アラートとルール", - "xpack.apm.home.alertsMenu.createAnomalyAlert": "異常ルールを作成", - "xpack.apm.home.alertsMenu.createThresholdAlert": "しきい値ルールを作成", - "xpack.apm.home.alertsMenu.errorCount": "エラー数", - "xpack.apm.home.alertsMenu.transactionDuration": "レイテンシ", - "xpack.apm.home.alertsMenu.transactionErrorRate": "トランザクションエラー率", - "xpack.apm.home.alertsMenu.viewActiveAlerts": "ルールの管理", - "xpack.apm.home.serviceMapTabLabel": "サービスマップ", - "xpack.apm.instancesLatencyDistributionChartLegend": "インスタンス", - "xpack.apm.instancesLatencyDistributionChartLegend.previousPeriod": "前の期間", - "xpack.apm.instancesLatencyDistributionChartTitle": "インスタンスのレイテンシ分布", - "xpack.apm.instancesLatencyDistributionChartTooltipClickToFilterDescription": "クリックすると、インスタンスでフィルタリングします", - "xpack.apm.instancesLatencyDistributionChartTooltipLatencyLabel": "レイテンシ", - "xpack.apm.instancesLatencyDistributionChartTooltipThroughputLabel": "スループット", - "xpack.apm.invalidLicense.licenseManagementLink": "ライセンスを更新", - "xpack.apm.invalidLicense.message": "現在ご使用のライセンスが期限切れか有効でなくなったため、APM UI を利用できません。", - "xpack.apm.invalidLicense.title": "無効なライセンス", - "xpack.apm.jvmsTable.cpuColumnLabel": "CPU 平均", - "xpack.apm.jvmsTable.explainServiceNodeNameMissing": "これらのメトリックが所属する JVM を特定できませんでした。7.5 よりも古い APM Server を実行していることが原因である可能性が高いです。この問題は APM Server 7.5 以降にアップグレードすることで解決されます。", - "xpack.apm.jvmsTable.heapMemoryColumnLabel": "ヒープ領域の平均", - "xpack.apm.jvmsTable.nameColumnLabel": "名前", - "xpack.apm.jvmsTable.nameExplanation": "JVM 名はデフォルトでコンピューター ID (該当する場合) またはホスト名ですが、エージェントの「'service_node_name」で手動で構成することもできます。", - "xpack.apm.jvmsTable.noJvmsLabel": "JVM が見つかりませんでした", - "xpack.apm.jvmsTable.nonHeapMemoryColumnLabel": "非ヒープ領域の平均", - "xpack.apm.jvmsTable.threadCountColumnLabel": "最大スレッド数", - "xpack.apm.keyValueFilterList.actionFilterLabel": "値でフィルタリング", - "xpack.apm.license.betaBadge": "ベータ", - "xpack.apm.license.betaTooltipMessage": "現在、この機能はベータです。不具合を見つけた場合やご意見がある場合、サポートに問い合わせるか、またはディスカッションフォーラムにご報告ください。", - "xpack.apm.license.button": "トライアルを開始", - "xpack.apm.license.title": "無料の 30 日トライアルを開始", - "xpack.apm.localFilters.titles.browser": "ブラウザー", - "xpack.apm.localFilters.titles.device": "デバイス", - "xpack.apm.localFilters.titles.location": "場所", - "xpack.apm.localFilters.titles.os": "OS", - "xpack.apm.localFilters.titles.serviceName": "サービス名", - "xpack.apm.localFilters.titles.transactionUrl": "URL", - "xpack.apm.localFiltersTitle": "フィルター", - "xpack.apm.metadataTable.section.agentLabel": "エージェント", - "xpack.apm.metadataTable.section.clientLabel": "クライアント", - "xpack.apm.metadataTable.section.containerLabel": "コンテナー", - "xpack.apm.metadataTable.section.customLabel": "カスタム", - "xpack.apm.metadataTable.section.errorLabel": "エラー", - "xpack.apm.metadataTable.section.hostLabel": "ホスト", - "xpack.apm.metadataTable.section.httpLabel": "HTTP", - "xpack.apm.metadataTable.section.labelsLabel": "ラベル", - "xpack.apm.metadataTable.section.messageLabel": "メッセージ", - "xpack.apm.metadataTable.section.pageLabel": "ページ", - "xpack.apm.metadataTable.section.processLabel": "プロセス", - "xpack.apm.metadataTable.section.serviceLabel": "サービス", - "xpack.apm.metadataTable.section.spanLabel": "スパン", - "xpack.apm.metadataTable.section.traceLabel": "トレース", - "xpack.apm.metadataTable.section.transactionLabel": "トランザクション", - "xpack.apm.metadataTable.section.urlLabel": "URL", - "xpack.apm.metadataTable.section.userAgentLabel": "ユーザーエージェント", - "xpack.apm.metadataTable.section.userLabel": "ユーザー", - "xpack.apm.metrics.transactionChart.machineLearningLabel": "機械学習:", - "xpack.apm.metrics.transactionChart.machineLearningTooltip": "ストリームには、平均レイテンシの想定境界が表示されます。赤色の垂直の注釈は、異常スコアが75以上の異常値を示します。", - "xpack.apm.metrics.transactionChart.machineLearningTooltip.withKuery": "フィルタリングで検索バーを使用しているときには、機械学習結果が表示されません", - "xpack.apm.metrics.transactionChart.viewJob": "ジョブを表示", - "xpack.apm.navigation.serviceMapTitle": "サービスマップ", - "xpack.apm.navigation.servicesTitle": "サービス", - "xpack.apm.navigation.tracesTitle": "トレース", - "xpack.apm.notAvailableLabel": "N/A", - "xpack.apm.profiling.collapseSimilarFrames": "類似した項目を折りたたむ", - "xpack.apm.profiling.highlightFrames": "検索", - "xpack.apm.profiling.table.name": "名前", - "xpack.apm.profiling.table.value": "自己", - "xpack.apm.propertiesTable.agentFeature.noDataAvailableLabel": "利用可能なデータがありません", - "xpack.apm.propertiesTable.agentFeature.noResultFound": "\"{value}\"に対する結果が見つかりませんでした。", - "xpack.apm.propertiesTable.tabs.exceptionStacktraceLabel": "例外のスタックトレース", - "xpack.apm.propertiesTable.tabs.logs.serviceName": "サービス名", - "xpack.apm.propertiesTable.tabs.logsLabel": "ログ", - "xpack.apm.propertiesTable.tabs.logStacktraceLabel": "スタックトレース", - "xpack.apm.propertiesTable.tabs.metadataLabel": "メタデータ", - "xpack.apm.propertiesTable.tabs.timelineLabel": "Timeline", - "xpack.apm.rum.coreVitals.dataUndefined": "N/A", - "xpack.apm.rum.coreVitals.fcp": "初回コンテンツの描画", - "xpack.apm.rum.coreVitals.fcpTooltip": "初回コンテンツの描画 (FCP) は初期のレンダリングに集中し、ページの読み込みが開始してから、ページのコンテンツのいずれかの部分が画面に表示されるときまでの時間を測定します。", - "xpack.apm.rum.coreVitals.tbt": "合計ブロック時間", - "xpack.apm.rum.coreVitals.tbtTooltip": "合計ブロック時間 (TBT) は、初回コンテンツの描画からトランザクションが完了したときまでに発生する、各長いタスクのブロック時間 (50 ミリ秒超) の合計です。", - "xpack.apm.rum.dashboard.backend": "バックエンド", - "xpack.apm.rum.dashboard.dataMissing": "N/A", - "xpack.apm.rum.dashboard.frontend": "フロントエンド", - "xpack.apm.rum.dashboard.impactfulMetrics.highTrafficPages": "高トラフィックページ", - "xpack.apm.rum.dashboard.impactfulMetrics.jsErrors": "JavaScript エラー", - "xpack.apm.rum.dashboard.overall.label": "全体", - "xpack.apm.rum.dashboard.pageLoad.label": "ページの読み込み", - "xpack.apm.rum.dashboard.pageLoadDistribution.label": "ページ読み込み分布", - "xpack.apm.rum.dashboard.pageLoadDuration.label": "ページ読み込み時間", - "xpack.apm.rum.dashboard.pageLoadTime.label": "ページ読み込み時間 (秒) ", - "xpack.apm.rum.dashboard.pageLoadTimes.label": "ページ読み込み時間", - "xpack.apm.rum.dashboard.pagesLoaded.label": "ページが読み込まれました", - "xpack.apm.rum.dashboard.pageViews": "合計ページビュー", - "xpack.apm.rum.dashboard.resetZoom.label": "ズームをリセット", - "xpack.apm.rum.dashboard.tooltips.backEnd": "バックエンド時間は、最初の 1 バイトを受信するまでの時間 (TTFB) です。これは、要求が実行された後、最初の応答パケットが受信された時点です。", - "xpack.apm.rum.dashboard.tooltips.frontEnd": "フロントエンド時間は、合計ページ読み込み時間からバックエンド時間を減算した時間です。", - "xpack.apm.rum.dashboard.tooltips.totalPageLoad": "合計はすべてのページ読み込み時間です。", - "xpack.apm.rum.dashboard.totalPageLoad": "合計", - "xpack.apm.rum.filterGroup.breakdown": "内訳", - "xpack.apm.rum.filterGroup.coreWebVitals": "コアWebバイタル", - "xpack.apm.rum.filterGroup.seconds": "秒", - "xpack.apm.rum.filterGroup.selectBreakdown": "内訳を選択", - "xpack.apm.rum.filters.filterByUrl": "IDでフィルタリング", - "xpack.apm.rum.filters.searchResults": "{total}件の検索結果", - "xpack.apm.rum.filters.select": "選択してください", - "xpack.apm.rum.filters.topPages": "上位のページ", - "xpack.apm.rum.filters.url": "Url", - "xpack.apm.rum.filters.url.loadingResults": "結果を読み込み中", - "xpack.apm.rum.filters.url.noResults": "結果がありません", - "xpack.apm.rum.jsErrors.errorMessage": "エラーメッセージ", - "xpack.apm.rum.jsErrors.errorRate": "エラー率", - "xpack.apm.rum.jsErrors.impactedPageLoads": "影響を受けるページ読み込み数", - "xpack.apm.rum.jsErrors.totalErrors": "合計エラー数", - "xpack.apm.rum.uxMetrics.longestLongTasks": "最長タスク時間", - "xpack.apm.rum.uxMetrics.longestLongTasksTooltip": "最も長いタスクの時間。長いタスクは、UI スレッドを長時間 (50 ミリ秒以上) 独占し、他の重要なタスク (フレームレートや入力レイテンシ) の実行を妨害するユーザーアクティビティまたはブラウザータスクとして定義されます。", - "xpack.apm.rum.uxMetrics.noOfLongTasks": "時間がかかるタスク数", - "xpack.apm.rum.uxMetrics.noOfLongTasksTooltip": "長いタスクの数。長いタスクは、UI スレッドを長時間 (50 ミリ秒以上) 独占し、他の重要なタスク (フレームレートや入力レイテンシ) の実行を妨害するユーザーアクティビティまたはブラウザータスクとして定義されます。", - "xpack.apm.rum.uxMetrics.sumLongTasks": "時間がかかるタスクの合計時間", - "xpack.apm.rum.uxMetrics.sumLongTasksTooltip": "長いタスクの合計時間。長いタスクは、UI スレッドを長時間 (50 ミリ秒以上) 独占し、他の重要なタスク (フレームレートや入力レイテンシ) の実行を妨害するユーザーアクティビティまたはブラウザータスクとして定義されます。", - "xpack.apm.rum.visitorBreakdown": "アクセスユーザー内訳", - "xpack.apm.rum.visitorBreakdown.browser": "ブラウザー", - "xpack.apm.rum.visitorBreakdown.operatingSystem": "オペレーティングシステム", - "xpack.apm.rum.visitorBreakdownMap.avgPageLoadDuration": "平均ページ読み込み時間", - "xpack.apm.rum.visitorBreakdownMap.pageLoadDurationByRegion": "地域別ページ読み込み時間 (平均) ", - "xpack.apm.searchInput.filter": "フィルター...", - "xpack.apm.selectPlaceholder": "オプションを選択:", - "xpack.apm.serviceDetails.errorsTabLabel": "エラー", - "xpack.apm.serviceDetails.metrics.cpuUsageChartTitle": "CPU 使用状況", - "xpack.apm.serviceDetails.metrics.errorOccurrencesChart.title": "エラーのオカレンス", - "xpack.apm.serviceDetails.metrics.errorsList.title": "エラー", - "xpack.apm.serviceDetails.metrics.memoryUsageChartTitle": "システムメモリー使用状況", - "xpack.apm.serviceDetails.metricsTabLabel": "メトリック", - "xpack.apm.serviceDetails.nodesTabLabel": "JVM", - "xpack.apm.serviceDetails.overviewTabLabel": "概要", - "xpack.apm.serviceDetails.profilingTabExperimentalDescription": "プロファイリングは実験的機能であり、内部利用専用です。", - "xpack.apm.serviceDetails.profilingTabExperimentalLabel": "実験的", - "xpack.apm.serviceDetails.profilingTabLabel": "プロファイリング", - "xpack.apm.serviceDetails.transactionsTabLabel": "トランザクション", - "xpack.apm.serviceHealthStatus.critical": "重大", - "xpack.apm.serviceHealthStatus.healthy": "正常", - "xpack.apm.serviceHealthStatus.unknown": "不明", - "xpack.apm.serviceHealthStatus.warning": "警告", - "xpack.apm.serviceIcons.cloud": "クラウド", - "xpack.apm.serviceIcons.container": "コンテナー", - "xpack.apm.serviceIcons.service": "サービス", - "xpack.apm.serviceIcons.serviceDetails.cloud.availabilityZoneLabel": "{zones, plural, =other {可用性ゾーン}} ", - "xpack.apm.serviceIcons.serviceDetails.cloud.machineTypesLabel": "{machineTypes, plural, =other {コンピュータータイプ}} ", - "xpack.apm.serviceIcons.serviceDetails.cloud.projectIdLabel": "プロジェクト ID", - "xpack.apm.serviceIcons.serviceDetails.cloud.providerLabel": "クラウドプロバイダー", - "xpack.apm.serviceIcons.serviceDetails.container.containerizedLabel": "コンテナー化", - "xpack.apm.serviceIcons.serviceDetails.container.noLabel": "いいえ", - "xpack.apm.serviceIcons.serviceDetails.container.orchestrationLabel": "オーケストレーション", - "xpack.apm.serviceIcons.serviceDetails.container.osLabel": "OS", - "xpack.apm.serviceIcons.serviceDetails.container.totalNumberInstancesLabel": "インスタンスの合計数", - "xpack.apm.serviceIcons.serviceDetails.container.yesLabel": "はい", - "xpack.apm.serviceIcons.serviceDetails.service.agentLabel": "エージェント名・バージョン", - "xpack.apm.serviceIcons.serviceDetails.service.frameworkLabel": "フレームワーク名", - "xpack.apm.serviceIcons.serviceDetails.service.runtimeLabel": "ランタイム名・バージョン", - "xpack.apm.serviceIcons.serviceDetails.service.versionLabel": "サービスバージョン", - "xpack.apm.serviceInventory.mlNudgeMessageTitle": "異常検知を有効にして、正常性ステータスインジケーターをサービスに追加します", - "xpack.apm.serviceInventory.toastText": "現在 Elastic Stack 7.0+ を実行中で、以前のバージョン 6.x からの互換性のないデータを検知しました。このデータを APM で表示するには、移行が必要です。詳細 ", - "xpack.apm.serviceInventory.toastTitle": "選択された時間範囲内にレガシーデータが検知されました。", - "xpack.apm.serviceInventory.upgradeAssistantLinkText": "アップグレードアシスタント", - "xpack.apm.serviceMap.anomalyDetectionPopoverDisabled": "APM 設定で異常検知を有効にすると、サービス正常性インジケーターが表示されます。", - "xpack.apm.serviceMap.anomalyDetectionPopoverLink": "異常を表示", - "xpack.apm.serviceMap.anomalyDetectionPopoverNoData": "選択した時間範囲で、異常スコアを検出できませんでした。異常エクスプローラーで詳細を確認してください。", - "xpack.apm.serviceMap.anomalyDetectionPopoverScoreMetric": "スコア (最大) ", - "xpack.apm.serviceMap.anomalyDetectionPopoverTitle": "異常検知", - "xpack.apm.serviceMap.anomalyDetectionPopoverTooltip": "サービス正常性インジケーターは、機械学習の異常検知に基づいています。", - "xpack.apm.serviceMap.avgCpuUsagePopoverStat": "CPU使用状況 (平均) ", - "xpack.apm.serviceMap.avgMemoryUsagePopoverStat": "メモリー使用状況 (平均) ", - "xpack.apm.serviceMap.avgReqPerMinutePopoverMetric": "スループット (平均) ", - "xpack.apm.serviceMap.avgTransDurationPopoverStat": "レイテンシ (平均) ", - "xpack.apm.serviceMap.center": "中央", - "xpack.apm.serviceMap.download": "ダウンロード", - "xpack.apm.serviceMap.emptyBanner.docsLink": "詳細はドキュメントをご覧ください", - "xpack.apm.serviceMap.emptyBanner.message": "接続されているサービスや外部リクエストを検出できる場合、システムはそれらをマップします。最新版の APM エージェントが動作していることを確認してください。", - "xpack.apm.serviceMap.emptyBanner.title": "単一のサービスしかないようです。", - "xpack.apm.serviceMap.errorRatePopoverStat": "トランザクションエラー率 (平均) ", - "xpack.apm.serviceMap.focusMapButtonText": "焦点マップ", - "xpack.apm.serviceMap.invalidLicenseMessage": "サービスマップを利用するには、Elastic Platinum ライセンスが必要です。これにより、APM データとともにアプリケーションスタックすべてを可視化することができるようになります。", - "xpack.apm.serviceMap.noServicesPromptDescription": "現在選択されている時間範囲と環境内では、マッピングするサービスが見つかりません。別の範囲を試すか、選択した環境を確認してください。サービスがない場合は、セットアップ手順に従って開始してください。", - "xpack.apm.serviceMap.noServicesPromptTitle": "サービスが利用できません", - "xpack.apm.serviceMap.resourceCountLabel": "{count}個のリソース", - "xpack.apm.serviceMap.serviceDetailsButtonText": "サービス詳細", - "xpack.apm.serviceMap.subtypePopoverStat": "サブタイプ", - "xpack.apm.serviceMap.timeoutPrompt.docsLink": "APM 設定の詳細については、ドキュメントを参照してください", - "xpack.apm.serviceMap.timeoutPromptDescription": "サービスマップのデータの取得中にタイムアウトしました。時間範囲を狭めて範囲を制限するか、小さい値で構成設定「{configName}」を使用してください。", - "xpack.apm.serviceMap.timeoutPromptTitle": "サービスマップタイムアウト", - "xpack.apm.serviceMap.typePopoverStat": "型", - "xpack.apm.serviceMap.viewFullMap": "サービスの全体マップを表示", - "xpack.apm.serviceMap.zoomIn": "ズームイン", - "xpack.apm.serviceMap.zoomOut": "ズームアウト", - "xpack.apm.serviceNodeMetrics.containerId": "コンテナー ID", - "xpack.apm.serviceNodeMetrics.host": "ホスト", - "xpack.apm.serviceNodeMetrics.serviceName": "サービス名", - "xpack.apm.serviceNodeMetrics.unidentifiedServiceNodesWarningDocumentationLink": "APM Server のドキュメンテーション", - "xpack.apm.serviceNodeMetrics.unidentifiedServiceNodesWarningText": "これらのメトリックが所属する JVM を特定できませんでした。7.5 よりも古い APM Server を実行していることが原因である可能性が高いです。この問題は APM Server 7.5 以降にアップグレードすることで解決されます。アップグレードに関する詳細は、{link} をご覧ください。代わりに Kibana クエリバーを使ってホスト名、コンテナー ID、またはその他フィールドでフィルタリングすることもできます。", - "xpack.apm.serviceNodeMetrics.unidentifiedServiceNodesWarningTitle": "JVM を特定できませんでした", - "xpack.apm.serviceNodeNameMissing": " (空) ", - "xpack.apm.serviceOveriew.errorsTableOccurrences": "{occurrencesCount} occ.", - "xpack.apm.serviceOverview.dependenciesTableTitle": "依存関係", - "xpack.apm.serviceOverview.errorsTableColumnLastSeen": "前回の認識", - "xpack.apm.serviceOverview.errorsTableColumnName": "名前", - "xpack.apm.serviceOverview.errorsTableColumnOccurrences": "オカレンス", - "xpack.apm.serviceOverview.errorsTableLinkText": "エラーを表示", - "xpack.apm.serviceOverview.errorsTableTitle": "エラー", - "xpack.apm.serviceOverview.instancesTable.actionMenus.container.subtitle": "このコンテナーのログとインデックスを表示し、さらに詳細を確認できます。", - "xpack.apm.serviceOverview.instancesTable.actionMenus.container.title": "コンテナーの詳細", - "xpack.apm.serviceOverview.instancesTable.actionMenus.containerLogs": "コンテナーログ", - "xpack.apm.serviceOverview.instancesTable.actionMenus.containerMetrics": "コンテナーメトリック", - "xpack.apm.serviceOverview.instancesTable.actionMenus.filterByInstance": "インスタンスで概要をフィルタリング", - "xpack.apm.serviceOverview.instancesTable.actionMenus.metrics": "メトリック", - "xpack.apm.serviceOverview.instancesTable.actionMenus.pod.subtitle": "このポッドのログとメトリックを表示し、さらに詳細を確認できます。", - "xpack.apm.serviceOverview.instancesTable.actionMenus.pod.title": "ポッドの詳細", - "xpack.apm.serviceOverview.instancesTable.actionMenus.podLogs": "ポッドログ", - "xpack.apm.serviceOverview.instancesTable.actionMenus.podMetrics": "ポッドメトリック", - "xpack.apm.serviceOverview.instancesTableColumnCpuUsage": "CPU使用状況 (平均) ", - "xpack.apm.serviceOverview.instancesTableColumnErrorRate": "エラー率", - "xpack.apm.serviceOverview.instancesTableColumnMemoryUsage": "メモリー使用状況 (平均) ", - "xpack.apm.serviceOverview.instancesTableColumnNodeName": "ノード名", - "xpack.apm.serviceOverview.instancesTableColumnThroughput": "スループット", - "xpack.apm.serviceOverview.instancesTableTitle": "インスタンス", - "xpack.apm.serviceOverview.instanceTable.details.cloudTitle": "クラウド", - "xpack.apm.serviceOverview.instanceTable.details.containerTitle": "コンテナー", - "xpack.apm.serviceOverview.instanceTable.details.serviceTitle": "サービス", - "xpack.apm.serviceOverview.latencyChartTitle": "レイテンシ", - "xpack.apm.serviceOverview.latencyChartTitle.prepend": "メトリック", - "xpack.apm.serviceOverview.latencyChartTitle.previousPeriodLabel": "前の期間", - "xpack.apm.serviceOverview.latencyColumnAvgLabel": "レイテンシ (平均) ", - "xpack.apm.serviceOverview.latencyColumnDefaultLabel": "レイテンシ", - "xpack.apm.serviceOverview.latencyColumnP95Label": "レイテンシ (95 番目) ", - "xpack.apm.serviceOverview.latencyColumnP99Label": "レイテンシ (99 番目) ", - "xpack.apm.serviceOverview.mlNudgeMessage.content": "APM の異常検知統合で、異常なトランザクションを特定し、アップストリームおよびダウンストリームサービスの正常性を確認します。わずか数分で開始できます。", - "xpack.apm.serviceOverview.mlNudgeMessage.dismissButton": "閉じる", - "xpack.apm.serviceOverview.mlNudgeMessage.learnMoreButton": "使ってみる", - "xpack.apm.serviceOverview.throughtputChart.previousPeriodLabel": "前の期間", - "xpack.apm.serviceOverview.throughtputChartTitle": "スループット", - "xpack.apm.serviceOverview.transactionsTableColumnErrorRate": "エラー率", - "xpack.apm.serviceOverview.transactionsTableColumnImpact": "インパクト", - "xpack.apm.serviceOverview.transactionsTableColumnName": "名前", - "xpack.apm.serviceOverview.transactionsTableColumnThroughput": "スループット", - "xpack.apm.serviceProfiling.valueTypeLabel.allocObjects": "Alloc. objects", - "xpack.apm.serviceProfiling.valueTypeLabel.allocSpace": "Alloc. space", - "xpack.apm.serviceProfiling.valueTypeLabel.cpuTime": "On-CPU", - "xpack.apm.serviceProfiling.valueTypeLabel.inuseObjects": "使用中のオブジェクト", - "xpack.apm.serviceProfiling.valueTypeLabel.inuseSpace": "使用中のスペース", - "xpack.apm.serviceProfiling.valueTypeLabel.samples": "サンプル", - "xpack.apm.serviceProfiling.valueTypeLabel.unknown": "その他", - "xpack.apm.serviceProfiling.valueTypeLabel.wallTime": "Wall", - "xpack.apm.servicesTable.7xOldDataMessage": "また、移行が必要な古いデータがある可能性もあります。", - "xpack.apm.servicesTable.7xUpgradeServerMessage": "バージョン7.xより前からのアップグレードですか?また、\n APM Server インスタンスを7.0以降にアップグレードしていることも確認してください。", - "xpack.apm.servicesTable.environmentColumnLabel": "環境", - "xpack.apm.servicesTable.healthColumnLabel": "ヘルス", - "xpack.apm.servicesTable.latencyAvgColumnLabel": "レイテンシ (平均) ", - "xpack.apm.servicesTable.metricsExplanationLabel": "これらのメトリックは何か。", - "xpack.apm.servicesTable.nameColumnLabel": "名前", - "xpack.apm.servicesTable.noServicesLabel": "APM サービスがインストールされていないようです。追加しましょう!", - "xpack.apm.servicesTable.notFoundLabel": "サービスが見つかりません", - "xpack.apm.servicesTable.throughputColumnLabel": "スループット", - "xpack.apm.servicesTable.tooltip.metricsExplanation": "サービスメトリックは、トランザクションタイプ「要求」、「ページ読み込み」、または上位の使用可能なトランザクションタイプのいずれかで集計されます。", - "xpack.apm.servicesTable.transactionColumnLabel": "トランザクションタイプ", - "xpack.apm.servicesTable.transactionErrorRate": "エラー率%", - "xpack.apm.servicesTable.UpgradeAssistantLink": "Kibana アップグレードアシスタントで詳細をご覧ください", - "xpack.apm.settings.agentConfig": "エージェントの編集", - "xpack.apm.settings.agentConfig.createConfigButton.tooltip": "エージェント構成を作成する権限がありません", - "xpack.apm.settings.agentConfig.descriptionText": "APMアプリ内からエージェント構成を微調整してください。変更はAPMエージェントに自動的に伝達されるので、再デプロイする必要はありません。", - "xpack.apm.settings.anomaly_detection.legacy_jobs.body": "以前の統合のレガシー機械学習ジョブが見つかりました。これは、APMアプリでは使用されていません。", - "xpack.apm.settings.anomaly_detection.legacy_jobs.button": "ジョブの確認", - "xpack.apm.settings.anomaly_detection.legacy_jobs.title": "レガシーMLジョブはAPMアプリで使用されていません。", - "xpack.apm.settings.anomalyDetection": "異常検知", - "xpack.apm.settings.anomalyDetection.addEnvironments.cancelButtonText": "キャンセル", - "xpack.apm.settings.anomalyDetection.addEnvironments.createJobsButtonText": "ジョブの作成", - "xpack.apm.settings.anomalyDetection.addEnvironments.descriptionText": "異常検知を有効にするサービス環境を選択してください。異常は選択した環境内のすべてのサービスとトランザクションタイプで表面化します。", - "xpack.apm.settings.anomalyDetection.addEnvironments.selectorLabel": "環境", - "xpack.apm.settings.anomalyDetection.addEnvironments.selectorPlaceholder": "環境を選択または追加", - "xpack.apm.settings.anomalyDetection.addEnvironments.titleText": "環境を選択", - "xpack.apm.settings.anomalyDetection.jobList.actionColumnLabel": "アクション", - "xpack.apm.settings.anomalyDetection.jobList.addEnvironments": "MLジョブを作成", - "xpack.apm.settings.anomalyDetection.jobList.emptyListText": "異常検知ジョブがありません。", - "xpack.apm.settings.anomalyDetection.jobList.environmentColumnLabel": "環境", - "xpack.apm.settings.anomalyDetection.jobList.environments": "環境", - "xpack.apm.settings.anomalyDetection.jobList.failedFetchText": "異常検知ジョブを取得できません。", - "xpack.apm.settings.anomalyDetection.jobList.mlDescriptionText": "異常検知を新しい環境に追加するには、機械学習ジョブを作成します。既存の機械学習ジョブは、{mlJobsLink}で管理できます。", - "xpack.apm.settings.anomalyDetection.jobList.mlDescriptionText.mlJobsLinkText": "機械学習", - "xpack.apm.settings.anomalyDetection.jobList.mlJobLinkText": "MLでジョブを表示", - "xpack.apm.settings.apmIndices.applyButton": "変更を適用", - "xpack.apm.settings.apmIndices.applyChanges.failed.text": "インデックスの適用時に何か問題が発生しました。エラー:{errorMessage}", - "xpack.apm.settings.apmIndices.applyChanges.failed.title": "インデックスが適用できませんでした。", - "xpack.apm.settings.apmIndices.applyChanges.succeeded.text": "インデックスの変更の適用に成功しました。これらの変更は、APM UIで直ちに反映されます。", - "xpack.apm.settings.apmIndices.applyChanges.succeeded.title": "適用されるインデックス", - "xpack.apm.settings.apmIndices.cancelButton": "キャンセル", - "xpack.apm.settings.apmIndices.description": "APM UI は、APM インデックスをクエリするためにインデックスパターンを使用しています。APM Server がイベントを書き込むインデックス名をカスタマイズした場合、APM UI が機能するにはこれらパターンをアップデートする必要がある場合があります。ここの設定は、 kibana.yml で設定されたものよりも優先します。", - "xpack.apm.settings.apmIndices.errorIndicesLabel": "エラーインデックス", - "xpack.apm.settings.apmIndices.helpText": "上書き {configurationName}: {defaultValue}", - "xpack.apm.settings.apmIndices.metricsIndicesLabel": "メトリックインデックス", - "xpack.apm.settings.apmIndices.noPermissionTooltipLabel": "ユーザーロールには、APMインデックスを変更する権限がありません", - "xpack.apm.settings.apmIndices.onboardingIndicesLabel": "オンボーディングインデックス", - "xpack.apm.settings.apmIndices.sourcemapIndicesLabel": "ソースマップインデックス", - "xpack.apm.settings.apmIndices.spanIndicesLabel": "スパンインデックス", - "xpack.apm.settings.apmIndices.title": "インデックス", - "xpack.apm.settings.apmIndices.transactionIndicesLabel": "トランザクションインデックス", - "xpack.apm.settings.createApmPackagePolicy.errorToast.title": "クラウドエージェントポリシーでAPMパッケージポリシーを作成できません", - "xpack.apm.settings.customizeApp": "アプリをカスタマイズ", - "xpack.apm.settings.customizeUI.customLink": "カスタムリンク", - "xpack.apm.settings.customizeUI.customLink.create.failed": "リンクを保存できませんでした!", - "xpack.apm.settings.customizeUI.customLink.create.failed.message": "リンクを保存するときに問題が発生しました。エラー:「{errorMessage}」", - "xpack.apm.settings.customizeUI.customLink.create.successed": "リンクを保存しました。", - "xpack.apm.settings.customizeUI.customLink.createCustomLink": "カスタムリンクを作成", - "xpack.apm.settings.customizeUI.customLink.default.label": "Elastic.co", - "xpack.apm.settings.customizeUI.customLink.default.url": "https://www.elastic.co", - "xpack.apm.settings.customizeUI.customLink.delete": "削除", - "xpack.apm.settings.customizeUI.customLink.delete.failed": "カスタムリンクを削除できませんでした", - "xpack.apm.settings.customizeUI.customLink.delete.successed": "カスタムリンクを削除しました。", - "xpack.apm.settings.customizeUI.customLink.emptyPromptText": "変更しましょう。サービスごとのトランザクションの詳細でアクションコンテキストメニューにカスタムリンクを追加できます。自社のサポートポータルへの役立つリンクを作成するか、新しい不具合レポートを発行します。詳細はドキュメントをご覧ください。", - "xpack.apm.settings.customizeUI.customLink.emptyPromptTitle": "リンクが見つかりません。", - "xpack.apm.settings.customizeUI.customLink.flyout.action.title": "リンク", - "xpack.apm.settings.customizeUI.customLink.flyout.close": "閉じる", - "xpack.apm.settings.customizeUI.customLink.flyout.filters.addAnotherFilter": "別のフィルターを追加", - "xpack.apm.settings.customizeUI.customLink.flyOut.filters.defaultOption": "フィールドを選択してください...", - "xpack.apm.settings.customizeUI.customLink.flyOut.filters.defaultOption.value": "値", - "xpack.apm.settings.customizeUI.customLink.flyout.filters.prepend": "フィールド", - "xpack.apm.settings.customizeUI.customLink.flyout.filters.subtitle": "フィルターオプションを使用すると、特定のサービスについてのみ表示されるようにスコープを設定できます。", - "xpack.apm.settings.customizeUI.customLink.flyout.filters.title": "フィルター", - "xpack.apm.settings.customizeUI.customLink.flyout.label": "リンクは APM アプリ全体にわたるトランザクション詳細のコンテキストで利用できるようになります。作成できるリンクの数は無制限です。トランザクションメタデータのいずれかを使用することで、動的変数を参照して URL を入力できます。さらなる詳細および例がドキュメンテーションに記載されています", - "xpack.apm.settings.customizeUI.customLink.flyout.label.doc": "ドキュメンテーション", - "xpack.apm.settings.customizeUI.customLink.flyout.link.label": "ラベル", - "xpack.apm.settings.customizeUI.customLink.flyout.link.label.helpText": "これはアクションコンテキストメニューに表示されるラベルです。できるだけ短くしてください。", - "xpack.apm.settings.customizeUI.customLink.flyout.link.label.placeholder": "例:サポートチケット", - "xpack.apm.settings.customizeUI.customLink.flyout.link.url": "URL", - "xpack.apm.settings.customizeUI.customLink.flyout.link.url.doc": "詳細はドキュメントをご覧ください。", - "xpack.apm.settings.customizeUI.customLink.flyout.link.url.helpText": "URL にフィールド名変数 (例:{sample}) を追加すると値を適用できます。", - "xpack.apm.settings.customizeUI.customLink.flyout.link.url.placeholder": "例:https://www.elastic.co/", - "xpack.apm.settings.customizeUI.customLink.flyout.required": "必須", - "xpack.apm.settings.customizeUI.customLink.flyout.save": "保存", - "xpack.apm.settings.customizeUI.customLink.flyout.title": "リンクを作成", - "xpack.apm.settings.customizeUI.customLink.info": "これらのリンクは、トランザクション詳細などによって、アプリの選択した領域にあるアクションコンテキストメニューに表示されます。", - "xpack.apm.settings.customizeUI.customLink.license.text": "カスタムリンクを作成するには、Elastic Gold 以上のライセンスが必要です。適切なライセンスがあれば、カスタムリンクを作成してサービスを分析する際にワークフローを改良できます。", - "xpack.apm.settings.customizeUI.customLink.linkPreview.descrition": "上記のフィルターに基づき、サンプルトランザクションドキュメントの値でリンクをテストしてください。", - "xpack.apm.settings.customizeUI.customLink.noPermissionTooltipLabel": "ユーザーロールには、カスタムリンクを作成する権限がありません", - "xpack.apm.settings.customizeUI.customLink.preview.contextVariable.invalid": "無効な変数が定義されているため、サンプルトランザクションドキュメントが見つかりませんでした。", - "xpack.apm.settings.customizeUI.customLink.preview.contextVariable.noMatch": "{variables} に一致する値がサンプルトランザクションドキュメント内にありませんでした。", - "xpack.apm.settings.customizeUI.customLink.preview.transaction.notFound": "定義されたフィルターに基づき、一致するトランザクションドキュメントが見つかりませんでした。", - "xpack.apm.settings.customizeUI.customLink.previewSectionTitle": "プレビュー", - "xpack.apm.settings.customizeUI.customLink.searchInput.filter": "名前と URL でリンクをフィルタリング...", - "xpack.apm.settings.customizeUI.customLink.table.editButtonDescription": "このカスタムリンクを編集", - "xpack.apm.settings.customizeUI.customLink.table.editButtonLabel": "編集", - "xpack.apm.settings.customizeUI.customLink.table.lastUpdated": "最終更新", - "xpack.apm.settings.customizeUI.customLink.table.name": "名前", - "xpack.apm.settings.customizeUI.customLink.table.noResultFound": "\"{value}\"に対する結果が見つかりませんでした。", - "xpack.apm.settings.customizeUI.customLink.table.url": "URL", - "xpack.apm.settings.indices": "インデックス", - "xpack.apm.settings.schema": "スキーマ", - "xpack.apm.settings.schema.confirm.apmServerSettingsCloudLinkText": "クラウドでAPMサーバー設定に移動", - "xpack.apm.settings.schema.confirm.cancelText": "キャンセル", - "xpack.apm.settings.schema.confirm.checkboxLabel": "データストリームに切り替えることを確認する", - "xpack.apm.settings.schema.confirm.descriptionText": "現在、スタック監視はFleetで管理されたAPMではサポートされていません。", - "xpack.apm.settings.schema.confirm.irreversibleWarning.message": "移行中には一時的にAPMデータ収集に影響する可能性があります。移行プロセスは数分で完了します。", - "xpack.apm.settings.schema.confirm.irreversibleWarning.title": "データストリームへの切り替えは元に戻せません。", - "xpack.apm.settings.schema.confirm.switchButtonText": "データストリームに切り替える", - "xpack.apm.settings.schema.confirm.title": "選択内容を確認してください", - "xpack.apm.settings.schema.confirm.unsupportedConfigs.descriptionText": "互換性のあるカスタムapm-server.ymlユーザー設定がFleetサーバー設定に移動されます。削除する前に互換性のない設定について通知されます。", - "xpack.apm.settings.schema.confirm.unsupportedConfigs.title": "次のapm-server.ymlユーザー設定は互換性がないため削除されます", - "xpack.apm.settings.schema.descriptionText": "クラシックAPMインデックスから切り替え、新しいデータストリーム機能をすぐに活用するためのシンプルでシームレスなプロセスを構築しました。このアクションは{irreversibleEmphasis}。また、Fleetへのアクセス権が付与された{superuserEmphasis}のみが実行できます。{dataStreamsDocLink}の詳細を参照してください。", - "xpack.apm.settings.schema.descriptionText.dataStreamsDocLinkText": "データストリーム", - "xpack.apm.settings.schema.descriptionText.irreversibleEmphasisText": "元に戻せません", - "xpack.apm.settings.schema.descriptionText.superuserEmphasisText": "スーパーユーザー", - "xpack.apm.settings.schema.disabledReason": "データストリームへの切り替えを使用できません: {reasons}", - "xpack.apm.settings.schema.disabledReason.cloudApmMigrationEnabled": "クラウド移行が有効ではありません", - "xpack.apm.settings.schema.disabledReason.hasCloudAgentPolicy": "クラウドエージェントポリシーが存在しません", - "xpack.apm.settings.schema.disabledReason.hasRequiredRole": "ユーザーにはスーパーユーザーロールがありません", - "xpack.apm.settings.schema.migrate.classicIndices.currentSetup": "現在の設定", - "xpack.apm.settings.schema.migrate.classicIndices.description": "現在、データのクラシックAPMインデックスを使用しています。このデータスキーマは廃止予定であり、Elastic Stackバージョン8.0でデータストリームに置換されます。", - "xpack.apm.settings.schema.migrate.classicIndices.title": "クラシックAPMインデックス", - "xpack.apm.settings.schema.migrate.dataStreams.betaBadge.description": "データストリームへの切り替えはGAではありません。不具合が発生したら報告してください。", - "xpack.apm.settings.schema.migrate.dataStreams.betaBadge.label": "ベータ", - "xpack.apm.settings.schema.migrate.dataStreams.betaBadge.title": "データストリーム", - "xpack.apm.settings.schema.migrate.dataStreams.buttonText": "データストリームに切り替える", - "xpack.apm.settings.schema.migrate.dataStreams.description": "今後、新しく取り込まれたデータはすべてデータストリームに格納されます。以前に取り込まれたデータはクラシックAPMインデックスに残ります。APMおよびUXアプリは引き続き両方のインデックスをサポートします。", - "xpack.apm.settings.schema.migrate.dataStreams.title": "データストリーム", - "xpack.apm.settings.schema.success.description": "APM統合が設定されました。現在導入されているエージェントからデータを受信できます。統合に適用されたポリシーは自由に確認できます。", - "xpack.apm.settings.schema.success.returnText": "あるいは、{serviceInventoryLink}に戻ることができます。", - "xpack.apm.settings.schema.success.returnText.serviceInventoryLink": "サービスインベントリ", - "xpack.apm.settings.schema.success.title": "データストリームが正常に設定されました。", - "xpack.apm.settings.schema.success.viewIntegrationInFleet.buttonText": "FleetでAPM統合を表示", - "xpack.apm.settings.title": "設定", - "xpack.apm.settings.unsupportedConfigs.errorToast.title": "APMサーバー設定を取り込めません", - "xpack.apm.settingsLinkLabel": "設定", - "xpack.apm.setupInstructionsButtonLabel": "セットアップの手順", - "xpack.apm.significanTerms.license.text": "相関関係APIを使用するには、Elastic Platinumライセンスのサブスクリプションが必要です。", - "xpack.apm.stacktraceTab.causedByFramesToogleButtonLabel": "作成元", - "xpack.apm.stacktraceTab.localVariablesToogleButtonLabel": "ローカル変数", - "xpack.apm.stacktraceTab.noStacktraceAvailableLabel": "利用可能なスタックトレースがありません。", - "xpack.apm.timeComparison.label": "比較", - "xpack.apm.timeComparison.select.dayBefore": "前の日", - "xpack.apm.timeComparison.select.weekBefore": "前の週", - "xpack.apm.toggleHeight.showLessButtonLabel": "表示する行数を減らす", - "xpack.apm.toggleHeight.showMoreButtonLabel": "表示する行数を増やす", - "xpack.apm.tracesTable.avgResponseTimeColumnLabel": "レイテンシ (平均) ", - "xpack.apm.tracesTable.impactColumnDescription": "ご利用のサービスで最も頻繁に使用されていて、最も遅いエンドポイントです。レイテンシとスループットを乗算した結果です", - "xpack.apm.tracesTable.impactColumnLabel": "インパクト", - "xpack.apm.tracesTable.nameColumnLabel": "名前", - "xpack.apm.tracesTable.notFoundLabel": "このクエリのトレースが見つかりません", - "xpack.apm.tracesTable.originatingServiceColumnLabel": "発生元サービス", - "xpack.apm.tracesTable.tracesPerMinuteColumnLabel": "1 分あたりのトレース", - "xpack.apm.transactionActionMenu.actionsButtonLabel": "調査", - "xpack.apm.transactionActionMenu.container.subtitle": "このコンテナーのログとインデックスを表示し、さらに詳細を確認できます。", - "xpack.apm.transactionActionMenu.container.title": "コンテナーの詳細", - "xpack.apm.transactionActionMenu.customLink.section": "カスタムリンク", - "xpack.apm.transactionActionMenu.customLink.showAll": "すべて表示", - "xpack.apm.transactionActionMenu.customLink.showFewer": "簡易表示", - "xpack.apm.transactionActionMenu.customLink.subtitle": "リンクは新しいウィンドウで開きます。", - "xpack.apm.transactionActionMenu.host.subtitle": "ホストログとメトリックを表示し、さらに詳細を確認できます。", - "xpack.apm.transactionActionMenu.host.title": "ホストの詳細", - "xpack.apm.transactionActionMenu.pod.subtitle": "このポッドのログとメトリックを表示し、さらに詳細を確認できます。", - "xpack.apm.transactionActionMenu.pod.title": "ポッドの詳細", - "xpack.apm.transactionActionMenu.showContainerLogsLinkLabel": "コンテナーログ", - "xpack.apm.transactionActionMenu.showContainerMetricsLinkLabel": "コンテナーメトリック", - "xpack.apm.transactionActionMenu.showHostLogsLinkLabel": "ホストログ", - "xpack.apm.transactionActionMenu.showHostMetricsLinkLabel": "ホストメトリック", - "xpack.apm.transactionActionMenu.showPodLogsLinkLabel": "ポッドログ", - "xpack.apm.transactionActionMenu.showPodMetricsLinkLabel": "ポッドメトリック", - "xpack.apm.transactionActionMenu.showTraceLogsLinkLabel": "トレースログ", - "xpack.apm.transactionActionMenu.status.subtitle": "ステータスを表示し、さらに詳細を確認できます。", - "xpack.apm.transactionActionMenu.status.title": "ステータスの詳細", - "xpack.apm.transactionActionMenu.trace.subtitle": "トレースログを表示し、さらに詳細を確認できます。", - "xpack.apm.transactionActionMenu.trace.title": "トレースの詳細", - "xpack.apm.transactionActionMenu.viewInUptime": "ステータス", - "xpack.apm.transactionActionMenu.viewSampleDocumentLinkLabel": "サンプルドキュメントを表示", - "xpack.apm.transactionBreakdown.chartTitle": "スパンタイプ別時間", - "xpack.apm.transactionDetails.noTraceParentButtonTooltip": "トレースの親が見つかりませんでした", - "xpack.apm.transactionDetails.percentOfTraceLabelExplanation": "{parentType, select, transaction {トランザクション} trace {トレース} }の割合が100%を超えています。これは、この{childType, select, span {スパン} transaction {トランザクション} }がルートトランザクションよりも時間がかかるためです。", - "xpack.apm.transactionDetails.requestMethodLabel": "リクエストメソッド", - "xpack.apm.transactionDetails.resultLabel": "結果", - "xpack.apm.transactionDetails.serviceLabel": "サービス", - "xpack.apm.transactionDetails.servicesTitle": "サービス", - "xpack.apm.transactionDetails.spanFlyout.databaseStatementTitle": "データベースステートメント", - "xpack.apm.transactionDetails.spanFlyout.nameLabel": "名前", - "xpack.apm.transactionDetails.spanFlyout.spanAction": "アクション", - "xpack.apm.transactionDetails.spanFlyout.spanDetailsTitle": "スパン詳細", - "xpack.apm.transactionDetails.spanFlyout.spanSubtype": "サブタイプ", - "xpack.apm.transactionDetails.spanFlyout.spanType": "型", - "xpack.apm.transactionDetails.spanFlyout.spanType.navigationTimingLabel": "ナビゲーションタイミング", - "xpack.apm.transactionDetails.spanFlyout.stackTraceTabLabel": "スタックトレース", - "xpack.apm.transactionDetails.spanFlyout.viewSpanInDiscoverButtonLabel": "Discover でスパンを表示", - "xpack.apm.transactionDetails.spanTypeLegendTitle": "型", - "xpack.apm.transactionDetails.statusCode": "ステータスコード", - "xpack.apm.transactionDetails.syncBadgeAsync": "非同期", - "xpack.apm.transactionDetails.syncBadgeBlocking": "ブロック", - "xpack.apm.transactionDetails.traceNotFound": "選択されたトレースが見つかりません", - "xpack.apm.transactionDetails.traceSampleTitle": "トレースのサンプル", - "xpack.apm.transactionDetails.transactionLabel": "トランザクション", - "xpack.apm.transactionDetails.transFlyout.callout.agentDroppedSpansMessage": "このトランザクションを報告した APM エージェントが、構成に基づき {dropped} 個以上のスパンをドロップしました。", - "xpack.apm.transactionDetails.transFlyout.callout.learnMoreAboutDroppedSpansLinkText": "ドロップされたスパンの詳細。", - "xpack.apm.transactionDetails.transFlyout.transactionDetailsTitle": "トランザクションの詳細", - "xpack.apm.transactionDetails.userAgentAndVersionLabel": "ユーザーエージェントとバージョン", - "xpack.apm.transactionDetails.viewFullTraceButtonLabel": "完全なトレースを表示", - "xpack.apm.transactionDetails.viewingFullTraceButtonTooltip": "現在完全なトレースが表示されています", - "xpack.apm.transactionDurationAlert.aggregationType.95th": "95 パーセンタイル", - "xpack.apm.transactionDurationAlert.aggregationType.99th": "99 パーセンタイル", - "xpack.apm.transactionDurationAlert.aggregationType.avg": "平均", - "xpack.apm.transactionDurationAlert.name": "レイテンシしきい値", - "xpack.apm.transactionDurationAlertTrigger.ms": "ms", - "xpack.apm.transactionDurationAlertTrigger.when": "タイミング", - "xpack.apm.transactionDurationAnomalyAlert.name": "レイテンシ異常値", - "xpack.apm.transactionDurationAnomalyAlertTrigger.anomalySeverity": "異常と重要度があります", - "xpack.apm.transactionDurationLabel": "期間", - "xpack.apm.transactionErrorRateAlert.name": "トランザクションエラー率しきい値", - "xpack.apm.transactionErrorRateAlertTrigger.isAbove": "より大きい", - "xpack.apm.transactions.latency.chart.95thPercentileLabel": "95 パーセンタイル", - "xpack.apm.transactions.latency.chart.99thPercentileLabel": "99 パーセンタイル", - "xpack.apm.transactions.latency.chart.averageLabel": "平均", - "xpack.apm.tutorial.agent_config.choosePolicy.helper": "選択したポリシー構成を下のスニペットに追加します。", - "xpack.apm.tutorial.agent_config.choosePolicyLabel": "ポリシーを選択", - "xpack.apm.tutorial.agent_config.defaultStandaloneConfig": "デフォルトのダッシュボード構成", - "xpack.apm.tutorial.agent_config.fleetPoliciesLabel": "Fleetポリシー", - "xpack.apm.tutorial.agent_config.getStartedWithFleet": "Fleetの基本", - "xpack.apm.tutorial.agent_config.manageFleetPolicies": "Fleetポリシーの管理", - "xpack.apm.tutorial.apmAgents.statusCheck.btnLabel": "エージェントステータスを確認", - "xpack.apm.tutorial.apmAgents.statusCheck.errorMessage": "エージェントからまだデータを受け取っていません", - "xpack.apm.tutorial.apmAgents.statusCheck.successMessage": "1 つまたは複数のエージェントからデータを受け取りました", - "xpack.apm.tutorial.apmAgents.statusCheck.text": "アプリケーションが実行されていてエージェントがデータを送信していることを確認してください。", - "xpack.apm.tutorial.apmAgents.statusCheck.title": "エージェントステータス", - "xpack.apm.tutorial.apmAgents.title": "APM エージェント", - "xpack.apm.tutorial.apmServer.callOut.message": "ご使用の APM Server を 7.0 以上に更新してあることを確認してください。 Kibana の管理セクションにある移行アシスタントで 6.x データを移行することもできます。", - "xpack.apm.tutorial.apmServer.callOut.title": "重要:7.0 以上に更新中", - "xpack.apm.tutorial.apmServer.fleet.apmIntegration.button": "APM統合", - "xpack.apm.tutorial.apmServer.fleet.manageApmIntegration.button": "FleetでAPM統合を管理", - "xpack.apm.tutorial.apmServer.fleet.message": "APMA統合は、APMデータ用にElasticsearchテンプレートとIngest Nodeパイプラインをインストールします。", - "xpack.apm.tutorial.apmServer.fleet.title": "Elastic APM (ベータ版) がFleetで提供されました。", - "xpack.apm.tutorial.apmServer.statusCheck.btnLabel": "APM Server ステータスを確認", - "xpack.apm.tutorial.apmServer.statusCheck.errorMessage": "APM Server が検出されました。7.0 以上に更新され、動作中であることを確認してください。", - "xpack.apm.tutorial.apmServer.statusCheck.successMessage": "APM Server が正しくセットアップされました", - "xpack.apm.tutorial.apmServer.statusCheck.text": "APM エージェントの導入を開始する前に、APM Server が動作していることを確認してください。", - "xpack.apm.tutorial.apmServer.statusCheck.title": "APM Server ステータス", - "xpack.apm.tutorial.apmServer.title": "APM Server", - "xpack.apm.tutorial.copySnippet": "スニペットをコピー", - "xpack.apm.tutorial.djangoClient.configure.commands.addAgentComment": "インストールされたアプリにエージェントを追加します", - "xpack.apm.tutorial.djangoClient.configure.commands.addTracingMiddlewareComment": "パフォーマンスメトリックを送信するには、追跡ミドルウェアを追加します。", - "xpack.apm.tutorial.djangoClient.configure.commands.allowedCharactersComment": "a-z、A-Z、0-9、-、_、スペース", - "xpack.apm.tutorial.djangoClient.configure.commands.setCustomApmServerUrlComment": "カスタム APM Server URL (デフォルト:{defaultApmServerUrl}) を設定します", - "xpack.apm.tutorial.djangoClient.configure.commands.setRequiredServiceNameComment": "任意のサービス名を設定します。使用できる文字:", - "xpack.apm.tutorial.djangoClient.configure.commands.setServiceEnvironmentComment": "サービス環境を設定します", - "xpack.apm.tutorial.djangoClient.configure.commands.useIfApmServerRequiresTokenComment": "APM Server でシークレットトークンが必要な場合に使います", - "xpack.apm.tutorial.djangoClient.configure.textPost": "高度な用途に関しては [ドキュメンテーション] ({documentationLink}) をご覧ください。", - "xpack.apm.tutorial.djangoClient.configure.textPre": "エージェントとは、アプリケーションプロセス内で実行されるライブラリです。APM サービスは「SERVICE_NAME」に基づいてプログラムで作成されます。", - "xpack.apm.tutorial.djangoClient.configure.title": "エージェントの構成", - "xpack.apm.tutorial.djangoClient.install.textPre": "Python 用の APM エージェントを依存関係としてインストールします。", - "xpack.apm.tutorial.djangoClient.install.title": "APM エージェントのインストール", - "xpack.apm.tutorial.dotNetClient.configureAgent.textPost": "エージェントに「IConfiguration」インスタンスが渡されていない場合、 (例:非 ASP.NET Core アプリケーションの場合) 、エージェントを環境変数で構成することもできます。\n 高度な用途に関しては [ドキュメンテーション] ({documentationLink}) をご覧ください。", - "xpack.apm.tutorial.dotNetClient.configureAgent.title": "appsettings.json ファイルの例:", - "xpack.apm.tutorial.dotNetClient.configureApplication.textPost": "「IConfiguration」インスタンスを渡すのは任意であり、これにより、エージェントはこの「IConfiguration」インスタンス (例:「appsettings.json」ファイル) から構成を読み込みます。", - "xpack.apm.tutorial.dotNetClient.configureApplication.textPre": "「Elastic.Apm.NetCoreAll」パッケージの ASP.NET Core の場合、「Startup.cs」ファイル内の「Configure」メソドの「UseElasticApm」メソドを呼び出します。", - "xpack.apm.tutorial.dotNetClient.configureApplication.title": "エージェントをアプリケーションに追加", - "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.dotNetClient.download.title": "APM エージェントのダウンロード", - "xpack.apm.tutorial.downloadServer.title": "APM Server をダウンロードして展開します", - "xpack.apm.tutorial.downloadServerRpm": "32 ビットパッケージをお探しですか?[ダウンロードページ] ({downloadPageLink}) をご覧ください。", - "xpack.apm.tutorial.downloadServerTitle": "32 ビットパッケージをお探しですか?[ダウンロードページ] ({downloadPageLink}) をご覧ください。", - "xpack.apm.tutorial.editConfig.textPre": "Elastic Stack の X-Pack セキュアバージョンをご使用の場合、「apm-server.yml」構成ファイルで認証情報を指定する必要があります。", - "xpack.apm.tutorial.editConfig.title": "構成を編集する", - "xpack.apm.tutorial.elasticCloudInstructions.title": "APM エージェント", - "xpack.apm.tutorial.flaskClient.configure.commands.allowedCharactersComment": "a-z、A-Z、0-9、-、_、スペース", - "xpack.apm.tutorial.flaskClient.configure.commands.configureElasticApmComment": "またはアプリケーションの設定で ELASTIC_APM を使用するよう構成します。", - "xpack.apm.tutorial.flaskClient.configure.commands.initializeUsingEnvironmentVariablesComment": "環境変数を使用して初期化します", - "xpack.apm.tutorial.flaskClient.configure.commands.setCustomApmServerUrlComment": "カスタム APM Server URL (デフォルト:{defaultApmServerUrl}) を設定します", - "xpack.apm.tutorial.flaskClient.configure.commands.setRequiredServiceNameComment": "任意のサービス名を設定します。使用できる文字:", - "xpack.apm.tutorial.flaskClient.configure.commands.setServiceEnvironmentComment": "サービス環境を設定します", - "xpack.apm.tutorial.flaskClient.configure.commands.useIfApmServerRequiresTokenComment": "APM Server でシークレットトークンが必要な場合に使います", - "xpack.apm.tutorial.flaskClient.configure.textPost": "高度な用途に関しては [ドキュメンテーション] ({documentationLink}) をご覧ください。", - "xpack.apm.tutorial.flaskClient.configure.textPre": "エージェントとは、アプリケーションプロセス内で実行されるライブラリです。APM サービスは「SERVICE_NAME」に基づいてプログラムで作成されます。", - "xpack.apm.tutorial.flaskClient.configure.title": "エージェントの構成", - "xpack.apm.tutorial.flaskClient.install.textPre": "Python 用の APM エージェントを依存関係としてインストールします。", - "xpack.apm.tutorial.flaskClient.install.title": "APM エージェントのインストール", - "xpack.apm.tutorial.goClient.configure.commands.initializeUsingEnvironmentVariablesComment": "環境変数を使用して初期化します:", - "xpack.apm.tutorial.goClient.configure.commands.setCustomApmServerUrlComment": "カスタム APM Server URL (デフォルト:{defaultApmServerUrl}) を設定します", - "xpack.apm.tutorial.goClient.configure.commands.setServiceEnvironment": "サービス環境を設定します", - "xpack.apm.tutorial.goClient.configure.commands.setServiceNameComment": "サービス名を設定します。使用できる文字は # a-z、A-Z、0-9、-、_、スペースです。", - "xpack.apm.tutorial.goClient.configure.commands.usedExecutableNameComment": "ELASTIC_APM_SERVICE_NAME が指定されていない場合、実行ファイルの名前が使用されます。", - "xpack.apm.tutorial.goClient.configure.commands.useIfApmRequiresTokenComment": "APM Server でシークレットトークンが必要な場合に使います", - "xpack.apm.tutorial.goClient.configure.textPost": "高度な構成に関しては [ドキュメンテーション] ({documentationLink}) をご覧ください。", - "xpack.apm.tutorial.goClient.configure.textPre": "エージェントとは、アプリケーションプロセス内で実行されるライブラリです。APM サービスは実行ファイル名または「ELASTIC_APM_SERVICE_NAME」環境変数に基づいてプログラムで作成されます。", - "xpack.apm.tutorial.goClient.configure.title": "エージェントの構成", - "xpack.apm.tutorial.goClient.install.textPre": "Go の APM エージェントパッケージをインストールします。", - "xpack.apm.tutorial.goClient.install.title": "APM エージェントのインストール", - "xpack.apm.tutorial.goClient.instrument.textPost": "Go のソースコードのインストルメンテーションの詳細ガイドは、[ドキュメンテーション] ({documentationLink}) をご覧ください。", - "xpack.apm.tutorial.goClient.instrument.textPre": "提供されたインストルメンテーションモジュールの 1 つ、またはトレーサー API を直接使用して、Go アプリケーションにインストルメンテーションを設定します。", - "xpack.apm.tutorial.goClient.instrument.title": "アプリケーションのインストルメンテーション", - "xpack.apm.tutorial.introduction": "アプリケーション内から詳細なパフォーマンスメトリックやエラーを収集します。", - "xpack.apm.tutorial.javaClient.download.textPre": "[Maven Central] ({mavenCentralLink}) からエージェントをダウンロードします。アプリケーションにエージェントを依存関係として「追加しない」でください。", - "xpack.apm.tutorial.javaClient.download.title": "APM エージェントのダウンロード", - "xpack.apm.tutorial.javaClient.startApplication.textPost": "構成オプションと高度な用途に関しては、[ドキュメンテーション] ({documentationLink}) をご覧ください。", - "xpack.apm.tutorial.javaClient.startApplication.textPre": "「-javaagent」フラグを追加し、システムプロパティを使用してエージェントを構成します。\n\n * 任意のサービス名を設定します (使用可能な文字は a-z、A-Z、0-9、-、_、スペースです) \n * カスタム APM Server URL (デフォルト:{customApmServerUrl}) を設定します\n * APM Server シークレットトークンを設定します\n * サービス環境を設定します\n * アプリケーションのベースパッケージを設定します", - "xpack.apm.tutorial.javaClient.startApplication.title": "javaagent フラグでアプリケーションを起動", - "xpack.apm.tutorial.jsClient.enableRealUserMonitoring.textPre": "デフォルトでは、APM Server を実行すると RUM サポートは無効になります。RUM サポートを有効にする手順については、[ドキュメンテーション] ({documentationLink}) をご覧ください。", - "xpack.apm.tutorial.jsClient.enableRealUserMonitoring.title": "APM Server のリアルユーザー監視サポートを有効にする", - "xpack.apm.tutorial.jsClient.installDependency.commands.setCustomApmServerUrlComment": "カスタム APM Server URL (デフォルト:{defaultApmServerUrl}) を設定します", - "xpack.apm.tutorial.jsClient.installDependency.commands.setRequiredServiceNameComment": "任意のサービス名を設定します (使用可能な文字は a-z、A-Z、0-9、-、_、スペースです) ", - "xpack.apm.tutorial.jsClient.installDependency.commands.setServiceEnvironmentComment": "サービス環境を設定します", - "xpack.apm.tutorial.jsClient.installDependency.commands.setServiceVersionComment": "サービスバージョンを設定します (ソースマップ機能に必要) ", - "xpack.apm.tutorial.jsClient.installDependency.textPost": "React や Angular などのフレームワーク統合には、カスタム依存関係があります。詳細は [統合ドキュメント] ({docLink}) をご覧ください。", - "xpack.apm.tutorial.jsClient.installDependency.textPre": "「npm install @elastic/apm-rum --save」でエージェントをアプリケーションへの依存関係としてインストールできます。\n\nその後で以下のようにアプリケーションでエージェントを初期化して構成できます。", - "xpack.apm.tutorial.jsClient.installDependency.title": "エージェントを依存関係としてセットアップ", - "xpack.apm.tutorial.jsClient.scriptTags.textPre": "または、スクリプトタグを使用してエージェントのセットアップと構成ができます。` を追加